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 98B941ABEB1; Mon, 14 Oct 2024 14:57:40 +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=1728917860; cv=none; b=kJ86SUp96+zxVHv79QlQnp3u4ca1RcmaFJeT/ZPRXdUilXeRIM97FQPBEgfY7QXiRT+WKkrgfwapX1fcGg26Wqsw4NouZBr/yRJ6nEhPprbTZvtv/7QkMLsxWTXJtz8PgPRoYazXhpwzMl3lf/50dQya3mkggJxwh54qRy0IivU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728917860; c=relaxed/simple; bh=bHIJKk8O7TdCtWRNqC73W56fgobWQJESrSajzzsNCxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ISxugmoJK5YEs3A+aR0uiQiRYlwuO3h2J27JH85rQN0afNHEozrs550y7YokDjqgny168MAVzmPTC7TS540Jot4WFBufHgKY5fJL2pXjBsLG1v5yDUNwSFdg9jEvbdRnC0Nfiek3xTNuRSuS/yb/tjqPY3M2bjMLEiQ5T+JETB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RJcXKJgw; 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="RJcXKJgw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DAF4C4CEC3; Mon, 14 Oct 2024 14:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728917860; bh=bHIJKk8O7TdCtWRNqC73W56fgobWQJESrSajzzsNCxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJcXKJgwyNqVwIh29RfmXB4XmaSdI4BlElPV1M4hJjxcb0UjHhY/BJYvy7d8SulfY s9yo4pU7Ld0zBjzYXJgChiGcRdUBB+a2yefaCr8Ngl0cw/tUM8mu0paCL8ngAzJWxs DOJ3HR8NbBm4yGVE+DYPT5/uQeIfNQYRrcA5lnDw= 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.1 125/798] drm/msm/a5xx: disable preemption in submits by default Date: Mon, 14 Oct 2024 16:11:19 +0200 Message-ID: <20241014141222.833048818@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141217.941104064@linuxfoundation.org> References: <20241014141217.941104064@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 895a0e9db1f09..6e3f7d39d7e38 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