[igt-dev] [PATCH i-g-t] tests/xe: When GT is in RC6 donot assert if act freq is 0

Nilawar, Badal badal.nilawar at intel.com
Fri Jun 30 11:00:06 UTC 2023



On 27-06-2023 04:39, Dixit, Ashutosh wrote:
> On Thu, 22 Jun 2023 02:37:18 -0700, Badal Nilawar wrote:
>>
>> @@ -223,13 +244,15 @@ static void test_freq_fixed(int sysfs, int gt_id)
>> 	igt_assert(set_freq(sysfs, gt_id, "max", rpn) > 0);
>> 	usleep(ACT_FREQ_LATENCY_US);
>> 	igt_assert(get_freq(sysfs, gt_id, "cur") == rpn);
>> -	igt_assert(get_freq(sysfs, gt_id, "act") == rpn);
>> +	if (!in_rc6(sysfs, gt_id))
>> +		igt_assert(get_freq(sysfs, gt_id, "act") == rpn);
>>
>> 	igt_assert(set_freq(sysfs, gt_id, "min", rpe) > 0);
>> 	igt_assert(set_freq(sysfs, gt_id, "max", rpe) > 0);
>> 	usleep(ACT_FREQ_LATENCY_US);
>> 	igt_assert(get_freq(sysfs, gt_id, "cur") == rpe);
>> -	igt_assert(get_freq(sysfs, gt_id, "act") == rpe);
>> +	if (!in_rc6(sysfs, gt_id))
>> +		igt_assert(get_freq(sysfs, gt_id, "act") == rpe);
>>
>> 	igt_assert(set_freq(sysfs, gt_id, "min", rp0) > 0);
>> 	igt_assert(set_freq(sysfs, gt_id, "max", rp0) > 0);
>> @@ -269,7 +292,8 @@ static void test_freq_range(int sysfs, int gt_id)
>> 	cur = get_freq(sysfs, gt_id, "cur");
>> 	igt_assert(rpn <= cur && cur <= rpe);
>> 	act = get_freq(sysfs, gt_id, "act");
>> -	igt_assert(rpn <= act && act <= rpe);
>> +	if (!in_rc6(sysfs, gt_id))
>> +		igt_assert(rpn <= act && act <= rpe);
> 
> Basically slightly racy because in_rc6() and get_freq() are not done
> atomically, but maybe ok here if not causing false positives?
Not sure how to handle race here. Not observed any false positives.
> 
> Further, do we need to add the following else's here:
> 
> 	if (!in_rc6(sysfs, gt_id))
> 		igt_assert(rpn <= act && act <= rpe);
> 	else
> 		igt_assert(act == 0);
Instead of this to accommodate idle and exec test should we pass flag 
(is_idle) here. So this will be.
if (is_idle)
	igt_assert(act == 0);
else
	igt_assert(rpn <= act && act <= rpe);

Regards,
Badal
> 
> Or is that likely to blow up
> 
> Ashutosh


More information about the igt-dev mailing list