Commit d3b80dc7 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe/pf: Fix xe_gt_sriov_pf_config_print_available_ggtt()

This function is using internal helper pf_get_spare_ggtt() that
expects PF's master mutex to be locked. Fix that.

Fixes: ac6598ae ("drm/xe/pf: Add support to configure SR-IOV VFs")
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Reviewed-by: default avatarPiotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240419141000.314-1-michal.wajdeczko@intel.com
parent 783d6cdc
...@@ -1932,14 +1932,17 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin ...@@ -1932,14 +1932,17 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin
const struct drm_mm *mm = &ggtt->mm; const struct drm_mm *mm = &ggtt->mm;
const struct drm_mm_node *entry; const struct drm_mm_node *entry;
u64 alignment = pf_get_ggtt_alignment(gt); u64 alignment = pf_get_ggtt_alignment(gt);
u64 spare = pf_get_spare_ggtt(gt);
u64 hole_min_start = xe_wopcm_size(gt_to_xe(gt)); u64 hole_min_start = xe_wopcm_size(gt_to_xe(gt));
u64 hole_start, hole_end, hole_size; u64 hole_start, hole_end, hole_size;
u64 avail, total = 0; u64 spare, avail, total = 0;
char buf[10]; char buf[10];
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt))); xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
spare = pf_get_spare_ggtt(gt);
mutex_lock(&ggtt->lock); mutex_lock(&ggtt->lock);
drm_mm_for_each_hole(entry, mm, hole_start, hole_end) { drm_mm_for_each_hole(entry, mm, hole_start, hole_end) {
...@@ -1957,6 +1960,7 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin ...@@ -1957,6 +1960,7 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin
} }
mutex_unlock(&ggtt->lock); mutex_unlock(&ggtt->lock);
mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
string_get_size(total, 1, STRING_UNITS_2, buf, sizeof(buf)); string_get_size(total, 1, STRING_UNITS_2, buf, sizeof(buf));
drm_printf(p, "total:\t%llu\t(%s)\n", total, buf); drm_printf(p, "total:\t%llu\t(%s)\n", total, buf);
......
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