Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2018 21:53:32 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337554 - in head/sys/cam: . ata nvme scsi
Message-ID:  <201808092153.w79LrWEZ097986@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Thu Aug  9 21:53:32 2018
New Revision: 337554
URL: https://svnweb.freebsd.org/changeset/base/337554

Log:
  cam(4): Add an xpt-neutral flag indicating a valid panic CCB
  
  No functional change.
  
  Note that this change is careful to set the CCB header xflags after
  foo_fill_bar() routines, which generally zero existing flags.  An earlier
  version of this patch mistakenly set the flag before the fill routines.
  
  Submitted by:	Scott Ferris <sferris AT isilon.com>, jhibbits@
  Reviewed by:	bdrewery@, markj@, and non-committer FreeBSD contributor Anton Rang
  Sponsored by:	Dell EMC Isilon

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	Thu Aug  9 21:52:51 2018	(r337553)
+++ head/sys/cam/ata/ata_da.c	Thu Aug  9 21:53:32 2018	(r337554)
@@ -1081,6 +1081,7 @@ 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)) {
@@ -1115,6 +1116,7 @@ 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);
@@ -3499,6 +3501,7 @@ 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	Thu Aug  9 21:52:51 2018	(r337553)
+++ head/sys/cam/cam_ccb.h	Thu Aug  9 21:53:32 2018	(r337554)
@@ -116,7 +116,8 @@ 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_UNMAPPED_BUF	= 0x00000008,/* use unmapped I/O */
+	CAM_CCB_DUMP		= 0x00000010,/* polled ccb during dump */
 } ccb_xflags;
 
 /* XPT Opcodes for xpt_action */

Modified: head/sys/cam/nvme/nvme_da.c
==============================================================================
--- head/sys/cam/nvme/nvme_da.c	Thu Aug  9 21:52:51 2018	(r337553)
+++ head/sys/cam/nvme/nvme_da.c	Thu Aug  9 21:53:32 2018	(r337554)
@@ -426,6 +426,7 @@ 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)
@@ -439,6 +440,7 @@ 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	Thu Aug  9 21:52:51 2018	(r337553)
+++ head/sys/cam/scsi/scsi_da.c	Thu Aug  9 21:53:32 2018	(r337554)
@@ -1847,6 +1847,7 @@ 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)
@@ -1869,6 +1870,7 @@ 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808092153.w79LrWEZ097986>