Commit c9c3e457 authored by David Shaohua Li's avatar David Shaohua Li Committed by Len Brown
parent acf05f4b
...@@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void) ...@@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void)
} }
} }
void __init pcibios_penalize_isa_irq(int irq) void __init pcibios_penalize_isa_irq(int irq, int active)
{ {
} }
......
...@@ -1006,24 +1006,28 @@ static int __init pcibios_irq_init(void) ...@@ -1006,24 +1006,28 @@ static int __init pcibios_irq_init(void)
subsys_initcall(pcibios_irq_init); subsys_initcall(pcibios_irq_init);
static void pirq_penalize_isa_irq(int irq) static void pirq_penalize_isa_irq(int irq, int active)
{ {
/* /*
* 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) if (irq < 16) {
pirq_penalty[irq] += 100; if (active)
pirq_penalty[irq] += 1000;
else
pirq_penalty[irq] += 100;
}
} }
void pcibios_penalize_isa_irq(int irq) void pcibios_penalize_isa_irq(int irq, int active)
{ {
#ifdef CONFIG_ACPI_PCI #ifdef CONFIG_ACPI_PCI
if (!acpi_noirq) if (!acpi_noirq)
acpi_penalize_isa_irq(irq); acpi_penalize_isa_irq(irq, active);
else else
#endif #endif
pirq_penalize_isa_irq(irq); pirq_penalize_isa_irq(irq, active);
} }
static int pirq_enable_irq(struct pci_dev *dev) static int pirq_enable_irq(struct pci_dev *dev)
......
...@@ -21,7 +21,7 @@ static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } ...@@ -21,7 +21,7 @@ static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq;
void __init pcibios_penalize_isa_irq(int irq) {} void __init pcibios_penalize_isa_irq(int irq, int active) {}
unsigned int pci_bus0, pci_bus1; unsigned int pci_bus0, pci_bus1;
......
...@@ -804,9 +804,12 @@ static int __init acpi_irq_penalty_update(char *str, int used) ...@@ -804,9 +804,12 @@ static int __init acpi_irq_penalty_update(char *str, int used)
* There is no ISA_POSSIBLE weight, so we simply use * There is no ISA_POSSIBLE weight, so we simply use
* the (small) PCI_USING penalty. * the (small) PCI_USING penalty.
*/ */
void acpi_penalize_isa_irq(int irq) void acpi_penalize_isa_irq(int irq, int active)
{ {
acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; if (active)
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
else
acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
} }
/* /*
......
...@@ -160,7 +160,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -160,7 +160,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
acpi_register_gsi(res->data.irq.interrupts[0], acpi_register_gsi(res->data.irq.interrupts[0],
res->data.irq.edge_level, res->data.irq.edge_level,
res->data.irq.active_high_low)); res->data.irq.active_high_low));
pcibios_penalize_isa_irq(res->data.irq.interrupts[0]); pcibios_penalize_isa_irq(res->data.irq.interrupts[0], 1);
} }
break; break;
...@@ -171,7 +171,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -171,7 +171,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
acpi_register_gsi(res->data.extended_irq.interrupts[0], acpi_register_gsi(res->data.extended_irq.interrupts[0],
res->data.extended_irq.edge_level, res->data.extended_irq.edge_level,
res->data.extended_irq.active_high_low)); res->data.extended_irq.active_high_low));
pcibios_penalize_isa_irq(res->data.extended_irq.interrupts[0]); pcibios_penalize_isa_irq(res->data.extended_irq.interrupts[0], 1);
} }
break; break;
case ACPI_RSTYPE_DMA: case ACPI_RSTYPE_DMA:
......
...@@ -64,7 +64,7 @@ pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq) ...@@ -64,7 +64,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); pcibios_penalize_isa_irq(irq, 1);
} }
} }
......
...@@ -102,7 +102,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) ...@@ -102,7 +102,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
if (test_bit(i, data->map)) if (test_bit(i, data->map))
pcibios_penalize_isa_irq(i); pcibios_penalize_isa_irq(i, 0);
} }
#endif #endif
return 0; return 0;
......
...@@ -58,7 +58,7 @@ struct pci_controller { ...@@ -58,7 +58,7 @@ struct pci_controller {
extern void pcibios_set_master(struct pci_dev *dev); extern void pcibios_set_master(struct pci_dev *dev);
extern inline void pcibios_penalize_isa_irq(int irq) extern inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -14,7 +14,7 @@ static inline void pcibios_set_master(struct pci_dev *dev) ...@@ -14,7 +14,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -15,7 +15,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev) ...@@ -15,7 +15,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
extern inline void pcibios_penalize_isa_irq(int irq) extern inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -27,7 +27,7 @@ void pcibios_config_init(void); ...@@ -27,7 +27,7 @@ void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus); struct pci_bus * pcibios_scan_root(int bus);
void pcibios_set_master(struct pci_dev *dev); void pcibios_set_master(struct pci_dev *dev);
void pcibios_penalize_isa_irq(int irq); void pcibios_penalize_isa_irq(int irq, int active);
struct irq_routing_table *pcibios_get_irq_routing_table(void); struct irq_routing_table *pcibios_get_irq_routing_table(void);
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
......
...@@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev) ...@@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev)
} }
static inline void static inline void
pcibios_penalize_isa_irq (int irq) pcibios_penalize_isa_irq (int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -43,7 +43,7 @@ static inline void pcibios_set_master(struct pci_dev *dev) ...@@ -43,7 +43,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -69,7 +69,7 @@ extern unsigned long PCIBIOS_MIN_MEM; ...@@ -69,7 +69,7 @@ extern unsigned long PCIBIOS_MIN_MEM;
extern void pcibios_set_master(struct pci_dev *dev); extern void pcibios_set_master(struct pci_dev *dev);
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -37,7 +37,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev) ...@@ -37,7 +37,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
extern inline void pcibios_penalize_isa_irq(int irq) extern inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -37,7 +37,7 @@ static inline void pcibios_set_master(struct pci_dev *dev) ...@@ -37,7 +37,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -36,7 +36,7 @@ struct pci_dev; ...@@ -36,7 +36,7 @@ struct pci_dev;
extern void pcibios_set_master(struct pci_dev *dev); extern void pcibios_set_master(struct pci_dev *dev);
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -26,7 +26,7 @@ extern void pcibios_set_master(struct pci_dev *dev); ...@@ -26,7 +26,7 @@ extern void pcibios_set_master(struct pci_dev *dev);
/* /*
* Set penalize isa irq function * Set penalize isa irq function
*/ */
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -20,7 +20,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev) ...@@ -20,7 +20,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
extern inline void pcibios_penalize_isa_irq(int irq) extern inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -23,7 +23,7 @@ static inline void pcibios_set_master(struct pci_dev *dev) ...@@ -23,7 +23,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* No special bus mastering setup handling */ /* No special bus mastering setup handling */
} }
static inline void pcibios_penalize_isa_irq(int irq) static inline void pcibios_penalize_isa_irq(int irq, int active)
{ {
/* We don't do dynamic PCI IRQ allocation */ /* We don't do dynamic PCI IRQ allocation */
} }
......
...@@ -33,7 +33,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int le ...@@ -33,7 +33,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int le
extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
void pcibios_set_master(struct pci_dev *dev); void pcibios_set_master(struct pci_dev *dev);
void pcibios_penalize_isa_irq(int irq); void pcibios_penalize_isa_irq(int irq, int active);
struct irq_routing_table *pcibios_get_irq_routing_table(void); struct irq_routing_table *pcibios_get_irq_routing_table(void);
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
......
...@@ -465,7 +465,7 @@ struct acpi_prt_list { ...@@ -465,7 +465,7 @@ struct acpi_prt_list {
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); void acpi_penalize_isa_irq(int irq, int active);
#ifdef CONFIG_ACPI_DEALLOCATE_IRQ #ifdef CONFIG_ACPI_DEALLOCATE_IRQ
void acpi_pci_irq_disable (struct pci_dev *dev); void acpi_pci_irq_disable (struct pci_dev *dev);
......
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