diff options
author | Fugang Duan <fugang.duan@nxp.com> | 2017-12-01 14:27:39 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 5f51a77b4542e819ead83563a6f6eb0a9f480a73 (patch) | |
tree | 40aac29428d6a72655875ce4ae05a793367b1ca6 /drivers/tty/serial | |
parent | 7005580e0ae4ebbd7651d47ac070cd5361621e25 (diff) |
MLK-17133-01 tty: serial: lpuart: only enable wakeup interrupt when wakeup enabled
Current driver suppose system disable irq when wakeup is not enabled
like below follow, so it always enable the wakeup interrupt in .suspend_noirq().
dpm_suspend_noirq()
device_wakeup_arm_wake_irqs()
if (device_may_wakeup(wirq->dev))
enable_irq_wake(wirq->irq);
irq_set_irq_wake(irq, 1);
suspend_device_irqs();
if (irqd_is_wakeup_set(&desc->irq_data))
__disable_irq(desc);
device_suspend_noirq(dev);
...
But in i.MX8x chips, the gic-v3 chip->irq_disable() is not implemented,
so the device's irq line is not masked in noirq stage. Then lpuart interrupt
can wake up system even if it is not enabled as wakeup source.
To avoid the issue, only enable wakeup interrupt when it is enabled as
wakeup source.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/fsl_lpuart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 56dc5bdfc2b0..9c10e52e454c 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2361,7 +2361,7 @@ static int lpuart_suspend_noirq(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct lpuart_port *sport = platform_get_drvdata(pdev); - serial_lpuart_enable_wakeup(sport, true); + serial_lpuart_enable_wakeup(sport, !!sport->port.irq_wake); clk_disable(sport->ipg_clk); pinctrl_pm_select_sleep_state(dev); |