Skip to contentSkip to conversation

drm/xe/xe_survivability: Fix runtime survivability error handling

PATCH Superseded Mallesh Koujalagi 2 participants 2 messages Apr 16

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/xe/xe_survivability: Fix runtime survivability error handling

xe_survivability_mode_runtime_enable() returns an int, but its caller csc_hw_error_work() cannot take any meaningful recovery action on failure. The function already handles all internal errors via dev_err() and proceeds to enable survivability mode regardless of sysfs creation failure.

Change the return type to void and drop unnecessary error handling in csc_hw_error_work().

v2:
- Return is not require after the sysfs creation fail. (Rodrigo/Riana)
- Change int to void return type. (Rodrigo)
- Remove extra message from csc_hw_error_work().

v3:
- Remove ret variable (Raag)

Fixes a2ca0633a0fe ("drm/xe/xe_survivability: Add support for Runtime survivability mode")
---
 drivers/gpu/drm/xe/xe_hw_error.c           | 5 +----
 drivers/gpu/drm/xe/xe_survivability_mode.c | 9 ++-------
 drivers/gpu/drm/xe/xe_survivability_mode.h | 2 +-
 3 files changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/xe/xe_hw_error.c +1 -4
index 2a31b430570e..64d2260e761b 100644
@@ -169,11 +169,8 @@ static void csc_hw_error_work(struct work_struct *work)
 {
 	struct xe_tile *tile = container_of(work, typeof(*tile), csc_hw_error_work);
 	struct xe_device *xe = tile_to_xe(tile);
-	int ret;
 
-	ret = xe_survivability_mode_runtime_enable(xe);
-	if (ret)
-		drm_err(&xe->drm, "Failed to enable runtime survivability mode\n");
+	xe_survivability_mode_runtime_enable(xe);
 }
 
 static void csc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)
drivers/gpu/drm/xe/xe_survivability_mode.c +2 -7
index db64cac39c94..b16c2ad9aa15 100644
@@ -396,18 +396,15 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
  * Runtime survivability mode is enabled when certain errors cause the device to be
  * in non-recoverable state. The device is declared wedged with the appropriate
  * recovery method and survivability mode sysfs exposed to userspace
- *
- * Return: 0 if runtime survivability mode is enabled, negative error code otherwise.
  */
-int xe_survivability_mode_runtime_enable(struct xe_device *xe)
+void xe_survivability_mode_runtime_enable(struct xe_device *xe)
 {
 	struct xe_survivability *survivability = &xe->survivability;
 	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
-	int ret;
 
 	if (!IS_DGFX(xe) || IS_SRIOV_VF(xe) || xe->info.platform < XE_BATTLEMAGE) {
 		dev_err(&pdev->dev, "Runtime Survivability Mode not supported\n");
-		return -EINVAL;
+		return;
 	}
 
 	populate_survivability_info(xe);
@@ -422,8 +419,6 @@ int xe_survivability_mode_runtime_enable(struct xe_device *xe)
 	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_VENDOR);
 	xe_device_declare_wedged(xe);
 	dev_err(&pdev->dev, "Firmware flash required, Please refer to the userspace documentation for more details!\n");
-
-	return 0;
 }
 
 /**
drivers/gpu/drm/xe/xe_survivability_mode.h +1 -1
index 1cc94226aa82..cd040e4d18bb 100644
@@ -11,7 +11,7 @@
 struct xe_device;
 
 int xe_survivability_mode_boot_enable(struct xe_device *xe);
-int xe_survivability_mode_runtime_enable(struct xe_device *xe);
+void xe_survivability_mode_runtime_enable(struct xe_device *xe);
 bool xe_survivability_mode_is_boot_enabled(struct xe_device *xe);
 bool xe_survivability_mode_is_requested(struct xe_device *xe);
 
Signature · 1 line
2.34.1
#1 lore raw

✗ CI.KUnit: failure for drm/xe/xe_survivability: Fix runtime survivability error handling (rev3)

== Series Details ==

== Series Details ==

Series: drm/xe/xe_survivability: Fix runtime survivability error handling (rev3)
URL : https://patchwork.freedesktop.org/series/164855/
State : failure

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig ERROR:root:../drivers/gpu/drm/xe/xe_survivability_mode.c: In function ‘xe_survivability_mode_runtime_enable’:
../drivers/gpu/drm/xe/xe_survivability_mode.c:412:9: error: ‘ret’ undeclared (first use in this function); did you mean ‘net’?

  412 |         ret = create_survivability_sysfs(pdev);
      |         ^~~
      |         net

../drivers/gpu/drm/xe/xe_survivability_mode.c:412:9: note: each undeclared identifier is reported only once for each function it appears in make[7]: *** [../scripts/Makefile.build:289: drivers/gpu/drm/xe/xe_survivability_mode.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [../scripts/Makefile.build:549: drivers/gpu/drm/xe] Error 2
make[5]: *** [../scripts/Makefile.build:549: drivers/gpu/drm] Error 2
make[4]: *** [../scripts/Makefile.build:549: drivers/gpu] Error 2
make[3]: *** [../scripts/Makefile.build:549: drivers] Error 2
make[2]: *** [/kernel/Makefile:2105: .] Error 2
make[1]: *** [/kernel/Makefile:248: __sub-make] Error 2
make: *** [Makefile:248: __sub-make] Error 2

[23:25:22] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[23:25:26] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel