From: Tao Zhou <tao.zhou1@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <alexander.deucher@amd.com>,
<hawking.zhang@amd.com>, <dennis.li@amd.com>,
<broonie@kernel.org>, <akpm@linux-foundation.org>,
<christian.koenig@amd.com>
Cc: <kernel-build-reports@lists.linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-next@vger.kernel.org>, "Tao Zhou" <tao.zhou1@amd.com>
Subject: [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations
Date: Wed, 7 Aug 2019 10:56:40 +0800 [thread overview]
Message-ID: <20190807025640.682-1-tao.zhou1@amd.com> (raw)
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
next reply other threads:[~2019-08-07 2:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 2:56 Tao Zhou [this message]
2019-08-07 3:09 ` [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190807025640.682-1-tao.zhou1@amd.com \
--to=tao.zhou1@amd.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=broonie@kernel.org \
--cc=christian.koenig@amd.com \
--cc=dennis.li@amd.com \
--cc=hawking.zhang@amd.com \
--cc=kernel-build-reports@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-next@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).