All of lore.kernel.org
 help / color / mirror / Atom feed
From: dsd@laptop.org (Daniel Drake)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 02/11] irqchip: mmp: support irqchip
Date: Tue, 13 Aug 2013 16:53:39 -0600	[thread overview]
Message-ID: <CAMLZHHQF2xAC8McNyH_8Ln-yVAUegHKk9wJqQd7LY9KhMRciuA@mail.gmail.com> (raw)
In-Reply-To: <CAMLZHHTsYqSB-dPGZvAZT+aJ70sbV679CyJgm-V6-Q7NFtgVbQ@mail.gmail.com>

On Mon, Aug 12, 2013 at 4:53 PM, Daniel Drake <dsd@laptop.org> wrote:

> This patch causes boot to fail, tested on OLPC XO-1.75 (MMP2).
>
> Calibrating delay loop... irq 13, desc: db804740, depth: 1, count: 0,
> unhandled: 0
> ->handle_irq():  c00704f4, handle_bad_irq+0x0/0x214
> ->irq_data.chip(): c05aa2e8, 0xc05aa2e8
> ->action():   (null)
>    IRQ_NOPROBE set
>  IRQ_NOREQUEST set
>
> continues as infinite loop.
>
> I had a poke, trying to figure out what would have caused this,
> without much luck. I tried to go back to irq_domain_add_legacy() and
> sprinkled some icu_mask_irq() calls around, nothing changed. Any
> ideas?

In my above experiments I was assuming things were crashing during the
IRQ setup path (e.g mmp_setup_bases). That was wrong - I now realise
that the setup code moved around by this patch exits OK, then the
timer driver loads and requests + unmasks interrupt 13, and these
messages start appearing upon the first interrupt which happens right
after.

It is not happy because no IRQ handler was registered. This is
normally done by mmp_irq_domain_map(), previously called immediately
from irq_domain_add_legacy().
Now that we moved to irq_domain_add_linear() in this patch, the map
function is not called.
I fixed this by calling irq_set_chip_and_handler() and set_irq_flags()
in the loop immediately after where irq_create_mapping() is used, as
is done by irq-bcm2835.c.

Now I get a new crash, still handling the first interrupt. In
icu_mask_ack_irq(), d->domain is NULL. We dereference it, causing a
crash. The domain field should have been set by irq_create_mapping().

What actually happens is that early_irq_init (kernel/irqdesc.c)
allocates 16 interrupt descriptors even before we've looked at the
device tree. Are those "legacy" interrupts? I can't figure out what
that is supposed to mean. Then the interrupts registered by irq-mmp.c
start at 16 (e.g. hwirq 0 becomes virq 16).

When the hardware interrupt 13 comes in, the call chain is:
handle_IRQ()
generic_handle_irq()
handle_level_irq()
icu_mask_ack_irq()

generic_handle_irq() above looks up the descriptor for IRQ 13, but it
does it without considering the mapping. So it picks up the descriptor
for "legacy" interrupt 13 and passes that to icu_mask_ack_irq() -
rather than passing the descriptor for the hwirq 13 that irq-mmp.c
registered and was expecting (i.e. no translation was performed).

How is this supposed to work?

Thanks
Daniel

  reply	other threads:[~2013-08-13 22:53 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 10:05 No subject Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 01/11] irqchip: move mmp irq driver Haojian Zhuang
2013-08-14 21:26   ` Daniel Drake
2013-08-21 20:27     ` Daniel Drake
2013-08-22  1:28       ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 02/11] irqchip: mmp: support irqchip Haojian Zhuang
2013-08-12 22:53   ` Daniel Drake
2013-08-13 22:53     ` Daniel Drake [this message]
2013-08-14 17:47       ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 03/11] irqchip: mmp: support MULTI_IRQ_HANDLER Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 04/11] ARM: mmp: avoid to include head file in mach-mmp Haojian Zhuang
2013-08-14 18:56   ` Daniel Drake
2013-08-24  9:45     ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 05/11] irqchip: mmp: avoid to include irqs head file Haojian Zhuang
2013-07-26 16:10   ` Arnd Bergmann
2013-07-26 10:05 ` [PATCH v6 06/11] clocksource: mmp: move mmp timer driver Haojian Zhuang
2013-08-14 19:22   ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 07/11] ARM: mmp: move timer registers into driver Haojian Zhuang
2013-08-14 19:37   ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 08/11] ARM: pxa: init dma debugfs in late level Haojian Zhuang
2013-08-10 17:29   ` Daniel Mack
2013-08-11  4:53     ` Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 09/11] clk: mmp: parse clock from dts Haojian Zhuang
2013-08-09 16:04   ` Mark Rutland
2013-08-10 11:06     ` Tomasz Figa
2013-08-10 12:31       ` Mark Rutland
2013-08-10 12:34         ` Tomasz Figa
2013-08-10 14:57   ` Daniel Drake
2013-08-11  5:22     ` Haojian Zhuang
2013-08-14 21:25       ` Daniel Drake
2013-07-26 10:05 ` [PATCH v6 10/11] ARM: dts: support common clock in arch mmp Haojian Zhuang
2013-07-26 10:05 ` [PATCH v6 11/11] ARM: mmp: avoid to use cpu_is_xxx in timer Haojian Zhuang

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=CAMLZHHQF2xAC8McNyH_8Ln-yVAUegHKk9wJqQd7LY9KhMRciuA@mail.gmail.com \
    --to=dsd@laptop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.