All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations
@ 2019-08-07  2:56 ` Tao Zhou
  0 siblings, 0 replies; 49+ messages in thread
From: Tao Zhou @ 2019-08-07  2:56 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	alexander.deucher-5C7GfCeVMHo, hawking.zhang-5C7GfCeVMHo,
	dennis.li-5C7GfCeVMHo, broonie-DgEjT+Ai2ygdnm+yROfE0A,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	christian.koenig-5C7GfCeVMHo
  Cc: Tao Zhou, linux-next-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kernel-build-reports-cunTk1MwBs8s++Sfvej+rw

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

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

Thread overview: 49+ 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  2:56 ` Tao Zhou
2019-08-07  2:56 ` Tao Zhou
2019-08-07  3:09 ` Jisheng Zhang
2019-08-07  3:09   ` Jisheng Zhang
2019-08-07  3:09   ` Jisheng Zhang
     [not found]   ` <20190807105759.58a28ef0-XW7BGIvHH6X931TTwiNRCw@public.gmane.org>
2019-08-07  4:02     ` Alex Deucher
2019-08-07  4:02       ` Alex Deucher
2019-08-07  4:02       ` Alex Deucher
     [not found] ` <20190807025640.682-1-tao.zhou1-5C7GfCeVMHo@public.gmane.org>
2019-08-07  4:03   ` Alex Deucher
2019-08-07  4:03     ` Alex Deucher
2019-08-07  4:03     ` Alex Deucher
2019-08-07  7:08 ` Christoph Hellwig
2019-08-07  7:08   ` Christoph Hellwig
2019-08-07  7:08   ` Christoph Hellwig
     [not found]   ` <20190807070834.GA24792-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2019-08-07  8:53     ` Koenig, Christian
2019-08-07  8:53       ` Koenig, Christian
2019-08-07  8:53       ` Koenig, Christian
2019-08-07 10:41       ` Christoph Hellwig
2019-08-07 10:41         ` Christoph Hellwig
2019-08-07 10:41         ` Christoph Hellwig
2019-08-07 10:55         ` Koenig, Christian
2019-08-07 10:55           ` Koenig, Christian
2019-08-07 10:55           ` Koenig, Christian
2019-08-07 12:59           ` Mark Brown
2019-08-07 12:59             ` Mark Brown
     [not found]             ` <20190807125928.GC4048-7j8lgAiuQgnQXOPxS62xeg@public.gmane.org>
2019-08-07 13:00               ` Koenig, Christian
2019-08-07 13:00                 ` Koenig, Christian
2019-08-07 13:00                 ` Koenig, Christian
2019-08-07 13:07                 ` Christoph Hellwig
2019-08-07 13:07                   ` Christoph Hellwig
2019-08-07 13:07                   ` Christoph Hellwig
2019-08-07 13:00           ` Christoph Hellwig
2019-08-07 13:00             ` Christoph Hellwig
2019-08-07 13:00             ` Christoph Hellwig
     [not found]             ` <20190807130043.GA6023-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2019-08-07 13:03               ` Koenig, Christian
2019-08-07 13:03                 ` Koenig, Christian
2019-08-07 13:03                 ` Koenig, Christian
     [not found]                 ` <c613ca25-4443-f275-ea8d-6d55af10ac77-5C7GfCeVMHo@public.gmane.org>
2019-08-07 18:00                   ` Alex Deucher
2019-08-07 18:00                     ` Alex Deucher
2019-08-07 18:00                     ` Alex Deucher
2019-08-08 19:25 ` Guenter Roeck
2019-08-08 19:25   ` Guenter Roeck
     [not found]   ` <20190808192535.GA18697-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2019-08-08 19:33     ` Alex Deucher
2019-08-08 19:33       ` Alex Deucher
2019-08-08 19:33       ` Alex Deucher
     [not found]       ` <CADnq5_ONGvL0yMybsXCyYJO6zKRAi4aEPo8LwEwQjSP3aVbdJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-09  9:04         ` Koenig, Christian
2019-08-09  9:04           ` Koenig, Christian
2019-08-09  9:04           ` Koenig, Christian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.