Skip to content

Commit 459702e

Browse files
aford173gregkh
authored andcommitted
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: 0604160 ("usb: gadget: udc: renesas_usb3: Enhance role switch support") Cc: stable <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Adam Ford <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 292d2c8 commit 459702e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/gadget/udc/renesas_usb3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,6 +2378,8 @@ static void handle_ext_role_switch_states(struct device *dev,
23782378
switch (role) {
23792379
case USB_ROLE_NONE:
23802380
usb3->connection_state = USB_ROLE_NONE;
2381+
if (cur_role == USB_ROLE_HOST)
2382+
device_release_driver(host);
23812383
if (usb3->driver)
23822384
usb3_disconnect(usb3);
23832385
usb3_vbus_out(usb3, false);

0 commit comments

Comments
 (0)