After the previous patch RPS disabling doesn't depend any more on the first level interrupts being disabled, so we can move it everywhere earlier. Doing so let's us think about the uninitialization steps afterwards independently of any asynchronous RPS events that can happen atm. It also makes the system/runtime suspend time RPS disabling more uniform. Finally this gets rid of the WARN in intel_suspend_gt_powersave(), which we can hit if a final RPS work runs after we disabled the first level interrupts.
Unified · Split
| @@ -584,6 +584,8 @@ static int i915_drm_suspend(struct drm_device *dev) · 583 unmodified lines | |||
| 584 | return error; | 584 | return error; |
| 585 | } | 585 | } |
| 586 | 586 | ||
| 587 | intel_suspend_gt_powersave(dev); | ||
| 588 | |||
| 587 | /* | 589 | /* |
| 588 | * Disable CRTCs directly since we want to preserve sw state | 590 | * Disable CRTCs directly since we want to preserve sw state |
| 589 | * for _thaw. Also, power gate the CRTC power wells. | 591 | * for _thaw. Also, power gate the CRTC power wells. |
| @@ -595,15 +597,11 @@ static int i915_drm_suspend(struct drm_device *dev) · 5 unmodified lines | |||
| 595 | 597 | ||
| 596 | intel_dp_mst_suspend(dev); | 598 | intel_dp_mst_suspend(dev); |
| 597 | 599 | ||
| 598 | flush_delayed_work(&dev_priv->rps.delayed_resume_work); | ||
| 599 | |||
| 600 | intel_runtime_pm_disable_interrupts(dev_priv); | 600 | intel_runtime_pm_disable_interrupts(dev_priv); |
| 601 | intel_hpd_cancel_work(dev_priv); | 601 | intel_hpd_cancel_work(dev_priv); |
| 602 | 602 | ||
| 603 | intel_suspend_encoders(dev_priv); | 603 | intel_suspend_encoders(dev_priv); |
| 604 | 604 | ||
| 605 | intel_suspend_gt_powersave(dev); | ||
| 606 | |||
| 607 | intel_suspend_hw(dev); | 605 | intel_suspend_hw(dev); |
| 608 | } | 606 | } |
| 609 | 607 | ||
| @@ -1393,9 +1391,8 @@ static int intel_runtime_suspend(struct device *device) · 783 unmodified lines | |||
| 1393 | i915_gem_release_all_mmaps(dev_priv); | 1391 | i915_gem_release_all_mmaps(dev_priv); |
| 1394 | mutex_unlock(&dev->struct_mutex); | 1392 | mutex_unlock(&dev->struct_mutex); |
| 1395 | 1393 | ||
| 1396 | flush_delayed_work(&dev_priv->rps.delayed_resume_work); | ||
| 1397 | intel_runtime_pm_disable_interrupts(dev_priv); | ||
| 1398 | intel_suspend_gt_powersave(dev); | 1394 | intel_suspend_gt_powersave(dev); |
| 1395 | intel_runtime_pm_disable_interrupts(dev_priv); | ||
| 1399 | 1396 | ||
| 1400 | ret = intel_suspend_complete(dev_priv); | 1397 | ret = intel_suspend_complete(dev_priv); |
| 1401 | if (ret) { | 1398 | if (ret) { |
| @@ -13540,11 +13540,13 @@ void intel_modeset_cleanup(struct drm_device *dev) · 13539 unmodified lines | |||
| 13540 | struct drm_i915_private *dev_priv = dev->dev_private; | 13540 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 13541 | struct drm_connector *connector; | 13541 | struct drm_connector *connector; |
| 13542 | 13542 | ||
| 13543 | intel_disable_gt_powersave(dev); | ||
| 13544 | |||
| 13543 | intel_backlight_unregister(dev); | 13545 | intel_backlight_unregister(dev); |
| 13544 | 13546 | ||
| 13545 | /* | 13547 | /* |
| 13546 | * Interrupts and polling as the first thing to avoid creating havoc. | 13548 | * Interrupts and polling as the first thing to avoid creating havoc. |
| 13547 | * Too much stuff here (turning of rps, connectors, ...) would | 13549 | * Too much stuff here (turning of connectors, ...) would |
| 13548 | * experience fancy races otherwise. | 13550 | * experience fancy races otherwise. |
| 13549 | */ | 13551 | */ |
| 13550 | intel_irq_uninstall(dev_priv); | 13552 | intel_irq_uninstall(dev_priv); |
| @@ -13561,8 +13563,6 @@ void intel_modeset_cleanup(struct drm_device *dev) · 10 unmodified lines | |||
| 13561 | 13563 | ||
| 13562 | intel_disable_fbc(dev); | 13564 | intel_disable_fbc(dev); |
| 13563 | 13565 | ||
| 13564 | intel_disable_gt_powersave(dev); | ||
| 13565 | |||
| 13566 | ironlake_teardown_rc6(dev); | 13566 | ironlake_teardown_rc6(dev); |
| 13567 | 13567 | ||
| 13568 | mutex_unlock(&dev->struct_mutex); | 13568 | mutex_unlock(&dev->struct_mutex); |
| @@ -6183,9 +6183,6 @@ void intel_suspend_gt_powersave(struct drm_device *dev) · 6182 unmodified lines | |||
| 6183 | { | 6183 | { |
| 6184 | struct drm_i915_private *dev_priv = dev->dev_private; | 6184 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 6185 | 6185 | ||
| 6186 | /* Interrupts should be disabled already to avoid re-arming. */ | ||
| 6187 | WARN_ON(intel_irqs_enabled(dev_priv)); | ||
| 6188 | |||
| 6189 | if (INTEL_INFO(dev)->gen < 6) | 6186 | if (INTEL_INFO(dev)->gen < 6) |
| 6190 | return; | 6187 | return; |
| 6191 | 6188 | ||