Skip to content

Commit 4f2dc3d

Browse files
MingcongBaiopsiff
authored andcommitted
drm: amdgpu: radeon: disable cache flush workaround for LoongArch and Loongson64
This workaround causes instability for LoongArch/Loongson (MIPS) devices based on the 7A1000/2000 chipset under heavy I/O load. FIXME: Disable this workaround until we find a better fix (possibly in the platform-specific PCI code). Signed-off-by: Mingcong Bai <baimingcong@uniontech.com> Link: deepin-community#323 (cherry picked from commit 7060b71) Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Conflicts: drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
1 parent 6639f8f commit 4f2dc3d

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,14 @@ static void gfx_v7_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
21252125
bool int_sel = flags & AMDGPU_FENCE_FLAG_INT;
21262126
bool exec = flags & AMDGPU_FENCE_FLAG_EXEC;
21272127

2128+
2129+
/* This workaround causes instability for LoongArch/Loongson (MIPS)
2130+
* devices based on the 7A1000/2000 chipset under heavy I/O load.
2131+
*
2132+
* FIXME: Disable this workaround until we find a better fix (possibly in
2133+
* the platform-specific PCI code).
2134+
*/
2135+
#ifndef CONFIG_MACH_LOONGSON64
21282136
/* Workaround for cache flush problems. First send a dummy EOP
21292137
* event down the pipe with seq one below.
21302138
*/
@@ -2138,6 +2146,7 @@ static void gfx_v7_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
21382146
DATA_SEL(1) | INT_SEL(0));
21392147
amdgpu_ring_write(ring, lower_32_bits(seq - 1));
21402148
amdgpu_ring_write(ring, upper_32_bits(seq - 1));
2149+
#endif
21412150

21422151
/* Then send the real EOP event down the pipe. */
21432152
amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,6 +6113,13 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
61136113
bool int_sel = flags & AMDGPU_FENCE_FLAG_INT;
61146114
bool exec = flags & AMDGPU_FENCE_FLAG_EXEC;
61156115

6116+
/* This workaround causes instability for LoongArch/Loongson (MIPS)
6117+
* devices based on the 7A1000/2000 chipset under heavy I/O load.
6118+
*
6119+
* FIXME: Disable this workaround until we find a better fix (possibly in
6120+
* the platform-specific PCI code).
6121+
*/
6122+
#ifndef CONFIG_MACH_LOONGSON64
61166123
/* Workaround for cache flush problems. First send a dummy EOP
61176124
* event down the pipe with seq one below.
61186125
*/
@@ -6127,6 +6134,7 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
61276134
DATA_SEL(1) | INT_SEL(0));
61286135
amdgpu_ring_write(ring, lower_32_bits(seq - 1));
61296136
amdgpu_ring_write(ring, upper_32_bits(seq - 1));
6137+
#endif
61306138

61316139
/* Then send the real EOP event down the pipe:
61326140
* EVENT_WRITE_EOP - flush caches, send int */

drivers/gpu/drm/radeon/cik.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3543,6 +3543,13 @@ void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
35433543
struct radeon_ring *ring = &rdev->ring[fence->ring];
35443544
u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
35453545

3546+
/* This workaround causes instability for LoongArch/Loongson (MIPS)
3547+
* devices based on the 7A1000/2000 chipset under heavy I/O load.
3548+
*
3549+
* FIXME: Disable this workaround until we find a better fix (possibly in
3550+
* the platform-specific PCI code).
3551+
*/
3552+
#ifndef CONFIG_MACH_LOONGSON64
35463553
/* Workaround for cache flush problems. First send a dummy EOP
35473554
* event down the pipe with seq one below.
35483555
*/
@@ -3556,6 +3563,7 @@ void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
35563563
DATA_SEL(1) | INT_SEL(0));
35573564
radeon_ring_write(ring, fence->seq - 1);
35583565
radeon_ring_write(ring, 0);
3566+
#endif
35593567

35603568
/* Then send the real EOP event down the pipe. */
35613569
radeon_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));

0 commit comments

Comments
 (0)