From: Jiang Liu <jiang.liu@linux.intel.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Bjorn Helgaas <bhelgaas@google.com>,
Randy Dunlap <rdunlap@infradead.org>,
Yinghai Lu <yinghai@kernel.org>, Borislav Petkov <bp@alien8.de>,
Grant Likely <grant.likely@linaro.org>
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Tony Luck <tony.luck@intel.com>, Joerg Roedel <joro@8bytes.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [RFC Part1 v1 13/18] x86, irq: Move IRQ initialization routines from io_apic.c into vector.c
Date: Thu, 11 Sep 2014 16:25:00 +0800 [thread overview]
Message-ID: <1410423905-26239-14-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <1410423905-26239-1-git-send-email-jiang.liu@linux.intel.com>
Move IRQ initialization routines from io_apic.c into vector.c,
preparing for enabling hierarchy irqdomain.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
arch/x86/include/asm/io_apic.h | 2 ++
arch/x86/kernel/apic/io_apic.c | 22 +---------------------
arch/x86/kernel/apic/vector.c | 28 ++++++++++++++++++++++++++++
3 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 533803dc3733..7bf86bfe05b1 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -145,6 +145,7 @@ extern unsigned long io_apic_irqs;
struct irq_cfg;
extern void ioapic_insert_resources(void);
+extern int arch_early_ioapic_init(void);
extern int native_setup_ioapic_entry(int, struct IO_APIC_route_entry *,
unsigned int, int,
@@ -249,6 +250,7 @@ extern void print_IO_APICs(void);
#define io_apic_assign_pci_irqs 0
#define setup_ioapic_ids_from_mpc x86_init_noop
static inline void ioapic_insert_resources(void) { }
+static inline int arch_early_ioapic_init(void) { return 0; }
static inline void print_IO_APICs(void) {}
#define gsi_top (NR_IRQS_LEGACY)
static inline int mp_find_ioapic(u32 gsi) { return 0; }
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index e2b3e8b40fcb..f51143507c1c 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -245,7 +245,7 @@ static void free_ioapic_saved_registers(int idx)
ioapics[idx].saved_registers = NULL;
}
-int __init arch_early_irq_init(void)
+int __init arch_early_ioapic_init(void)
{
struct irq_cfg *cfg;
int i, node = cpu_to_node(0);
@@ -2486,26 +2486,6 @@ unsigned int arch_dynirq_lower_bound(unsigned int from)
return ioapic_initialized ? ioapic_dynirq_base : gsi_top;
}
-int __init arch_probe_nr_irqs(void)
-{
- int nr;
-
- if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
- nr_irqs = NR_VECTORS * nr_cpu_ids;
-
- nr = (gsi_top + nr_legacy_irqs()) + 8 * nr_cpu_ids;
-#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
- /*
- * for MSI and HT dyn irq
- */
- nr += gsi_top * 16;
-#endif
- if (nr < nr_irqs)
- nr_irqs = nr;
-
- return 0;
-}
-
#ifdef CONFIG_X86_32
static int io_apic_get_unique_id(int ioapic, int apic_id)
{
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index f728cbfc29a9..2df1bff738b1 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -235,6 +235,34 @@ void clear_irq_vector(int irq, struct irq_cfg *cfg)
raw_spin_unlock_irqrestore(&vector_lock, flags);
}
+int __init arch_probe_nr_irqs(void)
+{
+ int nr;
+
+ if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
+ nr_irqs = NR_VECTORS * nr_cpu_ids;
+
+ nr = (gsi_top + nr_legacy_irqs()) + 8 * nr_cpu_ids;
+#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
+ /*
+ * for MSI and HT dyn irq
+ */
+ if (gsi_top <= NR_IRQS_LEGACY)
+ nr += 8 * nr_cpu_ids;
+ else
+ nr += gsi_top * 16;
+#endif
+ if (nr < nr_irqs)
+ nr_irqs = nr;
+
+ return 0;
+}
+
+int __init arch_early_irq_init(void)
+{
+ return arch_early_ioapic_init();
+}
+
static void __setup_vector_irq(int cpu)
{
/* Initialize vector_irq on a new cpu */
--
1.7.10.4
next prev parent reply other threads:[~2014-09-11 8:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 8:24 [RFC Part1 v1 00/18] Prepare for enabling hierarchy irqdomain on x86 Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 01/18] x86, irq, ACPI: Fix building warning of unused code Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 02/18] x86, irq: Kill fourth parameter of IO_APIC_get_PCI_irq_vector() Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 03/18] x86, irq: Convert irq_2_pin list to generic list Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 04/18] x86, irq: Refine hw_irq.h to prepare for irqdomain support Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 05/18] x86, irq: Rename local APIC related functions in io_apic.c as apic_xxx() Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 06/18] x86, irq: Protect __clear_irq_vector() with vector_lock Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 07/18] x86, irq: Introduce helpers to access struct irq_cfg Jiang Liu
2014-09-11 9:27 ` Thomas Gleixner
2014-09-11 14:47 ` Thomas Gleixner
2014-09-11 8:24 ` [RFC Part1 v1 08/18] x86, irq: Move local APIC related code from io_apic.c into vector.c Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 09/18] x86, irq: Replace printk(KERN_LVL) with pr_lvl() utilities Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 10/18] x86, irq: Move PCI MSI related code from io_apic.c into msi.c Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 11/18] x86, irq: Move HT IRQ related code from io_apic.c into htirq.c Jiang Liu
2014-09-11 8:24 ` [RFC Part1 v1 12/18] x86, irq: Move IOAPIC related declarations from hw_irq.h into io_apic.h Jiang Liu
2014-09-11 8:25 ` Jiang Liu [this message]
2014-09-11 8:25 ` [RFC Part1 v1 14/18] x86, irq: Make MSI and HT_IRQ indepenent of X86_IO_APIC Jiang Liu
2014-09-11 8:25 ` [RFC Part1 v1 15/18] x86, irq: Use helpers to access irq_cfg data structure associated with IRQ Jiang Liu
2014-09-11 8:25 ` [RFC Part1 v1 16/18] x86: irq_remapping: " Jiang Liu
2014-09-11 8:25 ` [RFC Part1 v1 17/18] iommu/vt-d: " Jiang Liu
2014-09-11 8:25 ` [RFC Part1 v1 18/18] iommu/amd: " Jiang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410423905-26239-14-git-send-email-jiang.liu@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).