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 82C211D0E27; Wed, 2 Oct 2024 14:05:04 +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=1727877904; cv=none; b=A+0QqxVMxNt2e6oqRXiBXfVoMwovJGevv40bGpHFTYbN9EzVrquouu1x/5EveM8xo3YPWKWawKKR3I3gdEIfSE6lmrS03XKrbds9KEFV6lD88XkCGkSaZPzjS8zMumIzHBnivLGAs8UD4Qo0aPhB3ju/n0m+LIH4KxDlL3wmMK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727877904; c=relaxed/simple; bh=wwXZhktZHAYWzusY+MduCi9gUZCvKzmAtiK33H4i2z8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q754sb6qwHalWpfPcy3j+iXjrM0Hv7WAEiRycDlmwR7ELLhHu3bGv1CEdcX7zfVf0jfM0/RhTQvO9Ss2HOSsHmLaEvw8b4tKGXm1yJanniw4B8MCwlz0H6bifO404d35dMmFEQa9N4nsWTrbIHkNGYZ+yQ4ASFnYunHVuCwcquI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qmyqoG33; 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="qmyqoG33" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05A7BC4CEC5; Wed, 2 Oct 2024 14:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727877904; bh=wwXZhktZHAYWzusY+MduCi9gUZCvKzmAtiK33H4i2z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qmyqoG332H+mxgVeiEjlRoaQbivbkwLiUJslHMjGctkPJfDzSu3ztyawHk5YX3ED+ Sh/ZMCquQbFS7IzgChOQx9PTu/srkzBeHDan/IsmFV2K2MSkE+7f6hLn6D40rumDhP 7gf6isFXi3WnrLTt8gvJL9S3Hka3VXfUfhH0LDDM= 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.10 203/634] drm/msm/a5xx: disable preemption in submits by default Date: Wed, 2 Oct 2024 14:55:03 +0200 Message-ID: <20241002125819.119907015@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125811.070689334@linuxfoundation.org> References: <20241002125811.070689334@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.10-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 c003f970189b0..64466282689fd 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