mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
drm/xe/pf: Prefer guard(mutex) when doing fair LMEM provisioning
We will add more code there and with guard() it will easier to avoid mistakes in unlocking. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://patch.msgid.link/20260218205553.3561-9-michal.wajdeczko@intel.com
This commit is contained in:
parent
62acbb1dd5
commit
67a716b693
|
|
@ -1945,10 +1945,9 @@ int xe_gt_sriov_pf_config_set_fair_lmem(struct xe_gt *gt, unsigned int vfid,
|
|||
if (!xe_device_has_lmtt(gt_to_xe(gt)))
|
||||
return 0;
|
||||
|
||||
mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
|
||||
fair = pf_estimate_fair_lmem(gt, num_vfs);
|
||||
mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
|
||||
guard(mutex)(xe_gt_sriov_pf_master_mutex(gt));
|
||||
|
||||
fair = pf_estimate_fair_lmem(gt, num_vfs);
|
||||
if (!fair)
|
||||
return -ENOSPC;
|
||||
|
||||
|
|
@ -1958,7 +1957,7 @@ int xe_gt_sriov_pf_config_set_fair_lmem(struct xe_gt *gt, unsigned int vfid,
|
|||
xe_gt_sriov_info(gt, "Using non-profile provisioning (%s %llu vs %llu)\n",
|
||||
"VRAM", fair, profile);
|
||||
|
||||
return xe_gt_sriov_pf_config_bulk_set_lmem(gt, vfid, num_vfs, fair);
|
||||
return xe_gt_sriov_pf_config_bulk_set_lmem_locked(gt, vfid, num_vfs, fair);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user