From patchwork Fri May 17 11:25:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 13666888 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 88AE4C25B7A for ; Fri, 17 May 2024 11:26:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C670A10EE76; Fri, 17 May 2024 11:26:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="iPrk+aFj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 762A410EE76; Fri, 17 May 2024 11:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715945183; x=1747481183; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1kCACN8hRFGzdaw/N5tccKsL9YjfyvxlsDeImPqYpns=; b=iPrk+aFjp26i7BNR1paq0gv3TqKtmRTGbw9Ypvn6a2WSRmEmLrqTBcFT K07Qtyc5qOfF0ZkP6bU+qgs0rTxL20GRvwIfTasVElgR0omsdBqR7h3bq 8QrlQmAKIfzWZC5u7Pxcxl53IlNAOAFdzUV+43gF13jzCRzo2sKym0C9E uZlSCayC0h2jgjJJN3fsS1UgqATkLtqT0C6vfpNREoYckDTLy5y55nfnq 2Bs8M+A5M8S12Wlwp5/f9913KSP7IVE6X4ECn4pcvSOmvf2SBKJhevy0e m+sXuwTP6lnIeqc2i5zuutebfr3T0Tdxxjq7SaJRkNb43zqtCVn5vUZ8u A==; X-CSE-ConnectionGUID: 082X+viOSyW/NZ8RAcGbhA== X-CSE-MsgGUID: nYP0/Y1HTI+k8HMBA6J0ow== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11921346" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11921346" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 04:26:23 -0700 X-CSE-ConnectionGUID: L87CEbNVRCqqOCwEIMmR5g== X-CSE-MsgGUID: NoC4mb9cTgWow3Zm7GI4eQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31700787" Received: from bvivekan-mobl2.gar.corp.intel.com (HELO intel.com) ([10.247.118.196]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 04:26:16 -0700 From: Andi Shyti To: intel-gfx , dri-devel Cc: Daniele Ceraolo Spurio , Nirmoy Das , Janusz Krzysztofik , Andi Shyti , Andi Shyti Subject: [PATCH 1/2] drm/i915: Increase FLR timeout from 3s to 9s Date: Fri, 17 May 2024 13:25:49 +0200 Message-ID: <20240517112550.251955-2-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240517112550.251955-1-andi.shyti@linux.intel.com> References: <20240517112550.251955-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the guidelines it takes 3 seconds to perform an FLR reset. Let's give it a bit more slack because this time can change depending on the platform and on the firmware Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10955 Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/intel_uncore.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 729409a4bada..2eba289d88ad 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -2614,11 +2614,18 @@ void intel_uncore_prune_engine_fw_domains(struct intel_uncore *uncore, static void driver_initiated_flr(struct intel_uncore *uncore) { struct drm_i915_private *i915 = uncore->i915; - const unsigned int flr_timeout_ms = 3000; /* specs recommend a 3s wait */ + unsigned int flr_timeout_ms; int ret; drm_dbg(&i915->drm, "Triggering Driver-FLR\n"); + /* + * The specification recommends a 3 seconds FLR reset timeout. To be + * cautious, we will extend this to 9 seconds, three times the specified + * timeout. + */ + flr_timeout_ms = 9000; + /* * Make sure any pending FLR requests have cleared by waiting for the * FLR trigger bit to go to zero. Also clear GU_DEBUG's DRIVERFLR_STATUS From patchwork Fri May 17 11:25:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 13666894 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 A4520C04FFE for ; Fri, 17 May 2024 11:26:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3B2C10EE78; Fri, 17 May 2024 11:26:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="IRJd+3Nr"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23DCC10EE78; Fri, 17 May 2024 11:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715945199; x=1747481199; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6B9qTx8nmCoezSLzzcMRXr+s4VwpY77QrMPmH6L3Fzs=; b=IRJd+3NrQKpxrwQ7d7tSu9u7+v4AL6YZ5Knn3vSuNeOohb8Fm6YYVdI6 UeHV7Y6stNkagzhGbkwwuYi1zvo1OY2evdT4tiiTqUrtKys4l03oNoRf1 F3f1WAxVadNfaDGfUFoG3dG0Ho1M1MLx4s1UYdgXX7qIorW5b7IRExZk9 f2fsUUyPVTg/MRUAa/vEPABIHRTqwqc8e0xaIxomnHfCTV5wkvLMweeiJ uOaAVbbTE1CUh2LurvZkZo3IAcAqLCmUrjGcJ6YAFNW9B6nh5E+q1/w1v Kwhs6y2WqyBjMKNotofh+VlT+HTjSWnayN1o3ndsK5sLBxqhqmkAKQ3Dq w==; X-CSE-ConnectionGUID: U2mhwmvtRtqJbdtMV/k6LA== X-CSE-MsgGUID: IH8t64CUTgupcfOtxwR7+Q== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11571494" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11571494" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 04:26:38 -0700 X-CSE-ConnectionGUID: iiqb8KNNTyeMyCJHY40w4g== X-CSE-MsgGUID: 1pqjHUOdQ5SBOcCGum2rJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31904167" Received: from bvivekan-mobl2.gar.corp.intel.com (HELO intel.com) ([10.247.118.196]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 04:26:33 -0700 From: Andi Shyti To: intel-gfx , dri-devel Cc: Daniele Ceraolo Spurio , Nirmoy Das , Janusz Krzysztofik , Andi Shyti , Andi Shyti Subject: [PATCH 2/2] drm/i915: Don't treat FLR resets as errors Date: Fri, 17 May 2024 13:25:50 +0200 Message-ID: <20240517112550.251955-3-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240517112550.251955-1-andi.shyti@linux.intel.com> References: <20240517112550.251955-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If we timeout while waiting for an FLR reset, there is nothing we can do and i915 doesn't have any control on it. In any case the system is still perfectly usable and the function returns void. We don't need to be alarmed, therefore, print the timeout expiration as a debug message instead of an error. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10955 Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/intel_uncore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 2eba289d88ad..a3fa2ed91aae 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -2637,7 +2637,7 @@ static void driver_initiated_flr(struct intel_uncore *uncore) */ ret = intel_wait_for_register_fw(uncore, GU_CNTL, DRIVERFLR, 0, flr_timeout_ms); if (ret) { - drm_err(&i915->drm, + drm_dbg(&i915->drm, "Failed to wait for Driver-FLR bit to clear! %d\n", ret); return; @@ -2652,7 +2652,7 @@ static void driver_initiated_flr(struct intel_uncore *uncore) DRIVERFLR, 0, flr_timeout_ms); if (ret) { - drm_err(&i915->drm, "Driver-FLR-teardown wait completion failed! %d\n", ret); + drm_dbg(&i915->drm, "Driver-FLR-teardown wait completion failed! %d\n", ret); return; } @@ -2661,7 +2661,7 @@ static void driver_initiated_flr(struct intel_uncore *uncore) DRIVERFLR_STATUS, DRIVERFLR_STATUS, flr_timeout_ms); if (ret) { - drm_err(&i915->drm, "Driver-FLR-reinit wait completion failed! %d\n", ret); + drm_dbg(&i915->drm, "Driver-FLR-reinit wait completion failed! %d\n", ret); return; }