From 29ffe2adf7f87302b4d6c888cec7939af0a682d3 Mon Sep 17 00:00:00 2001 From: Adam Belay Date: Sun, 21 Sep 2003 19:02:08 +0000 Subject: [PATCH] [PNP] remove DMA 0 restrictions The original argument for blocking DMA 0 was to avoid conflicts with "memory refresh" but such configurations are only found on very old 8-bit systems that are likely not supported by the linux kernel. This patch allows dma 0 to be assigned to PnP devices by default. If for whatever reason dma 0 cannot be used, one can avoid allocating it by setting the pnp_reserve_dma= kernel parameter. --- drivers/pnp/quirks.c | 24 ------------------------ drivers/pnp/resource.c | 18 ++---------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 883f845a8d111..74eecb245bd53 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -111,28 +111,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev) return; } -extern int pnp_allow_dma0; -static void quirk_opl3sax_resources(struct pnp_dev *dev) -{ - /* This really isn't a device quirk but isapnp core code - * doesn't allow a DMA channel of 0, afflicted card is an - * OPL3Sax where x=4. - */ - struct pnp_option *res; - int max; - res = dev->dependent; - max = 0; - for (; res; res = res->next) { - if (res->dma->map > max) - max = res->dma->map; - } - if (max == 1 && pnp_allow_dma0 == -1) { - printk(KERN_INFO "pnp: opl3sa4 quirk: Allowing dma 0.\n"); - pnp_allow_dma0 = 1; - } - return; -} - /* * PnP Quirks * Cards or devices that need some tweaking due to incomplete resource info @@ -153,7 +131,6 @@ static struct pnp_fixup pnp_fixups[] = { { "CTL0043", quirk_sb16audio_resources }, { "CTL0044", quirk_sb16audio_resources }, { "CTL0045", quirk_sb16audio_resources }, - { "YMH0021", quirk_opl3sax_resources }, { "" } }; @@ -170,4 +147,3 @@ void pnp_fixup_device(struct pnp_dev *dev) i++; } } - diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index ffd4211da4343..dfe565a82ea8a 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -21,8 +21,6 @@ #include #include "base.h" -int pnp_allow_dma0 = -1; /* allow dma 0 during auto activation: - * -1=off (:default), 0=off (set by user), 1=on */ int pnp_skip_pci_scan; /* skip PCI resource scanning */ int pnp_reserve_irq[16] = { [0 ... 15] = -1 }; /* reserve (don't use) some IRQ */ int pnp_reserve_dma[8] = { [0 ... 7] = -1 }; /* reserve (don't use) some DMA */ @@ -426,7 +424,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx) int pnp_check_dma(struct pnp_dev * dev, int idx) { - int tmp, mindma = 1; + int tmp; struct pnp_dev *tdev; unsigned long * dma = &dev->res.dma_resource[idx].start; @@ -435,9 +433,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx) return 1; /* check if the resource is valid */ - if (pnp_allow_dma0 == 1) - mindma = 0; - if (*dma < mindma || *dma == 4 || *dma > 7) + if (*dma < 0 || *dma == 4 || *dma > 7) return 0; /* check if the resource is reserved */ @@ -488,16 +484,6 @@ EXPORT_SYMBOL(pnp_register_port_resource); EXPORT_SYMBOL(pnp_register_mem_resource); -/* format is: allowdma0 */ - -static int __init pnp_allowdma0(char *str) -{ - pnp_allow_dma0 = 1; - return 1; -} - -__setup("allowdma0", pnp_allowdma0); - /* format is: pnp_reserve_irq=irq1[,irq2] .... */ static int __init pnp_setup_reserve_irq(char *str) -- 2.53.0