diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-06-10 02:16:27 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 17:05:44 -0400 |
commit | 6a38fa0e3c94dfd1394a71a2d47c9c4d47367374 (patch) | |
tree | 467a9e2bab59c23c4c0659d3d950720ce4b7c729 | |
parent | df334bead7e94772c41745af9f329383067d44ae (diff) |
x86, irq, ACPI: 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>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Link: http://lkml.kernel.org/r/1402380987-32577-1-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 27 | ||||
-rw-r--r-- | drivers/acpi/pci_irq.c | 3 |
2 files changed, 29 insertions, 1 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index fd4b6d2e436c..8c28023924bf 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -421,8 +421,24 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger, | |||
421 | return irq; | 421 | return irq; |
422 | } | 422 | } |
423 | 423 | ||
424 | static void mp_unregister_gsi(u32 gsi) | ||
425 | { | ||
426 | int irq; | ||
427 | |||
428 | if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) | ||
429 | return; | ||
430 | |||
431 | if (acpi_gbl_FADT.sci_interrupt == gsi) | ||
432 | return; | ||
433 | |||
434 | irq = mp_map_gsi_to_irq(gsi, 0); | ||
435 | if (irq > 0) | ||
436 | mp_unmap_irq(irq); | ||
437 | } | ||
438 | |||
424 | static struct irq_domain_ops acpi_irqdomain_ops = { | 439 | static struct irq_domain_ops acpi_irqdomain_ops = { |
425 | .map = mp_irqdomain_map, | 440 | .map = mp_irqdomain_map, |
441 | .unmap = mp_irqdomain_unmap, | ||
426 | }; | 442 | }; |
427 | 443 | ||
428 | static int __init | 444 | static int __init |
@@ -640,8 +656,16 @@ static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi, | |||
640 | return irq; | 656 | return irq; |
641 | } | 657 | } |
642 | 658 | ||
659 | static void acpi_unregister_gsi_ioapic(u32 gsi) | ||
660 | { | ||
661 | #ifdef CONFIG_X86_IO_APIC | ||
662 | mp_unregister_gsi(gsi); | ||
663 | #endif | ||
664 | } | ||
665 | |||
643 | int (*__acpi_register_gsi)(struct device *dev, u32 gsi, | 666 | int (*__acpi_register_gsi)(struct device *dev, u32 gsi, |
644 | int trigger, int polarity) = acpi_register_gsi_pic; | 667 | int trigger, int polarity) = acpi_register_gsi_pic; |
668 | void (*__acpi_unregister_gsi)(u32 gsi) = NULL; | ||
645 | 669 | ||
646 | #ifdef CONFIG_ACPI_SLEEP | 670 | #ifdef CONFIG_ACPI_SLEEP |
647 | int (*acpi_suspend_lowlevel)(void) = x86_acpi_suspend_lowlevel; | 671 | int (*acpi_suspend_lowlevel)(void) = x86_acpi_suspend_lowlevel; |
@@ -661,6 +685,8 @@ EXPORT_SYMBOL_GPL(acpi_register_gsi); | |||
661 | 685 | ||
662 | void acpi_unregister_gsi(u32 gsi) | 686 | void acpi_unregister_gsi(u32 gsi) |
663 | { | 687 | { |
688 | if (__acpi_unregister_gsi) | ||
689 | __acpi_unregister_gsi(gsi); | ||
664 | } | 690 | } |
665 | EXPORT_SYMBOL_GPL(acpi_unregister_gsi); | 691 | EXPORT_SYMBOL_GPL(acpi_unregister_gsi); |
666 | 692 | ||
@@ -668,6 +694,7 @@ static void __init acpi_set_irq_model_ioapic(void) | |||
668 | { | 694 | { |
669 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; | 695 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; |
670 | __acpi_register_gsi = acpi_register_gsi_ioapic; | 696 | __acpi_register_gsi = acpi_register_gsi_ioapic; |
697 | __acpi_unregister_gsi = acpi_unregister_gsi_ioapic; | ||
671 | acpi_ioapic = 1; | 698 | acpi_ioapic = 1; |
672 | } | 699 | } |
673 | 700 | ||
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 9c62340c2360..6ba463ceccc6 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -498,5 +498,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) | |||
498 | */ | 498 | */ |
499 | 499 | ||
500 | dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin)); | 500 | dev_dbg(&dev->dev, "PCI INT %c disabled\n", pin_name(pin)); |
501 | acpi_unregister_gsi(gsi); | 501 | if (gsi >= 0 && dev->irq > 0) |
502 | acpi_unregister_gsi(gsi); | ||
502 | } | 503 | } |