]> err.no Git - linux-2.6/blobdiff - drivers/ata/libata-core.c
pata_ninja32: Cardbus ATA initial support
[linux-2.6] / drivers / ata / libata-core.c
index 9b7f3c4777302fca776eacc89a93bba4b11438eb..3dd0e942df363c0762bd3605f0cc6184a07af8e4 100644 (file)
@@ -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);