@@ -443,7 +443,6 @@ static int i915_pcode_init(struct drm_i915_private *i915)
443
443
static int i915_driver_hw_probe (struct drm_i915_private * dev_priv )
444
444
{
445
445
struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
446
- struct pci_dev * root_pdev ;
447
446
int ret ;
448
447
449
448
if (i915_inject_probe_failure (dev_priv ))
@@ -557,15 +556,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
557
556
558
557
intel_bw_init_hw (dev_priv );
559
558
560
- /*
561
- * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
562
- * This should be totally removed when we handle the pci states properly
563
- * on runtime PM and on s2idle cases.
564
- */
565
- root_pdev = pcie_find_root_port (pdev );
566
- if (root_pdev )
567
- pci_d3cold_disable (root_pdev );
568
-
569
559
return 0 ;
570
560
571
561
err_opregion :
@@ -591,18 +581,13 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
591
581
static void i915_driver_hw_remove (struct drm_i915_private * dev_priv )
592
582
{
593
583
struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
594
- struct pci_dev * root_pdev ;
595
584
596
585
i915_perf_fini (dev_priv );
597
586
598
587
intel_opregion_cleanup (dev_priv );
599
588
600
589
if (pdev -> msi_enabled )
601
590
pci_disable_msi (pdev );
602
-
603
- root_pdev = pcie_find_root_port (pdev );
604
- if (root_pdev )
605
- pci_d3cold_enable (root_pdev );
606
591
}
607
592
608
593
/**
@@ -1517,6 +1502,8 @@ static int intel_runtime_suspend(struct device *kdev)
1517
1502
{
1518
1503
struct drm_i915_private * dev_priv = kdev_to_i915 (kdev );
1519
1504
struct intel_runtime_pm * rpm = & dev_priv -> runtime_pm ;
1505
+ struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
1506
+ struct pci_dev * root_pdev ;
1520
1507
struct intel_gt * gt ;
1521
1508
int ret , i ;
1522
1509
@@ -1568,6 +1555,15 @@ static int intel_runtime_suspend(struct device *kdev)
1568
1555
drm_err (& dev_priv -> drm ,
1569
1556
"Unclaimed access detected prior to suspending\n" );
1570
1557
1558
+ /*
1559
+ * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
1560
+ * This should be totally removed when we handle the pci states properly
1561
+ * on runtime PM.
1562
+ */
1563
+ root_pdev = pcie_find_root_port (pdev );
1564
+ if (root_pdev )
1565
+ pci_d3cold_disable (root_pdev );
1566
+
1571
1567
rpm -> suspended = true;
1572
1568
1573
1569
/*
@@ -1606,6 +1602,8 @@ static int intel_runtime_resume(struct device *kdev)
1606
1602
{
1607
1603
struct drm_i915_private * dev_priv = kdev_to_i915 (kdev );
1608
1604
struct intel_runtime_pm * rpm = & dev_priv -> runtime_pm ;
1605
+ struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
1606
+ struct pci_dev * root_pdev ;
1609
1607
struct intel_gt * gt ;
1610
1608
int ret , i ;
1611
1609
@@ -1619,6 +1617,11 @@ static int intel_runtime_resume(struct device *kdev)
1619
1617
1620
1618
intel_opregion_notify_adapter (dev_priv , PCI_D0 );
1621
1619
rpm -> suspended = false;
1620
+
1621
+ root_pdev = pcie_find_root_port (pdev );
1622
+ if (root_pdev )
1623
+ pci_d3cold_enable (root_pdev );
1624
+
1622
1625
if (intel_uncore_unclaimed_mmio (& dev_priv -> uncore ))
1623
1626
drm_dbg (& dev_priv -> drm ,
1624
1627
"Unclaimed access during suspend, bios?\n" );
0 commit comments