Devicetree
 help / color / mirror / Atom feed
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 v7 4/5] drm/bridge: trilinear: add the DPTX core and build glue
Date: Fri, 27 Nov 2026 08:02:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-236854@kernel.org> (raw)
In-Reply-To: <20261127074639.277959-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 b7015f37668416cb2e6bc1550b44c2c5d2b795c6
Author: Luo Liu <Luo.Liu@cixtech.com>

drm/bridge: trilinear: add the DPTX core and build glue

This commit adds the Trilinear DPTX bridge core implementation, including
probe, power management, hotplug handling, and stream management, along
with Kconfig and Makefile build 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..ff80ba42a1140
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/trilinear/dptx_core.c

[ ... ]

> +static void dptx_deinit(struct dptx_dev *dp)
> +{
> +	struct device_link *link = NULL;
> +
> +	if (!(dp->state & DPTX_STATE_CONFIGURED))
> +		return;
> +
> +	scoped_guard(mutex, &dp->lock) {
> +		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 while dp->hw->aux is still registered if
it races with dptx_deinit()?

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);

		link = dp->link;
		dp->link = NULL;
	}
	...
}

Because the device link uses DL_FLAG_STATELESS, the bridge device and
the DRM consumer device can tear down concurrently:

CPU0                                  CPU1
dptx_deinit()                         dptx_bridge_detach()
  lock(&dp->lock)
  dp->released = true
  unlock(&dp->lock)
  dptx_cancel_hpd_works(dp)
                                        dptx_quiesce_hpd(dp)
                                        lock(&dp->lock)
                                        if (!dp->released) /* false */
                                        unlock(&dp->lock)
                                      /* DRM device teardown proceeds
                                         while dp->hw->aux is still
                                         registered with aux.drm_dev */
  lock(&dp->lock)
  dp->hw->ops->aux_unregister(dp->hw)

Also, dptx_deinit() checks dp->state & DPTX_STATE_CONFIGURED without
holding dp->lock, while other paths update dp->state with non-atomic
read-modify-write operations under dp->lock.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127074639.277959-1-Luo.Liu@cixtech.com?part=4

  reply	other threads:[~2026-11-27  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  7:46 [PATCH v7 0/5] drm/bridge: trilinear: add the Sky1 DisplayPort transmitter Luo Liu
2026-11-27  7:46 ` [PATCH v7 1/5] dt-bindings: display: add CIX " Luo Liu
2026-11-27  7:46 ` [PATCH v7 2/5] drm/bridge: trilinear: add the DPTX hardware layer Luo Liu
2026-11-27  8:05   ` sashiko-bot
2026-11-27  7:46 ` [PATCH v7 3/5] drm/bridge: trilinear: add the DPTX DRM bridge Luo Liu
2026-11-27  8:06   ` sashiko-bot
2026-11-27  7:46 ` [PATCH v7 4/5] drm/bridge: trilinear: add the DPTX core and build glue Luo Liu
2026-11-27  8:02   ` sashiko-bot [this message]
2026-11-27  7:46 ` [PATCH v7 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-236854@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