On Tue, Dec 10, 2002, Oliver Neukum <[EMAIL PROTECTED]> wrote:
> > > > Any fixes for this would be gladly accepted.
> > >
> > > Well, this isn't easy to do well without deep surgery.
> > > Here's a patch that fixes the problem but isn't pretty.
> > > It's just for review and please note, my kernel still
> > > doesn't compile.
> > > Perhaps we should allocate the buffers before we go down
> > > the tree ? IMHO using BKL is more or less inevitable
> > > in this case in any fix.
> > > People from IBM will soon come down on me for
> > > abuse of BKL ;-)
> >
> > Heh.
> >
> > Why can't we just use reference counting?
> 
> At least the initial increase has to be atomic for the
> whole tree. If you don't meet that requirement
> there's a window between determining a hub's children
> and incrementing their count. As you have to have
> mutual exclusion to khubd this means BKL.
> 
> So you'd have major surgery. You'd have to walk
> the tree three times. The first time atomically
> incrementing the counts, then building the output
> and then decrementing the counts again, bottomup
> or again atomically. And you'd have to make sure that
> no devices are added during that time.
> 
> Doesn't sound easy to me.

Ick. I agree.

I have one other suggestion, ditch /proc/bus/usb/devices :)

JE



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to