Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] tests/xe_guc_pc: Restore max freq first
@ 2023-03-25  0:34 Vinay Belgaumkar
  2023-03-26 10:51 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
  0 siblings, 1 reply; 3+ messages in thread
From: Vinay Belgaumkar @ 2023-03-25  0:34 UTC (permalink / raw)
  To: intel-gfx, igt-dev

When min/max are both at RPn, restoring min back to 300
will not work. Max needs to be increased first. Also, add
igt_assert() here, which would have caught the issue.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
---
 tests/xe/xe_guc_pc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
index 60c93288..43bf6f48 100644
--- a/tests/xe/xe_guc_pc.c
+++ b/tests/xe/xe_guc_pc.c
@@ -489,8 +489,8 @@ igt_main
 
 	igt_fixture {
 		xe_for_each_gt(fd, gt) {
-			set_freq(sysfs, gt, "min", stash_min);
-			set_freq(sysfs, gt, "max", stash_max);
+			igt_assert(set_freq(sysfs, gt, "max", stash_max) > 0);
+			igt_assert(set_freq(sysfs, gt, "min", stash_min) > 0);
 		}
 		close(sysfs);
 		xe_device_put(fd);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/xe_guc_pc: Restore max freq first
  2023-03-25  0:34 [Intel-gfx] [PATCH i-g-t] tests/xe_guc_pc: Restore max freq first Vinay Belgaumkar
@ 2023-03-26 10:51 ` Rodrigo Vivi
  2023-03-27 23:04   ` Belgaumkar, Vinay
  0 siblings, 1 reply; 3+ messages in thread
From: Rodrigo Vivi @ 2023-03-26 10:51 UTC (permalink / raw)
  To: Vinay Belgaumkar; +Cc: igt-dev, intel-gfx

On Fri, Mar 24, 2023 at 05:34:42PM -0700, Vinay Belgaumkar wrote:
> When min/max are both at RPn, restoring min back to 300
> will not work. Max needs to be increased first.

why max needs to come first in this case? we should probably at
least document so we don't forget it again...

> Also, add
> igt_assert() here, which would have caught the issue.

I was going to ask if we should really add asserts inside the fixture
or maybe using igt_require instead, but then I noticed more cases
doing the assert...

> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> ---
>  tests/xe/xe_guc_pc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
> index 60c93288..43bf6f48 100644
> --- a/tests/xe/xe_guc_pc.c
> +++ b/tests/xe/xe_guc_pc.c
> @@ -489,8 +489,8 @@ igt_main
>  
>  	igt_fixture {
>  		xe_for_each_gt(fd, gt) {
> -			set_freq(sysfs, gt, "min", stash_min);
> -			set_freq(sysfs, gt, "max", stash_max);
> +			igt_assert(set_freq(sysfs, gt, "max", stash_max) > 0);
> +			igt_assert(set_freq(sysfs, gt, "min", stash_min) > 0);
>  		}
>  		close(sysfs);
>  		xe_device_put(fd);
> -- 
> 2.38.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] tests/xe_guc_pc: Restore max freq first
  2023-03-26 10:51 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
@ 2023-03-27 23:04   ` Belgaumkar, Vinay
  0 siblings, 0 replies; 3+ messages in thread
From: Belgaumkar, Vinay @ 2023-03-27 23:04 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: igt-dev, intel-gfx


On 3/26/2023 3:51 AM, Rodrigo Vivi wrote:
> On Fri, Mar 24, 2023 at 05:34:42PM -0700, Vinay Belgaumkar wrote:
>> When min/max are both at RPn, restoring min back to 300
>> will not work. Max needs to be increased first.
> why max needs to come first in this case? we should probably at
> least document so we don't forget it again...
I was assuming we use soft limits like in i915, but looks like we don't. 
So, this is not an issue.
>
>> Also, add
>> igt_assert() here, which would have caught the issue.
> I was going to ask if we should really add asserts inside the fixture
> or maybe using igt_require instead, but then I noticed more cases
> doing the assert...

Do we still need to add the assert in this case?

Thanks,

Vinay.

>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
>> ---
>>   tests/xe/xe_guc_pc.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
>> index 60c93288..43bf6f48 100644
>> --- a/tests/xe/xe_guc_pc.c
>> +++ b/tests/xe/xe_guc_pc.c
>> @@ -489,8 +489,8 @@ igt_main
>>   
>>   	igt_fixture {
>>   		xe_for_each_gt(fd, gt) {
>> -			set_freq(sysfs, gt, "min", stash_min);
>> -			set_freq(sysfs, gt, "max", stash_max);
>> +			igt_assert(set_freq(sysfs, gt, "max", stash_max) > 0);
>> +			igt_assert(set_freq(sysfs, gt, "min", stash_min) > 0);
>>   		}
>>   		close(sysfs);
>>   		xe_device_put(fd);
>> -- 
>> 2.38.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-27 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-25  0:34 [Intel-gfx] [PATCH i-g-t] tests/xe_guc_pc: Restore max freq first Vinay Belgaumkar
2023-03-26 10:51 ` [Intel-gfx] [igt-dev] " Rodrigo Vivi
2023-03-27 23:04   ` Belgaumkar, Vinay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox