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 C8C70342537; Wed, 3 Dec 2025 15:57:34 +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=1764777454; cv=none; b=SO51D98B/+VAwAMoxWADWpSBxTRD9n5Q8gAb6oSzDct9K2IGM+uwoiJ3YvYAt0zDyIW5uyK3vHAqCIefNFdIJha1SJJ0/P60r40p1+CNgjU1v+z10HcDF/XqVRB4BAfI4LKLds+eYnhTD5Zr8vTwKjL37voMl/UDciQCN19BEq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764777454; c=relaxed/simple; bh=s1SUotEdHhSAlFRxLIhoGDzJy6iNH9ZSQM78/wF8F9o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I4jUxF0vhx9Y0dJtJUH0cvXIw7gsFUkdqGtt71cWpu5fZWAMWS1hBMB8xWDfUZF0iurkfAGF/gyu4jHLtB11ceCGm93cYqXwADu5VAX3Xh0SdPmT3kHgr88ZXKt9rc4LQTK2PBIEmroFMd3VdouGDzJApVeFH5QXxq2NT2WINWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BfGK626R; 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="BfGK626R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5181DC4CEF5; Wed, 3 Dec 2025 15:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764777454; bh=s1SUotEdHhSAlFRxLIhoGDzJy6iNH9ZSQM78/wF8F9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BfGK626R3LSCWuB7S1ikczysZejfL7IQsX9q3uIJp00LOdLenUczS0kbSp6/vn/K3 1Qlscew/NX/Pwf+7mBlQVg1/xdptESnCffYz5k0wwr2ZPnbd8c3W1z3wkdtV4kHIaA YyqT8DrUAXMC59li8frqelIsZ2r2MMDvD5QlJZjQ= 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.15 025/392] drm/etnaviv: fix flush sequence logic Date: Wed, 3 Dec 2025 16:22:55 +0100 Message-ID: <20251203152415.028250424@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@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.15-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