diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-13 11:47:50 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-13 11:47:50 -0400 |
commit | 254bb5503611da57240ed6df1cfe6d7f0f185027 (patch) | |
tree | 6ba845e77e6173bb0a3ba09d7934bc8f07974a9d /drivers/ide | |
parent | aedea5910ce44fea79e2c517bb22e0006372156f (diff) |
ide-pmac: use ide_tune_dma() (take 2)
* Add missing initialization of hwif->autodma and drive->autodma to
pmac_ide_setup_dma().
* Use ide_tune_dma() in pmac_ide_dma_check().
While at it:
* Fix pmac_ide_dma_check() return value if DMA mode is not programmed
(should be "-1" otherwise ide_set_dma() will try to enable DMA).
* Remove unnecessary drive->using_dma fiddling (->dma_off_quietly is always
called before ide_set_dma() call and ide_set_dma() calls ->ide_dma_on if
->ide_dma_check returns "0").
v2:
* No reason to blacklist all ide_floppy devices and the old code was always
enabling DMA anyway (without even programming controller/device if the
device was ide_floppy).
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ppc/pmac.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 24f73291c4d5..a1d24cd1293e 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -1593,24 +1593,10 @@ pmac_ide_destroy_dmatable (ide_drive_t *drive) | |||
1593 | static int | 1593 | static int |
1594 | pmac_ide_dma_check(ide_drive_t *drive) | 1594 | pmac_ide_dma_check(ide_drive_t *drive) |
1595 | { | 1595 | { |
1596 | int enable = 1; | 1596 | if (ide_tune_dma(drive)) |
1597 | return 0; | ||
1597 | 1598 | ||
1598 | drive->using_dma = 0; | 1599 | return -1; |
1599 | |||
1600 | if (drive->media == ide_floppy) | ||
1601 | enable = 0; | ||
1602 | if ((drive->id->capability & 1) == 0 && !__ide_dma_good_drive(drive)) | ||
1603 | enable = 0; | ||
1604 | if (__ide_dma_bad_drive(drive)) | ||
1605 | enable = 0; | ||
1606 | |||
1607 | if (enable) { | ||
1608 | u8 mode = ide_max_dma_mode(drive); | ||
1609 | |||
1610 | if (mode && pmac_ide_tune_chipset(drive, mode) == 0) | ||
1611 | drive->using_dma = 1; | ||
1612 | } | ||
1613 | return 0; | ||
1614 | } | 1600 | } |
1615 | 1601 | ||
1616 | /* | 1602 | /* |
@@ -1844,7 +1830,10 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) | |||
1844 | hwif->mwdma_mask = 0x07; | 1830 | hwif->mwdma_mask = 0x07; |
1845 | hwif->swdma_mask = 0x00; | 1831 | hwif->swdma_mask = 0x00; |
1846 | break; | 1832 | break; |
1847 | } | 1833 | } |
1834 | |||
1835 | hwif->autodma = 1; | ||
1836 | hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma; | ||
1848 | } | 1837 | } |
1849 | 1838 | ||
1850 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | 1839 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ |