diff options
author | Tao Zhou <tao.zhou1@amd.com> | 2019-08-07 05:28:54 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-08-09 19:14:11 +0300 |
commit | c6dddf45402caeadc49dc859fa497cfb98841af4 (patch) | |
tree | dde5a0b1cdd97c9a84849ccae3615ea2e57df314 /drivers/gpu | |
parent | 2a1e00c3c0d37f65241236d7731ef6bb92f0d07f (diff) | |
download | linux-c6dddf45402caeadc49dc859fa497cfb98841af4.tar.xz |
drm/amdgpu: replace readq/writeq with atomic64 operations
what we really want is a read or write that is guaranteed to be 64 bits
at a time, atomic64 operations are supported on all architectures
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index e7537e1c4fdf..0471a1d4305c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -273,14 +273,10 @@ void amdgpu_mm_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, */ uint64_t amdgpu_mm_rreg64(struct amdgpu_device *adev, uint32_t reg) { - uint64_t ret; - if ((reg * 4) < adev->rmmio_size) - ret = readq(((void __iomem *)adev->rmmio) + (reg * 4)); + return atomic64_read((atomic64_t *)(adev->rmmio + (reg * 4))); else BUG(); - - return ret; } /** @@ -295,7 +291,7 @@ uint64_t amdgpu_mm_rreg64(struct amdgpu_device *adev, uint32_t reg) void amdgpu_mm_wreg64(struct amdgpu_device *adev, uint32_t reg, uint64_t v) { if ((reg * 4) < adev->rmmio_size) - writeq(v, ((void __iomem *)adev->rmmio) + (reg * 4)); + atomic64_set((atomic64_t *)(adev->rmmio + (reg * 4)), v); else BUG(); } |