From: Michal Wajdeczko Date: Wed, 26 Jun 2024 11:18:26 +0000 (+0200) Subject: drm/xe/pf: Disable VFs on remove X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8d789ff4a41a557de565b1778a7c620cbb22ae0e;p=users%2Fdwmw2%2Flinux.git 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 Cc: Piotr Piórkowski Reviewed-by: Piotr Piórkowski Link: https://patchwork.freedesktop.org/patch/msgid/20240626111827.1389-2-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 21a1b7d2b2a94..f5d5a368e5959 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);