Skip to contentSkip to conversation

patch "usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition" added to usb-testing

PATCH [email protected] 1 participant 1 message Jan 31, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

From efdfd34d5749724be0eba4168ef0fa5143ea0639 Mon Sep 17 00:00:00 2001
From: Adam Ford <[email protected]>
Date: Fri, 28 Jan 2022 16:36:03 -0600
Subject: 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 <[email protected]>
---
 drivers/usb/gadget/udc/renesas_usb3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/udc/renesas_usb3.c +2 -0
index 57d417a7c3e0..601829a6b4ba 100644
@@ -2378,6 +2378,8 @@ static void handle_ext_role_switch_states(struct device *dev,
 	switch (role) {
 	case USB_ROLE_NONE:
 		usb3->connection_state = USB_ROLE_NONE;
+		if (cur_role == USB_ROLE_HOST)
+			device_release_driver(host);
 		if (usb3->driver)
 			usb3_disconnect(usb3);
 		usb3_vbus_out(usb3, false);
Signature · 1 line
2.35.1