Commit ba563648 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by sanglipeng
Browse files

drm/msm/a5xx: fix the emptyness check in the preempt code

stable inclusion
from stable-v5.10.175
commit 34e71ca0a0068f9d7e12c59dc997ae5725fa181f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=34e71ca0a0068f9d7e12c59dc997ae5725fa181f



--------------------------------

[ Upstream commit b4fb748f ]

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: default avatarYassine Oudjana <y.oudjana@protonmail.com>
Fixes: b1fc2839 ("drm/msm: Implement preemption for A5XX targets")
Signed-off-by: default avatarDmitry 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: default avatarRob Clark <robdclark@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 7382e435
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment