linux/drivers/tty
Shinya Kuribayashi 33b48e1633 serial: sh-sci: fix possible race cases on SCSCR register accesses
In the previous commit, console write function (serial_console_write)
is changed to disable SCI interrupts while printing console strings.
This introduces possible race cases in the serial startup / shutdown
functions on SMP systems.

This patch fixes the sh-sci in the same way as commit 9ec1882df2
(tty: serial: imx: console write routing is unsafe on SMP, from
Xinyu Chen <xinyu.chen@freescale.com>, 2012-08-27) did.

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 opens /dev/console and writes with sys_write()

The shell goes into the normal UART open() and write() system calls,
while the other two go into the console operations.  The open() call
invokes serial startup function (sci_startup), which will write to
the SCSCR register (to enable or disable SCI interrupts) without any
locking.  This will conflict with the console serial function.

Add spinlock protections in sci_startup() and sci_shutdown() properly.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 18:02:51 -08:00
..
hvc TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
ipwireless TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
serial serial: sh-sci: fix possible race cases on SCSCR register accesses 2012-11-15 18:02:51 -08:00
vt TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
amiserial.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
bfin_jtag_comm.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
cyclades.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
ehv_bytechan.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
isicom.c TTY: isicom, fix tty buffers memory leak 2012-11-15 17:20:58 -08:00
Kconfig tty/serial: put (EXPERIMENTAL) marking back on N_GSM and SERIAL_IFX6X60 2012-09-18 17:17:56 +01:00
Makefile tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
moxa.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
moxa.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
mxser.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
mxser.h Fix common misspellings 2011-03-31 11:26:23 -03:00
n_gsm.c TTY: n_gsm, use kref from tty_port 2012-11-15 17:20:57 -08:00
n_hdlc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
n_r3964.c tty: localise the lock 2012-08-10 12:55:47 -07:00
n_tracerouter.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.h n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tty.c tty: add missing newlines to WARN_RATELIMIT 2012-10-25 11:30:27 -07:00
nozomi.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
pty.c TTY: pty, fix tty buffers leak 2012-11-15 17:18:55 -08:00
rocket_int.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
rocket.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
rocket.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclink_gt.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
synclink.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
synclinkmp.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
sysrq.c mm, oom: ensure sysrq+f always passes valid zonelist 2012-11-15 17:13:48 -08:00
tty_audit.c TTY: audit, stop accessing tty->icount 2012-10-22 16:50:54 -07:00
tty_buffer.c tty: add missing newlines to WARN_RATELIMIT 2012-10-25 11:30:27 -07:00
tty_io.c tty: Add get- ioctls to fetch tty status v3 2012-10-25 12:07:18 -07:00
tty_ioctl.c tty: pty - Move TIOCPKT handling into pty.c 2012-10-25 12:07:18 -07:00
tty_ldisc.c tty: Use raw spin lock to protect TTY ldisc administration 2012-10-24 11:37:02 -07:00
tty_mutex.c tty: tty_mutex.c: Fixed coding style warning (using printk) 2012-10-24 11:34:51 -07:00
tty_port.c TTY: introduce tty_port_destroy 2012-11-15 17:20:58 -08:00