aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/aec62xx.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-05-05 16:03:50 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-05 16:03:50 -0400
commit826a1b6502d0d1d67fc41043fc831e90f2ef5835 (patch)
tree0b45902fcec08e2d22ed17208c079358939779ad /drivers/ide/pci/aec62xx.c
parent66602c83dcb6a5d82772d88ae7a32cd4a1213528 (diff)
aec62xx: fix PIO/DMA setup issues
Teach the driver's tuneproc() method to do PIO auto-runing properly since it treated 5 instead of 255 as auto-tune request, and also passed the mode limit of PIO5 to ide_get_best_pio_mode() despite supporting up to PIO4 only. While at it, also: - remove the driver's wrong claim about supporting SWDMA modes; - stop hooking ide_dma_timeout() method as the handler clearly doesn't fit for the task... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/aec62xx.c')
-rw-r--r--drivers/ide/pci/aec62xx.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 990eafe5ea11..73bdf64dbbfc 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -1,7 +1,8 @@
1/* 1/*
2 * linux/drivers/ide/pci/aec62xx.c Version 0.11 March 27, 2002 2 * linux/drivers/ide/pci/aec62xx.c Version 0.21 Apr 21, 2007
3 * 3 *
4 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
5 * 6 *
6 */ 7 */
7 8
@@ -193,18 +194,8 @@ static int config_chipset_for_dma (ide_drive_t *drive)
193 194
194static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio) 195static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
195{ 196{
196 u8 speed = 0; 197 pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
197 u8 new_pio = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); 198 (void) aec62xx_tune_chipset(drive, pio + XFER_PIO_0);
198
199 switch(pio) {
200 case 5: speed = new_pio; break;
201 case 4: speed = XFER_PIO_4; break;
202 case 3: speed = XFER_PIO_3; break;
203 case 2: speed = XFER_PIO_2; break;
204 case 1: speed = XFER_PIO_1; break;
205 default: speed = XFER_PIO_0; break;
206 }
207 (void) aec62xx_tune_chipset(drive, speed);
208} 199}
209 200
210static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) 201static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
@@ -213,7 +204,7 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
213 return 0; 204 return 0;
214 205
215 if (ide_use_fast_pio(drive)) 206 if (ide_use_fast_pio(drive))
216 aec62xx_tune_drive(drive, 5); 207 aec62xx_tune_drive(drive, 255);
217 208
218 return -1; 209 return -1;
219} 210}
@@ -288,11 +279,10 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
288 279
289 hwif->ultra_mask = 0x7f; 280 hwif->ultra_mask = 0x7f;
290 hwif->mwdma_mask = 0x07; 281 hwif->mwdma_mask = 0x07;
291 hwif->swdma_mask = 0x07;
292 282
293 hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; 283 hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate;
294 hwif->ide_dma_lostirq = &aec62xx_irq_timeout; 284 hwif->ide_dma_lostirq = &aec62xx_irq_timeout;
295 hwif->ide_dma_timeout = &aec62xx_irq_timeout; 285
296 if (!noautodma) 286 if (!noautodma)
297 hwif->autodma = 1; 287 hwif->autodma = 1;
298 hwif->drives[0].autodma = hwif->autodma; 288 hwif->drives[0].autodma = hwif->autodma;