]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc2: avoid leaking DMA channels on disconnection
authorVincent Palatin <vpalatin@chromium.org>
Sun, 15 Mar 2015 20:24:32 +0000 (13:24 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 19 Mar 2015 16:22:57 +0000 (11:22 -0500)
commit41990f0fdaf93ed939d4424f61b5a36ad8d5009b
tree04c39ed0e16ed67741597bab709256724b5ded45
parent0d2e6cd0a56cd2f5da0524a7aff34830830d16ba
usb: dwc2: avoid leaking DMA channels on disconnection

When the HCD is disconnected, the DMA transfers still in-flight were cleaned-up
but the count of available DMA channels (e.g. available_host_channels) was not
reset.
The pool of DMA channels can be depleted when doing unclean
disconnection of USB peripherals, and reaches the point where no
transfer was possible until the next reboot/reload of the driver.

Tested by putting a programmable USB mux on the port and randomly
plugging/unpluging a USB HUB with USB mass-storage key, USB-audio and
USB-ethernet dongle connected to its downstream ports, and also doing the
disconnection early while the devices are still enumerating to get more URBs
in-flight.
After the patch, the devices are still enumerating after thousands of cycles,
while the port was totally dead before.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/hcd.c