aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/triflex.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:20 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:20 -0500
commit39baf8a798926eb675c9360d5822ca86ed92866e (patch)
treee9caacbf354d74c72f9cdfc086442a43147edd6a /drivers/ide/pci/triflex.c
parent296d9bcc00c7180d327235d6f1e4b7f4ac0166a1 (diff)
atiixp/jmicron/triflex: fix PIO fallback
* atiixp: if DMA can't be used atiixp_config_drive_for_dma() should return 0, atiixp_dma_check() will tune the correct PIO mode anyway * jmicron: if DMA can't be used config_chipset_for_dma() should return 0, micron_config_drive_for_dma() will tune the correct PIO mode anyway config_jmicron_chipset_for_pio(drive, !speed) doesn't program device transfer mode for speed != 0 (only wastes some CPU cycles on ide_get_best_pio_mode() call) so remove it * triflex: if DMA can't be used triflex_config_drive_for_dma() should return 0, triflex_config_drive_xfer_rate() will tune correct PIO mode anyway Above changes also fix (theoretical) issue when ->speedproc fails to set device transfer mode (i.e. when ide_config_drive_speed() fails to program it) but one of DMA transfer modes is already enabled on the device by the BIOS. In such scenario ide_dma_enable() will incorrectly return true statement and ->ide_dma_check will try to enable DMA on the device. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/triflex.c')
-rw-r--r--drivers/ide/pci/triflex.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index b13cce1fd1a6..b0d29cd7123a 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -104,11 +104,9 @@ static int triflex_config_drive_for_dma(ide_drive_t *drive)
104{ 104{
105 int speed = ide_dma_speed(drive, 0); /* No ultra speeds */ 105 int speed = ide_dma_speed(drive, 0); /* No ultra speeds */
106 106
107 if (!speed) { 107 if (!speed)
108 u8 pspeed = ide_get_best_pio_mode(drive, 255, 4, NULL); 108 return 0;
109 speed = XFER_PIO_0 + pspeed; 109
110 }
111
112 (void) triflex_tune_chipset(drive, speed); 110 (void) triflex_tune_chipset(drive, speed);
113 return ide_dma_enable(drive); 111 return ide_dma_enable(drive);
114} 112}