linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gpio: davinci: interrupt related fixes
@ 2023-04-03  7:24 Dhruva Gole
  2023-04-03  7:24 ` [PATCH 1/2] gpio: davinci: Do not clear the bank intr enable bit in save_context Dhruva Gole
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dhruva Gole @ 2023-04-03  7:24 UTC (permalink / raw)
  To: linux-gpio
  Cc: Dhruva Gole, linux-kernel, Keerthy, Bartosz Golaszewski,
	Linus Walleij, Devarsh Thakkar, Tony Lindgren, Vibhore Vardhan

This series fixes some critical bugs in the gpio-davinci driver
that come to light when the system tries to wakeup from a suspended
state.

It was earlier posted as an RFC here:
https://lore.kernel.org/all/20230323122910.991148-1-d-gole@ti.com/

No changes, just resending without the RFC tag since the patches are now
proposed to be merged into mainline.
Also add all the Acks and R-by's from respective maintainers and reviewers.

Cc: Keerthy <j-keerthy@ti.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Devarsh Thakkar <devarsht@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Vibhore Vardhan <vibhore@ti.com>

Dhruva Gole (2):
  gpio: davinci: Do not clear the bank intr enable bit in save_context
  gpio: davinci: Add irq chip flag to skip set wake

 drivers/gpio/gpio-davinci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.25.1


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

* [PATCH 1/2] gpio: davinci: Do not clear the bank intr enable bit in save_context
  2023-04-03  7:24 [PATCH 0/2] gpio: davinci: interrupt related fixes Dhruva Gole
@ 2023-04-03  7:24 ` Dhruva Gole
  2023-04-03  7:24 ` [PATCH 2/2] gpio: davinci: Add irq chip flag to skip set wake Dhruva Gole
  2023-04-03 15:41 ` [PATCH 0/2] gpio: davinci: interrupt related fixes Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Dhruva Gole @ 2023-04-03  7:24 UTC (permalink / raw)
  To: linux-gpio
  Cc: Dhruva Gole, linux-kernel, Devarsh Thakkar, Linus Walleij, Keerthy

The interrupt enable bits might be set if we want to use the GPIO as
wakeup source. Clearing this will mean disabling of interrupts in the GPIO
banks that we may want to wakeup from.
Thus remove the line that was clearing this bit from the driver's save
context function.

Cc: Devarsh Thakkar <devarsht@ti.com>
Fixes: 0651a730924b ("gpio: davinci: Add support for system suspend/resume PM")
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Keerthy <j-keerthy@ti.com>
---
 drivers/gpio/gpio-davinci.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 7fc83057990a..d7595b39e8c4 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -639,9 +639,6 @@ static void davinci_gpio_save_context(struct davinci_gpio_controller *chips,
 		context->set_falling = readl_relaxed(&g->set_falling);
 	}
 
-	/* Clear Bank interrupt enable bit */
-	writel_relaxed(0, base + BINTEN);
-
 	/* Clear all interrupt status registers */
 	writel_relaxed(GENMASK(31, 0), &g->intstat);
 }
-- 
2.25.1


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

* [PATCH 2/2] gpio: davinci: Add irq chip flag to skip set wake
  2023-04-03  7:24 [PATCH 0/2] gpio: davinci: interrupt related fixes Dhruva Gole
  2023-04-03  7:24 ` [PATCH 1/2] gpio: davinci: Do not clear the bank intr enable bit in save_context Dhruva Gole
@ 2023-04-03  7:24 ` Dhruva Gole
  2023-04-03 15:41 ` [PATCH 0/2] gpio: davinci: interrupt related fixes Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Dhruva Gole @ 2023-04-03  7:24 UTC (permalink / raw)
  To: linux-gpio; +Cc: Dhruva Gole, linux-kernel, Linus Walleij

Add the IRQCHIP_SKIP_SET_WAKE flag since there are no special IRQ Wake
bits that can be set to enable wakeup IRQ.

Fixes: 3d9edf09d452 ("[ARM] 4457/2: davinci: GPIO support")
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-davinci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index d7595b39e8c4..aaaf61dc2632 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -322,7 +322,7 @@ static struct irq_chip gpio_irqchip = {
 	.irq_enable	= gpio_irq_enable,
 	.irq_disable	= gpio_irq_disable,
 	.irq_set_type	= gpio_irq_type,
-	.flags		= IRQCHIP_SET_TYPE_MASKED,
+	.flags		= IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
 };
 
 static void gpio_irq_handler(struct irq_desc *desc)
-- 
2.25.1


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

* Re: [PATCH 0/2] gpio: davinci: interrupt related fixes
  2023-04-03  7:24 [PATCH 0/2] gpio: davinci: interrupt related fixes Dhruva Gole
  2023-04-03  7:24 ` [PATCH 1/2] gpio: davinci: Do not clear the bank intr enable bit in save_context Dhruva Gole
  2023-04-03  7:24 ` [PATCH 2/2] gpio: davinci: Add irq chip flag to skip set wake Dhruva Gole
@ 2023-04-03 15:41 ` Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2023-04-03 15:41 UTC (permalink / raw)
  To: Dhruva Gole
  Cc: linux-gpio, linux-kernel, Keerthy, Linus Walleij,
	Devarsh Thakkar, Tony Lindgren, Vibhore Vardhan

On Mon, Apr 3, 2023 at 9:25 AM Dhruva Gole <d-gole@ti.com> wrote:
>
> This series fixes some critical bugs in the gpio-davinci driver
> that come to light when the system tries to wakeup from a suspended
> state.
>
> It was earlier posted as an RFC here:
> https://lore.kernel.org/all/20230323122910.991148-1-d-gole@ti.com/
>
> No changes, just resending without the RFC tag since the patches are now
> proposed to be merged into mainline.
> Also add all the Acks and R-by's from respective maintainers and reviewers.
>
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Devarsh Thakkar <devarsht@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Vibhore Vardhan <vibhore@ti.com>
>
> Dhruva Gole (2):
>   gpio: davinci: Do not clear the bank intr enable bit in save_context
>   gpio: davinci: Add irq chip flag to skip set wake
>
>  drivers/gpio/gpio-davinci.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> --
> 2.25.1
>

Queued for fixes. Thanks!

Bart

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

end of thread, other threads:[~2023-04-03 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03  7:24 [PATCH 0/2] gpio: davinci: interrupt related fixes Dhruva Gole
2023-04-03  7:24 ` [PATCH 1/2] gpio: davinci: Do not clear the bank intr enable bit in save_context Dhruva Gole
2023-04-03  7:24 ` [PATCH 2/2] gpio: davinci: Add irq chip flag to skip set wake Dhruva Gole
2023-04-03 15:41 ` [PATCH 0/2] gpio: davinci: interrupt related fixes 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).