]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ide/pci/serverworks.c: Fix corruption/timeouts with MegaIDE
authorAlan Cox <alan@redhat.com>
Thu, 24 May 2007 00:42:38 +0000 (02:42 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 24 May 2007 00:42:38 +0000 (02:42 +0200)
It turns out from customer reports to Red Hat and some PCI dumps that the
MegaIDE in RAID mode doesn't provide the drive tuning data that the
serverworks driver expects but sometimes does provide something that
fools the code.

For the RAID class case skip the oem setup and don't trust the BIOS data.
We then tune from scratch and this sorts it out. (This has been confirmed
on an afflicted IBM blade)

[libata serverworks.c never trusts the BIOS in the first place so is
accidentally immune]

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/serverworks.c

index 6234f806c6b5caa6d264d52371dbc69fa2405f8d..1f80c6d58805b1fb2d2f5fad997689d10264c332 100644 (file)
@@ -158,6 +158,12 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
        pci_read_config_word(dev, 0x4A, &csb5_pio);
        pci_read_config_byte(dev, 0x54, &ultra_enable);
 
+       /* If we are in RAID mode (eg AMI MegaIDE) then we can't it
+          turns out trust the firmware configuration */
+
+       if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
+               goto oem_setup_failed;
+
        /* Per Specified Design by OEM, and ASIC Architect */
        if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
            (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {