svn commit: r207222 - head/sys/cam/ata

Alexander Motin mav at FreeBSD.org
Mon Apr 26 12:03:55 UTC 2010


Author: mav
Date: Mon Apr 26 12:03:55 2010
New Revision: 207222
URL: http://svn.freebsd.org/changeset/base/207222

Log:
  MFp4:
  Move PI_TAG_ABLE check from ada driver to ATA XPT.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Mon Apr 26 11:58:15 2010	(r207221)
+++ head/sys/cam/ata/ata_da.c	Mon Apr 26 12:03:55 2010	(r207222)
@@ -686,14 +686,10 @@ adaregister(struct cam_periph *periph, v
 	else
 		softc->quirks = ADA_Q_NONE;
 
-	/* Check if the SIM does not want queued commands */
 	bzero(&cpi, sizeof(cpi));
 	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
-	if (cpi.ccb_h.status != CAM_REQ_CMP ||
-	    (cpi.hba_inquiry & PI_TAG_ABLE) == 0)
-		softc->flags &= ~ADA_FLAG_CAN_NCQ;
 
 	TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph);
 

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Mon Apr 26 11:58:15 2010	(r207221)
+++ head/sys/cam/ata/ata_xpt.c	Mon Apr 26 12:03:55 2010	(r207222)
@@ -766,6 +766,7 @@ noerror:
 	}
 	case PROBE_IDENTIFY:
 	{
+		struct ccb_pathinq cpi;
 		int16_t *ptr;
 
 		ident_buf = &softc->ident_data;
@@ -840,16 +841,24 @@ noerror:
 		ata_find_quirk(path->device);
 		if (path->device->mintags != 0 &&
 		    path->bus->sim->max_tagged_dev_openings != 0) {
-			/* Report SIM which tags are allowed. */
-			bzero(&cts, sizeof(cts));
-			xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE);
-			cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-			cts.type = CTS_TYPE_CURRENT_SETTINGS;
-			cts.xport_specific.sata.tags = path->device->maxtags;
-			cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS;
-			xpt_action((union ccb *)&cts);
-			/* Reconfigure queues for tagged queueing. */
-			xpt_start_tags(path);
+			/* Check if the SIM does not want queued commands. */
+			bzero(&cpi, sizeof(cpi));
+			xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE);
+			cpi.ccb_h.func_code = XPT_PATH_INQ;
+			xpt_action((union ccb *)&cpi);
+			if (cpi.ccb_h.status == CAM_REQ_CMP &&
+			    (cpi.hba_inquiry & PI_TAG_ABLE)) {
+				/* Report SIM which tags are allowed. */
+				bzero(&cts, sizeof(cts));
+				xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE);
+				cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
+				cts.type = CTS_TYPE_CURRENT_SETTINGS;
+				cts.xport_specific.sata.tags = path->device->maxtags;
+				cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS;
+				xpt_action((union ccb *)&cts);
+				/* Reconfigure queues for tagged queueing. */
+				xpt_start_tags(path);
+			}
 		}
 		ata_device_transport(path);
 		PROBE_SET_ACTION(softc, PROBE_SETMODE);


More information about the svn-src-all mailing list