Parallel hotplugging event issues

Sjoerd Simons sjoerd at
Mon Mar 17 03:33:15 PDT 2008

On Mon, Mar 17, 2008 at 12:25:23AM +0100, Danny Kukawka wrote:
> On Sonntag, 16. März 2008, Sjoerd Simons wrote:
> > Now when a device is removed, all it's child devices get removed too.. So
> > the event for A removes device C, causing the handlers of C to get confused
> > (as C is gone).. What this shows is that purely using the sysfs path
> > prefixes for dependency information isn't enough, the relationship of
> > devices as hal has detected them needs to be taken into account too.
> The problem is IMO now the code to remove e.g. spawned devices which are 
> childs of real devices. See attached patch which may helps if a device get 
> removed by remove childs only if they have no sysfs path. Other devices with 
> a set sysfs path should get removed correctly via normal handling. 
> I didn't test the patch, I do this tomorrow.

This will work around the issue i'm seeing, but still seems to be the wrong
solution to me. As it means parent devices can still get removed before their
children are removed. And it's not unlikely that some handlers need these
parent devices.

A proper fix for this part of the issue would be to queue a real removal event
for all the child devices (assuming that haven't got one just yet) and then
only continue with the removal of the parent if all these events are done.

This won't fix the reverse issue though. With the current parallel hotplugging
stuff a block device could be added before it's host controller is, which
breaks some valid assumptions. I'm not sure if those are actually used.

As you will see, I told them, in no uncertain terms, to see Figure one.
		-- Dave "First Strike" Pare

More information about the hal mailing list