From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"michal.simek@amd.com" <michal.simek@amd.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"git@amd.com" <git@amd.com>
Subject: Re: [PATCH 3/5] usb: dwc3: xilinx: fix system suspend and resume PHY handling
Date: Wed, 26 Aug 2026 00:12:55 +0000 [thread overview]
Message-ID: <ao4vUiCsjZ9oOpA9@vbox> (raw)
In-Reply-To: <20260810174713.2325292-4-radhey.shyam.pandey@amd.com>
On Mon, Aug 10, 2026, Radhey Shyam Pandey wrote:
> System suspend and resume error paths do not handle PHY and clock
> resources correctly. Suspend calls phy_exit() without first powering
> off the PHY and ignores failures, while resume can leave clocks
> enabled if PHY reinitialization fails.
>
> Propagate errors to the PM core and unwind resources to ensure a
> consistent state on suspend and resume failures.
>
> Fixes: d6edcdc1ef06 ("usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure")
Does this need to be backported to stable?
BR,
Thinh
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> ---
> drivers/usb/dwc3/dwc3-xilinx.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index 4a04d158f872..894f5f5e8b7a 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -403,13 +403,25 @@ static int __maybe_unused dwc3_xlnx_runtime_idle(struct device *dev)
> static int __maybe_unused dwc3_xlnx_suspend(struct device *dev)
> {
> struct dwc3_xlnx *priv_data = dev_get_drvdata(dev);
> + int ret;
>
> - phy_exit(priv_data->usb3_phy);
> + ret = phy_power_off(priv_data->usb3_phy);
> + if (ret < 0)
> + return ret;
> +
> + ret = phy_exit(priv_data->usb3_phy);
> + if (ret < 0)
> + goto err_phy_power_on;
>
> /* Disable the clocks */
> clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
>
> return 0;
> +
> +err_phy_power_on:
> + phy_power_on(priv_data->usb3_phy);
> +
> + return ret;
> }
>
> static int __maybe_unused dwc3_xlnx_resume(struct device *dev)
> @@ -423,15 +435,20 @@ static int __maybe_unused dwc3_xlnx_resume(struct device *dev)
>
> ret = phy_init(priv_data->usb3_phy);
> if (ret < 0)
> - return ret;
> + goto err_clk_disable;
>
> ret = phy_power_on(priv_data->usb3_phy);
> if (ret < 0) {
> phy_exit(priv_data->usb3_phy);
> - return ret;
> + goto err_clk_disable;
> }
>
> return 0;
> +
> +err_clk_disable:
> + clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
> +
> + return ret;
> }
>
> static const struct dev_pm_ops dwc3_xlnx_dev_pm_ops = {
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-08-26 0:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 17:47 [PATCH 0/5] usb: dwc3: xilinx: error handling and teardown fixes Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 1/5] usb: dwc3: xilinx: use device_get_match_data() in probe Radhey Shyam Pandey
2026-08-26 0:09 ` Thinh Nguyen
2026-08-10 17:47 ` [PATCH 2/5] usb: dwc3: xilinx: add platform data struct with init callback Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 3/5] usb: dwc3: xilinx: fix system suspend and resume PHY handling Radhey Shyam Pandey
2026-08-26 0:12 ` Thinh Nguyen [this message]
2026-08-10 17:47 ` [PATCH 4/5] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Radhey Shyam Pandey
2026-08-10 17:47 ` [PATCH 5/5] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Radhey Shyam Pandey
2026-08-26 0:22 ` [PATCH 0/5] usb: dwc3: xilinx: error handling and teardown fixes Thinh Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ao4vUiCsjZ9oOpA9@vbox \
--to=thinh.nguyen@synopsys.com \
--cc=git@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=p.zabel@pengutronix.de \
--cc=radhey.shyam.pandey@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox