Hi all, currently we have the problem that the driver core might send out hotplug events even though the initialisation of a device has not been finished; worse, we might get an "add" followed by an "remove" event if the device fails to initialise properly, with the corresponding device never appearing in sysfs properly. This is due to the design of the driver core: a call to device_register will trigger a hotplug event, but any sysfs attributes which are added _after_ device_register() will in fact created after the hotplug event has been triggered. For the unbelievers, look at drivers/scsi/scsi_sysfs.c:scsi_sysfs_add_sdev(). This leads to all sorts of nasty race conditions and waiting loops in the hotplug agents. To solve this I've wrapped up a patch for delaying / suspending hotplug events until they are explicitely enabled again. As an example of how it should be used I've patched drivers/scsi/scsi_sysfs.c:scsi_sysfs_add_sdev(), so that the device "add" event will now be triggered only _after_ the device has been initialised properly, including all sysfs attributes. Is this approach feasible or am I completely off kilter here? And if the latter, how should it be solved properly? (Note: this is a proof of concept. No devices have been harmed in creating this patch. I just wanted to get a general opinion before venturing any further.) Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de