mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: pca953x: mask interrupts in irq shutdown
@ 2026-01-21 12:57 Martin Larsson
  2026-01-27  9:29 ` Linus Walleij
  2026-01-27  9:35 ` Bartosz Golaszewski
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Larsson @ 2026-01-21 12:57 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, Martin Larsson

In the existing implementation irq_shutdown does not mask the interrupts
in hardware. This can cause spurious interrupts from the IO expander.
Add masking to irq_shutdown to prevent spurious interrupts.

Signed-off-by: Martin Larsson <martin.larsson@actia.se>
---
 drivers/gpio/gpio-pca953x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 8727ae54bc57..f93a3dbb2daa 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -914,6 +914,8 @@ static void pca953x_irq_shutdown(struct irq_data *d)
 	clear_bit(hwirq, chip->irq_trig_fall);
 	clear_bit(hwirq, chip->irq_trig_level_low);
 	clear_bit(hwirq, chip->irq_trig_level_high);
+
+	pca953x_irq_mask(d);
 }
 
 static void pca953x_irq_print_chip(struct irq_data *data, struct seq_file *p)
-- 
2.51.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: pca953x: mask interrupts in irq shutdown
  2026-01-21 12:57 [PATCH] gpio: pca953x: mask interrupts in irq shutdown Martin Larsson
@ 2026-01-27  9:29 ` Linus Walleij
  2026-01-27  9:47   ` Emanuele Ghidoli
  2026-01-27  9:35 ` Bartosz Golaszewski
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2026-01-27  9:29 UTC (permalink / raw)
  To: Martin Larsson
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, Michael Roth,
	Francesco Lavra, Hugo Villeneuve, Maria Garcia, Emanuele Ghidoli

Add a few recent developers to CC, this is a very widely used GPIO chip.

Emanuele was dealing with IRQ storms and may want to look at this.

On Wed, Jan 21, 2026 at 2:12 PM Martin Larsson <martin.larsson@actia.se> wrote:

> In the existing implementation irq_shutdown does not mask the interrupts
> in hardware. This can cause spurious interrupts from the IO expander.
> Add masking to irq_shutdown to prevent spurious interrupts.
>
> Signed-off-by: Martin Larsson <martin.larsson@actia.se>
> ---
>  drivers/gpio/gpio-pca953x.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 8727ae54bc57..f93a3dbb2daa 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -914,6 +914,8 @@ static void pca953x_irq_shutdown(struct irq_data *d)
>         clear_bit(hwirq, chip->irq_trig_fall);
>         clear_bit(hwirq, chip->irq_trig_level_low);
>         clear_bit(hwirq, chip->irq_trig_level_high);
> +
> +       pca953x_irq_mask(d);

It makes sense to me.

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: pca953x: mask interrupts in irq shutdown
  2026-01-21 12:57 [PATCH] gpio: pca953x: mask interrupts in irq shutdown Martin Larsson
  2026-01-27  9:29 ` Linus Walleij
@ 2026-01-27  9:35 ` Bartosz Golaszewski
  1 sibling, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2026-01-27  9:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Martin Larsson
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel


On Wed, 21 Jan 2026 12:57:22 +0000, Martin Larsson wrote:
> In the existing implementation irq_shutdown does not mask the interrupts
> in hardware. This can cause spurious interrupts from the IO expander.
> Add masking to irq_shutdown to prevent spurious interrupts.
> 
> 

Cc'ed stable and applied for fixes, thanks!

[1/1] gpio: pca953x: mask interrupts in irq shutdown
      commit: b168ba38e82d354c4875befdb34498a94045cb21

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: pca953x: mask interrupts in irq shutdown
  2026-01-27  9:29 ` Linus Walleij
@ 2026-01-27  9:47   ` Emanuele Ghidoli
  0 siblings, 0 replies; 4+ messages in thread
From: Emanuele Ghidoli @ 2026-01-27  9:47 UTC (permalink / raw)
  To: Linus Walleij, Martin Larsson
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, Michael Roth,
	Francesco Lavra, Hugo Villeneuve, Maria Garcia, Emanuele Ghidoli



On 27/01/2026 10:29, Linus Walleij wrote:
> Add a few recent developers to CC, this is a very widely used GPIO chip.
> 
> Emanuele was dealing with IRQ storms and may want to look at this.
> 
> On Wed, Jan 21, 2026 at 2:12 PM Martin Larsson <martin.larsson@actia.se> wrote:
> 
>> In the existing implementation irq_shutdown does not mask the interrupts
>> in hardware. This can cause spurious interrupts from the IO expander.
>> Add masking to irq_shutdown to prevent spurious interrupts.
>>
>> Signed-off-by: Martin Larsson <martin.larsson@actia.se>
>> ---
>>  drivers/gpio/gpio-pca953x.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
>> index 8727ae54bc57..f93a3dbb2daa 100644
>> --- a/drivers/gpio/gpio-pca953x.c
>> +++ b/drivers/gpio/gpio-pca953x.c
>> @@ -914,6 +914,8 @@ static void pca953x_irq_shutdown(struct irq_data *d)
>>         clear_bit(hwirq, chip->irq_trig_fall);
>>         clear_bit(hwirq, chip->irq_trig_level_low);
>>         clear_bit(hwirq, chip->irq_trig_level_high);
>> +
>> +       pca953x_irq_mask(d);
> 
> It makes sense to me.
> 
> Reviewed-by: Linus Walleij <linusw@kernel.org>
> 
> Yours,
> Linus Walleij

Looks good to me, thanks.

Emanuele


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-27  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-21 12:57 [PATCH] gpio: pca953x: mask interrupts in irq shutdown Martin Larsson
2026-01-27  9:29 ` Linus Walleij
2026-01-27  9:47   ` Emanuele Ghidoli
2026-01-27  9:35 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®