aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <lenb@toshiba.hsd1.ma.comcast.net>2005-05-27 04:21:50 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-27 11:15:04 -0400
commit25be5e6ccc5c9cab77012fabbb72520f9b6e4618 (patch)
tree4c1b48179d7f18b3e037a473d8e04708b619ac5c
parent2efe86b809d97debaaf9fcc13b041aedf15bd3d2 (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>
-rw-r--r--arch/i386/pci/irq.c5
-rw-r--r--drivers/acpi/pci_irq.c4
-rw-r--r--drivers/pci/quirks.c40
-rw-r--r--include/linux/acpi.h5
4 files changed, 28 insertions, 26 deletions
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index d6598da4b67b..da21b1d07c15 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -1029,7 +1029,6 @@ void pcibios_penalize_isa_irq(int irq)
1029static int pirq_enable_irq(struct pci_dev *dev) 1029static int pirq_enable_irq(struct pci_dev *dev)
1030{ 1030{
1031 u8 pin; 1031 u8 pin;
1032 extern int via_interrupt_line_quirk;
1033 struct pci_dev *temp_dev; 1032 struct pci_dev *temp_dev;
1034 1033
1035 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); 1034 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
@@ -1084,10 +1083,6 @@ static int pirq_enable_irq(struct pci_dev *dev)
1084 printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", 1083 printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n",
1085 'A' + pin, pci_name(dev), msg); 1084 'A' + pin, pci_name(dev), msg);
1086 } 1085 }
1087 /* VIA bridges use interrupt line for apic/pci steering across
1088 the V-Link */
1089 else if (via_interrupt_line_quirk)
1090 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15);
1091 return 0; 1086 return 0;
1092} 1087}
1093 1088
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)
494DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi ); 492DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi );
495DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi ); 493DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi );
496 494
495static 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}
516DECLARE_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}
684DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); 705DECLARE_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 */
689int via_interrupt_line_quirk;
690
691static 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}
698DECLARE_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
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index aefe6d051ace..d5a55bdb9c3c 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,6 +25,8 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#ifdef CONFIG_ACPI
29
28#ifndef _LINUX 30#ifndef _LINUX
29#define _LINUX 31#define _LINUX
30#endif 32#endif
@@ -533,4 +535,5 @@ static inline int acpi_get_pxm(acpi_handle handle)
533 535
534extern int pnpacpi_disabled; 536extern int pnpacpi_disabled;
535 537
536#endif /*_LINUX_ACPI_H*/ 538#endif /* CONFIG_ACPI */
539#endif /*_LINUX_ACPI_H*/