public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [RFC] ACPI IRQ proposal
Date: Thu, 22 Apr 2004 02:20:24 +0000	[thread overview]
Message-ID: <MDEEKOKJPMPMKGHIFAMAAEELDNAA.kaneshige.kenji@jp.fujitsu.com> (raw)
In-Reply-To: <200403231537.14505.bjorn.helgaas@hp.com>

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);

_


      parent reply	other threads:[~2004-04-22  2:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 22:37 [RFC] ACPI IRQ proposal Bjorn Helgaas
2004-03-23 22:59 ` David Mosberger
2004-03-26  5:39 ` MAEDA Naoaki
2004-03-26  8:56   ` Takayoshi Kochi
2004-03-27  0:00     ` Bjorn Helgaas
2004-03-29  1:24     ` [ACPI] " MAEDA Naoaki
2004-04-22  2:20 ` Kenji Kaneshige [this message]

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=MDEEKOKJPMPMKGHIFAMAAEELDNAA.kaneshige.kenji@jp.fujitsu.com \
    --to=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-ia64@vger.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