Skip to content

Commit 6dbcb80

Browse files
committed
Merge tag 'drm-xe-fixes-2025-11-27' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Fix resource leak in xe_guc_ct_init_noalloc()'s error path (Shuicheng Lin) - Fix stack_depot usage without STACKDEPOT_ALWAYS_INIT (Lucas) - Fix overflow in conversion from clock tics to msec (Harish Chegondi) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patch.msgid.link/7ejiqjgthpqybg5svmkind2pszk4fqadxuq7rngchaaw76iept@5pn6sngqj6lk
2 parents 26c7a18 + 7276878 commit 6dbcb80

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

drivers/gpu/drm/xe/xe_gt_clock.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ int xe_gt_clock_init(struct xe_gt *gt)
9393
return 0;
9494
}
9595

96-
static u64 div_u64_roundup(u64 n, u32 d)
97-
{
98-
return div_u64(n + d - 1, d);
99-
}
100-
10196
/**
10297
* xe_gt_clock_interval_to_ms - Convert sampled GT clock ticks to msec
10398
*
@@ -108,5 +103,5 @@ static u64 div_u64_roundup(u64 n, u32 d)
108103
*/
109104
u64 xe_gt_clock_interval_to_ms(struct xe_gt *gt, u64 count)
110105
{
111-
return div_u64_roundup(count * MSEC_PER_SEC, gt->info.reference_clock);
106+
return mul_u64_u32_div(count, MSEC_PER_SEC, gt->info.reference_clock);
112107
}

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
226226

227227
xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE));
228228

229+
err = drmm_mutex_init(&xe->drm, &ct->lock);
230+
if (err)
231+
return err;
232+
233+
primelockdep(ct);
234+
229235
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", WQ_MEM_RECLAIM);
230236
if (!ct->g2h_wq)
231237
return -ENOMEM;
@@ -237,16 +243,13 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
237243
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
238244
spin_lock_init(&ct->dead.lock);
239245
INIT_WORK(&ct->dead.worker, ct_dead_worker_func);
246+
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
247+
stack_depot_init();
248+
#endif
240249
#endif
241250
init_waitqueue_head(&ct->wq);
242251
init_waitqueue_head(&ct->g2h_fence_wq);
243252

244-
err = drmm_mutex_init(&xe->drm, &ct->lock);
245-
if (err)
246-
return err;
247-
248-
primelockdep(ct);
249-
250253
err = drmm_add_action_or_reset(&xe->drm, guc_ct_fini, ct);
251254
if (err)
252255
return err;

0 commit comments

Comments
 (0)