1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 17:10:13 +00:00

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)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAmko6kgACgkQm6KlpjDL
 6lO84A/6ArsDA9pMeWtk/GHQTL20ABV8LiSfrlC2VMum1agafXdIFZ2ookpyoKI8
 9nzNiFGQJT7V55psamWs25DI+LF//7vq4btNdYunzUk5p+LZOvYtx72MPhdCS4/F
 AfET4NXVtpcOTd+4Lro4zjfUZGB/qObMWRHQKAKXcr5vFhDUHpk1wQgnApKoL8uZ
 4G+GAVpDxW4bhagrNgQD0i6ZrwUWA1mJAyrTbwuYrQp1kZPCfZ7LIQEot+8rcNaB
 ZFKDjr2w2DIt/ue5yx3SLbVIuqZS8GOQMdVH7b6RVgpjEgqBcTQM3vKSt0KFC+71
 8wBs8D6SR+ZR5Guw2qvhobPfea/0pya7WP+8Nv678QnoIcAylMBG9bs5oyR9RoSB
 GNonR/WA69nhH20OEU6h5zjbvdsfo0ICFrBiUHH0njwpFDb9TdJ/LAzVCurvl29p
 gwUcc4v04YrG+Do/NSAH3esGDP2k5e//XD6bgkcZgGpO/Mx4AMHO1dmdtQav1PbY
 m8roRI2fo6TV+LHggLSp2zCP7CRq8t0h03g3Ufx1xDwg5oZ7PLz3ZHSz2LZCoavg
 i3AZtsHszJ3r/uXJePpvJK3qV1F3cv3QdwBl7M3rlrQgTymDsps0d4z8TrTeeI2w
 AUWd9pFunZvFvvQvKzbgfUr3Eq7/22jw4FQpyEpbi/vD1tU1b14=
 =ue6Q
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Dave Airlie 2025-11-28 12:10:19 +10:00
commit 6dbcb801e1
2 changed files with 10 additions and 12 deletions

View File

@ -93,11 +93,6 @@ int xe_gt_clock_init(struct xe_gt *gt)
return 0;
}
static u64 div_u64_roundup(u64 n, u32 d)
{
return div_u64(n + d - 1, d);
}
/**
* xe_gt_clock_interval_to_ms - Convert sampled GT clock ticks to msec
*
@ -108,5 +103,5 @@ static u64 div_u64_roundup(u64 n, u32 d)
*/
u64 xe_gt_clock_interval_to_ms(struct xe_gt *gt, u64 count)
{
return div_u64_roundup(count * MSEC_PER_SEC, gt->info.reference_clock);
return mul_u64_u32_div(count, MSEC_PER_SEC, gt->info.reference_clock);
}

View File

@ -226,6 +226,12 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE));
err = drmm_mutex_init(&xe->drm, &ct->lock);
if (err)
return err;
primelockdep(ct);
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", WQ_MEM_RECLAIM);
if (!ct->g2h_wq)
return -ENOMEM;
@ -237,16 +243,13 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
spin_lock_init(&ct->dead.lock);
INIT_WORK(&ct->dead.worker, ct_dead_worker_func);
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
stack_depot_init();
#endif
#endif
init_waitqueue_head(&ct->wq);
init_waitqueue_head(&ct->g2h_fence_wq);
err = drmm_mutex_init(&xe->drm, &ct->lock);
if (err)
return err;
primelockdep(ct);
err = drmm_add_action_or_reset(&xe->drm, guc_ct_fini, ct);
if (err)
return err;