diff options
author | Chen Yu <yu.c.chen@intel.com> | 2015-10-24 13:02:19 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-25 23:39:25 -0400 |
commit | 49e4b84333f338d4f183f28f1f3c1131b9fb2b5a (patch) | |
tree | ce656bcbb514d7d6004847e214f3c1c2fe03de2e | |
parent | 32b88194f71d6ae7768a29f87fbba454728273ee (diff) |
ACPI: Use correct IRQ when uninstalling ACPI interrupt handler
Currently when the system is trying to uninstall the ACPI interrupt
handler, it uses acpi_gbl_FADT.sci_interrupt as the IRQ number.
However, the IRQ number that the ACPI interrupt handled is installed
for comes from acpi_gsi_to_irq() and that is the number that should
be used for the handler removal.
Fix this problem by using the mapped IRQ returned from acpi_gsi_to_irq()
as appropriate.
Cc: All applicable <stable@vger.kernel.org>
Acked-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/osl.c | 9 | ||||
-rw-r--r-- | include/linux/acpi.h | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 739a4a6b3b9b..2a25919f8eab 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -81,6 +81,7 @@ static struct workqueue_struct *kacpid_wq; | |||
81 | static struct workqueue_struct *kacpi_notify_wq; | 81 | static struct workqueue_struct *kacpi_notify_wq; |
82 | static struct workqueue_struct *kacpi_hotplug_wq; | 82 | static struct workqueue_struct *kacpi_hotplug_wq; |
83 | static bool acpi_os_initialized; | 83 | static bool acpi_os_initialized; |
84 | unsigned int acpi_sci_irq = INVALID_ACPI_IRQ; | ||
84 | 85 | ||
85 | /* | 86 | /* |
86 | * This list of permanent mappings is for memory that may be accessed from | 87 | * This list of permanent mappings is for memory that may be accessed from |
@@ -856,17 +857,19 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, | |||
856 | acpi_irq_handler = NULL; | 857 | acpi_irq_handler = NULL; |
857 | return AE_NOT_ACQUIRED; | 858 | return AE_NOT_ACQUIRED; |
858 | } | 859 | } |
860 | acpi_sci_irq = irq; | ||
859 | 861 | ||
860 | return AE_OK; | 862 | return AE_OK; |
861 | } | 863 | } |
862 | 864 | ||
863 | acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) | 865 | acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler handler) |
864 | { | 866 | { |
865 | if (irq != acpi_gbl_FADT.sci_interrupt) | 867 | if (gsi != acpi_gbl_FADT.sci_interrupt || !acpi_sci_irq_valid()) |
866 | return AE_BAD_PARAMETER; | 868 | return AE_BAD_PARAMETER; |
867 | 869 | ||
868 | free_irq(irq, acpi_irq); | 870 | free_irq(acpi_sci_irq, acpi_irq); |
869 | acpi_irq_handler = NULL; | 871 | acpi_irq_handler = NULL; |
872 | acpi_sci_irq = INVALID_ACPI_IRQ; | ||
870 | 873 | ||
871 | return AE_OK; | 874 | return AE_OK; |
872 | } | 875 | } |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 43856d19cf4d..1ae6ba06f9ac 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -193,6 +193,12 @@ int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base); | |||
193 | void acpi_irq_stats_init(void); | 193 | void acpi_irq_stats_init(void); |
194 | extern u32 acpi_irq_handled; | 194 | extern u32 acpi_irq_handled; |
195 | extern u32 acpi_irq_not_handled; | 195 | extern u32 acpi_irq_not_handled; |
196 | extern unsigned int acpi_sci_irq; | ||
197 | #define INVALID_ACPI_IRQ ((unsigned)-1) | ||
198 | static inline bool acpi_sci_irq_valid(void) | ||
199 | { | ||
200 | return acpi_sci_irq != INVALID_ACPI_IRQ; | ||
201 | } | ||
196 | 202 | ||
197 | extern int sbf_port; | 203 | extern int sbf_port; |
198 | extern unsigned long acpi_realmode_flags; | 204 | extern unsigned long acpi_realmode_flags; |