Thread (12 messages) 12 messages, 4 authors, 2012-08-28
STALE5028d REVIEWED: 1 (0M)

[PATCH 1/2] tty: serial: imx: console write routing is unsafe on SMP

From: Shawn Guo <hidden>
Date: 2012-08-27 22:33:05
Also in: linux-serial

On Mon, Aug 27, 2012 at 09:36:51AM +0200, Dirk Behme wrote:
From: Xinyu Chen <redacted>

The console feature's write routing is unsafe on SMP with
the startup/shutdown call.

There could be several consumers of the console
* the kernel printk
* the init process using /dev/kmsg to call printk to show log
* shell, which open /dev/console and write with sys_write()

The shell goes into the normal uart open/write routing,
but the other two go into the console operations.
The open routing calls imx serial startup, which will write USR1/2
register without any lock and critical with imx_console_write call.

Add a spin_lock for startup/shutdown/console_write routing.

This patch is a port from Freescale's Android kernel.

Signed-off-by: Xinyu Chen <redacted>
Tested-by: Dirk Behme <redacted>
CC: Shawn Guo <redacted>
CC: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help