[PATCH v3 6/6] drm/xe/guc: Fix page fault by moving guc_submit_fini to devm

Zhanjun Dong
2026-01-20T20:16:30Z

guc_submit_fini requires access to device memory. Using a device-managed
action guarantees the correct ordering of cleanup relative to memory
unmapping.

Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index c848615d6057..f29ed62d2b12 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -241,7 +241,7 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q)

static int __xe_guc_submit_reset_prepare(struct xe_guc *guc);

-static void guc_submit_fini(struct drm_device *drm, void *arg)
+static void guc_submit_fini(void *arg)
{
struct xe_guc *guc = arg;
struct xe_device *xe = guc_to_xe(guc);
@@ -334,7 +334,7 @@ int xe_guc_submit_init(struct xe_guc *guc, unsigned int num_ids)

guc->submission_state.initialized = true;

- return drmm_add_action_or_reset(&xe->drm, guc_submit_fini, guc);
+ return devm_add_action_or_reset(xe->drm.dev, guc_submit_fini, guc);
}

/*
--
2.34.1