[PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Sebastian Andrzej Siewior posted 21 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Sebastian Andrzej Siewior 2 weeks, 3 days ago
Using a threaded interrupt without a dedicated primary handler mandates
the IRQF_ONESHOT flag to mask the interrupt source while the threaded
handler is active. Otherwise the interrupt can fire again before the
threaded handler had a chance to run.

Mark explained that this should not happen with this hardware since it a
slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will
refuse to accept such a handler.

Set IRQF_ONESHOT so the interrupt source is masked until the secondary
handler is done.

Cc: Lee Jones <lee@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: patches@opensource.cirrus.com
Cc: Mark Brown <broonie@kernel.org>
Fixes: 1c6c69525b40e ("genirq: Reject bogus threaded irq requests")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/mfd/wm8350/core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 5f70d3b5d1b1a..097ef4dfcdac8 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -667,7 +667,7 @@ static inline int wm8350_register_irq(struct wm8350 *wm8350, int irq,
 		return -ENODEV;
 
 	return request_threaded_irq(irq + wm8350->irq_base, NULL,
-				    handler, flags, name, data);
+				    handler, flags | IRQF_ONESHOT, name, data);
 }
 
 static inline void wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data)
-- 
2.51.0
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Charles Keepax 2 weeks ago
On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:
> Using a threaded interrupt without a dedicated primary handler mandates
> the IRQF_ONESHOT flag to mask the interrupt source while the threaded
> handler is active. Otherwise the interrupt can fire again before the
> threaded handler had a chance to run.
> 
> Mark explained that this should not happen with this hardware since it a
> slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will
> refuse to accept such a handler.
> 
> Set IRQF_ONESHOT so the interrupt source is masked until the secondary
> handler is done.
> 
> Cc: Lee Jones <lee@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: patches@opensource.cirrus.com
> Cc: Mark Brown <broonie@kernel.org>
> Fixes: 1c6c69525b40e ("genirq: Reject bogus threaded irq requests")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Andy Shevchenko 2 weeks, 2 days ago
On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:
> Using a threaded interrupt without a dedicated primary handler mandates
> the IRQF_ONESHOT flag to mask the interrupt source while the threaded
> handler is active. Otherwise the interrupt can fire again before the
> threaded handler had a chance to run.
> 
> Mark explained that this should not happen with this hardware since it a

"it is a" ?

> slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will
> refuse to accept such a handler.
> 
> Set IRQF_ONESHOT so the interrupt source is masked until the secondary
> handler is done.

...

> Cc: Lee Jones <lee@kernel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: patches@opensource.cirrus.com
> Cc: Mark Brown <broonie@kernel.org>

Cc list can be moved out from the commit message.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Sebastian Andrzej Siewior 2 weeks ago
On 2026-01-23 16:52:59 [+0200], Andy Shevchenko wrote:
> On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:
> > Using a threaded interrupt without a dedicated primary handler mandates
> > the IRQF_ONESHOT flag to mask the interrupt source while the threaded
> > handler is active. Otherwise the interrupt can fire again before the
> > threaded handler had a chance to run.
> > 
> > Mark explained that this should not happen with this hardware since it a
> 
> "it is a" ?

yes.

> > slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will
> > refuse to accept such a handler.
> > 
> > Set IRQF_ONESHOT so the interrupt source is masked until the secondary
> > handler is done.
> 
> ...
> 
> > Cc: Lee Jones <lee@kernel.org>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: patches@opensource.cirrus.com
> > Cc: Mark Brown <broonie@kernel.org>
> 
> Cc list can be moved out from the commit message.

If I move it out, the list won't be CCed.

Sebastian
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Andy Shevchenko 2 weeks ago
On Mon, Jan 26, 2026 at 09:01:19AM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-01-23 16:52:59 [+0200], Andy Shevchenko wrote:
> > On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:

...

> > > Cc: Lee Jones <lee@kernel.org>
> > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Cc: patches@opensource.cirrus.com
> > > Cc: Mark Brown <broonie@kernel.org>
> > 
> > Cc list can be moved out from the commit message.
> 
> If I move it out, the list won't be CCed.

Please. elaborate. It works for me. I use `git send-email ...`

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Sebastian Andrzej Siewior 2 weeks ago
On 2026-01-26 11:46:11 [+0200], Andy Shevchenko wrote:
> On Mon, Jan 26, 2026 at 09:01:19AM +0100, Sebastian Andrzej Siewior wrote:
> > On 2026-01-23 16:52:59 [+0200], Andy Shevchenko wrote:
> > > On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:
> 
> ...
> 
> > > > Cc: Lee Jones <lee@kernel.org>
> > > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Cc: patches@opensource.cirrus.com
> > > > Cc: Mark Brown <broonie@kernel.org>
> > > 
> > > Cc list can be moved out from the commit message.
> > 
> > If I move it out, the list won't be CCed.
> 
> Please. elaborate. It works for me. I use `git send-email ...`

Yes that works. But I have to move it every single patch and I have 20
and the number of Cc:es varies. Once I move it there, it won't be there
on the next git-format-patch or will be imported via git-am.
If you continue to nitpick here, I could do it for the next iio
submission assuming it will be picked-up by iio maintainers. But doing
it just for the single mfd patch looks like too much work.

Sebastian
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Andy Shevchenko 2 weeks ago
On Mon, Jan 26, 2026 at 10:56:13AM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-01-26 11:46:11 [+0200], Andy Shevchenko wrote:
> > On Mon, Jan 26, 2026 at 09:01:19AM +0100, Sebastian Andrzej Siewior wrote:
> > > On 2026-01-23 16:52:59 [+0200], Andy Shevchenko wrote:
> > > > On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:

...

> > > > > Cc: Lee Jones <lee@kernel.org>
> > > > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > > Cc: patches@opensource.cirrus.com
> > > > > Cc: Mark Brown <broonie@kernel.org>
> > > > 
> > > > Cc list can be moved out from the commit message.
> > > 
> > > If I move it out, the list won't be CCed.
> > 
> > Please. elaborate. It works for me. I use `git send-email ...`
> 
> Yes that works. But I have to move it every single patch and I have 20
> and the number of Cc:es varies. Once I move it there, it won't be there
> on the next git-format-patch

`git format-patch` uses the commit message verbatim.

> or will be imported via git-am.

Yes, that's the idea. `git am` will strip them out. But why would you need to
apply via `git am` locally? You can pull from the tree.

> If you continue to nitpick here, I could do it for the next iio
> submission assuming it will be picked-up by iio maintainers. But doing
> it just for the single mfd patch looks like too much work.

I'm thinking of all the patches.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Sebastian Andrzej Siewior 2 weeks ago
On 2026-01-26 12:05:13 [+0200], Andy Shevchenko wrote:
> > or will be imported via git-am.
> 
> Yes, that's the idea. `git am` will strip them out. But why would you need to
> apply via `git am` locally? You can pull from the tree.

I fetch from the list to pick up the tags, fix some of them up as the
iio but most of them remain the same. Then I post the v2. Where do I get
the Cc from? So I add them manually again?

> > If you continue to nitpick here, I could do it for the next iio
> > submission assuming it will be picked-up by iio maintainers. But doing
> > it just for the single mfd patch looks like too much work.
> 
> I'm thinking of all the patches.
> 

Sebastian
Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Andy Shevchenko 2 weeks ago
On Mon, Jan 26, 2026 at 11:13:08AM +0100, Sebastian Andrzej Siewior wrote:
> On 2026-01-26 12:05:13 [+0200], Andy Shevchenko wrote:
> > > or will be imported via git-am.
> > 
> > Yes, that's the idea. `git am` will strip them out. But why would you need to
> > apply via `git am` locally? You can pull from the tree.
> 
> I fetch from the list to pick up the tags, fix some of them up as the
> iio but most of them remain the same. Then I post the v2. Where do I get
> the Cc from? So I add them manually again?

Nope, I just checked how `b4 trailers -u ...` works. It does the correct thing.
What did I miss?

So, for the matter of test I took this one:
20250503-smc-6-15-v4-1-500b9b6546fc@svenpeter.dev
(as a *single* change).

In my tree I corrected it to look like this at the end of the commit message:

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sven Peter <sven@svenpeter.dev>
    ---
    Cc: Janne Grunau <j@jannau.net>
    Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    Cc: Neal Gompa <neal@gompa.dev>
    Cc: Hector Martin <marcan@marcan.st>
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Cc: Bartosz Golaszewski <brgl@bgdev.pl>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
    Cc: Conor Dooley <conor+dt@kernel.org>
    Cc: Sebastian Reichel <sre@kernel.org>
    Cc: Lee Jones <lee@kernel.org>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: asahi@lists.linux.dev
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-gpio@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org

Then I ran

$ b4 trailers -u 20250503-smc-6-15-v4-1-500b9b6546fc@svenpeter.dev
Finding code-review trailers for 1 commits...
---
  + Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    https://lore.kernel.org/all/aB3_Kw6WDaDAY6Ub@blossom
  + Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    https://lore.kernel.org/all/CACRpkdbCfUEZd06yeZTNecGFPwBgJkpMH3hqkvJw4J%2BiSENG%3DQ@mail.gmail.com
---
Press Enter to apply these trailers or Ctrl-C to abort
  dt-bindings: gpio: Add Apple Mac SMC GPIO block
    + Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> (✓ DKIM/rosenzweig.io)
    + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (✗ DKIM/linaro.org)
---
Invoking git-filter-repo to update trailers.
New history written in 0.08 seconds...
Completely finished after 0.38 seconds.
Trailers updated.

Then I looked at `git show` again:

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sven Peter <sven@svenpeter.dev>
    Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    ---
    Cc: Janne Grunau <j@jannau.net>
    Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    Cc: Neal Gompa <neal@gompa.dev>
    Cc: Hector Martin <marcan@marcan.st>
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Cc: Bartosz Golaszewski <brgl@bgdev.pl>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
    Cc: Conor Dooley <conor+dt@kernel.org>
    Cc: Sebastian Reichel <sre@kernel.org>
    Cc: Lee Jones <lee@kernel.org>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: asahi@lists.linux.dev
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-gpio@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org

P.S. `git am` is for maintainers, not flexible for the contributors.

> > > If you continue to nitpick here, I could do it for the next iio
> > > submission assuming it will be picked-up by iio maintainers. But doing
> > > it just for the single mfd patch looks like too much work.
> > 
> > I'm thinking of all the patches.

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT
Posted by Andy Shevchenko 2 weeks ago
On Mon, Jan 26, 2026 at 01:22:14PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 26, 2026 at 11:13:08AM +0100, Sebastian Andrzej Siewior wrote:
> > On 2026-01-26 12:05:13 [+0200], Andy Shevchenko wrote:

...

> > > > or will be imported via git-am.
> > > 
> > > Yes, that's the idea. `git am` will strip them out. But why would you need to
> > > apply via `git am` locally? You can pull from the tree.
> > 
> > I fetch from the list to pick up the tags, fix some of them up as the
> > iio but most of them remain the same. Then I post the v2. Where do I get
> > the Cc from? So I add them manually again?
> 
> Nope, I just checked how `b4 trailers -u ...` works. It does the correct thing.
> What did I miss?
> 
> So, for the matter of test I took this one:
> 20250503-smc-6-15-v4-1-500b9b6546fc@svenpeter.dev
> (as a *single* change).
> 
> In my tree I corrected it to look like this at the end of the commit message:
> 
>     Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>     Signed-off-by: Sven Peter <sven@svenpeter.dev>
>     ---
>     Cc: Janne Grunau <j@jannau.net>
>     Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
>     Cc: Neal Gompa <neal@gompa.dev>
>     Cc: Hector Martin <marcan@marcan.st>
>     Cc: Linus Walleij <linus.walleij@linaro.org>
>     Cc: Bartosz Golaszewski <brgl@bgdev.pl>
>     Cc: Rob Herring <robh@kernel.org>
>     Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
>     Cc: Conor Dooley <conor+dt@kernel.org>
>     Cc: Sebastian Reichel <sre@kernel.org>
>     Cc: Lee Jones <lee@kernel.org>
>     Cc: Marc Zyngier <maz@kernel.org>
>     Cc: asahi@lists.linux.dev
>     Cc: linux-arm-kernel@lists.infradead.org
>     Cc: linux-gpio@vger.kernel.org
>     Cc: devicetree@vger.kernel.org
>     Cc: linux-kernel@vger.kernel.org
>     Cc: linux-pm@vger.kernel.org
> 
> Then I ran
> 
> $ b4 trailers -u 20250503-smc-6-15-v4-1-500b9b6546fc@svenpeter.dev
> Finding code-review trailers for 1 commits...
> ---
>   + Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
>     https://lore.kernel.org/all/aB3_Kw6WDaDAY6Ub@blossom
>   + Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>     https://lore.kernel.org/all/CACRpkdbCfUEZd06yeZTNecGFPwBgJkpMH3hqkvJw4J%2BiSENG%3DQ@mail.gmail.com
> ---
> Press Enter to apply these trailers or Ctrl-C to abort
>   dt-bindings: gpio: Add Apple Mac SMC GPIO block
>     + Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> (✓ DKIM/rosenzweig.io)
>     + Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (✗ DKIM/linaro.org)
> ---
> Invoking git-filter-repo to update trailers.
> New history written in 0.08 seconds...
> Completely finished after 0.38 seconds.
> Trailers updated.
> 
> Then I looked at `git show` again:
> 
>     Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>     Signed-off-by: Sven Peter <sven@svenpeter.dev>
>     Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
>     Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>     ---
>     Cc: Janne Grunau <j@jannau.net>
>     Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
>     Cc: Neal Gompa <neal@gompa.dev>
>     Cc: Hector Martin <marcan@marcan.st>
>     Cc: Linus Walleij <linus.walleij@linaro.org>
>     Cc: Bartosz Golaszewski <brgl@bgdev.pl>
>     Cc: Rob Herring <robh@kernel.org>
>     Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
>     Cc: Conor Dooley <conor+dt@kernel.org>
>     Cc: Sebastian Reichel <sre@kernel.org>
>     Cc: Lee Jones <lee@kernel.org>
>     Cc: Marc Zyngier <maz@kernel.org>
>     Cc: asahi@lists.linux.dev
>     Cc: linux-arm-kernel@lists.infradead.org
>     Cc: linux-gpio@vger.kernel.org
>     Cc: devicetree@vger.kernel.org
>     Cc: linux-kernel@vger.kernel.org
>     Cc: linux-pm@vger.kernel.org

FWIW, I ran `git format-patch` and reapplied locally to test how maintainer
will see it:

    Add the DT binding for the Apple Mac System Management Controller GPIOs.

    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sven Peter <sven@svenpeter.dev>
    Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

diff --git a/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml b/Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml

So, everything works as intended.

> P.S. `git am` is for maintainers, not flexible for the contributors.
> 
> > > > If you continue to nitpick here, I could do it for the next iio
> > > > submission assuming it will be picked-up by iio maintainers. But doing
> > > > it just for the single mfd patch looks like too much work.
> > > 
> > > I'm thinking of all the patches.

-- 
With Best Regards,
Andy Shevchenko