From: "Souza, Jose" <jose.souza@intel.com>
To: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Deak, Imre" <imre.deak@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Apply CMTG clock disabling WA while DPLL0 is enabled
Date: Mon, 2 Aug 2021 20:52:41 +0000 [thread overview]
Message-ID: <70c089841d159b322f6c6749fad8e416766676dc.camel@intel.com> (raw)
In-Reply-To: <20210802190148.2099625-1-imre.deak@intel.com>
On Mon, 2021-08-02 at 22:01 +0300, Imre Deak wrote:
> CI test results/further experiments show that the workaround added in
>
> commit 573d7ce4f69a ("drm/i915/adlp: Add workaround to disable CMTG clock gating")
>
> can be applied only while DPLL0 is enabled. If it's disabled the
> TRANS_CMTG_CHICKEN register is not accessible. Accordingly move the WA
> to DPLL0 HW state sanitization and enabling.
>
> This fixes an issue where the WA won't get applied (and a WARN is thrown
> due to an unexpected value in TRANS_CMTG_CHICKEN) if the driver is
> loaded without DPLL0 being enabled: booting without BIOS enabling an
> output with this PLL, or reloading the driver.
>
> While at it also add a debug print for the unexpected register value.
Workaround do not mention nothing about this DPLL0 dependency, maybe would be nice to comment in HSD about this.
Have you tried to check if the workaround applies if DPLL1 is enabled? We could comment DPLL0 out from the adlp_plls table.
>
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 18 ----------
> drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 34 ++++++++++++++++++-
> 2 files changed, 33 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 4ca354f154215..98f7fbede6226 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -13284,24 +13284,6 @@ static void intel_early_display_was(struct drm_i915_private *dev_priv)
> KBL_ARB_FILL_SPARE_13 | KBL_ARB_FILL_SPARE_14,
> KBL_ARB_FILL_SPARE_14);
> }
> -
> - if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
> - u32 val;
> -
> - /*
> - * Wa_16011069516:adl-p[a0]
> - *
> - * All CMTG regs are unreliable until CMTG clock gating is
> - * disabled, so we can only assume the default CMTG_CHICKEN
> - * reg value and sanity check this assumption with a double
> - * read, which presumably returns the correct value even with
> - * clock gating on.
> - */
> - val = intel_de_read(dev_priv, TRANS_CMTG_CHICKEN);
> - val = intel_de_read(dev_priv, TRANS_CMTG_CHICKEN);
> - intel_de_write(dev_priv, TRANS_CMTG_CHICKEN, DISABLE_DPT_CLK_GATING);
> - drm_WARN_ON(&dev_priv->drm, val & ~DISABLE_DPT_CLK_GATING);
> - }
> }
>
> static void ibx_sanitize_pch_hdmi_port(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> index 0d72917e5670f..5c91d125a3371 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> @@ -3735,6 +3735,31 @@ static void icl_pll_enable(struct drm_i915_private *dev_priv,
> drm_err(&dev_priv->drm, "PLL %d not locked\n", pll->info->id);
> }
>
> +static void adlp_cmtg_clock_gating_wa(struct drm_i915_private *i915, struct intel_shared_dpll *pll)
> +{
> + u32 val;
> +
> + if (!IS_ADLP_DISPLAY_STEP(i915, STEP_A0, STEP_B0) ||
> + pll->info->id != DPLL_ID_ICL_DPLL0)
> + return;
> + /*
> + * Wa_16011069516:adl-p[a0]
> + *
> + * All CMTG regs are unreliable until CMTG clock gating is disabled,
> + * so we can only assume the default TRANS_CMTG_CHICKEN reg value and
> + * sanity check this assumption with a double read, which presumably
> + * returns the correct value even with clock gating on.
> + *
> + * Instead of the usual place for workarounds we apply this one here,
> + * since TRANS_CMTG_CHICKEN is only accessible while DPLL0 is enabled.
> + */
> + val = intel_de_read(i915, TRANS_CMTG_CHICKEN);
> + val = intel_de_read(i915, TRANS_CMTG_CHICKEN);
> + intel_de_write(i915, TRANS_CMTG_CHICKEN, DISABLE_DPT_CLK_GATING);
> + if (drm_WARN_ON(&i915->drm, val & ~DISABLE_DPT_CLK_GATING))
> + drm_dbg_kms(&i915->drm, "Unexpected flags in TRANS_CMTG_CHICKEN: %08x\n", val);
> +}
> +
> static void combo_pll_enable(struct drm_i915_private *dev_priv,
> struct intel_shared_dpll *pll)
> {
> @@ -3764,6 +3789,8 @@ static void combo_pll_enable(struct drm_i915_private *dev_priv,
>
> icl_pll_enable(dev_priv, pll, enable_reg);
>
> + adlp_cmtg_clock_gating_wa(dev_priv, pll);
> +
> /* DVFS post sequence would be here. See the comment above. */
> }
>
> @@ -4273,7 +4300,12 @@ void intel_dpll_readout_hw_state(struct drm_i915_private *i915)
> static void sanitize_dpll_state(struct drm_i915_private *i915,
> struct intel_shared_dpll *pll)
> {
> - if (!pll->on || pll->active_mask)
> + if (!pll->on)
> + return;
> +
> + adlp_cmtg_clock_gating_wa(i915, pll);
> +
> + if (pll->active_mask)
> return;
>
> drm_dbg_kms(&i915->drm,
next prev parent reply other threads:[~2021-08-02 20:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-02 19:01 [Intel-gfx] [PATCH] drm/i915: Apply CMTG clock disabling WA while DPLL0 is enabled Imre Deak
2021-08-02 20:01 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-08-02 20:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-08-02 20:52 ` Souza, Jose [this message]
2021-08-02 21:07 ` [Intel-gfx] [PATCH] " Imre Deak
2021-08-02 21:16 ` Souza, Jose
2021-08-02 21:20 ` Imre Deak
2021-08-03 12:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2021-08-03 13:51 ` Imre Deak
2021-08-03 14:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-08-03 15:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-08-04 5:32 ` 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=70c089841d159b322f6c6749fad8e416766676dc.camel@intel.com \
--to=jose.souza@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