[PATCH v5 3/3] gpio: grgpio: Add irq support
Linus Walleij
linus.walleij at linaro.org
Tue Apr 23 21:14:51 EST 2013
On Mon, Apr 15, 2013 at 2:38 PM, Andreas Larson <andreas at gaisler.com> wrote:
> On 2013-04-10 21:25, Linus Walleij wrote:
>>> +int grgpio_irq_map(struct irq_domain *d, unsigned int virq,
(...)
>>> + /* Request underlying irq if not already requested */
>>> + lirq->virq = virq;
>>> + uirq = &priv->uirqs[lirq->index];
>>> + if (uirq->refcnt == 0) {
>>> + ret = request_irq(uirq->uirq, grgpio_irq_handler, 0,
>>> + dev_name(priv->dev), priv);
>>
>>
>> No, please request all present uirqs in probe() before creating the
>> irqdomain.
>
>
> The reason for doing it at irq_map and not in probe is that one
> typical hardware setup for this core is that it has irqs that are shared
> with pretty much all other cores in the system. Therefore, if this
> drivers requests all its irqs in the probe function, pretty much all the
> drivers for the other cores in the system that were not lucky enough to
> request their irq before this driver will fail their probes in such a
> hardware setup. This driver can not share irq:s so even if the other
> drivers can handle shared irqs they are out of luck if this driver is
> probed first.
>
> That is why only the irqs that are actually used should be requested and
> thus why the driver does it on demand instead of in the probe.
OK I buy that explanation...
Thanks,
Linus Walleij
More information about the devicetree-discuss
mailing list