Skip to content

Commit

Permalink
[ACPI] PNPACPI vs sound IRQ
Browse files Browse the repository at this point in the history
http://bugme.osdl.org/show_bug.cgi?id=4016

Written-by: David Shaohua Li <[email protected]>
Acked-by: Adam Belay <[email protected]>
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
David Shaohua Li authored and lenb committed Jul 12, 2005
1 parent acf05f4 commit c9c3e45
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion arch/frv/mb93090-mb00/pci-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
16 changes: 10 additions & 6 deletions arch/i386/pci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,24 +1006,28 @@ static int __init pcibios_irq_init(void)
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
* IRQ's, we try to avoid assigning it to PCI devices.
*/
if (irq < 16)
pirq_penalty[irq] += 100;
if (irq < 16) {
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
if (!acpi_noirq)
acpi_penalize_isa_irq(irq);
acpi_penalize_isa_irq(irq, active);
else
#endif
pirq_penalize_isa_irq(irq);
pirq_penalize_isa_irq(irq, active);
}

static int pirq_enable_irq(struct pci_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/pci/visws.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

void __init pcibios_penalize_isa_irq(int irq) {}
void __init pcibios_penalize_isa_irq(int irq, int active) {}


unsigned int pci_bus0, pci_bus1;
Expand Down
7 changes: 5 additions & 2 deletions drivers/acpi/pci_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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;
}

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
acpi_register_gsi(res->data.irq.interrupts[0],
res->data.irq.edge_level,
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;

Expand All @@ -171,7 +171,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
acpi_register_gsi(res->data.extended_irq.interrupts[0],
res->data.extended_irq.edge_level,
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;
case ACPI_RSTYPE_DMA:
Expand Down
2 changes: 1 addition & 1 deletion drivers/pnp/pnpbios/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
}
res->irq_resource[i].start =
res->irq_resource[i].end = (unsigned long) irq;
pcibios_penalize_isa_irq(irq);
pcibios_penalize_isa_irq(irq, 1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/pnp/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)

for (i = 0; i < 16; i++)
if (test_bit(i, data->map))
pcibios_penalize_isa_irq(i);
pcibios_penalize_isa_irq(i, 0);
}
#endif
return 0;
Expand Down
2 changes: 1 addition & 1 deletion include/asm-alpha/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct pci_controller {

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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-arm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-h8300/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-i386/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus);

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);
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);

Expand Down
2 changes: 1 addition & 1 deletion include/asm-ia64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev)
}

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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-m68k/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-mips/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern unsigned long PCIBIOS_MIN_MEM;

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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-ppc/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-ppc64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-sh/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct pci_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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-sh64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern void pcibios_set_master(struct pci_dev *dev);
/*
* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-sparc/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-sparc64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
/* 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 */
}
Expand Down
2 changes: 1 addition & 1 deletion include/asm-x86_64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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);
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);

Expand Down
2 changes: 1 addition & 1 deletion include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ struct acpi_prt_list {
struct pci_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
void acpi_pci_irq_disable (struct pci_dev *dev);
Expand Down

0 comments on commit c9c3e45

Please sign in to comment.