[PATCH i-g-t 2/2] lib/igt_sysfs: Remove XE_SYSFS_DRIVER_UNBIND

Lucas De Marchi lucas.demarchi at intel.com
Fri Mar 14 14:46:11 UTC 2025


On Fri, Mar 14, 2025 at 10:55:05AM +0100, Francois Dugast wrote:
>xe_sysfs_driver_do() will be removed. The XE_SYSFS_DRIVER_UNBIND can
>already be removed because a proper alternative is already in place,
>so use it.
>
>Cc: Satyanarayana K V P <satyanarayana.k.v.p at intel.com>
>Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>Signed-off-by: Francois Dugast <francois.dugast at intel.com>
>---
> lib/igt_sysfs.c                  | 4 ----
> lib/igt_sysfs.h                  | 1 -
> tests/intel/xe_fault_injection.c | 2 +-
> 3 files changed, 1 insertion(+), 6 deletions(-)
>
>diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
>index 2e4c2ee63..a76af54eb 100644
>--- a/lib/igt_sysfs.c
>+++ b/lib/igt_sysfs.c
>@@ -1505,10 +1505,6 @@ int xe_sysfs_driver_do(int xe_device, char pci_slot[], enum xe_sysfs_driver_acti
> 		igt_sysfs_set(sysfs, "bind", pci_slot);
> 		close(sysfs);
> 		break;
>-	case XE_SYSFS_DRIVER_UNBIND:
>-		igt_assert(igt_sysfs_set(sysfs, "unbind", pci_slot));
>-		close(sysfs);
>-		break;
> 	case XE_SYSFS_DRIVER_REBIND:
> 		igt_assert(igt_sysfs_set(sysfs, "unbind", pci_slot));
>
>diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h
>index 86345f3d1..5bc733168 100644
>--- a/lib/igt_sysfs.h
>+++ b/lib/igt_sysfs.h
>@@ -186,7 +186,6 @@ int xe_sysfs_engine_open(int xe_device, int gt, int class);
> enum xe_sysfs_driver_action {
> 	XE_SYSFS_DRIVER_BIND,
> 	XE_SYSFS_DRIVER_TRY_BIND,
>-	XE_SYSFS_DRIVER_UNBIND,
> 	XE_SYSFS_DRIVER_REBIND,
> };
>
>diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
>index 5409d19a6..6307e0277 100644
>--- a/tests/intel/xe_fault_injection.c
>+++ b/tests/intel/xe_fault_injection.c
>@@ -394,7 +394,7 @@ igt_main
> 					exec_queue_create_fail(fd, hwe, s->name, s->flags);
>
> 	igt_fixture {
>-		xe_sysfs_driver_do(fd, pci_slot, XE_SYSFS_DRIVER_UNBIND);
>+		igt_kmod_unbind("xe", pci_slot);

I think this was wrong before... for this test we don't want to unbind
with the fd still open. So this should be:

		drm_close_driver(fd);
		igt_kmod_unbind("xe", pci_slot);

But also, I'm not sure what happens with these 3 fixtures we
have in this test. When are they executed?

Lucas De Marchi


More information about the igt-dev mailing list