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 BC9F21D0487; Wed, 2 Oct 2024 14:32:38 +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=1727879558; cv=none; b=IuPw8pX7II2oM99xtnyW0ehZyVlZ1IbDJeSFoue++GiF54yRtNm9FeaIuDaD+3cce0PG5MaVlot3rUxMBFmfRLp/2snanzNfcZv3HMfLX4eRzmwBo9vw57+IAJFkodC9WBc9eg6eO0ysYMtrwzkYhlqhJOZgzd/27ToEvtlaT+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727879558; c=relaxed/simple; bh=v3xq6tq5KXQmpPast0lg+JIXGtVFYE/sS4hFd61WOoA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ITdseHrJ42zwdlsz0tsYW7HRd839BPiT+g0OJPNmMnnbw0gPbBh+Q8XUuML7q68/CB7zV+lEsfEip4JBnzPAlGAYAItVxqnjVQm5Vufj1eeUBp57IJkc85WODGSe+B+qQm0Ev+Hm379Cgu5Q2uzvZqAXIEmZaPAZUDsA0/U2tog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=S4N9B1K2; 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="S4N9B1K2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44551C4CEC2; Wed, 2 Oct 2024 14:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727879558; bh=v3xq6tq5KXQmpPast0lg+JIXGtVFYE/sS4hFd61WOoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4N9B1K2RTvZ5TXDhKzfQp2DG3ctakf/qTk+89MeO0nCiRk1KJ35w6/6WxotoCE2o vpdTGhbPAWBbqdtxgua30VDEYNuKFs8tbmHBrfAAhY182CjS69YLLvzqunaP5rqmrI wmGG9Jn/sDim6cuq4sXk8V2O2lPifjq5ZitJ1cPQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vladimir Lypak , Rob Clark , Sasha Levin Subject: [PATCH 6.6 159/538] drm/msm/a5xx: disable preemption in submits by default Date: Wed, 2 Oct 2024 14:56:38 +0200 Message-ID: <20241002125758.530893909@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125751.964700919@linuxfoundation.org> References: <20241002125751.964700919@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vladimir Lypak [ Upstream commit db9dec2db76146d65e1cfbb6afb2e2bd5dab67f8 ] Fine grain preemption (switching from/to points within submits) requires extra handling in command stream of those submits, especially when rendering with tiling (using GMEM). However this handling is missing at this point in mesa (and always was). For this reason we get random GPU faults and hangs if more than one priority level is used because local preemption is enabled prior to executing command stream from submit. With that said it was ahead of time to enable local preemption by default considering the fact that even on downstream kernel it is only enabled if requested via UAPI. Fixes: a7a4c19c36de ("drm/msm/a5xx: fix setting of the CP_PREEMPT_ENABLE_LOCAL register") Signed-off-by: Vladimir Lypak Patchwork: https://patchwork.freedesktop.org/patch/612041/ Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index e5916c1067967..14d3a3e78a9db 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -150,9 +150,13 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) OUT_PKT7(ring, CP_SET_PROTECTED_MODE, 1); OUT_RING(ring, 1); - /* Enable local preemption for finegrain preemption */ + /* + * Disable local preemption by default because it requires + * user-space to be aware of it and provide additional handling + * to restore rendering state or do various flushes on switch. + */ OUT_PKT7(ring, CP_PREEMPT_ENABLE_LOCAL, 1); - OUT_RING(ring, 0x1); + OUT_RING(ring, 0x0); /* Allow CP_CONTEXT_SWITCH_YIELD packets in the IB2 */ OUT_PKT7(ring, CP_YIELD_ENABLE, 1); -- 2.43.0