radeon: use memcpy_to/fromio for UVD fw upload
authorChen Li <chenli@uniontech.com>
Fri, 4 Jun 2021 08:43:02 +0000 (16:43 +0800)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:49:16 +0000 (08:49 -0400)
commit9d704cd5b4ba5f872d633419d8b1704a4658320f
tree57d1c005056d9074fcda28cbfcbe56e652f0c637
parentd9a6a2654d3946b35e63b9f9e3a5bd6345d7bb2f
radeon: use memcpy_to/fromio for UVD fw upload

[ Upstream commit ab8363d3875a83f4901eb1cc00ce8afd24de6c85 ]

I met a gpu addr bug recently and the kernel log
tells me the pc is memcpy/memset and link register is
radeon_uvd_resume.

As we know, in some architectures, optimized memcpy/memset
may not work well on device memory. Trival memcpy_toio/memset_io
can fix this problem.

BTW, amdgpu has already done it in:
commit ba0b2275a678 ("drm/amdgpu: use memcpy_to/fromio for UVD fw upload"),
that's why it has no this issue on the same gpu and platform.

Signed-off-by: Chen Li <chenli@uniontech.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/radeon/radeon_uvd.c