]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: stm32: fix wake-up flag handling
authorErwan Le Ray <erwan.leray@foss.st.com>
Thu, 4 Mar 2021 16:23:01 +0000 (17:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:36 +0000 (10:49 +0200)
commit35b2040b1119f7cd957f9d74ae491ac4d12f68e9
treee9e35b6108433379c3743e087ca50bd160e6541f
parent4b1b4242335932208a6463077cc2fbab308c13ac
serial: stm32: fix wake-up flag handling

[ Upstream commit 12761869f0efa524348e2ae31827fd52eebf3f0d ]

This patch fixes several issue with wake-up handling:
- the WUF irq is handled several times at wake-up
- the USART is disabled / enabled at suspend to set wake-up flag.
It can cause glitches during RX.

This patch fix those issues:
- clear wake-up flag and disable wake-up irq in WUF irq handling
- enable wake-up from low power on start bit detection at port
configuration
- Unmask the wake-up flag irq at suspend and mask it at resume

In addition, pm_wakeup_event handling is moved from receice_chars to WUF
irq handling.

Fixes: 270e5a74fe4c ("serial: stm32: add wakeup mechanism")
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20210304162308.8984-7-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/stm32-usart.c