Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm: amdgpu: radeon: disable cache flush workaround for LoongArch and Loongson64 #323

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,14 @@ static void gfx_v7_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
{
bool write64bit = flags & AMDGPU_FENCE_FLAG_64BIT;
bool int_sel = flags & AMDGPU_FENCE_FLAG_INT;

/* 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).
*/
#ifndef CONFIG_MACH_LOONGSON64
/* Workaround for cache flush problems. First send a dummy EOP
* event down the pipe with seq one below.
*/
Expand All @@ -2130,6 +2138,7 @@ static void gfx_v7_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
DATA_SEL(1) | INT_SEL(0));
amdgpu_ring_write(ring, lower_32_bits(seq - 1));
amdgpu_ring_write(ring, upper_32_bits(seq - 1));
#endif

/* Then send the real EOP event down the pipe. */
amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -6154,6 +6154,13 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
bool write64bit = flags & AMDGPU_FENCE_FLAG_64BIT;
bool int_sel = flags & AMDGPU_FENCE_FLAG_INT;

/* 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).
*/
#ifndef CONFIG_MACH_LOONGSON64
/* Workaround for cache flush problems. First send a dummy EOP
* event down the pipe with seq one below.
*/
Expand All @@ -6168,6 +6175,7 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr,
DATA_SEL(1) | INT_SEL(0));
amdgpu_ring_write(ring, lower_32_bits(seq - 1));
amdgpu_ring_write(ring, upper_32_bits(seq - 1));
#endif

/* Then send the real EOP event down the pipe:
* EVENT_WRITE_EOP - flush caches, send int */
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/radeon/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -3543,6 +3543,13 @@ void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
struct radeon_ring *ring = &rdev->ring[fence->ring];
u64 addr = rdev->fence_drv[fence->ring].gpu_addr;

/* 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).
*/
#ifndef CONFIG_MACH_LOONGSON64
/* Workaround for cache flush problems. First send a dummy EOP
* event down the pipe with seq one below.
*/
Expand All @@ -3556,6 +3563,7 @@ void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
DATA_SEL(1) | INT_SEL(0));
radeon_ring_write(ring, fence->seq - 1);
radeon_ring_write(ring, 0);
#endif

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