Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Arthur J Runyan <arthur.j.runyan@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/adlp: Fix register corruption after DDI clock enabling
Date: Fri, 25 Mar 2022 22:46:33 +0200	[thread overview]
Message-ID: <Yj4qKcD760V27Gbq@intel.com> (raw)
In-Reply-To: <20220323201749.288566-1-imre.deak@intel.com>

On Wed, Mar 23, 2022 at 10:17:49PM +0200, Imre Deak wrote:
> Accessing the DDI_BUF_CTL register without the port's DDI clock being
> enabled (to set/clear the TypeC PHY ownership for the port) can lead to
> a corrupted value read during any i915 register access right after the
> DDI clock is enabled.
> 
> The root cause is the way clock synchronization works for this register,
> controlled by the CHICKEN_DCPR_1 DDI_CLOCK_REG_ACCESS flag. Correctly
> this flag should be cleared on ADLP (see the Bspec link below), however
> after bootup the flag is set.
> 
> One easily reproducible issue is an unclaimed register access of the
> PWR_WELL_CTL_DDI2 register, programmed right after DDI clock enabling to
> enable the port's DDI_IO power well (see the HSDES, VLK links below).
> With the correct setting above this problem can't be reproduced.
> 
> Bspec: 49189
> HSDES: 18019028154
> VLK: 28328, 28655
> 
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Cc: Arthur J Runyan <arthur.j.runyan@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_reg.h | 1 +
>  drivers/gpu/drm/i915/intel_pm.c | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index a0d652f19ff93..d83bd7a75c788 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -5939,6 +5939,7 @@
>  #define   ICL_DELAY_PMRSP			REG_BIT(22)
>  #define   DISABLE_FLR_SRC			REG_BIT(15)
>  #define   MASK_WAKEMEM				REG_BIT(13)
> +#define   DDI_CLOCK_REG_ACCESS			REG_BIT(7)
>  
>  #define GEN11_CHICKEN_DCPR_2			_MMIO(0x46434)
>  #define   DCPR_MASK_MAXLATENCY_MEMUP_CLR	REG_BIT(27)
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 2c3cd4d775daf..4291963013c51 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -7470,6 +7470,9 @@ static void adlp_init_clock_gating(struct drm_i915_private *dev_priv)
>  
>  	/* Wa_22011091694:adlp */
>  	intel_de_rmw(dev_priv, GEN9_CLKGATE_DIS_5, 0, DPCE_GATING_DIS);
> +
> +	/* Bspec/49189 Initialize Sequence */
> +	intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, DDI_CLOCK_REG_ACCESS, 0);
>  }
>  
>  static void dg1_init_clock_gating(struct drm_i915_private *dev_priv)
> -- 
> 2.30.2

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2022-03-25 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 20:17 [Intel-gfx] [PATCH] drm/i915/adlp: Fix register corruption after DDI clock enabling Imre Deak
2022-03-23 21:29 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-03-23 21:33 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-23 22:00 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-03-23 22:47 ` [Intel-gfx] [PATCH] " Runyan, Arthur J
2022-03-25 20:46 ` Ville Syrjälä [this message]
2022-03-29 16:04 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/adlp: Fix register corruption after DDI clock enabling (rev2) Patchwork
2022-03-29 16:08 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-29 16:43 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-03-30 15:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-30 17:43 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=Yj4qKcD760V27Gbq@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=arthur.j.runyan@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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