Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/core_setmaster: Handle the test even if cards are non-continuous
@ 2024-08-12  5:24 Bommu Krishnaiah
  2024-08-12  5:41 ` Bommu, Krishnaiah
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Bommu Krishnaiah @ 2024-08-12  5:24 UTC (permalink / raw)
  To: igt-dev
  Cc: Bommu Krishnaiah, Emil Velikov, Himal Prasad Ghimiray,
	Kamil Konieczny

Although most of userspace assumes drm cards to be populated continously,

this assumption may not be always true. After hot unpluging and
repluging of card

the card may be non-continous.  To address such scenarios where the
cards can be non-continous

modify the tweak_perm function to loop all possible
cardnumbers(card0-card255) to confirm are they populated or not.

Problem Description:
The test fails after running the `core_hotunplug@hot*` subtest, where
card0 is missing.
This leads to a failure in the subsequent `master-drop-set-user` test.

Command sequence for reproducing the issue:
- Check available cards: `ls /dev/dri/`
	- Output: by-path  card0  renderD128
- Run the test: `# ./core_hotunplug --r hotrebind-lateclose`
- Check again: ‘ls /dev/dri/’
	- Output after failure: by-path  card1  renderD129
- Run the test: `# ./core_setmaster --r master-drop-set-user`

This failures on both XE and i915 for above sequence.

Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/core_setmaster.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
index 9c2083f66..a2758e2f2 100644
--- a/tests/core_setmaster.c
+++ b/tests/core_setmaster.c
@@ -116,9 +116,10 @@ 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. */
+		/* Userspace cannot always have continuous card0...N due to
+		 * dynamic unloading or removal of cards */
 		if (stat(path, &st) != 0)
-			break;
+			continue;
 
 		if (save) {
 			/* Save and toggle */
-- 
2.25.1


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

end of thread, other threads:[~2024-09-04  6:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12  5:24 [PATCH] tests/core_setmaster: Handle the test even if cards are non-continuous Bommu Krishnaiah
2024-08-12  5:41 ` Bommu, Krishnaiah
2024-08-12  6:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-08-12  6:25 ` ✓ CI.xeBAT: " Patchwork
2024-08-12  8:13 ` ✓ CI.xeFULL: " Patchwork
2024-08-12 21:41 ` ✓ Fi.CI.IGT: " Patchwork
2024-08-22 16:46 ` [PATCH] " Kamil Konieczny
2024-09-03  8:32   ` Bommu, Krishnaiah
2024-09-03 12:03     ` Kamil Konieczny
2024-09-04  6:47       ` Bommu, Krishnaiah
2024-09-03 11:46 ` ✗ Fi.CI.BUILD: failure for tests/core_setmaster: Handle the test even if cards are non-continuous (rev2) Patchwork
2024-09-04  6:55 ` ✗ Fi.CI.BUILD: failure for tests/core_setmaster: Handle the test even if cards are non-continuous (rev3) Patchwork

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