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 8F7A7EAD0; Fri, 15 Nov 2024 06:49:06 +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=1731653346; cv=none; b=S9jiSRq8UI8XvA3hiD+WpAErmdi5/ZzPSUSh42rhvCzOW/o/yo2X0UZvcSPd1IxZDNwuQGK9a2Eg09T7zwaL+IemamTSYuGqPFT0CbWIkTJV1Zx+2fZ5jVMjKwIwmEWMqYf/qTVM60jAfPOyiJ5m8Dre+spUhwXOfaI655aOCCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731653346; c=relaxed/simple; bh=oaQlrcgFsbIC8ndU/CRk+OURRxWY68ZusMt0/3q6WtU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kc7++f8sdN7RGmVyOp/AO9c9Cw8pugAPOiaCfB24augJtCahVinbd4YQcQqTqWJfTXwQFUoZ2LCX/5FH3+NnACabwEfiY4KPpJBYH2ehLkasTItIIRLaS+pp670CG2f+w0DRszvRoeXLV/ScA6UhoAMju5lQRdCbRb8EGLCy2RQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i7PQD2Ha; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i7PQD2Ha" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3E74C4CECF; Fri, 15 Nov 2024 06:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731653346; bh=oaQlrcgFsbIC8ndU/CRk+OURRxWY68ZusMt0/3q6WtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7PQD2Ha0+edUuFOAz6V4pbic59kWGQ61PbsmoB5GNCx3Ct3nzZSPro9Nd8pkGeAC ivqu0/H5jnAoDljn8hS85f6gEF4mu8SS0LVufC+FnZhCxDfs1fn+KFIf9iKDEHrmTZ qdZ+vah9euecYaD+a5yVt7TzI5v9ZdotxUYsmgsc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Badal Nilawar , Matthew Brost , Matthew Auld , John Harrison , Himal Prasad Ghimiray , Lucas De Marchi , Sasha Levin Subject: [PATCH 6.11 58/63] drm/xe/guc/ct: Flush g2h worker in case of g2h response timeout Date: Fri, 15 Nov 2024 07:38:21 +0100 Message-ID: <20241115063728.001184216@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241115063725.892410236@linuxfoundation.org> References: <20241115063725.892410236@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Badal Nilawar [ Upstream commit 22ef43c78647dd37b0dafe2182b8650b99dbbe59 ] 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 (cherry picked from commit e5152723380404acb8175e0777b1cea57f319a01) Signed-off-by: Lucas De Marchi 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 12e1fe6a8da28..1e8bb8b28a23e 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -897,6 +897,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