All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Suraj Kandpal" <suraj.kandpal@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 12/15] drm/i915/dp: Apply link training fallback to the whole tile group
Date: Thu, 26 Nov 2026 07:06:05 +0000	[thread overview]
Message-ID: <sashiko-outbox-234928@kernel.org> (raw)
In-Reply-To: <20261126063459.863698-13-suraj.kandpal@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: unsynchronized peer link_caps access in
  intel_dp_tile_group_fallback()
--

commit 68cc58bbaafcfb065f2593125e09f6bebc6846cc
Author: Suraj Kandpal <suraj.kandpal@intel.com>

drm/i915/dp: Apply link training fallback to the whole tile group

This commit applies the reduced link limits of a pipelock-capable tiled
connector that fails link training to the other connectors in its tile
group.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> index ac1aff6edf052..d19f8d9b2c604 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
[ ... ]
> @@ -1976,6 +1977,37 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
>  	return err;
>  }
>  
> +static void intel_dp_tile_group_fallback(struct intel_dp *intel_dp)
> +{
> +	struct intel_display *display = to_intel_display(intel_dp);
> +	struct intel_connector *connector = intel_dp->attached_connector;
> +	struct intel_dp_link_config max_link_limits;
> +	struct drm_connector_list_iter conn_iter;
> +	struct intel_connector *iter;
> +
> +	if (!intel_pipelock_connector_possible(connector))
> +		return;
> +
> +	intel_dp_link_caps_get_max_limits(intel_dp->link.caps, &max_link_limits);
> +
> +	drm_connector_list_iter_begin(display->drm, &conn_iter);
> +	for_each_intel_connector_iter(iter, &conn_iter) {
> +		struct intel_dp *iter_dp;
> +
> +		if (iter == connector || !intel_pipelock_connector_possible(iter) ||
> +		    iter->base.tile_group != connector->base.tile_group)
> +			continue;
> +
> +		iter_dp = intel_attached_dp(iter);
> +
> +		if (!intel_dp_link_caps_set_max_limits(iter_dp->link.caps, &max_link_limits))
> +			drm_dbg_kms(display->drm,
> +				    "[CONNECTOR:%d:%s] Can't limit link to match tile group\n",
> +				    iter->base.base.id, iter->base.name);
> +	}
> +	drm_connector_list_iter_end(&conn_iter);
> +}

[Severity: Medium]
Can walking the device-wide connector list here race with concurrent
updates to iter_dp->link.caps on a sibling connector?

intel_dp_tile_group_fallback() runs during the atomic commit tail, which
executes asynchronously on display->wq.modeset for nonblocking commits
without holding mode_config.connection_mutex.  Other paths that modify a
connector's link.caps hold connection_mutex and serialize against
in-flight commits by calling intel_dp_flush_connector_commits(), which
waits only on that connector's conn_state->commit->hw_done:

drivers/gpu/drm/i915/display/intel_dp.c:wait_for_connector_hw_done() {
	...
	if (!conn_state->commit)
		return;

	drm_WARN_ON(display->drm,
		    !wait_for_completion_timeout(&conn_state->commit->hw_done,
						 msecs_to_jiffies(5000)));
}

If a sibling connector iter was not added to the current
intel_atomic_state (for instance, when connector's pipe is added to a
modeset after drm_atomic_helper_check_modeset()),
drm_atomic_helper_setup_commit() does not bind iter->base.state->commit to
this commit.  A concurrent hotplug or probe on iter then returns from
intel_dp_flush_connector_commits(iter) without waiting for this commit
tail to finish:

CPU0 (display->wq.modeset)        CPU1 (probe / hotplug on iter)
intel_atomic_commit_tail(state)
  ...
  intel_dp_tile_group_fallback()
                                  lock(&connection_mutex)
                                  intel_dp_detect(iter)
                                    intel_dp_flush_connector_commits(iter)
                                      /* iter->base.state->commit
                                       * is not this commit */
                                    intel_dp_link_caps_update(iter_dp->...)
                                      sort_r(link_caps->configs, ...)
    intel_dp_link_caps_set_max_limits(
      iter_dp->link.caps, ...)
      max_link_limits_valid()  <-- data race on configs[] / rate_lane_map[]

Iterating over the connectors in the current intel_atomic_state (passed
down from intel_dp_schedule_fallback_link_training()) would restrict this
update to connectors whose conn_state->commit is bound to the running
commit.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126063459.863698-1-suraj.kandpal@intel.com?part=12

  reply	other threads:[~2026-11-26  7:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  6:34 [PATCH 00/15] drm/i915/display: Sync tiled displays with pipelock Suraj Kandpal
2026-11-26  6:34 ` [PATCH 01/15] drm/i915/display: Rename port sync master/slave to primary/secondary Suraj Kandpal
2026-11-26  6:43   ` sashiko-bot
2026-11-26  6:34 ` [PATCH 02/15] drm/i915/display: Add HAS_PIPELOCK() Suraj Kandpal
2026-11-26  6:34 ` [PATCH 03/15] drm/i915/display: Add pipelock bits to TRANS_DDI_FUNC_CTL2 Suraj Kandpal
2026-11-26  8:45   ` Jani Nikula
2026-11-26  6:34 ` [PATCH 04/15] drm/i915/ddi: Program pipelock in TRANS_DDI_FUNC_CTL2 Suraj Kandpal
2026-11-26  6:34 ` [PATCH 05/15] drm/i915/ddi: Don't hold the DP link in idle with pipelock Suraj Kandpal
2026-11-26  6:34 ` [PATCH 06/15] drm/i915/display: Enable the pipelock primary before its secondaries Suraj Kandpal
2026-11-26  6:34 ` [PATCH 07/15] drm/i915/display: Read out and verify pipelock state Suraj Kandpal
2026-11-26  6:34 ` [PATCH 08/15] drm/i915/pipelock: Keep SSC, PSR and CMRR off on pipelock tiles Suraj Kandpal
2026-11-26  8:52   ` Jani Nikula
2026-11-26  9:14     ` Kandpal, Suraj
2026-11-26  6:34 ` [PATCH 09/15] drm/i915/pipelock: Compute pipelock groups for DP tiled displays Suraj Kandpal
2026-11-26  8:56   ` Jani Nikula
2026-11-26  9:16     ` Kandpal, Suraj
2026-11-26  6:34 ` [PATCH 10/15] drm/i915/vrr: Split out setting the guardband Suraj Kandpal
2026-11-26  6:44   ` sashiko-bot
2026-11-26  8:58   ` Jani Nikula
2026-11-26  9:17     ` Kandpal, Suraj
2026-11-26  6:34 ` [PATCH 11/15] drm/i915/pipelock: Equalize the guardband across a pipelock group Suraj Kandpal
2026-11-26  6:49   ` sashiko-bot
2026-11-27  5:14     ` Kandpal, Suraj
2026-11-26  6:34 ` [PATCH 12/15] drm/i915/dp: Apply link training fallback to the whole tile group Suraj Kandpal
2026-11-26  7:06   ` sashiko-bot [this message]
2026-11-26  6:34 ` [PATCH 13/15] drm/i915/display: Show transcoder sync state in i915_display_info Suraj Kandpal
2026-11-26  6:34 ` [PATCH 14/15] drm/i915/display: Use pipelock on PTL Suraj Kandpal
2026-11-26  6:54   ` sashiko-bot
2026-11-27  5:42     ` Kandpal, Suraj
2026-11-26  6:34 ` [PATCH 15/15] drm/i915/ddi: Disable port sync " Suraj Kandpal
2026-11-26  6:42 ` ✗ CI.checkpatch: warning for drm/i915/display: Sync tiled displays with pipelock Patchwork
2026-11-26  6:45 ` ✓ CI.KUnit: success " Patchwork
2026-11-26  7:26 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26  7:49 ` ✓ i915.CI.BAT: " Patchwork
2026-11-26 12:54 ` ✓ Xe.CI.FULL: " Patchwork

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-234928@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=suraj.kandpal@intel.com \
    /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.