]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
usb: dwc2: gadget: kill requests after disabling ep
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Fri, 9 Jan 2015 12:38:57 +0000 (13:38 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Jan 2015 21:33:58 +0000 (15:33 -0600)
kill_all_requests() can flush the fifo. Call it after disabling the
endpoint.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/gadget.c

index cd8880d6be53719ecda639dd5fbf5ac3b6318bbe..3dda17eb070040ae232aaed2f8403f74ce96d56a 100644 (file)
@@ -2605,8 +2605,6 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)
        epctrl_reg = dir_in ? DIEPCTL(index) : DOEPCTL(index);
 
        spin_lock_irqsave(&hsotg->lock, flags);
-       /* terminate all requests with shutdown */
-       kill_all_requests(hsotg, hs_ep, -ESHUTDOWN);
 
        hsotg->fifo_map &= ~(1<<hs_ep->fifo_index);
        hs_ep->fifo_index = 0;
@@ -2623,6 +2621,9 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)
        /* disable endpoint interrupts */
        s3c_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 0);
 
+       /* terminate all requests with shutdown */
+       kill_all_requests(hsotg, hs_ep, -ESHUTDOWN);
+
        spin_unlock_irqrestore(&hsotg->lock, flags);
        return 0;
 }