Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie parent bridge device
@ 2023-05-08  9:17 Anshuman Gupta
  2023-05-08  9:22 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Anshuman Gupta @ 2023-05-08  9:17 UTC (permalink / raw)
  To: intel-xe; +Cc: Anshuman Gupta, rodrigo.vivi

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 state therefore
assert drm_WARN_ON() on unbounded VSP.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/xe/xe_pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 19ead642442e..dc0d5cb4950b 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -667,12 +667,24 @@ static void xe_pci_shutdown(struct pci_dev *pdev)
 	xe_device_shutdown(pdev_to_xe_device(pdev));
 }
 
+static void xe_assert_on_unbounded_bridge(struct pci_dev *pdev)
+{
+	struct pci_dev *bridge = pci_upstream_bridge(pdev);
+	struct xe_device *xe = pdev_to_xe_device(pdev);
+
+	if (!bridge)
+		return;
+
+	drm_WARN_ON(&xe->drm, !bridge->driver);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int xe_pci_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	int err;
 
+	xe_assert_on_unbounded_bridge(pdev);
 	err = xe_pm_suspend(pdev_to_xe_device(pdev));
 	if (err)
 		return err;
@@ -718,6 +730,7 @@ static int xe_pci_runtime_suspend(struct device *dev)
 	struct xe_device *xe = pdev_to_xe_device(pdev);
 	int err;
 
+	xe_assert_on_unbounded_bridge(pdev);
 	err = xe_pm_runtime_suspend(xe);
 	if (err)
 		return err;
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-09 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-08  9:17 [Intel-xe] [PATCH] drm/xe/pm: WARN_ON() on unbounded pcie parent bridge device Anshuman Gupta
2023-05-08  9:22 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-05-08  9:23 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-08  9:27 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-08  9:52 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-05-08 17:14 ` [Intel-xe] [PATCH] " Rodrigo Vivi
2023-05-09  3:20   ` Gupta, Anshuman
2023-05-09 17:26     ` Rodrigo Vivi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox