[PATCH] drm/bridge: analogix: Propagate PHY errors from resume

From: Pengpeng Hou

Date: Fri Aug 28 2026 - 05:17:27 EST


analogix_dp_resume() enables the controller clock and platform power
before setting up the DisplayPort PHY. It currently ignores both PHY
operation results and initializes the controller even when the PHY is
unavailable.

Check phy_set_mode() and phy_power_on(). On failure, undo platform
power and the controller clock before returning the error to the
platform resume callback.

The issue was identified via static analysis and manually reviewed.

Fixes: 73f613908eb1 ("drm/bridge: analogix_dp: move platform and PHY power handling into runtime PM")
Fixes: 2c0883459ed6 ("drm/bridge: analogix_dp: Add support for phy configuration.")

Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 30c0c0b41d5a..00844f68d748 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1461,12 +1461,23 @@ int analogix_dp_resume(struct analogix_dp_device *dp)
if (dp->plat_data->power_on)
dp->plat_data->power_on(dp->plat_data);

- phy_set_mode(dp->phy, PHY_MODE_DP);
- phy_power_on(dp->phy);
+ ret = phy_set_mode(dp->phy, PHY_MODE_DP);
+ if (ret)
+ goto power_off;
+
+ ret = phy_power_on(dp->phy);
+ if (ret)
+ goto power_off;

analogix_dp_init_dp(dp);

return 0;
+
+power_off:
+ if (dp->plat_data->power_off)
+ dp->plat_data->power_off(dp->plat_data);
+ clk_disable_unprepare(dp->clock);
+ return ret;
}
EXPORT_SYMBOL_GPL(analogix_dp_resume);

--
2.43.0