Commit 7586fc52 authored by Stuart Summers's avatar Stuart Summers Committed by Matthew Brost

drm/xe: Fix missing workqueue destroy in xe_gt_pagefault

On driver reload we never free up the memory for the pagefault and
access counter workqueues. Add those destroy calls here.

Fixes: dd08ebf6 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: default avatarStuart Summers <stuart.summers@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c9a951505271dc3a7aee76de7656679f69c11518.1723862633.git.stuart.summers@intel.com
parent 23683061
...@@ -382,6 +382,18 @@ static void pf_queue_work_func(struct work_struct *w) ...@@ -382,6 +382,18 @@ static void pf_queue_work_func(struct work_struct *w)
static void acc_queue_work_func(struct work_struct *w); static void acc_queue_work_func(struct work_struct *w);
static void pagefault_fini(void *arg)
{
struct xe_gt *gt = arg;
struct xe_device *xe = gt_to_xe(gt);
if (!xe->info.has_usm)
return;
destroy_workqueue(gt->usm.acc_wq);
destroy_workqueue(gt->usm.pf_wq);
}
int xe_gt_pagefault_init(struct xe_gt *gt) int xe_gt_pagefault_init(struct xe_gt *gt)
{ {
struct xe_device *xe = gt_to_xe(gt); struct xe_device *xe = gt_to_xe(gt);
...@@ -409,10 +421,12 @@ int xe_gt_pagefault_init(struct xe_gt *gt) ...@@ -409,10 +421,12 @@ int xe_gt_pagefault_init(struct xe_gt *gt)
gt->usm.acc_wq = alloc_workqueue("xe_gt_access_counter_work_queue", gt->usm.acc_wq = alloc_workqueue("xe_gt_access_counter_work_queue",
WQ_UNBOUND | WQ_HIGHPRI, WQ_UNBOUND | WQ_HIGHPRI,
NUM_ACC_QUEUE); NUM_ACC_QUEUE);
if (!gt->usm.acc_wq) if (!gt->usm.acc_wq) {
destroy_workqueue(gt->usm.pf_wq);
return -ENOMEM; return -ENOMEM;
}
return 0; return devm_add_action_or_reset(xe->drm.dev, pagefault_fini, gt);
} }
void xe_gt_pagefault_reset(struct xe_gt *gt) void xe_gt_pagefault_reset(struct xe_gt *gt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment