linux/arch/x86/kernel/apic
Rui Wang 9d98bcec73 x86/ioapic: Fix incorrect pointers in ioapic_setup_resources()
On a 4-socket Brickland system, hot-removing one ioapic is fine.
Hot-removing the 2nd one causes panic in mp_unregister_ioapic()
while calling release_resource().

It is because the iomem_res pointer has already been released
when removing the first ioapic.

To explain the use of &res[num] here: res is assigned to ioapic_resources,
and later in ioapic_insert_resources() we do:

	struct resource *r = ioapic_resources;

        for_each_ioapic(i) {
                insert_resource(&iomem_resource, r);
                r++;
        }

Here 'r' is treated as an arry of 'struct resource', and the r++ ensures
that each element of the array is inserted separately. Thus we should call
release_resouce() on each element at &res[num].

Fix it by assigning the correct pointers to ioapics[i].iomem_res in
ioapic_setup_resources().

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tony.luck@intel.com
Cc: linux-pci@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org
Cc: bhelgaas@google.com
Link: http://lkml.kernel.org/r/1465369193-4816-3-git-send-email-rui.y.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-06-10 14:45:54 +02:00
..
Makefile kernel: add kcov code coverage 2016-03-22 15:36:02 -07:00
apic.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
apic_flat_64.c x86/apic: Deinline _flat_send_IPI_mask, save ~150 bytes 2016-03-08 12:26:41 +01:00
apic_noop.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
apic_numachip.c x86/cpufeature: Replace the old static_cpu_has() with safe variant 2016-01-30 11:22:18 +01:00
bigsmp_32.c x86/apic: Wire up single IPI for bigsmp_apic 2015-11-05 13:07:52 +01:00
htirq.c x86: Constify irqdomain ops 2015-05-05 11:14:48 +02:00
hw_nmi.c printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
io_apic.c x86/ioapic: Fix incorrect pointers in ioapic_setup_resources() 2016-06-10 14:45:54 +02:00
ipi.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
msi.c x86/irq: Export functions to allow MSI domains in modules 2015-12-20 12:40:49 +01:00
probe_32.c x86/apic: Use default send single IPI wrapper 2015-11-05 13:07:53 +01:00
probe_64.c x86/platform: Introduce APIC post-initialization callback 2012-06-06 09:06:19 +02:00
vector.c Merge branch 'x86/urgent' into x86/asm, to refresh the tree 2016-04-29 11:55:04 +02:00
x2apic_cluster.c x86/apic: Implement single target IPI function for x2apic_cluster 2015-11-05 13:07:52 +01:00
x2apic_phys.c x86/apic: Implement single IPI for x2apic_phys 2015-11-05 13:07:53 +01:00
x2apic_uv_x.c Merge branch 'x86/urgent' into x86/platform, to resolve conflict 2016-05-05 09:56:10 +02:00