summary refs log tree commit diff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2018-01-05 17:46:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-22 14:20:56 +0100
commit09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 (patch)
tree6ad96fd82010fc817f77015b6dc4d2e0cbf132ec /drivers/tty/tty_io.c
parent44117a1d1732c513875d5a163f10d9adbe866c08 (diff)
downloadlinux-09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775.tar.gz
serial: imx: fix endless loop during suspend
Before we go into suspend mode, we enable the imx uart's interrupt for
the awake bit in the UART Status Register 1. If, for some reason, the
awake bit is already set before we enter suspend mode, we get an
interrupt immediately when we enable interrupts for awake. The uart's
clk_ipg is disabled at this point (unless there's an ongoing transfer).
We end up in the interrupt handler, which usually tries to clear the
awake bit. This doesn't work with the clock disabled. Therefore, we
keep getting interrupts forever, resulting in an endless loop.

Clear the awake bit before setting the awaken bit to signal that we want
an imx interrupt when the awake bit will be set. This ensures that we're
not woken up by events that happened before we started going into
suspend mode.

Change the clock handling so that suspend prepares and enables the clock
and suspend_noirq disables it. Revert these operations in resume_noirq and
resume.

With these preparations in place, we can now modify awake and awaken in
the suspend function when the actual imx interrupt is disabled and the
required clk_ipg is active.

Update the thaw and freeze functions to use the new clock handling since
we share the suspend_noirq function between suspend and hibernate.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
0 files changed, 0 insertions, 0 deletions