[PATCH v2 04/16] drm/panel/sun4i: Keep up with refcounting

Maxime Ripard mripard at kernel.org
Tue Jun 24 08:53:02 UTC 2025


On Fri, Jun 20, 2025 at 03:54:10PM -0500, Anusha Srivatsa wrote:
> On Fri, Jun 20, 2025 at 8:27 AM Maxime Ripard <mripard at kernel.org> wrote:
> 
> > Hi,
> >
> > On Thu, Jun 19, 2025 at 02:15:56PM -0500, Anusha Srivatsa wrote:
> > > Put the panel reference back when driver is no
> > > longer using it.
> > >
> > > Signed-off-by: Anusha Srivatsa <asrivats at redhat.com>
> >
> > When I asked you to provide a rationale for why you think the
> > drm_panel_put() call belonged where it does, it was pretty obvious it
> > needed to be done for all patches with the same issue, not just a few
> > random ones.
>
> Well, not totally random. THe intention was to specifically explain
> the cases where the drm_panel_put() is part of a probe(), enable() or
> attach() like function since that caused confusion in the last
> version. There must have been misunderstanding on my end when I
> thought only those cases needed additional explanation. I will make
> the commit message more verbose.

Eventually, it's a memory management thing. You can't judge how a
driver, framework or function uses the memory from 3 lines of context.

This patch is a good example: it might make sense from the 3 lines of
context. But if you consider what this function is doing, and how it
uses the drm_panel pointer, what you did is broken.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250624/69adc695/attachment.sig>


More information about the dri-devel mailing list