Skip to content

Commit da6ec74

Browse files
committed
drm/xe/pf: Reset thresholds when releasing a VF config
As part of the VF config release, we should reset all parameters, including thresholds, to always start with the clean VF config. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a1498ab commit da6ec74

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,18 @@ u32 xe_gt_sriov_pf_config_get_threshold(struct xe_gt *gt, unsigned int vfid,
18421842
return value;
18431843
}
18441844

1845+
static void pf_reset_config_thresholds(struct xe_gt *gt, struct xe_gt_sriov_config *config)
1846+
{
1847+
lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));
1848+
1849+
#define reset_threshold_config(TAG, ...) ({ \
1850+
config->thresholds[MAKE_XE_GUC_KLV_THRESHOLD_INDEX(TAG)] = 0; \
1851+
});
1852+
1853+
MAKE_XE_GUC_KLV_THRESHOLDS_SET(reset_threshold_config);
1854+
#undef reset_threshold_config
1855+
}
1856+
18451857
static void pf_release_vf_config(struct xe_gt *gt, unsigned int vfid)
18461858
{
18471859
struct xe_gt_sriov_config *config = pf_pick_vf_config(gt, vfid);
@@ -1857,6 +1869,7 @@ static void pf_release_vf_config(struct xe_gt *gt, unsigned int vfid)
18571869
pf_release_config_ctxs(gt, config);
18581870
pf_release_config_dbs(gt, config);
18591871
pf_reset_config_sched(gt, config);
1872+
pf_reset_config_thresholds(gt, config);
18601873
}
18611874

18621875
/**

0 commit comments

Comments
 (0)