[PATCH v2 i-g-t v2] tests/core_setmaster: Change break to continue in tweak_perm function

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri Jul 26 17:00:37 UTC 2024


Hi Bommu,
On 2024-07-26 at 15:56:18 +0530, Bommu Krishnaiah wrote:

I have few nits, first about subject:
[PATCH v2 i-g-t v2] tests/core_setmaster: Change break to continue in tweak_perm function

please do not write in subject word-for-word C code,
see links in CONTRUBUTE.md on how to describe changes, so

s/Change break to continue in tweak_perm function/...one line description.../

> Existing userspace assumes there's no gaps card’s, but I see cards

Maybe explain why this cannot be always true?

> are not continues, after running “gta at core_hotunplug I am not seeing card0,
> hence test is failing.
>

s/“gta at core_hotunplug/core_hotunplug at hotrebind-lateclose/

> Failure sequence:
> 

Put command here: ls /dev/dri

> card0  renderD128  version
> 

same here, put command to get this result:
sudo ... write here command to run a test below

> Subtest master-drop-set-user: SUCCESS (0.061s)
> 

Same here.

> card0  renderD128  version

Same here.

> 
> Subtest hotrebind-lateclose: SUCCESS (2.791s)
> 
> ls /sys/class/drm/
> card1  renderD129  version
> 
> root at DUT4419LNL:/usr/local/libexec/igt-gpu-tools# ./core_setmaster --r master-drop-set-user

s!root at DUT4419LNL:/usr/local/libexec/igt-gpu-tools!!

> Subtest master-drop-set-user: FAIL (0.017s)
> 
> Failure on XE

Move this to begin, where you describe problem.
Does this also happen for i915?
If not maybe this is a regression in Xe?

I do see why userspace cannot have continous card0...N
and that is you could dynamically unload/remove a card
but please write that in comment in a test.

Regards,
Kamil

> 
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu at intel.com>
> Cc: Emil Velikov <emil.l.velikov at gmail.com>
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> ---
>  tests/core_setmaster.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> index 9c2083f66..60ae06331 100644
> --- a/tests/core_setmaster.c
> +++ b/tests/core_setmaster.c
> @@ -116,9 +116,8 @@ static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save)
>  	for (i = 0; i < max_perm; i++) {
>  		snprintf(path, sizeof(path), "/dev/dri/card%u", i);
>  
> -		/* Existing userspace assumes there's no gaps, do the same. */
>  		if (stat(path, &st) != 0)
> -			break;
> +			continue;
>  
>  		if (save) {
>  			/* Save and toggle */
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list