From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1473A1DFD9C; Sun, 24 Nov 2024 13:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732455361; cv=none; b=XYHQi5rMlAnlJRAcAP2ODeotA3K5OBZWK8TBM9UcRxKc6zT3pKcVxwiJsPrIvfcfmlJlcC8jLFGt04ULgksPzODG19QjgTmt2GeDaKdJHAXtOu/8vS1m0jryIT+tSDy4mSvudv/JOJLr2ZqBWuv0MzOSbzHljIIWRHvMyhxgWtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732455361; c=relaxed/simple; bh=juvZpPMZICGteH+IeDccZe5iw94T8otHKKCkwOAJIyE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hC9+t6T/KHgU7DA6wR4p1SYJ3nh30swAiUxCxiIwelwbsls2pJp45uyAUmF3MfN5JLRqWwwfIcEDPD25dV9quMmlh7NrkbypFXfR5l5jvAEg2C+K5fYXZwEjLglAOwEyt6zDem9b65AkjxzdjFoY0UTUMRvg+RlONC8ZwTFtuNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B0b86pTB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B0b86pTB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11C90C4CED1; Sun, 24 Nov 2024 13:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732455360; bh=juvZpPMZICGteH+IeDccZe5iw94T8otHKKCkwOAJIyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B0b86pTBVq+WBhKkMkcHKSP5Z6NEZj1tfNfDm6kNVBynlIZ3XhUcQ6xYeweIcnWRA 6nFX8b4qa860QsO6inGGTV3O4S5babnFYoQGPB1O13lY/pwNiexzBzQAEUZcRkLnUy U14hTWEUCHfZvjaEPZIdhASUQTms1TFgpGjeVzJY0vyfvmTff8E0EpJn1nnRzTjsPZ 6ha1OsHn7FrI44FzNPCy/3I498UszNyGY2M0CigVDIsmwGxWqUF/t5uecQTUgkz/mw Uwt+b08KnjxeUHHyPQrL7pqglCi9UCn+ImEeoprc+CmdlGd0ZSiWEPHAM5Fr6eqOMI TpG7hCsItir+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Badal Nilawar , Matthew Brost , Matthew Auld , John Harrison , Himal Prasad Ghimiray , Sasha Levin , lucas.demarchi@intel.com, thomas.hellstrom@linux.intel.com, rodrigo.vivi@intel.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.12 054/107] drm/xe/guc/ct: Flush g2h worker in case of g2h response timeout Date: Sun, 24 Nov 2024 08:29:14 -0500 Message-ID: <20241124133301.3341829-54-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241124133301.3341829-1-sashal@kernel.org> References: <20241124133301.3341829-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.1 Content-Transfer-Encoding: 8bit From: Badal Nilawar [ Upstream commit e5152723380404acb8175e0777b1cea57f319a01 ] In case if g2h worker doesn't get opportunity to within specified timeout delay then flush the g2h worker explicitly. v2: - Describe change in the comment and add TODO (Matt B/John H) - Add xe_gt_warn on fence done after G2H flush (John H) v3: - Updated the comment with root cause - Clean up xe_gt_warn message (John H) Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1620 Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2902 Signed-off-by: Badal Nilawar Cc: Matthew Brost Cc: Matthew Auld Cc: John Harrison Cc: Himal Prasad Ghimiray Reviewed-by: Himal Prasad Ghimiray Acked-by: Matthew Brost Signed-off-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20241017111410.2553784-2-badal.nilawar@intel.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/xe/xe_guc_ct.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index 9c505d3517cd1..cd6a5f09d631e 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -906,6 +906,24 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len, } } + /* + * Occasionally it is seen that the G2H worker starts running after a delay of more than + * a second even after being queued and activated by the Linux workqueue subsystem. This + * leads to G2H timeout error. The root cause of issue lies with scheduling latency of + * Lunarlake Hybrid CPU. Issue dissappears if we disable Lunarlake atom cores from BIOS + * and this is beyond xe kmd. + * + * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU. + */ + if (!ret) { + flush_work(&ct->g2h_worker); + if (g2h_fence.done) { + xe_gt_warn(gt, "G2H fence %u, action %04x, done\n", + g2h_fence.seqno, action[0]); + ret = 1; + } + } + /* * Ensure we serialize with completion side to prevent UAF with fence going out of scope on * the stack, since we have no clue if it will fire after the timeout before we can erase -- 2.43.0