linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* imx8m-blk-ctrl: WARNING, no release() function
@ 2024-12-12 14:10 Francesco Dolcini
  2024-12-16 22:54 ` Luca Ceresoli
  2024-12-17  1:39 ` Peng Fan
  0 siblings, 2 replies; 5+ messages in thread
From: Francesco Dolcini @ 2024-12-12 14:10 UTC (permalink / raw)
  To: linux-pm, imx
  Cc: Ulf Hansson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Peng Fan, Marek Vasut, linux-arm-kernel,
	linux-kernel, Lucas Stach

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.
[    4.618977] WARNING: CPU: 1 PID: 11 at /drivers/base/core.c:2569 device_release+0x80/0x94
[    4.638974] Modules linked in: ecdh_generic ecc etnaviv(+) rfkill libaes samsung_dsim gpu_sched imx_sdma(+) governor_userspace imx_bus dwc3_imx8mp spi_nxp_fspi lontium_lt8912b ina2xx snd_soc_wm8904 ti_ads1015 industrialio_triggered_buffer kfifo_buf lm75 snvs_pwrkey pwm_imx27 nvmem_snvs_lpgpr imx8mm_thermal caam flexcan error can_dev spi_imx usb_conn_gpio display_connector roles gpio_keys fuse ipv6 autofs4
[    4.639073] CPU: 1 UID: 0 PID: 11 Comm: kworker/u16:0 Not tainted 6.13.0-rc2-0.0.0-devel-00040-ga1625b19385c #1
[    4.639082] Hardware name: Toradex Verdin iMX8M Plus WB on Dahlia Board (DT)
[    4.639087] Workqueue: events_unbound deferred_probe_work_func
[    4.639099] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    4.639107] pc : device_release+0x80/0x94
[    4.639116] lr : device_release+0x80/0x94
[    4.639122] sp : ffff80008142b910
[    4.639125] x29: ffff80008142b910 x28: 00000000fffffdfb x27: ffff000005c92180
[    4.639137] x26: ffff000000018028 x25: ffff000000046dc0 x24: ffff800080c43710
[    4.639147] x23: 0000000100000001 x22: 0000000000000000 x21: ffff800080e43750
[    4.639158] x20: 0000000000000000 x19: ffff000007cb06d8 x18: 0000000000000006
[    4.639168] x17: 0000000000000001 x16: 0000000000000000 x15: 0000000000000002
[    4.639179] x14: 0000000000001400 x13: ffff0000000a9110 x12: 0000000000225510
[    4.639190] x11: 0000000000000000 x10: 00000000000009c0 x9 : ffff80008142b790
[    4.639200] x8 : ffff00000013bba0 x7 : 000000000000002d x6 : 000000000113158e
[    4.639210] x5 : 00000001134e0800 x4 : 0000000000000002 x3 : ffff000003b04c50
[    4.639221] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00000013b180
[    4.639231] Call trace:
[    4.639235]  device_release+0x80/0x94 (P)
[    4.639245]  device_release+0x80/0x94 (L)
[    4.639253]  kobject_put+0xb0/0x214
[    4.639264]  put_device+0x14/0x24
[    4.639272]  genpd_remove+0x114/0x248
[    4.639281]  pm_genpd_remove+0x30/0x58
[    4.639288]  imx8m_blk_ctrl_probe+0x36c/0x540
[    4.639299]  platform_probe+0x68/0xdc
[    4.639308]  really_probe+0xc0/0x39c
[    4.639315]  __driver_probe_device+0x7c/0x14c
[    4.639322]  driver_probe_device+0x3c/0x120
[    4.639329]  __device_attach_driver+0xbc/0x160
[    4.639336]  bus_for_each_drv+0x88/0xe8
[    4.639346]  __device_attach+0xa0/0x1b4
[    4.639353]  device_initial_probe+0x14/0x20
[    4.639360]  bus_probe_device+0xb0/0xbc
[    4.639366]  deferred_probe_work_func+0xa0/0xf0
[    4.639373]  process_one_work+0x148/0x284
[    4.639383]  worker_thread+0x2d0/0x3e4
[    4.639391]  kthread+0x110/0x114
[    4.639399]  ret_from_fork+0x10/0x20
[    4.639409] ---[ end trace 0000000000000000 ]---

and more for other devices, from the same driver.

Just reporting for the moment, in case someone has some ideas or wants to
have a look.

Francesco



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: imx8m-blk-ctrl: WARNING, no release() function
  2024-12-12 14:10 imx8m-blk-ctrl: WARNING, no release() function Francesco Dolcini
@ 2024-12-16 22:54 ` Luca Ceresoli
  2024-12-17  1:39 ` Peng Fan
  1 sibling, 0 replies; 5+ messages in thread
From: Luca Ceresoli @ 2024-12-16 22:54 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: linux-pm, imx, Ulf Hansson, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Peng Fan, Marek Vasut,
	linux-arm-kernel, linux-kernel, Lucas Stach, Jindong Yue,
	Benjamin Gaignard, Paul Elder, Hervé Codina

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@dolcini.it> 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@linaro.org>
  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@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Message-ID: <20241122134207.157283-2-ulf.hansson@linaro.org>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: imx8m-blk-ctrl: WARNING, no release() function
  2024-12-12 14:10 imx8m-blk-ctrl: WARNING, no release() function Francesco Dolcini
  2024-12-16 22:54 ` Luca Ceresoli
@ 2024-12-17  1:39 ` Peng Fan
  2024-12-17  8:42   ` Luca Ceresoli
  1 sibling, 1 reply; 5+ messages in thread
From: Peng Fan @ 2024-12-17  1:39 UTC (permalink / raw)
  To: Francesco Dolcini, linux-pm@vger.kernel.org, imx@lists.linux.dev
  Cc: Ulf Hansson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Marek Vasut, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Lucas Stach

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

Please try this patch.
https://lore.kernel.org/all/20241206112731.98244-1-peng.fan@oss.nxp.com/

Thanks,
Peng.

> 
> 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.
> [    4.618977] WARNING: CPU: 1 PID: 11 at /drivers/base/core.c:2569
> device_release+0x80/0x94
> [    4.638974] Modules linked in: ecdh_generic ecc etnaviv(+) rfkill
> libaes samsung_dsim gpu_sched imx_sdma(+) governor_userspace
> imx_bus dwc3_imx8mp spi_nxp_fspi lontium_lt8912b ina2xx
> snd_soc_wm8904 ti_ads1015 industrialio_triggered_buffer kfifo_buf
> lm75 snvs_pwrkey pwm_imx27 nvmem_snvs_lpgpr imx8mm_thermal
> caam flexcan error can_dev spi_imx usb_conn_gpio display_connector
> roles gpio_keys fuse ipv6 autofs4
> [    4.639073] CPU: 1 UID: 0 PID: 11 Comm: kworker/u16:0 Not tainted
> 6.13.0-rc2-0.0.0-devel-00040-ga1625b19385c #1
> [    4.639082] Hardware name: Toradex Verdin iMX8M Plus WB on
> Dahlia Board (DT)
> [    4.639087] Workqueue: events_unbound
> deferred_probe_work_func
> [    4.639099] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS
> BTYPE=--)
> [    4.639107] pc : device_release+0x80/0x94
> [    4.639116] lr : device_release+0x80/0x94
> [    4.639122] sp : ffff80008142b910
> [    4.639125] x29: ffff80008142b910 x28: 00000000fffffdfb x27:
> ffff000005c92180
> [    4.639137] x26: ffff000000018028 x25: ffff000000046dc0 x24:
> ffff800080c43710
> [    4.639147] x23: 0000000100000001 x22: 0000000000000000 x21:
> ffff800080e43750
> [    4.639158] x20: 0000000000000000 x19: ffff000007cb06d8 x18:
> 0000000000000006
> [    4.639168] x17: 0000000000000001 x16: 0000000000000000 x15:
> 0000000000000002
> [    4.639179] x14: 0000000000001400 x13: ffff0000000a9110 x12:
> 0000000000225510
> [    4.639190] x11: 0000000000000000 x10: 00000000000009c0 x9 :
> ffff80008142b790
> [    4.639200] x8 : ffff00000013bba0 x7 : 000000000000002d x6 :
> 000000000113158e
> [    4.639210] x5 : 00000001134e0800 x4 : 0000000000000002 x3 :
> ffff000003b04c50
> [    4.639221] x2 : 0000000000000000 x1 : 0000000000000000 x0 :
> ffff00000013b180
> [    4.639231] Call trace:
> [    4.639235]  device_release+0x80/0x94 (P)
> [    4.639245]  device_release+0x80/0x94 (L)
> [    4.639253]  kobject_put+0xb0/0x214
> [    4.639264]  put_device+0x14/0x24
> [    4.639272]  genpd_remove+0x114/0x248
> [    4.639281]  pm_genpd_remove+0x30/0x58
> [    4.639288]  imx8m_blk_ctrl_probe+0x36c/0x540
> [    4.639299]  platform_probe+0x68/0xdc
> [    4.639308]  really_probe+0xc0/0x39c
> [    4.639315]  __driver_probe_device+0x7c/0x14c
> [    4.639322]  driver_probe_device+0x3c/0x120
> [    4.639329]  __device_attach_driver+0xbc/0x160
> [    4.639336]  bus_for_each_drv+0x88/0xe8
> [    4.639346]  __device_attach+0xa0/0x1b4
> [    4.639353]  device_initial_probe+0x14/0x20
> [    4.639360]  bus_probe_device+0xb0/0xbc
> [    4.639366]  deferred_probe_work_func+0xa0/0xf0
> [    4.639373]  process_one_work+0x148/0x284
> [    4.639383]  worker_thread+0x2d0/0x3e4
> [    4.639391]  kthread+0x110/0x114
> [    4.639399]  ret_from_fork+0x10/0x20
> [    4.639409] ---[ end trace 0000000000000000 ]---
> 
> and more for other devices, from the same driver.
> 
> Just reporting for the moment, in case someone has some ideas or
> wants to have a look.
> 
> Francesco



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: imx8m-blk-ctrl: WARNING, no release() function
  2024-12-17  1:39 ` Peng Fan
@ 2024-12-17  8:42   ` Luca Ceresoli
  2024-12-17  9:37     ` Lucas Stach
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Ceresoli @ 2024-12-17  8:42 UTC (permalink / raw)
  To: Peng Fan
  Cc: Francesco Dolcini, linux-pm@vger.kernel.org, imx@lists.linux.dev,
	Ulf Hansson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Marek Vasut, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Lucas Stach, Jindong Yue,
	Benjamin Gaignard, Paul Elder, Hervé Codina

Hello Peng,

On Tue, 17 Dec 2024 01:39:09 +0000
Peng Fan <peng.fan@nxp.com> wrote:

> > Subject: imx8m-blk-ctrl: WARNING, no release() function  
> 
> Please try this patch.
> https://lore.kernel.org/all/20241206112731.98244-1-peng.fan@oss.nxp.com/

I cherry-picked the two patches from linux-next:

  e1a875703470 ("pmdomain: imx-gpcv2: Suppress bind attrs")
  afb2a86f002b ("pmdomain: imx8m[p]-blk-ctrl: Suppress bind attrs")

but I still have the same warnings:

[    5.427038] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
[    6.464219] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
[    6.752903] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
[    7.303529] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
[    8.006575] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
[    8.598453] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.

This is with 6.13-rc3 on a imx8mp.

Luca

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: imx8m-blk-ctrl: WARNING, no release() function
  2024-12-17  8:42   ` Luca Ceresoli
@ 2024-12-17  9:37     ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2024-12-17  9:37 UTC (permalink / raw)
  To: Luca Ceresoli, Peng Fan
  Cc: Francesco Dolcini, linux-pm@vger.kernel.org, imx@lists.linux.dev,
	Ulf Hansson, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Marek Vasut, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Jindong Yue, Benjamin Gaignard,
	Paul Elder, Hervé Codina

Hi Luca,

Am Dienstag, dem 17.12.2024 um 09:42 +0100 schrieb Luca Ceresoli:
> Hello Peng,
> 
> On Tue, 17 Dec 2024 01:39:09 +0000
> Peng Fan <peng.fan@nxp.com> wrote:
> 
> > > Subject: imx8m-blk-ctrl: WARNING, no release() function  
> > 
> > Please try this patch.
> > https://lore.kernel.org/all/20241206112731.98244-1-peng.fan@oss.nxp.com/
> 
> I cherry-picked the two patches from linux-next:
> 
>   e1a875703470 ("pmdomain: imx-gpcv2: Suppress bind attrs")
>   afb2a86f002b ("pmdomain: imx8m[p]-blk-ctrl: Suppress bind attrs")
> 
> but I still have the same warnings:
> 
> [    5.427038] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> [    6.464219] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> [    6.752903] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> [    7.303529] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> [    8.006575] Device 'mediablk-mipi-csi2-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> [    8.598453] Device 'mediablk-mipi-dsi-1' does not have a release() function, it is broken and must be fixed. See Documentation/core-api/kobject.rst.
> 
> This is with 6.13-rc3 on a imx8mp.

As far as I can see this isn't emitted due to the blk-ctrl device
itself missing the release function, but from the pseudo devices used
by genpd to control the power of the secondary power domains.

I think this needs to be fixed in genpd itself. I'll take a look.

Regards,
Lucas


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-17  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 14:10 imx8m-blk-ctrl: WARNING, no release() function Francesco Dolcini
2024-12-16 22:54 ` Luca Ceresoli
2024-12-17  1:39 ` Peng Fan
2024-12-17  8:42   ` Luca Ceresoli
2024-12-17  9:37     ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).