summaryrefslogtreecommitdiff
path: root/usr/src/uts
diff options
context:
space:
mode:
authorvitezslav batrla - Sun Microsystems - Prague Czech Republic <Vitezslav.Batrla@Sun.COM>2009-12-14 11:18:51 +0100
committervitezslav batrla - Sun Microsystems - Prague Czech Republic <Vitezslav.Batrla@Sun.COM>2009-12-14 11:18:51 +0100
commitab5a7454a6d76e82a121d74c74d5589cc3d37a8f (patch)
tree6708f8c16210da25358052311a04605f0e099cad /usr/src/uts
parent26ae4a35171d0fa5abf7e331443c9e589ff9189d (diff)
downloadillumos-joyent-ab5a7454a6d76e82a121d74c74d5589cc3d37a8f.tar.gz
6892920 ata_id_common() is slow on x4150
Diffstat (limited to 'usr/src/uts')
-rw-r--r--usr/src/uts/intel/io/dktp/controller/ata/ata_common.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c b/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c
index 055e572d14..bd0b2e5374 100644
--- a/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c
+++ b/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c
@@ -1678,13 +1678,17 @@ ata_id_common(
}
/*
* Give the drive another second to assert DRQ. Some older
- * drives de-assert BSY before asserting DRQ.
+ * drives de-assert BSY before asserting DRQ. Bail out
+ * immediately if the status becomes 0x7f, which is invalid
+ * value. It can happen when no drive is present.
*/
- if (!ata_wait(io_hdl2, ioaddr2, ATS_DRQ, ATS_BSY, 1000000)) {
- ADBG_WARN(("ata_id_common: !DRQ status 0x%x error 0x%x\n",
- ddi_get8(io_hdl2, (uchar_t *)ioaddr2 +AT_ALTSTATUS),
- ddi_get8(io_hdl1, (uchar_t *)ioaddr1 + AT_ERROR)));
- return (FALSE);
+ if (!ata_wait3(io_hdl2, ioaddr2, ATS_DRQ, ATS_BSY, 0x7f,
+ ATS_BSY, 0x7f, ATS_BSY, 1000000)) {
+ ADBG_WARN(("ata_id_common: "
+ "!DRQ status 0x%x error 0x%x\n",
+ ddi_get8(io_hdl2, (uchar_t *)ioaddr2 +AT_ALTSTATUS),
+ ddi_get8(io_hdl1, (uchar_t *)ioaddr1 + AT_ERROR)));
+ return (FALSE);
}
}
@@ -1701,16 +1705,19 @@ ata_id_common(
/*
* Wait for the drive to recognize I've read all the data.
* Some drives have been observed to take as much as 3msec to
- * deassert DRQ after reading the data; allow 10 msec just in case.
+ * deassert DRQ after reading the data; allow 1 sec just in case.
*
* Note: some non-compliant ATAPI drives (e.g., NEC Multispin 6V,
* CDR-1350A) don't assert DRDY. If we've made it this far we can
* safely ignore the DRDY bit since the ATAPI Packet command
* actually doesn't require it to ever be asserted.
*
+ * Bail out immediately if the status becomes 0x7f, which is invalid
+ * value. It can happen when no drive is present.
+ *
*/
- if (!ata_wait(io_hdl2, ioaddr2, (uchar_t)(expect_drdy ? ATS_DRDY : 0),
- (ATS_BSY | ATS_DRQ), 1000000)) {
+ if (!ata_wait3(io_hdl2, ioaddr2, (uchar_t)(expect_drdy ? ATS_DRDY : 0),
+ (ATS_BSY | ATS_DRQ), 0x7f, ATS_BSY, 0x7f, ATS_BSY, 1000000)) {
ADBG_WARN(("ata_id_common: bad status 0x%x error 0x%x\n",
ddi_get8(io_hdl2, (uchar_t *)ioaddr2 + AT_ALTSTATUS),
ddi_get8(io_hdl1, (uchar_t *)ioaddr1 + AT_ERROR)));