From: Alan Stern This patch (as660) changes the registration and unregistration routines for blocking notifier chains. During system startup, when task switching is illegal, the routines will avoid calling down_write(). Signed-off-by: Alan Stern Signed-off-by: Andrew Morton --- kernel/sys.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -puN kernel/sys.c~notifier-chain-update-api-changes-avoid-calling-down_read-and-down_write-during-startup kernel/sys.c --- devel/kernel/sys.c~notifier-chain-update-api-changes-avoid-calling-down_read-and-down_write-during-startup 2006-02-23 17:43:02.000000000 -0800 +++ devel-akpm/kernel/sys.c 2006-02-23 17:43:02.000000000 -0800 @@ -249,6 +249,14 @@ int blocking_notifier_chain_register(str { int ret; + /* + * This code gets used during boot-up, when task switching is + * not yet working and interrupts must remain disabled. At + * such times we must not call down_write(). + */ + if (unlikely(system_state == SYSTEM_BOOTING)) + return notifier_chain_register(&nh->head, n); + down_write(&nh->rwsem); ret = notifier_chain_register(&nh->head, n); up_write(&nh->rwsem); @@ -272,6 +280,14 @@ int blocking_notifier_chain_unregister(s { int ret; + /* + * This code gets used during boot-up, when task switching is + * not yet working and interrupts must remain disabled. At + * such times we must not call down_write(). + */ + if (unlikely(system_state == SYSTEM_BOOTING)) + return notifier_chain_unregister(&nh->head, n); + down_write(&nh->rwsem); ret = notifier_chain_unregister(&nh->head, n); up_write(&nh->rwsem); _