drm/msm/adreno: fix updating ring fence
authorRob Clark <robdclark@chromium.org>
Thu, 13 Aug 2020 00:03:09 +0000 (17:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:26 +0000 (11:29 +0200)
commit103942e19ae4454ed07f23323999d6df1fd9e742
tree9716fbca8712e6e1b069312557bc852b239a1467
parent58794696d3d81f26d137b7c7b11dde478a475e73
drm/msm/adreno: fix updating ring fence

[ Upstream commit f228af11dfa1d1616bc67f3a4119ab77c36181f1 ]

We need to set it to the most recent completed fence, not the most
recent submitted.  Otherwise we have races where we think we can retire
submits that the GPU is not finished with, if the GPU doesn't manage to
overwrite the seqno before we look at it.

This can show up with hang recovery if one of the submits after the
crashing submit also hangs after it is replayed.

Fixes: f97decac5f4c ("drm/msm: Support multiple ringbuffers")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/adreno/adreno_gpu.c