On Sat, Dec 11, 2010 at 2:11 PM, MERIGHI Marcus <mcmer-open...@tor.at> wrote: > the latest modification of src/sys/dev/hotplug.c (1) changes hotplug(4) > behaviour concerning devices that are attached before the hotplug device > is opened (by hotplugd(8), for example). such devices are ignored in > hotplug.c by hotplug_put_event because of !evqueue (line 92 in -current). > > since the commit messages says nothing about behaviour change I suggest > the following patch to restore the old behaviour: > > > Index: hotplug.c > =================================================================== > RCS file: /cvs/src/sys/dev/hotplug.c,v > retrieving revision 1.10 > diff -u -r1.10 hotplug.c > --- hotplug.c 2 Dec 2010 04:12:35 -0000 1.10 > +++ hotplug.c 11 Dec 2010 19:00:09 -0000 > @@ -90,7 +90,8 @@ > return (1); > } > if (!evqueue) > - return (1); > + evqueue = malloc(sizeof(*he) * HOTPLUG_MAXEVENTS, M_DEVBUF, \ > + M_WAITOK); > > evqueue[evqueue_head] = *he; > evqueue_head = EVQUEUE_NEXT(evqueue_head);
You can't do this, because sleeping in this function would be bad. You shouldn't need to handle hotplug events before the daemon is running, just have the normal startup scripts deal with it. Not receiving old events actually prevents problems where the device is both attached and detached before hotplugd is running. Sorry, I missed your previous email.