diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 4703837bf1fc..18c78ad2b31e 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -491,10 +491,6 @@ EXPORT_SYMBOL(ide_dma_host_on); | |||
491 | 491 | ||
492 | int __ide_dma_on (ide_drive_t *drive) | 492 | int __ide_dma_on (ide_drive_t *drive) |
493 | { | 493 | { |
494 | /* consult the list of known "bad" drives */ | ||
495 | if (__ide_dma_bad_drive(drive)) | ||
496 | return 1; | ||
497 | |||
498 | drive->using_dma = 1; | 494 | drive->using_dma = 1; |
499 | ide_toggle_bounce(drive, 1); | 495 | ide_toggle_bounce(drive, 1); |
500 | 496 | ||
@@ -827,22 +823,19 @@ int ide_set_dma(ide_drive_t *drive) | |||
827 | ide_hwif_t *hwif = drive->hwif; | 823 | ide_hwif_t *hwif = drive->hwif; |
828 | int rc; | 824 | int rc; |
829 | 825 | ||
830 | rc = ide_dma_check(drive); | 826 | /* |
827 | * Force DMAing for the beginning of the check. | ||
828 | * Some chipsets appear to do interesting | ||
829 | * things, if not checked and cleared. | ||
830 | * PARANOIA!!! | ||
831 | */ | ||
832 | hwif->dma_off_quietly(drive); | ||
831 | 833 | ||
832 | switch(rc) { | 834 | rc = ide_dma_check(drive); |
833 | case -1: /* DMA needs to be disabled */ | 835 | if (rc) |
834 | hwif->dma_off_quietly(drive); | 836 | return rc; |
835 | return -1; | ||
836 | case 0: /* DMA needs to be enabled */ | ||
837 | return hwif->ide_dma_on(drive); | ||
838 | case 1: /* DMA setting cannot be changed */ | ||
839 | break; | ||
840 | default: | ||
841 | BUG(); | ||
842 | break; | ||
843 | } | ||
844 | 837 | ||
845 | return rc; | 838 | return hwif->ide_dma_on(drive); |
846 | } | 839 | } |
847 | 840 | ||
848 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 841 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -968,11 +961,6 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports) | |||
968 | 961 | ||
969 | hwif->dma_base = base; | 962 | hwif->dma_base = base; |
970 | 963 | ||
971 | if (hwif->mate) | ||
972 | hwif->dma_master = hwif->channel ? hwif->mate->dma_base : base; | ||
973 | else | ||
974 | hwif->dma_master = base; | ||
975 | |||
976 | if (!(hwif->dma_command)) | 964 | if (!(hwif->dma_command)) |
977 | hwif->dma_command = hwif->dma_base; | 965 | hwif->dma_command = hwif->dma_base; |
978 | if (!(hwif->dma_vendor1)) | 966 | if (!(hwif->dma_vendor1)) |
@@ -1014,8 +1002,6 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports) | |||
1014 | hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); | 1002 | hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); |
1015 | } | 1003 | } |
1016 | printk("\n"); | 1004 | printk("\n"); |
1017 | |||
1018 | BUG_ON(!hwif->dma_master); | ||
1019 | } | 1005 | } |
1020 | 1006 | ||
1021 | EXPORT_SYMBOL_GPL(ide_setup_dma); | 1007 | EXPORT_SYMBOL_GPL(ide_setup_dma); |