From patchwork Mon Nov 25 06:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 13884456 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 D0552D3B7E1 for ; Mon, 25 Nov 2024 06:51:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2CE610E1B5; Mon, 25 Nov 2024 06:51:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="PWQSEl42"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88A4A10E151 for ; Mon, 25 Nov 2024 06:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732517514; x=1764053514; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=swR7AAk63JIuneNcpRQhFP2DKjIS3sVTZ2Y5r2JLig4=; b=PWQSEl42IY2N6wzZBa5NvqxtjjNH6p+hGUUU4Mft0WyrBHMpxn+iER72 ZdWXPRbiIIZ5BwCbJpoquVX41RfZ7aHhDaX5jYqwatmfQEPMPVOxTxXLF /p3oTw7l9jEcYb48WzE1tSjfpjXZL3NhW7zoXbuWatv3aT8Z3FvSRxXbq WahsBCfBioTrzbEggiwOMp770GQGoV4CH/5/ghxmEX7/h5Oqfi4YlrZn8 ZNOmAh/uH1h6QOOLERQJ75BgbiNtVId/OgqkSoUCL6xuslg5CjoYDBm/p fYxpEJhGPWyKjxBuNESZar7w+orU1lhOHlAUGhXV4LVz54j0nUEEHHzcM Q==; X-CSE-ConnectionGUID: 8pMs91kFR/O4EoNAk51FmA== X-CSE-MsgGUID: Emqf9p1DRKG1HrD1k7F0hg== X-IronPort-AV: E=McAfee;i="6700,10204,11266"; a="43105888" X-IronPort-AV: E=Sophos;i="6.12,182,1728975600"; d="scan'208";a="43105888" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2024 22:51:51 -0800 X-CSE-ConnectionGUID: C07ej8KtR0SV9wEJqxBGfA== X-CSE-MsgGUID: TddbmPRmRcuBYWpzEaoxhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,182,1728975600"; d="scan'208";a="90802679" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.99.123.50]) by fmviesa006.fm.intel.com with ESMTP; 24 Nov 2024 22:51:49 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Cc: ville.syrjala@intel.com, ville.syrjala@linux.intel.com, bgeffon@google.com, shawn.c.lee@intel.com, Vidya Srinivas Subject: [PATCH 1/2] Revert "drm/i915/dpt: Make DPT object unshrinkable" Date: Mon, 25 Nov 2024 11:58:03 +0530 Message-Id: <20241125062804.412536-1-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Reason for revert: Restricting the DPT object to not be shrunk makes some chromebooks run out of memory and causes DMA remap failures. This reverts commit 43e2b37e2ab660c3565d4cff27922bc70e79c3f1. Signed-off-by: Vidya Srinivas --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index 3dc61cbd2e11..bb713e096db2 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -283,9 +283,7 @@ bool i915_gem_object_has_iomem(const struct drm_i915_gem_object *obj); static inline bool i915_gem_object_is_shrinkable(const struct drm_i915_gem_object *obj) { - /* TODO: make DPT shrinkable when it has no bound vmas */ - return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_SHRINKABLE) && - !obj->is_dpt; + return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_SHRINKABLE); } static inline bool From patchwork Mon Nov 25 06:28:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 13884455 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 54D95D3B7DD for ; Mon, 25 Nov 2024 06:51:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B01DF10E151; Mon, 25 Nov 2024 06:51:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="m8acpmNl"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21CD510E1B5 for ; Mon, 25 Nov 2024 06:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732517514; x=1764053514; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZVHENTadvdn+iwLwsl5NmYIFecXfe1pNJK3UAMPlf4U=; b=m8acpmNlnadV+k5nD0CD8wWuZAs3bKAp/X0y/wV/SqBKl0/G4YKNBpkr +PCg3JWNWMNSjHcpA1B6uUpWSY3oedRLYh72YW+fKeB1TdjjP68A89e3/ aKlgnulCKfxRGn0aT99TmiznN+xkGKFBs9KlpziSnlrwrDd4tJkjfKt/M aHEFgMnenfJPJQcKwZ+aYSbV0kyq8eB1dN97yFpgM0S3s7r2qUEZFgPNK 8a+eY9FZcsZCltqCsffWkJIQBKzVN1gak5HfhVLi32szeVIT8Qo8FAqZ2 d/oALJ4IZmAurg11UAWsYCb7s9U+d3iH6IbHzy8fFh89OHd/PlIiwmfru g==; X-CSE-ConnectionGUID: RgykCcg2R8GUzbsFEGHcBQ== X-CSE-MsgGUID: IMxgqmQLQB2yevgdFPHGRw== X-IronPort-AV: E=McAfee;i="6700,10204,11266"; a="43105895" X-IronPort-AV: E=Sophos;i="6.12,182,1728975600"; d="scan'208";a="43105895" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2024 22:51:53 -0800 X-CSE-ConnectionGUID: OeuDkaG4SOWzhATE0m4UQA== X-CSE-MsgGUID: uKcSlO2CSj+rLXnlAh3VFQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,182,1728975600"; d="scan'208";a="90802683" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.99.123.50]) by fmviesa006.fm.intel.com with ESMTP; 24 Nov 2024 22:51:51 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Cc: ville.syrjala@intel.com, ville.syrjala@linux.intel.com, bgeffon@google.com, shawn.c.lee@intel.com, Vidya Srinivas Subject: [PATCH 2/2] [RFC] drm/i915: Unbind the vma in suspend if it was bound Date: Mon, 25 Nov 2024 11:58:04 +0530 Message-Id: <20241125062804.412536-2-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241125062804.412536-1-vidya.srinivas@intel.com> References: <20241125062804.412536-1-vidya.srinivas@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In i915_ggtt_suspend_vm, if the vma was bound, the path to unbind/evict is not hitting during suspend. This is causing issues with DPT where DPT gets shrunk but the framebuffer is still on the DPT's bound list. This causes system reboot in some scenarios of suspend/resume where it tries to rewrite the PTEs via a stale mapping. Signed-off-by: Vidya Srinivas --- drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index d60a6ca0cae5..8499aa12a787 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -157,13 +157,11 @@ void i915_ggtt_suspend_vm(struct i915_address_space *vm) goto retry; } - if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND)) { + if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND)) i915_vma_wait_for_bind(vma); - __i915_vma_evict(vma, false); - drm_mm_remove_node(&vma->node); - } - + __i915_vma_evict(vma, false); + drm_mm_remove_node(&vma->node); i915_gem_object_unlock(obj); }