]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: disable DMA in ->ide_dma_check for "no IORDY" case (v2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 17 Feb 2007 01:40:25 +0000 (02:40 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 17 Feb 2007 01:40:25 +0000 (02:40 +0100)
If DMA is unsupported ->ide_dma_check should disable DMA.

v2:
* updated for scc_pata

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 files changed:
drivers/ide/pci/aec62xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/tc86c001.c
drivers/ide/ppc/scc_pata.c

index 30f8de6176dddf6c498b013026be8954c0bc2efe..25892814b314c278e984ca630809eb1d94705313 100644 (file)
@@ -214,12 +214,10 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                aec62xx_tune_drive(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static int aec62xx_irq_timeout (ide_drive_t *drive)
index dfc738c42228f0126184a29b01d85daf2f3718eb..6d372c4e1d815ecaa00dedef3a51aa6e54020a80 100644 (file)
@@ -264,10 +264,9 @@ static int atiixp_dma_check(ide_drive_t *drive)
                tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
                speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
                hwif->speedproc(drive, speed);
-               return hwif->ide_dma_off_quietly(drive);
        }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /**
index a76451a074c6b9a13102660e8a367462ad36f29b..28f58088669338dcb1c8df9205484f09e3fccb65 100644 (file)
@@ -479,12 +479,10 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive, 1);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static int cmd64x_alt_dma_status (struct pci_dev *dev)
index e47653f4d1dd2881bbe0714a889b46654398d819..cd7c4190ad6e375c571a2007a269f0e6f891c61b 100644 (file)
@@ -206,10 +206,9 @@ static int cs5535_dma_check(ide_drive_t *drive)
        if (ide_use_fast_pio(drive)) {
                speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
                cs5535_set_drive(drive, speed);
-               return hwif->ide_dma_off_quietly(drive);
        }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
index 0830089c77fd547938474b9fe138dbe14a6c35df..c65971d8d6adc3e50df095f7eb078d9c59e0ef3e 100644 (file)
@@ -120,12 +120,10 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
                return hwif->ide_dma_on(drive);
 #endif
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                hpt34x_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /*
index eccf29f7f89d281a2b4775c2f892bdd8f1090320..752b6d6dde040adb7322e0dad59fb62b2bd2f213 100644 (file)
@@ -743,12 +743,10 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                hpt3xx_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /*
index 32f37e4c129297931f1c7940f6c38408c9c58e22..b780e15e9f321e2c92731efd0b0f8307dfa43c64 100644 (file)
@@ -288,12 +288,10 @@ static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                hwif->tuneproc(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static int pdcnew_quirkproc(ide_drive_t *drive)
index d3be342e516232a4e58772bb589b935e7f9d50d9..b2b8e6ea7e90a718ca1c6bcb51ace2030f9f72a6 100644 (file)
@@ -329,12 +329,10 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                pdc202xx_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static int pdc202xx_quirkproc (ide_drive_t *drive)
index 85e8a78e10ad81f6538f7ce7870174d1b3cd3760..caf606a1ee8695f6016e84c79165845fe37a3d77 100644 (file)
@@ -393,14 +393,12 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                /* Find best PIO mode. */
                (void) hwif->speedproc(drive, XFER_PIO_0 +
                                       ide_get_best_pio_mode(drive, 255, 4, NULL));
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /**
index 36decbe3afcb6e78d72ce749cee8604c2d6a4832..f44a5ab8fe00f5f4766ebc77405e2352850d62ad 100644 (file)
@@ -322,13 +322,10 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive);
-               //      hwif->tuneproc(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name)
index 40e992af000533a97eb46d44f166d16abcda8f65..1e5b8b17e6d8ef4f8ba9ba8cc57b08745c1b3671 100644 (file)
@@ -419,12 +419,10 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                config_chipset_for_pio(drive, 1);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /* returns 1 if dma irq issued, 0 otherwise */
index 4fff663a643209e56caafda2d71993abc6787af4..53ffeced06ff9e63fd33f6af81a3e7828bf03ef9 100644 (file)
@@ -678,12 +678,10 @@ static int sis5513_config_xfer_rate(ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                sis5513_tune_drive(drive, 5);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /* Chip detection and general config */
index 4042fd8e2308688b56bdc14bb1d8f80e371c63ff..917cc8e61e47d0d63a2d6cb9cf2f336b1fa7c645 100644 (file)
@@ -186,13 +186,11 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                (void) hwif->speedproc(drive, XFER_PIO_0 +
                                       ide_get_best_pio_mode(drive, 255, 4, NULL));
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
index b408508a96eee6de590cf1af91c83c7ed9e30aae..3703fc87d150c5f86126982116c6d575988e4e14 100644 (file)
@@ -190,12 +190,10 @@ static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_use_dma(drive) && config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                tc86c001_tune_drive(drive, 255);
-               return hwif->ide_dma_off_quietly(drive);
-       }
-       /* IORDY not supported */
-       return 0;
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
index f05117e8fdb955dd56a157b0c8454bfc19acd777..7e3e93caafd0030e51f83dae00f51fa914a68d9f 100644 (file)
@@ -376,11 +376,10 @@ static int scc_config_drive_for_dma(ide_drive_t *drive)
        if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive))
                return hwif->ide_dma_on(drive);
 
-       if (ide_use_fast_pio(drive)) {
+       if (ide_use_fast_pio(drive))
                hwif->tuneproc(drive, 4);
-               hwif->ide_dma_off_quietly(drive);
-       }
-       return 1; /* DMA is not supported */
+
+       return hwif->ide_dma_off_quietly(drive);
 }
 
 /**