Commit c03b3b07 authored by Jiang Liu's avatar Jiang Liu Committed by Thomas Gleixner

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: default avatarJiang 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.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 6a38fa0e
...@@ -115,6 +115,7 @@ static void __init MP_bus_info(struct mpc_bus *m) ...@@ -115,6 +115,7 @@ static void __init MP_bus_info(struct mpc_bus *m)
static struct irq_domain_ops mp_ioapic_irqdomain_ops = { static struct irq_domain_ops mp_ioapic_irqdomain_ops = {
.map = mp_irqdomain_map, .map = mp_irqdomain_map,
.unmap = mp_irqdomain_unmap,
}; };
static void __init MP_ioapic_info(struct mpc_ioapic *m) static void __init MP_ioapic_info(struct mpc_ioapic *m)
......
...@@ -26,6 +26,7 @@ static int acer_tm360_irqrouting; ...@@ -26,6 +26,7 @@ static int acer_tm360_irqrouting;
static struct irq_routing_table *pirq_table; static struct irq_routing_table *pirq_table;
static int pirq_enable_irq(struct pci_dev *dev); static int pirq_enable_irq(struct pci_dev *dev);
static void pirq_disable_irq(struct pci_dev *dev);
/* /*
* Never use: 0, 1, 2 (timer, keyboard, and cascade) * Never use: 0, 1, 2 (timer, keyboard, and cascade)
...@@ -53,7 +54,7 @@ struct irq_router_handler { ...@@ -53,7 +54,7 @@ struct irq_router_handler {
}; };
int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq; int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq;
void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; void (*pcibios_disable_irq)(struct pci_dev *dev) = pirq_disable_irq;
/* /*
* Check passed address for the PCI IRQ Routing Table signature * Check passed address for the PCI IRQ Routing Table signature
...@@ -1186,7 +1187,7 @@ void pcibios_penalize_isa_irq(int irq, int active) ...@@ -1186,7 +1187,7 @@ void pcibios_penalize_isa_irq(int irq, int active)
static int pirq_enable_irq(struct pci_dev *dev) static int pirq_enable_irq(struct pci_dev *dev)
{ {
u8 pin; u8 pin = 0;
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
if (pin && !pcibios_lookup_irq(dev, 1)) { if (pin && !pcibios_lookup_irq(dev, 1)) {
...@@ -1252,3 +1253,11 @@ static int pirq_enable_irq(struct pci_dev *dev) ...@@ -1252,3 +1253,11 @@ static int pirq_enable_irq(struct pci_dev *dev)
} }
return 0; return 0;
} }
static void pirq_disable_irq(struct pci_dev *dev)
{
if (io_apic_assign_pci_irqs && dev->irq) {
mp_unmap_irq(dev->irq);
dev->irq = 0;
}
}
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