MPSAFE TTY - Fix deadlock in reporting of probe errors.
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Aug 2010 17:50:47 +0000 (10:50 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Aug 2010 17:52:29 +0000 (10:52 -0700)
commit438acbcc599b3db8b97949a152027f27f8028066
tree76d5f0541a4506a39e834324b017dced162348c1
parent5fddbda2ad4306c54ebfde04cf94f0a83f54ad56
 MPSAFE TTY - Fix deadlock in reporting of probe errors.

* When sio can't drain it reports the fact, but it was doing it while
  still holding com_lock.  Rearranging the lock fixes the problem.

* Clean up some unnecessary tty_tokens in critical code paths and rearrange
  code to not hold com_lock across tty_token acquisition calls.

* Release the com_lock around breakpoint() (<enter>~^B sequence) to
  avoid a deadlock.

* Detect and ignore a reentrant kprintf() to try to avoid a deadlock.
  The detection flag is also reset by a panic.
sys/dev/serial/sio/sio.c
sys/kern/subr_prf.c
sys/sys/globaldata.h