usb: renesas_usbhs: pop packet when urb dequeued
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 9 Dec 2011 02:26:07 +0000 (18:26 -0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 10:26:35 +0000 (12:26 +0200)
usbhsh_ureq_free() is not enough when urb dequeued.

Without this patch, the driver can not recognize re-connected
USB device after USB hub disconnected

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/mod_host.c

index c39404783271bbaae89b526c5ee2c4752eea8e4e..0dbbc6613c1ff3b7664265c75c0322a41548be5f 100644 (file)
@@ -800,8 +800,13 @@ static int usbhsh_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
        struct usbhsh_hpriv *hpriv = usbhsh_hcd_to_hpriv(hcd);
        struct usbhsh_request *ureq = usbhsh_urb_to_ureq(urb);
 
-       if (ureq)
-               usbhsh_ureq_free(hpriv, ureq);
+       if (ureq) {
+               struct usbhs_priv *priv = usbhsh_hpriv_to_priv(hpriv);
+               struct usbhs_pkt *pkt = &ureq->pkt;
+
+               usbhs_pkt_pop(pkt->pipe, pkt);
+               usbhsh_queue_done(priv, pkt);
+       }
 
        return 0;
 }