driver core changes are going to take some time so how about this patch to fix it up
for the moment in (what I think is) a satisfactory manner so we can have multi.interface
devices working again.
Executive summary:
loop until dependant device list is empty instead of for loop over changing list.
/Brian
Change driver_detach so it loops until the dependant device list is empty instead of the dangerous (non safe) for loop which cannot handle the next list element being disconnected by the driver itself calling device_release_driver with the next device.
diff -u linux-2.6.11-bk7.orig/drivers/base/bus.c linux-2.6.11-bk7/drivers/base/bus.c --- linux-2.6.11-bk7.orig/drivers/base/bus.c 2005-03-14 11:59:29.000000000 +0100 +++ linux-2.6.11-bk7/drivers/base/bus.c 2005-03-17 10:18:31.000000000 +0100 @@ -405,9 +405,12 @@ static void driver_detach(struct device_driver * drv) { - struct list_head * entry, * next; - list_for_each_safe(entry, next, &drv->devices) { - struct device * dev = container_of(entry, struct device, driver_list); + struct list_head * entry; + struct device * dev; + + while (!list_empty(&drv->devices)) { + entry = drv->devices.next; + dev = container_of(entry, struct device, driver_list); device_release_driver(dev); } }