* [RFC PATCH] drm/meson: dw-hdmi: Propagate reset failures during initialization
@ 2026-08-28 9:14 Pengpeng Hou
0 siblings, 0 replies; only message in thread
From: Pengpeng Hou @ 2026-08-28 9:14 UTC (permalink / raw)
To: Neil Armstrong, Maarten Lankhorst
Cc: Pengpeng Hou, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Philipp Zabel, dri-devel, linux-amlogic, linux-arm-kernel,
linux-kernel
meson_dw_hdmi_init() resets the APB, controller and PHY domains before
accessing the HDMI block. All three reset results are ignored, so bind
or system resume can continue after a reset controller rejected part of
the sequence.
Make the helper return an error and propagate it through bind and
resume. This RFC intentionally leaves earlier HHI programming and
successful resets in place on failure; feedback is requested on whether
these SoCs require an additional rollback sequence.
The issue was identified via static analysis and manually reviewed.
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/gpu/drm/meson/meson_dw_hdmi.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index fef1702acb14..1b55d1c89f62 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -595,9 +595,10 @@ static const struct meson_dw_hdmi_data meson_dw_hdmi_g12a_data = {
.cntl1_init = PHY_CNTL1_INIT,
};
-static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
+static int meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
{
struct meson_drm *priv = meson_dw_hdmi->priv;
+ int ret;
/* Enable clocks */
regmap_update_bits(priv->hhi, HHI_HDMI_CLK_CNTL, 0xffff, 0x100);
@@ -606,9 +607,17 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
regmap_update_bits(priv->hhi, HHI_MEM_PD_REG0, 0xff << 8, 0);
/* Reset HDMITX APB & TX & PHY */
- reset_control_reset(meson_dw_hdmi->hdmitx_apb);
- reset_control_reset(meson_dw_hdmi->hdmitx_ctrl);
- reset_control_reset(meson_dw_hdmi->hdmitx_phy);
+ ret = reset_control_reset(meson_dw_hdmi->hdmitx_apb);
+ if (ret)
+ return ret;
+
+ ret = reset_control_reset(meson_dw_hdmi->hdmitx_ctrl);
+ if (ret)
+ return ret;
+
+ ret = reset_control_reset(meson_dw_hdmi->hdmitx_phy);
+ if (ret)
+ return ret;
/* Enable APB3 fail on error */
if (!meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) {
@@ -641,6 +650,7 @@ static void meson_dw_hdmi_init(struct meson_dw_hdmi *meson_dw_hdmi)
meson_dw_hdmi->data->top_write(meson_dw_hdmi, HDMITX_TOP_INTR_MASKN,
HDMITX_TOP_INTR_CORE);
+ return 0;
}
static void meson_disable_clk(void *data)
@@ -754,7 +764,9 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
return ret;
}
- meson_dw_hdmi_init(meson_dw_hdmi);
+ ret = meson_dw_hdmi_init(meson_dw_hdmi);
+ if (ret)
+ return ret;
/* Bridge / Connector */
@@ -819,11 +831,14 @@ static int __maybe_unused meson_dw_hdmi_pm_suspend(struct device *dev)
static int __maybe_unused meson_dw_hdmi_pm_resume(struct device *dev)
{
struct meson_dw_hdmi *meson_dw_hdmi = dev_get_drvdata(dev);
+ int ret;
if (!meson_dw_hdmi)
return 0;
- meson_dw_hdmi_init(meson_dw_hdmi);
+ ret = meson_dw_hdmi_init(meson_dw_hdmi);
+ if (ret)
+ return ret;
dw_hdmi_resume(meson_dw_hdmi->hdmi);
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-28 9:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 9:14 [RFC PATCH] drm/meson: dw-hdmi: Propagate reset failures during initialization Pengpeng Hou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox