Another of the recent USB issues seems to be caused by khubd
exiting ... it seems to be getting a signal, and thinking that
is a fine reason to exit. Net result: no, you can't plug in
any new devices, sorry.
Here's a quick hack that may help. It's not all that clean,
the replacement for the "kill thread on shutdown" logic is
smp-wrong and this makes khubd show up on load statistics,
but at least if you're seeing this failure you'll be able to
get past it.
- Dave
--- ./drivers-dist/usb/core/hub.c Thu Oct 17 01:29:50 2002
+++ ./drivers/usb/core/hub.c Wed Oct 16 13:35:48 2002
@@ -45,4 +45,5 @@
static int khubd_pid = 0; /* PID of khubd */
static DECLARE_COMPLETION(khubd_exited);
+static int khubd_exiting = 0;
#ifdef DEBUG
@@ -1057,11 +1058,10 @@
strcpy(current->comm, "khubd");
- /* Send me a signal to get me die (for debugging) */
do {
usb_hub_events();
- wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
+ wait_event(khubd_wait, !list_empty(&hub_event_list));
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
- } while (!signal_pending(current));
+ } while (!khubd_exiting);
dbg("usb_hub_thread exiting");
@@ -1116,10 +1116,9 @@
void usb_hub_cleanup(void)
{
- int ret;
-
- /* Kill the thread */
- ret = kill_proc(khubd_pid, SIGTERM, 1);
-
+ dbg ("wait for khubd exit");
+ khubd_exiting = 1;
+ wake_up(&khubd_wait);
wait_for_completion(&khubd_exited);
+ khubd_exiting = 0;
/*