Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH v1 10/10] tests/intel/xe: Remove xe_uevent for now
Date: Fri, 15 Dec 2023 15:50:50 +0000	[thread overview]
Message-ID: <20231215155050.7-11-francois.dugast@intel.com> (raw)
In-Reply-To: <20231215155050.7-1-francois.dugast@intel.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>

This kernel uevent is getting removed for now. It will come
back later with a better future proof name.

v2: Align with kernel commit ("drm/xe/uapi: Remove reset uevent \
    for now") (Francois Dugast)

Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
---
 include/drm-uapi/xe_drm.h |  11 ----
 tests/intel/xe_uevent.c   | 129 --------------------------------------
 tests/meson.build         |   1 -
 3 files changed, 141 deletions(-)
 delete mode 100644 tests/intel/xe_uevent.c

diff --git a/include/drm-uapi/xe_drm.h b/include/drm-uapi/xe_drm.h
index 991c45bda..bacdca787 100644
--- a/include/drm-uapi/xe_drm.h
+++ b/include/drm-uapi/xe_drm.h
@@ -20,7 +20,6 @@ extern "C" {
  *   2. Extension definition and helper structs
  *   3. IOCTL's Query structs in the order of the Query's entries.
  *   4. The rest of IOCTL structs in the order of IOCTL declaration.
- *   5. uEvents
  */
 
 /**
@@ -1341,16 +1340,6 @@ struct drm_xe_wait_user_fence {
 	__u64 reserved[2];
 };
 
-/**
- * DOC: uevent generated by xe on it's pci node.
- *
- * DRM_XE_RESET_FAILED_UEVENT - Event is generated when attempt to reset gt
- * fails. The value supplied with the event is always "NEEDS_RESET".
- * Additional information supplied is tile id and gt id of the gt unit for
- * which reset has failed.
- */
-#define DRM_XE_RESET_FAILED_UEVENT "DEVICE_STATUS"
-
 #if defined(__cplusplus)
 }
 #endif
diff --git a/tests/intel/xe_uevent.c b/tests/intel/xe_uevent.c
deleted file mode 100644
index d30931714..000000000
--- a/tests/intel/xe_uevent.c
+++ /dev/null
@@ -1,129 +0,0 @@
-// SPDX-License-Identifier: MIT
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-/**
- * TEST: cause fake gt reset failure and listen uevent from KMD
- * Category: Software building block
- * SUBTEST:fake_reset_uevent_listener
- * Functionality: uevent
- * Sub-category: GT reset failure uevent
- * Test category: functionality test
- * Description:
- *		Test creates uevent listener and causes fake reset failure for gt0
- *		and returns success if uevent is sent by driver and listened by listener.
- */
-
-#include <libudev.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#include "igt.h"
-
-#include "xe_drm.h"
-#include "xe/xe_ioctl.h"
-#include "xe/xe_query.h"
-
-static void xe_fail_gt_reset(int fd, int gt)
-{
-	igt_debugfs_write(fd, "fail_gt_reset/probability", "100");
-	igt_debugfs_write(fd, "fail_gt_reset/times", "2");
-
-	xe_force_gt_reset(fd, gt);
-}
-
-static bool listen_reset_fail_uevent(struct udev_device *device, const char *source, int gt_id)
-{
-	struct udev_list_entry *list_entry;
-	bool dev_needs_reset = false;
-	bool tile_id_passed = false;
-	bool gt_id_matches = false;
-	const char *name, *val;
-
-	udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(device))
-	{
-		name = udev_list_entry_get_name(list_entry);
-		val = udev_list_entry_get_value(list_entry);
-
-		if (!strcmp(name, "DEVICE_STATUS") && !strcmp(val, "NEEDS_RESET")) {
-			igt_debug("%s = %s\n", name, val);
-			dev_needs_reset = true;
-			continue;
-		}
-
-		if (!strcmp(name, "TILE_ID")) {
-			igt_debug("%s = %s\n", name, val);
-			tile_id_passed = true;
-			continue;
-		}
-
-		if (!strcmp(name, "GT_ID") && (atoi(val) == gt_id)) {
-			igt_debug("%s = %s\n", name, val);
-			gt_id_matches = true;
-			continue;
-		}
-	}
-
-	return (dev_needs_reset && tile_id_passed && gt_id_matches);
-}
-
-static void fake_reset_uevent_listener(int fd, int gt_id)
-{
-	struct udev *udev;
-	struct udev_device *dev;
-	struct udev_monitor *mon;
-	bool event_received = false;
-	bool event_sent = false;
-	const u32 listener_timeout = 5;
-
-	/* create udev object */
-	udev = udev_new();
-	if (!udev)
-		igt_assert_f(false, "New udev object creation failed");
-
-	mon = udev_monitor_new_from_netlink(udev, "kernel");
-	udev_monitor_filter_add_match_subsystem_devtype(mon, "pci", NULL);
-	udev_monitor_enable_receiving(mon);
-	igt_until_timeout(listener_timeout) {
-		if (event_sent) {
-			dev = udev_monitor_receive_device(mon);
-			if (dev) {
-				event_received = listen_reset_fail_uevent(dev, "kernel", gt_id);
-				udev_device_unref(dev);
-			}
-		} else {
-			event_sent = true;
-			xe_fail_gt_reset(fd, gt_id);
-		}
-
-		if (event_received)
-			break;
-	}
-
-	udev_unref(udev);
-	igt_assert_f(event_received, "Event not received");
-}
-
-igt_main
-{
-	int fd;
-	int gt;
-	const u32 settle_xe_load_uevents = 50000;
-
-	igt_fixture
-		fd = drm_open_driver(DRIVER_XE);
-
-	/* Ensures uevents triggered in case of driver
-	 * load are settled down.
-	 */
-	usleep(settle_xe_load_uevents);
-
-	igt_subtest("fake_reset_uevent_listener")
-		xe_for_each_gt(fd, gt) {
-			fake_reset_uevent_listener(fd, gt);
-		}
-
-	igt_fixture
-		drm_close_driver(fd);
-}
diff --git a/tests/meson.build b/tests/meson.build
index a5f5c143c..6dbe45e93 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -307,7 +307,6 @@ intel_xe_progs = [
 	'xe_pm_residency',
 	'xe_prime_self_import',
 	'xe_query',
-	'xe_uevent',
 	'xe_vm',
 	'xe_waitfence',
 	'xe_spin_batch',
-- 
2.34.1

  parent reply	other threads:[~2023-12-15 15:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 15:50 [PATCH v1 00/10] uAPI Alignment - More cleanup before upstream Francois Dugast
2023-12-15 15:50 ` [PATCH v1 01/10] drm-uapi/xe: Align header with current kernel uAPI Francois Dugast
2023-12-15 15:50 ` [PATCH v1 02/10] drm-uapi/xe: add exec_queue_id member to drm_xe_wait_user_fence structure Francois Dugast
2023-12-15 15:50 ` [PATCH v1 03/10] drm-uapi/xe: Don't wait on user_fence during exec queue reset Francois Dugast
2023-12-15 15:50 ` [PATCH v1 04/10] drm-uapi/xe: Remove DRM_IOCTL_XE_EXEC_QUEUE_SET_PROPERTY Francois Dugast
2023-12-15 15:50 ` [PATCH v1 05/10] drm-uapi/xe: Remove DRM_XE_UFENCE_WAIT_MASK_* Francois Dugast
2023-12-15 15:50 ` [PATCH v1 06/10] drm-uapi/xe: Remove PMU from Xe till uapi is finalized Francois Dugast
2023-12-15 15:50 ` [PATCH v1 07/10] drm-uapi/xe: Ensure every uapi struct has drm_xe prefix Francois Dugast
2023-12-15 15:50 ` [PATCH v1 08/10] drm-uapi/xe: Remove sync binds Francois Dugast
2023-12-15 15:50 ` [PATCH v1 09/10] drm-uapi/xe: Update header after documentation updates Francois Dugast
2023-12-15 15:50 ` Francois Dugast [this message]
2023-12-15 15:56 ` [PATCH v1 00/10] uAPI Alignment - More cleanup before upstream Dixit, Ashutosh
2023-12-15 16:48   ` Rodrigo Vivi
2023-12-15 16:35 ` ✓ Fi.CI.BAT: success for uAPI Alignment - More cleanup before upstream (rev3) Patchwork
2023-12-15 16:59 ` ✗ CI.xeBAT: failure " Patchwork
2023-12-16  0:22 ` ✗ Fi.CI.IGT: " 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=20231215155050.7-11-francois.dugast@intel.com \
    --to=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@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