Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/xe_gt_debugfs: Add synchronous gt reset debugfs
@ 2024-06-05 15:08 Jonathan Cavitt
  2024-06-05 15:28 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Jonathan Cavitt @ 2024-06-05 15:08 UTC (permalink / raw)
  To: intel-xe
  Cc: saurabhg.gupta, jonathan.cavitt, matthew.brost, john.c.harrison,
	stuart.summers

We currently have debugfs support that allows the userspace to initiate
an asynchronous gt reset on command.  However, userspace may also wish
to wait for the completion of the gt reset before performing any
additional work.  To that end, add a version of the force_reset gt
debugfs function that operates synchronously.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1068
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
CC: John Harrison <john.c.harrison@intel.com>
CC: Stuart Summers <stuart.summers@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_debugfs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
index 66f897a9b6ca9..5e7fd937917a1 100644
--- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
@@ -116,6 +116,17 @@ static int force_reset(struct xe_gt *gt, struct drm_printer *p)
 	return 0;
 }
 
+static int force_reset_sync(struct xe_gt *gt, struct drm_printer *p)
+{
+	xe_pm_runtime_get(gt_to_xe(gt));
+	xe_gt_reset_async(gt);
+	xe_pm_runtime_put(gt_to_xe(gt));
+
+	flush_work(&gt->reset.worker);
+
+	return 0;
+}
+
 static int sa_info(struct xe_gt *gt, struct drm_printer *p)
 {
 	struct xe_tile *tile = gt_to_tile(gt);
@@ -261,6 +272,7 @@ static int vecs_default_lrc(struct xe_gt *gt, struct drm_printer *p)
 static const struct drm_info_list debugfs_list[] = {
 	{"hw_engines", .show = xe_gt_debugfs_simple_show, .data = hw_engines},
 	{"force_reset", .show = xe_gt_debugfs_simple_show, .data = force_reset},
+	{"force_reset_sync", .show = xe_gt_debugfs_simple_show, .data = force_reset_sync},
 	{"sa_info", .show = xe_gt_debugfs_simple_show, .data = sa_info},
 	{"topology", .show = xe_gt_debugfs_simple_show, .data = topology},
 	{"steering", .show = xe_gt_debugfs_simple_show, .data = steering},
-- 
2.25.1


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

end of thread, other threads:[~2024-06-06 17:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 15:08 [PATCH] drm/xe/xe_gt_debugfs: Add synchronous gt reset debugfs Jonathan Cavitt
2024-06-05 15:28 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-05 15:28 ` ✓ CI.checkpatch: " Patchwork
2024-06-05 15:29 ` ✓ CI.KUnit: " Patchwork
2024-06-05 15:41 ` ✓ CI.Build: " Patchwork
2024-06-05 15:41 ` ✗ CI.Hooks: failure " Patchwork
2024-06-05 15:42 ` ✓ CI.checksparse: success " Patchwork
2024-06-05 16:19 ` [PATCH] " Matthew Brost
2024-06-05 16:26 ` ✓ CI.BAT: success for " Patchwork
2024-06-05 22:09 ` [PATCH] " Rodrigo Vivi
2024-06-06 14:11   ` Cavitt, Jonathan
2024-06-06 16:25     ` Rodrigo Vivi
2024-06-06 16:38       ` Cavitt, Jonathan
2024-06-06 17:33         ` Rodrigo Vivi
2024-06-06 17:35         ` Lucas De Marchi
2024-06-06 17:37           ` Matthew Brost
2024-06-06 17:45             ` Cavitt, Jonathan
2024-06-06  9:45 ` ✗ CI.FULL: failure for " Patchwork

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