Consider multi-gt support when cancelling all tlb invalidations on suspend, and when submitting tlb invalidations on resume. Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> Signed-off-by: Fei Yang <fei.yang@xxxxxxxxx> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@xxxxxxxxx> CC: John Harrison <John.C.Harrison@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_driver.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index f5175103ea900..d7655a7b60eda 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -1077,6 +1077,8 @@ static int i915_drm_suspend(struct drm_device *dev) struct drm_i915_private *dev_priv = to_i915(dev); struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); pci_power_t opregion_target_state; + struct intel_gt *gt; + int i; disable_rpm_wakeref_asserts(&dev_priv->runtime_pm); @@ -1094,7 +1096,8 @@ static int i915_drm_suspend(struct drm_device *dev) intel_runtime_pm_disable_interrupts(dev_priv); - wake_up_all_tlb_invalidate(&to_gt(dev_priv)->uc.guc); + for_each_gt(gt, dev_priv, i) + wake_up_all_tlb_invalidate(>->uc.guc); intel_hpd_cancel_work(dev_priv); @@ -1267,9 +1270,11 @@ static int i915_drm_resume(struct drm_device *dev) intel_gvt_resume(dev_priv); - if (INTEL_GUC_SUPPORTS_TLB_INVALIDATION(&to_gt(dev_priv)->uc.guc)) { - intel_guc_invalidate_tlb_full(&to_gt(dev_priv)->uc.guc); - intel_guc_invalidate_tlb(&to_gt(dev_priv)->uc.guc); + for_each_gt(gt, dev_priv, i) { + if (!INTEL_GUC_SUPPORTS_TLB_INVALIDATION(>->uc.guc)) + continue; + intel_guc_invalidate_tlb_full(>->uc.guc); + intel_guc_invalidate_tlb(>->uc.guc); } enable_rpm_wakeref_asserts(&dev_priv->runtime_pm); -- 2.25.1