gpio: davinci: Do not clear the bank intr enable bit in save_context
Subsystems (2)
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.
--- drivers/gpio/gpio-davinci.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpio/gpio-davinci.c +0 -3
@@ -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
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.
--- drivers/gpio/gpio-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-davinci.c +1 -1
@@ -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
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_WAKEflag 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 <[email protected]>
Yours,
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]>Signed-off-by Dhruva Gole <[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
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]>Signed-off-by Dhruva Gole <[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. :(Reviewed-by Linus Walleij <[email protected]>
Quoted 3 lines
Yours,
Linus Walleij