diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2016-08-29 16:39:00 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-31 03:06:06 -0400 |
commit | 1c07b20eaa0e001b3f7811cb3e1dafc4f00648c3 (patch) | |
tree | ec8fb860ebc8cff088d0773431db1799b1af95ff | |
parent | 21f3bb52986c5f0ab74d350486de38fafff6ddef (diff) |
usb: dwc2: gadget: free TX FIFO after killing requests
As kill_all_requests() potentially flushes TX FIFO, we should should
free FIFO after calling it. Otherwise FIFO could stay unflushed properly.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 94698298e829..94bd19ad7f5c 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -3120,10 +3120,6 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep) | |||
3120 | 3120 | ||
3121 | spin_lock_irqsave(&hsotg->lock, flags); | 3121 | spin_lock_irqsave(&hsotg->lock, flags); |
3122 | 3122 | ||
3123 | hsotg->fifo_map &= ~(1<<hs_ep->fifo_index); | ||
3124 | hs_ep->fifo_index = 0; | ||
3125 | hs_ep->fifo_size = 0; | ||
3126 | |||
3127 | ctrl = dwc2_readl(hsotg->regs + epctrl_reg); | 3123 | ctrl = dwc2_readl(hsotg->regs + epctrl_reg); |
3128 | ctrl &= ~DXEPCTL_EPENA; | 3124 | ctrl &= ~DXEPCTL_EPENA; |
3129 | ctrl &= ~DXEPCTL_USBACTEP; | 3125 | ctrl &= ~DXEPCTL_USBACTEP; |
@@ -3138,6 +3134,10 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep) | |||
3138 | /* terminate all requests with shutdown */ | 3134 | /* terminate all requests with shutdown */ |
3139 | kill_all_requests(hsotg, hs_ep, -ESHUTDOWN); | 3135 | kill_all_requests(hsotg, hs_ep, -ESHUTDOWN); |
3140 | 3136 | ||
3137 | hsotg->fifo_map &= ~(1 << hs_ep->fifo_index); | ||
3138 | hs_ep->fifo_index = 0; | ||
3139 | hs_ep->fifo_size = 0; | ||
3140 | |||
3141 | spin_unlock_irqrestore(&hsotg->lock, flags); | 3141 | spin_unlock_irqrestore(&hsotg->lock, flags); |
3142 | return 0; | 3142 | return 0; |
3143 | } | 3143 | } |