PERFORCE change 166591 for review

Alexander Motin mav at FreeBSD.org
Sun Jul 26 17:29:33 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166591

Change 166591 by mav at mav_mavbook on 2009/07/26 17:29:04

	Some scan related tuning.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#5 edit
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#31 edit
.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#16 edit

Differences ...

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

@@ -247,11 +247,12 @@
 	case AC_BUS_RESET:
 		softc = (struct pmp_softc *)periph->softc;
 		cam_periph_async(periph, code, path, arg);
+		if (softc->state != PMP_STATE_NORMAL)
+			break;
 		if (code == AC_SENT_BDR || code == AC_BUS_RESET)
 			softc->found = 0; /* We have to reset everything. */
-		else if (softc->state != PMP_STATE_NORMAL)
-			break;
 		softc->state = PMP_STATE_PORTS;
+		(void)cam_periph_hold(periph, PRIBIO);
 		xpt_schedule(periph, CAM_PRIORITY_BUS);
 		break;
 	default:
@@ -347,7 +348,7 @@
 	 * to finish the probe.  The reference will be dropped in pmpdone at
 	 * the end of probe.
 	 */
-//	(void)cam_periph_hold(periph, PRIBIO);
+	(void)cam_periph_hold(periph, PRIBIO);
 	xpt_schedule(periph, CAM_PRIORITY_BUS);
 
 	return(CAM_REQ_CMP);
@@ -680,6 +681,7 @@
 	default:
 		break;
 	}
+	cam_periph_unhold(periph);
 	softc->state = PMP_STATE_NORMAL;
 }
 

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

@@ -261,10 +261,9 @@
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
-	if (periph->path->device->flags & CAM_DEV_UNCONFIGURED)
+	if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) ||
+	    periph->path->device->protocol == PROTO_SATAPM)
 		PROBE_SET_ACTION(softc, PROBE_RESET);
-	else if (periph->path->device->protocol == PROTO_SATAPM)
-		PROBE_SET_ACTION(softc, PROBE_PM_PID);
 	else
 		PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
 
@@ -273,7 +272,7 @@
 	else
 		softc->flags &= ~PROBE_NO_ANNOUNCE;
 
-	xpt_schedule(periph, ccb->ccb_h.pinfo.priority);
+	xpt_schedule(periph, CAM_PRIORITY_HOST);
 }
 
 static void
@@ -282,7 +281,6 @@
 	/* Probe the device that our peripheral driver points to */
 	struct ccb_ataio *ataio;
 	struct ccb_scsiio *csio;
-	struct ccb_trans_settings cts;
 	probe_softc *softc;
 
 	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n"));
@@ -293,17 +291,6 @@
 
 	switch (softc->action) {
 	case PROBE_RESET:
-		if (start_ccb->ccb_h.target_id == 15) {
-			/* Report SIM that we have no knowledge about PM presence. */
-			bzero(&cts, sizeof(cts));
-			xpt_setup_ccb(&cts.ccb_h, start_ccb->ccb_h.path,
-			    CAM_PRIORITY_NORMAL);
-			cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-			cts.type = CTS_TYPE_CURRENT_SETTINGS;
-			cts.xport_specific.sata.pm_present = 0;
-			cts.xport_specific.sata.valid = CTS_SATA_VALID_PM;
-			xpt_action((union ccb *)&cts);
-		}
 		cam_fill_ataio(ataio,
 		      0,
 		      probedone,
@@ -598,9 +585,7 @@
 					xpt_print(path,
 					    "Unexpected signature 0x%04x\n", sign);
 				}
-				found = 0;
-				xpt_release_ccb(done_ccb);
-				break;
+				goto device_fail;
 			}
 			xpt_release_ccb(done_ccb);
 			xpt_schedule(periph, priority);
@@ -710,7 +695,6 @@
 		 * drivers that this device is no more.
 		 */
 		if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
-			/* Send the async notification. */
 			xpt_async(AC_LOST_DEVICE, path, NULL);
 		found = 0;
 		xpt_release_ccb(done_ccb);

==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#16 (text+ko) ====

@@ -667,7 +667,7 @@
 	else
 		softc->flags &= ~PROBE_NO_ANNOUNCE;
 
-	xpt_schedule(periph, ccb->ccb_h.pinfo.priority);
+	xpt_schedule(periph, CAM_PRIORITY_HOST);
 }
 
 static void


More information about the p4-projects mailing list