From: Raag Jadav Date: Thu, 30 Oct 2025 12:23:56 +0000 (+0530) Subject: drm/xe/pm: Assert on runtime suspend if VFs are enabled X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6d2fe31a76d4960b0005e8fcb5eb66d00ed2e14;p=thirdparty%2Fkernel%2Flinux.git drm/xe/pm: Assert on runtime suspend if VFs are enabled We hold an additional reference to the runtime PM to keep PF in D0 during VFs lifetime, as our VFs do not implement the PM capability. This means we should never be runtime suspending as long as VFs are enabled. v8: Add !IS_SRIOV_VF() assert (Matthew Brost) Suggested-by: Daniele Ceraolo Spurio Signed-off-by: Raag Jadav Reviewed-by: Matthew Brost Signed-off-by: Ashutosh Dixit Link: https://patch.msgid.link/20251030122357.128825-4-raag.jadav@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 94abefa3d9ca4..763f588521d01 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -1160,6 +1160,15 @@ static int xe_pci_runtime_suspend(struct device *dev) struct xe_device *xe = pdev_to_xe_device(pdev); int err; + /* + * We hold an additional reference to the runtime PM to keep PF in D0 + * during VFs lifetime, as our VFs do not implement the PM capability. + * This means we should never be runtime suspending as long as VFs are + * enabled. + */ + xe_assert(xe, !IS_SRIOV_VF(xe)); + xe_assert(xe, !pci_num_vf(pdev)); + err = xe_pm_runtime_suspend(xe); if (err) return err;