From patchwork Mon Oct 2 17:24:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Cavitt, Jonathan" X-Patchwork-Id: 13406514 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60F36E74905 for ; Mon, 2 Oct 2023 18:23:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E476710E07E; Mon, 2 Oct 2023 18:23:07 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3B6910E07E for ; Mon, 2 Oct 2023 18:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696270985; x=1727806985; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CLpbvdSW2DpyODTdxlEwVl6UHZsKBgDfitA6ssaRax8=; b=eptO7CW7WcvACnnpdfaWacG88bvo3H0xanfdsOGpplkNCW3C+i61HbSX 3Esbd3Rx1LtjosnXtc6bcz1JD9xuwE66xI5JTYuC/O9uHU5hHTGkZyZsp wesZ5Je17jC9wop66u2Ch5lfFvbctyStM94Ch9eZg3538XpP6tjMpGU6p 06r/XWOmVkOLGtPfE/RAjBdtNXll3gePYG2f/zFiawJaMi0ciuoYKV0Tn /2EaGfBJmT9RttX/gwRn8uJBe7iiuHSFs9QhnhM6j2lW+jXyEXl6u7J9I sghwemo/xVtgXth/hAS+a4k9W5kACYcnrztWBQ+RSXln6LWJ95rEhH2JX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="413607937" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="413607937" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 10:35:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="785836326" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="785836326" Received: from dut-internal-9dd7.jf.intel.com ([10.165.21.194]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 10:35:01 -0700 From: Jonathan Cavitt To: intel-gfx@lists.freedesktop.org Date: Mon, 2 Oct 2023 10:24:18 -0700 Message-Id: <20231002172419.1017044-3-jonathan.cavitt@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231002172419.1017044-1-jonathan.cavitt@intel.com> References: <20231002172419.1017044-1-jonathan.cavitt@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v3 3/4] drm/i915: Perform TLB invalidation on all GTs during suspend/resume X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: janusz.krzysztofik@intel.com, andi.shyti@intel.com, matthew.d.roper@intel.com, jonathan.cavitt@intel.com, chris.p.wilson@linux.intel.com, nirmoy.das@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Consider multi-gt support when cancelling all tlb invalidations on suspend, and when submitting tlb invalidations on resume. Suggested-by: Tvrtko Ursulin Signed-off-by: Fei Yang Signed-off-by: Jonathan Cavitt CC: John Harrison --- 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);