Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/1] drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class
@ 2025-04-05  6:54 Sobin Thomas
  2025-04-05  7:14 ` ✓ CI.Patch_applied: success for series starting with [i-g-t,1/1] " Patchwork
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sobin Thomas @ 2025-04-05  6:54 UTC (permalink / raw)
  To: intel-xe; +Cc: tejas.upadhyay

- Added fault injection for `kobj_xe_hw_engine_class` to enhance coverage.
- Improved error handling by checking for `IS_ERR_OR_NULL` on `keclass` and
  propagating the error using `PTR_ERR`.

Can be tested using inject-fault-probe-function-kobj_xe_hw_engine_class

Signed-off-by: Sobin Thomas <sobin.thomas@intel.com>
---
 drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
index 640950172088..0cafe1175389 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c
@@ -571,6 +571,7 @@ kobj_xe_hw_engine_class(struct xe_device *xe, struct kobject *parent, const char
 
 	return keclass;
 }
+ALLOW_ERROR_INJECTION(kobj_xe_hw_engine_class, NULL);
 
 static void hw_engine_class_defaults_fini(void *arg)
 {
@@ -662,8 +663,8 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)
 		}
 
 		keclass = kobj_xe_hw_engine_class(xe, kobj, name);
-		if (!keclass) {
-			err = -EINVAL;
+		if (IS_ERR_OR_NULL(keclass)) {
+			err = PTR_ERR(keclass);
 			goto err_object;
 		}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-04-07 20:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-05  6:54 [PATCH i-g-t 1/1] drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class Sobin Thomas
2025-04-05  7:14 ` ✓ CI.Patch_applied: success for series starting with [i-g-t,1/1] " Patchwork
2025-04-05  7:15 ` ✓ CI.checkpatch: " Patchwork
2025-04-05  7:16 ` ✓ CI.KUnit: " Patchwork
2025-04-05  7:32 ` ✓ CI.Build: " Patchwork
2025-04-05  7:35 ` ✓ CI.Hooks: " Patchwork
2025-04-05  7:36 ` ✓ CI.checksparse: " Patchwork
2025-04-07  3:30 ` [PATCH i-g-t 1/1] " Upadhyay, Tejas
2025-04-07 13:25 ` ✓ CI.Patch_applied: success for series starting with [i-g-t,1/1] drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class (rev2) Patchwork
2025-04-07 13:25 ` ✓ CI.checkpatch: " Patchwork
2025-04-07 13:27 ` ✓ CI.KUnit: " Patchwork
2025-04-07 13:30 ` ✗ CI.Build: failure " Patchwork
2025-04-07 20:13 ` ✓ Xe.CI.Full: success for series starting with [i-g-t,1/1] drm/xe: xe_hw_engine_class: Add fault injection and improve error handling in kobj_xe_hw_engine_class Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox