All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
	<andi.shyti@intel.com>, <andrzej.hajda@intel.com>,
	<sk.anirban@intel.com>
Subject: Re: [PATCH v3] drm/i915: Disable RPG during live selftest
Date: Fri, 24 Jan 2025 13:02:21 -0500	[thread overview]
Message-ID: <Z5PVrQeOCktGX-go@intel.com> (raw)
In-Reply-To: <20250124065023.1082862-1-badal.nilawar@intel.com>

On Fri, Jan 24, 2025 at 08:50:23AM +0200, Badal Nilawar wrote:
> The Forcewake timeout issue has been observed on Gen 12.0 and above. To address this,
> disable Render Power-Gating (RPG) during live self-tests for these generations.
> The temporary workaround 'drm/i915/mtl: do not enable render power-gating on MTL'
> disables RPG globally, which is unnecessary since the issues were only seen during self-tests.
> 
> v2: take runtime pm wakeref
> 
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9413
> Fixes: 25e7976db86b ("drm/i915/mtl: do not enable render power-gating on MTL")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_rc6.c           | 19 ++++---------------
>  .../gpu/drm/i915/selftests/i915_selftest.c    | 18 ++++++++++++++++++
>  2 files changed, 22 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c b/drivers/gpu/drm/i915/gt/intel_rc6.c
> index 9378d5901c49..9ca42589da4d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_rc6.c
> +++ b/drivers/gpu/drm/i915/gt/intel_rc6.c
> @@ -117,21 +117,10 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
>  			GEN6_RC_CTL_RC6_ENABLE |
>  			GEN6_RC_CTL_EI_MODE(1);
>  
> -	/*
> -	 * BSpec 52698 - Render powergating must be off.
> -	 * FIXME BSpec is outdated, disabling powergating for MTL is just
> -	 * temporary wa and should be removed after fixing real cause
> -	 * of forcewake timeouts.
> -	 */
> -	if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74)))
> -		pg_enable =
> -			GEN9_MEDIA_PG_ENABLE |
> -			GEN11_MEDIA_SAMPLER_PG_ENABLE;
> -	else
> -		pg_enable =
> -			GEN9_RENDER_PG_ENABLE |
> -			GEN9_MEDIA_PG_ENABLE |
> -			GEN11_MEDIA_SAMPLER_PG_ENABLE;
> +	pg_enable =
> +		GEN9_RENDER_PG_ENABLE |
> +		GEN9_MEDIA_PG_ENABLE |
> +		GEN11_MEDIA_SAMPLER_PG_ENABLE;
>  
>  	if (GRAPHICS_VER(gt->i915) >= 12 && !IS_DG1(gt->i915)) {
>  		for (i = 0; i < I915_MAX_VCS; i++)
> diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c
> index fee76c1d2f45..889281819c5b 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_selftest.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c
> @@ -23,7 +23,9 @@
>  
>  #include <linux/random.h>
>  
> +#include "gt/intel_gt.h"
>  #include "gt/intel_gt_pm.h"
> +#include "gt/intel_gt_regs.h"
>  #include "gt/uc/intel_gsc_fw.h"
>  
>  #include "i915_driver.h"
> @@ -253,11 +255,27 @@ int i915_mock_selftests(void)
>  int i915_live_selftests(struct pci_dev *pdev)
>  {
>  	struct drm_i915_private *i915 = pdev_to_i915(pdev);
> +	struct intel_uncore *uncore = &i915->uncore;
>  	int err;
> +	u32 pg_enable;
> +	intel_wakeref_t wakeref;
>  
>  	if (!i915_selftest.live)
>  		return 0;
>  
> +	/*
> +	 * FIXME Disable render powergating, this is temporary wa and should be removed
> +	 * after fixing real cause of forcewake timeouts.
> +	 */
> +	with_intel_runtime_pm(uncore->rpm, wakeref) {

We probably need to take the runtime pm reference in upper layers...

CI is mad around runtime pm on selftests with this patch.

> +		if (IS_GFX_GT_IP_RANGE(to_gt(i915), IP_VER(12, 00), IP_VER(12, 74))) {
> +			pg_enable = intel_uncore_read(uncore, GEN9_PG_ENABLE);
> +			if (pg_enable & GEN9_RENDER_PG_ENABLE)
> +				intel_uncore_write_fw(uncore, GEN9_PG_ENABLE,
> +						      pg_enable & ~GEN9_RENDER_PG_ENABLE);

We also are facing some repeated GPU hangs on selftests with this,
so we probably cannot blindly disable here?

I know our CI oscilates some time, but when different attempts gets
same results there, then we really need to believe it...

> +		}
> +	}
> +
>  	__wait_gsc_proxy_completed(i915);
>  	__wait_gsc_huc_load_completed(i915);
>  
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2025-01-24 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24  6:50 [PATCH v3] drm/i915: Disable RPG during live selftest Badal Nilawar
2025-01-24 14:18 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Disable RPG during live selftest (rev2) Patchwork
2025-01-24 14:38 ` ✗ i915.CI.BAT: failure " Patchwork
2025-01-24 18:02 ` Rodrigo Vivi [this message]

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=Z5PVrQeOCktGX-go@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=andi.shyti@intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sk.anirban@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.