From patchwork Mon Apr 22 13:59:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Cavitt, Jonathan" X-Patchwork-Id: 13638564 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 B6369C4345F for ; Mon, 22 Apr 2024 14:15:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1752E112B3C; Mon, 22 Apr 2024 14:15:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="W/pnHxy3"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8E75112B3C for ; Mon, 22 Apr 2024 14:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713795318; x=1745331318; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SMEeyAUjJ/kaTYgayrnUJGuwTIb/oDVMT3r+PbbktKM=; b=W/pnHxy3E9U5fe7R7IacmidaB1gc1iKiamXQgR84pF5/FTxhamKziMLn TrZ4X8I2T/jcQYKZKQqXIfCkldUDsnUEZiNlmRiJQLtXLuA55DO54BxOl XSBK3b+wktRPq4E5ByGZHxAYFbfUHBI7DaCekuOgIeO6PvS9KvPgL+IWW trHQMmXnUnEt7wZGulrk2HQbb988FGuNNRuN7EEeWRKqIcuwpQ1TwyWEt uPp71/njljCsOBusl9/XpUJHXRIJVuqoYjv22hZidTLjZg9jDTGRA8teB U3a/S1Nzi7Slc2fX3WnGJzZwmyBlaw44JaDX1385Oq+vLWaRgpV2sf7fs w==; X-CSE-ConnectionGUID: soI0/3ncRn+OpBACF4iL+w== X-CSE-MsgGUID: QHwogikWRW6sa3s9JoiFzQ== X-IronPort-AV: E=McAfee;i="6600,9927,11052"; a="20481922" X-IronPort-AV: E=Sophos;i="6.07,220,1708416000"; d="scan'208";a="20481922" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2024 07:15:17 -0700 X-CSE-ConnectionGUID: ophMnXgJSt6bxLy14V8vbg== X-CSE-MsgGUID: Hkhzg0rnQXS03e5rmOd8uw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,220,1708416000"; d="scan'208";a="24100232" Received: from dut-internal-9dd7.jf.intel.com ([10.165.21.194]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2024 07:15:17 -0700 From: Jonathan Cavitt To: intel-gfx@lists.freedesktop.org Cc: saurabhg.gupta@intel.com, jonathan.cavitt@intel.com, John.C.Harrison@intel.com, chris.p.wilson@linux.intel.com, andi.shyti@linux.intel.com, nirmoy.das@intel.com Subject: [PATCH v2] drm/i915/gem: Downgrade stolen lmem setup warning Date: Mon, 22 Apr 2024 06:59:59 -0700 Message-Id: <20240422135959.4127003-1-jonathan.cavitt@intel.com> X-Mailer: git-send-email 2.25.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" In the case where lmem_size < dsm_base, hardware is reporting that stolen lmem is unusable. In this case, instead of throwing a warning, we can continue execution as normal by disabling stolen LMEM support. For example, this change will allow the following error report from ATS-M to no longer apply: <6> [144.859887] pcieport 0000:4b:00.0: bridge window [mem 0xb1000000-0xb11fffff] <6> [144.859900] pcieport 0000:4b:00.0: bridge window [mem 0x3bbc00000000-0x3bbc17ffffff 64bit pref] <6> [144.859917] pcieport 0000:4c:01.0: PCI bridge to [bus 4d-4e] <6> [144.859932] pcieport 0000:4c:01.0: bridge window [mem 0xb1000000-0xb11fffff] <6> [144.859945] pcieport 0000:4c:01.0: bridge window [mem 0x3bbc00000000-0x3bbc17ffffff 64bit pref] <6> [144.859984] i915 0000:4d:00.0: [drm] BAR2 resized to 256M <6> [144.860640] i915 0000:4d:00.0: [drm] Using a reduced BAR size of 256MiB. Consider enabling 'Resizable BAR' or similar, if available in the BIOS. <4> [144.860719] -----------[ cut here ]----------- <4> [144.860727] WARNING: CPU: 17 PID: 1815 at drivers/gpu/drm/i915/gem/i915_gem_stolen.c:939 i915_gem_stolen_lmem_setup+0x38c/0x430 [i915] <4> [144.861430] Modules linked in: i915 snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm vgem drm_shmem_helper prime_numbers i2c_algo_bit ttm video drm_display_helper drm_buddy fuse x86_pkg_temp_thermal coretemp kvm_intel kvm ixgbe mdio irqbypass ptp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pps_core i2c_i801 mei_me i2c_smbus mei wmi acpi_power_meter [last unloaded: i915] <4> [144.861611] CPU: 17 PID: 1815 Comm: i915_module_loa Tainted: G U 6.8.0-rc5-drmtip_1515-g78f49af27723+ #1 <4> [144.861624] Hardware name: Intel Corporation WHITLEY/WHITLEY, BIOS SE5C6200.86B.0020.P41.2109300305 09/30/2021 <4> [144.861632] RIP: 0010:i915_gem_stolen_lmem_setup+0x38c/0x430 [i915] <4> [144.862287] Code: ff 41 c1 e4 05 e9 ac fe ff ff 4d 63 e4 48 89 ef 48 85 ed 74 04 48 8b 7d 08 48 c7 c6 10 a3 7b a0 e8 e9 90 43 e1 e9 ee fd ff ff <0f> 0b 49 c7 c4 ed ff ff ff e9 e0 fd ff ff 0f b7 d2 48 c7 c6 00 d9 <4> [144.862299] RSP: 0018:ffffc90005607980 EFLAGS: 00010207 <4> [144.862315] RAX: fffffffffff00000 RBX: 0000000000000003 RCX: 0000000000000000 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10833 Suggested-by: Chris Wilson Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti --- v2: - Return 0 to allow execution to continue - Remove white space in commit message - s/Fixes/Closes drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index ad6dd7f3259bc..4d60a5b375053 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -936,8 +936,12 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type, } else { /* Use DSM base address instead for stolen memory */ dsm_base = intel_uncore_read64(uncore, GEN6_DSMBASE) & GEN11_BDSM_MASK; - if (WARN_ON(lmem_size < dsm_base)) - return ERR_PTR(-ENODEV); + if (lmem_size < dsm_base) { + drm_dbg(&i915->drm, + "Disabling stolen memory support due to OOB placement: lmem_size = %lli vs dsm_base = %lli\n", + lmem_size, dsm_base); + return 0; + } dsm_size = ALIGN_DOWN(lmem_size - dsm_base, SZ_1M); }