kernel - Fix syscons deadlock during panic
commit539fbd92996b1ec2a93228c56a318b53fa514df1
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Jun 2015 21:05:40 +0000 (26 14:05 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Jun 2015 21:49:30 +0000 (26 14:49 -0700)
tree9e77fff761e97e2510803c534b730065b6f3bc4d
parent546cb17e48cea226fbf6691c8a70373811b245e2
kernel - Fix syscons deadlock during panic

* The system console can deadlock during a panic if a cpu is stopped
  while holding syscons_mtx.

* The new asynchronous update thread makes this problem more likely to occur.

* Fix the problem by recoding syscons_lock() to detect the panic or shutdown
  condition and loop for up to 0.5 seconds trying to get the syscons_mtx.
  If it is unable to acquire it, it reinitializes the mutex.

* We still have issues with VT switching away from X.
sys/dev/misc/syscons/sckmsrndr.c
sys/dev/misc/syscons/scterm-dumb.c
sys/dev/misc/syscons/scterm-sc.c
sys/dev/misc/syscons/scterm.c
sys/dev/misc/syscons/sctermvar.h
sys/dev/misc/syscons/scvgarndr.c
sys/dev/misc/syscons/syscons.c