Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9f8ab2dafba2dc12dd94e5d2db31d5cf495775f
Commit:     b9f8ab2dafba2dc12dd94e5d2db31d5cf495775f
Parent:     bd3adca52bc43b72c75db3e4c7809d47923b154c
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 14:33:11 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Wed Jan 23 05:24:09 2008 -0500

    libata: IORDY handling
    
    I believe this version meets all Sergei's objections
    
    Correct the logic for when we issue a set features for transfer mode
    
    - If the device has IORDY and the controller has IORDY - set the mode
    - If the device has IORDY and the controller does not - turn IORDY off
    - If neither has IORDY do nothing
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9b7f3c4..3dd0e94 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4373,7 +4373,14 @@ static unsigned int ata_dev_set_xfermode(struct 
ata_device *dev)
        tf.feature = SETFEATURES_XFER;
        tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING;
        tf.protocol = ATA_PROT_NODATA;
-       tf.nsect = dev->xfer_mode;
+       /* If we are using IORDY we must send the mode setting command */
+       if (ata_pio_need_iordy(dev))
+               tf.nsect = dev->xfer_mode;
+       /* If the device has IORDY and the controller does not - turn it off */
+       else if (ata_id_has_iordy(dev->id))
+               tf.nsect = 0x01;
+       else /* In the ancient relic department - skip all of this */
+               return 0;
 
        err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
 
-
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