linux/drivers/tty
Shinya Kuribayashi 40f70c03e3 serial: sh-sci: add locking to console write function to avoid SMP lockup
Symptom:

When entering the suspend with Android logcat running, printk() call
gets stuck and never returns.  The issue can be observed at printk()s
on nonboot CPUs when going to offline with their interrupts disabled,
and never seen at boot CPU (core0 in our case).

Details:

serial_console_write() lacks of appropriate spinlock handling.

In SMP systems, as long as sci_transmit_chars() is being processed
at one CPU core, serial_console_write() can stuck at the other CPU
core(s), when it tries to access to the same serial port _without_
a proper locking.  serial_console_write() waits for the transmit FIFO
getting empty, while sci_transmit_chars() writes data to the FIFO.

In general, peripheral interrupts are routed to boot CPU (core0) by
Linux ARM standard affinity settings.  SCI(F) interrupts are handled
by core0, so sci_transmit_chars() is processed on core0 as well.

When logcat is running, it writes enormous log data to the kernel at
every moment, forever.  So core0 can repeatedly continue to process
sci_transmit_chars() in its interrupt handler, which eventually makes
the other CPU core(s) stuck at serial_console_write().

Looking at serial/8250.c, this is a known console write lockup issue
with SMP kernels.  Fix the sh-sci driver in the same way 8250.c does.

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: add locking to console write function to avoid SMP lockup 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
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
rocket.c TTY: call tty_port_destroy in the rest of drivers 2012-11-15 17:20:58 -08:00
rocket.h
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