aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/slc90e66.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2006-12-29 19:49:26 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-30 13:56:43 -0500
commit44854add66811124a5667466245b6824f751143a (patch)
tree5413f8e9974860dee9831a0731d739376cef0045 /drivers/ide/pci/slc90e66.c
parent242ce41fc92214c3430495edd43783c3ba3dcd2b (diff)
[PATCH] PIIX/SLC90E66: PIO mode fallback fix
The fallback to PIO mode in the hwif->dma_check() handler doesn't work in the Intel PIIX and SMsC SLC90E66 IDE drivers because: - config_drive_for_dma() calls the hwif->speedproc() handler with a wrong mode number (unbiased by XFER_PIO_0) in case of the PIO fallback; - hwif->tuneproc() handler doesn't really set the drive's own speed (this is not fixed as yet). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/pci/slc90e66.c')
-rw-r--r--drivers/ide/pci/slc90e66.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 4a1853af3bbb..9be7e49cba0e 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -1,9 +1,10 @@
1/* 1/*
2 * linux/drivers/ide/pci/slc90e66.c Version 0.11 September 11, 2002 2 * linux/drivers/ide/pci/slc90e66.c Version 0.12 May 12, 2006
3 * 3 *
4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com>
5 * 6 *
6 * This a look-a-like variation of the ICH0 PIIX4 Ultra-66, 7 * This is a look-alike variation of the ICH0 PIIX4 Ultra-66,
7 * but this keeps the ISA-Bridge and slots alive. 8 * but this keeps the ISA-Bridge and slots alive.
8 * 9 *
9 */ 10 */
@@ -158,10 +159,8 @@ static int slc90e66_config_drive_for_dma (ide_drive_t *drive)
158{ 159{
159 u8 speed = ide_dma_speed(drive, slc90e66_ratemask(drive)); 160 u8 speed = ide_dma_speed(drive, slc90e66_ratemask(drive));
160 161
161 if (!(speed)) { 162 if (!speed)
162 u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); 163 return 0;
163 speed = slc90e66_dma_2_pio(XFER_PIO_0 + tspeed);
164 }
165 164
166 (void) slc90e66_tune_chipset(drive, speed); 165 (void) slc90e66_tune_chipset(drive, speed);
167 return ide_dma_enable(drive); 166 return ide_dma_enable(drive);
@@ -176,16 +175,15 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
176 175
177 if (id && (id->capability & 1) && drive->autodma) { 176 if (id && (id->capability & 1) && drive->autodma) {
178 177
179 if (ide_use_dma(drive)) { 178 if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
180 if (slc90e66_config_drive_for_dma(drive)) 179 return hwif->ide_dma_on(drive);
181 return hwif->ide_dma_on(drive);
182 }
183 180
184 goto fast_ata_pio; 181 goto fast_ata_pio;
185 182
186 } else if ((id->capability & 8) || (id->field_valid & 2)) { 183 } else if ((id->capability & 8) || (id->field_valid & 2)) {
187fast_ata_pio: 184fast_ata_pio:
188 hwif->tuneproc(drive, 5); 185 (void) hwif->speedproc(drive, XFER_PIO_0 +
186 ide_get_best_pio_mode(drive, 255, 4, NULL));
189 return hwif->ide_dma_off_quietly(drive); 187 return hwif->ide_dma_off_quietly(drive);
190 } 188 }
191 /* IORDY not supported */ 189 /* IORDY not supported */