drm/etnaviv: consider completed fence seqno in hang check
authorLucas Stach <l.stach@pengutronix.de>
Wed, 22 Dec 2021 00:17:28 +0000 (01:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:49 +0000 (11:04 +0100)
commit46241ec22925290e1f5d894de3ba7280fd4865f2
tree388b83e12cbf9e45f0f925f890c468c890338eed
parent2b68b42a5d05b236e0eef29266ca8fa1f92a2d5f
drm/etnaviv: consider completed fence seqno in hang check

[ Upstream commit cdd156955f946beaa5f3a00d8ccf90e5a197becc ]

Some GPU heavy test programs manage to trigger the hangcheck quite often.
If there are no other GPU users in the system and the test program
exhibits a very regular structure in the commandstreams that are being
submitted, we can end up with two distinct submits managing to trigger
the hangcheck with the FE in a very similar address range. This leads
the hangcheck to believe that the GPU is stuck, while in reality the GPU
is already busy working on a different job. To avoid those spurious
GPU resets, also remember and consider the last completed fence seqno
in the hang check.

Reported-by: Joerg Albert <joerg.albert@iav.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/etnaviv/etnaviv_gpu.h
drivers/gpu/drm/etnaviv/etnaviv_sched.c