* [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device
@ 2026-11-17 20:59 Henry Zhang
2026-11-18 10:09 ` Maxime Ripard
2026-11-18 14:00 ` Maíra Canal
0 siblings, 2 replies; 4+ messages in thread
From: Henry Zhang @ 2026-11-17 20:59 UTC (permalink / raw)
To: mripard, dave.stevenson, mcanal
Cc: kernel-list, maarten.lankhorst, tzimmermann, airlied, simona,
dri-devel, linux-kernel
The DSI encoder is embedded in struct vc4_dsi, which lives as long as
the DSI platform device, but it is initialised with drmm_encoder_init()
and so is only cleaned up when the DRM device is released. The DRM
device can outlive the unbind of the vc4 components: unloading the DSI
panel driver detaches from the DSI host, which deletes the DSI component
and unbinds the whole vc4 DRM device, but a compositor that keeps the
DRM device open keeps it alive.
If the panel driver is loaded again before that, the new DRM device
binds the DSI component and calls drmm_encoder_init() on the encoder
that is still on the old DRM device's encoder list. The old device's
release later cleans it up from under the new one. On a Raspberry Pi 4
with a 6.18-based kernel, closing the old DRM device then gave:
WARNING: drivers/gpu/drm/drm_encoder.c:214 at drmm_encoder_alloc_release+0x30/0x40 [drm]
Call trace: drmm_encoder_alloc_release <- drm_dev_put <- drm_gem_dmabuf_release <- __fput
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
pc : drm_mode_config_cleanup+0x5c/0x2f0 [drm]
Call trace: drm_mode_config_cleanup <- drm_managed_release <- drm_dev_put
Allocate the encoder in bind with drmm_encoder_alloc(), so each DRM
device has its own and releases only its own. The DSI bridge is still
shared: while the old DRM device holds it, drm_bridge_attach() in the
new bind fails with -EBUSY, so binding again before the old DRM device
is released now fails cleanly instead of corrupting both devices.
The analysis, this change and this description were prepared with the
help of an AI coding assistant (Claude Code).
Fixes: 6f0ca506c30e ("drm/vc4: dsi: Switch to DRM-managed encoder initialization")
Signed-off-by: Henry Zhang <henryzhang62@gmail.com>
---
Testing:
- On this base (drm-misc-next 467ac0b56aeb): compile-tested only,
arm64 defconfig with DRM_VC4=m, W=1, no new warnings.
- A backport to a downstream Raspberry Pi 6.18.34 kernel, on a
Raspberry Pi 4 with an out-of-tree modular DSI panel driver: with the
compositor stopped and a process holding /dev/dri/card1 open, unload
the panel driver and load it again. The bind now fails cleanly:
vc4-drm gpu: failed to bind fe700000.dsi (ops vc4_dsi_ops [vc4]): -16
vc4-drm gpu: adev bind failed: -16
the panel probe fails with -16, and there is no warning or oops,
also when the holder then closes the old DRM device. Unloading and
loading the panel driver again after that brings back the display
and the compositor. Without the change, the same kernel gave the
warning and oops above. The backport differs from this patch in two
ways: that kernel still gets the panel bridge with
drmm_of_get_bridge(), which has a use-after-free of its own in this
sequence, so the test kernel used devm_drm_of_get_bridge() instead
(not needed here, where the panel bridge is refcounted); and a
downstream DSI restart worker that used the embedded encoder now
follows a pointer to the current one.
The -EBUSY is final: the panel probe is not retried when the old DRM
device goes away, so the panel driver has to be loaded again. Would you
prefer the DSI host to wait for the old DRM device to be released
before adding its component again, or a bridge allocated per bind?
Not addressed: a connector probe that is already running when the
panel is removed can still call into the panel driver.
This applies to drm-misc-next on its own. It also applies on top of my
"drm/vc4: dsi: Serialize register writes through the DMA workaround",
and it does not touch the code changed by my vc4 DSI series
<20261028164539.3471833-1-henryzhang62@gmail.com>.
Tools: Claude Code (an AI coding assistant) analysed the crash logs and
the vc4/DRM lifetimes, located the introducing commit, wrote the change
and this description, built and checkpatch-checked it, and ran the
backport test on the board, at my request.
drivers/gpu/drm/vc4/vc4_dsi.c | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
index ec008f766..5bd8f579b 100644
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -546,9 +546,18 @@ struct vc4_dsi_variant {
};
+/*
+ * The encoder of one DRM device. The DRM device can outlive the unbind of
+ * this component, so a later bind must not reuse the encoder of an earlier
+ * one: allocate one per bind, managed by the DRM device.
+ */
+struct vc4_dsi_encoder {
+ struct vc4_encoder base;
+ struct vc4_dsi *dsi;
+};
+
/* General DSI hardware state. */
struct vc4_dsi {
- struct vc4_encoder encoder;
struct mipi_dsi_host dsi_host;
struct platform_device *pdev;
@@ -601,7 +610,7 @@ struct vc4_dsi {
container_of_const(host, struct vc4_dsi, dsi_host)
#define to_vc4_dsi(_encoder) \
- container_of_const(_encoder, struct vc4_dsi, encoder.base)
+ (container_of_const(_encoder, struct vc4_dsi_encoder, base.base)->dsi)
#define bridge_to_vc4_dsi(_bridge) \
container_of_const(_bridge, struct vc4_dsi, bridge)
@@ -1626,7 +1635,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
struct platform_device *pdev = to_platform_device(dev);
struct drm_device *drm = dev_get_drvdata(master);
struct vc4_dsi *dsi = dev_get_drvdata(dev);
- struct drm_encoder *encoder = &dsi->encoder.base;
+ struct vc4_dsi_encoder *dsi_encoder;
+ struct drm_encoder *encoder;
int ret;
drm_bridge_get(&dsi->bridge);
@@ -1637,9 +1647,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
dsi->variant = of_device_get_match_data(dev);
- dsi->encoder.type = dsi->variant->port ?
- VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
-
dsi->regs = vc4_ioremap_regs(pdev, 0);
if (IS_ERR(dsi->regs))
return PTR_ERR(dsi->regs);
@@ -1758,12 +1765,16 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
if (ret)
return ret;
- ret = drmm_encoder_init(drm, encoder,
- &vc4_dsi_encoder_funcs,
- DRM_MODE_ENCODER_DSI,
- NULL);
- if (ret)
- return ret;
+ dsi_encoder = drmm_encoder_alloc(drm, struct vc4_dsi_encoder, base.base,
+ &vc4_dsi_encoder_funcs,
+ DRM_MODE_ENCODER_DSI, NULL);
+ if (IS_ERR(dsi_encoder))
+ return PTR_ERR(dsi_encoder);
+
+ dsi_encoder->dsi = dsi;
+ dsi_encoder->base.type = dsi->variant->port ?
+ VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
+ encoder = &dsi_encoder->base.base;
ret = devm_pm_runtime_enable(dev);
if (ret)
base-commit: 467ac0b56aebc804360f276feffbc9032c265a6e
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device
2026-11-17 20:59 [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device Henry Zhang
@ 2026-11-18 10:09 ` Maxime Ripard
2026-11-18 17:48 ` Henry Zhang
2026-11-18 14:00 ` Maíra Canal
1 sibling, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2026-11-18 10:09 UTC (permalink / raw)
To: Henry Zhang
Cc: dave.stevenson, mcanal, kernel-list, maarten.lankhorst,
tzimmermann, airlied, simona, dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2060 bytes --]
On Tue, Nov 17, 2026 at 12:59:02PM -0800, Henry Zhang wrote:
> The DSI encoder is embedded in struct vc4_dsi, which lives as long as
> the DSI platform device
That's not true.
It's allocated with devm_drm_bridge_alloc() that will *not* free it in
remove but give away its reference there.
We have another reference taken in vc4_dsi_bind, that is only given up
through a drm-managed action and thus will only be freed when the DRM
device is destroyed.
> but it is initialised with drmm_encoder_init() and so is only cleaned
> up when the DRM device is released. The DRM device can outlive the
> unbind of the vc4 components: unloading the DSI panel driver detaches
> from the DSI host, which deletes the DSI component and unbinds the
> whole vc4 DRM device, but a compositor that keeps the DRM device open
> keeps it alive.
All vc4 components should be tied to the DRM device lifetime so that's
not generally correct either. Something might have snuck back in though.
Also, generally speaking, unloading panel drivers is unsupported at this
point. It's a work in progress, but requires more changes to be safe.
> If the panel driver is loaded again before that, the new DRM device
> binds the DSI component and calls drmm_encoder_init() on the encoder
> that is still on the old DRM device's encoder list. The old device's
> release later cleans it up from under the new one. On a Raspberry Pi 4
> with a 6.18-based kernel, closing the old DRM device then gave:
>
> WARNING: drivers/gpu/drm/drm_encoder.c:214 at drmm_encoder_alloc_release+0x30/0x40 [drm]
> Call trace: drmm_encoder_alloc_release <- drm_dev_put <- drm_gem_dmabuf_release <- __fput
> Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
> pc : drm_mode_config_cleanup+0x5c/0x2f0 [drm]
> Call trace: drm_mode_config_cleanup <- drm_managed_release <- drm_dev_put
This is surprising though. I'd like to see a detailed analysis of what's
actually going on on mainline because it doesn't look right.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device
2026-11-17 20:59 [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device Henry Zhang
2026-11-18 10:09 ` Maxime Ripard
@ 2026-11-18 14:00 ` Maíra Canal
1 sibling, 0 replies; 4+ messages in thread
From: Maíra Canal @ 2026-11-18 14:00 UTC (permalink / raw)
To: Henry Zhang, mripard, dave.stevenson
Cc: kernel-list, maarten.lankhorst, tzimmermann, airlied, simona,
dri-devel, linux-kernel
Hi Henry,
On 17/11/26 17:59, Henry Zhang wrote:
> The DSI encoder is embedded in struct vc4_dsi, which lives as long as
> the DSI platform device, but it is initialised with drmm_encoder_init()
> and so is only cleaned up when the DRM device is released. The DRM
> device can outlive the unbind of the vc4 components: unloading the DSI
> panel driver detaches from the DSI host, which deletes the DSI component
> and unbinds the whole vc4 DRM device, but a compositor that keeps the
> DRM device open keeps it alive.
>
> If the panel driver is loaded again before that, the new DRM device
> binds the DSI component and calls drmm_encoder_init() on the encoder
> that is still on the old DRM device's encoder list. The old device's
> release later cleans it up from under the new one. On a Raspberry Pi 4
> with a 6.18-based kernel, closing the old DRM device then gave:
>
> WARNING: drivers/gpu/drm/drm_encoder.c:214 at drmm_encoder_alloc_release+0x30/0x40 [drm]
> Call trace: drmm_encoder_alloc_release <- drm_dev_put <- drm_gem_dmabuf_release <- __fput
> Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
> pc : drm_mode_config_cleanup+0x5c/0x2f0 [drm]
> Call trace: drm_mode_config_cleanup <- drm_managed_release <- drm_dev_put
Could you reproduce this issue on top of drm-misc-next? The downstream
kernel differs from upstream in several ways. If you are able to
reproduce it, could you please provide the full call trace?
Best regards,
- Maíra
>
> Allocate the encoder in bind with drmm_encoder_alloc(), so each DRM
> device has its own and releases only its own. The DSI bridge is still
> shared: while the old DRM device holds it, drm_bridge_attach() in the
> new bind fails with -EBUSY, so binding again before the old DRM device
> is released now fails cleanly instead of corrupting both devices.
>
> The analysis, this change and this description were prepared with the
> help of an AI coding assistant (Claude Code).
>
> Fixes: 6f0ca506c30e ("drm/vc4: dsi: Switch to DRM-managed encoder initialization")
> Signed-off-by: Henry Zhang <henryzhang62@gmail.com>
> ---
> Testing:
>
> - On this base (drm-misc-next 467ac0b56aeb): compile-tested only,
> arm64 defconfig with DRM_VC4=m, W=1, no new warnings.
>
> - A backport to a downstream Raspberry Pi 6.18.34 kernel, on a
> Raspberry Pi 4 with an out-of-tree modular DSI panel driver: with the
> compositor stopped and a process holding /dev/dri/card1 open, unload
> the panel driver and load it again. The bind now fails cleanly:
>
> vc4-drm gpu: failed to bind fe700000.dsi (ops vc4_dsi_ops [vc4]): -16
> vc4-drm gpu: adev bind failed: -16
>
> the panel probe fails with -16, and there is no warning or oops,
> also when the holder then closes the old DRM device. Unloading and
> loading the panel driver again after that brings back the display
> and the compositor. Without the change, the same kernel gave the
> warning and oops above. The backport differs from this patch in two
> ways: that kernel still gets the panel bridge with
> drmm_of_get_bridge(), which has a use-after-free of its own in this
> sequence, so the test kernel used devm_drm_of_get_bridge() instead
> (not needed here, where the panel bridge is refcounted); and a
> downstream DSI restart worker that used the embedded encoder now
> follows a pointer to the current one.
>
> The -EBUSY is final: the panel probe is not retried when the old DRM
> device goes away, so the panel driver has to be loaded again. Would you
> prefer the DSI host to wait for the old DRM device to be released
> before adding its component again, or a bridge allocated per bind?
>
> Not addressed: a connector probe that is already running when the
> panel is removed can still call into the panel driver.
>
> This applies to drm-misc-next on its own. It also applies on top of my
> "drm/vc4: dsi: Serialize register writes through the DMA workaround",
> and it does not touch the code changed by my vc4 DSI series
> <20261028164539.3471833-1-henryzhang62@gmail.com>.
>
> Tools: Claude Code (an AI coding assistant) analysed the crash logs and
> the vc4/DRM lifetimes, located the introducing commit, wrote the change
> and this description, built and checkpatch-checked it, and ran the
> backport test on the board, at my request.
>
> drivers/gpu/drm/vc4/vc4_dsi.c | 35 +++++++++++++++++++++++------------
> 1 file changed, 23 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
> index ec008f766..5bd8f579b 100644
> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
> @@ -546,9 +546,18 @@ struct vc4_dsi_variant {
>
> };
>
> +/*
> + * The encoder of one DRM device. The DRM device can outlive the unbind of
> + * this component, so a later bind must not reuse the encoder of an earlier
> + * one: allocate one per bind, managed by the DRM device.
> + */
> +struct vc4_dsi_encoder {
> + struct vc4_encoder base;
> + struct vc4_dsi *dsi;
> +};
> +
> /* General DSI hardware state. */
> struct vc4_dsi {
> - struct vc4_encoder encoder;
> struct mipi_dsi_host dsi_host;
>
> struct platform_device *pdev;
> @@ -601,7 +610,7 @@ struct vc4_dsi {
> container_of_const(host, struct vc4_dsi, dsi_host)
>
> #define to_vc4_dsi(_encoder) \
> - container_of_const(_encoder, struct vc4_dsi, encoder.base)
> + (container_of_const(_encoder, struct vc4_dsi_encoder, base.base)->dsi)
>
> #define bridge_to_vc4_dsi(_bridge) \
> container_of_const(_bridge, struct vc4_dsi, bridge)
> @@ -1626,7 +1635,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
> struct platform_device *pdev = to_platform_device(dev);
> struct drm_device *drm = dev_get_drvdata(master);
> struct vc4_dsi *dsi = dev_get_drvdata(dev);
> - struct drm_encoder *encoder = &dsi->encoder.base;
> + struct vc4_dsi_encoder *dsi_encoder;
> + struct drm_encoder *encoder;
> int ret;
>
> drm_bridge_get(&dsi->bridge);
> @@ -1637,9 +1647,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
>
> dsi->variant = of_device_get_match_data(dev);
>
> - dsi->encoder.type = dsi->variant->port ?
> - VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
> -
> dsi->regs = vc4_ioremap_regs(pdev, 0);
> if (IS_ERR(dsi->regs))
> return PTR_ERR(dsi->regs);
> @@ -1758,12 +1765,16 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
> if (ret)
> return ret;
>
> - ret = drmm_encoder_init(drm, encoder,
> - &vc4_dsi_encoder_funcs,
> - DRM_MODE_ENCODER_DSI,
> - NULL);
> - if (ret)
> - return ret;
> + dsi_encoder = drmm_encoder_alloc(drm, struct vc4_dsi_encoder, base.base,
> + &vc4_dsi_encoder_funcs,
> + DRM_MODE_ENCODER_DSI, NULL);
> + if (IS_ERR(dsi_encoder))
> + return PTR_ERR(dsi_encoder);
> +
> + dsi_encoder->dsi = dsi;
> + dsi_encoder->base.type = dsi->variant->port ?
> + VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
> + encoder = &dsi_encoder->base.base;
>
> ret = devm_pm_runtime_enable(dev);
> if (ret)
>
> base-commit: 467ac0b56aebc804360f276feffbc9032c265a6e
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device
2026-11-18 10:09 ` Maxime Ripard
@ 2026-11-18 17:48 ` Henry Zhang
0 siblings, 0 replies; 4+ messages in thread
From: Henry Zhang @ 2026-11-18 17:48 UTC (permalink / raw)
To: mripard, mcanal
Cc: dave.stevenson, kernel-list, maarten.lankhorst, tzimmermann,
airlied, simona, dri-devel, linux-kernel, henryzhang62
On Wed, Nov 18, 2026, Maxime Ripard wrote:
> On Tue, Nov 17, 2026 at 12:59:02PM -0800, Henry Zhang wrote:
> > The DSI encoder is embedded in struct vc4_dsi, which lives as long as
> > the DSI platform device
>
> That's not true.
>
> It's allocated with devm_drm_bridge_alloc() that will *not* free it in
> remove but give away its reference there.
>
> We have another reference taken in vc4_dsi_bind, that is only given up
> through a drm-managed action and thus will only be freed when the DRM
> device is destroyed.
You're right, thanks. struct vc4_dsi is refcounted through its bridge,
and the old DRM device keeps it alive. I'll fix that sentence. The
problem is not that struct vc4_dsi is freed too early, but that the
encoder embedded in it is used by two DRM devices at the same time.
> All vc4 components should be tied to the DRM device lifetime so that's
> not generally correct either. Something might have snuck back in though.
The encoder itself is DRM-managed: it is initialised with
drmm_encoder_init() and cleaned up when the DRM device is released.
But it is embedded in struct vc4_dsi, which outlives an unbind and is
shared by the next DRM device that binds the component. That part is
not tied to a single DRM device, since 6f0ca506c30e ("drm/vc4: dsi:
Switch to DRM-managed encoder initialization").
> Also, generally speaking, unloading panel drivers is unsupported at this
> point. It's a work in progress, but requires more changes to be safe.
Understood.
> This is surprising though. I'd like to see a detailed analysis of what's
> actually going on on mainline because it doesn't look right.
Maíra asked the same, so this answers both. It reproduces on
drm-misc-next (fb191ef62) on a Raspberry Pi 4, DSI1 in video mode, with
an out-of-tree DSI panel module and no downstream changes to vc4. The
compositor is stopped, a process holds /dev/dri/card1 open, the panel
module is unloaded and loaded again, then the held fd is closed:
1. Unloading the panel module detaches from the DSI host, which deletes
the DSI component and unbinds vc4. The held fd keeps the old DRM
device alive, with dsi->encoder still on its encoder list and the
DSI bridge still attached to it.
2. Loading it again binds a new DRM device. vc4_dsi_bind() calls
drmm_encoder_init() on the same dsi->encoder, which links it into
the new device's encoder list.
3. drm_bridge_attach() returns -EBUSY, as the bridge still belongs to
the old device, so the bind fails.
4. The failed bind releases the new DRM device. drm_encoder_cleanup()
unlinks dsi->encoder and clears it, but the old device's encoder
list still points to it.
5. Closing the held fd releases the old DRM device, which walks that
list: list corruption, the WARN in drmm_encoder_alloc_release() and
a NULL pointer dereference in drm_mode_config_cleanup().
Kprobes on drmm_encoder_init(), drm_bridge_attach() and
drm_encoder_cleanup() show it (condensed below). The old DRM device is
ffff000049249000, the new one ffff000041a79000, dsi->encoder is
ffff000044138000 and dsi->bridge ffff0000441380f0:
223.656483 drmm_encoder_init drm=ffff000041a79000 enc=ffff000044138000
223.656520 drm_bridge_attach enc=ffff000044138000 br=ffff0000441380f0
223.656529 drm_bridge_attach returned -16
223.715147 drm_encoder_cleanup enc=ffff000044138000 dev=ffff000041a79000
(held fd closed)
233.848952 drm_encoder_cleanup enc=ffff0000409cca58 dev=ffff000049249000
and the first list_del report shows the cleared dsi->encoder.head
(ffff000044138008) still linked in the old device's list:
[ 233.849039] list_del corruption. prev->next should be ffff0000409cca60, but was 0000000000000000. (prev=ffff000044138008)
[ 233.849099] WARNING: lib/list_debug.c:62 at __list_del_entry_valid_or_report+0x128/0x160, CPU#0: python3/2080
[ 233.849394] CPU: 0 UID: 0 PID: 2080 Comm: python3 Tainted: G C O 7.4.0-rc2-dmn-test+ #1 PREEMPT(full)
[ 233.849424] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[ 233.849448] pc : __list_del_entry_valid_or_report+0x128/0x160
[ 233.849465] lr : __list_del_entry_valid_or_report+0x128/0x160
[ 233.849734] Call trace:
[ 233.849744] __list_del_entry_valid_or_report+0x128/0x160 (P)
[ 233.849764] drm_encoder_cleanup+0xcc/0x150 [drm]
[ 233.849950] drmm_encoder_alloc_release+0x24/0x40 [drm]
[ 233.850090] drm_managed_release+0xb0/0x178 [drm]
[ 233.850231] drm_dev_put.part.0+0x98/0xd0 [drm]
[ 233.850371] drm_minor_release+0x20/0x50 [drm]
[ 233.850511] drm_release+0x110/0x148 [drm]
[ 233.850651] __fput+0xd4/0x300
[ 233.850672] fput_close_sync+0x48/0x110
[ 233.850690] filp_close_sync+0x2c/0x48
[ 233.850706] put_files_struct+0xd4/0x148
[ 233.850723] exit_files+0x4c/0x70
[ 233.850738] do_exit+0x25c/0xa20
[ 233.850756] do_group_exit+0x3c/0xa0
[ 233.850772] get_signal+0x920/0xa18
[ 233.850791] arch_do_signal_or_restart+0xa0/0x3f8
[ 233.850808] exit_to_user_mode_loop+0x100/0x188
[ 233.850825] el0_svc+0x1cc/0x1d0
[ 233.850845] el0t_64_sync_handler+0xa0/0xe8
[ 233.850864] el0t_64_sync+0x198/0x1a0
[ 233.850879] ---[ end trace 0000000000000000 ]---
[ 233.869067] WARNING: drivers/gpu/drm/drm_encoder.c:228 at drmm_encoder_alloc_release+0x30/0x40 [drm], CPU#0: python3/2080
[ 233.869478] CPU: 0 UID: 0 PID: 2080 Comm: python3 Tainted: G WC O 7.4.0-rc2-dmn-test+ #1 PREEMPT(full)
[ 233.869506] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[ 233.869529] pc : drmm_encoder_alloc_release+0x30/0x40 [drm]
[ 233.869668] lr : drm_managed_release+0xb0/0x178 [drm]
[ 233.870051] Call trace:
[ 233.870059] drmm_encoder_alloc_release+0x30/0x40 [drm] (P)
[ 233.870201] drm_dev_put.part.0+0x98/0xd0 [drm]
[ 233.870340] drm_minor_release+0x20/0x50 [drm]
[ 233.870479] drm_release+0x110/0x148 [drm]
[ 233.870619] __fput+0xd4/0x300
[ 233.870639] fput_close_sync+0x48/0x110
[ 233.870657] filp_close_sync+0x2c/0x48
[ 233.870672] put_files_struct+0xd4/0x148
[ 233.870688] exit_files+0x4c/0x70
[ 233.870703] do_exit+0x25c/0xa20
[ 233.870721] do_group_exit+0x3c/0xa0
[ 233.870737] get_signal+0x920/0xa18
[ 233.870755] arch_do_signal_or_restart+0xa0/0x3f8
[ 233.870772] exit_to_user_mode_loop+0x100/0x188
[ 233.870787] el0_svc+0x1cc/0x1d0
[ 233.870807] el0t_64_sync_handler+0xa0/0xe8
[ 233.870825] el0t_64_sync+0x198/0x1a0
[ 233.870839] ---[ end trace 0000000000000000 ]---
[two more list_del corruption reports with the same call trace cut]
[ 233.875117] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
[ 233.875331] Internal error: Oops: 0000000096000004 [#1] SMP
[ 233.875631] CPU: 0 UID: 0 PID: 2080 Comm: python3 Tainted: G WC O 7.4.0-rc2-dmn-test+ #1 PREEMPT(full)
[ 233.875679] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[ 233.875717] pc : drm_mode_config_cleanup+0x58/0x320 [drm]
[ 233.875875] lr : drm_mode_config_init_release+0x18/0x30 [drm]
[ 233.876371] Call trace:
[ 233.876383] drm_mode_config_cleanup+0x58/0x320 [drm] (P)
[ 233.876539] drm_mode_config_init_release+0x18/0x30 [drm]
[ 233.876692] drm_managed_release+0xb0/0x178 [drm]
[ 233.876842] drm_dev_put.part.0+0x98/0xd0 [drm]
[ 233.876998] drm_minor_release+0x20/0x50 [drm]
[ 233.877149] drm_release+0x110/0x148 [drm]
[ 233.877299] __fput+0xd4/0x300
[ 233.877330] fput_close_sync+0x48/0x110
[ 233.877355] filp_close_sync+0x2c/0x48
[ 233.877377] put_files_struct+0xd4/0x148
[ 233.877400] exit_files+0x4c/0x70
[ 233.877422] do_exit+0x25c/0xa20
[ 233.877446] do_group_exit+0x3c/0xa0
[ 233.877469] get_signal+0x920/0xa18
[ 233.877494] arch_do_signal_or_restart+0xa0/0x3f8
[ 233.877519] exit_to_user_mode_loop+0x100/0x188
[ 233.877542] el0_svc+0x1cc/0x1d0
[ 233.877567] el0t_64_sync_handler+0xa0/0xe8
[ 233.877593] el0t_64_sync+0x198/0x1a0
[ 233.877620] Code: eb0102bf 54000160 d1002294 f9404001 (f9400421)
[ 233.877643] ---[ end trace 0000000000000000 ]---
Additional sanitized trace excerpts are available on request.
With the patch, the same test on the same kernel still fails the bind
with -EBUSY, but closing the held fd gives no warning or oops, and
loading the panel module again afterwards brings the display back. This
was one focused run per build, not a stress test, and the patch does
not make the rebind succeed while the old device holds the bridge.
Would you prefer a v2 with the corrected description and the mainline
trace, or should this go with the panel unloading work?
Thanks,
Henry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-18 17:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 20:59 [PATCH] drm/vc4: dsi: Allocate the encoder per DRM device Henry Zhang
2026-11-18 10:09 ` Maxime Ripard
2026-11-18 17:48 ` Henry Zhang
2026-11-18 14:00 ` Maíra Canal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®