* [PATCH] fbdev: omapfb: panel-dsi-cm: initialize lock before registering display
@ 2026-08-18 13:53 Runyu Xiao
2026-08-18 16:49 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Runyu Xiao @ 2026-08-18 13:53 UTC (permalink / raw)
To: Helge Deller
Cc: Rob Clark, Dave Airlie, Tomi Valkeinen, linux-omap, linux-fbdev,
dri-devel, linux-kernel, stable, Runyu Xiao, Jianhao Xu
dsicm_probe() registers the display before initializing ddata->lock.
Once omapdss_register_display() publishes the display, another consumer
can reach a dsicm callback that takes this mutex while it is still
uninitialized.
Initialize the mutex before registering the display so the published
callbacks always see a valid lock.
Fixes: f76ee892a99e ("omapfb: copy omapdss & displays for omapfb")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
---
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
index 1d75f27c6b80..ce1d4d5f4034 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
@@ -1151,14 +1151,14 @@ static int dsicm_probe(struct platform_device *pdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
+ mutex_init(&ddata->lock);
+
r = omapdss_register_display(dssdev);
if (r) {
dev_err(dev, "Failed to register panel\n");
goto err_reg;
}
- mutex_init(&ddata->lock);
-
atomic_set(&ddata->do_update, 0);
ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fbdev: omapfb: panel-dsi-cm: initialize lock before registering display
2026-08-18 13:53 [PATCH] fbdev: omapfb: panel-dsi-cm: initialize lock before registering display Runyu Xiao
@ 2026-08-18 16:49 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2026-08-18 16:49 UTC (permalink / raw)
To: Runyu Xiao
Cc: Rob Clark, Dave Airlie, Tomi Valkeinen, linux-omap, linux-fbdev,
dri-devel, linux-kernel, stable, Jianhao Xu
On 8/18/26 15:53, Runyu Xiao wrote:
> dsicm_probe() registers the display before initializing ddata->lock.
> Once omapdss_register_display() publishes the display, another consumer
> can reach a dsicm callback that takes this mutex while it is still
> uninitialized.
>
> Initialize the mutex before registering the display so the published
> callbacks always see a valid lock.
>
> Fixes: f76ee892a99e ("omapfb: copy omapdss & displays for omapfb")
> Cc: stable@vger.kernel.org
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
> ---
> drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
applied.
Thanks!
Helge
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-18 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 13:53 [PATCH] fbdev: omapfb: panel-dsi-cm: initialize lock before registering display Runyu Xiao
2026-08-18 16:49 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox