Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81afe893181b283f9d182ea8637ce6ccdbe1a56a
Commit:     81afe893181b283f9d182ea8637ce6ccdbe1a56a
Parent:     f834e49f1a09414e9618ff0c9cd83c2114032bb6
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 7 12:37:41 2007 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Thu Feb 15 18:04:01 2007 -0500

    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 <[EMAIL PROTECTED]>
    Cc: Art Haas <[EMAIL PROTECTED]>
    Cc: Mark Lord <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 25d8d3f..2cf8251 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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to