[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-8cda974ab278dd8d4a9024085535f71175ddf38d@git.kernel.org>
Date: Mon, 3 Nov 2014 02:58:55 -0800
From: tip-bot for Yinghai Lu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: rdunlap@...radead.org, sebastian@...akpoint.cc,
benh@...nel.crashing.org, konrad.wilk@...cle.com,
jiang.liu@...ux.intel.com, mingo@...nel.org, bhelgaas@...gle.com,
hpa@...or.com, prarit@...hat.com, linux-kernel@...r.kernel.org,
bp@...en8.de, rjw@...ysocki.net, yinghai@...nel.org,
joro@...tes.org, tony.luck@...el.com, gregkh@...uxfoundation.org,
tglx@...utronix.de, grant.likely@...aro.org
Subject: [tip:x86/apic] x86, irq: Split out alloc_ioapic_save_registers()
Commit-ID: 8cda974ab278dd8d4a9024085535f71175ddf38d
Gitweb: http://git.kernel.org/tip/8cda974ab278dd8d4a9024085535f71175ddf38d
Author: Yinghai Lu <yinghai@...nel.org>
AuthorDate: Mon, 27 Oct 2014 13:21:39 +0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Mon, 3 Nov 2014 11:56:07 +0100
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: Yinghai Lu <yinghai@...nel.org>
Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: Joerg Roedel <joro@...tes.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Sebastian Andrzej Siewior <sebastian@...akpoint.cc>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Rafael J. Wysocki <rjw@...ysocki.net>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Randy Dunlap <rdunlap@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Grant Likely <grant.likely@...aro.org>
Cc: Prarit Bhargava <prarit@...hat.com>
Link: http://lkml.kernel.org/r/1414387308-27148-10-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
arch/x86/kernel/apic/io_apic.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 1183d54..acaee90 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)
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)
{
struct irq_cfg *cfg;
@@ -245,13 +258,8 @@ int __init arch_early_irq_init(void)
if (!nr_legacy_irqs())
io_apic_irqs = ~0UL;
- for_each_ioapic(i) {
- ioapics[i].saved_registers =
- 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_each_ioapic(i)
+ alloc_ioapic_saved_registers(i);
/*
* For legacy IRQ's, start with assigning irq0 to irq15 to
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists