linux-stable/drivers/usb/mtu3
Macpaul Lin 0da0ac8941 usb: mtu3: fix USB 3.0 dual-role-switch from device to host
commit 456244aeec upstream.

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: d0ed062a8b ("usb: mtu3: dual-role mode support")
Cc: stable@vger.kernel.org
Tested-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Tainping Fang <tianping.fang@mediatek.com>
Link: https://lore.kernel.org/r/20220419081245.21015-1-macpaul.lin@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-09 09:14:27 +02:00
..
Kconfig
Makefile
mtu3.h usb: mtu3: support suspend/resume for device mode 2021-07-27 15:58:37 +02:00
mtu3_core.c usb: mtu3: restore HS function when set SS/SSP 2021-08-13 13:05:50 +02:00
mtu3_debug.h usb: mtu3: mtu3_debug: remove an unused struct member 2020-12-04 16:49:06 +01:00
mtu3_debugfs.c usb: mtu3: dump a status register of IPPC 2021-06-03 13:53:04 +02:00
mtu3_dr.c usb: mtu3: fix USB 3.0 dual-role-switch from device to host 2022-05-09 09:14:27 +02:00
mtu3_dr.h usb: mtu3: support suspend/resume for dual-role mode 2021-07-27 15:58:37 +02:00
mtu3_gadget.c usb: mtu3: fix interval value for intr and isoc 2022-01-11 15:35:17 +01:00
mtu3_gadget_ep0.c usb: mtu3: use MTU3_EP_WEDGE flag 2020-07-29 16:53:58 +02:00
mtu3_host.c usb: mtu3: fix random remote wakeup 2021-08-26 13:41:52 +02:00
mtu3_hw_regs.h usb: mtu3: fix macro for maximum number of packets 2020-07-29 16:53:57 +02:00
mtu3_plat.c usb: mtu3: fix random remote wakeup 2021-08-26 13:41:52 +02:00
mtu3_qmu.c usb: mtu3: add memory barrier before set GPD's HWO 2022-01-05 12:42:38 +01:00
mtu3_qmu.h
mtu3_trace.c
mtu3_trace.h