Re: [PATCH 3/5] drm/panel: get/put panel reference in drm_panel_add/remove()

From: Luca Ceresoli
Date: Wed Mar 26 2025 - 05:24:14 EST


On Tue, 25 Mar 2025 13:24:10 -0400
Anusha Srivatsa <asrivats@xxxxxxxxxx> wrote:

> Take the panel reference and put it back as required
> using the helpers introduced in previous patch.
> drm_panel_add() and drm_panel_remove()
> add a panel to the global registry and removes a panel
> respectively, use get() and put() helpers to keep up
> with refcounting.
>
> Signed-off-by: Anusha Srivatsa <asrivats@xxxxxxxxxx>

This is OK but is should not be applied until all panel drivers are
converted to the new devm_drm_panel_alloc() API. Otherwise for
not-yet-converted panel drivers drm_panel_get/put() would operate on an
uninitialized kref. See [0].

# Do not apply until all panel drivers are converted!
Reviewed-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>

[0] https://lore.kernel.org/all/20250317155607.68cff522@booty/

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com