Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mika Kahola" <mika.kahola@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 6/6] drm/i915/display: Allow forcing the joiner on eDP
Date: Mon, 12 Oct 2026 12:52:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-168129@kernel.org> (raw)
In-Reply-To: <20261012124145.1960050-7-mika.kahola@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] drm/i915: data race on connector->force_joined_pipes via debugfs
--

commit 45be7b5e2e6fcbea23658dd271134587c4797f89
Author: Mika Kahola <mika.kahola@intel.com>

drm/i915/display: Allow forcing the joiner on eDP

intel_dp_has_joiner() rejects eDP unless the VBT enables the pipe
joiner, and the debugfs file is only created when that returns true, so
i915_joiner_force_enable can never turn it on.

Always create the file for DP and eDP, and let a forced pipe count
above one override the VBT.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index d8c0d9381471d..ec0b4885e33ac 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c

[ ... ]

> @@ -473,9 +473,15 @@ bool intel_dp_has_joiner(struct intel_dp *intel_dp)
>  	if (intel_dp->mso_link_count)
>  		return false;
>  
> -	if (intel_dp_is_edp(intel_dp) &&
> -	    !connector->panel.vbt.edp.pipe_joiner_enable)
> -		return false;
> +	if (intel_dp_is_edp(intel_dp)) {
> +		bool pipe_joiner_enable = connector->panel.vbt.edp.pipe_joiner_enable;
> +
> +		if (connector->force_joined_pipes > 1)

[Severity: Low]
Does this code introduce a data race with debugfs?

The debugfs handler i915_joiner_write() locklessly modifies
connector->force_joined_pipes:

drivers/gpu/drm/i915/display/intel_display_debugfs.c:i915_joiner_write() {
    ...
    connector->force_joined_pipes = force_joined_pipes;
    ...
}

Meanwhile, this read in intel_dp_has_joiner() during an atomic modeset
happens without holding any lock shared with the debugfs write path.

This problem wasn't introduced by this patch, but this commit expands a
similar pattern found in intel_dp_joiner_candidate_valid(), where a
double-read can cause a TOCTOU flaw if the compiler reloads the value
between reads:

drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_joiner_candidate_valid() {
    ...
    if (connector->force_joined_pipes && connector->force_joined_pipes != num_joined_pipes)
        return false;
    ...
}

Could a lock or READ_ONCE() and WRITE_ONCE() annotations be added to
safely serialize or annotate these accesses?

> +			pipe_joiner_enable = true;
> +
> +		if (!pipe_joiner_enable)
> +			return false;
> +	}
>  
>  	return DISPLAY_VER(display) >= 12 ||
>  		(DISPLAY_VER(display) == 11 &&

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261012124145.1960050-1-mika.kahola@intel.com?part=6

  reply	other threads:[~2026-10-12 12:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 12:41 [PATCH v2 0/6] drm/i915/psr: Panel Replay and PSR2 with the joiner Mika Kahola
2026-10-12 12:41 ` [PATCH v2 1/6] drm/i915/psr: Track all joined pipes for frontbuffer tracking Mika Kahola
2026-10-12 12:41 ` [PATCH v2 2/6] drm/i915/psr: Exclude the joiner secondary from active_non_psr_pipes Mika Kahola
2026-10-12 12:41 ` [PATCH v2 3/6] drm/i915/psr: Take the selective fetch area from pipe_mode Mika Kahola
2026-10-12 12:41 ` [PATCH v2 4/6] drm/i915/psr: Merge the selective fetch area across joined pipes Mika Kahola
2026-10-12 12:56   ` sashiko-bot
2026-10-13 11:07   ` [PATCH v3 " Mika Kahola
2026-10-13 11:16     ` Mika Kahola
2026-10-12 12:41 ` [PATCH v2 5/6] drm/i915/psr: Allow Panel Replay and PSR2 with joiner Mika Kahola
2026-10-12 12:41 ` [PATCH v2 6/6] drm/i915/display: Allow forcing the joiner on eDP Mika Kahola
2026-10-12 12:52   ` sashiko-bot [this message]
2026-10-12 14:35 ` ✓ i915.CI.BAT: success for drm/i915/psr: Panel Replay and PSR2 with the joiner Patchwork
2026-10-12 17:25 ` ✗ i915.CI.Full: failure " Patchwork
2026-10-13 12:08 ` ✓ i915.CI.BAT: success for drm/i915/psr: Panel Replay and PSR2 with the joiner (rev3) Patchwork
2026-10-13 14:09 ` ✗ i915.CI.Full: failure " 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-168129@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mika.kahola@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox