@@ -530,6 +530,7 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
530
530
static int i915_driver_hw_probe (struct drm_i915_private * dev_priv )
531
531
{
532
532
struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
533
+ struct pci_dev * root_pdev ;
533
534
int ret ;
534
535
535
536
if (i915_inject_probe_failure (dev_priv ))
@@ -641,6 +642,15 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
641
642
642
643
intel_bw_init_hw (dev_priv );
643
644
645
+ /*
646
+ * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
647
+ * This should be totally removed when we handle the pci states properly
648
+ * on runtime PM and on s2idle cases.
649
+ */
650
+ root_pdev = pcie_find_root_port (pdev );
651
+ if (root_pdev )
652
+ pci_d3cold_disable (root_pdev );
653
+
644
654
return 0 ;
645
655
646
656
err_msi :
@@ -664,11 +674,16 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
664
674
static void i915_driver_hw_remove (struct drm_i915_private * dev_priv )
665
675
{
666
676
struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
677
+ struct pci_dev * root_pdev ;
667
678
668
679
i915_perf_fini (dev_priv );
669
680
670
681
if (pdev -> msi_enabled )
671
682
pci_disable_msi (pdev );
683
+
684
+ root_pdev = pcie_find_root_port (pdev );
685
+ if (root_pdev )
686
+ pci_d3cold_enable (root_pdev );
672
687
}
673
688
674
689
/**
@@ -1193,14 +1208,6 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
1193
1208
goto out ;
1194
1209
}
1195
1210
1196
- /*
1197
- * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
1198
- * This should be totally removed when we handle the pci states properly
1199
- * on runtime PM and on s2idle cases.
1200
- */
1201
- if (suspend_to_idle (dev_priv ))
1202
- pci_d3cold_disable (pdev );
1203
-
1204
1211
pci_disable_device (pdev );
1205
1212
/*
1206
1213
* During hibernation on some platforms the BIOS may try to access
@@ -1365,8 +1372,6 @@ static int i915_drm_resume_early(struct drm_device *dev)
1365
1372
1366
1373
pci_set_master (pdev );
1367
1374
1368
- pci_d3cold_enable (pdev );
1369
-
1370
1375
disable_rpm_wakeref_asserts (& dev_priv -> runtime_pm );
1371
1376
1372
1377
ret = vlv_resume_prepare (dev_priv , false);
@@ -1543,7 +1548,6 @@ static int intel_runtime_suspend(struct device *kdev)
1543
1548
{
1544
1549
struct drm_i915_private * dev_priv = kdev_to_i915 (kdev );
1545
1550
struct intel_runtime_pm * rpm = & dev_priv -> runtime_pm ;
1546
- struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
1547
1551
int ret ;
1548
1552
1549
1553
if (drm_WARN_ON_ONCE (& dev_priv -> drm , !HAS_RUNTIME_PM (dev_priv )))
@@ -1589,12 +1593,6 @@ static int intel_runtime_suspend(struct device *kdev)
1589
1593
drm_err (& dev_priv -> drm ,
1590
1594
"Unclaimed access detected prior to suspending\n" );
1591
1595
1592
- /*
1593
- * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
1594
- * This should be totally removed when we handle the pci states properly
1595
- * on runtime PM and on s2idle cases.
1596
- */
1597
- pci_d3cold_disable (pdev );
1598
1596
rpm -> suspended = true;
1599
1597
1600
1598
/*
@@ -1633,7 +1631,6 @@ static int intel_runtime_resume(struct device *kdev)
1633
1631
{
1634
1632
struct drm_i915_private * dev_priv = kdev_to_i915 (kdev );
1635
1633
struct intel_runtime_pm * rpm = & dev_priv -> runtime_pm ;
1636
- struct pci_dev * pdev = to_pci_dev (dev_priv -> drm .dev );
1637
1634
int ret ;
1638
1635
1639
1636
if (drm_WARN_ON_ONCE (& dev_priv -> drm , !HAS_RUNTIME_PM (dev_priv )))
@@ -1646,7 +1643,6 @@ static int intel_runtime_resume(struct device *kdev)
1646
1643
1647
1644
intel_opregion_notify_adapter (dev_priv , PCI_D0 );
1648
1645
rpm -> suspended = false;
1649
- pci_d3cold_enable (pdev );
1650
1646
if (intel_uncore_unclaimed_mmio (& dev_priv -> uncore ))
1651
1647
drm_dbg (& dev_priv -> drm ,
1652
1648
"Unclaimed access during suspend, bios?\n" );
0 commit comments