drm/xe/pm: Disable PM on unbounded pcie parent bridge
authorAnshuman Gupta <anshuman.gupta@intel.com>
Wed, 24 May 2023 09:06:53 +0000 (14:36 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:35:05 +0000 (11:35 -0500)
Intel Discrete GFX cards gfx may have multiple PCIe endpoints,
they connects to root port via pcie upstream switch port(USP)
and virtual pcie switch port(VSP), sometimes VSP pcie devices
doesn't bind to pcieport driver. Without pcieport driver, pcie PM
comes without any warranty and with unbounded VSP gfx card won't
transition to low power pcie Device and Link states therefore
assert drm_warn on unbounded VSP and disable xe driver
PM support.

v2:
- Disable Xe PCI PM support. [Rodrigo]
v3:
- Changed subject and Rebase.
v4:
- %s/xe_pci_unbounded_bridge_disable_pm/xe_assert_on_unbounded_bridge.
  [Rodrigo]
- Use device_set_pm_not_required() instead of dev_pm_ops NULL assignment.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230524090653.1192566-1-anshuman.gupta@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_pm.c
drivers/gpu/drm/xe/xe_pm.h

index 71be80274683dcb14f3a475ae773d99da38ad229..96f1ee1ea17f40a450914ebdfc20dd3165d916e7 100644 (file)
@@ -617,6 +617,7 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (IS_ERR(xe))
                return PTR_ERR(xe);
 
+       xe_pm_assert_unbounded_bridge(xe);
        subplatform_desc = find_subplatform(xe, desc);
 
        err = xe_info_init(xe, desc, subplatform_desc);
index 9a74d15052c4957075ecb4b76a55313df78abafe..20e9e522ab805f6049a450e2d628176d54700122 100644 (file)
@@ -214,3 +214,17 @@ int xe_pm_runtime_get_if_active(struct xe_device *xe)
        WARN_ON(pm_runtime_suspended(xe->drm.dev));
        return pm_runtime_get_if_active(xe->drm.dev, true);
 }
+
+void xe_pm_assert_unbounded_bridge(struct xe_device *xe)
+{
+       struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
+       struct pci_dev *bridge = pci_upstream_bridge(pdev);
+
+       if (!bridge)
+               return;
+
+       if (!bridge->driver) {
+               drm_warn(&xe->drm, "unbounded parent pci bridge, device won't support any PM support.\n");
+               device_set_pm_not_required(&pdev->dev);
+       }
+}
index 6a885585f65349dfa5591ba9e31c8c80d01edde5..8418ee6faac5f621f32cea6674b5025875efdf11 100644 (file)
@@ -21,5 +21,6 @@ int xe_pm_runtime_get(struct xe_device *xe);
 int xe_pm_runtime_put(struct xe_device *xe);
 bool xe_pm_runtime_resume_if_suspended(struct xe_device *xe);
 int xe_pm_runtime_get_if_active(struct xe_device *xe);
+void xe_pm_assert_unbounded_bridge(struct xe_device *xe);
 
 #endif