]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/a5xx: fix the emptyness check in the preempt code
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 14 Feb 2023 02:09:55 +0000 (05:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:22 +0000 (08:50 +0100)
commit4b1309149b631b97a1f4da56e3609649fb65f1de
treedae7aea88885d9e7282e299923f17d503d72a607
parent60880ac38501a815ef0addc813f098035a41e767
drm/msm/a5xx: fix the emptyness check in the preempt code

[ Upstream commit dfcb111cd1c8f452e74ae4df535d63b94063579c ]

Quoting Yassine: ring->memptrs->rptr is never updated and stays 0, so
the comparison always evaluates to false and get_next_ring always
returns ring 0 thinking it isn't empty.

Fix this by calling get_rptr() instead of reading rptr directly.

Reported-by: Yassine Oudjana <y.oudjana@protonmail.com>
Fixes: 2ae99dd8e304 ("drm/msm: Implement preemption for A5XX targets")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/522642/
Link: https://lore.kernel.org/r/20230214020956.164473-4-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/adreno/a5xx_preempt.c