OSDN Git Service

usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition
authorAdam Ford <aford173@gmail.com>
Fri, 28 Jan 2022 22:36:03 +0000 (16:36 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Jan 2022 13:22:49 +0000 (14:22 +0100)
commit459702eea6132888b5c5b64c0e9c626da4ec2493
treee474dc6891fb9afe5fec5f097052e70ef06347e5
parent292d2c82b105d92082c2120a44a58de9767e44f1
usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition

The support the external role switch a variety of situations were
addressed, but the transition from USB_ROLE_HOST to USB_ROLE_NONE
leaves the host up which can cause some error messages when
switching from host to none, to gadget, to none, and then back
to host again.

 xhci-hcd ee000000.usb: Abort failed to stop command ring: -110
 xhci-hcd ee000000.usb: xHCI host controller not responding, assume dead
 xhci-hcd ee000000.usb: HC died; cleaning up
 usb 4-1: device not accepting address 6, error -108
 usb usb4-port1: couldn't allocate usb_device

After this happens it will not act as a host again.
Fix this by releasing the host mode when transitioning to USB_ROLE_NONE.

Fixes: 0604160d8c0b ("usb: gadget: udc: renesas_usb3: Enhance role switch support")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
Link: https://lore.kernel.org/r/20220128223603.2362621-1-aford173@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/renesas_usb3.c