* [PATCH] ia64: Fix IOSAPIC delivery mode setting
@ 2007-10-31 11:06 Kenji Kaneshige
2007-11-07 0:13 ` Luck, Tony
2007-11-07 6:38 ` Kenji Kaneshige
0 siblings, 2 replies; 3+ messages in thread
From: Kenji Kaneshige @ 2007-10-31 11:06 UTC (permalink / raw)
To: linux-ia64
Fix the problem that redirect hit bit in I/O SAPIC RTE is set even
when it must be disabled (e.g. nointroute boot option is set, CPU
hotplug is enabled or percpu vector is enabled).
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
arch/ia64/kernel/iosapic.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6.24-rc1/arch/ia64/kernel/iosapic.c
=================================--- linux-2.6.24-rc1.orig/arch/ia64/kernel/iosapic.c
+++ linux-2.6.24-rc1/arch/ia64/kernel/iosapic.c
@@ -762,6 +762,12 @@ iosapic_register_intr (unsigned int gsi,
unsigned long flags;
struct iosapic_rte_info *rte;
u32 low32;
+ unsigned char dmode;
+
+ if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+ dmode = IOSAPIC_LOWEST_PRIORITY;
+ else
+ dmode = IOSAPIC_FIXED;
/*
* If this GSI has already been registered (i.e., it's a
@@ -791,8 +797,7 @@ iosapic_register_intr (unsigned int gsi,
spin_lock(&irq_desc[irq].lock);
dest = get_target_cpu(gsi, irq);
- err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY,
- polarity, trigger);
+ err = register_intr(gsi, irq, dmode, polarity, trigger);
if (err < 0) {
spin_unlock(&irq_desc[irq].lock);
irq = err;
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [PATCH] ia64: Fix IOSAPIC delivery mode setting 2007-10-31 11:06 [PATCH] ia64: Fix IOSAPIC delivery mode setting Kenji Kaneshige @ 2007-11-07 0:13 ` Luck, Tony 2007-11-07 6:38 ` Kenji Kaneshige 1 sibling, 0 replies; 3+ messages in thread From: Luck, Tony @ 2007-11-07 0:13 UTC (permalink / raw) To: linux-ia64 + if (smp_int_redirect & SMP_IRQ_REDIRECTION) This breaks the build on CONFIG_SMP=n configurations (neither smp_int_redirect nor SMP_IRQ_REDIRECTION is defined). Perhaps you could have: #ifdef CONFIG_SMP static inline char choose_dmode(void) { if (smp_int_redirect & SMP_IRQ_REDIRECTION) return IOSAPIC_LOWEST_PRIORITY; else return IOSAPIC_FIXED: } #else static inline char choose_dmode(void) { return IOSAPIC_FIXED; } #endif ... dmode = choose_dmode(); Unless you can see some less invasive syntax. -Tony ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ia64: Fix IOSAPIC delivery mode setting 2007-10-31 11:06 [PATCH] ia64: Fix IOSAPIC delivery mode setting Kenji Kaneshige 2007-11-07 0:13 ` Luck, Tony @ 2007-11-07 6:38 ` Kenji Kaneshige 1 sibling, 0 replies; 3+ messages in thread From: Kenji Kaneshige @ 2007-11-07 6:38 UTC (permalink / raw) To: linux-ia64 > + if (smp_int_redirect & SMP_IRQ_REDIRECTION) > > This breaks the build on CONFIG_SMP=n configurations (neither > smp_int_redirect nor SMP_IRQ_REDIRECTION is defined). > Thank you for pointing out it, and I'm sorry about it. I'm attaching the fixed one. I noticed that the same fix is also needed for iosapic_override_isa_irq(). The fixed one also contains this fix. BTW, I'm thinking that delivery mode for CPEI also need to be fixed. I'll send the another patch about this. Thanks, Kenji Kaneshige Fix the problem that redirect hit bit in I/O SAPIC RTE is set even when it must be disabled (e.g. nointroute boot option is set, CPU hotplug is enabled or percpu vector is enabled). Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> --- arch/ia64/kernel/iosapic.c | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) Index: linux-2.6.24-rc2/arch/ia64/kernel/iosapic.c =================================--- linux-2.6.24-rc2.orig/arch/ia64/kernel/iosapic.c +++ linux-2.6.24-rc2/arch/ia64/kernel/iosapic.c @@ -748,6 +748,15 @@ skip_numa_setup: #endif } +static inline unsigned char choose_dmode(void) +{ +#ifdef CONFIG_SMP + if (smp_int_redirect & SMP_IRQ_REDIRECTION) + return IOSAPIC_LOWEST_PRIORITY; +#endif + return IOSAPIC_FIXED; +} + /* * ACPI can describe IOSAPIC interrupts via static tables and namespace * methods. This provides an interface to register those interrupts and @@ -762,6 +771,7 @@ iosapic_register_intr (unsigned int gsi, unsigned long flags; struct iosapic_rte_info *rte; u32 low32; + unsigned char dmode; /* * If this GSI has already been registered (i.e., it's a @@ -791,8 +801,8 @@ iosapic_register_intr (unsigned int gsi, spin_lock(&irq_desc[irq].lock); dest = get_target_cpu(gsi, irq); - err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY, - polarity, trigger); + dmode = choose_dmode(); + err = register_intr(gsi, irq, dmode, polarity, trigger); if (err < 0) { spin_unlock(&irq_desc[irq].lock); irq = err; @@ -961,10 +971,12 @@ iosapic_override_isa_irq (unsigned int i { int vector, irq; unsigned int dest = cpu_physical_id(smp_processor_id()); + unsigned char dmode; irq = vector = isa_irq_to_vector(isa_irq); BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); - register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY, polarity, trigger); + dmode = choose_dmode(); + register_intr(gsi, irq, dmode, polarity, trigger); DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n", isa_irq, gsi, trigger = IOSAPIC_EDGE ? "edge" : "level", ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-07 6:38 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-10-31 11:06 [PATCH] ia64: Fix IOSAPIC delivery mode setting Kenji Kaneshige 2007-11-07 0:13 ` Luck, Tony 2007-11-07 6:38 ` Kenji Kaneshige
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.