[PATCH v10 30/69] drm/rockchip: dw_hdmi_qp: Cancel pending HPD work on suspend
From: Cristian Ciocaltea
Date: Fri Jul 31 2026 - 12:31:36 EST
The HPD threaded handler debounces hotplug events by delaying
hdmi->hpd_work for 150 ms. Nothing discards that work when the system
goes to sleep: drm_kms_helper_poll_disable() only disables the HPD IRQ
line via the bridge .hpd_disable() op, and disable_irq() merely waits
for the threaded handler, which has already returned after arming the
timer.
If the debounce expires during suspend, its non-freezable work may probe
the connector and read the EDID over DDC. Since genpd powers off the
HDMI controller's power domain in ->suspend_noirq(), this access may
hit unpowered hardware and hang the system.
Cancel the work in the suspend callback. The DRM device is registered
as a consumer of the HDMI device, so it always suspends first and the
HPD IRQ is already disabled by that point, meaning nothing can re-arm
the work behind our back. No counterpart is needed on resume, as the
work gets scheduled again on the next hotplug interrupt.
Fixes: 128a9bf8ace2 ("drm/rockchip: Add basic RK3588 HDMI output support")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/20260723015909.7F79A1F000E9@xxxxxxxxxxxxxxx/
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx>
---
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 646a4cb96830..e9fda67b8ca9 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -728,8 +728,12 @@ static int __maybe_unused dw_hdmi_qp_rockchip_suspend(struct device *dev)
{
struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev);
- if (hdmi)
- dw_hdmi_qp_suspend(dev, hdmi->hdmi);
+ if (!hdmi)
+ return 0;
+
+ dw_hdmi_qp_suspend(dev, hdmi->hdmi);
+
+ cancel_delayed_work_sync(&hdmi->hpd_work);
return 0;
}
--
2.55.0