Skip to content

Commit 456244a

Browse files
macpaul-lin-mtkgregkh
authored andcommitted
usb: mtu3: fix USB 3.0 dual-role-switch from device to host
Issue description: When an OTG port has been switched to device role and then switch back to host role again, the USB 3.0 Host (XHCI) will not be able to detect "plug in event of a connected USB 2.0/1.0 ((Highspeed and Fullspeed) devices until system reboot. Root cause and Solution: There is a condition checking flag "ssusb->otg_switch.is_u3_drd" in toggle_opstate(). At the end of role switch procedure, toggle_opstate() will be called to set DC_SESSION and SOFT_CONN bit. If "is_u3_drd" was set and switched the role to USB host 3.0, bit DC_SESSION and SOFT_CONN will be skipped hence caused the port cannot detect connected USB 2.0 (Highspeed and Fullspeed) devices. Simply remove the condition check to solve this issue. Fixes: d0ed062 ("usb: mtu3: dual-role mode support") Cc: [email protected] Tested-by: Fabien Parent <[email protected]> Reviewed-by: Chunfeng Yun <[email protected]> Signed-off-by: Macpaul Lin <[email protected]> Signed-off-by: Tainping Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d8bfe50 commit 456244a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/mtu3/mtu3_dr.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ static inline struct ssusb_mtk *otg_sx_to_ssusb(struct otg_switch_mtk *otg_sx)
2121

2222
static void toggle_opstate(struct ssusb_mtk *ssusb)
2323
{
24-
if (!ssusb->otg_switch.is_u3_drd) {
25-
mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION);
26-
mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN);
27-
}
24+
mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION);
25+
mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN);
2826
}
2927

3028
/* only port0 supports dual-role mode */

0 commit comments

Comments
 (0)