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

From: Francesco Dolcini

Date: Thu Dec 03 2026 - 08:05:35 EST


Hello Gianfranco,

I would suggest to look at the sashiko findings.

Anyway, I had a quick look.

On Thu, Nov 26, 2026 at 07:03:15PM +0100, Gianfranco Mariotti wrote:
> The FXL6408 and PI4IOE5V6408 GPIO expanders feature an open-drain
> active-low interrupt output asserted when an unmasked input transitions
> away from the state programmed in INPUT_DEFAULT_STATE (register 0x09).
> Reading INT_STS (register 0x13) clears all latched interrupt status bits
> and releases the INT line, requiring the input to return to its default
> state before another interrupt is generated.
[...]

> @@ -206,12 +276,43 @@ static int fxl6408_probe(struct i2c_client *client)
> if (ret)
> return dev_err_probe(dev, ret, "failed to write 'output high Z' register\n");
>
> + if (client->irq > 0) {
> + struct regmap_irq_chip *irq_chip;
> +
> + irq_chip = devm_kzalloc_obj(dev, *irq_chip);

this needs #include <linux/device/devres.h>, not slab

> + if (!irq_chip)
> + return -ENOMEM;
> +
> + irq_chip->name = dev_name(dev);
> + irq_chip->status_base = FXL6408_REG_INT_STS;
> + irq_chip->mask_base = FXL6408_REG_INT_MASK;
> + irq_chip->config_base = fxl6408_irq_config_base;
> + irq_chip->num_config_bases = ARRAY_SIZE(fxl6408_irq_config_base);
> + irq_chip->num_config_regs = 1;
> + irq_chip->num_regs = 1;
> + irq_chip->irqs = fxl6408_regmap_irqs;
> + irq_chip->num_irqs = ARRAY_SIZE(fxl6408_regmap_irqs);
> + 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.

Francesco