From: ebiederm@xmission.com (Eric W. Biederman)
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch] ia64: use generic_handle_irq()
Date: Tue, 14 Nov 2006 18:08:12 +0000 [thread overview]
Message-ID: <m14pt1lx4j.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20061114124638.GA12848@elte.hu> (Ingo Molnar's message of "Tue, 14 Nov 2006 13:46:38 +0100")
Ingo Molnar <mingo@elte.hu> writes:
> * Andrew Morton <akpm@osdl.org> wrote:
>
>> On Tue, 14 Nov 2006 17:08:10 +0800
>> "Zhang, Yanmin" <yanmin_zhang@linux.intel.com> wrote:
>>
>> > I got an oops when booting 2.6.19-rc5-mm1 on my ia64 machine.
>> >
>> >
>> > The root cause is that some irq_chip variables, especially ia64_msi_chip,
>> > initiate their memeber end to point to NULL. __do_IRQ doesn't check
>> > if irq_chip->end is null and just calls it after processing the interrupt.
>> >
>> > As irq_chip->end is called at many places, so I fix it by reinitiating
>> > irq_chip->end to dummy_irq_chip.end, e.g., a noop function.
>> >
>> > Below patch against 2.6.19-rc5-mm1 fixes it.
>> >
>> > Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
>> >
>> > ---
>> >
>> > --- linux-2.6.19-rc5-mm1/kernel/irq/chip.c 2006-11-14 14:16:16.000000000
> +0800
>> > +++ linux-2.6.19-rc5-mm1_fix/kernel/irq/chip.c 2006-11-14 14:14:25.000000000
> +0800
>> > @@ -233,6 +233,8 @@ void irq_chip_set_defaults(struct irq_ch
>> > chip->shutdown = chip->disable;
>> > if (!chip->name)
>> > chip->name = chip->typename;
>> > + if (!chip->end)
>> > + chip->end = dummy_irq_chip.end;
>> > }
>> >
>>
>> The same bug should be hitting in mainline, shouldn't it?
>
> correct.
>
> this bug comes from a 'mixed' IRQ setup on ia64: half of it is still
> old-style, half of it (the MSI stuff) is new-style irqchip code. But the
> ia64 lowlevel code unconditionally calls __do_IRQ(), which is a bug.
Now that we hare half converted yes it is a bug.
> the genirq code has all the right helpers for such a mixed situation: so
> a better fix might be the one below: use generic_handle_irq() instead of
> unconditionally calling into __do_IRQ(). But i have not tested it -
> Yanmin, can you confirm this too fixes your bug?
>
> similarly, any architecture that makes use of the new generic MSI
> infrastructure should not be calling __do_IRQ() directly. (but i'm not
> aware of any other besides ia64 - i386 and x86_64 is now fully irq-chip
> converted.)
>
> Eric, do you agree?
>
This is true in practice. It isn't necessarily true, as all of irq_chip
structures are arch specific. It would be silly to start using msi interrupts
without converting to genirq though. So I think this covers it for ia64.
Your patch only fixes 2 spots and there is a third in irq_ia64.c that
needs to be fixed as well. At least in linus's tree.
>
> Index: linux/arch/ia64/kernel/irq.c
> =================================> --- linux.orig/arch/ia64/kernel/irq.c
> +++ linux/arch/ia64/kernel/irq.c
> @@ -197,7 +197,7 @@ void fixup_irqs(void)
> struct pt_regs *old_regs = set_irq_regs(NULL);
>
> vectors_in_migration[irq]=0;
> - __do_IRQ(irq);
> + generic_handle_irq(irq);
> set_irq_regs(old_regs);
> }
> }
> Index: linux/arch/ia64/kernel/irq_ia64.c
> =================================> --- linux.orig/arch/ia64/kernel/irq_ia64.c
> +++ linux/arch/ia64/kernel/irq_ia64.c
> @@ -186,7 +186,7 @@ ia64_handle_irq (ia64_vector vector, str
> ia64_setreg(_IA64_REG_CR_TPR, vector);
> ia64_srlz_d();
>
> - __do_IRQ(local_vector_to_irq(vector));
> + generic_handle_irq(local_vector_to_irq(vector));
>
> /*
> * Disable interrupts and send EOI:
next prev parent reply other threads:[~2006-11-14 18:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-14 9:08 [PATCH] some irq_chip variables initiate end to point to NULL Zhang, Yanmin
2006-11-14 10:05 ` Andrew Morton
2006-11-14 12:46 ` [patch] ia64: use generic_handle_irq() Ingo Molnar
2006-11-14 18:08 ` Eric W. Biederman [this message]
2006-11-15 2:26 ` Zhang, Yanmin
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=m14pt1lx4j.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@osdl.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=yanmin_zhang@linux.intel.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