Re: [PATCH v7 15/34] pinctrl: airoha: fix IRQ mask/unmask code

From: Lorenzo Bianconi

Date: Mon Jul 27 2026 - 04:42:47 EST


> When using IRQCHIP_IMMUTABLE, airoha_irq_unmask() must manually call
> gpiochip_enable_irq() and airoha_irq_mask() must call
> gpiochip_disable_irq(). Without these calls, gpiolib never sets the
> GPIOD_FLAG_IRQ_IS_ENABLED bit. Because this bit is missing,
> gpiod_direction_output() will not realize the pin is actively used
> as an interrupt.

Acked-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>

>
> Fixes: 1c8ace2d0725 ("pinctrl: airoha: Add support for EN7581 SoC")
> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@xxxxxxxxx>
> ---
> drivers/pinctrl/airoha/pinctrl-airoha.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
> index 6cf4ed5976fb0..f85941ccea560 100644
> --- a/drivers/pinctrl/airoha/pinctrl-airoha.c
> +++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
> @@ -2580,6 +2580,7 @@ static void airoha_irq_unmask(struct irq_data *data)
> if (WARN_ON_ONCE(data->hwirq >= ARRAY_SIZE(gpiochip->irq_type)))
> return;
>
> + gpiochip_enable_irq(gc, irqd_to_hwirq(data));
> switch (gpiochip->irq_type[data->hwirq]) {
> case IRQ_TYPE_LEVEL_LOW:
> val = val << 1;
> @@ -2614,6 +2615,7 @@ static void airoha_irq_mask(struct irq_data *data)
>
> regmap_clear_bits(pinctrl->regmap, gpiochip->level[index], mask);
> regmap_clear_bits(pinctrl->regmap, gpiochip->edge[index], mask);
> + gpiochip_disable_irq(gc, irqd_to_hwirq(data));
> }
>
> static int airoha_irq_type(struct irq_data *data, unsigned int type)
> --
> 2.53.0
>

Attachment: signature.asc
Description: PGP signature