aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-11-19 09:33:11 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:09 -0500
commitb9f8ab2dafba2dc12dd94e5d2db31d5cf495775f (patch)
tree4c6a80d72a1af2c02ab28caa5b0978b0742d4619 /drivers/ata
parentbd3adca52bc43b72c75db3e4c7809d47923b154c (diff)
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 <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9b7f3c477730..3dd0e942df36 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)
4373 tf.feature = SETFEATURES_XFER; 4373 tf.feature = SETFEATURES_XFER;
4374 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING; 4374 tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING;
4375 tf.protocol = ATA_PROT_NODATA; 4375 tf.protocol = ATA_PROT_NODATA;
4376 tf.nsect = dev->xfer_mode; 4376 /* If we are using IORDY we must send the mode setting command */
4377 if (ata_pio_need_iordy(dev))
4378 tf.nsect = dev->xfer_mode;
4379 /* If the device has IORDY and the controller does not - turn it off */
4380 else if (ata_id_has_iordy(dev->id))
4381 tf.nsect = 0x01;
4382 else /* In the ancient relic department - skip all of this */
4383 return 0;
4377 4384
4378 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 4385 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
4379 4386