summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo2007-02-07 21:37:41 +0100
committerJeff Garzik2007-02-16 00:04:01 +0100
commit81afe893181b283f9d182ea8637ce6ccdbe1a56a (patch)
tree2a86298615d17c73cfdf23d4c575e0a7bb0fbc39 /drivers/ata/libata-core.c
parentlibata: Add a host flag to indicate lack of IORDY capability (diff)
downloadkernel-qcow2-linux-81afe893181b283f9d182ea8637ce6ccdbe1a56a.tar.gz
kernel-qcow2-linux-81afe893181b283f9d182ea8637ce6ccdbe1a56a.tar.xz
kernel-qcow2-linux-81afe893181b283f9d182ea8637ce6ccdbe1a56a.zip
libata: clear TF before IDENTIFYing
Some devices chock if Feature is not clear when IDENTIFY is issued. Set ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE for IDENTIFY such that whole TF is cleared when reading ID data. Kudos to Art Haas for testing various futile patches over several months and Mark Lord for pointing out the fix. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Art Haas <ahaas@airmail.net> Cc: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 25d8d3f778a1..2cf8251728d2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1410,7 +1410,16 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
}
tf.protocol = ATA_PROT_PIO;
- tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */
+
+ /* Some devices choke if TF registers contain garbage. Make
+ * sure those are properly initialized.
+ */
+ tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
+
+ /* Device presence detection is unreliable on some
+ * controllers. Always poll IDENTIFY if available.
+ */
+ tf.flags |= ATA_TFLAG_POLLING;
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE,
id, sizeof(id[0]) * ATA_ID_WORDS);