Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, saurabhg.gupta@intel.com,
	alex.zuo@intel.com, francois.dugast@intel.com,
	lucas.demarchi@intel.com, matthew.brost@intel.com,
	rodrigo.vivi@intel.com, michal.wajdeczko@intel.com,
	kamil.konieczny@linux.intel.com
Subject: [PATCH v3] tests/intel/xe_fault_injection: Ignore expected errors
Date: Tue, 19 Nov 2024 21:50:27 +0000	[thread overview]
Message-ID: <20241119215027.109598-1-jonathan.cavitt@intel.com> (raw)

The following errors can be observed when running the xe_fault_injection
subtests:

[drm] *ERROR* GT0: GuC init failed with -ENOMEM
[drm] *ERROR* GT0: Failed to initialize uC (-ENOMEM)
probe with driver xe failed with error -12

Add these messages to the dmesg ignore regex to the applicable tests
(specifically, all tests for the last error, and all tests that target
GuC subsystems for the first two errors).

v2:
- Fix and merge regex (Kamil)

v3:
- Rebase change to be compatible with latest revision (Kamil)

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3343
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: Francois Dugast <francois.dugast@intel.com>
CC: Lucas De Marchi <lucas.demarchi@intel.com>
CC: Matthew Brost <matthew.brost@intel.com>
CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
CC: Michal Wajdeczko <michal.wajdeczko@intel.com>
CC: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/intel/xe_fault_injection.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 1b29041745..7d6c902761 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -50,6 +50,30 @@ static int fail_function_open(void)
 	return debugfs_fail_function_dir_fd;
 }
 
+static bool function_is_part_of_guc(const char function_name[])
+{
+	return strstr(function_name, "_guc_") != NULL ||
+	       strstr(function_name, "_uc_") != NULL ||
+	       strstr(function_name, "_wopcm_") != NULL;
+}
+
+static void ignore_faults_in_dmesg(const char function_name[])
+{
+	/* Driver probe is expected to fail in all cases, so ignore in igt_runner */
+	char regex[1024] = "probe with driver xe failed with error -12";
+
+	/*
+	 * If GuC module fault is injected, GuC is expected to fail,
+	 * so also ignore GuC init failures in igt_runner.
+	 */
+	if (function_is_part_of_guc(function_name)) {
+		strcat(regex, "|GT[0-9a-fA-F]*: GuC init failed with -ENOMEM");
+		strcat(regex, "|GT[0-9a-fA-F]*: Failed to initialize uC .-ENOMEM");
+	}
+
+	igt_emit_ignore_dmesg_regex(regex);
+}
+
 /*
  * The injectable file requires CONFIG_FUNCTION_ERROR_INJECTION in kernel.
  */
@@ -152,6 +176,7 @@ inject_fault_probe(int fd, char pci_slot[], const char function_name[])
 	igt_info("Injecting error \"%s\" (%d) in function \"%s\"\n",
 		 strerror(-INJECT_ERRNO), INJECT_ERRNO, function_name);
 
+	ignore_faults_in_dmesg(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);
@@ -184,6 +209,7 @@ vm_create_fail(int fd, const char function_name[], unsigned int flags)
 {
 	igt_assert_eq(simple_vm_create(fd, flags), 0);
 
+	ignore_faults_in_dmesg(function_name);
 	injection_list_do(INJECTION_LIST_ADD, function_name);
 	set_retval(function_name, INJECT_ERRNO);
 	igt_assert(simple_vm_create(fd, flags) != 0);
@@ -243,6 +269,7 @@ vm_bind_fail(int fd, const char function_name[])
 
 	igt_assert_eq(simple_vm_bind(fd, vm), 0);
 
+	ignore_faults_in_dmesg(function_name);
 	injection_list_do(INJECTION_LIST_ADD, function_name);
 	set_retval(function_name, INJECT_ERRNO);
 	igt_assert(simple_vm_bind(fd, vm) != 0);
-- 
2.43.0


             reply	other threads:[~2024-11-19 21:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 21:50 Jonathan Cavitt [this message]
2024-11-20  1:02 ` ✗ CI.xeBAT: failure for tests/intel/xe_fault_injection: Ignore expected errors (rev3) Patchwork
2024-11-20 19:29   ` Cavitt, Jonathan
2024-11-20  1:08 ` ✗ Fi.CI.BAT: " Patchwork
2024-11-20 19:29   ` Cavitt, Jonathan
2024-11-20 18:50 ` [PATCH v3] tests/intel/xe_fault_injection: Ignore expected errors Kamil Konieczny
2024-11-20 19:28   ` Cavitt, Jonathan

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=20241119215027.109598-1-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=saurabhg.gupta@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