From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Ernest Van Hoecke" <ernestvanhoecke@gmail.com>,
"Anusha Srivatsa" <asrivats@redhat.com>,
"Maxime Ripard" <mripard@kernel.org>
Cc: "Neil Armstrong" <neil.armstrong@linaro.org>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Jessica Zhang" <quic_jesszhan@quicinc.com>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Hui Pu" <Hui.Pu@gehealthcare.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<imx@lists.linux.dev>, <regressions@lists.linux.dev>
Subject: Re: [REGRESSION] drm/panel/panel-simple v6.17 WARNING regression
Date: Tue, 14 Oct 2025 12:31:35 +0200 [thread overview]
Message-ID: <DDHZ5GO9MPF0.CGYTVBI74FOZ@bootlin.com> (raw)
In-Reply-To: <hlf4wdopapxnh4rekl5s3kvoi6egaga3lrjfbx6r223ar3txri@3ik53xw5idyh>
Hello Ernest,
thanks for your detailed analysis and report!
On Tue Oct 14, 2025 at 10:13 AM CEST, Ernest Van Hoecke wrote:
> Hello everyone,
>
> Commit 94d50c1a2ca3 ("drm/bridge: get/put the bridge reference in drm_bridge_attach/detach()")
> introduced a regression with the below warning dure probe with panel
> dpi described in the device tree.
>
> [ 9.160074] ------------[ cut here ]------------
> [ 9.160092] WARNING: CPU: 0 PID: 66 at /usr/src/kernel/lib/refcount.c:25 drm_bridge_attach+0x2c/0x1dc
> [ 9.160138] refcount_t: addition on 0; use-after-free.
> [ 9.160147] Modules linked in: coda_vpu(+) snd_soc_fsl_asrc snd_compress v4l2_jpeg pwm_imx27 imx_vdoa spi_imx imx6_media(C) imx_media_common(C) videobuf2_dma_contig etnaviv snd_soc_fsl_ssi v4l2_mem2mem imx_pcm_dma panel_simple gpio_keys gpu_sched pwm_bl loop fuse ipv6 autofs4
> [ 9.160423] CPU: 0 UID: 0 PID: 66 Comm: kworker/u10:2 Tainted: G C 6.17.0-rc5-0.0.0-devel #1 PREEMPT
> [ 9.160459] Tainted: [C]=CRAP
> [ 9.160476] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [ 9.160497] Workqueue: events_unbound deferred_probe_work_func
> [ 9.160535] Call trace:
> [ 9.160546] unwind_backtrace from show_stack+0x10/0x14
> [ 9.160603] show_stack from dump_stack_lvl+0x54/0x68
> [ 9.160637] dump_stack_lvl from __warn+0x7c/0xd4
> [ 9.160672] __warn from warn_slowpath_fmt+0x130/0x1c4
> [ 9.160726] warn_slowpath_fmt from drm_bridge_attach+0x2c/0x1dc
> [ 9.160780] drm_bridge_attach from imx_pd_bind+0x74/0xa0
> [ 9.160836] imx_pd_bind from component_bind_all+0xfc/0x254
> [ 9.160881] component_bind_all from imx_drm_bind+0xa8/0x154
> [ 9.160903] imx_drm_bind from try_to_bring_up_aggregate_device+0x1f8/0x2b0
> [ 9.160959] try_to_bring_up_aggregate_device from __component_add+0x9c/0x160
> [ 9.161003] __component_add from imx_pd_probe+0xa8/0x160
> [ 9.161042] imx_pd_probe from platform_probe+0x5c/0x90
> [ 9.161066] platform_probe from really_probe+0xd0/0x3a4
> [ 9.161093] really_probe from __driver_probe_device+0x8c/0x1d4
> [ 9.161144] __driver_probe_device from driver_probe_device+0x34/0xd0
> [ 9.161195] driver_probe_device from __device_attach_driver+0xa4/0x134
> [ 9.161248] __device_attach_driver from bus_for_each_drv+0x90/0xe4
> [ 9.161299] bus_for_each_drv from __device_attach+0xa4/0x1cc
> [ 9.161328] __device_attach from bus_probe_device+0x84/0x88
> [ 9.161354] bus_probe_device from deferred_probe_work_func+0x8c/0xcc
> [ 9.161395] deferred_probe_work_func from process_one_work+0x158/0x2e0
> [ 9.161434] process_one_work from worker_thread+0x254/0x3fc
> [ 9.161449] worker_thread from kthread+0x128/0x24c
> [ 9.161473] kthread from ret_from_fork+0x14/0x28
> [ 9.161494] Exception stack(0xe0aa1fb0 to 0xe0aa1ff8)
> [ 9.161505] 1fa0: 00000000 00000000 00000000 00000000
> [ 9.161517] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> [ 9.161529] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> [ 9.161539] ---[ end trace 0000000000000000 ]---
>
> Note that this commit was added to branch 'drm-next-2025-07-30',
> which did not contain an already mainlined fix for another regression [1].
> Without that fix [2], this new regression is masked.
>
> Reverting 94d50c1a2ca3 on top of
> commit 260f6f4fda93 ("Merge tag 'drm-next-2025-07-30' of https://gitlab.freedesktop.org/drm/kernel")
> fixes the issue. At that point, [1] was fixed in mainline, and the new
> regression reported here was merged in. v6.17-rc1 to v6.17-rc7 are in
> this state.
This is because the DRM_IMX has not been converted to the new
devm_drm_bridge_alloc() [0] DRM bridge allocation API, which is now
mandatory.
I converted all the bridges, except for a few which I missed because my
search was based on looking for drm_bridge_add() calls, and this driver
does not call it.
I recently sent a series proposing to make drm_bridge_add() mandatory
before drm_bridge_attach() in the docs and warn if that is violated [1]. If
you apply patch 4 of that series you should see the warning.
Let me have a look at the DRM_IMX driver, I'll try to send a series
converting it to the new API within today.
[0] https://elixir.bootlin.com/linux/v6.17.1/source/include/drm/drm_bridge.h#L1282
[1] https://lore.kernel.org/lkml/20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com/#t
> However, later on, another regression seems to be introduced by
> commit 8fa5909400f3 ("drm/bridge: get the bridge returned by drm_bridge_chain_get_first_bridge()")
> so reverting 94d50c1a2ca3 on top of drm-misc-next does not solve
> everything. This was tested by rebasing drm-misc-next onto (260f6f4fda93
> plus the revert of 94d50c1a2ca3) and then bisecting.
>
> So in v6.18-rc1, both regressions are present.
>
> There, I get the following additional warnings:
>
> [ 9.732278] ------------[ cut here ]------------
> [ 9.732336] WARNING: CPU: 0 PID: 38 at lib/refcount.c:22 drm_bridge_get+0x10/0x18
> [ 9.744608] refcount_t: saturated; leaking memory.
Not sure here, but it may well be another symptom of the same bug: the
refcount was not initialized correctly, so it is found inconsistent later
when trying to increase it. Let's fix the known issue and then we'll see.
Best regards,
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-10-14 10:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 8:13 [REGRESSION] drm/panel/panel-simple v6.17 WARNING regression Ernest Van Hoecke
2025-10-14 10:31 ` Luca Ceresoli [this message]
2025-10-14 11:25 ` Ernest Van Hoecke
2025-10-14 11:43 ` Luca Ceresoli
2025-10-14 12:22 ` Ernest Van Hoecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DDHZ5GO9MPF0.CGYTVBI74FOZ@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=Hui.Pu@gehealthcare.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=asrivats@redhat.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ernestvanhoecke@gmail.com \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=regressions@lists.linux.dev \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.