Skip to contentSkip to conversation

gpio: davinci: Do not clear the bank intr enable bit in save_context

RFC PATCH In review Dhruva Gole 3 participants 5 messages Mar 23, 2023 – Mar 30, 2023

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

RFC 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.

Fixes 0651a730924b ("gpio: davinci: Add support for system suspend/resume PM")
Cc Devarsh Thakkar <[email protected]>
---
 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
#1 lore raw

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

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
Reviewed-by on v1 2/2
#2 lore raw

Re: [RFC PATCH 2/2] gpio: davinci: Add irq chip flag to skip set wake

Quoted 5 lines · 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")

Yours,
Linus Walleij

Reviewed-by on v1 1/2
#3 lore raw
In reply to Dhruva Gole
Quoted 9 lines · Dhruva Gole

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.

Fixes 0651a730924b ("gpio: davinci: Add support for system suspend/resume PM")
Cc Devarsh Thakkar <[email protected]>

Looks like the right solution to me.
I'm a bit surprised given how long we have had this driver. I suppose people have used out-of-tree patches for suspend/resume. :(

Yours,
Linus Walleij

maintainer Acked-by
#4 lore raw
Quoted 12 lines · Linus Walleij
Quoted 9 lines · Dhruva Gole

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.

Fixes 0651a730924b ("gpio: davinci: Add support for system suspend/resume PM")
Cc Devarsh Thakkar <[email protected]>
Quoted 5 lines

Looks like the right solution to me.
I'm a bit surprised given how long we have had this driver. I suppose people have used out-of-tree patches for suspend/resume. :(

Quoted 3 lines

Yours,
Linus Walleij