linux_dsm_epyc7002/drivers/tty
Rabin Vincent 2fc46915ec vt: fix race in vt_waitactive()
pm_restore_console() is called from the suspend/resume path, and this
calls vt_move_to_console(), which calls vt_waitactive().

There's a race in this path which causes the process which requests the
suspend to sleep indefinitely waiting for an event which already
happened:

P1                                      P2
 vt_move_to_console()
  set_console()
    schedule_console_callback()
  vt_waitactive()
    check n == fg_console +1
                                       console_callback()
                                         switch_screen()
                                         vt_event_post() // no waiters

    vt_event_wait() // forever

Fix the race by ensuring we're registered for the event before we check
if it's already completed.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 17:10:08 -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 serial: sh-sci: Make probe fail for ports that exceed the maximum count 2012-06-12 15:56:54 -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 tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
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_int.h
rocket.c TTY: remove unneeded tty->index checks 2012-03-08 11:42:21 -08:00
rocket.h
synclink_gt.c tty: Revert the tty locking series, it needs more work 2012-06-02 15:21:43 -07:00
synclink.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