aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wajdeczko <[email protected]>2024-06-26 13:18:26 +0200
committerRodrigo Vivi <[email protected]>2024-06-26 18:25:35 -0400
commit8d789ff4a41a557de565b1778a7c620cbb22ae0e (patch)
tree1ee45bb43196562babe418ab43cc7ecc820f10da
parent80bab5c5038f32c92f5d26ff9df7255247c8dd89 (diff)
drm/xe/pf: Disable VFs on remove
We shouldn't leave VFs enabled when unloading the PF driver. Otherwise we will get a message like: [ ] xe 0000:4d:00.0: driver left SR-IOV enabled after remove 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] Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 21a1b7d2b2a9..f5d5a368e595 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -748,6 +748,11 @@ static void xe_pci_remove(struct pci_dev *pdev)
if (!xe) /* driver load aborted, nothing to cleanup */
return;
+#ifdef CONFIG_PCI_IOV
+ if (IS_SRIOV_PF(xe))
+ xe_pci_sriov_configure(pdev, 0);
+#endif
+
xe_device_remove(xe);
xe_pm_runtime_fini(xe);
pci_set_drvdata(pdev, NULL);