tty: serial: imx: add lock for registers save/restore
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 5 Sep 2018 01:24:26 +0000 (09:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Sep 2018 14:07:24 +0000 (16:07 +0200)
commit07b5e16e9830878291bc83df70e87cdb0833517c
tree58ad1807ac2c3ff5dbfbdb006e8ab9f5995decfc
parentc974991d2620419fe21508fc4529014369d16df7
tty: serial: imx: add lock for registers save/restore

In noirq suspend/resume stage with no_console_suspend enabled,
imx_uart_console_write() may be called to print out log_buf
message by printk(), so there will be race condition between
imx_uart_console_write() and imx_uart_save/restore_context(),
need to add lock to protect the registers save/restore operations.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c