RE: [RFC] ACPI IRQ proposal

From: Kenji Kaneshige <kaneshige.kenji_at_jp.fujitsu.com>
Date: 2004-04-22 12:20:24
Hi Bjorn,

It will be possible that iosapic_register_intr() runs on multiple CPUs in
parallel when your patch is applied. But I think current
iosapic_register_int()
doesn't take care of this. If iosapic_register_intr() is called for one gsi
on
multiple CPUs in parallel, two or more vectors might be assigned to one
gsi. A following patch is a sample patch to fix this issue. (This patch is
not
tested yet.)

Thanks,
Kenji Kaneshige

---

 linux-2.6.6-rc1-kanesige/arch/ia64/kernel/iosapic.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN arch/ia64/kernel/iosapic.c~lock_iosapic_register_intr
arch/ia64/kernel/iosapic.c
--- linux-2.6.6-rc1/arch/ia64/kernel/iosapic.c~lock_iosapic_register_intr
2004-04-21 14:58:25.229102461 +0900
+++ linux-2.6.6-rc1-kanesige/arch/ia64/kernel/iosapic.c	2004-04-21
15:44:04.719878795 +0900
@@ -499,9 +499,12 @@ int
 iosapic_register_intr (unsigned int gsi,
 		       unsigned long polarity, unsigned long trigger)
 {
+	unsigned long flags;
 	int vector;
 	unsigned int dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;

+	spin_lock_irqsave(&iosapic_lock, flags);
+
 	vector = gsi_to_vector(gsi);
 	if (vector < 0)
 		vector = assign_irq_vector(AUTO_ASSIGN);
@@ -509,6 +512,8 @@ iosapic_register_intr (unsigned int gsi,
 	register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
 		      polarity, trigger);

+	spin_unlock_irqrestore(&iosapic_lock, flags);
+
 	printk(KERN_INFO "GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
 	       gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
 	       (trigger == IOSAPIC_EDGE ? "edge" : "level"), dest, vector);

_

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Apr 21 22:17:47 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:25 EST