@@ -1932,14 +1932,17 @@ int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_prin
1932
1932
const struct drm_mm * mm = & ggtt -> mm ;
1933
1933
const struct drm_mm_node * entry ;
1934
1934
u64 alignment = pf_get_ggtt_alignment (gt );
1935
- u64 spare = pf_get_spare_ggtt (gt );
1936
1935
u64 hole_min_start = xe_wopcm_size (gt_to_xe (gt ));
1937
1936
u64 hole_start , hole_end , hole_size ;
1938
- u64 avail , total = 0 ;
1937
+ u64 spare , avail , total = 0 ;
1939
1938
char buf [10 ];
1940
1939
1941
1940
xe_gt_assert (gt , IS_SRIOV_PF (gt_to_xe (gt )));
1942
1941
1942
+ mutex_lock (xe_gt_sriov_pf_master_mutex (gt ));
1943
+
1944
+ spare = pf_get_spare_ggtt (gt );
1945
+
1943
1946
mutex_lock (& ggtt -> lock );
1944
1947
1945
1948
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
1960
}
1958
1961
1959
1962
mutex_unlock (& ggtt -> lock );
1963
+ mutex_unlock (xe_gt_sriov_pf_master_mutex (gt ));
1960
1964
1961
1965
string_get_size (total , 1 , STRING_UNITS_2 , buf , sizeof (buf ));
1962
1966
drm_printf (p , "total:\t%llu\t(%s)\n" , total , buf );
0 commit comments