From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/8] ARM: sirf: move irq driver to drivers/irqchip
Date: Mon, 25 Mar 2013 11:13:43 +0000 [thread overview]
Message-ID: <201303251113.44076.arnd@arndb.de> (raw)
In-Reply-To: <CAGsJ_4yPRE8SBSk5eLH3j3Y9bf9tbhy15i0kEE+83VcPNk80Cw@mail.gmail.com>
On Monday 25 March 2013, Barry Song wrote:
> 2013/3/25, Arnd Bergmann <arnd@arndb.de>:
> > On Monday 25 March 2013, Barry Song wrote:
> >> 2013/3/20, Arnd Bergmann <arnd@arndb.de>:
> >> this breaks the hwirq and irq mapping. the hwirq 0 is mapped to
> >> no_irqs, then setup_irq will fail in
> >> drivers/clocksource/timer-prima2.c.
> >
> > Hmm, I don't understand yet what is going on there. This should create
> > a domain with all dynamically allocated interrupt descriptors,
> > and the hwirq number is just local to the controller then.
>
> suppose we think the hardware register flag bit of timer-prima2 is 0,
> irq_of_parse_and_map() will return 16 in patch2 for the timer-prima2
> which uses the 1st hardware IRQ in the system.
>
> if add nr_irqs=288 in ATLAS6 machine, irq_of_parse_and_map() will
> return 288 in patch2. it looks like the first hw irq will always be
> mapped to nr_irqs.
right.
> > Without patch 2 of the series, this would fail, because that interrupt
> > is not mapped, but as far as I can tell, we correctly instantiate
> > the domain here, so the irq_of_parse_and_map() in sirfsoc_of_timer_map
> > should return a valid interrupt number. Can you check what it returns
> > instead? Does it work if you revert to a legacy domain here?
>
> actually patch2 can work without patch3 by irq_domain_add legacy. as
> you can see, my old timer-marco.c uses irq_of_parse_and_map() instead
> of reading interrupts manually.
Yes, irq_of_parse_and_map() should always work.
> void __iomem *base = of_iomap(np, 0);
> if (!base)
> panic("unable to map intc cpu registers\n");
>
> - sirfsoc_irqdomain = irq_domain_add_linear(np, SIRFSOC_NUM_IRQS,
> + sirfsoc_irqdomain = irq_domain_add_legacy(np, SIRFSOC_NUM_IRQS, 0, 0,
> &irq_domain_simple_ops, base);
>
> sirfsoc_alloc_gc(base, 0, 32);
> ...
> drivers/pinctrl/pinctrl-sirf.c:
> - bank->domain = irq_domain_add_linear(np,
> SIRFSOC_GPIO_BANK_SIZE,
> + bank->domain = irq_domain_add_legacy(np,
> SIRFSOC_GPIO_BANK_SIZE,
> + 128 + i * SIRFSOC_GPIO_BANK_SIZE, 0,
> &sirfsoc_gpio_irq_simple_ops, bank);
Right, but if we do this, we encode static IRQ numbers into the
irqchip drivers, which should not be necessary if all interrupts
can be mapped dynamically.
This means that the interrupt numbers that Linux reports in
/proc/interrupts will all change, but I don't see anything that
still depends on those, unless you have additional out of tree
patches that rely on hardcoded numbers.
Digging a bit deeper, I found that the generic irqchip implemmentation
does not deal with linear irq domains yet. There was a patch[1] least
year from Rob Herring, but it never got merged. I guess we can move
back to using the legacy domain for drivers/irqchip/irq-sirfsoc.c for
now and hardwire the assumption that its interrupts start at number 0.
Arnd
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2012-January/082455.html
next prev parent reply other threads:[~2013-03-25 11:13 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 11:41 [PATCH 0/8] SIRF multiplatform support Arnd Bergmann
2013-03-20 11:41 ` [PATCH 1/8] pinctrl: sirf: convert to linear irq domain Arnd Bergmann
2013-03-20 14:28 ` Barry Song
2013-03-25 9:11 ` Barry Song
2013-03-25 9:33 ` Arnd Bergmann
2013-03-25 10:08 ` Barry Song
2013-03-20 11:41 ` [PATCH 2/8] ARM: sirf: fix prima2 interrupt lookup Arnd Bergmann
2013-03-25 5:44 ` Barry Song
2013-03-20 11:41 ` [PATCH 3/8] ARM: sirf: move irq driver to drivers/irqchip Arnd Bergmann
2013-03-25 9:19 ` Barry Song
2013-03-25 9:41 ` Arnd Bergmann
2013-03-25 9:56 ` Barry Song
2013-03-25 11:13 ` Arnd Bergmann [this message]
2013-03-20 11:41 ` [PATCH 4/8] ARM: sirf: enable sparse IRQ Arnd Bergmann
2013-03-25 10:33 ` Barry Song
2013-03-25 10:53 ` Arnd Bergmann
2013-03-20 11:41 ` [PATCH 5/8] ARM: sirf: move debug-macro.S to include/debug/sirf.S Arnd Bergmann
2013-03-25 9:44 ` Barry Song
2013-03-20 11:41 ` [PATCH 6/8] ARM: sirf: use clocksource_of infrastructure Arnd Bergmann
2013-03-25 9:27 ` Barry Song
2013-03-20 11:41 ` [PATCH 7/8] ARM: sirf: enable multiplatform support Arnd Bergmann
2013-03-25 10:22 ` Barry Song
2013-03-25 10:54 ` Arnd Bergmann
2013-03-20 11:41 ` [PATCH 8/8] ARM: sirf: enable support in multi_v7_defconfig Arnd Bergmann
2013-03-25 10:26 ` Barry Song
2013-03-20 12:28 ` [PATCH 0/8] SIRF multiplatform support Arnd Bergmann
2013-03-25 11:33 ` Arnd Bergmann
2013-03-26 6:17 ` Barry Song
2013-03-26 14:31 ` Arnd Bergmann
2013-03-27 1:48 ` Barry Song
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=201303251113.44076.arnd@arndb.de \
--to=arnd@arndb.de \
--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).