All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: mxc: Fix disabled interrupt wake-up support
@ 2021-06-17 13:54 Loic Poulain
  2021-06-17 14:36 ` Linus Walleij
  2021-06-21 18:44 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2021-06-17 13:54 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski; +Cc: linux-gpio, michal.koziel, Loic Poulain

A disabled/masked interrupt marked as wakeup source must be re-enable
and unmasked in order to be able to wake-up the host. That can be done
by flaging the irqchip with IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND.

Note: It 'sometimes' works without that change, but only thanks to the
lazy generic interrupt disabling (keeping interrupt unmasked).

Reported-by: Michal Koziel <michal.koziel@emlogic.no>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/gpio/gpio-mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 157106e..b9fdf05 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -334,7 +334,7 @@ static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
 	ct->chip.irq_unmask = irq_gc_mask_set_bit;
 	ct->chip.irq_set_type = gpio_set_irq_type;
 	ct->chip.irq_set_wake = gpio_set_wake_irq;
-	ct->chip.flags = IRQCHIP_MASK_ON_SUSPEND;
+	ct->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND;
 	ct->regs.ack = GPIO_ISR;
 	ct->regs.mask = GPIO_IMR;
 
-- 
2.7.4


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

* Re: [PATCH] gpio: mxc: Fix disabled interrupt wake-up support
  2021-06-17 13:54 [PATCH] gpio: mxc: Fix disabled interrupt wake-up support Loic Poulain
@ 2021-06-17 14:36 ` Linus Walleij
  2021-06-21 18:44 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2021-06-17 14:36 UTC (permalink / raw)
  To: Loic Poulain; +Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM, michal.koziel

On Thu, Jun 17, 2021 at 3:44 PM Loic Poulain <loic.poulain@linaro.org> wrote:

> A disabled/masked interrupt marked as wakeup source must be re-enable
> and unmasked in order to be able to wake-up the host. That can be done
> by flaging the irqchip with IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND.
>
> Note: It 'sometimes' works without that change, but only thanks to the
> lazy generic interrupt disabling (keeping interrupt unmasked).
>
> Reported-by: Michal Koziel <michal.koziel@emlogic.no>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Looks correct:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: mxc: Fix disabled interrupt wake-up support
  2021-06-17 13:54 [PATCH] gpio: mxc: Fix disabled interrupt wake-up support Loic Poulain
  2021-06-17 14:36 ` Linus Walleij
@ 2021-06-21 18:44 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2021-06-21 18:44 UTC (permalink / raw)
  To: Loic Poulain; +Cc: Linus Walleij, linux-gpio, michal.koziel

On Thu, Jun 17, 2021 at 3:44 PM Loic Poulain <loic.poulain@linaro.org> wrote:
>
> A disabled/masked interrupt marked as wakeup source must be re-enable
> and unmasked in order to be able to wake-up the host. That can be done
> by flaging the irqchip with IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND.
>
> Note: It 'sometimes' works without that change, but only thanks to the
> lazy generic interrupt disabling (keeping interrupt unmasked).
>
> Reported-by: Michal Koziel <michal.koziel@emlogic.no>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>

Applied for fixes, thanks!

Bartosz

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

end of thread, other threads:[~2021-06-21 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 13:54 [PATCH] gpio: mxc: Fix disabled interrupt wake-up support Loic Poulain
2021-06-17 14:36 ` Linus Walleij
2021-06-21 18:44 ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.