From: sashiko-bot@kernel.org
To: "Luo Liu" <Luo.Liu@cixtech.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 4/5] drm/bridge: trilinear: add the DPTX core and build glue
Date: Mon, 30 Nov 2026 02:36:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-240249@kernel.org> (raw)
In-Reply-To: <20261130022510.762141-5-Luo.Liu@cixtech.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/bridge: trilinear: dptx_deinit() race skips
aux_unregister() on detach
--
commit 00155c57bf2032aceb755ea1f307b341e22e5c42
Author: Luo Liu <Luo.Liu@cixtech.com>
drm/bridge: trilinear: add the DPTX core and build glue
This commit adds the core probe, power management, hotplug handling, and
stream state machine for the Trilinear DPTX bridge driver, along with Kconfig
and Makefile integration.
> diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_core.c b/drivers/gpu/drm/bridge/trilinear/dptx_core.c
> new file mode 100644
> index 0000000000000..87c21bb189f89
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/trilinear/dptx_core.c
[ ... ]
> +static void dptx_deinit(struct dptx_dev *dp)
> +{
> + struct device_link *link = NULL;
> +
> + scoped_guard(mutex, &dp->lock) {
> + if (!(dp->state & DPTX_STATE_CONFIGURED))
> + return;
> +
> + WRITE_ONCE(dp->hpd_stopped, true);
> + dp->released = true;
> + dptx_irq_off(dp);
> + }
> +
> + dptx_cancel_hpd_works(dp);
> +
> + scoped_guard(mutex, &dp->lock) {
> + dptx_stop_streams(dp);
> + dptx_host_deinit(dp);
> + dp->hw->ops->aux_unregister(dp->hw);
> + dp->state &= ~(DPTX_STATE_CONFIGURED);
> + link = dp->link;
> + dp->link = NULL;
> + }
> +
> + if (link)
> + device_link_del(link);
> +}
[Severity: Medium]
Can dptx_bridge_detach() return before dp->hw->aux is unregistered when it
races with dptx_deinit()?
dptx_bridge_detach() skips aux_unregister() when dp->released is set:
drivers/gpu/drm/bridge/trilinear/dptx_drm.c:dptx_bridge_detach() {
...
scoped_guard(mutex, &dp->lock) {
dp->attached = false;
if (!dp->released)
dp->hw->ops->aux_unregister(dp->hw);
...
}
Because dptx_deinit() sets dp->released in the first critical section and
drops dp->lock to cancel the HPD workers before calling aux_unregister() in
the second critical section, the two teardowns can interleave:
CPU0 CPU1
dptx_deinit() dptx_bridge_detach()
lock(&dp->lock) dptx_quiesce_hpd()
dp->released = true;
unlock(&dp->lock)
dptx_cancel_hpd_works()
lock(&dp->lock)
if (!dp->released) /* false */
unlock(&dp->lock)
/* drm_device teardown proceeds while
aux is still registered */
lock(&dp->lock)
...
dp->hw->ops->aux_unregister()
dptx_bridge_detach() then returns to drm_bridge_detach(), allowing DRM device
cleanup to free bridge->dev while dp->hw->aux is still registered and
dp->hw->aux.drm_dev still points to the DRM device. Moving dp->released =
true into the second critical section of dptx_deinit() (where aux_unregister()
runs under the same lock acquisition) avoids this window.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130022510.762141-1-Luo.Liu@cixtech.com?part=4
next prev parent reply other threads:[~2026-11-30 2:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 2:25 [PATCH v8 0/5] drm/bridge: trilinear: add the Sky1 DisplayPort transmitter Luo Liu
2026-11-30 2:25 ` [PATCH v8 1/5] dt-bindings: display: add CIX " Luo Liu
2026-11-30 2:25 ` [PATCH v8 2/5] drm/bridge: trilinear: add the DPTX hardware layer Luo Liu
2026-11-30 2:42 ` sashiko-bot
2026-11-30 2:25 ` [PATCH v8 3/5] drm/bridge: trilinear: add the DPTX DRM bridge Luo Liu
2026-11-30 2:25 ` [PATCH v8 4/5] drm/bridge: trilinear: add the DPTX core and build glue Luo Liu
2026-11-30 2:36 ` sashiko-bot [this message]
2026-11-30 2:25 ` [PATCH v8 5/5] drm/cix: add the Sky1 DisplayPort platform glue Luo Liu
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=sashiko-outbox-240249@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Luo.Liu@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox