1
0
Fork 0

MLK-19326 gpio: mxc: fix possible race condition for PAD wakeup

This patch adds line 0 PAD wakeup support, it is missed previously,
also protect the PAD wakeup interrupt handle with spin lock to
avoid possible race condition of GPIO interrupt arriving during
PAD wakeup interrupt handling.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit db842471137ef2758de6192f8f400e4b56da5d01)
pull/10/head
Anson Huang 2018-08-24 14:17:58 +08:00 committed by Jason Liu
parent c485aab546
commit c4c3924c10
1 changed files with 2 additions and 3 deletions

View File

@ -831,12 +831,11 @@ static int __maybe_unused mxc_gpio_noirq_resume(struct device *dev)
writel(port->suspend_saved_reg[3], port->base + GPIO_GDIR);
writel(port->suspend_saved_reg[4], port->base + GPIO_EDGE_SEL);
writel(port->suspend_saved_reg[5], port->base + GPIO_DR);
spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
#ifdef CONFIG_GPIO_MXC_PAD_WAKEUP
if (wakeup_line > 0)
if (wakeup_line >= 0)
mxc_gpio_handle_pad_wakeup(port, wakeup_line);
#endif
spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
clk_disable_unprepare(port->clk);
return 0;