Commit 29ffe2ad authored by Adam Belay's avatar Adam Belay

[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.
parent af0cf44c
...@@ -111,28 +111,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev) ...@@ -111,28 +111,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
return; 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 * PnP Quirks
* Cards or devices that need some tweaking due to incomplete resource info * Cards or devices that need some tweaking due to incomplete resource info
...@@ -153,7 +131,6 @@ static struct pnp_fixup pnp_fixups[] = { ...@@ -153,7 +131,6 @@ static struct pnp_fixup pnp_fixups[] = {
{ "CTL0043", quirk_sb16audio_resources }, { "CTL0043", quirk_sb16audio_resources },
{ "CTL0044", quirk_sb16audio_resources }, { "CTL0044", quirk_sb16audio_resources },
{ "CTL0045", quirk_sb16audio_resources }, { "CTL0045", quirk_sb16audio_resources },
{ "YMH0021", quirk_opl3sax_resources },
{ "" } { "" }
}; };
...@@ -170,4 +147,3 @@ void pnp_fixup_device(struct pnp_dev *dev) ...@@ -170,4 +147,3 @@ void pnp_fixup_device(struct pnp_dev *dev)
i++; i++;
} }
} }
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#include <linux/pnp.h> #include <linux/pnp.h>
#include "base.h" #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_skip_pci_scan; /* skip PCI resource scanning */
int pnp_reserve_irq[16] = { [0 ... 15] = -1 }; /* reserve (don't use) some IRQ */ 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 */ 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) ...@@ -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 pnp_check_dma(struct pnp_dev * dev, int idx)
{ {
int tmp, mindma = 1; int tmp;
struct pnp_dev *tdev; struct pnp_dev *tdev;
unsigned long * dma = &dev->res.dma_resource[idx].start; unsigned long * dma = &dev->res.dma_resource[idx].start;
...@@ -435,9 +433,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx) ...@@ -435,9 +433,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
return 1; return 1;
/* check if the resource is valid */ /* check if the resource is valid */
if (pnp_allow_dma0 == 1) if (*dma < 0 || *dma == 4 || *dma > 7)
mindma = 0;
if (*dma < mindma || *dma == 4 || *dma > 7)
return 0; return 0;
/* check if the resource is reserved */ /* check if the resource is reserved */
...@@ -488,16 +484,6 @@ EXPORT_SYMBOL(pnp_register_port_resource); ...@@ -488,16 +484,6 @@ EXPORT_SYMBOL(pnp_register_port_resource);
EXPORT_SYMBOL(pnp_register_mem_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] .... */ /* format is: pnp_reserve_irq=irq1[,irq2] .... */
static int __init pnp_setup_reserve_irq(char *str) static int __init pnp_setup_reserve_irq(char *str)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment