Re: ttydev_cdevsw has no d_purge

From: Hans Petter Selasky <hselasky_at_c2i.net>
Date: Fri, 10 Aug 2012 16:39:34 +0200
On Friday 10 August 2012 15:39:16 Ed Schouten wrote:
> Hi Hans,
> 
> 2012/8/9 Hans Petter Selasky <hselasky_at_c2i.net>:
> > 1) Use unrhdr. Suggested by ed.
> 
> Thanks!
> 
> > 2) Implement tty_set_softc() and use that when dereffing ucom unit
> > numbers.
> 
> We're getting there. Now that I think of it, if we want to go in this
> direction, we might as well do the following:
> 
> - Simply call tty_alloc() -- not tty_alloc_mutex(). I'd rather get rid
> of this functionality altogether, if possible.
> - Use the TTY mutex to lock down the state of the ucom driver, e.g.
> #define ucom_lock(sc) tty_lock(sc->sc_mtx).
> 
> Any thoughts?

Hi,

Not possible :-( It will cause a hell inside ucom when multiple tty's are 
present having each their lock sharing the same USB device and possibly also 
an ethernet interface on the same softc. KISS: One lock per softc. No more no 
less.

You're simply pushing a problem into ucom, that ucom has do do refcounting 
which should be generic for all TTY clients.

BTW: I've changed by solutions a little bit to be more generic. I will commit 
it shortly.

There are more problems like kldunload() and how you need to block kldunload() 
from completing when a softc is pending for tsw_free().

--HPS
Received on Fri Aug 10 2012 - 12:39:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:29 UTC