Re: imx8m-blk-ctrl: WARNING, no release() function

From: Luca Ceresoli
Date: Mon Dec 16 2024 - 17:55:40 EST


Hi Francesco,

+Cc: Jindong, Benjamin, Paul (recent committers, in lack of an
imx8m-blk-ctrl.c maintainer)
+Cc: Hervé (stumbled on this issue too)

On Thu, 12 Dec 2024 15:10:03 +0100
Francesco Dolcini <francesco@xxxxxxxxxx> wrote:

> Hello,
> on v6.13-rc2 (PREEMPT_RT, if it matters), I have the following warning
>
> [ 4.615793] ------------[ cut here ]------------
> [ 4.615814] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.

Thanks for the report. It is happening also here after upgrading from
6.13-rc1 to 6.13-rc3.

This originates from drivers/pmdomain/imx/imx8m-blk-ctrl.c

I bisected and the initial commit exposing this warning is:

commit b8f7bbd1f4ecff6d6277b8c454f62bb0a1c6dbe4
Author: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
Date: Fri Nov 22 14:42:02 2024 +0100

pmdomain: core: Add missing put_device()

When removing a genpd we don't clean up the genpd->dev correctly. Let's add
the missing put_device() in genpd_free_data() to fix this.

Fixes: 401ea1572de9 ("PM / Domain: Add struct device to genpd")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
Message-ID: <20241122134207.157283-2-ulf.hansson@xxxxxxxxxx>

Superficially, it looks to me like a legitimate commit which exposes a
pre-existing flaw in drivers/pmdomain/imx/imx8m-blk-ctrl.c.

I have no more info at the moment.

Luca

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