Hi,

in hub.c sleep_on is used. Thus there's a window during which an event that
should be processed could be queued instead. The included patch should fix it.

        Regards
                Oliver
--- hub.c.alt   Fri Feb  1 16:41:16 2002
+++ hub.c       Fri Feb  1 16:49:17 2002
@@ -878,6 +878,9 @@
 
 static int usb_hub_thread(void *__hub)
 {
+       DECLARE_WAITQUEUE(wait, current);
+       int pending = 0;
+       long flags;
        lock_kernel();
 
        /*
@@ -891,10 +894,18 @@
        strcpy(current->comm, "khubd");
 
        /* Send me a signal to get me die (for debugging) */
+       add_wait_queue(&khubd_wait, &wait);
        do {
                usb_hub_events();
-               interruptible_sleep_on(&khubd_wait);
+               set_current_state(TASK_INTERRUPTIBLE);
+               spin_lock_irqsave(&hub_event_lock, flags);
+               pending = !list_empty(&hub_event_list);
+               spin_unlock_irqrestore(&hub_event_lock, flags);
+               if (!pending)
+                       schedule();
        } while (!signal_pending(current));
+       remove_wait_queue(&khubd_wait, &wait);
+       set_current_state(TASK_RUNNING);
 
        dbg("usb_hub_thread exiting");
 
 

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to