diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-16 16:29:54 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-16 16:29:54 -0400 |
commit | 8446f65988b48d19cf419aa4def9a9ccfed17b76 (patch) | |
tree | 48dd976eca3d3abfdff1546185f5a0a0b6be0ebf | |
parent | 8c91abf86280a1b900619ee0d8ae1840e943110e (diff) |
au1xxx-ide: use ide_tune_dma()
* Remove needless setting of drive->using_dma from auide_dma_check().
* Split off auide_mdma_filter() from auide_dma_check().
* Use ide_tune_dma() in auide_dma_check(), this fixes following issues:
- device's DMA capability bit not being checked
- device not being checked against generic DMA blacklist
- transfer mode not being set on device/host
* Add PIO autotune fallback to auide_dma_check().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 892d08f61dc0..1c4732958fb2 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -351,11 +351,18 @@ static int auide_dma_setup(ide_drive_t *drive) | |||
351 | return 0; | 351 | return 0; |
352 | } | 352 | } |
353 | 353 | ||
354 | static int auide_dma_check(ide_drive_t *drive) | 354 | static u8 auide_mdma_filter(ide_drive_t *drive) |
355 | { | 355 | { |
356 | u8 speed = ide_max_dma_mode(drive); | 356 | /* |
357 | * FIXME: ->white_list and ->black_list are based on completely bogus | ||
358 | * ->ide_dma_check implementation which didn't set neither the host | ||
359 | * controller timings nor the device for the desired transfer mode. | ||
360 | * | ||
361 | * They should be either removed or 0x00 MWDMA mask should be | ||
362 | * returned for devices on the ->black_list. | ||
363 | */ | ||
357 | 364 | ||
358 | if( dbdma_init_done == 0 ){ | 365 | if (dbdma_init_done == 0) { |
359 | auide_hwif.white_list = ide_in_drive_list(drive->id, | 366 | auide_hwif.white_list = ide_in_drive_list(drive->id, |
360 | dma_white_list); | 367 | dma_white_list); |
361 | auide_hwif.black_list = ide_in_drive_list(drive->id, | 368 | auide_hwif.black_list = ide_in_drive_list(drive->id, |
@@ -366,21 +373,20 @@ static int auide_dma_check(ide_drive_t *drive) | |||
366 | } | 373 | } |
367 | 374 | ||
368 | /* Is the drive in our DMA black list? */ | 375 | /* Is the drive in our DMA black list? */ |
369 | 376 | if (auide_hwif.black_list) | |
370 | if ( auide_hwif.black_list ) { | ||
371 | drive->using_dma = 0; | ||
372 | |||
373 | /* Borrowed the warning message from ide-dma.c */ | ||
374 | |||
375 | printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", | 377 | printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", |
376 | drive->name, drive->id->model); | 378 | drive->name, drive->id->model); |
377 | } | ||
378 | else | ||
379 | drive->using_dma = 1; | ||
380 | 379 | ||
381 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) | 380 | return drive->hwif->mwdma_mask; |
381 | } | ||
382 | |||
383 | static int auide_dma_check(ide_drive_t *drive) | ||
384 | { | ||
385 | if (ide_tune_dma(drive)) | ||
382 | return 0; | 386 | return 0; |
383 | 387 | ||
388 | ide_set_max_pio(drive); | ||
389 | |||
384 | return -1; | 390 | return -1; |
385 | } | 391 | } |
386 | 392 | ||
@@ -692,6 +698,8 @@ static int au_ide_probe(struct device *dev) | |||
692 | hwif->dma_off_quietly = &auide_dma_off_quietly; | 698 | hwif->dma_off_quietly = &auide_dma_off_quietly; |
693 | hwif->dma_timeout = &auide_dma_timeout; | 699 | hwif->dma_timeout = &auide_dma_timeout; |
694 | 700 | ||
701 | hwif->mdma_filter = &auide_mdma_filter; | ||
702 | |||
695 | hwif->ide_dma_check = &auide_dma_check; | 703 | hwif->ide_dma_check = &auide_dma_check; |
696 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; | 704 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; |
697 | hwif->dma_start = &auide_dma_start; | 705 | hwif->dma_start = &auide_dma_start; |