linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations
@ 2019-08-07  2:56 Tao Zhou
  2019-08-07  3:09 ` Jisheng Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Tao Zhou @ 2019-08-07  2:56 UTC (permalink / raw)
  To: amd-gfx, alexander.deucher, hawking.zhang, dennis.li, broonie,
	akpm, christian.koenig
  Cc: kernel-build-reports, linux-arm-kernel, linux-next, Tao Zhou

readq/writeq are not supported on all architectures

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++------
 1 file 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 558fe6d091ed..7eb9e0b9235a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -272,14 +272,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;
 }
 
 /**
@@ -294,7 +290,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();
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-08-09  9:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07  2:56 [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations Tao Zhou
2019-08-07  3:09 ` Jisheng Zhang
2019-08-07  4:02   ` Alex Deucher
2019-08-07  4:03 ` Alex Deucher
2019-08-07  7:08 ` Christoph Hellwig
2019-08-07  8:53   ` Koenig, Christian
2019-08-07 10:41     ` Christoph Hellwig
2019-08-07 10:55       ` Koenig, Christian
2019-08-07 12:59         ` Mark Brown
2019-08-07 13:00           ` Koenig, Christian
2019-08-07 13:07             ` Christoph Hellwig
2019-08-07 13:00         ` Christoph Hellwig
2019-08-07 13:03           ` Koenig, Christian
2019-08-07 18:00             ` Alex Deucher
2019-08-08 19:25 ` Guenter Roeck
2019-08-08 19:33   ` Alex Deucher
2019-08-09  9:04     ` Koenig, Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).