diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-10-27 01:21:47 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-12-16 08:08:15 -0500 |
commit | e89900c9ad75a1b80e1f1f46ce9c9bb0e7ea1d96 (patch) | |
tree | 34711ca047dd11efbf4dd06cb0cc995822dbe03f /arch/x86/kernel/acpi/boot.c | |
parent | 15516a3b8633a32f03a82a2db23b87cf9600514c (diff) |
x86, irq: Introduce helper to check whether an IOAPIC has been registered
Introduce acpi_ioapic_registered() to check whether an IOAPIC has already
been registered, it will be used when enabling IOAPIC hotplug.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.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: Borislav Petkov <bp@alien8.de>
Cc: Len Brown <len.brown@intel.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Link: http://lkml.kernel.org/r/1414387308-27148-18-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/acpi/boot.c')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 5427d9b70f75..ddddaed91872 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -826,6 +826,28 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) | |||
826 | } | 826 | } |
827 | EXPORT_SYMBOL(acpi_unregister_ioapic); | 827 | EXPORT_SYMBOL(acpi_unregister_ioapic); |
828 | 828 | ||
829 | /** | ||
830 | * acpi_ioapic_registered - Check whether IOAPIC assoicatied with @gsi_base | ||
831 | * has been registered | ||
832 | * @handle: ACPI handle of the IOAPIC deivce | ||
833 | * @gsi_base: GSI base associated with the IOAPIC | ||
834 | * | ||
835 | * Assume caller holds some type of lock to serialize acpi_ioapic_registered() | ||
836 | * with acpi_register_ioapic()/acpi_unregister_ioapic(). | ||
837 | */ | ||
838 | int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base) | ||
839 | { | ||
840 | int ret = 0; | ||
841 | |||
842 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | ||
843 | mutex_lock(&acpi_ioapic_lock); | ||
844 | ret = mp_ioapic_registered(gsi_base); | ||
845 | mutex_unlock(&acpi_ioapic_lock); | ||
846 | #endif | ||
847 | |||
848 | return ret; | ||
849 | } | ||
850 | |||
829 | static int __init acpi_parse_sbf(struct acpi_table_header *table) | 851 | static int __init acpi_parse_sbf(struct acpi_table_header *table) |
830 | { | 852 | { |
831 | struct acpi_table_boot *sb; | 853 | struct acpi_table_boot *sb; |