diff options
| author | Bartlomiej Zolnierkiewicz <bzolnier@trik.(none)> | 2004-10-10 21:37:56 +0200 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <bzolnier@trik.(none)> | 2004-10-10 21:37:56 +0200 |
| commit | d04907ecf4e52eb4c3f5b6708e2b2f3d540fd976 (patch) | |
| tree | 73eba50626caf863dc08d4dd43e8bfd821e486e4 | |
| parent | 33b013138c43ea63036fec370f15d5cc95695669 (diff) | |
[ide] ide-dma blacklist behaviour broken
From: Jens Axboe <axboe@suse.de>
The blacklist stuff is broken. When set_using_dma() calls into
->ide_dma_check(), it returns __ide_dma_off() for a blacklisted drive.
This of course succeeds, returning success to the caller of ->ide_dma_check().
Not so good... It then uncondtionally calls ->ide_dma_on(), which turns on
DMA for the drive.
This moves the check to __ide_dma_on() so we also catch the buggy
->ide_dma_check() defined by various chipset drivers.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
| -rw-r--r-- | drivers/ide/ide-dma.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 192ef5a883e2..cd32057b53a9 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -407,10 +407,6 @@ static int config_drive_for_dma (ide_drive_t *drive) ide_hwif_t *hwif = HWIF(drive); if ((id->capability & 1) && hwif->autodma) { - /* Consult the list of known "bad" drives */ - if (__ide_dma_bad_drive(drive)) - return __ide_dma_off(drive); - /* * Enable DMA on any drive that has * UltraDMA (mode 0/1/2/3/4/5/6) enabled @@ -564,6 +560,10 @@ EXPORT_SYMBOL(__ide_dma_host_on); int __ide_dma_on (ide_drive_t *drive) { + /* consult the list of known "bad" drives */ + if (__ide_dma_bad_drive(drive)) + return 1; + drive->using_dma = 1; ide_toggle_bounce(drive, 1); |
