public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: davinci: fix lazy disable
@ 2024-08-28 13:32 Parth Pancholi
  2024-09-02 12:08 ` Bartosz Golaszewski
  2024-09-30 11:54 ` Bartosz Golaszewski
  0 siblings, 2 replies; 5+ messages in thread
From: Parth Pancholi @ 2024-08-28 13:32 UTC (permalink / raw)
  To: Keerthy, Linus Walleij, Bartosz Golaszewski
  Cc: Emanuele Ghidoli, linux-gpio, linux-kernel, Parth Pancholi,
	stable

From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

On a few platforms such as TI's AM69 device, disable_irq()
fails to keep track of the interrupts that happen between
disable_irq() and enable_irq() and those interrupts are missed.
Use the ->irq_unmask() and ->irq_mask() methods instead
of ->irq_enable() and ->irq_disable() to correctly keep track of
edges when disable_irq is called.
This solves the issue of disable_irq() not working as expected
on such platforms.

Fixes: 23265442b02b ("ARM: davinci: irq_data conversion.")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
Cc: stable@vger.kernel.org
---
 drivers/gpio/gpio-davinci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 1d0175d6350b..0ecfa7de5ce2 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -289,7 +289,7 @@ static int davinci_gpio_probe(struct platform_device *pdev)
  * serve as EDMA event triggers.
  */
 
-static void gpio_irq_disable(struct irq_data *d)
+static void gpio_irq_mask(struct irq_data *d)
 {
 	struct davinci_gpio_regs __iomem *g = irq2regs(d);
 	uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
@@ -298,7 +298,7 @@ static void gpio_irq_disable(struct irq_data *d)
 	writel_relaxed(mask, &g->clr_rising);
 }
 
-static void gpio_irq_enable(struct irq_data *d)
+static void gpio_irq_unmask(struct irq_data *d)
 {
 	struct davinci_gpio_regs __iomem *g = irq2regs(d);
 	uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
@@ -324,8 +324,8 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger)
 
 static struct irq_chip gpio_irqchip = {
 	.name		= "GPIO",
-	.irq_enable	= gpio_irq_enable,
-	.irq_disable	= gpio_irq_disable,
+	.irq_unmask	= gpio_irq_unmask,
+	.irq_mask	= gpio_irq_mask,
 	.irq_set_type	= gpio_irq_type,
 	.flags		= IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
 };
-- 
2.34.1


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

* Re: [PATCH] gpio: davinci: fix lazy disable
  2024-08-28 13:32 [PATCH] gpio: davinci: fix lazy disable Parth Pancholi
@ 2024-09-02 12:08 ` Bartosz Golaszewski
  2024-09-23  9:40   ` Francesco Dolcini
  2024-09-30 11:54 ` Bartosz Golaszewski
  1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-09-02 12:08 UTC (permalink / raw)
  To: Parth Pancholi
  Cc: Keerthy, Linus Walleij, Emanuele Ghidoli, linux-gpio,
	linux-kernel, Parth Pancholi, stable

On Wed, Aug 28, 2024 at 3:32 PM Parth Pancholi <parth105105@gmail.com> wrote:
>
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
>
> On a few platforms such as TI's AM69 device, disable_irq()
> fails to keep track of the interrupts that happen between
> disable_irq() and enable_irq() and those interrupts are missed.
> Use the ->irq_unmask() and ->irq_mask() methods instead
> of ->irq_enable() and ->irq_disable() to correctly keep track of
> edges when disable_irq is called.
> This solves the issue of disable_irq() not working as expected
> on such platforms.
>
> Fixes: 23265442b02b ("ARM: davinci: irq_data conversion.")
> Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
> Cc: stable@vger.kernel.org
> ---

It looks good to me but I'd like to have an Ack from Keerthy on this.

Bart

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

* Re: [PATCH] gpio: davinci: fix lazy disable
  2024-09-02 12:08 ` Bartosz Golaszewski
@ 2024-09-23  9:40   ` Francesco Dolcini
  2024-09-23 10:06     ` J, KEERTHY
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco Dolcini @ 2024-09-23  9:40 UTC (permalink / raw)
  To: Keerthy, Bartosz Golaszewski
  Cc: Parth Pancholi, Linus Walleij, Emanuele Ghidoli, linux-gpio,
	linux-kernel, Parth Pancholi, stable

Hello Keerthy,

On Mon, Sep 02, 2024 at 02:08:30PM +0200, Bartosz Golaszewski wrote:
> On Wed, Aug 28, 2024 at 3:32 PM Parth Pancholi <parth105105@gmail.com> wrote:
> >
> > From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> >
> > On a few platforms such as TI's AM69 device, disable_irq()
> > fails to keep track of the interrupts that happen between
> > disable_irq() and enable_irq() and those interrupts are missed.
> > Use the ->irq_unmask() and ->irq_mask() methods instead
> > of ->irq_enable() and ->irq_disable() to correctly keep track of
> > edges when disable_irq is called.
> > This solves the issue of disable_irq() not working as expected
> > on such platforms.
> >
> > Fixes: 23265442b02b ("ARM: davinci: irq_data conversion.")
> > Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> > Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
> > Cc: stable@vger.kernel.org
> > ---
> 
> It looks good to me but I'd like to have an Ack from Keerthy on this.

Keerthy, just a gentle ping on this, can you help?

Francesco


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

* RE: [PATCH] gpio: davinci: fix lazy disable
  2024-09-23  9:40   ` Francesco Dolcini
@ 2024-09-23 10:06     ` J, KEERTHY
  0 siblings, 0 replies; 5+ messages in thread
From: J, KEERTHY @ 2024-09-23 10:06 UTC (permalink / raw)
  To: Francesco Dolcini, Bartosz Golaszewski
  Cc: Parth Pancholi, Linus Walleij, Emanuele Ghidoli,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Parth Pancholi, stable@vger.kernel.org



-----Original Message-----
From: Francesco Dolcini <francesco@dolcini.it> 
Sent: Monday, September 23, 2024 3:10 PM
To: J, KEERTHY <j-keerthy@ti.com>; Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Parth Pancholi <parth105105@gmail.com>; Linus Walleij <linus.walleij@linaro.org>; Emanuele Ghidoli <emanuele.ghidoli@toradex.com>; linux-gpio@vger.kernel.org; linux-kernel@vger.kernel.org; Parth Pancholi <parth.pancholi@toradex.com>; stable@vger.kernel.org
Subject: Re: [PATCH] gpio: davinci: fix lazy disable

Hello Keerthy,

On Mon, Sep 02, 2024 at 02:08:30PM +0200, Bartosz Golaszewski wrote:
> On Wed, Aug 28, 2024 at 3:32 PM Parth Pancholi <parth105105@gmail.com> wrote:
> >
> > From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> >
> > On a few platforms such as TI's AM69 device, disable_irq()
> > fails to keep track of the interrupts that happen between
> > disable_irq() and enable_irq() and those interrupts are missed.
> > Use the ->irq_unmask() and ->irq_mask() methods instead
> > of ->irq_enable() and ->irq_disable() to correctly keep track of
> > edges when disable_irq is called.
> > This solves the issue of disable_irq() not working as expected
> > on such platforms.
> >
> > Fixes: 23265442b02b ("ARM: davinci: irq_data conversion.")
> > Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> > Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
> > Cc: stable@vger.kernel.org
> > ---
> 
> It looks good to me but I'd like to have an Ack from Keerthy on this.

Keerthy, just a gentle ping on this, can you help?

> Acked-by: Keerthy <j-keerthy@ti.com>

Francesco


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

* Re: [PATCH] gpio: davinci: fix lazy disable
  2024-08-28 13:32 [PATCH] gpio: davinci: fix lazy disable Parth Pancholi
  2024-09-02 12:08 ` Bartosz Golaszewski
@ 2024-09-30 11:54 ` Bartosz Golaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-09-30 11:54 UTC (permalink / raw)
  To: Keerthy, Linus Walleij, Bartosz Golaszewski, Parth Pancholi
  Cc: Bartosz Golaszewski, Emanuele Ghidoli, linux-gpio, linux-kernel,
	Parth Pancholi, stable

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Wed, 28 Aug 2024 15:32:07 +0200, Parth Pancholi wrote:
> On a few platforms such as TI's AM69 device, disable_irq()
> fails to keep track of the interrupts that happen between
> disable_irq() and enable_irq() and those interrupts are missed.
> Use the ->irq_unmask() and ->irq_mask() methods instead
> of ->irq_enable() and ->irq_disable() to correctly keep track of
> edges when disable_irq is called.
> This solves the issue of disable_irq() not working as expected
> on such platforms.
> 
> [...]

A couple hints:

Keerthy: Don't quote your tags as b4 will not pick it up.
Parth: Don't wrap the commit message lines too eagerly as it actually makes
it less readable.

Applied for fixes, thanks!

[1/1] gpio: davinci: fix lazy disable
      commit: 3360d41f4ac490282fddc3ccc0b58679aa5c065d

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

end of thread, other threads:[~2024-09-30 11:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 13:32 [PATCH] gpio: davinci: fix lazy disable Parth Pancholi
2024-09-02 12:08 ` Bartosz Golaszewski
2024-09-23  9:40   ` Francesco Dolcini
2024-09-23 10:06     ` J, KEERTHY
2024-09-30 11:54 ` Bartosz Golaszewski

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