diff options
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index a157b666ac36..654b69b836b6 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -237,6 +237,19 @@ static struct irq_pin_list *alloc_irq_pin_list(int node) | |||
237 | return kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node); | 237 | return kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node); |
238 | } | 238 | } |
239 | 239 | ||
240 | static void alloc_ioapic_saved_registers(int idx) | ||
241 | { | ||
242 | size_t size; | ||
243 | |||
244 | if (ioapics[idx].saved_registers) | ||
245 | return; | ||
246 | |||
247 | size = sizeof(struct IO_APIC_route_entry) * ioapics[idx].nr_registers; | ||
248 | ioapics[idx].saved_registers = kzalloc(size, GFP_KERNEL); | ||
249 | if (!ioapics[idx].saved_registers) | ||
250 | pr_err("IOAPIC %d: suspend/resume impossible!\n", idx); | ||
251 | } | ||
252 | |||
240 | int __init arch_early_irq_init(void) | 253 | int __init arch_early_irq_init(void) |
241 | { | 254 | { |
242 | struct irq_cfg *cfg; | 255 | struct irq_cfg *cfg; |
@@ -245,13 +258,8 @@ int __init arch_early_irq_init(void) | |||
245 | if (!nr_legacy_irqs()) | 258 | if (!nr_legacy_irqs()) |
246 | io_apic_irqs = ~0UL; | 259 | io_apic_irqs = ~0UL; |
247 | 260 | ||
248 | for_each_ioapic(i) { | 261 | for_each_ioapic(i) |
249 | ioapics[i].saved_registers = | 262 | alloc_ioapic_saved_registers(i); |
250 | kzalloc(sizeof(struct IO_APIC_route_entry) * | ||
251 | ioapics[i].nr_registers, GFP_KERNEL); | ||
252 | if (!ioapics[i].saved_registers) | ||
253 | pr_err("IOAPIC %d: suspend/resume impossible!\n", i); | ||
254 | } | ||
255 | 263 | ||
256 | /* | 264 | /* |
257 | * For legacy IRQ's, start with assigning irq0 to irq15 to | 265 | * For legacy IRQ's, start with assigning irq0 to irq15 to |