From: Arina Kharlamova <[email protected]>
ingenic_drm_unbind() disables the LCD and pixel clocks before it calls
drm_dev_unregister() and drm_atomic_helper_shutdown(). The shutdown
disables the CRTC and the planes, which writes the LCD controller
registers through the regmap, and the vblank interrupt stays enabled
until then. All of that now happens with the clocks already off.
Unregister the device and shut down the display first, then remove the
clock notifier and disable the clocks.
Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs")
Signed-off-by: Arina Kharlamova <[email protected]>
---
Found by checks derived from the spec2patch kernel API specifications,
with the help of an AI coding assistant (Claude); I reviewed the
analysis and the fix.
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 625ec76cf04d..bc4a6dec680d 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1441,13 +1441,14 @@ static void ingenic_drm_unbind(struct device *dev)
struct ingenic_drm *priv = dev_get_drvdata(dev);
struct clk *parent_clk = clk_get_parent(priv->pix_clk);
+ drm_dev_unregister(&priv->drm);
+ drm_atomic_helper_shutdown(&priv->drm);
+
clk_notifier_unregister(parent_clk, &priv->clock_nb);
if (priv->lcd_clk)
clk_disable_unprepare(priv->lcd_clk);
clk_disable_unprepare(priv->pix_clk);
- drm_dev_unregister(&priv->drm);
- drm_atomic_helper_shutdown(&priv->drm);
dev_set_drvdata(dev, NULL);
}
---
base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
change-id: 20261129-s2p-d81-20babc714aed
Best regards,
--
Arina Kharlamova <[email protected]>