aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_new.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2006-12-08 05:39:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:03 -0500
commitb10a06866600d1eda9e72ff328999e70f077fb3a (patch)
tree5b24ab8eab610142653791cd63508a962a883f62 /drivers/ide/pci/pdc202xx_new.c
parentb1489009963b8c5132f2ffe23483e811d9ae5607 (diff)
[PATCH] pdc202xx_new: fix PIO mode setup
Fix pdcnew_tune_drive() to always set the PIO mode requested, not pick the best possible one, change pdcnew_config_drive_xfer_rate() accordingly, and get rid of the duplicate tuneproc() call in config_chipset_for_dma(). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: 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/pdc202xx_new.c')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 0592dc0f96c0..3ca581063f72 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -9,6 +9,7 @@
9 * Split from: 9 * Split from:
10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002 10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
12 * Copyright (C) 2005-2006 MontaVista Software, Inc.
12 * Portions Copyright (C) 1999 Promise Technology, Inc. 13 * Portions Copyright (C) 1999 Promise Technology, Inc.
13 * Author: Frank Tiernan (frankt@promise.com) 14 * Author: Frank Tiernan (frankt@promise.com)
14 * Released under terms of General Public License 15 * Released under terms of General Public License
@@ -168,12 +169,8 @@ static int pdcnew_new_tune_chipset (ide_drive_t *drive, u8 xferspeed)
168 */ 169 */
169static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio) 170static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio)
170{ 171{
171 u8 speed; 172 pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
172 173 (void)pdcnew_new_tune_chipset(drive, XFER_PIO_0 + pio);
173 if (pio == 5) pio = 4;
174 speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL);
175
176 (void)pdcnew_new_tune_chipset(drive, speed);
177} 174}
178 175
179static u8 pdcnew_new_cable_detect (ide_hwif_t *hwif) 176static u8 pdcnew_new_cable_detect (ide_hwif_t *hwif)
@@ -207,10 +204,8 @@ static int config_chipset_for_dma (ide_drive_t *drive)
207 204
208 speed = ide_dma_speed(drive, pdcnew_ratemask(drive)); 205 speed = ide_dma_speed(drive, pdcnew_ratemask(drive));
209 206
210 if (!(speed)) { 207 if (!speed)
211 hwif->tuneproc(drive, 5);
212 return 0; 208 return 0;
213 }
214 209
215 (void) hwif->speedproc(drive, speed); 210 (void) hwif->speedproc(drive, speed);
216 return ide_dma_enable(drive); 211 return ide_dma_enable(drive);
@@ -234,7 +229,7 @@ static int pdcnew_config_drive_xfer_rate (ide_drive_t *drive)
234 229
235 } else if ((id->capability & 8) || (id->field_valid & 2)) { 230 } else if ((id->capability & 8) || (id->field_valid & 2)) {
236fast_ata_pio: 231fast_ata_pio:
237 hwif->tuneproc(drive, 5); 232 hwif->tuneproc(drive, 255);
238 return hwif->ide_dma_off_quietly(drive); 233 return hwif->ide_dma_off_quietly(drive);
239 } 234 }
240 /* IORDY not supported */ 235 /* IORDY not supported */