Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2009 09:38:54 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 164325 for review
Message-ID:  <200906140938.n5E9csID086887@repoman.freebsd.org>

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

Change 164325 by mav@mav_mavbook on 2009/06/14 09:38:08

	Look on error status while polling for reset.
	It allows to reduce waiting in some cases.

Affected files ...

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

Differences ...

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

@@ -1085,10 +1085,20 @@
 			DELAY(1000);
 			if (!(ATA_INL(ch->r_mem, AHCI_P_CI) & (1 << slot->slot)))
 				break;
+			if (ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) {
+				device_printf(ch->dev,
+				    "Poll error on slot %d, TFD: %04x\n",
+				    slot->slot, ATA_INL(ch->r_mem, AHCI_P_TFD));
+				et = AHCI_ERR_REAL;
+				break;
+			}
 		}
 		if (timeout && (count >= timeout)) {
-device_printf(ch->dev, "Poll timeout on slot %d\n", slot->slot);
+			device_printf(ch->dev,
+			    "Poll timeout on slot %d\n", slot->slot);
 			et = CAM_CMD_TIMEOUT;
+		}
+		if (et != AHCI_ERR_NONE) {
 			/* Kick controller into sane state */
 			ahci_stop(ch->dev);
 			ahci_clo(ch->dev);



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