From: sashiko-bot@kernel.org
To: "Johan Jonker" <jbx6244@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/rockchip: rk3066_hdmi: convert to devm_drm_bridge_alloc() API
Date: Fri, 04 Sep 2026 10:27:38 +0000 [thread overview]
Message-ID: <20260904102738.BD8EA1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260904-drm-v3-1-5b36532a3b72@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Lifecycle mismatch: devm_* APIs used in component bind callback cause severe resource leaks, re-bind failures, and system hangs on unbind.
--
commit 55f99b0dc1074955624c3dfcd17a773dd54e5b91
Author: Hüseyin BIYIK <boogiepop@gmx.com>
Subject: drm/rockchip: rk3066_hdmi: convert to devm_drm_bridge_alloc() API
This commit converts the rk3066_hdmi driver to use the devm_drm_bridge_alloc()
API. This aligns the driver with the new standard for allocating DRM bridges
that was introduced during the initial bridge API conversion.
> diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
> index f28d6a883e099..05dbbcc6f7b03 100644
> --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
[ ... ]
> @@ -747,9 +745,10 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
> int irq;
> int ret;
>
> - hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
> - if (!hdmi)
> - return -ENOMEM;
> + hdmi = devm_drm_bridge_alloc(dev, struct rk3066_hdmi, bridge,
> + &rk3066_hdmi_bridge_funcs);
> + if (IS_ERR(hdmi))
> + return PTR_ERR(hdmi);
[Severity: High]
This is a pre-existing issue, but is it safe to use device-managed APIs
like devm_drm_bridge_alloc() inside a component bind callback like
rk3066_hdmi_bind()?
Device-managed resources are tied to the platform device's probe and remove
lifecycle, not the component bind and unbind lifecycle. When
rk3066_hdmi_unbind() is called (e.g., during master deferred probe or driver
unload), the platform device isn't removed, so the devm allocations are not
released.
If the component is bound again, allocations will fail. For example,
devm_platform_ioremap_resource() will return -EBUSY because the memory
region is already claimed, completely breaking deferred probing.
Could this also cause a system hang on unbind? Since rk3066_hdmi_unbind()
calls clk_disable_unprepare() but the interrupt remains active via
devm_request_threaded_irq(), an HDMI hotplug event occurring after unbind
triggers rk3066_hdmi_hardirq(). Accessing unclocked registers there will
synchronously hang the system.
>
> hdmi->dev = dev;
> hdmi->drm_dev = drm;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-drm-v3-1-5b36532a3b72@gmail.com?part=1
prev parent reply other threads:[~2026-09-04 10:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 10:17 [PATCH v3] drm/rockchip: rk3066_hdmi: convert to devm_drm_bridge_alloc() API Johan Jonker via B4 Relay
2026-09-04 10:17 ` Johan Jonker
2026-09-04 10:17 ` Johan Jonker via B4 Relay
2026-09-04 10:27 ` sashiko-bot [this message]
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=20260904102738.BD8EA1F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jbx6244@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.