]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
usb: musb: fix tx fifo flush handling
authorBin Liu <b-liu@ti.com>
Fri, 6 Nov 2015 18:08:56 +0000 (12:08 -0600)
committerFelipe Balbi <balbi@ti.com>
Tue, 17 Nov 2015 17:35:48 +0000 (11:35 -0600)
commit68fe05e2a45181ce02ab2698930b37f20487bd24
tree1674ac962884a43588a07b91203e3c9145d5bce6
parent5e216d54b4862611c663e1e3e8ca1db1930ef948
usb: musb: fix tx fifo flush handling

Here are a few changes in musb_h_tx_flush_fifo().

- It has been observed that sometimes (if not always) musb is unable
  to flush tx fifo during urb dequeue when disconnect a device. But
  it seems to be harmless, since the tx fifo flush is done again in
  musb_ep_program() when re-use the hw_ep.

  But the WARN() floods the console in the case when multiple tx urbs
  are queued, so change it to dev_WARN_ONCE().

- applications could queue up many tx urbs, then the 1ms delay could
  causes minutes of delay in device disconnect. So remove it to get
  better user experience. The 1ms delay does not help the flushing
  anyway.

- cleanup the debug code - related to lastcsr.

----
Note: The tx fifo flush issue has been observed during device disconnect
on AM335x.

To reproduce the issue, ensure tx urb(s) are queued when unplug the usb
device which is connected to AM335x usb host port.

I found using a usb-ethernet device and running iperf (client on AM335x)
has very high chance to trigger the problem.

Better to turn on dev_dbg() in musb_cleanup_urb() with CPPI enabled to
see the issue when aborting the tx channel.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_host.c