[PATCH v7 05/20] drm/bridge: analogix_dp: Take a runtime PM reference in bridge detect

From: Damon Ding

Date: Wed Nov 25 2026 - 06:22:40 EST


The analogix_dp_bridge_detect() calls analogix_dp_detect_hpd(), which
reads the controller registers and may write them for the force HPD
fallback. The connector is polled and can be queried by userspace at
any time, so this runs while the device is runtime suspended when the
display is disabled.

Take a runtime PM reference around the HPD check, and report the
connector status as unknown when the device cannot be resumed.

Fixes: 2b77a2918c5d ("drm: bridge: analogix/dp: move hpd detect to connector detect function")
CC: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx>

---

Changes in v7:
- Add this patch to take a runtime PM reference in
analogix_dp_bridge_detect(), as the register accesses behind it may
run while the device is runtime suspended.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 46d4dd9d7cd7..b9f4e5757fc5 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -908,9 +908,14 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
if (dp->force_connected_mode)
return connector_status_connected;

+ if (pm_runtime_resume_and_get(dp->dev) < 0)
+ return connector_status_unknown;
+
if (!analogix_dp_detect_hpd(dp))
status = connector_status_connected;

+ pm_runtime_put_autosuspend(dp->dev);
+
return status;
}

--
2.34.1