Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>2004-02-15 21:46:25 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2004-02-15 21:46:25 -0800
commit49dd3fd82d8a75e6ef844f1d4227140e4a643010 (patch)
treead989b6e692b6fe28a718880830d103480c3a725
parentf1bdede03ad0b229632a6c44760c712d86d4900c (diff)
[PATCH] fix OOPS on non-DMA IDE hosts with CONFIG_BLK_DEV_IDEDMA=y
From: Glenn Wurster <gwurster@scs.carleton.ca>
-rw-r--r--drivers/ide/ide-iops.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 262dd198fa45..296da725a486 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -830,7 +830,8 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
// ide_delay_50ms();
#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI)
- hwif->ide_dma_host_off(drive);
+ if (hwif->ide_dma_check) /* check if host supports DMA */
+ hwif->ide_dma_host_off(drive);
#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */
/*
@@ -906,10 +907,12 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
drive->id->dma_1word &= ~0x0F00;
#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI)
- if (speed >= XFER_SW_DMA_0)
+ if (speed >= XFER_SW_DMA_0) {
hwif->ide_dma_host_on(drive);
- else
- hwif->ide_dma_off_quietly(drive);
+ } else {
+ if (hwif->ide_dma_check) /* check if host supports DMA */
+ hwif->ide_dma_off_quietly(drive);
+ }
#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */
switch(speed) {