On Thu, 1 Jan 2004, David Brownell wrote:
How about a lock tree?
I was playing around with a simpler idea... Have the core notify khubd
whenever it's about to remove all the children of a hub. Khubd guarantees
that after returning from the notification it will not access that hub's children[] array. In principle this notification could simply take the form of a call to the hub driver's release() routine.
That sounds like adding a special case -- which in my book doesn't really add up to "simpler"!
In other words, at each interior node of the tree have usb_disconnect() unbind the hub driver _before_ recursively disconnecting the child nodes and the hub node itself.
Any reason why this wouldn't work? Or wouldn't be sufficiently general?
Seems to me like when you work it out, it'll end up as a lock tree.
Because when one of those children is a hub itself, you'll be applying the same algorithm ... and you'll still need to hold the lock for whatever manages each hub's port, so that you can scrub out those records safely.
- Dave
------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel