Commit 65e06b78 authored by Chen Li's avatar Chen Li Committed by Alex Deucher

radeon: use memcpy_to/fromio for UVD fw upload

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 ba0b2275 ("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: default avatarChen Li <chenli@uniontech.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c0f2b640
...@@ -288,7 +288,7 @@ int radeon_uvd_resume(struct radeon_device *rdev) ...@@ -288,7 +288,7 @@ int radeon_uvd_resume(struct radeon_device *rdev)
if (rdev->uvd.vcpu_bo == NULL) if (rdev->uvd.vcpu_bo == NULL)
return -EINVAL; return -EINVAL;
memcpy(rdev->uvd.cpu_addr, rdev->uvd_fw->data, rdev->uvd_fw->size); memcpy_toio((void __iomem *)rdev->uvd.cpu_addr, rdev->uvd_fw->data, rdev->uvd_fw->size);
size = radeon_bo_size(rdev->uvd.vcpu_bo); size = radeon_bo_size(rdev->uvd.vcpu_bo);
size -= rdev->uvd_fw->size; size -= rdev->uvd_fw->size;
...@@ -296,7 +296,7 @@ int radeon_uvd_resume(struct radeon_device *rdev) ...@@ -296,7 +296,7 @@ int radeon_uvd_resume(struct radeon_device *rdev)
ptr = rdev->uvd.cpu_addr; ptr = rdev->uvd.cpu_addr;
ptr += rdev->uvd_fw->size; ptr += rdev->uvd_fw->size;
memset(ptr, 0, size); memset_io((void __iomem *)ptr, 0, size);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment