public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@osdl.org>
Cc: "Linus Torvalds" <torvalds@osdl.org>,
	"Tobias Diedrich" <ranma+kernel@tdiedrich.de>,
	"Adrian Bunk" <bunk@stusta.de>, "Andi Kleen" <ak@suse.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Lu, Yinghai" <yinghai.lu@amd.com>
Subject: [PATCH] x86_64 ioapic: check_timer_pin Don't add_pin_to_irq if it is already there.
Date: Mon, 08 Jan 2007 15:50:14 -0700	[thread overview]
Message-ID: <m1fyalgml5.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <5986589C150B2F49A46483AC44C7BCA490736D@ssvlexmb2.amd.com> (Yinghai Lu's message of "Mon, 8 Jan 2007 13:46:49 -0800")

"Lu, Yinghai" <yinghai.lu@amd.com> writes:

>>Any updates to add_pin_to_irq are wrong.  It works fine.  If there
>>is something wrong we need to fix remove_pin_to_irq.
>
>>What is the problem you see?  Sorry I'm dense at the moment.

> In the check_timer_pin, irq_from_pin could return 0, it mean some entry
> is for IRQ0 already.
> The add_pin_to_irq could add another same entry for it again.

Yep.  My oversight.  Here is the trivial patch to fix it.  I don't
see how we could hit this case but if we are going to allow for it
we should handle it correctly.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/x86_64/kernel/io_apic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 4891959..cc8e9a4 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1687,7 +1687,8 @@ static int check_timer_pin(int apic, int pin)
 	idx = update_irq0_entry(apic, pin);
 
 	/* Add an entry in irq_to_pin */
-	add_pin_to_irq(0, apic, pin);
+	if (irq != 0)
+		add_pin_to_irq(0, apic, pin);
 
 	/* Now setup the irq */
 	setup_IO_APIC_irq(apic, pin, idx, 0);
-- 
1.4.4.1.g278f



  reply	other threads:[~2007-01-08 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-08 21:46 [PATCH 1/4] x86_64 io_apic: Implement remove_pin_to_irq Lu, Yinghai
2007-01-08 22:50 ` Eric W. Biederman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-08 22:56 [PATCH] x86_64 ioapic: check_timer_pin Don't add_pin_to_irq if it is already there Lu, Yinghai

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=m1fyalgml5.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ranma+kernel@tdiedrich.de \
    --cc=torvalds@osdl.org \
    --cc=yinghai.lu@amd.com \
    /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