> From: johan verrept <[EMAIL PROTECTED]>
> To: linux-usb-devel <[EMAIL PROTECTED]>
> CC: Johannes Erdfelt <[EMAIL PROTECTED]>
> Date: Mon, 16 Apr 2001 18:27:46 +0200

>       When a hub interrupt urb completes hub_irq() checks whether
> the waitqueue is active (if the hub thread is sleeping). If it
> isn't sleeping, the hub never gets scheduled for event processing.
>       It causes a problem with the uml hcd. [...]

I also disagree with this. Almost ALL instances of the following
code in kernel are racy:

        if (waitqueue_active(&wq))
                wake_up(&wq);

The right approach is to call wake_up regardless, as a rule of thumb.

> The only reason I see for this is that the list spinlock is held
> during the entire usb_hub_events()
> call and that would cause hub_irq() to block.

The statement above is not true. This is the 2.4.3 code that I have:

static void usb_hub_events(void)
{
        .....................
        while (1) {
                spin_lock_irqsave(&hub_event_lock, flags);
                if (list_empty(&hub_event_list))
                        break;
                tmp = hub_event_list.next;
                hub = list_entry(tmp, struct usb_hub, event_list);
                list_del(tmp);
                INIT_LIST_HEAD(tmp);
                down(&khubd_sem);       // <=== replaced in my last patch
                spin_unlock_irqrestore(&hub_event_lock, flags);
                ....................
        }
}

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

Reply via email to