All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] musb-fixes for v4.13-rc3
@ 2017-07-25 14:31 Bin Liu
  2017-07-25 14:31 ` [PATCH 1/2] usb: core: unlink urbs from the tail of the endpoint's urb_list Bin Liu
  2017-07-25 14:31 ` [PATCH 2/2] usb: musb: fix tx fifo flush handling again Bin Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Bin Liu @ 2017-07-25 14:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, stable, Bin Liu

Hi Greg,

Here is a musb fix for v4.13-rc3, for the re-enumeration issue exposed by
AM9271 WIFI dongle. Please let me know if any change is needed.

Regards,
-Bin.
---

Bin Liu (2):
  usb: core: unlink urbs from the tail of the endpoint's urb_list
  usb: musb: fix tx fifo flush handling again

 drivers/usb/core/hcd.c       | 2 +-
 drivers/usb/musb/musb_host.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] usb: core: unlink urbs from the tail of the endpoint's urb_list
  2017-07-25 14:31 [PATCH 0/2] musb-fixes for v4.13-rc3 Bin Liu
@ 2017-07-25 14:31 ` Bin Liu
  2017-07-25 14:31 ` [PATCH 2/2] usb: musb: fix tx fifo flush handling again Bin Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Bin Liu @ 2017-07-25 14:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, stable, Bin Liu

While unlink an urb, if the urb has been programmed in the controller,
the controller driver might do some hw related actions to tear down the
urb.

Currently usb_hcd_flush_endpoint() passes each urb from the head of the
endpoint's urb_list to the controller driver, which could make the
controller driver think each urb has been programmed and take the
unnecessary actions for each urb.

This patch changes the behavior in usb_hcd_flush_endpoint() to pass the
urbs from the tail of the list, to avoid any unnecessary actions in an
controller driver.

Cc: stable@vger.kernel.org # v4.4+
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/core/hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index ab1bb3b538ac..193b1249976f 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1888,7 +1888,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
 	/* No more submits can occur */
 	spin_lock_irq(&hcd_urb_list_lock);
 rescan:
-	list_for_each_entry (urb, &ep->urb_list, urb_list) {
+	list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) {
 		int	is_in;
 
 		if (urb->unlinked)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] usb: musb: fix tx fifo flush handling again
  2017-07-25 14:31 [PATCH 0/2] musb-fixes for v4.13-rc3 Bin Liu
  2017-07-25 14:31 ` [PATCH 1/2] usb: core: unlink urbs from the tail of the endpoint's urb_list Bin Liu
@ 2017-07-25 14:31 ` Bin Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Bin Liu @ 2017-07-25 14:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, stable, Bin Liu

commit 68fe05e2a451 ("usb: musb: fix tx fifo flush handling") drops the
1ms delay trying to solve the long disconnect time issue when
application queued many tx urbs. However, the 1ms delay is needed for
some use cases, for example, without the delay, reconnecting AR9271 WIFI
dongle no longer works if the connection is dropped from the AP.

So let's add back the 1ms delay in musb_h_tx_flush_fifo(), and solve the
long disconnect time problem with a separate patch for
usb_hcd_flush_endpoint().

Cc: stable@vger.kernel.org # v4.4+
Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/musb/musb_host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 76decb8011eb..3344ffd5bb13 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -139,6 +139,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep)
 				"Could not flush host TX%d fifo: csr: %04x\n",
 				ep->epnum, csr))
 			return;
+		mdelay(1);
 	}
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-25 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 14:31 [PATCH 0/2] musb-fixes for v4.13-rc3 Bin Liu
2017-07-25 14:31 ` [PATCH 1/2] usb: core: unlink urbs from the tail of the endpoint's urb_list Bin Liu
2017-07-25 14:31 ` [PATCH 2/2] usb: musb: fix tx fifo flush handling again Bin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.