linux-stable/drivers/tty
Darren Hart fe89def79c pch_uart: Add eg20t_port lock field, avoid recursive spinlocks
pch_uart_interrupt() takes priv->port.lock which leads to two recursive
spinlock calls if low_latency==1 or CONFIG_PREEMPT_RT_FULL=y (one
otherwise):

pch_uart_interrupt
  spin_lock_irqsave(priv->port.lock, flags)
  case PCH_UART_IID_RDR_TO (data ready)
  handle_rx_to
    push_rx
      tty_port_tty_get
        spin_lock_irqsave(&port->lock, flags) <--- already hold this lock
        ...
      tty_flip_buffer_push
        ...
        flush_to_ldisc
          spin_lock_irqsave(&tty->buf.lock)
            spin_lock_irqsave(&tty->buf.lock)
            disc->ops->receive_buf(tty, char_buf)
              n_tty_receive_buf
                tty->ops->flush_chars()
                uart_flush_chars
                  uart_start
                    spin_lock_irqsave(&port->lock) <--- already hold this lock

Avoid this by using a dedicated lock to protect the eg20t_port structure
and IO access to its membase. This is more consistent with the 8250
driver.  Ensure priv->lock is always take prior to priv->port.lock when
taken at the same time.

V2: Remove inadvertent whitespace change.
V3: Account for oops_in_progress for the private lock in
    pch_console_write().

Note: Like the 8250 driver, if a printk is introduced anywhere inside
      the pch_console_write() critical section, the kernel will hang
      on a recursive spinlock on the private lock. The oops case is
      handled by using a trylock in the oops_in_progress case.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Alexander Stein <alexander.stein@systec-electronic.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:50:46 -07:00
..
hvc tty: hvc_xen: NULL dereference on allocation failure 2012-05-15 08:48:45 -07:00
ipwireless TTY: ipwireless, use tty from tty_port 2012-04-09 11:30:39 -07:00
serial pch_uart: Add eg20t_port lock field, avoid recursive spinlocks 2012-06-20 16:50:46 -07:00
vt vt: fix race in vt_waitactive() 2012-06-14 17:10:08 -07:00
amiserial.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
bfin_jtag_comm.c TTY: bfin_jtag_comm, use tty from tty_port 2012-04-09 11:28:18 -07:00
cyclades.c TTY: cyclades, add local pointer for card 2012-06-12 15:50:23 -07:00
ehv_bytechan.c TTY: remove re-assignments to tty_driver members 2012-03-08 11:37:58 -08:00
isicom.c Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
Kconfig tty/powerpc: early udbg consoles can't be modules 2012-02-24 16:11:50 -08:00
Makefile
moxa.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
moxa.h
mxser.c tty: mxser: local variables should not be exposed globally 2012-05-04 16:42:14 -07:00
mxser.h
n_gsm.c TTY: remove re-assignments to tty_driver members 2012-03-08 11:37:58 -08:00
n_hdlc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
n_r3964.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c TTY: n_tty, do not dereference user buffer 2012-04-29 22:13:54 -04:00
nozomi.c TTY: remove re-assignments to tty_driver members 2012-03-08 11:37:58 -08:00
pty.c PTY: add tty_port 2012-06-13 17:30:15 -07:00
rocket.c TTY: remove unneeded tty->index checks 2012-03-08 11:42:21 -08:00
rocket.h
rocket_int.h
synclink.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
synclink_gt.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
synclinkmp.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
sysrq.c sysrq: use SEND_SIG_FORCED instead of force_sig() 2012-04-05 15:25:50 -07:00
tty_audit.c
tty_buffer.c tty: hold lock across tty buffer finding and buffer filling 2012-04-09 12:12:45 -07:00
tty_io.c TTY: add ports array to tty_driver 2012-06-13 17:30:54 -07:00
tty_ioctl.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
tty_ldisc.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
tty_mutex.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
tty_port.c TTY: add tty_port_register_device helper 2012-06-13 17:30:54 -07:00