]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: Fix timeout issue during controller enter/exit from halt state
authorSelvarasu Ganesan <selvarasu.g@samsung.com>
Sat, 1 Feb 2025 16:39:02 +0000 (22:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:51 +0000 (12:50 +0100)
commit006a4e9069a1eaf27f36bff5d164816da51d96d0
treea442d52039eaf09d35cabd25fb38058f1ed0ae94
parent47cc53c3ebe32e7b306980536f39ef48be31fc47
usb: dwc3: Fix timeout issue during controller enter/exit from halt state

[ Upstream commit d3a8c28426fc1fb3252753a9f1db0d691ffc21b0 ]

There is a frequent timeout during controller enter/exit from halt state
after toggling the run_stop bit by SW. This timeout occurs when
performing frequent role switches between host and device, causing
device enumeration issues due to the timeout. This issue was not present
when USB2 suspend PHY was disabled by passing the SNPS quirks
(snps,dis_u2_susphy_quirk and snps,dis_enblslpm_quirk) from the DTS.
However, there is a requirement to enable USB2 suspend PHY by setting of
GUSB2PHYCFG.ENBLSLPM and GUSB2PHYCFG.SUSPHY bits when controller starts
in gadget or host mode results in the timeout issue.

This commit addresses this timeout issue by ensuring that the bits
GUSB2PHYCFG.ENBLSLPM and GUSB2PHYCFG.SUSPHY are cleared before starting
the dwc3_gadget_run_stop sequence and restoring them after the
dwc3_gadget_run_stop sequence is completed.

Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250201163903.459-1-selvarasu.g@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c