All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Arun R Murthy <arun.r.murthy@intel.com>, intel-gfx@lists.freedesktop.org
Cc: suraj.kandpal@intel.com, Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [PATCHv4] drm/i915/dp: On DPCD init wake the DPRx for eDP
Date: Mon, 07 Sep 2026 13:33:03 +0300	[thread overview]
Message-ID: <b7c948a346a6dd55894473296081bafda3ae6307@intel.com> (raw)
In-Reply-To: <20260907092707.1823088-1-arun.r.murthy@intel.com>

On Mon, 07 Sep 2026, Arun R Murthy <arun.r.murthy@intel.com> wrote:
> Its observed that on AUX_CH failure, even if the retry is increased to
> 1000, it does not succeed. Either the command might be wrong or sink in
> an unknown/sleep state can cause this. So try waking the sink device.
> Before reading the DPCD caps wake the sink for eDP.
>
> v2: Use poll_timeout_us (Jani N)
>     Add the reason, why this change is required (Ville)
> v3: Wake sink only for eDP
>     Remove the dpcd probe set to true/false in wake_sink (Imre)
> v4: make edp_wake_sinc() static and dpcd_readb -> dpcd_reab_byte (Suraj)
>
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4391
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16654
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 34 +++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0cd5e6b5034c..d4cc5f7e82a4 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 */

Where in the spec? What software overhead?

> +#define AUX_CH_WAKE_RETRY	6

There is no guarantee that this is tried 3 or 6 times. The timeout is a
timeout, not retry count.

> +
> +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
> +	 */

So this is now talking about 1 ms, but the timeout used is 6 ms.

> +	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);
> +
> +	/*
> +	 * 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) {

You need to switch the order here. Value may be garbage if 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);
> +	}
> +}
> +
>  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);
> +
>  	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);

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2026-09-07 10:33 UTC|newest]

Thread overview: 59+ 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:45 ` ✗ CI.checkpatch: warning for " Patchwork
2026-02-19 10:46 ` ✓ CI.KUnit: success " Patchwork
2026-02-19 10:48 ` ✓ i915.CI.BAT: " Patchwork
2026-02-19 11:22 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-19 14:20 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-19 14:36 ` ✗ i915.CI.Full: " 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  7:56 ` ✓ CI.KUnit: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev2) Patchwork
2026-02-24  9:02 ` ✓ i915.CI.BAT: " 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  6:19 ` ✓ CI.KUnit: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev3) Patchwork
2026-02-25  6:56 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-25  7:17 ` ✗ i915.CI.BAT: failure " Patchwork
2026-02-25 11:20 ` ✗ Xe.CI.FULL: " 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
2026-09-07 10:33   ` Jani Nikula [this message]
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
2026-09-15  4:23 ` [PATCHv6] drm/i915/dp: On DPCD init wake the DPRx for eDP Arun R Murthy
2026-09-15  4:32   ` sashiko-bot
2026-09-15  5:16     ` Murthy, Arun R
2026-09-15  5:46   ` Kandpal, Suraj
2026-09-15  6:20 ` ✓ i915.CI.BAT: success for drm/i915/dp: On DPCD init/caps wake the DPRx (rev7) Patchwork
2026-09-15 10:53 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-16  9:30 ` ✓ i915.CI.Full: success " 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=b7c948a346a6dd55894473296081bafda3ae6307@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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.