Hello Luca,
Thank you very much for your review and suggestions.
> -----邮件原件-----
> 发件人: Luca Ceresoli <[email protected]>
> 发送时间: 2026年12月1日 1:30
> 收件人: Luo Liu <[email protected]>
> 抄送: Maarten Lankhorst <[email protected]>; Maxime
> Ripard <[email protected]>; Thomas Zimmermann
> <[email protected]>; Liviu Dudau <[email protected]>; Russell King
> <[email protected]>; [email protected]; Ayan Halder
> <[email protected]>; Andrzej Hajda <[email protected]>; Neil
> Armstrong <[email protected]>; Robert Foss <[email protected]>;
> Laurent Pinchart <[email protected]>; Jonas Karlman
> <[email protected]>; Jernej Skrabec <[email protected]>; Kory
> Maincent <[email protected]>; Luca Ceresoli
> <[email protected]>; David Airlie <[email protected]>; Simona Vetter
> <[email protected]>; [email protected]; cix-kernel-upstream
> <[email protected]>; Wuyi Shen (沈武义)
> <[email protected]>
> 主题: Re: [PATCH v5 2/2] drm/komeda: Use drmm_mode_config_init()
>
> [Some people who received this message don't often get email from
> [email protected]. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
>
> EXTERNAL EMAIL
>
> > drm_bridge_connector_init() creates the connector with
> > drmm_connector_init(), which does not allow a ->destroy hook and
> > registers its own cleanup action instead. Calling
> > drm_mode_config_cleanup() explicitly drops the connector's last
> > reference, so drm_connector_free() ends up calling a NULL ->destroy
> > pointer. That happens on the
> > komeda_kms_attach() error paths, and on unbind as soon as no other
> > component holds a connector reference.
> >
> > Let DRM release the mode configuration: switch to
> > drmm_mode_config_init() and drop the explicit
> > drm_mode_config_cleanup() calls. The managed cleanup is registered
> > before the connectors are created, so it runs after the connector cleanup
> actions and finds an empty connector list.
> >
> > The mode configuration teardown now happens after komeda_kms_detach()
> > has returned, so komeda can no longer rely on
> > drm_mode_config_cleanup() detaching the encoders' bridges before
> > komeda_kms_cleanup_private_objs() walks mode_config.privobj_list - the
> > bridges are private objects there as well, and finalizing them a
> > second time when the encoders are cleaned up would corrupt the list
> > and free their state twice. Since the komeda private objects belong to
> > the pipeline components, finalize them by walking the pipelines instead of
> > the
> shared list.
> >
> > Signed-off-by: Luo Liu <[email protected]>
>
> Based on your description, it looks like patch 1 breaks something and this
> patch
> fixes it. Shouldn't the two patches be swapped, with this one first as a
> preparation step before switching to the bridge connector?
>
> Also, this patch does not apply due to a trivial conflict. Please ensure you
> rebase
> on top of drm-misc/drm-misc-next before sending feature patches.
>
> Otherwise looks OK.
Sorry for the conflict, I will rebase on drm-misc/drm-misc-next, and I will
also swap the first two patches as
you suggested. Patch 2 will be reworded as a preparation for the connector
switch, so it no longer reads as a
fix for a problem it introduces.
Best regards,
Luo
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
本邮件及其附件包含CIX公司的保密信息,受法律保护,仅供本邮件指定的收件人查阅。严禁任何未经授权的使用、传播、分发或复制本邮件及其任何内容。此限制适用于指定收件人以外的所有人员,包括未经明确授权处理此类信息的CIX公司员工或代理人。若您误收本邮件,请立即通知发件人,并永久删除邮件及所有附件。互联网传输无法保证及时性、安全性、完整性和无病毒性,CIX公司对任何传输错误或遗漏概不承担责任。