aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 16:57:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 16:57:26 -0500
commitf31c338675872875e24f124af0689131b0c72600 (patch)
treecf12b28d52da1675ab32871abd2db455ffbfe920 /drivers/ide/ide-dma.c
parent0008bf54408d4c0637c24d34642f1038c299be95 (diff)
parent61a368c216897aa3bbee35b3f2e6db76ec73fad0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (67 commits) ide: remove redundant DMA blacklist check from __ide_dma_on() ide: cleanup ide_set_dma() ide: remove redundant ->ide_dma_on call from set_using_dma() sc1200: move DMA timings to timing tables ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag sis5513: factor out UDMA programming code pdc202xx_new: move PIO programming code to pdcnew_set_pio_mode() ide: make 'extra' field in struct ide_port_info u8 ide: kill duplicate code in ide_dump_{ata,atapi}_status() ide-disk: use ide_get_lba_addr() ide: printk fix ide: add ide_tf_read() helper ide: fix registers loading order in ide_dump_ata_status() ide-disk: use do_rw_taskfile() (take 2) ide-disk: add ide_tf_set_cmd() helper ide-disk: extend timeout for PIO-in commands ide: remove 'handler' field from ide_task_t (take 2) ide: use ->data_phase to set ->handler in do_rw_taskfile() ide: convert do_rw_taskfile() to use ->data_phase ide: merge flagged_taskfile() into do_rw_taskfile() ...
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c36
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
492int __ide_dma_on (ide_drive_t *drive) 492int __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
1021EXPORT_SYMBOL_GPL(ide_setup_dma); 1007EXPORT_SYMBOL_GPL(ide_setup_dma);