Re: [PATCH 5/5] gpio: fxl6408: Add interrupt controller support

From: Gianfranco Mariotti

Date: Thu Dec 03 2026 - 09:57:23 EST


Hi Francesco,

Thanks for taking a look.

On Thu, Dec 03, 2026 at 02:05:16PM +0100, Francesco Dolcini wrote:
> I would suggest to look at the sashiko findings.

Yes, I went through all the sashiko findings on both patch 1/5 and
patch 5/5 and addressed them for v2 (dropping num_reg_defaults_raw so
regcache_hw_init() does not read reserved or clear-on-read registers,
and reworking the IRQ and suspend/resume handling as noted below).

> Anyway, I had a quick look.
[...]
> > + irq_chip = devm_kzalloc_obj(dev, *irq_chip);
>
> this needs #include <linux/device/devres.h>, not slab

Good catch, I will replace <linux/slab.h> with <linux/device/devres.h>
in v2.

> > + irq_chip->init_ack_masked = true;
> > + irq_chip->clear_on_unmask = true;
>
> Race condition if we unmask an interrupt with one already active? The
> register clears on read.

Indeed, with regmap-irq, clear_on_unmask discards the value read from
INT_STS, which would drop a pending interrupt on another already
unmasked line (and regmap-irq also updates INPUT_DEFAULT_STATE before
masking when reconfiguring trigger polarity, as sashiko pointed out).

For v2 I have replaced regmap-irq with a custom immutable irq_chip and
irq_domain that updates INPUT_DEFAULT_STATE while masked, saves any
status bits latched on other active lines when clearing INT_STS before
unmasking (waking the IRQ thread via irq_wake_thread()), and handles
RST_INT and wakeup lines across suspend and resume.

Best regards,
Gianfranco