]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/v3d: Address race-condition in MMU flush
authorMaíra Canal <mcanal@igalia.com>
Mon, 23 Sep 2024 13:55:05 +0000 (10:55 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:52 +0000 (19:50 +0100)
commit6887f9f412677afc02bf06558164c2356e35bb51
treead2687f3f776b8bd644d33591ab67a6aadc90c8b
parent89267ef694d0a93f11c5629cc5f169a358809521
drm/v3d: Address race-condition in MMU flush

[ Upstream commit cf1becb7f996a0a23ea2c270cf6bb0911ec3ca1a ]

We must first flush the MMU cache and then, flush the TLB, not the other
way around. Currently, we can see a race condition between the MMU cache
and the TLB when running multiple rendering processes at the same time.
This is evidenced by MMU errors triggered by the IRQ.

Fix the MMU flush order by flushing the MMU cache and then the TLB.
Also, in order to address the race condition, wait for the MMU cache flush
to finish before starting the TLB flush.

Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923141348.2422499-2-mcanal@igalia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/v3d/v3d_mmu.c