kernel-ark/drivers/tty
Doug Anderson d208a3bf77 TTY: serial_core: Fix crash if DCD drop during suspend
This crash was showing up 100% of the time on Tegra CPUs when an
agetty was running on the serial port and the console was not running
on the serial port.  The reason the Tegra saw it so reliably is that
the Tegra CPU internally ties DTR to DCD/DSR.  That means when we
dropped DTR during suspend we would get always get an immediate DCD
drop.

The specific order of operations that were running:
* uart_suspend_port() would be called to put the uart in suspend mode
* we'd drop DTR (ops->set_mctrl(uport, 0)).
* the DTR drop would be looped back in the CPU to be a DCD drop.
* the DCD drop would look to the serial driver as a hangup
* the hangup would call uart_shutdown()
* ... suspend / resume happens ...
* uart_resume_port() would be called and run the code in the
  (port->flags & ASYNC_SUSPENDED) block, which would startup the port
  (and enable tx again).
* Since the UART would be available for tx, we'd immediately get
  an interrupt, eventually calling transmit_chars()
* The transmit_chars() function would crash.  The first crash would
  be a dereference of a NULL tty member, but since the port has been
  shutdown that was just a symptom.

I have proposed a patch that would fix the Tegra CPUs here (see
https://lkml.org/lkml/2011/10/11/444 - tty/serial: Prevent drop of DCD
on suspend for Tegra UARTs).  However, even with that fix it is still
possible for systems that have an externally visible DCD line to see a
crash if the DCD drops at just the right time during suspend: thus
this patch is still useful.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19 13:07:19 -07:00
..
hvc hvc_console: display printk messages on console. 2011-10-18 14:17:10 -07:00
ipwireless
serial TTY: serial_core: Fix crash if DCD drop during suspend 2011-10-19 13:07:19 -07:00
vt keyboard: Do not include <linux/irq.> 2011-09-22 16:05:08 -07:00
amiserial.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
bfin_jtag_comm.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
cyclades.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
ehv_bytechan.c drivers/tty: don't use the byte channel handle as a parameter in ehv_bytechan.c 2011-09-26 16:38:43 -07:00
isicom.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
Kconfig tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
Makefile tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
moxa.c drivers/tty: use printk_ratelimited() instead of printk_ratelimit() 2011-07-01 15:35:45 -07:00
moxa.h
mxser.c TTY: mxser+cyclades remove wait_until_sent debug code 2011-08-23 10:34:07 -07:00
mxser.h
n_gsm.c tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output 2011-09-26 16:39:23 -07:00
n_hdlc.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
n_r3964.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-07-25 23:09:27 -07:00
nozomi.c
pty.c TTY: pty, release tty in all ptmx_open fail paths 2011-10-18 16:39:44 -07:00
rocket_int.h
rocket.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
rocket.h
synclink_gt.c
synclink.c drivers/tty/synclink: remove double comment 2011-08-23 10:32:56 -07:00
synclinkmp.c TTY: snyclinkmp: forever loop in tx_load_dma_buffer() 2011-09-29 13:23:33 -07:00
sysrq.c
tty_audit.c
tty_buffer.c tty_buffer: get rid of 'seen_tail' logic in flush_to_ldisc 2011-06-08 07:46:30 -07:00
tty_io.c Revert "TTY: call tty_driver_lookup_tty unconditionally" 2011-10-19 08:33:21 -07:00
tty_ioctl.c tty: Support compat_ioctl get/set termios_locked 2011-10-18 14:17:11 -07:00
tty_ldisc.c TTY: remove tty_locked 2011-08-23 10:34:07 -07:00
tty_mutex.c TTY: remove tty_locked 2011-08-23 10:34:07 -07:00
tty_port.c TTY: use tty_wait_until_sent_from_close in tty_port_close_start 2011-08-25 09:00:41 -07:00