From: Yinghai Lu <yinghai@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>,
Suresh Siddha <suresh.b.siddha@intel.com>
Subject: [PATCH 1/7] x86, irq: Modify irq chip one time when irq remapping is enabled
Date: Thu, 26 Jan 2012 23:25:47 -0800 [thread overview]
Message-ID: <1327649153-16477-2-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1327649153-16477-1-git-send-email-yinghai@kernel.org>
So we don't need change irq chip during every irq setup.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
---
arch/x86/include/asm/io_apic.h | 2 ++
arch/x86/kernel/apic/apic.c | 9 ++++++++-
arch/x86/kernel/apic/io_apic.c | 23 +++++++++++++++++------
3 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 690d1cc..142a6b9 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -176,6 +176,8 @@ extern void mp_save_irq(struct mpc_intsrc *m);
extern void disable_ioapic_support(void);
+void irq_remap_modify_chips(void);
+
#else /* !CONFIG_X86_IO_APIC */
#define io_apic_assign_pci_irqs 0
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 2eec05b..87aa884 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1512,6 +1512,8 @@ void enable_x2apic(void)
int __init enable_IR(void)
{
#ifdef CONFIG_IRQ_REMAP
+ int ret;
+
if (!intr_remapping_supported()) {
pr_debug("intr-remapping not supported\n");
return -1;
@@ -1523,7 +1525,12 @@ int __init enable_IR(void)
return -1;
}
- return enable_intr_remapping();
+ ret = enable_intr_remapping();
+
+ if (ret >= 0)
+ irq_remap_modify_chips();
+
+ return ret;
#endif
return -1;
}
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index fb07275..e4ee9bc 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1313,7 +1313,6 @@ static void ioapic_register_intr(unsigned int irq, struct irq_cfg *cfg,
if (irq_remapped(cfg)) {
irq_set_status_flags(irq, IRQ_MOVE_PCNTXT);
- irq_remap_modify_chip_defaults(chip);
fasteoi = trigger != 0;
}
@@ -2634,6 +2633,8 @@ static void ir_print_prefix(struct irq_data *data, struct seq_file *p)
static void irq_remap_modify_chip_defaults(struct irq_chip *chip)
{
+ apic_printk(APIC_DEBUG, KERN_DEBUG "irq_chip: %s ==> IR-%s",
+ chip->name, chip->name);
chip->irq_print_chip = ir_print_prefix;
chip->irq_ack = ir_ack_apic_edge;
chip->irq_eoi = ir_ack_apic_level;
@@ -3268,10 +3269,8 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
irq_set_msi_desc(irq, msidesc);
write_msi_msg(irq, &msg);
- if (irq_remapped(irq_get_chip_data(irq))) {
+ if (irq_remapped(irq_get_chip_data(irq)))
irq_set_status_flags(irq, IRQ_MOVE_PCNTXT);
- irq_remap_modify_chip_defaults(chip);
- }
irq_set_chip_and_handler_name(irq, chip, handle_edge_irq, "edge");
@@ -3459,8 +3458,6 @@ int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
hpet_msi_write(irq_get_handler_data(irq), &msg);
irq_set_status_flags(irq, IRQ_MOVE_PCNTXT);
- if (irq_remapped(irq_get_chip_data(irq)))
- irq_remap_modify_chip_defaults(chip);
irq_set_chip_and_handler_name(irq, chip, handle_edge_irq, "edge");
return 0;
@@ -3468,6 +3465,20 @@ int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
#endif
#endif /* CONFIG_PCI_MSI */
+
+void irq_remap_modify_chips(void)
+{
+#ifdef CONFIG_IRQ_REMAP
+ irq_remap_modify_chip_defaults(&ioapic_chip);
+# ifdef CONFIG_PCI_MSI
+ irq_remap_modify_chip_defaults(&msi_chip);
+# ifdef CONFIG_HPET_TIMER
+ irq_remap_modify_chip_defaults(&hpet_msi_type);
+# endif
+# endif
+#endif
+}
+
/*
* Hypertransport interrupt support
*/
--
1.7.7
next prev parent reply other threads:[~2012-01-27 7:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 7:25 [PATCH 0/7] x86/irq related fix Yinghai Lu
2012-01-27 7:25 ` Yinghai Lu [this message]
2012-01-27 7:25 ` [PATCH 2/7] x86, irq: more clear about msix printout Yinghai Lu
2012-01-27 7:25 ` [PATCH 3/7] x86, irq: Let msi-x to shown as MSI-X in /proc/interrupt Yinghai Lu
2012-01-27 7:25 ` [PATCH 4/7] x86, irq: Make dmar_msi/hpet_msi irq_chip name consistent Yinghai Lu
2012-01-27 7:25 ` [PATCH 5/7] ia64, irq: add dummy create_irq_nr() Yinghai Lu
2012-01-27 7:25 ` [PATCH 6/7] iommu, irq: alloc irq_desc for dmar_msi with local node Yinghai Lu
2012-01-27 7:25 ` [PATCH 7/7] x86, irq: kill create_irq() Yinghai Lu
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=1327649153-16477-2-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome