The list macro's now do poisoning to detect attempted traversal of
dead elements, but the UHCI wants to initialize them as empty.
The problem with marking them as empty, is if there ever is a locking
problem, then the code traversing the list can hit the initialized 
element and end up in a endless circle...

Therefore poisoning is safer and faster.

diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c       Mon Feb 23 16:17:40 2004
+++ b/drivers/usb/host/uhci-hcd.c       Mon Feb 23 16:17:40 2004
@@ -711,10 +711,6 @@
        if (!urbp)
                return;
 
-       if (!list_empty(&urbp->urb_list))
-               dev_warn(uhci_dev(uhci), "urb %p still on uhci->urb_list "
-                               "or uhci->remove_list!\n", urb);
-
        spin_lock_irqsave(&uhci->td_remove_list_lock, flags);
 
        /* Check to see if the remove list is empty. Set the IOC bit */
@@ -1495,7 +1491,7 @@
                /* Submit failed, so delete it from the urb_list */
                struct urb_priv *urbp = urb->hcpriv;
 
-               list_del_init(&urbp->urb_list);
+               list_del(&urbp->urb_list);
                uhci_destroy_urb_priv(uhci, urb);
        } else
                ret = 0;
@@ -1640,7 +1636,7 @@
        urbp = urb->hcpriv;
        if (!urbp)                      /* URB was never linked! */
                goto done;
-       list_del_init(&urbp->urb_list);
+       list_del(&urbp->urb_list);
 
        uhci_unlink_generic(uhci, urb);
 
@@ -1835,7 +1831,7 @@
                struct urb_priv *urbp = list_entry(tmp, struct urb_priv, urb_list);
                struct urb *urb = urbp->urb;
 
-               list_del_init(&urbp->urb_list);
+               list_del(&urbp->urb_list);
                spin_unlock(&uhci->complete_list_lock);
 
                uhci_finish_urb(hcd, urb, regs);


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to