diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-02-03 10:35:05 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-02-03 10:35:05 +0000 |
commit | 6514406b988d9947fa6422072b22a0eb90610fbf (patch) | |
tree | 8a1ca74961b920146dcafdabede3ae4c66c00394 | |
parent | 1bd82eeb1a0e950477df836bf5ec712b7d40b360 (diff) | |
download | FreeBSD-src-6514406b988d9947fa6422072b22a0eb90610fbf.zip FreeBSD-src-6514406b988d9947fa6422072b22a0eb90610fbf.tar.gz |
When entering siocnputc() with (kdb_active), don't acquire (or
release) the sio spin mutex, as use of synchronization primitives in
the debugger can result in substantial problems. With this patch in
place entering the debugger via a serial console is made
substantially more reliable.
MFC after: 1 week
Tested by: kris
Discussed with: bde
-rw-r--r-- | sys/dev/sio/sio.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index ca59986..65b1029 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -2583,16 +2583,20 @@ siocnputc(struct consdev *cd, int c) } s = spltty(); need_unlock = 0; - if (sio_inited == 2 && !mtx_owned(&sio_lock)) { - mtx_lock_spin(&sio_lock); - need_unlock = 1; + if (!kdb_active) { + if (sio_inited == 2 && !mtx_owned(&sio_lock)) { + mtx_lock_spin(&sio_lock); + need_unlock = 1; + } } siocnopen(&sp, iobase, speed); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); - if (need_unlock) - mtx_unlock_spin(&sio_lock); + if (!kdb_active) { + if (need_unlock) + mtx_unlock_spin(&sio_lock); + } splx(s); } |