From owner-svn-src-head@freebsd.org Fri Aug 10 19:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B95810727F6; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 115EB76EA2; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0D274887; Fri, 10 Aug 2018 19:19:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJJ8xt060456; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJJ87w060452; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808101919.w7AJJ87w060452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 Aug 2018 19:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337583 - in head/sys/cam: . ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata nvme scsi X-SVN-Commit-Revision: 337583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 19:19:09 -0000 Author: cem Date: Fri Aug 10 19:19:07 2018 New Revision: 337583 URL: https://svnweb.freebsd.org/changeset/base/337583 Log: Walk back r337554 while discussion continues The idea was to get the uncontroversial mechanical change out of the way, then get the meatier functional changes reviewed subsequently. I had not realized that the immediately adjacent issue was addressed in a different direction in r334506 (see Warner's guidance in D15592). Discussion continues, trying to determine if there is a secondary issue still[1] and how best to fix it. With 12-related activities coming up, while that is ongoing, just take this back for now. [1]: Shutdown-time eventhandler events fire normally during panic's reboot path. Driver callbacks that attempt to issue and wait on interrupt- completed IO may never complete, hanging the system. This is particularly obnoxious in the shutdown/panic path, as the debugger cannot be entered anymore and the hang prevents reboot restoring availability. (There's nothing CAM-specific about this problem -- any shutdown event-triggered driver could do something like this during panic. But most NICs, etc. don't try to send spin-down commands at shutdown. ;-)) Discussed with: imp, markj Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/ata/ata_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1081,7 +1081,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical (u_int8_t *) virtual, length, ada_default_timeout*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { @@ -1116,7 +1115,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical NULL, 0, 5*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); @@ -3501,7 +3499,6 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); - local_ccb.ccb_h.xflags |= CAM_CCB_DUMP; ata_28bit_cmd(&local_ccb, cmd, 0, 0, 0); error = cam_periph_runccb((union ccb *)&local_ccb, adaerror, /*cam_flags*/0, /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/cam_ccb.h Fri Aug 10 19:19:07 2018 (r337583) @@ -116,8 +116,7 @@ typedef enum { typedef enum { CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000008,/* use unmapped I/O */ - CAM_CCB_DUMP = 0x00000010,/* polled ccb during dump */ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/nvme/nvme_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -426,7 +426,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -440,7 +439,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/scsi/scsi_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1847,7 +1847,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -1870,7 +1869,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*lb_count*/0, SSD_FULL_SIZE, 5 * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0)