From: "Anirban, Sk" <sk.anirban@intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <riana.tauro@intel.com>,
<karthik.poosa@intel.com>, <raag.jadav@intel.com>,
<soham.purkait@intel.com>, <mallesh.koujalagi@intel.com>
Subject: Re: [PATCH] drm/i915/selftest: Add throttle reason diagnostics to RPS selftests
Date: Thu, 11 Dec 2025 11:07:05 +0530 [thread overview]
Message-ID: <a7af4b0a-31cc-4f8b-b90c-e5f3bc399f0e@intel.com> (raw)
In-Reply-To: <tglsnnckzfji56d3vqzvbee7ax6yjh6o5lv7lpoco2clikdmzn@txrozp7qqebp>
Hi,
On 10-12-2025 02:21 pm, Krzysztof Karas wrote:
> Hi,
>
> On 2025-12-09 at 13:36:15 +0530, Anirban, Sk wrote:
>> Hi,
>>
>> On 09-12-2025 12:46 pm, Krzysztof Karas wrote:
>>> Hi Sk Anirban,
>>>
>>> On 2025-12-09 at 11:26:17 +0530, Sk Anirban wrote:
>>>> Report GPU throttle reasons when RPS tests fail to reach expected
>>>> frequencies or power levels.
>>>>
>>>> Signed-off-by: Sk Anirban <sk.anirban@intel.com>
>>>> ---
>>>> drivers/gpu/drm/i915/gt/selftest_rps.c | 17 +++++++++++++++++
>>>> 1 file changed, 17 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
>>>> index 73bc91c6ea07..01c671e00e61 100644
>>>> --- a/drivers/gpu/drm/i915/gt/selftest_rps.c
>>>> +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
>>>> @@ -1138,6 +1138,7 @@ int live_rps_power(void *arg)
>>>> struct intel_engine_cs *engine;
>>>> enum intel_engine_id id;
>>>> struct igt_spinner spin;
>>>> + u32 throttle;
>>>> int err = 0;
>>>> /*
>>>> @@ -1216,6 +1217,13 @@ 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);
>>>> +
>>>> + 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);
>>>> +
>>> This feels like spamming the system messages. We are on error
>>> path already and exiting with -EINVAL, so printing an
>>> unconditional warning here is excessive, I think.
>>>
>>> [...]
>> Got it. Based on past experience, most failures occur due to throttling.
>> However, I can switch it to pr_info since we already print pr_err
>> beforehand.
> No, that would bunch up two reasons for potential failure.
> If you experienced problems in condition check:
>
> if (11 * min.power > 10 * max.power)
>
> due to throttling, then throttling detection could use its own
> error path, something like this could work:
>
> if (11 * min.power > 10 * max.power) {
> - pr_err("%s: did not conserve power when setting lower frequency!\n",
> - engine->name);
> + if (read_cagf(rps) != rps->max_freq) {
> + throttle = intel_uncore_read(gt->uncore,
> + intel_gt_perf_limit_reasons_reg(gt));
> + pr_err("%s: GPU throttled with reasons 0x%08x\n",
> + engine->name, throttle & GT0_PERF_LIMIT_REASONS_MASK);
> + } else {
> + pr_err("%s: did not conserve power when setting lower frequency!\n",
> + engine->name);
> + }
> +
> err = -EINVAL;
> break;
> }
>
> The main goal would be to differentiate and print only one
> reason for failure, instead of emitting two of them and leaving
> people guessing which one of the two was the real reason the
> function returned with -EINVAL.
>
> I did not test the code above, so it may require some changes.
Throttle is not considered a failure in this context; it serves only as
a debug indicator or a potential reason for failure.
The primary objective of the test is to measure power, and any failure
will be related to power metrics.
Throttling is viewed as a defensive mechanism rather than a failure
condition.
Thanks,
Anirban
>
next prev parent reply other threads:[~2025-12-11 5:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 5:56 [PATCH] drm/i915/selftest: Add throttle reason diagnostics to RPS selftests 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 [this message]
2025-12-11 6:43 ` Raag Jadav
2025-12-11 7:05 ` Krzysztof Karas
2025-12-09 9:27 ` ✓ i915.CI.BAT: success for " Patchwork
2025-12-09 11:01 ` ✗ i915.CI.Full: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-12-11 17:50 [PATCH] " Sk Anirban
2025-12-12 7:44 ` Krzysztof Karas
2025-12-12 8:34 ` Raag Jadav
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=a7af4b0a-31cc-4f8b-b90c-e5f3bc399f0e@intel.com \
--to=sk.anirban@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=raag.jadav@intel.com \
--cc=riana.tauro@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.