Re: [PATCH v3] drm/ingenic: fix bridge allocation

From: H. Nikolaus Schaller

Date: Mon Aug 24 2026 - 06:10:55 EST


Hi Paul,

> Am 24.08.2026 um 11:56 schrieb Paul Cercueil <paul@xxxxxxxxxxxxxxx>:
>
> Hi Nikolaus,
>
> Le dimanche 23 août 2026 à 16:12 +0200, H. Nikolaus Schaller a écrit :
>> Bridge allocation API has changed and ingenic/drm was broken
>> leading to
>>
>> [ 54.997593] dw-hdmi-ingenic 10180000.hdmi: Detected HDMI \X
>> controller v1.31a with HDCP (DWC HDMI 3D TX PHY)
>> [ 55.491338] dw-hdmi-ingenic 10180000.hdmi: registered DesignWare
>> HDMI I2C bus driver
>> [ 55.899132] [drm] DRM bridge corrupted or not allocated by
>> devm_drm_bridge_alloc()
>> [ 55.904136] ------------[ cut here ]------------
>> [ 55.908753] WARNING: lib/refcount.c:25 at drm_bridge_get+0x58/0x6c
>> [drm], CPU#0: kworker/u4:2/36
>> [ 55.917538] refcount_t: addition on 0; use-after-free.
>> ...
>> [ 56.354928] [<c04898b8>] drm_bridge_attach+0x80/0x208 [drm]
>> ...
>>
>> Fixes: 9347f2fbb0183b0 ("drm/bridge: add warning for bridges using
>> neither devm_drm_bridge_alloc() nor drm_bridge_add()")
>> Tested-by: Waldemar Brodkorb <wbx@xxxxxxxxxxx> (on CI20 with HDMI)
>> Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
>> Cc: Waldemar Brodkorb <wbx@xxxxxxxxxxx>
>> Cc: stable@xxxxxxxxxxxxxxx
>> ---
>>
>> Notes:
>> v3: fixed a malformed diff
>>
>> v2: removed ib->bridge->ops = DRM_BRIDGE_OP_EDID |
>> DRM_BRIDGE_OP_DETECT as suggested by Sashiko-reviews
>>
>> https://sashiko.dev/#/patchset/400ba2fe0d4f76484e929d2efaa32f67a940163a.1787477392.git.hns@xxxxxxxxxxxxx?part=1
>>
>> drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 23 +++++++++++++++++++--
>> --
>> 1 file changed, 19 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>> b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>> index 42c86f195c66b3..8d7979a7859332 100644
>> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
>> @@ -122,7 +122,7 @@ struct ingenic_drm {
>>
>>
>> - ret = drm_bridge_attach(encoder, &ib->bridge, NULL,
>> + ib->bridge->interlace_allowed = true;
>
> That one line feels like it doesn't belong here, but in its own patch.

You are right, it is not a fix but adds a feature.

I'll send a v4 asap.

>
> Cheers,
> -Paul

BR,
Nikolaus