PERFORCE change 177184 for review

Alexander Motin mav at FreeBSD.org
Wed Apr 21 19:04:18 UTC 2010


http://p4web.freebsd.org/@@177184?ac=10

Change 177184 by mav at mav_mavtest on 2010/04/21 19:03:52

	Do not allow NCQ for Gen-II chips when PMP attached.
	It works, but extremely slow.
	
	Move PI_TAG_ABLE check from ada driver to ATA XPT, as it should be.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#51 edit
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#84 edit
.. //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#7 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#51 (text+ko) ====

@@ -686,14 +686,10 @@
 	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);
 

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#84 (text+ko) ====

@@ -766,6 +766,7 @@
 	}
 	case PROBE_IDENTIFY:
 	{
+		struct ccb_pathinq cpi;
 		int16_t *ptr;
 
 		ident_buf = &softc->ident_data;
@@ -840,16 +841,24 @@
 		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);

==== //depot/projects/scottl-camlock/src/sys/dev/mvs/mvs.c#7 (text+ko) ====

@@ -566,7 +566,7 @@
 	/* Construct SIM entry */
 	ch->sim = cam_sim_alloc(mvsaction, mvspoll, "mvsch", ch,
 	    device_get_unit(dev), &ch->mtx,
-	    MVS_MAX_SLOTS - 1, (ch->quirks & MVS_Q_GENI) ? 0 : MVS_MAX_SLOTS - 1,
+	    2, (ch->quirks & MVS_Q_GENI) ? 0 : MVS_MAX_SLOTS - 1,
 	    devq);
 	if (ch->sim == NULL) {
 		device_printf(dev, "unable to allocate sim\n");
@@ -1353,7 +1353,7 @@
 	}
 	bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map,
 	    BUS_DMASYNC_PREREAD);
-	if (cin_idx == in_idx) {
+	if (cin_idx == ch->in_idx) {
 		ATA_OUTL(ch->r_mem, EDMA_RESQOP,
 		    ch->dma.workrp_bus | (cin_idx << EDMA_RESQP_ERPQP_SHIFT));
 	}
@@ -2435,8 +2435,12 @@
 
 		cpi->version_num = 1; /* XXX??? */
 		cpi->hba_inquiry = PI_SDTR_ABLE;
-		if (!(ch->quirks & MVS_Q_GENI))
-			cpi->hba_inquiry |= PI_TAG_ABLE | PI_SATAPM;
+		if (!(ch->quirks & MVS_Q_GENI)) {
+			cpi->hba_inquiry |= PI_SATAPM;
+			/* Gen-II is extremely slow with NCQ on PMP. */
+			if ((ch->quirks & MVS_Q_GENIIE) || ch->pm_present == 0)
+				cpi->hba_inquiry |= PI_TAG_ABLE;
+		}
 		cpi->target_sprt = 0;
 		cpi->hba_misc = PIM_SEQSCAN;
 		cpi->hba_eng_cnt = 0;


More information about the p4-projects mailing list