Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Subject: [PATCH v2 i-g-t] tests/intel/xe_fault_injection: Do not treat probe success as error
Date: Thu, 27 Mar 2025 13:50:51 +0100	[thread overview]
Message-ID: <20250327125051.621892-1-marcin.bernatowicz@linux.intel.com> (raw)

Certain functions may not be called at all, such as xe_wopcm_init,
xe_guc_log_init, and xe_guc_ads_init during VF probe.
In such cases, a successful probe should not be treated as an error.

v2: Use igt_kmod_unbind instead of xe_sysfs_driver_do.

Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 tests/intel/xe_fault_injection.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 24c114ba7..b4ce8972d 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -185,6 +185,8 @@ static void set_retval(const char function_name[], long long retval)
 static void
 inject_fault_probe(int fd, char pci_slot[], const char function_name[])
 {
+	int err = 0;
+
 	igt_info("Injecting error \"%s\" (%d) in function \"%s\"\n",
 		 strerror(-INJECT_ERRNO), INJECT_ERRNO, function_name);
 
@@ -192,8 +194,12 @@ inject_fault_probe(int fd, char pci_slot[], const char function_name[])
 	injection_list_do(INJECTION_LIST_ADD, function_name);
 	set_retval(function_name, INJECT_ERRNO);
 	xe_sysfs_driver_do(fd, pci_slot, XE_SYSFS_DRIVER_TRY_BIND);
-	igt_assert_eq(-errno, INJECT_ERRNO);
+	err = -errno;
 	injection_list_do(INJECTION_LIST_REMOVE, function_name);
+	if (err)
+		igt_assert_eq(err, INJECT_ERRNO);
+	else
+		igt_kmod_unbind("xe", pci_slot);
 }
 
 /**
-- 
2.31.1


             reply	other threads:[~2025-03-27 12:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 12:50 Marcin Bernatowicz [this message]
2025-03-27 18:05 ` ✓ Xe.CI.BAT: success for tests/intel/xe_fault_injection: Do not treat probe success as error (rev2) Patchwork
2025-03-27 18:17 ` ✓ i915.CI.BAT: " Patchwork
2025-03-27 21:16 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-28  4:15 ` ✗ Xe.CI.Full: " Patchwork
2025-03-28 12:33 ` Patchwork
2025-04-06 16:54 ` ✓ Xe.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250327125051.621892-1-marcin.bernatowicz@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=satyanarayana.k.v.p@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox