drm/amdgpu/sdma: Fix incorrect calculations of the wptr of the doorbells
authorHaohui Mai <ricetons@gmail.com>
Mon, 25 Apr 2022 12:41:38 +0000 (20:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:34 +0000 (10:22 +0200)
commit7719a8044bf66b9f59818e50b0c7877e1397e7f4
tree6f8f0915b83894819af3e004a54530f06192fbc8
parent942ce0cba14c907eefb954b84045df220c88ebd6
drm/amdgpu/sdma: Fix incorrect calculations of the wptr of the doorbells

[ Upstream commit 7dba6e838e741caadcf27ef717b6dcb561e77f89 ]

This patch fixes the issue where the driver miscomputes the 64-bit
values of the wptr of the SDMA doorbell when initializing the
hardware. SDMA engines v4 and later on have full 64-bit registers for
wptr thus they should be set properly.

Older generation hardwares like CIK / SI have only 16 / 20 / 24bits
for the WPTR, where the calls of lower_32_bits() will be removed in a
following patch.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Haohui Mai <ricetons@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c