OSDN Git Service

usb: musb: return -ESHUTDOWN in urb when three-strikes error happened
authorBin Liu <b-liu@ti.com>
Mon, 25 May 2020 02:50:44 +0000 (21:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 May 2020 11:36:30 +0000 (13:36 +0200)
commit1b967691ecdcf512bc33c0783158f760e5c1a9cf
tree801bc67908158c9d87d8113febe1f9bbd02f09d8
parentca681aa49200422a4144ee376a2079a9f717bf11
usb: musb: return -ESHUTDOWN in urb when three-strikes error happened

When a USB device attached to a hub got disconnected, MUSB controller
generates RXCSR_RX_ERROR interrupt for the 3-strikes-out error.

Currently the MUSB host driver returns -EPROTO in current URB, then the
USB device driver could immediately resubmit the URB which causes MUSB
generate RXCSR_RX_ERROR interrupt again. This circle causes interrupt
storm then the hub never got a chance to report the USB device detach.

To fix the interrupt storm, change the URB return code to -ESHUTDOWN for
MUSB_RXCSR_H_ERROR interrupt, so that the USB device driver will not
immediately resubmit the URB.

Signed-off-by: Bin Liu <b-liu@ti.com>
Link: https://lore.kernel.org/r/20200525025049.3400-2-b-liu@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_host.c