Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jun 2009 20:56:54 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 163376 for review
Message-ID:  <200906022056.n52Kus3j011649@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163376

Change 163376 by mav@mav_mavbook on 2009/06/02 20:56:08

	Report absent drive via CAM_SEL_TIMEOUT error on any command,
	same as SCSI. ATA unable to determine that error type so fast,
	so use scan info for this.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#11 edit

Differences ...

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

@@ -1668,6 +1668,12 @@
 	/* Common cases first */
 	case XPT_ATA_IO:	/* Execute the requested I/O operation */
 	case XPT_SCSI_IO:
+		if ((((ATA_ATA_MASTER | ATA_ATAPI_MASTER) <<
+		    ccb->ccb_h.target_id) & ch->devices) == 0) {
+			ccb->ccb_h.status = CAM_SEL_TIMEOUT;
+			xpt_done(ccb);
+			break;
+		}
 		ahci_begin_transaction(ch->dev, ccb);
 		break;
 	case XPT_EN_LUN:		/* Enable LUN as a target */
@@ -1744,10 +1750,6 @@
 	{
 		struct ccb_pathinq *cpi = &ccb->cpi;
 
-		if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD ||
-		    (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) <<
-			ccb->ccb_h.target_id) & ch->devices)) {
-
 		cpi->version_num = 1; /* XXX??? */
 		cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE;
 		cpi->target_sprt = 0;
@@ -1764,15 +1766,12 @@
 		cpi->unit_number = cam_sim_unit(sim);
 		cpi->transport = XPORT_ATA;
 		cpi->transport_version = 2;
-		if ((ATA_ATA_MASTER << ccb->ccb_h.target_id) & ch->devices)
+		if ((ATA_ATAPI_MASTER << ccb->ccb_h.target_id) & ch->devices)
+			cpi->protocol = PROTO_SCSI;
+		else
 			cpi->protocol = PROTO_ATA;
-		else
-			cpi->protocol = PROTO_SCSI;
 		cpi->protocol_version = SCSI_REV_2;
 		cpi->ccb_h.status = CAM_REQ_CMP;
-		} else {
-		    ccb->ccb_h.status = CAM_REQ_INVALID;
-		}
 		xpt_done(ccb);
 		break;
 	}



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