[PATCH] drm/xe/pf: Restore default PF scheduling on failed VF enable

Marcin Bernatowicz <[email protected]>
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
When VF enabling fails, xe_sriov_pf_unprovision_vfs() releases VF
resources but does not restore PF scheduling parameters set by
xe_gt_sriov_pf_config_set_fair_sched(). This leaves the PF with
scheduling parameters (exec_quantum, preempt_timeout) set
even though no VFs are enabled.

Add xe_sriov_pf_reprovision_default() to the failure path, mirroring
what pf_disable_vfs() already does on the normal disable path.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8126
Fixes: afc480ff55c5 ("drm/xe/pf: Perform fair scheduling auto-provisioning")
Signed-off-by: Marcin Bernatowicz <[email protected]>
Cc: Michal Wajdeczko <[email protected]>
---
 drivers/gpu/drm/xe/xe_pci_sriov.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
index 35e6b53e18ce..faac369501a6 100644
--- a/drivers/gpu/drm/xe/xe_pci_sriov.c
+++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
@@ -164,6 +164,7 @@ static int pf_enable_vfs(struct xe_device *xe, int num_vfs)
 	return num_vfs;
 
 failed:
+	xe_sriov_pf_reprovision_default(xe);
 	xe_sriov_pf_unprovision_vfs(xe, num_vfs);
 	xe_pm_runtime_put(xe);
 	pf_finish_vfs_enabling(xe);
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.