Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michael Walle" <mwalle@kernel.org>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [RFT PATCH 11/13] gpio: 104-idi-48: create the regmap-irq chip from the gpio-regmap callback
Date: Thu, 26 Nov 2026 15:48:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-235845@kernel.org> (raw)
In-Reply-To: <20261126153600.299724-12-mwalle@kernel.org>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] gpio: 104-idi-48: skipped IRQ mask write and status clear in
  idi_48_probe() [1]
--

commit 36940f74396bbd63f657b4578ebd69175712902d
Author: Michael Walle <mwalle@kernel.org>

gpio: 104-idi-48: create the regmap-irq chip from the gpio-regmap callback

This commit converts the 104-idi-48 driver to create its regmap-irq domain
via the gpio_regmap_config.create_irq_domain callback using
gpio_regmap_add_irq_chip().

> diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c
> index 93d7ccaded83e..434704c06d7ef 100644
> --- a/drivers/gpio/gpio-104-idi-48.c
> +++ b/drivers/gpio/gpio-104-idi-48.c

[ ... ]

> @@ -148,10 +166,14 @@ static int idi_48_probe(struct device *dev, unsigned int id)
>  		return dev_err_probe(dev, PTR_ERR(map),
>  				     "Unable to initialize register map\n");
>  
> -	chip = devm_kzalloc_obj(dev, *chip);
> -	if (!chip)
> +	idi48gpio = devm_kzalloc_obj(dev, *idi48gpio);
> +	if (!idi48gpio)
>  		return -ENOMEM;
>  
> +	idi48gpio->dev = dev;
> +	idi48gpio->irq = irq[id];
> +	chip = &idi48gpio->chip;
> +
>  	chip->name = name;
>  	chip->status_base = IDI48_IRQ_STATUS;
>  	chip->unmask_base = IDI48_IRQ_ENABLE;

[Severity: High]
This problem wasn't introduced by this patch, but configuring
chip->unmask_base on offset 0x7 without a register cache or
handle_mask_sync callback causes regmap_update_bits() to perform a physical
read-modify-write on offset 0x7 [1].

On the 104-idi-48, reading offset 0x7 returns and clears pending interrupt
status bits rather than the active enable mask, while writing it programs
the interrupt enable register.  The read in _regmap_update_bits() clears
pending interrupts before regmap_irq_thread() can service them, and when
all banks are masked (~mask_buf[0] & 0x3f == 0) while no status bits are
pending (orig & 0x3f == 0), _regmap_update_bits() sees no change and skips
the write, leaving device interrupts enabled during probe and after masking
all banks.

[1] https://sashiko.dev/#/bug/linux-84cdae6c-00ca-4070-8100-3b16d7660350

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126153600.299724-1-mwalle@kernel.org?part=11

  reply	other threads:[~2026-11-26 15:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 15:35 [RFT PATCH 00/13] gpio: regmap: IRQ domain cleanups Michael Walle
2026-11-26 15:35 ` [RFT PATCH 01/13] gpio: regmap: remove gpiochip before tearing down irqchip Michael Walle
2026-11-26 15:35 ` [RFT PATCH 02/13] gpio: regmap: add a callback to create the IRQ domain Michael Walle
2026-11-26 15:47   ` sashiko-bot
2026-11-26 15:35 ` [RFT PATCH 03/13] gpio: rtd1625: create the IRQ domain from the gpio-regmap callback Michael Walle
2026-11-26 15:54   ` sashiko-bot
2026-11-26 15:35 ` [RFT PATCH 04/13] gpio: axiado-sgpio: " Michael Walle
2026-11-26 15:35 ` [RFT PATCH 05/13] gpio: regmap: add a helper to add a regmap-irq chip Michael Walle
2026-11-26 15:35 ` [RFT PATCH 06/13] gpio: max7360: create the regmap-irq chip from the gpio-regmap callback Michael Walle
2026-11-26 15:35 ` [RFT PATCH 07/13] gpio: sl28cpld: " Michael Walle
2026-11-26 15:35 ` [RFT PATCH 08/13] gpio: idio-16: " Michael Walle
2026-11-26 15:35 ` [RFT PATCH 09/13] gpio: pcie-idio-24: " Michael Walle
2026-11-26 15:48   ` sashiko-bot
2026-11-26 15:35 ` [RFT PATCH 10/13] gpio: ws16c48: " Michael Walle
2026-11-26 15:35 ` [RFT PATCH 11/13] gpio: 104-idi-48: " Michael Walle
2026-11-26 15:48   ` sashiko-bot [this message]
2026-11-26 15:35 ` [RFT PATCH 12/13] gpio: i8255: " Michael Walle
2026-11-26 15:35 ` [RFT PATCH 13/13] gpio: regmap: remove irq_domain and the regmap-irq configuration Michael Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-235845@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mwalle@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox