drm/xe: do not register to PM if GuC is disabled
authorOhad Sharabi <osharabi@habana.ai>
Thu, 28 Sep 2023 13:56:21 +0000 (16:56 +0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:41:21 +0000 (11:41 -0500)
When working without GuC (i.e. working with execlists), the flow
attempts to perform suspend operation which is failing due to a
lack of support without GuC.

If PM ops are not supported without GuC we may as well avoid PM
registration rather than returning errors from various PM flows.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_pm.c

index 1aa44d4f9ac1c80e67ba3468b14fa4461555c279..68cd9a7ee08727842bac1f2cc94c28b52b79b871 100644 (file)
@@ -641,10 +641,6 @@ int xe_gt_suspend(struct xe_gt *gt)
 {
        int err;
 
-       /* For now suspend/resume is only allowed with GuC */
-       if (!xe_device_uc_enabled(gt_to_xe(gt)))
-               return -ENODEV;
-
        xe_gt_sanitize(gt);
 
        xe_device_mem_access_get(gt_to_xe(gt));
index 2c2745f862237f56bf254942ebfe2a5858dac9f3..93a7658da324c514edeea0fd2fe76c8ff01bc656 100644 (file)
@@ -156,6 +156,10 @@ void xe_pm_init(struct xe_device *xe)
 {
        struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
 
+       /* For now suspend/resume is only allowed with GuC */
+       if (!xe_device_uc_enabled(xe))
+               return;
+
        drmm_mutex_init(&xe->drm, &xe->d3cold.lock);
 
        xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev);