summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorSergei Shtylylov <sshtylyov@ru.mvista.com>2006-10-03 12:14:13 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 19:04:07 +0400
commit020e322de3ff75d32daa58e431aad07071da27c6 (patch)
tree127509ae4fe684bd557285e246b835fa6a9d5ecd /drivers/ide/ide-dma.c
parentbbb3bbdb0f78cb02451daf5687a99627f7ad1140 (diff)
downloadlinux-020e322de3ff75d32daa58e431aad07071da27c6.tar.xz
[PATCH] IDE: claim extra DMA ports regardless of channel
- Claim extra DMA I/O ports regardless of what IDE channels are present/enabled. - Remove extra ports handling from ide_mapped_mmio_dma() since it's not applicable to the custom-mapping IDE drivers. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index c3546fe9af63..9937fa7da546 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -798,9 +798,9 @@ static int ide_release_dma_engine(ide_hwif_t *hwif)
static int ide_release_iomio_dma(ide_hwif_t *hwif)
{
- if ((hwif->dma_extra) && (hwif->channel == 0))
- release_region((hwif->dma_base + 16), hwif->dma_extra);
release_region(hwif->dma_base, 8);
+ if (hwif->extra_ports)
+ release_region(hwif->extra_base, hwif->extra_ports);
if (hwif->dma_base2)
release_region(hwif->dma_base, 8);
return 1;
@@ -840,9 +840,7 @@ static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base, unsigned in
{
printk(KERN_INFO " %s: MMIO-DMA ", hwif->name);
- hwif->dma_base = base;
- if (hwif->cds->extra && hwif->channel == 0)
- hwif->dma_extra = hwif->cds->extra;
+ hwif->dma_base = base;
if(hwif->mate)
hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
@@ -854,17 +852,29 @@ static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base, unsigned in
static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int ports)
{
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx",
- hwif->name, base, base + ports - 1);
+ hwif->name, base, base + ports - 1);
+
if (!request_region(base, ports, hwif->name)) {
printk(" -- Error, ports in use.\n");
return 1;
}
+
hwif->dma_base = base;
- if ((hwif->cds->extra) && (hwif->channel == 0)) {
- request_region(base+16, hwif->cds->extra, hwif->cds->name);
- hwif->dma_extra = hwif->cds->extra;
+
+ if (hwif->cds->extra) {
+ hwif->extra_base = base + (hwif->channel ? 8 : 16);
+
+ if (!hwif->mate || !hwif->mate->extra_ports) {
+ if (!request_region(hwif->extra_base,
+ hwif->cds->extra, hwif->cds->name)) {
+ printk(" -- Error, extra ports in use.\n");
+ release_region(base, ports);
+ return 1;
+ }
+ hwif->extra_ports = hwif->cds->extra;
+ }
}
-
+
if(hwif->mate)
hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
else
@@ -874,6 +884,8 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
{
printk(" -- Error, secondary ports in use.\n");
release_region(base, ports);
+ if (hwif->extra_ports)
+ release_region(hwif->extra_base, hwif->extra_ports);
return 1;
}
}