Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arun R Murthy" <arun.r.murthy@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCHv4] drm/i915/dp: On DPCD init wake the DPRx for eDP
Date: Mon, 07 Sep 2026 09:40:05 +0000	[thread overview]
Message-ID: <20260907094005.CC7911F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907092707.1823088-1-arun.r.murthy@intel.com>

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
- [High] The wake function is called after reading DPCD caps, entirely defeating the patch's purpose.
- [High] Ineffective polling loop in `poll_timeout_us` due to internal `drm_dp_dpcd_read_byte` timeouts exceeding the requested polling timeout.
- [Medium] Missing DPCD revision check before accessing the DP_SET_POWER register.
- [Medium] Unconditional write of DP_SET_POWER_D3_AUX_ON (0x5) is unsafe for eDP 1.1 panels.
- [Medium] The `poll_timeout_us` macro expands such that `ret` is modified inside the expression and overwritten by the return value, obfuscating errors.
- [Medium] The use of `true` for `sleep_before_op` unconditionally forces a 1ms delay on every eDP initialization.
--

commit fdfc8b88675078b318b600613848f0873f293de0
Author: Arun R Murthy <arun.r.murthy@intel.com>
drm/i915/dp: On DPCD init wake the DPRx for eDP

This commit attempts to fix AUX channel failures by waking up the sink
device for eDP connections. It introduces a wake sequence that is
called right before reading the DPCD capabilities.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4391
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16654

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0cd5e6b5034cf..d4cc5f7e82a49 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4779,6 +4779,38 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
>  	intel_edp_set_data_override_rates(intel_dp);
>  }
>  
> +/* Spec says to try for 3 times, its doubled to add the software overhead */
> +#define AUX_CH_WAKE_RETRY	6
> +
> +static void intel_edp_wake_sink(struct intel_dp *intel_dp)
> +{
> +	u8 value = 0;
> +	int ret = 0;
> +
> +	/*
> +	 * Wake the sink device
> +	 * Spec DP2.1 section 2.3.1.2 if AUX CH is powered down by writing 0x02
> +	 * to DP_SET_POWER dpcd reg, 1ms time would be required to wake it up
> +	 */
> +	ret = poll_timeout_us(ret = drm_dp_dpcd_read_byte(&intel_dp->aux,
> +							  DP_SET_POWER, &value),
> +			      ret == 0, 1000, AUX_CH_WAKE_RETRY * 1000, true);

[Severity: High]
Will this polling loop actually run more than once?

The poll_timeout_us() macro is given a 6ms timeout. However,
drm_dp_dpcd_read_byte() internally retries for 16ms.

Doesn't this mean the macro's timeout will expire during the very first
read attempt, unconditionally terminating the loop prematurely?

[Severity: Medium]
Does the ret = poll_timeout_us(ret = ...) assignment clobber the actual
error codes?

Since the macro expands and evaluates the inner expression, it looks
like it overwrites the internal hardware error (like -EIO) with
-ETIMEDOUT, which could hide the true failure reason.

[Severity: Medium]
Does passing true for sleep_before_op force an unconditional 1ms delay
on every eDP initialization?

It seems this sleep happens on the hot path before any wake command has
actually been issued to the hardware.

[Severity: Medium]
Is it safe to unconditionally read the DP_SET_POWER register here
without verifying panel capabilities first?

For DPCD 1.0 panels, polling an unsupported register might trigger
guaranteed NAKs and timeout delays.

> +
> +	/*
> +	 * If sink is in D3 then it may not respond to the AUX tx so
> +	 * wake it up to D3_AUX_ON state
> +	 * If the above poll_timeout_us fails, try waking the sink.
> +	 */
> +	if (value == DP_SET_POWER_D3 || ret < 0) {
> +		/* After setting to D0 need a min of 1ms to wake (Spec DP2.1 sec 2.3.1.2) */
> +		drm_dp_dpcd_write_byte(&intel_dp->aux, DP_SET_POWER,
> +				       DP_SET_POWER_D0);
> +		fsleep(1000);
> +		drm_dp_dpcd_write_byte(&intel_dp->aux, DP_SET_POWER,
> +				       DP_SET_POWER_D3_AUX_ON);

[Severity: Medium]
Is it safe to write DP_SET_POWER_D3_AUX_ON (0x5) unconditionally to
older hardware?

For eDP 1.1 panels where 0x5 is a reserved value, could this force a
compliance violation and cause a potential link drop?

> +	}
> +}
> +
>  static bool
>  intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector)
>  {
> @@ -4792,6 +4824,8 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector
>  	if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd) != 0)
>  		return false;
>  
> +	intel_edp_wake_sink(intel_dp);

[Severity: High]
Is intel_edp_wake_sink() unreachable if the sink is actually asleep?

If the sink is asleep, it seems like drm_dp_read_dpcd_caps() would
fail and immediately return false, completely bypassing the new wake
function.

Could this abort initialization and leave the display broken, defeating
the purpose of the patch?

> +
>  	drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
>  			 drm_dp_is_branch(intel_dp->dpcd));
>  	intel_init_dpcd_quirks(intel_dp, &intel_dp->desc.ident);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907092707.1823088-1-arun.r.murthy@intel.com?part=1

  parent reply	other threads:[~2026-09-07  9:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  9:43 [PATCH] drm/i915/dp: On DPCD init/caps wake the DPRx Arun R Murthy
2026-02-19 10:48 ` ✓ i915.CI.BAT: success for " Patchwork
2026-02-19 14:36 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-19 14:53 ` [PATCH] " Ville Syrjälä
2026-02-19 15:12   ` Murthy, Arun R
2026-02-20  3:11     ` Ville Syrjälä
2026-02-20  5:01       ` Murthy, Arun R
2026-02-24  8:24         ` Ville Syrjälä
2026-02-24  8:48           ` Murthy, Arun R
2026-02-24  7:48 ` [PATCHv2] " Arun R Murthy
2026-02-24 14:50   ` Imre Deak
2026-02-25  3:33     ` Murthy, Arun R
2026-02-25  5:58       ` Murthy, Arun R
2026-03-02  7:57       ` Imre Deak
2026-03-02  9:04         ` Murthy, Arun R
2026-03-02  9:20           ` Imre Deak
2026-03-10  8:52             ` Murthy, Arun R
2026-02-24  9:02 ` ✓ i915.CI.BAT: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev2) Patchwork
2026-02-24 10:50 ` ✓ i915.CI.Full: " Patchwork
2026-02-25  6:11 ` [PATCHv3] drm/i915/dp: On DPCD init wake the DPRx for eDP Arun R Murthy
2026-08-05  9:58   ` Murthy, Arun R
2026-08-11 12:17     ` Kandpal, Suraj
2026-09-07  9:00       ` Murthy, Arun R
2026-09-07  9:04         ` Kandpal, Suraj
2026-09-07  9:06           ` Murthy, Arun R
2026-02-25  7:17 ` ✗ i915.CI.BAT: failure for drm/i915/dp: On DPCD init/caps wake the DPRx (rev3) Patchwork
2026-08-05 10:06 ` ✗ Fi.CI.BUILD: failure for drm/i915/dp: On DPCD init/caps wake the DPRx (rev4) Patchwork
2026-09-07  9:27 ` [PATCHv4] drm/i915/dp: On DPCD init wake the DPRx for eDP Arun R Murthy
2026-09-07  9:37   ` Kandpal, Suraj
2026-09-08  3:54     ` Murthy, Arun R
2026-09-08  4:13       ` Kandpal, Suraj
2026-09-07  9:40   ` sashiko-bot [this message]
2026-09-07 10:33   ` Jani Nikula
2026-09-08  4:36     ` Murthy, Arun R
2026-09-07 12:17 ` ✓ i915.CI.BAT: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev5) Patchwork
2026-09-07 19:37 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-08 16:12 ` [PATCHv5] drm/i915/dp: On DPCD init wake the DPRx for eDP Arun R Murthy
2026-09-08 16:25   ` sashiko-bot
2026-09-08 17:33 ` ✓ i915.CI.BAT: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev6) Patchwork
2026-09-09  9:27 ` ✗ i915.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-09-07 20:53 [PATCHv4] drm/i915/dp: On DPCD init wake the DPRx for eDP Metrical revel
2026-09-08  3:20 ` Murthy, Arun R
2026-09-10  4:43   ` Metrical revel
2026-09-10  7:14     ` Murthy, Arun R

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=20260907094005.CC7911F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.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