MLK-17218 tty: serial: imx: add lock for register save/restore
authorFugang Duan <fugang.duan@nxp.com>
Thu, 14 Dec 2017 09:52:50 +0000 (17:52 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:51:34 +0000 (14:51 -0500)
commitca099b409c60dcadabc2f6334f05388bf23e15a4
tree223ee4c68c50e4020485c56d307c5e021eb7f829
parentb578c782d09c25e86d51b1e753d2ebf5d75f3249
MLK-17218 tty: serial: imx: add lock for register save/restore

The driver save/restore registers in system suspend/resume noirq stage
to support no_console_suspend in power lost case.

In noirq stage with no_console_suspend, .imx_console_write() _maybe_
called to print out log_buf message in .printk() or console_unlock()
called by other drivers.
It should add port.lock to protect the registers save/restore in noirq
stage since .imx_console_write() also access them.

Reported-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
drivers/tty/serial/imx.c