diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-07-31 09:01:48 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:32 -0400 |
commit | 0bc2a79a2002e3cc1b514c100b6c576983da6a90 (patch) | |
tree | 7669cfe54f3cf5125be440c5c9e84d29cec27294 /drivers | |
parent | e3667ebf857ba744b5211c90d46f6a17dd9a2479 (diff) |
libata: Correct IORDY handling
Debugging a report of a problem with an ancient solid state disk showed
up some problems in the IORDY handling
1. We check the wrong bit to see if the device has IORDY
2. Even then some ancient creaking piles of crap don't support
SETXFER at all.
The cases it fixes are obscure and the risk of side effects is slight
but possible. This also moves us slightly closer to supporting original
MFM/RLL disks with libata.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8a79b976f08a..02425e401a6d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2759,7 +2759,11 @@ static int ata_dev_set_mode(struct ata_device *dev) | |||
2759 | /* Old CFA may refuse this command, which is just fine */ | 2759 | /* Old CFA may refuse this command, which is just fine */ |
2760 | if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id)) | 2760 | if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id)) |
2761 | err_mask &= ~AC_ERR_DEV; | 2761 | err_mask &= ~AC_ERR_DEV; |
2762 | 2762 | /* Some very old devices and some bad newer ones fail any kind of | |
2763 | SET_XFERMODE request but support PIO0-2 timings and no IORDY */ | ||
2764 | if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) && | ||
2765 | dev->pio_mode <= XFER_PIO_2) | ||
2766 | err_mask &= ~AC_ERR_DEV; | ||
2763 | if (err_mask) { | 2767 | if (err_mask) { |
2764 | ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " | 2768 | ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " |
2765 | "(err_mask=0x%x)\n", err_mask); | 2769 | "(err_mask=0x%x)\n", err_mask); |