]> www.infradead.org Git - users/willy/linux.git/commit
drm/msm/adreno: De-spaghettify the use of memory barriers
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Tue, 25 Jun 2024 18:54:41 +0000 (20:54 +0200)
committerRob Clark <robdclark@chromium.org>
Sat, 29 Jun 2024 20:45:30 +0000 (13:45 -0700)
commit43ec1a202cfa9f765412d325b93873284e7c3d82
tree26831e1233667e2a121c9d246be8b42758332404
parent1e210f462b367ccf9589110f33e5350f53c7ec96
drm/msm/adreno: De-spaghettify the use of memory barriers

Memory barriers help ensure instruction ordering, NOT time and order
of actual write arrival at other observers (e.g. memory-mapped IP).
On architectures employing weak memory ordering, the latter can be a
giant pain point, and it has been as part of this driver.

Moreover, the gpu_/gmu_ accessors already use non-relaxed versions of
readl/writel, which include r/w (respectively) barriers.

Replace the barriers with a readback (or drop altogether where possible)
that ensures the previous writes have exited the write buffer (as the CPU
must flush the write to the register it's trying to read back).

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/600869/
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
drivers/gpu/drm/msm/adreno/a6xx_gpu.c