Subject: TTY locking
To: None <tech-smp@netbsd.org>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-smp
Date: 02/17/2003 08:57:53
The TTY subsystem locking strategy has some issues left. One of them
is that tputchar() can be called with or without the tty spin lock
held: i.e.

	[tu]printf()->kprintf()->tputchar()
vs.

	ttyinfo()->ttyprintf()->kprintf()->tputchar()

I put a simple_lock_try() in tputchar() to circumvent to problem, but
that's not correct, and LOCKDEBUG catches it.

Looking at the places from where ttyinfo() is called it seems Ok to just
release the tty spin lock while the load and session stuff is printed,
and then re-acquire it again before returning.

Comments?

-pk