Skip to contentSkip to conversation

gpio: davinci: interrupt related fixes

PATCH Applied Dhruva Gole 2 participants 4 messages Apr 3, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover gpio: davinci: interrupt related fixes

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/[email protected]/

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 <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Devarsh Thakkar <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Vibhore Vardhan <[email protected]>

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(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 gpio: davinci: Do not clear the bank intr enable bit in save_context

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 <[email protected]>
Fixes 0651a730924b ("gpio: davinci: Add support for system suspend/resume PM")
---
 drivers/gpio/gpio-davinci.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpio/gpio-davinci.c +0 -3
index 7fc83057990a..d7595b39e8c4 100644
@@ -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);
 }
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 gpio: davinci: Add irq chip flag to skip set wake

In reply to Dhruva Gole

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")
---
 drivers/gpio/gpio-davinci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-davinci.c +1 -1
index d7595b39e8c4..aaaf61dc2632 100644
@@ -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)
Signature · 1 line
2.25.1
#3 lore raw
In reply to Dhruva Gole
Quoted 23 lines · Dhruva Gole

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/[email protected]/

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 <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Devarsh Thakkar <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Vibhore Vardhan <[email protected]>

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

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

--
2.25.1

Queued for fixes. Thanks!

Bart