Commit 2b5ef8fb authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] introduces acpi_penalize_isa_irq() to to avoid PCI

devices use IRQ of legacy PNP devices.
Signed-off-by: default avatarDavid Shaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 16c5fb58
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <linux/acpi.h>
#include "pci.h" #include "pci.h"
...@@ -996,15 +997,26 @@ static int __init pcibios_irq_init(void) ...@@ -996,15 +997,26 @@ static int __init pcibios_irq_init(void)
subsys_initcall(pcibios_irq_init); subsys_initcall(pcibios_irq_init);
void pcibios_penalize_isa_irq(int irq) static void pirq_penalize_isa_irq(int irq)
{ {
/* /*
* If any ISAPnP device reports an IRQ in its list of possible * If any ISAPnP device reports an IRQ in its list of possible
* IRQ's, we try to avoid assigning it to PCI devices. * IRQ's, we try to avoid assigning it to PCI devices.
*/ */
if (irq < 16)
pirq_penalty[irq] += 100; pirq_penalty[irq] += 100;
} }
void pcibios_penalize_isa_irq(int irq)
{
#ifdef CONFIG_ACPI_PCI
if (!acpi_noirq)
acpi_penalize_isa_irq(irq);
else
#endif
pirq_penalize_isa_irq(irq);
}
int pirq_enable_irq(struct pci_dev *dev) int pirq_enable_irq(struct pci_dev *dev)
{ {
u8 pin; u8 pin;
......
...@@ -786,6 +786,11 @@ static int __init acpi_irq_penalty_update(char *str, int used) ...@@ -786,6 +786,11 @@ static int __init acpi_irq_penalty_update(char *str, int used)
return 1; return 1;
} }
void acpi_penalize_isa_irq(int irq)
{
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
}
/* /*
* Over-ride default table to reserve additional IRQs for use by ISA * Over-ride default table to reserve additional IRQs for use by ISA
* e.g. acpi_irq_isa=5 * e.g. acpi_irq_isa=5
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/pnp.h> #include <linux/pnp.h>
#include <linux/pnpbios.h> #include <linux/pnpbios.h>
#include <linux/pci.h>
#include "pnpbios.h" #include "pnpbios.h"
...@@ -58,6 +59,7 @@ pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq) ...@@ -58,6 +59,7 @@ pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
} }
res->irq_resource[i].start = res->irq_resource[i].start =
res->irq_resource[i].end = (unsigned long) irq; res->irq_resource[i].end = (unsigned long) irq;
pcibios_penalize_isa_irq(irq);
} }
} }
......
...@@ -439,6 +439,7 @@ extern struct acpi_prt_list acpi_prt; ...@@ -439,6 +439,7 @@ extern struct acpi_prt_list acpi_prt;
struct pci_dev; struct pci_dev;
int acpi_pci_irq_enable (struct pci_dev *dev); int acpi_pci_irq_enable (struct pci_dev *dev);
void acpi_penalize_isa_irq(int irq);
struct acpi_pci_driver { struct acpi_pci_driver {
struct acpi_pci_driver *next; struct acpi_pci_driver *next;
......
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