All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Sk Anirban <sk.anirban@intel.com>
Cc: intel-gfx@lists.freedesktop.org, anshuman.gupta@intel.com,
	badal.nilawar@intel.com, riana.tauro@intel.com,
	karthik.poosa@intel.com, soham.purkait@intel.com,
	mallesh.koujalagi@intel.com, krzysztof.karas@intel.com
Subject: Re: [PATCH] drm/i915/selftest: Add throttle reason diagnostics to RPS selftests
Date: Fri, 12 Dec 2025 09:34:02 +0100	[thread overview]
Message-ID: <aTvTek_-ksTyOFuf@black.igk.intel.com> (raw)
In-Reply-To: <20251211175045.1317753-2-sk.anirban@intel.com>

On Thu, Dec 11, 2025 at 11:20:46PM +0530, Sk Anirban wrote:
> Report GPU throttle reasons when RPS tests fail to reach expected
> frequencies or power levels.
> 
> v2: Read the throttle value before the spinner ends (Raag)
>     Add a condition before printing throttle value (Krzysztof)

Please also format-patch with same version for consistency.

https://kernelnewbies.org/FirstKernelPatch -> "Versioning one patch revision"

> Signed-off-by: Sk Anirban <sk.anirban@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/selftest_rps.c | 33 ++++++++++++++++++++++----
>  1 file changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
> index 73bc91c6ea07..b72536ea6747 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rps.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
> @@ -378,6 +378,7 @@ int live_rps_control(void *arg)
>  	enum intel_engine_id id;
>  	struct igt_spinner spin;
>  	intel_wakeref_t wakeref;
> +	u32 throttle = 0;

The test guarantees its assignment so no need to initialize it.

>  	int err = 0;
>  
>  	/*
> @@ -463,6 +464,10 @@ int live_rps_control(void *arg)
>  		max = rps_set_check(rps, limit);
>  		max_dt = ktime_sub(ktime_get(), max_dt);
>  
> +		throttle = intel_uncore_read(gt->uncore,
> +					     intel_gt_perf_limit_reasons_reg(gt));
> +		throttle &= GT0_PERF_LIMIT_REASONS_MASK;
> +
>  		min_dt = ktime_get();
>  		min = rps_set_check(rps, rps->min_freq);
>  		min_dt = ktime_sub(ktime_get(), min_dt);
> @@ -478,11 +483,9 @@ int live_rps_control(void *arg)
>  			min, max, ktime_to_ns(min_dt), ktime_to_ns(max_dt));
>  
>  		if (limit != rps->max_freq) {
> -			u32 throttle = intel_uncore_read(gt->uncore,
> -							 intel_gt_perf_limit_reasons_reg(gt));
> -
> -			pr_warn("%s: GPU throttled with reasons 0x%08x\n",
> -				engine->name, throttle & GT0_PERF_LIMIT_REASONS_MASK);
> +			if (throttle)
> +				pr_warn("%s: GPU throttled with reasons 0x%08x\n",
> +					engine->name, throttle);
>  			show_pstate_limits(rps);
>  		}
>  
> @@ -1138,6 +1141,7 @@ int live_rps_power(void *arg)
>  	struct intel_engine_cs *engine;
>  	enum intel_engine_id id;
>  	struct igt_spinner spin;
> +	u32 throttle = 0;

Ditto.

>  	int err = 0;
>  
>  	/*
> @@ -1195,6 +1199,10 @@ int live_rps_power(void *arg)
>  		max.freq = rps->max_freq;
>  		max.power = measure_power_at(rps, &max.freq);
>  
> +		throttle = intel_uncore_read(gt->uncore,
> +					     intel_gt_perf_limit_reasons_reg(gt));
> +		throttle &= GT0_PERF_LIMIT_REASONS_MASK;
> +
>  		min.freq = rps->min_freq;
>  		min.power = measure_power_at(rps, &min.freq);
>  
> @@ -1216,6 +1224,11 @@ int live_rps_power(void *arg)
>  		if (11 * min.power > 10 * max.power) {
>  			pr_err("%s: did not conserve power when setting lower frequency!\n",
>  			       engine->name);
> +
> +			if (throttle)
> +				pr_warn("%s: GPU throttled with reasons 0x%08x\n",
> +					engine->name, throttle);

I think this'll also be useful in frequency check above.

> +
>  			err = -EINVAL;
>  			break;
>  		}
> @@ -1241,6 +1254,7 @@ int live_rps_dynamic(void *arg)
>  	struct intel_engine_cs *engine;
>  	enum intel_engine_id id;
>  	struct igt_spinner spin;
> +	u32 throttle = 0;

Ditto.

Raag

>  	int err = 0;
>  
>  	/*
> @@ -1293,6 +1307,10 @@ int live_rps_dynamic(void *arg)
>  		max.freq = wait_for_freq(rps, rps->max_freq, 500);
>  		max.dt = ktime_sub(ktime_get(), max.dt);
>  
> +		throttle = intel_uncore_read(gt->uncore,
> +					     intel_gt_perf_limit_reasons_reg(gt));
> +		throttle &= GT0_PERF_LIMIT_REASONS_MASK;
> +
>  		igt_spinner_end(&spin);
>  
>  		min.dt = ktime_get();
> @@ -1308,6 +1326,11 @@ int live_rps_dynamic(void *arg)
>  		if (min.freq >= max.freq) {
>  			pr_err("%s: dynamic reclocking of spinner failed\n!",
>  			       engine->name);
> +
> +			if (throttle)
> +				pr_warn("%s: GPU throttled with reasons 0x%08x\n",
> +					engine->name, throttle);
> +
>  			err = -EINVAL;
>  		}
>  
> -- 
> 2.43.0
> 

  parent reply	other threads:[~2025-12-12  8:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 17:50 [PATCH] drm/i915/selftest: Add throttle reason diagnostics to RPS selftests Sk Anirban
2025-12-11 19:07 ` ✓ i915.CI.BAT: success for drm/i915/selftest: Add throttle reason diagnostics to RPS selftests (rev2) Patchwork
2025-12-12  6:40 ` ✗ i915.CI.Full: failure " Patchwork
2025-12-12  7:44 ` [PATCH] drm/i915/selftest: Add throttle reason diagnostics to RPS selftests Krzysztof Karas
2025-12-12  8:34 ` Raag Jadav [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-12-09  5:56 Sk Anirban
2025-12-09  7:16 ` Krzysztof Karas
2025-12-09  8:06   ` Anirban, Sk
2025-12-10  8:51     ` Krzysztof Karas
2025-12-11  5:37       ` Anirban, Sk
2025-12-11  6:43         ` Raag Jadav
2025-12-11  7:05         ` Krzysztof Karas

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=aTvTek_-ksTyOFuf@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=mallesh.koujalagi@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@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.