stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: dln2: Fix interrupts when replugging the device
@ 2021-10-18 11:22 Noralf Trønnes
  2021-10-24 21:09 ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Noralf Trønnes @ 2021-10-18 11:22 UTC (permalink / raw)
  To: linux-gpio
  Cc: linus.walleij, bgolaszewski, Noralf Trønnes, stable, Daniel Baluta

When replugging the device the following message shows up:

gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.

This also has the effect that interrupts won't work.
The same problem would also show up if multiple devices where plugged in.

Fix this by allocating the irq_chip data structure per instance like other
drivers do.

I don't know when this problem appeared, but it is present in 5.10.

Cc: <stable@vger.kernel.org> # 5.10+
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpio/gpio-dln2.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c
index 4c5f6d0c8d74..22f11dd5210d 100644
--- a/drivers/gpio/gpio-dln2.c
+++ b/drivers/gpio/gpio-dln2.c
@@ -46,6 +46,7 @@
 struct dln2_gpio {
 	struct platform_device *pdev;
 	struct gpio_chip gpio;
+	struct irq_chip irqchip;
 
 	/*
 	 * Cache pin direction to save us one transfer, since the hardware has
@@ -383,15 +384,6 @@ static void dln2_irq_bus_unlock(struct irq_data *irqd)
 	mutex_unlock(&dln2->irq_lock);
 }
 
-static struct irq_chip dln2_gpio_irqchip = {
-	.name = "dln2-irq",
-	.irq_mask = dln2_irq_mask,
-	.irq_unmask = dln2_irq_unmask,
-	.irq_set_type = dln2_irq_set_type,
-	.irq_bus_lock = dln2_irq_bus_lock,
-	.irq_bus_sync_unlock = dln2_irq_bus_unlock,
-};
-
 static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
 			    const void *data, int len)
 {
@@ -477,8 +469,15 @@ static int dln2_gpio_probe(struct platform_device *pdev)
 	dln2->gpio.direction_output = dln2_gpio_direction_output;
 	dln2->gpio.set_config = dln2_gpio_set_config;
 
+	dln2->irqchip.name = "dln2-irq",
+	dln2->irqchip.irq_mask = dln2_irq_mask,
+	dln2->irqchip.irq_unmask = dln2_irq_unmask,
+	dln2->irqchip.irq_set_type = dln2_irq_set_type,
+	dln2->irqchip.irq_bus_lock = dln2_irq_bus_lock,
+	dln2->irqchip.irq_bus_sync_unlock = dln2_irq_bus_unlock,
+
 	girq = &dln2->gpio.irq;
-	girq->chip = &dln2_gpio_irqchip;
+	girq->chip = &dln2->irqchip;
 	/* The event comes from the outside so no parent handler */
 	girq->parent_handler = NULL;
 	girq->num_parents = 0;
-- 
2.33.0


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

* Re: [PATCH] gpio: dln2: Fix interrupts when replugging the device
  2021-10-18 11:22 [PATCH] gpio: dln2: Fix interrupts when replugging the device Noralf Trønnes
@ 2021-10-24 21:09 ` Linus Walleij
  2021-11-22 20:28   ` Noralf Trønnes
  2021-12-19  0:01   ` Noralf Trønnes
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2021-10-24 21:09 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: open list:GPIO SUBSYSTEM, Bartosz Golaszewski, stable, Daniel Baluta

On Mon, Oct 18, 2021 at 1:23 PM Noralf Trønnes <noralf@tronnes.org> wrote:

> When replugging the device the following message shows up:
>
> gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.
>
> This also has the effect that interrupts won't work.
> The same problem would also show up if multiple devices where plugged in.
>
> Fix this by allocating the irq_chip data structure per instance like other
> drivers do.
>
> I don't know when this problem appeared, but it is present in 5.10.
>
> Cc: <stable@vger.kernel.org> # 5.10+
> Cc: Daniel Baluta <daniel.baluta@gmail.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: dln2: Fix interrupts when replugging the device
  2021-10-24 21:09 ` Linus Walleij
@ 2021-11-22 20:28   ` Noralf Trønnes
  2021-11-22 23:45     ` Linus Walleij
  2021-12-19  0:01   ` Noralf Trønnes
  1 sibling, 1 reply; 6+ messages in thread
From: Noralf Trønnes @ 2021-11-22 20:28 UTC (permalink / raw)
  To: Linus Walleij
  Cc: open list:GPIO SUBSYSTEM, Bartosz Golaszewski, stable, Daniel Baluta



Den 24.10.2021 23.09, skrev Linus Walleij:
> On Mon, Oct 18, 2021 at 1:23 PM Noralf Trønnes <noralf@tronnes.org> wrote:
> 
>> When replugging the device the following message shows up:
>>
>> gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.
>>
>> This also has the effect that interrupts won't work.
>> The same problem would also show up if multiple devices where plugged in.
>>
>> Fix this by allocating the irq_chip data structure per instance like other
>> drivers do.
>>
>> I don't know when this problem appeared, but it is present in 5.10.
>>
>> Cc: <stable@vger.kernel.org> # 5.10+
>> Cc: Daniel Baluta <daniel.baluta@gmail.com>
>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 

Has this been applied, I can't see it in -next?

Noralf.

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

* Re: [PATCH] gpio: dln2: Fix interrupts when replugging the device
  2021-11-22 20:28   ` Noralf Trønnes
@ 2021-11-22 23:45     ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-11-22 23:45 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: open list:GPIO SUBSYSTEM, Bartosz Golaszewski, stable, Daniel Baluta

On Mon, Nov 22, 2021 at 9:28 PM Noralf Trønnes <noralf@tronnes.org> wrote:

> Has this been applied, I can't see it in -next?

Bartosz is applying patches for the recent kernels, I bet he will
get to it.

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: dln2: Fix interrupts when replugging the device
  2021-10-24 21:09 ` Linus Walleij
  2021-11-22 20:28   ` Noralf Trønnes
@ 2021-12-19  0:01   ` Noralf Trønnes
  2021-12-19 14:02     ` Bartosz Golaszewski
  1 sibling, 1 reply; 6+ messages in thread
From: Noralf Trønnes @ 2021-12-19  0:01 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, open list:GPIO SUBSYSTEM, stable, Daniel Baluta



Den 24.10.2021 23.09, skrev Linus Walleij:
> On Mon, Oct 18, 2021 at 1:23 PM Noralf Trønnes <noralf@tronnes.org> wrote:
> 
>> When replugging the device the following message shows up:
>>
>> gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.
>>
>> This also has the effect that interrupts won't work.
>> The same problem would also show up if multiple devices where plugged in.
>>
>> Fix this by allocating the irq_chip data structure per instance like other
>> drivers do.
>>
>> I don't know when this problem appeared, but it is present in 5.10.
>>
>> Cc: <stable@vger.kernel.org> # 5.10+
>> Cc: Daniel Baluta <daniel.baluta@gmail.com>
>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 

Ping, has this been forgotten? Can't see it in -next.

Noralf.

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

* Re: [PATCH] gpio: dln2: Fix interrupts when replugging the device
  2021-12-19  0:01   ` Noralf Trønnes
@ 2021-12-19 14:02     ` Bartosz Golaszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2021-12-19 14:02 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: Bartosz Golaszewski, Linus Walleij, open list:GPIO SUBSYSTEM,
	stable, Daniel Baluta

On Sun, Dec 19, 2021 at 1:01 AM Noralf Trønnes <noralf@tronnes.org> wrote:
>
>
>
> Den 24.10.2021 23.09, skrev Linus Walleij:
> > On Mon, Oct 18, 2021 at 1:23 PM Noralf Trønnes <noralf@tronnes.org> wrote:
> >
> >> When replugging the device the following message shows up:
> >>
> >> gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver.
> >>
> >> This also has the effect that interrupts won't work.
> >> The same problem would also show up if multiple devices where plugged in.
> >>
> >> Fix this by allocating the irq_chip data structure per instance like other
> >> drivers do.
> >>
> >> I don't know when this problem appeared, but it is present in 5.10.
> >>
> >> Cc: <stable@vger.kernel.org> # 5.10+
> >> Cc: Daniel Baluta <daniel.baluta@gmail.com>
> >> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> >
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >
>
> Ping, has this been forgotten? Can't see it in -next.
>
> Noralf.

Hi Noralf,

As of commit d1d598104336075e7475d932d200b33108399225 my email address
has changed and the relevant commit has been in mainline for a while
now. I only by accident noticed this patch now. Please use
scripts/get_maintainer.pl in the future.

Now queued, thanks!

Bart

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

end of thread, other threads:[~2021-12-19 14:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 11:22 [PATCH] gpio: dln2: Fix interrupts when replugging the device Noralf Trønnes
2021-10-24 21:09 ` Linus Walleij
2021-11-22 20:28   ` Noralf Trønnes
2021-11-22 23:45     ` Linus Walleij
2021-12-19  0:01   ` Noralf Trønnes
2021-12-19 14:02     ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).