From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388422; b=wVeG3z+/h1C4EACsSF1fo3FE9PmcLXzhqgvAMKbKX2ikgWz4eiZqqWeDhOB9SxqFLgL0 pHd1yzTeZQoWAh9yqgM125Feekcq7zVJvkt2V/OIn1KaATHmImALz7veH9mIjFbPmzHVJ qFuW6SlVhy6r+zgjPuZGwAgrA5WFd51JTqiK4I2iPrQCrqtQ1NVnekIzTQXmb8QoKHvE0 6pbLntWLqnOnXZJLfR5kZEApXTioc5+dfwSdxcVheQNgd38x4rHm1voQ2GR+FYnOoQiwl dXqMvLhJ8e0EhquCnOj08s0lNvvrtsduMthT5ETgZ9g10b3dgcBtAn/4164ORsba7aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388422; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eutPld/xDTyN/TalQtjbkreKEiIDQ/bra30asWqyb4g=; b=QrCTp4pfxFwxYPZwzwPPP0r2Jz+WpFXLsK6YLEIoGTFPhmoURLgoXpWjU5bYbyVTOIK8 pu1I36vksow4gD3m+6skHyj5ABBwe7n3uhNgQdvzoRlpa/8YAm+i4WSiv+asXDNnojdls QPGDK/Td8ZpJrK+7TSb0ro77C2nODqsjuWZQCyCRMhwHiHNg7nh2ZyMVUB0rh1lq+EPGd tQGkh/wisUB1emPsbxFR/YEYTfDR0YiisBlka55Njw0/cBFKHMZsidQP4j3obmxK/rWRg WA8x164UJwDv0bdf6QId7TEiwRoU422f3r+k+SYStEoY7hd+vGsrzjZMwBSy+fW6dng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dg6SThWZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BA5B606A322; Fri, 4 Dec 2026 12:47:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dg6SThWZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB7971F000C2; Fri, 4 Dec 2026 12:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388422; bh=eutPld/xDTyN/TalQtjbkreKEiIDQ/bra30asWqyb4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dg6SThWZsvsKz95mvl3Mk7jlh+G2ntQZYjU2UnMUuYWi4zyEgT+xG4zsiTCZNBS3X kc50Dm2mWbtx3xOLSRVaNmwD2csyFPyz10sa33LeiAeMfg00WLT5rn1GzXSBn9tlWF +qyNd2MYsANsR1IpwB+psLGjSkWook0VUn7JlUeQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Radhey Shyam Pandey , Thinh Nguyen Subject: [PATCH 6.1 0607/1059] usb: dwc3: xilinx: fix system suspend and resume PHY handling Date: Fri, 4 Dec 2026 19:02:18 +0900 Message-ID: <20261204100659.843869667@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Radhey Shyam Pandey commit 2fad8d241a6833d0c7aeafa0ab596e83c7b4ec9c upstream. 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") Cc: stable Assisted-by: Claude:claude-opus-5 Signed-off-by: Radhey Shyam Pandey Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20260928120015.3152461-2-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-xilinx.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -353,13 +353,26 @@ static int __maybe_unused dwc3_xlnx_runt static int __maybe_unused dwc3_xlnx_suspend(struct device *dev) { struct dwc3_xlnx *priv_data = dev_get_drvdata(dev); + int ret; + + ret = phy_power_off(priv_data->usb3_phy); + if (ret < 0) + return ret; - phy_exit(priv_data->usb3_phy); + 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: + if (phy_power_on(priv_data->usb3_phy)) + dev_err(dev, "failed to restore PHY power after suspend error\n"); + + return ret; } static int __maybe_unused dwc3_xlnx_resume(struct device *dev) @@ -373,15 +386,20 @@ static int __maybe_unused dwc3_xlnx_resu 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 = {