[PATCH 2/3] irqchip: SigmaStar SSD20xD gpi

Linus Walleij linus.walleij at linaro.org
Thu Sep 30 09:10:59 PDT 2021


On Thu, Sep 30, 2021 at 4:11 PM Marc Zyngier <maz at kernel.org> wrote:
> On Thu, 30 Sep 2021 14:59:24 +0100,
> Daniel Palmer <daniel at 0x0f.com> wrote:

> > gpioirqchip->handler = handle_bad_irq;
> > gpioirqchip->default_type = IRQ_TYPE_NONE;
>
> Right. I have no idea why this is a requirement, and I would normally
> set it to whatever is the normal flow handler on this HW, but this
> looks like the GPIO subsystem has some expectations here.
>
> I'll let Linus comment on it.

The handle_bad_irq() as default handler is because many GPIO
IRQ controllers in difference from on-chip IRQ controllers support
two levels and two edges of triggers, and there is nothing "normal"
(it is "general purpose" after all) so we need to defer the selection
of a suitable flow handler to .set_type().

With device tree the trigger is often specified in the second cell in the
DTS, so .set_type() will be called for any consumer as part of
the request_irq() and the appropriate handler is set from .set_type().

In my mind this is following the DT (ACPI) usage model of allocating
and initializing resources dynamically as they are requested.

I don't know if this reasoning is wrong in some way, what should we
do otherwise? (Confused...)

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list