Skip to contentSkip to conversation

drm/amdgpu/sdma3: set wptr shadow atomically

PATCH In review Xiangliang.Yu 2 participants 2 messages Sep 14, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 drm/amdgpu/sdma3: set wptr shadow atomically

Port it from sdma4 for wptr polling usage.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3 -1
index b7d69ab..728c0d8 100644
@@ -379,8 +379,10 @@ static void sdma_v3_0_ring_set_wptr(struct amdgpu_ring *ring)
 	struct amdgpu_device *adev = ring->adev;
 
 	if (ring->use_doorbell) {
+		u32 *wb = (u32 *)&adev->wb.wb[ring->wptr_offs];
+
 		/* XXX check if swapping is necessary on BE */
-		adev->wb.wb[ring->wptr_offs] = lower_32_bits(ring->wptr) << 2;
+		WRITE_ONCE(*wb, (lower_32_bits(ring->wptr) << 2));
 		WDOORBELL32(ring->doorbell_index, lower_32_bits(ring->wptr) << 2);
 	} else {
 		int me = (ring == &ring->adev->sdma.instance[0].ring) ? 0 : 1;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1505374424-6872-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Xiangliang.Yu
Sent: Thursday, September 14, 2017 3:34 AM
To: [email protected]
Cc: Yu, Xiangliang
Subject: [PATCH 2/2] drm/amdgpu/sdma3: set wptr shadow atomically

Port it from sdma4 for wptr polling usage.

Series is:

Quoted 27 lines
---
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +3 -1
index b7d69ab..728c0d8 100644
@@ -379,8 +379,10 @@ static void sdma_v3_0_ring_set_wptr(struct
 amdgpu_ring *ring)
 	struct amdgpu_device *adev = ring->adev;
 
 	if (ring->use_doorbell) {
+		u32 *wb = (u32 *)&adev->wb.wb[ring->wptr_offs];
+
 		/* XXX check if swapping is necessary on BE */
-		adev->wb.wb[ring->wptr_offs] = lower_32_bits(ring->wptr)
 << 2;
+		WRITE_ONCE(*wb, (lower_32_bits(ring->wptr) << 2));
 		WDOORBELL32(ring->doorbell_index, lower_32_bits(ring-
Quoted 1 line

wptr) << 2);

drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +0 -1
 	} else {
 		int me = (ring == &ring->adev->sdma.instance[0].ring) ? 0 : 1;
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx