TTY locking

Paul Kranenburg <[email protected]> Mon, 17 Feb 2003 08:57:53 +0100 (MET)
Newsgroups gmane.os.netbsd.devel.smp
Message-ID <[email protected]>
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