Skip to content

Commit d3b80dc

Browse files
committed
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: ac6598a ("drm/xe/pf: Add support to configure SR-IOV VFs") Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Piotr Piórkowski <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 783d6cd commit d3b80dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,14 +1932,17 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin
19321932
const struct drm_mm *mm = &ggtt->mm;
19331933
const struct drm_mm_node *entry;
19341934
u64 alignment = pf_get_ggtt_alignment(gt);
1935-
u64 spare = pf_get_spare_ggtt(gt);
19361935
u64 hole_min_start = xe_wopcm_size(gt_to_xe(gt));
19371936
u64 hole_start, hole_end, hole_size;
1938-
u64 avail, total = 0;
1937+
u64 spare, avail, total = 0;
19391938
char buf[10];
19401939

19411940
xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
19421941

1942+
mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
1943+
1944+
spare = pf_get_spare_ggtt(gt);
1945+
19431946
mutex_lock(&ggtt->lock);
19441947

19451948
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
19571960
}
19581961

19591962
mutex_unlock(&ggtt->lock);
1963+
mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
19601964

19611965
string_get_size(total, 1, STRING_UNITS_2, buf, sizeof(buf));
19621966
drm_printf(p, "total:\t%llu\t(%s)\n", total, buf);

0 commit comments

Comments
 (0)