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 i-g-t] tests/intel/xe_fault_injection: Do not treat probe success as error
Date: Thu, 27 Mar 2025 13:44:31 +0100 [thread overview]
Message-ID: <20250327124431.620027-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.
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..f559d7c98 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
+ xe_sysfs_driver_do(fd, pci_slot, XE_SYSFS_DRIVER_UNBIND);
}
/**
--
2.31.1
reply other threads:[~2025-03-27 12:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250327124431.620027-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