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

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Jul 25 16:17:23 UTC 2024


Hi Bommu,
On 2024-07-25 at 11:13:11 +0530, Bommu Krishnaiah wrote:
> Existing userspace assumes there's no gaps card’s, but I see cards
> are not continues, after running “gta at core_hotunplug I am not seeing card0,
> hence test is failing.
> 
> Test result before this changes:
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#

Drop this line.

> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools# cat /sys/class/drm/
s/cat/ls/ and also make it shorter:
s!root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools!!

so resulting line will be:

# ls /sys/class/drm/

> card0/      renderD128/ version
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools# ./core_setmaster --r master-drop-set-user

Write only a sequence to replicate a bug, like:

# ./core_setmaster --r master-drop-set-user
 Subtest master-drop-set-user: SUCCESS (0.066s)
# ./core_hotunplug --r hotrebind-lateclose
 Subtest hotrebind-lateclose: SUCCESS (2.721s)
# ls /sys/class/drm/
 card1/      renderD129/ version
# ./core_setmaster --r master-drop-set-user

and here cite an error report. Also write which driver
it was (i915 or Xe).

Regards,
Kamil

> IGT-Version: 1.28-NO-GIT (x86_64) (Linux: 6.10.0-rc7-xe x86_64)
> Using IGT_SRANDOM=1721882790 for randomisation
> Starting subtest: master-drop-set-user
> Opened device: /dev/dri/card0
> Subtest master-drop-set-user: SUCCESS (0.066s)
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools# ./core_hotunplug --r hotrebind-lateclose
> IGT-Version: 1.28-NO-GIT (x86_64) (Linux: 6.10.0-rc7-xe x86_64)
> Using IGT_SRANDOM=1721882819 for randomisation
> Opened device: /dev/dri/card0
> Starting subtest: hotrebind-lateclose
> Opened device: /dev/dri/renderD128
> Unloaded audio driver snd_hda_intel
> Realoading snd_hda_intel
> Opened device: /dev/dri/card1
> Opened device: /dev/dri/renderD129
> Subtest hotrebind-lateclose: SUCCESS (2.721s)
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools# cat /sys/class/drm/
> card1/      renderD129/ version
> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools# ./core_setmaster --r master-drop-set-user
> IGT-Version: 1.28-NO-GIT (x86_64) (Linux: 6.10.0-rc7-xe x86_64)
> Using IGT_SRANDOM=1721882840 for randomisation
> Starting subtest: master-drop-set-user
> (core_setmaster:4366) CRITICAL: Test assertion failure function check_drop_set, file ../tests/core_setmaster.c:85:
> (core_setmaster:4366) CRITICAL: Failed assertion: master != -1
> (core_setmaster:4366) CRITICAL: Last errno: 2, No such file or directory
> (core_setmaster:4366) CRITICAL: error: -1 == -1
> Stack trace:
>   #0 [__igt_fail_assert+0x10a]
>   #1 [check_drop_set+0x70]
>   #2 [__igt_unique____real_main145+0x355]
>   #3 [main+0x2d]
>   #4 [__libc_init_first+0x90]
>   #5 [__libc_start_main+0x80]
>   #6 [_start+0x2e]
> child 0 failed with exit status 98
> Subtest master-drop-set-user failed.
> No log.
> Subtest master-drop-set-user: FAIL (0.019s)

Fail log could stay.

> root at DUT1523LNL:/usr/local/libexec/igt-gpu-tools#
> 
> 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 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
> index 9c2083f66..c02eaf671 100644
> --- a/tests/core_setmaster.c
> +++ b/tests/core_setmaster.c
> @@ -116,9 +116,9 @@ 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. */
> +		/* Existing userspace assumes there is a gaps, hence continues. */

Is it really true? Could you point to some discussion on
lore.kernel.org? Or some other mailing list/forum?

Regards,
Kamil

>  		if (stat(path, &st) != 0)
> -			break;
> +			continue;
>  
>  		if (save) {
>  			/* Save and toggle */
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list