Commit 7e899419 authored by Yinghai Lu's avatar Yinghai Lu Committed by Thomas Gleixner

x86, irq: Split out alloc_ioapic_save_registers()

Split out alloc_ioapic_save_registers() from early_irq_init(),
so it could be used for ioapic hotplug later.
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
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: Borislav Petkov <bp@alien8.de>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Link: http://lkml.kernel.org/r/1414387308-27148-10-git-send-email-jiang.liu@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 13ca62b2
...@@ -237,6 +237,19 @@ static struct irq_pin_list *alloc_irq_pin_list(int node) ...@@ -237,6 +237,19 @@ static struct irq_pin_list *alloc_irq_pin_list(int node)
return kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node); return kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node);
} }
static void alloc_ioapic_saved_registers(int idx)
{
size_t size;
if (ioapics[idx].saved_registers)
return;
size = sizeof(struct IO_APIC_route_entry) * ioapics[idx].nr_registers;
ioapics[idx].saved_registers = kzalloc(size, GFP_KERNEL);
if (!ioapics[idx].saved_registers)
pr_err("IOAPIC %d: suspend/resume impossible!\n", idx);
}
int __init arch_early_irq_init(void) int __init arch_early_irq_init(void)
{ {
struct irq_cfg *cfg; struct irq_cfg *cfg;
...@@ -245,13 +258,8 @@ int __init arch_early_irq_init(void) ...@@ -245,13 +258,8 @@ int __init arch_early_irq_init(void)
if (!nr_legacy_irqs()) if (!nr_legacy_irqs())
io_apic_irqs = ~0UL; io_apic_irqs = ~0UL;
for_each_ioapic(i) { for_each_ioapic(i)
ioapics[i].saved_registers = alloc_ioapic_saved_registers(i);
kzalloc(sizeof(struct IO_APIC_route_entry) *
ioapics[i].nr_registers, GFP_KERNEL);
if (!ioapics[i].saved_registers)
pr_err("IOAPIC %d: suspend/resume impossible!\n", i);
}
/* /*
* For legacy IRQ's, start with assigning irq0 to irq15 to * For legacy IRQ's, start with assigning irq0 to irq15 to
......
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