diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-06-09 04:20:08 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 17:05:44 -0400 |
commit | c03b3b0738a56cf283b0d05256988d5e3c8bd719 (patch) | |
tree | b648eb3b32bba2194256535545c271d9c749f76c | |
parent | 6a38fa0e3c94dfd1394a71a2d47c9c4d47367374 (diff) |
x86, irq, mpparse: Release IOAPIC pin when PCI device is disabled
Release IOAPIC pin associated with PCI device when the PCI device
is disabled.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1402302011-23642-40-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/mpparse.c | 1 | ||||
-rw-r--r-- | arch/x86/pci/irq.c | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index faf503aa3b70..fde86d2b79f8 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -115,6 +115,7 @@ static void __init MP_bus_info(struct mpc_bus *m) | |||
115 | 115 | ||
116 | static struct irq_domain_ops mp_ioapic_irqdomain_ops = { | 116 | static struct irq_domain_ops mp_ioapic_irqdomain_ops = { |
117 | .map = mp_irqdomain_map, | 117 | .map = mp_irqdomain_map, |
118 | .unmap = mp_irqdomain_unmap, | ||
118 | }; | 119 | }; |
119 | 120 | ||
120 | static void __init MP_ioapic_info(struct mpc_ioapic *m) | 121 | static void __init MP_ioapic_info(struct mpc_ioapic *m) |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index e4200e5e775e..748cfe8ab322 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -26,6 +26,7 @@ static int acer_tm360_irqrouting; | |||
26 | static struct irq_routing_table *pirq_table; | 26 | static struct irq_routing_table *pirq_table; |
27 | 27 | ||
28 | static int pirq_enable_irq(struct pci_dev *dev); | 28 | static int pirq_enable_irq(struct pci_dev *dev); |
29 | static void pirq_disable_irq(struct pci_dev *dev); | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Never use: 0, 1, 2 (timer, keyboard, and cascade) | 32 | * Never use: 0, 1, 2 (timer, keyboard, and cascade) |
@@ -53,7 +54,7 @@ struct irq_router_handler { | |||
53 | }; | 54 | }; |
54 | 55 | ||
55 | int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq; | 56 | int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq; |
56 | void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; | 57 | void (*pcibios_disable_irq)(struct pci_dev *dev) = pirq_disable_irq; |
57 | 58 | ||
58 | /* | 59 | /* |
59 | * Check passed address for the PCI IRQ Routing Table signature | 60 | * Check passed address for the PCI IRQ Routing Table signature |
@@ -1186,7 +1187,7 @@ void pcibios_penalize_isa_irq(int irq, int active) | |||
1186 | 1187 | ||
1187 | static int pirq_enable_irq(struct pci_dev *dev) | 1188 | static int pirq_enable_irq(struct pci_dev *dev) |
1188 | { | 1189 | { |
1189 | u8 pin; | 1190 | u8 pin = 0; |
1190 | 1191 | ||
1191 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 1192 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
1192 | if (pin && !pcibios_lookup_irq(dev, 1)) { | 1193 | if (pin && !pcibios_lookup_irq(dev, 1)) { |
@@ -1252,3 +1253,11 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1252 | } | 1253 | } |
1253 | return 0; | 1254 | return 0; |
1254 | } | 1255 | } |
1256 | |||
1257 | static void pirq_disable_irq(struct pci_dev *dev) | ||
1258 | { | ||
1259 | if (io_apic_assign_pci_irqs && dev->irq) { | ||
1260 | mp_unmap_irq(dev->irq); | ||
1261 | dev->irq = 0; | ||
1262 | } | ||
1263 | } | ||