On Fri, 20 Feb 2004, Stephen Hemminger wrote:

> The last problem was a red herring, since the UHCI changes hadn't made it into
> 2.6.3.  This new problem occurs on 2.6.3-bk plus two of Alan's patches: 
> 1) Subject: [linux-usb-devel] PATCH: (as186) Remove unneeded and error-provoking 
> variable in UHCI
> 2) Subject: [linux-usb-devel] PATCH: (as194) Simplify locking in UHCI
> 
> Now seeing the following OOPS after 15min to 30min of leaving the irda
> driver running.  In idle state it just keeps exchanging short packets with
> it's neighbor and each transmit involves aborting the outstanding receive
> urb's first.

Ah, a new different problem, good.

This oops occurred because the URB was dequeued before it had been fully 
queued.  There's already a check on the other side -- the urb_enqueue 
function will see that the URB has already been dequeued.  But the 
urb_dequeue routine did not check for this.

Here is a patch that I believe will fix the problem.

Alan Stern

P.S.: Have you made any more progress towards simplifying the use of 
spinlocks in this driver?


===== uhci-hcd.c 1.89 vs edited =====
--- 1.89/drivers/usb/host/uhci-hcd.c    Thu Feb 19 18:30:19 2004
+++ edited/drivers/usb/host/uhci-hcd.c  Fri Feb 20 15:04:41 2004
@@ -1508,12 +1508,9 @@
                struct urb_priv *urbp = urb->hcpriv;
 
                list_del_init(&urbp->urb_list);
-               spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
-               uhci_destroy_urb_priv (uhci, urb);
-
-               return ret;
-       }
-       ret = 0;
+               uhci_destroy_urb_priv(uhci, urb);
+       } else
+               ret = 0;
 
 out:
        spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
@@ -1649,10 +1646,12 @@
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
        unsigned long flags;
-       struct urb_priv *urbp = urb->hcpriv;
+       struct urb_priv *urbp;
 
        spin_lock_irqsave(&uhci->urb_list_lock, flags);
-
+       urbp = urb->hcpriv;
+       if (!urbp)                      /* URB was never linked! */
+               goto done;
        list_del_init(&urbp->urb_list);
 
        uhci_unlink_generic(uhci, urb);
@@ -1665,6 +1664,7 @@
        list_add_tail(&urbp->urb_list, &uhci->urb_remove_list);
 
        spin_unlock(&uhci->urb_remove_list_lock);
+done:
        spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
        return 0;
 }



-------------------------------------------------------
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