summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-04-21 07:26:14 +0000
committermav <mav@FreeBSD.org>2011-04-21 07:26:14 +0000
commitc59fbe15cedaa28ca9b79710939351a3281394b9 (patch)
treedf9562cd0e11cbde116770a3828e3c01b86b45dd
parent6ea4b2e0af6b400b92646e0e08d615a9af0faab2 (diff)
downloadFreeBSD-src-c59fbe15cedaa28ca9b79710939351a3281394b9.zip
FreeBSD-src-c59fbe15cedaa28ca9b79710939351a3281394b9.tar.gz
Make PATA-like soft-reset in ata(4) more strict in checking disk signature.
It allows to avoid false positive device detection under Xen, that caused long probe delays due to subsequent IDENTIFY command timeouts. MFC after: 1 month
-rw-r--r--sys/dev/ata/ata-lowlevel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 2234efb..81cc87b 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -535,7 +535,7 @@ ata_generic_reset(device_t dev)
if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
ch->devices |= ATA_ATAPI_MASTER;
}
- else if (stat0 & ATA_S_READY) {
+ else if (lsb == 0 && msb == 0 && (stat0 & ATA_S_READY)) {
ch->devices |= ATA_ATA_MASTER;
}
}
@@ -568,7 +568,7 @@ ata_generic_reset(device_t dev)
if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
ch->devices |= ATA_ATAPI_SLAVE;
}
- else if (stat1 & ATA_S_READY) {
+ else if (lsb == 0 && msb == 0 && (stat1 & ATA_S_READY)) {
ch->devices |= ATA_ATA_SLAVE;
}
}
OpenPOWER on IntegriCloud