diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-11 17:53:59 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-11 17:53:59 -0400 |
commit | a8028fcb485522c0d7de9c5423812de9224b37c9 (patch) | |
tree | ffc5d22dab4fcb3abbbf83e9a1fefa792425b116 /drivers | |
parent | 851dd33bcf23655eede62730c029e4f608f4084f (diff) |
ide: add missing ide_rate_filter() calls to ->speedproc()-s
* Fix icside, cris-ide, au1xxx-ide, amd74xx, via82cxxx and pmac host drivers
to use ide_rate_filter().
This results in the following modes (from user requests) being clipped down:
- invalid modes (values 0x46-0xFF) [ for all hosts ]
- unsupported by a host UDMA modes [ for hosts which support UDMA]
- all UDMA modes and MWDMA3-4 modes [ for hosts which don't support UDMA ]
- invalid modes (values 0x25-0x39) [ for hosts which don't support UDMA ]
* Host driver specific changes in behavior:
icside:
- no change
cris-ide
- clip unsupported UDMA3-6 modes down
- fix BUG() on trying to set unsupported UDMA3-6 modes
au1xxx-ide/pmac
- clip unsupported UDMA modes down
amd74xx/via82cxxx
- clip unsupported UDMA modes down
- fix random PIO timings being set for unsupported/invalid modes
- fix unsupported/invalid modes being set on the device
* While at it remove no longer needed checks from pmac.c driver.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/arm/icside.c | 3 | ||||
-rw-r--r-- | drivers/ide/cris/ide-cris.c | 2 | ||||
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 2 | ||||
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 2 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 10 |
6 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 8a9b98fcb66d..28f910b5aa5d 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -255,8 +255,7 @@ static int icside_set_speed(ide_drive_t *drive, u8 xfer_mode) | |||
255 | /* | 255 | /* |
256 | * Limit the transfer speed to MW_DMA_2. | 256 | * Limit the transfer speed to MW_DMA_2. |
257 | */ | 257 | */ |
258 | if (xfer_mode > XFER_MW_DMA_2) | 258 | xfer_mode = ide_rate_filter(drive, xfer_mode); |
259 | xfer_mode = XFER_MW_DMA_2; | ||
260 | 259 | ||
261 | switch (xfer_mode) { | 260 | switch (xfer_mode) { |
262 | case XFER_MW_DMA_2: | 261 | case XFER_MW_DMA_2: |
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index 04636f7eaae7..e08782ac88e0 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -726,6 +726,8 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed) | |||
726 | { | 726 | { |
727 | int cyc = 0, dvs = 0, strobe = 0, hold = 0; | 727 | int cyc = 0, dvs = 0, strobe = 0, hold = 0; |
728 | 728 | ||
729 | speed = ide_rate_filter(drive, speed); | ||
730 | |||
729 | if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { | 731 | if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { |
730 | tune_cris_ide(drive, speed - XFER_PIO_0); | 732 | tune_cris_ide(drive, speed - XFER_PIO_0); |
731 | return ide_config_drive_speed(drive, speed); | 733 | return ide_config_drive_speed(drive, speed); |
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 2ba6a054b861..0d5e4c67fa54 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -180,6 +180,8 @@ static int auide_tune_chipset (ide_drive_t *drive, u8 speed) | |||
180 | int mem_sttime; | 180 | int mem_sttime; |
181 | int mem_stcfg; | 181 | int mem_stcfg; |
182 | 182 | ||
183 | speed = ide_rate_filter(drive, speed); | ||
184 | |||
183 | mem_sttime = 0; | 185 | mem_sttime = 0; |
184 | mem_stcfg = au_readl(MEM_STCFG2); | 186 | mem_stcfg = au_readl(MEM_STCFG2); |
185 | 187 | ||
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 06c15a6a3e7d..3c0bb1e79514 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -240,6 +240,8 @@ static int amd_set_drive(ide_drive_t *drive, u8 speed) | |||
240 | struct ide_timing t, p; | 240 | struct ide_timing t, p; |
241 | int T, UT; | 241 | int T, UT; |
242 | 242 | ||
243 | speed = ide_rate_filter(drive, speed); | ||
244 | |||
243 | if (speed != XFER_PIO_SLOW) | 245 | if (speed != XFER_PIO_SLOW) |
244 | ide_config_drive_speed(drive, speed); | 246 | ide_config_drive_speed(drive, speed); |
245 | 247 | ||
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index a7be7795e6af..ec9ad6e0e1f6 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -165,6 +165,8 @@ static int via_set_drive(ide_drive_t *drive, u8 speed) | |||
165 | struct ide_timing t, p; | 165 | struct ide_timing t, p; |
166 | unsigned int T, UT; | 166 | unsigned int T, UT; |
167 | 167 | ||
168 | speed = ide_rate_filter(drive, speed); | ||
169 | |||
168 | if (speed != XFER_PIO_SLOW) | 170 | if (speed != XFER_PIO_SLOW) |
169 | ide_config_drive_speed(drive, speed); | 171 | ide_config_drive_speed(drive, speed); |
170 | 172 | ||
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 2fb047b898aa..222adcb54823 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -928,6 +928,8 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) | |||
928 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; | 928 | pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; |
929 | u32 *timings, *timings2; | 929 | u32 *timings, *timings2; |
930 | 930 | ||
931 | speed = ide_rate_filter(drive, speed); | ||
932 | |||
931 | if (pmif == NULL) | 933 | if (pmif == NULL) |
932 | return 1; | 934 | return 1; |
933 | 935 | ||
@@ -937,17 +939,9 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) | |||
937 | switch(speed) { | 939 | switch(speed) { |
938 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | 940 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC |
939 | case XFER_UDMA_6: | 941 | case XFER_UDMA_6: |
940 | if (pmif->kind != controller_sh_ata6) | ||
941 | return 1; | ||
942 | case XFER_UDMA_5: | 942 | case XFER_UDMA_5: |
943 | if (pmif->kind != controller_un_ata6 && | ||
944 | pmif->kind != controller_k2_ata6 && | ||
945 | pmif->kind != controller_sh_ata6) | ||
946 | return 1; | ||
947 | case XFER_UDMA_4: | 943 | case XFER_UDMA_4: |
948 | case XFER_UDMA_3: | 944 | case XFER_UDMA_3: |
949 | if (drive->hwif->cbl != ATA_CBL_PATA80) | ||
950 | return 1; | ||
951 | case XFER_UDMA_2: | 945 | case XFER_UDMA_2: |
952 | case XFER_UDMA_1: | 946 | case XFER_UDMA_1: |
953 | case XFER_UDMA_0: | 947 | case XFER_UDMA_0: |