diff options
author | Len Brown <lenb@toshiba.hsd1.ma.comcast.net> | 2005-05-27 04:21:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-27 11:15:04 -0400 |
commit | 25be5e6ccc5c9cab77012fabbb72520f9b6e4618 (patch) | |
tree | 4c1b48179d7f18b3e037a473d8e04708b619ac5c /drivers | |
parent | 2efe86b809d97debaaf9fcc13b041aedf15bd3d2 (diff) |
[PATCH] VIA IRQ quirk
Delete quirk_via_bridge(), restore quirk_via_irqpic() -- but now
improved to be invoked upon device ENABLE, and now only for VIA devices
-- not all devices behind VIA bridges.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/pci_irq.c | 4 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 40 |
2 files changed, 24 insertions, 20 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 12b0eea63407..8093f2e00321 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -391,7 +391,6 @@ acpi_pci_irq_enable ( | |||
391 | u8 pin = 0; | 391 | u8 pin = 0; |
392 | int edge_level = ACPI_LEVEL_SENSITIVE; | 392 | int edge_level = ACPI_LEVEL_SENSITIVE; |
393 | int active_high_low = ACPI_ACTIVE_LOW; | 393 | int active_high_low = ACPI_ACTIVE_LOW; |
394 | extern int via_interrupt_line_quirk; | ||
395 | char *link = NULL; | 394 | char *link = NULL; |
396 | 395 | ||
397 | ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); | 396 | ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); |
@@ -444,9 +443,6 @@ acpi_pci_irq_enable ( | |||
444 | } | 443 | } |
445 | } | 444 | } |
446 | 445 | ||
447 | if (via_interrupt_line_quirk) | ||
448 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15); | ||
449 | |||
450 | dev->irq = acpi_register_gsi(irq, edge_level, active_high_low); | 446 | dev->irq = acpi_register_gsi(irq, edge_level, active_high_low); |
451 | 447 | ||
452 | printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ", | 448 | printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ", |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 026aa04669a2..afc9d29acd8a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/acpi.h> | ||
21 | #include "pci.h" | 22 | #include "pci.h" |
22 | 23 | ||
23 | /* Deal with broken BIOS'es that neglect to enable passive release, | 24 | /* Deal with broken BIOS'es that neglect to enable passive release, |
@@ -467,9 +468,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, | |||
467 | * non-x86 architectures (yes Via exists on PPC among other places), | 468 | * non-x86 architectures (yes Via exists on PPC among other places), |
468 | * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get | 469 | * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get |
469 | * interrupts delivered properly. | 470 | * interrupts delivered properly. |
470 | * | ||
471 | * TODO: When we have device-specific interrupt routers, | ||
472 | * quirk_via_irqpic will go away from quirks. | ||
473 | */ | 471 | */ |
474 | 472 | ||
475 | /* | 473 | /* |
@@ -494,6 +492,29 @@ static void __devinit quirk_via_acpi(struct pci_dev *d) | |||
494 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi ); | 492 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi ); |
495 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi ); | 493 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi ); |
496 | 494 | ||
495 | static void __devinit quirk_via_irqpic(struct pci_dev *dev) | ||
496 | { | ||
497 | u8 irq, new_irq; | ||
498 | |||
499 | #ifdef CONFIG_X86_IO_APIC | ||
500 | if (nr_ioapics && !skip_ioapic_setup) | ||
501 | return; | ||
502 | #endif | ||
503 | #ifdef CONFIG_ACPI | ||
504 | if (acpi_irq_model != ACPI_IRQ_MODEL_PIC) | ||
505 | return; | ||
506 | #endif | ||
507 | new_irq = dev->irq & 0xf; | ||
508 | pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); | ||
509 | if (new_irq != irq) { | ||
510 | printk(KERN_INFO "PCI: Via PIC IRQ fixup for %s, from %d to %d\n", | ||
511 | pci_name(dev), irq, new_irq); | ||
512 | udelay(15); /* unknown if delay really needed */ | ||
513 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); | ||
514 | } | ||
515 | } | ||
516 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irqpic); | ||
517 | |||
497 | /* | 518 | /* |
498 | * PIIX3 USB: We have to disable USB interrupts that are | 519 | * PIIX3 USB: We have to disable USB interrupts that are |
499 | * hardwired to PIRQD# and may be shared with an | 520 | * hardwired to PIRQD# and may be shared with an |
@@ -683,19 +704,6 @@ static void __init quirk_disable_pxb(struct pci_dev *pdev) | |||
683 | } | 704 | } |
684 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); | 705 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); |
685 | 706 | ||
686 | /* | ||
687 | * VIA northbridges care about PCI_INTERRUPT_LINE | ||
688 | */ | ||
689 | int via_interrupt_line_quirk; | ||
690 | |||
691 | static void __devinit quirk_via_bridge(struct pci_dev *pdev) | ||
692 | { | ||
693 | if(pdev->devfn == 0) { | ||
694 | printk(KERN_INFO "PCI: Via IRQ fixup\n"); | ||
695 | via_interrupt_line_quirk = 1; | ||
696 | } | ||
697 | } | ||
698 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_bridge ); | ||
699 | 707 | ||
700 | /* | 708 | /* |
701 | * Serverworks CSB5 IDE does not fully support native mode | 709 | * Serverworks CSB5 IDE does not fully support native mode |