提交 f5ef2abc 编写于 作者: L Linus Torvalds

driver core: do not wait unnecessarily in driver_unregister()

Ingo reported that built-in drivers suffered bootup hangs with certain
driver unregistry sequences, due to sysfs breakage.

Do the minimal fix for v2.6.21: only wait if the driver is a module.
Acked-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 755948cf
......@@ -183,7 +183,14 @@ int driver_register(struct device_driver * drv)
void driver_unregister(struct device_driver * drv)
{
bus_remove_driver(drv);
wait_for_completion(&drv->unloaded);
/*
* If the driver is a module, we are probably in
* the module unload path, and we want to wait
* for everything to unload before we can actually
* finish the unload.
*/
if (drv->owner)
wait_for_completion(&drv->unloaded);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册