ide: remove ide_use_fast_pio()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)
Remove ide_use_fast_pio() and just re-tune PIO unconditionally if DMA tuning
has failed in ->ide_dma_check.  All host drivers using ide_use_fast_pio() set
drive->autotune so PIO is always tuned anyway and in some cases we _really_
need to re-tune PIO because PIO and DMA timings are shared.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 files changed:
drivers/ide/ide-lib.c
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/scc_pata.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
include/linux/ide.h

index 0e2562f..af86433 100644 (file)
@@ -96,21 +96,6 @@ static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
        return min(speed, mode);
 }
 
-int ide_use_fast_pio(ide_drive_t *drive)
-{
-       struct hd_driveid *id = drive->id;
-
-       if ((id->capability & 1) && drive->autodma)
-               return 1;
-
-       if ((id->capability & 8) || (id->field_valid & 2))
-               return 1;
-
-       return 0;
-}
-
-EXPORT_SYMBOL_GPL(ide_use_fast_pio);
-
 /*
  * Standard (generic) timings for PIO modes, from ATA2 specification.
  * These timings are for access to the IDE data port register *only*.
index 2e82ef5..91bf5be 100644 (file)
@@ -146,8 +146,7 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 644f4ae..b457df8 100644 (file)
@@ -171,8 +171,7 @@ static int atiixp_dma_check(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index d50f15e..52790cb 100644 (file)
@@ -335,8 +335,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 896cc92..2a72b4f 100644 (file)
@@ -162,8 +162,7 @@ static int cs5535_dma_check(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index bccf066..6972488 100644 (file)
@@ -85,8 +85,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return -1;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index a8097b5..992b60e 100644 (file)
@@ -718,8 +718,7 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index c3a7512..9767232 100644 (file)
@@ -228,8 +228,7 @@ static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 9847a4f..b2c7b6e 100644 (file)
@@ -184,8 +184,7 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 4dd1b6d..dcb0701 100644 (file)
@@ -267,8 +267,7 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 67f06dd..f839bde 100644 (file)
@@ -299,8 +299,7 @@ static int scc_config_drive_for_dma(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index b7076f4..4666e4c 100644 (file)
@@ -201,8 +201,7 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index ce77849..8be36f3 100644 (file)
@@ -326,8 +326,7 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 99fe0b6..5458c56 100644 (file)
@@ -606,8 +606,7 @@ static int sis5513_config_xfer_rate(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 38da065..41c5c57 100644 (file)
@@ -135,8 +135,7 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 840415d..e66e788 100644 (file)
@@ -167,8 +167,7 @@ static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive)
        if (ide_tune_dma(drive))
                return 0;
 
-       if (ide_use_fast_pio(drive))
-               ide_set_max_pio(drive);
+       ide_set_max_pio(drive);
 
        return -1;
 }
index 30a1931..86c5907 100644 (file)
@@ -1380,7 +1380,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
 extern char *ide_xfer_verbose(u8 xfer_rate);
 extern void ide_toggle_bounce(ide_drive_t *drive, int on);
 extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
-int ide_use_fast_pio(ide_drive_t *);
 
 static inline int ide_dev_has_iordy(struct hd_driveid *id)
 {