File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,18 @@ static void pf_queue_work_func(struct work_struct *w)
382
382
383
383
static void acc_queue_work_func (struct work_struct * w );
384
384
385
+ static void pagefault_fini (void * arg )
386
+ {
387
+ struct xe_gt * gt = arg ;
388
+ struct xe_device * xe = gt_to_xe (gt );
389
+
390
+ if (!xe -> info .has_usm )
391
+ return ;
392
+
393
+ destroy_workqueue (gt -> usm .acc_wq );
394
+ destroy_workqueue (gt -> usm .pf_wq );
395
+ }
396
+
385
397
int xe_gt_pagefault_init (struct xe_gt * gt )
386
398
{
387
399
struct xe_device * xe = gt_to_xe (gt );
@@ -409,10 +421,12 @@ int xe_gt_pagefault_init(struct xe_gt *gt)
409
421
gt -> usm .acc_wq = alloc_workqueue ("xe_gt_access_counter_work_queue" ,
410
422
WQ_UNBOUND | WQ_HIGHPRI ,
411
423
NUM_ACC_QUEUE );
412
- if (!gt -> usm .acc_wq )
424
+ if (!gt -> usm .acc_wq ) {
425
+ destroy_workqueue (gt -> usm .pf_wq );
413
426
return - ENOMEM ;
427
+ }
414
428
415
- return 0 ;
429
+ return devm_add_action_or_reset ( xe -> drm . dev , pagefault_fini , gt ) ;
416
430
}
417
431
418
432
void xe_gt_pagefault_reset (struct xe_gt * gt )
You can’t perform that action at this time.
0 commit comments