From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] plat-versatile: modernize FPGA IRQ controller
Date: Sat, 14 Apr 2012 00:34:09 +0100 [thread overview]
Message-ID: <20120413233409.GP24211@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CACRpkdZkNHodkpGZ9q+yNDqphgx7Bfa5veaCP9kub=FMqqmKOA@mail.gmail.com>
On Sat, Apr 14, 2012 at 01:21:32AM +0200, Linus Walleij wrote:
> On Thu, Apr 12, 2012 at 1:03 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Thu, Apr 12, 2012 at 12:44:00AM +0200, Linus Walleij wrote:
> >> +static int handle_one_fpga(struct fpga_irq_data *f, struct pt_regs *regs)
> >> ?{
> >> + ? ? int handled = 0;
> >> + ? ? int irq;
> >> + ? ? u32 status = readl(f->base + IRQ_STATUS);
> >> +
> >> + ? ? while (status) {
> >> + ? ? ? ? ? ? irq = ffs(status) - 1;
> >> + ? ? ? ? ? ? handle_IRQ(irq_find_mapping(f->domain, irq), regs);
> >> + ? ? ? ? ? ? status &= ~(1 << irq);
> >> + ? ? ? ? ? ? handled = 1;
> >> + ? ? }
> >> +
> >> + ? ? return handled;
> >
> > Buggy. ?See what happens when you cache the status register, and
> > handle_IRQ enables interrupts after processing the first IRQ to do
> > soft IRQ processing.
>
> Hm the code is exactly the same as in arch/arm/common/vic.c
> I guess once we figure this loop out we may need to go back and
> fix that driver also so good that we bring it up.
>
> Anyway, IIRC the VIC was written that way since it will traverse
> all IRQs once, if there are remaining IRQs after that these are
> treated from this outer loop in the per-instance handler:
>
> asmlinkage void __exception_irq_entry fpga_handle_irq(struct pt_regs *regs)
> {
> int i, handled;
>
> do {
> for (i = 0, handled = 0; i < fpga_irq_id; ++i)
> handled |= handle_one_fpga(&fpga_irq_devices[i], regs);
> } while (handled);
> }
>
> This will traverse all flags on all controllers until all flags are low so all
> handlers get chance to run. (i.e. IRQ0 on controller 0 cannot lock others
> out.)
>
> It always looked sane to me, but what am I not getting here...
See http://lists.arm.linux.org.uk/lurker/message/20120402.214614.e7740b12.en.html
and the rest of that thread.
prev parent reply other threads:[~2012-04-13 23:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 22:44 [PATCH 2/3] plat-versatile: modernize FPGA IRQ controller Linus Walleij
2012-04-11 23:03 ` Russell King - ARM Linux
2012-04-13 23:21 ` Linus Walleij
2012-04-13 23:34 ` Russell King - ARM Linux [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=20120413233409.GP24211@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).