All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gpio: siox: explicitly support only threaded irqs
@ 2020-09-07 15:31 Ahmad Fatoum
  2020-09-07 16:15 ` Uwe Kleine-König
  2020-09-09  9:43 ` Bartosz Golaszewski
  0 siblings, 2 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2020-09-07 15:31 UTC (permalink / raw)
  To: Thorsten Scherer, Uwe Kleine-König, Pengutronix Kernel Team,
	Linus Walleij, Bartosz Golaszewski
  Cc: tglx, Ahmad Fatoum, linux-gpio, linux-kernel

The gpio-siox driver uses handle_nested_irq() to implement its
interrupt support. This is only capable of handling threaded irq
actions. For a hardirq action it triggers a NULL pointer oops.
(It calls action->thread_fn which is NULL then.)

Prevent registration of a hardirq action by setting
gpio_irq_chip::threaded to true.

Cc: u.kleine-koenig@pengutronix.de
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
  reworded commit message (Uwe)
---
 drivers/gpio/gpio-siox.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index 26e1fe092304..f8c5e9fc4bac 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -245,6 +245,7 @@ static int gpio_siox_probe(struct siox_device *sdevice)
 	girq->chip = &ddata->ichip;
 	girq->default_type = IRQ_TYPE_NONE;
 	girq->handler = handle_level_irq;
+	girq->threaded = true;
 
 	ret = devm_gpiochip_add_data(dev, &ddata->gchip, NULL);
 	if (ret)
-- 
2.28.0


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

* Re: [PATCH v2] gpio: siox: explicitly support only threaded irqs
  2020-09-07 15:31 [PATCH v2] gpio: siox: explicitly support only threaded irqs Ahmad Fatoum
@ 2020-09-07 16:15 ` Uwe Kleine-König
  2020-09-09  9:43 ` Bartosz Golaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2020-09-07 16:15 UTC (permalink / raw)
  To: Ahmad Fatoum
  Cc: Thorsten Scherer, Pengutronix Kernel Team, Linus Walleij,
	Bartosz Golaszewski, linux-gpio, tglx, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Hello Ahmad,

On Mon, Sep 07, 2020 at 05:31:35PM +0200, Ahmad Fatoum wrote:
> The gpio-siox driver uses handle_nested_irq() to implement its
> interrupt support. This is only capable of handling threaded irq
> actions. For a hardirq action it triggers a NULL pointer oops.
> (It calls action->thread_fn which is NULL then.)
> 
> Prevent registration of a hardirq action by setting
> gpio_irq_chip::threaded to true.

cool commit log :-)

> Cc: u.kleine-koenig@pengutronix.de
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks for picking this up.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] gpio: siox: explicitly support only threaded irqs
  2020-09-07 15:31 [PATCH v2] gpio: siox: explicitly support only threaded irqs Ahmad Fatoum
  2020-09-07 16:15 ` Uwe Kleine-König
@ 2020-09-09  9:43 ` Bartosz Golaszewski
  2020-09-09 10:30   ` Uwe Kleine-König
  1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2020-09-09  9:43 UTC (permalink / raw)
  To: Ahmad Fatoum
  Cc: Thorsten Scherer, Uwe Kleine-König, Pengutronix Kernel Team,
	Linus Walleij, Thomas Gleixner, linux-gpio, LKML

On Mon, Sep 7, 2020 at 5:32 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> The gpio-siox driver uses handle_nested_irq() to implement its
> interrupt support. This is only capable of handling threaded irq
> actions. For a hardirq action it triggers a NULL pointer oops.
> (It calls action->thread_fn which is NULL then.)
>
> Prevent registration of a hardirq action by setting
> gpio_irq_chip::threaded to true.
>
> Cc: u.kleine-koenig@pengutronix.de
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---

Could you add a Fixes tag? This looks like stable material.

Bart

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

* Re: [PATCH v2] gpio: siox: explicitly support only threaded irqs
  2020-09-09  9:43 ` Bartosz Golaszewski
@ 2020-09-09 10:30   ` Uwe Kleine-König
  2020-09-09 11:00     ` Bartosz Golaszewski
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2020-09-09 10:30 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Ahmad Fatoum, Linus Walleij, LKML, linux-gpio, Thorsten Scherer,
	Pengutronix Kernel Team, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

On Wed, Sep 09, 2020 at 11:43:24AM +0200, Bartosz Golaszewski wrote:
> On Mon, Sep 7, 2020 at 5:32 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >
> > The gpio-siox driver uses handle_nested_irq() to implement its
> > interrupt support. This is only capable of handling threaded irq
> > actions. For a hardirq action it triggers a NULL pointer oops.
> > (It calls action->thread_fn which is NULL then.)
> >
> > Prevent registration of a hardirq action by setting
> > gpio_irq_chip::threaded to true.
> >
> > Cc: u.kleine-koenig@pengutronix.de
> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > ---
> 
> Could you add a Fixes tag? This looks like stable material.

Ah, we talked about this in the v1 thread---tglx and I agreed we want
it. That's:

Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox")

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] gpio: siox: explicitly support only threaded irqs
  2020-09-09 10:30   ` Uwe Kleine-König
@ 2020-09-09 11:00     ` Bartosz Golaszewski
  0 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2020-09-09 11:00 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Ahmad Fatoum, Linus Walleij, LKML, linux-gpio, Thorsten Scherer,
	Pengutronix Kernel Team, Thomas Gleixner

On Wed, Sep 9, 2020 at 12:30 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> On Wed, Sep 09, 2020 at 11:43:24AM +0200, Bartosz Golaszewski wrote:
> > On Mon, Sep 7, 2020 at 5:32 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> > >
> > > The gpio-siox driver uses handle_nested_irq() to implement its
> > > interrupt support. This is only capable of handling threaded irq
> > > actions. For a hardirq action it triggers a NULL pointer oops.
> > > (It calls action->thread_fn which is NULL then.)
> > >
> > > Prevent registration of a hardirq action by setting
> > > gpio_irq_chip::threaded to true.
> > >
> > > Cc: u.kleine-koenig@pengutronix.de
> > > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > > ---
> >
> > Could you add a Fixes tag? This looks like stable material.
>
> Ah, we talked about this in the v1 thread---tglx and I agreed we want
> it. That's:
>
> Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox")
>

Thanks, now queued for fixes.

Bartosz

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

end of thread, other threads:[~2020-09-09 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 15:31 [PATCH v2] gpio: siox: explicitly support only threaded irqs Ahmad Fatoum
2020-09-07 16:15 ` Uwe Kleine-König
2020-09-09  9:43 ` Bartosz Golaszewski
2020-09-09 10:30   ` Uwe Kleine-König
2020-09-09 11:00     ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.