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 C3B7430DD1A; Wed, 3 Dec 2025 15:31:32 +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=1764775892; cv=none; b=cWyEUfkhz2dKrwEqt0W8i74CeniBqrQY3RVnOjTj3080JY/dbD1O3a3u/VsDJ9ZVU6j9Je9aeHW9r3eesaCbR8cUw/gokn1RU6Mdu9lSHC2wR7XR7/K6uLc6er2VIQLldCVCO2Tyy6yiKdHDsItGXwRx1rE8C6EV8j6UTIsvae0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764775892; c=relaxed/simple; bh=kpYJKbOGDw/3fZBJWvWtlwUaCmiKzNURU/Dm21o7P14=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GP8pReyugdtCDKxAC5HFCtIb12CH9NAzdD4TyffX3vSYUtD0loVarUHpiHgh28/bR7Q/PEN9RJaQTnh0nNtAMxZp27T8XJhS6l6YTxmRQIozs+3XdZP3Y68nK8LJWTM66aI98tTebmGilihHfmSGpMF09PnyId2ofEt2j02tNDM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=c+ZadINM; 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="c+ZadINM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95AE2C4CEF5; Wed, 3 Dec 2025 15:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764775892; bh=kpYJKbOGDw/3fZBJWvWtlwUaCmiKzNURU/Dm21o7P14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c+ZadINMErJI+qWz+7jQPFpUH1QibbXufgqJv5DHFoOeZciwwxgSszLw6Oql2zoyR 2yzOhtsTu6QJNhx04GpZL3cPTdH4IEMLsKU1iskPw32jIbp8Kxow+55lVTxLSntO2D m09i+q69z+TRBQIyUy4FhZcMQSzz6Gz1u65799YU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tomeu Vizoso , Lucas Stach , Christian Gmeiner , Sasha Levin Subject: [PATCH 5.10 019/300] drm/etnaviv: fix flush sequence logic Date: Wed, 3 Dec 2025 16:23:43 +0100 Message-ID: <20251203152401.169744933@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152400.447697997@linuxfoundation.org> References: <20251203152400.447697997@linuxfoundation.org> User-Agent: quilt/0.69 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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomeu Vizoso [ Upstream commit a042beac6e6f8ac1e923784cfff98b47cbabb185 ] The current logic uses the flush sequence from the current address space. This is harmless when deducing the flush requirements for the current submit, as either the incoming address space is the same one as the currently active one or we switch context, in which case the flush is unconditional. However, this sequence is also stored as the current flush sequence of the GPU. If we switch context the stored flush sequence will no longer belong to the currently active address space. This incoherency can then cause missed flushes, resulting in translation errors. Fixes: 27b67278e007 ("drm/etnaviv: rework MMU handling") Signed-off-by: Tomeu Vizoso Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Link: https://lore.kernel.org/r/20251021093723.3887980-1-l.stach@pengutronix.de Signed-off-by: Sasha Levin --- drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c index 982174af74b1e..7d897aafb2a6a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c @@ -346,7 +346,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, u32 link_target, link_dwords; bool switch_context = gpu->exec_state != exec_state; bool switch_mmu_context = gpu->mmu_context != mmu_context; - unsigned int new_flush_seq = READ_ONCE(gpu->mmu_context->flush_seq); + unsigned int new_flush_seq = READ_ONCE(mmu_context->flush_seq); bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq; bool has_blt = !!(gpu->identity.minor_features5 & chipMinorFeatures5_BLT_ENGINE); -- 2.51.0