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

Dong, Zhanjun
2026-01-20T22:56:59Z

On 2026-01-20 3:37 p.m., Matthew Brost wrote:
> On Tue, Jan 20, 2026 at 03:16:21PM -0500, Zhanjun Dong wrote:
>> 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>
>
> Since patch #2 is a fixes and this fixes patch #2, can we squash this
> patch into patch #2?
>
> Aside from that, I do think this is correct as guc_submit_fini now
> initiates a hardware teardown so this should be the DEVM handler.
>
> Matt
To be squashed in next rev.

Zhanjun
>
>> ---
>> 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
>>