From e4f5dbb4c4891d3569fe197549b5e4ed6f10acdf Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Mon, 4 Nov 2024 10:44:53 -0800 Subject: [PATCH] Revert "usb: dwc3: core: Fix system suspend on TI AM62 platforms" This reverts commit 705e3ce37bccdf2ed6f848356ff355f480d51a91. This causes an issue with dwc3 devices that enable runtime PM. The issue was reported upstream in [1] and the proposed fix can be found in [2]. [1] https://lore.kernel.org/all/ZyVfcUuPq56R2m1Y@google.com/#t [2] https://lore.kernel.org/all/20241104-am62-lpm-usb-fix-v1-1-e93df73a4f0d@kernel.org/ Bug: 377320141 Change-Id: Ib0eead7d337b397a2777a4cefa852a436469d4ad Signed-off-by: Will McVicker --- drivers/usb/dwc3/core.c | 19 ------------------- drivers/usb/dwc3/core.h | 3 --- 2 files changed, 22 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 427e5660f87c..21740e2b8f07 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -2342,11 +2342,6 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) u32 reg; int i; - dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) & - DWC3_GUSB2PHYCFG_SUSPHY) || - (dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) & - DWC3_GUSB3PIPECTL_SUSPHY); - switch (dwc->current_dr_role) { case DWC3_GCTL_PRTCAP_DEVICE: if (pm_runtime_suspended(dwc->dev)) @@ -2398,15 +2393,6 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) break; } - if (!PMSG_IS_AUTO(msg)) { - /* - * TI AM62 platform requires SUSPHY to be - * enabled for system suspend to work. - */ - if (!dwc->susphy_state) - dwc3_enable_susphy(dwc, true); - } - return 0; } @@ -2474,11 +2460,6 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) break; } - if (!PMSG_IS_AUTO(msg)) { - /* restore SUSPHY state to that before system suspend. */ - dwc3_enable_susphy(dwc, dwc->susphy_state); - } - return 0; } diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index eab81dfdcc35..9c508e0c5cdf 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1150,8 +1150,6 @@ struct dwc3_scratchpad_array { * @sys_wakeup: set if the device may do system wakeup. * @wakeup_configured: set if the device is configured for remote wakeup. * @suspended: set to track suspend event due to U3/L2. - * @susphy_state: state of DWC3_GUSB2PHYCFG_SUSPHY + DWC3_GUSB3PIPECTL_SUSPHY - * before PM suspend. * @imod_interval: set the interrupt moderation interval in 250ns * increments or 0 to disable. * @max_cfg_eps: current max number of IN eps used across all USB configs. @@ -1384,7 +1382,6 @@ struct dwc3 { unsigned sys_wakeup:1; unsigned wakeup_configured:1; unsigned suspended:1; - unsigned susphy_state:1; u16 imod_interval;