Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325245 > unrolled thread

[PATCH v2 5/5] usb: dwc2: gadget: free TX FIFO after killing requests

Started byRobert Baldyga <r.baldyga@samsung.com>
First post2016-02-03 12:40 +0100
Last post2016-02-03 12:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 5/5] usb: dwc2: gadget: free TX FIFO after killing requests Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 12:40 +0100

#1325245 — [PATCH v2 5/5] usb: dwc2: gadget: free TX FIFO after killing requests

FromRobert Baldyga <r.baldyga@samsung.com>
Date2016-02-03 12:40 +0100
Subject[PATCH v2 5/5] usb: dwc2: gadget: free TX FIFO after killing requests
Message-ID<qY3WW-1lI-31@gated-at.bofh.it>
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>
---
 drivers/usb/dwc2/gadget.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 8f9d45b..fa5919a 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2779,10 +2779,6 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
 
 	spin_lock_irqsave(&hsotg->lock, flags);
 
-	hsotg->fifo_map &= ~(1<<hs_ep->fifo_index);
-	hs_ep->fifo_index = 0;
-	hs_ep->fifo_size = 0;
-
 	ctrl = dwc2_readl(hsotg->regs + epctrl_reg);
 	ctrl &= ~DXEPCTL_EPENA;
 	ctrl &= ~DXEPCTL_USBACTEP;
@@ -2797,6 +2793,10 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
 	/* 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;
+	hs_ep->fifo_size = 0;
+
 	spin_unlock_irqrestore(&hsotg->lock, flags);
 	return 0;
 }
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web