Re: ttydev_cdevsw has no d_purge

From: Hans Petter Selasky <hselasky_at_c2i.net>
Date: Wed, 8 Aug 2012 18:27:53 +0200
On Wednesday 08 August 2012 13:31:33 Konstantin Belousov wrote:
> On Tue, Aug 07, 2012 at 05:03:13PM +0200, Hans Petter Selasky wrote:
> > On Sunday 05 August 2012 10:33:13 Hans Petter Selasky wrote:
> > > On Friday 03 August 2012 10:32:47 Ed Schouten wrote:
> > > > 2012/8/1 Hans Petter Selasky <hselasky_at_c2i.net>:
> > > > > I think the problem is like this, that in order to re-use the unit
> > > > > numbers for USB serial tty devices, the USB stack needs to wait
> > > > > until a TTY is actually freed, right? Else you will have a panic
> > > > > on creating devfs entries having the same name.
> > > > 
> > > > Indeed. So the USB code could simply pick a different unit number.
> > > 
> > > Hi Ed,
> > > 
> > > USB could use a different Unit number. Some questions:
> > > 
> > > When can the previous unit number be re-used? Is there a callback for
> > > this?
> > > 
> > > When can the USB serial code assume that it will not be called again
> > > and that all callbacks are drained?
> > 
> > Hi,
> > 
> > Can you try the attached patch and report back?
> 
> I applied the patch and reloaded ucom and uplcom. So far there were no
> power glitches so UPS did not dropped off the bus yet.
> 
> I have a question regarding the changed fragment of code. Why don't you use
> unr(9) KPI to manage unit numbers ?

Probably I could, but right now the unr interface doesn't support pending unit 
free which I need for other reasons, see below.

Ed: I would really like to see a custom argument for the tsw_free(), because 
it only needs to know the unit number, and the xsc for UCOM is freed when this 
is called and cannot be referred. Is it possible to have a separate "void *" 
for the tsw_free() function? Is this something which you can implement?

--HPS
Received on Wed Aug 08 2012 - 14:27:32 UTC

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