drm/amdgpu/gfx8: replace BUG_ON() with WARN_ON()
Subsystems (3)
Alex Deucher
maintainerPATCH 1/43 drm/amdgpu/gfx8: replace BUG_ON() with WARN_ON()
There's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0 -3
@@ -6256,9 +6256,6 @@ static void gfx_v8_0_ring_emit_fence_compute(struct amdgpu_ring *ring,static void gfx_v8_0_ring_emit_fence_kiq (struct amdgpu_ring *ring,u64 addr,u64 seq,unsigned int flags) { -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 2/43 drm/amdgpu/gfx9: replace BUG_ON() with WARN_ON()
There's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5 -5
@@ -1183,7 +1183,7 @@ static void gfx_v9_0_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, WAIT_REG_MEM_ENGINE(eng_sel)));if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -5435,7 +5435,7 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, }amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -5531,7 +5531,7 @@ static void gfx_v9_0_ring_emit_ib_compute(struct amdgpu_ring *ring, }amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -5572,9 +5572,9 @@ static void gfx_v9_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 3/43 drm/amdgpu/gfx9.4.3: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +4 -7
@@ -405,7 +405,7 @@ static void gfx_v9_4_3_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, WAIT_REG_MEM_ENGINE(eng_sel)));if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -2944,7 +2944,7 @@ static void gfx_v9_4_3_ring_emit_ib_compute(struct amdgpu_ring *ring, }amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -2978,9 +2978,9 @@ static void gfx_v9_4_3_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -3040,9 +3040,6 @@ static void gfx_v9_4_3_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, {struct amdgpu_device *adev = ring->adev; -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 4/43 drm/amdgpu/gfx10: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -8
@@ -4022,7 +4022,7 @@ static void gfx_v10_0_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, WAIT_REG_MEM_ENGINE(eng_sel)));if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -8661,7 +8661,7 @@ static void gfx_v10_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, }amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -8696,7 +8696,7 @@ static void gfx_v10_0_ring_emit_ib_compute(struct amdgpu_ring *ring, }amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -8729,9 +8729,9 @@ static void gfx_v10_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -8779,9 +8779,6 @@ static void gfx_v10_0_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, {struct amdgpu_device *adev = ring->adev; -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 5/43 drm/amdgpu/gfx11: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +5 -8
@@ -546,7 +546,7 @@ static void gfx_v11_0_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, WAIT_REG_MEM_ENGINE(eng_sel)));if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -6024,7 +6024,7 @@ static void gfx_v11_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, }amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -6059,7 +6059,7 @@ static void gfx_v11_0_ring_emit_ib_compute(struct amdgpu_ring *ring, }amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -6092,9 +6092,9 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -6148,9 +6148,6 @@ static void gfx_v11_0_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, {struct amdgpu_device *adev = ring->adev; -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 6/43 drm/amdgpu/gfx12: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +5 -8
@@ -440,7 +440,7 @@ static void gfx_v12_0_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, WAIT_REG_MEM_ENGINE(eng_sel)));if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -4509,7 +4509,7 @@ static void gfx_v12_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, control |= ib->length_dw | (vmid <<24 );amdgpu_ring_write (ring, header); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -4528,7 +4528,7 @@ static void gfx_v12_0_ring_emit_ib_compute(struct amdgpu_ring *ring,u32 control =INDIRECT_BUFFER_VALID | ib->length_dw | (vmid <<24 );amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -4559,9 +4559,9 @@ static void gfx_v12_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -4609,9 +4609,6 @@ static void gfx_v12_0_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, {struct amdgpu_device *adev = ring->adev; -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 7/43 drm/amdgpu/gfx12.1: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +4 -7
@@ -248,7 +248,7 @@ static void gfx_v12_1_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, PACKET3_WAIT_REG_MEM__FUNCTION(3))); /* equal */if (mem_space) -BUG_ON (addr0 &0x3 );/* Dword align */ +WARN_ON (addr0 &0x3 );/* Dword align */ amdgpu_ring_write (ring, addr0);amdgpu_ring_write (ring, addr1);amdgpu_ring_write (ring, ref);
@@ -3435,7 +3435,7 @@ static void gfx_v12_1_ring_emit_ib_compute(struct amdgpu_ring *ring, }amdgpu_ring_write (ring,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 )); -BUG_ON (ib->gpu_addr &0x3 );/* Dword align */ +WARN_ON (ib->gpu_addr &0x3 );/* Dword align */ amdgpu_ring_write(ring, #ifdef __BIG_ENDIAN (2 << 0) |
@@ -3468,9 +3468,9 @@ static void gfx_v12_1_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,* aligned if only send 32bit data low (discard data high) */ if (write64bit) -BUG_ON (addr &0x7 ); +WARN_ON (addr &0x7 );else -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -3517,9 +3517,6 @@ static void gfx_v12_1_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, {struct amdgpu_device *adev = ring->adev; -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 ));amdgpu_ring_write (ring, (PACKET3_WRITE_DATA__DST_SEL (5 ) |PACKET3_WRITE_DATA__WR_CONFIRM (1 )));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 8/43 drm/amdgpu/sdma4.4.2: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -2
@@ -457,7 +457,7 @@ static void sdma_v4_4_2_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64/* write the fence */ amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -467,7 +467,7 @@ static void sdma_v4_4_2_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 addr +=4 ;amdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 9/43 drm/amdgpu/sdma5.0: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +2 -2
@@ -527,7 +527,7 @@ static void sdma_v5_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* Ucached(UC) */ /* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -538,7 +538,7 @@ static void sdma_v5_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 10/43 drm/amdgpu/sdma5.2: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +2 -2
@@ -377,7 +377,7 @@ static void sdma_v5_2_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* Ucached(UC) */ /* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -388,7 +388,7 @@ static void sdma_v5_2_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 11/43 drm/amdgpu/sdma6.0: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +2 -2
@@ -361,7 +361,7 @@ static void sdma_v6_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* Ucached(UC) */ /* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -372,7 +372,7 @@ static void sdma_v6_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 12/43 drm/amdgpu/sdma7.0: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +2 -2
@@ -363,7 +363,7 @@ static void sdma_v7_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* Ucached(UC) */ /* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -374,7 +374,7 @@ static void sdma_v7_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 13/43 drm/amdgpu/sdma7.1: replace BUG_ON() with WARN_ON()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c +2 -2
@@ -331,7 +331,7 @@ static void sdma_v7_1_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* Ucached(UC) */ /* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,lower_32_bits (seq));
@@ -342,7 +342,7 @@ static void sdma_v7_1_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seamdgpu_ring_write (ring,SDMA_PKT_COPY_LINEAR_HEADER_OP (SDMA_OP_FENCE ) |SDMA_PKT_FENCE_HEADER_MTYPE (0x3 ));/* zero in first two bits */ -BUG_ON (addr &0x3 ); +WARN_ON (addr &0x3 );amdgpu_ring_write (ring,lower_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (addr));amdgpu_ring_write (ring,upper_32_bits (seq));
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 14/43 drm/amdgpu: return an error instead of BUG() for CSA bo_va
In reply to Alex DeucherIf the bo_va is not present, return an error rather than crashing the kernel.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -1
@@ -1124,7 +1124,8 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)if (fpriv->csa_va) { bo_va = fpriv->csa_va; -BUG_ON (!bo_va); +if (!bo_va) +return -ENOMEM ; r =amdgpu_vm_bo_update (adev, bo_va, false);if (r)return r;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 15/43 drm/amdgpu/gfx11: WARN() rather than BUG() for invalid SDMA engine
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +2 -1
@@ -139,7 +139,8 @@ static uint32_t get_sdma_rlc_reg_offset(struct amdgpu_device *adev, regSDMA1_QUEUE0_RB_CNTL) - regSDMA0_QUEUE0_RB_CNTL;break ;default : -BUG (); +WARN (1 ,"Invalid SDMA engine id %d\n" , engine_id); +break ; } sdma_rlc_reg_offset = sdma_engine_reg_base
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 16/43 drm/amdgpu/gfx12: WARN() rather than BUG() for invalid SDMA engine
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c +2 -1
@@ -90,7 +90,8 @@ static uint32_t get_sdma_rlc_reg_offset(struct amdgpu_device *adev, regSDMA1_QUEUE0_RB_CNTL) - regSDMA0_QUEUE0_RB_CNTL;break ;default : -BUG (); +WARN (1 ,"Invalid SDMA engine id %d\n" , engine_id); +break ; } sdma_rlc_reg_offset = sdma_engine_reg_base
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 17/43 drm/amdgpu/gfx12.1: WARN() rather than BUG() for invalid SDMA engine
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12_1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12_1.c +2 -1
@@ -93,7 +93,8 @@ static uint32_t get_sdma_rlc_reg_offset(struct amdgpu_device *adev, regSDMA1_SDMA_QUEUE0_RB_CNTL) - regSDMA0_SDMA_QUEUE0_RB_CNTL;break ;default : -BUG (); +WARN (1 ,"Invalid SDMA engine id %d\n" , engine_id); +break ; } sdma_rlc_reg_offset = sdma_engine_reg_base
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 18/43 drm/amdgpu/atomfirmware: WARN() rather than BUG()
In reply to Alex DeucherThere's no need to crash the kernel for this case. Just return an error.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +0 -2
@@ -917,8 +917,6 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev) (crev != 6)) { spll->reference_freq =le32_to_cpu (gfx_info->v22.rlc_gpu_timer_refclk); ret =0 ; - } else { -BUG (); } } }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 19/43 drm/amdgpu/cgs: WARN() rather than BUG()
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +3 -5
@@ -76,10 +76,9 @@ static uint32_t amdgpu_cgs_read_ind_register(struct cgs_device *cgs_device,DRM_ERROR ("audio endpt register access not implemented.\n" );return 0 ;default : -BUG (); +WARN (1 ,"Invalid indirect register space" ); +return 0 ; } -WARN (1 ,"Invalid indirect register space" ); -return 0 ; } static void amdgpu_cgs_write_ind_register(struct cgs_device *cgs_device,
@@ -104,9 +103,8 @@ static void amdgpu_cgs_write_ind_register(struct cgs_device *cgs_device,DRM_ERROR ("audio endpt register access not implemented.\n" );return ;default : -BUG (); +WARN (1 ,"Invalid indirect register space" ); } -WARN (1 ,"Invalid indirect register space" ); }static uint32_t fw_type_convert (struct cgs_device *cgs_device,uint32_t fw_type)
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 20/43 drm/amdgpu/ucode: WARN() rather than BUG()
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +2 -1
@@ -1478,7 +1478,8 @@ void amdgpu_ucode_ip_version_decode(struct amdgpu_device *adev, int block_type, ip_name ="isp" ;break ;default : -BUG (); +WARN (1 ,"invalid HWIP %d\n" , block_type); +return ; } maj =IP_VERSION_MAJ (version);
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 21/43 drm/amdgpu/cik_sdma: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/cik_sdma.c +2 -1
@@ -125,7 +125,8 @@ static int cik_sdma_init_microcode(struct amdgpu_device *adev)case CHIP_MULLINS : chip_name ="mullins" ;break ; -default :BUG (); +default : +return -EINVAL ; }for (i =0 ; i < adev->sdma.num_instances; i++) {
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 22/43 drm/amdgpu/sdma2.4: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +1 -1
@@ -138,7 +138,7 @@ static int sdma_v2_4_init_microcode(struct amdgpu_device *adev) chip_name ="topaz" ;break ;default : -BUG (); +return -EINVAL ; }for (i =0 ; i < adev->sdma.num_instances; i++) {
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 23/43 drm/amdgpu/sdma3.0: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +2 -1
@@ -298,7 +298,8 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev)case CHIP_STONEY : chip_name ="stoney" ;break ; -default :BUG (); +default : +return -EINVAL ; }for (i =0 ; i < adev->sdma.num_instances; i++) {
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 24/43 drm/amdgpu/si: drop BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/si.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/si.c +2 -2
@@ -2224,7 +2224,7 @@ static void si_init_golden_registers(struct amdgpu_device *adev)default : -BUG (); +break ; } }
@@ -2741,7 +2741,7 @@ int si_set_ip_blocks(struct amdgpu_device *adev)amdgpu_device_ip_block_add (adev, &amdgpu_vkms_ip_block);break ;default : -BUG (); +break ; }return 0 ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 25/43 drm/amdgpu/gmc6: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +1 -1
@@ -124,7 +124,7 @@ static int gmc_v6_0_init_microcode(struct amdgpu_device *adev) chip_name ="hainan" ;break ;default : -BUG (); +return -EINVAL ; }/* this memory configuration requires special firmware */
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 26/43 drm/amdgpu/imu11: WARN() rather than BUG()
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/imu_v11_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +2 -1
@@ -375,7 +375,8 @@ static void imu_v11_0_program_rlc_ram(struct amdgpu_device *adev)imu_v11_0_3_program_rlc_ram (adev);break ;default : -BUG (); +WARN (1 ,"Invalid GFX/IMU IP version 0x%08x\n" , +amdgpu_ip_version (adev,GC_HWIP ,0 ));break ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 27/43 drm/amdgpu/imu12: WARN() rather than BUG()
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/imu_v12_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/imu_v12_0.c +2 -1
@@ -382,7 +382,8 @@ static void imu_v12_0_program_rlc_ram(struct amdgpu_device *adev) (const u32)ARRAY_SIZE(imu_rlc_ram_golden_12_0_1));break ;default : -BUG (); +WARN (1 ,"Invalid GFX/IMU IP version 0x%08x\n" , +amdgpu_ip_version (adev,GC_HWIP ,0 ));break ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 28/43 drm/amdgpu/mes11: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +10 -7
@@ -82,7 +82,7 @@ static void mes_v11_0_ring_set_wptr(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG (); +dev_warn (adev->dev,"mes_v11_0_ring_set_wptr() requires doorbell!\n" ); } }
@@ -93,12 +93,15 @@ static u64 mes_v11_0_ring_get_rptr(struct amdgpu_ring *ring)static u64 mes_v11_0_ring_get_wptr (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr; -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"mes_v11_0_ring_get_wptr() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -290,7 +293,7 @@ static int convert_to_mes_queue_type(int queue_type)else if (queue_type ==AMDGPU_RING_TYPE_SDMA )return MES_QUEUE_TYPE_SDMA ;else -BUG (); +WARN (1 ,"Invalid queue type %d\n" , queue_type);return -1 ; }
@@ -1536,7 +1539,7 @@ static int mes_v11_0_queue_init(struct amdgpu_device *adev,else if (pipe ==AMDGPU_MES_SCHED_PIPE ) ring = &adev->mes.ring[0 ];else -BUG (); +WARN (1 ,"Invalid MES pipe %d\n" , pipe);if ((pipe ==AMDGPU_MES_SCHED_PIPE ) && (amdgpu_in_reset (adev) || adev->in_suspend)) {
@@ -1619,7 +1622,7 @@ static int mes_v11_0_mqd_sw_init(struct amdgpu_device *adev,else if (pipe ==AMDGPU_MES_SCHED_PIPE ) ring = &adev->mes.ring[0 ];else -BUG (); +return -EINVAL ;if (ring->mqd_obj)return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 29/43 drm/amdgpu/mes12: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c +8 -5
@@ -59,7 +59,7 @@ static void mes_v12_0_ring_set_wptr(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG (); +dev_warn (adev->dev,"mes_v12_0_ring_set_wptr() requires doorbell!\n" ); } }
@@ -70,12 +70,15 @@ static u64 mes_v12_0_ring_get_rptr(struct amdgpu_ring *ring)static u64 mes_v12_0_ring_get_wptr (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr; -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"mes_v12_0_ring_get_wptr() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -279,7 +282,7 @@ static int convert_to_mes_queue_type(int queue_type)else if (queue_type ==AMDGPU_RING_TYPE_MES )return MES_QUEUE_TYPE_SCHQ ;else -BUG (); +WARN (1 ,"Invalid queue type %d\n" , queue_type);return -1 ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 30/43 drm/amdgpu/mes12.1: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/mes_v12_1.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/mes_v12_1.c +9 -5
@@ -62,7 +62,7 @@ static void mes_v12_1_ring_set_wptr(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG (); +dev_warn (adev->dev,"mes_v12_1_ring_set_wptr() requires doorbell!\n" ); } }
@@ -73,12 +73,16 @@ static u64 mes_v12_1_ring_get_rptr(struct amdgpu_ring *ring)static u64 mes_v12_1_ring_get_wptr (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr; -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"mes_v12_1_ring_get_wptr() requires doorbell!\n" ); + wptr =0 ; + + }return wptr; }
@@ -279,7 +283,7 @@ static int convert_to_mes_queue_type(int queue_type)else if (queue_type ==AMDGPU_RING_TYPE_MES )return MES_QUEUE_TYPE_SCHQ ;else -BUG (); +WARN (1 ,"Invalid queue type %d\n" , queue_type);return -1 ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 31/43 drm/amdgpu/psp11: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +1 -1
@@ -136,7 +136,7 @@ static int psp_v11_0_init_microcode(struct psp_context *psp) err =psp_init_toc_microcode (psp, ucode_prefix);break ;default : -BUG (); +return -EINVAL ; }return err;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 32/43 drm/amdgpu/psp13: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +1 -1
@@ -133,7 +133,7 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)return err;break ;default : -BUG (); +return -EINVAL ; }return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 33/43 drm/amdgpu/psp13.0.4: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/psp_v13_0_4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0_4.c +1 -1
@@ -50,7 +50,7 @@ static int psp_v13_0_4_init_microcode(struct psp_context *psp)return err;break ;default : -BUG (); +return -EINVAL ; }return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 34/43 drm/amdgpu/psp14: replace BUG() with an error
In reply to Alex DeucherThere's no need to crash the kernel for this case.
--- drivers/gpu/drm/amd/amdgpu/psp_v14_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/psp_v14_0.c +1 -1
@@ -85,7 +85,7 @@ static int psp_v14_0_init_microcode(struct psp_context *psp)return err;break ;default : -BUG (); +return -EINVAL ; }return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 35/43 drm/amdgpu/gfx6: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +3 -6
@@ -347,7 +347,8 @@ static int gfx_v6_0_init_microcode(struct amdgpu_device *adev)case CHIP_HAINAN : chip_name ="hainan" ;break ; -default :BUG (); +default : +return -EINVAL ; } err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
@@ -1736,7 +1737,6 @@ static void gfx_v6_0_constants_init(struct amdgpu_device *adev) gb_addr_config =HAINAN_GB_ADDR_CONFIG_GOLDEN ;break ;default : -BUG ();break ; }
@@ -2202,7 +2202,7 @@ static u64 gfx_v6_0_ring_get_wptr(struct amdgpu_ring *ring)else if (ring == &adev->gfx.compute_ring[1 ])return RREG32 (mmCP_RB2_WPTR);else -BUG (); +return 0 ; }static void gfx_v6_0_ring_set_wptr_gfx (struct amdgpu_ring *ring)
@@ -2223,8 +2223,6 @@ static void gfx_v6_0_ring_set_wptr_compute(struct amdgpu_ring *ring) }else if (ring == &adev->gfx.compute_ring[1 ]) {WREG32 (mmCP_RB2_WPTR,lower_32_bits (ring->wptr)); (void )RREG32 (mmCP_RB2_WPTR); - }else { -BUG (); } }
@@ -3310,7 +3308,6 @@ static void gfx_v6_0_set_compute_eop_interrupt_state(struct amdgpu_device *adev, }default : -BUG ();break ; }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 36/43 drm/amdgpu/gfx7: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +1 -1
@@ -933,7 +933,7 @@ static int gfx_v7_0_init_microcode(struct amdgpu_device *adev) chip_name ="mullins" ;break ;default : -BUG (); +return -EINVAL ; } err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 37/43 drm/amdgpu/gfx8: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -1
@@ -977,7 +977,7 @@ static int gfx_v8_0_init_microcode(struct amdgpu_device *adev) chip_name ="vegam" ;break ;default : -BUG (); +return -EINVAL ; }if (adev->asic_type >=CHIP_POLARIS10 && adev->asic_type <=CHIP_POLARIS12 ) {
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 38/43 drm/amdgpu/gfx9: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +9 -7
@@ -2107,8 +2107,7 @@ static int gfx_v9_0_gpu_early_init(struct amdgpu_device *adev)return err;break ;default : -BUG (); -break ; +return -EINVAL ; } adev->gfx.config.gb_addr_config = gb_addr_config;
@@ -5640,13 +5639,16 @@ static u64 gfx_v9_0_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v9_0_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"gfx_v9_0_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -5658,8 +5660,8 @@ static void gfx_v9_0_ring_set_wptr_compute(struct amdgpu_ring *ring)if (ring->use_doorbell) {atomic64_set ((atomic64_t *)ring->wptr_cpu_addr, ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); - }else { -BUG ();/* only DOORBELL method supported on gfx9 now */ + }else { +dev_warn (adev->dev,"gfx_v9_0_ring_set_wptr_compute() requires doorbell!\n" ); } }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 39/43 drm/amdgpu/gfx9.4.3: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +10 -4
@@ -3012,13 +3012,18 @@ static u64 gfx_v9_4_3_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v9_4_3_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)&ring->adev->wb.wb[ring->wptr_offs]); -else -BUG (); + }else { +dev_warn (adev->dev, +"gfx_v9_4_3_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + + }return wptr; }
@@ -3031,7 +3036,8 @@ static void gfx_v9_4_3_ring_set_wptr_compute(struct amdgpu_ring *ring)atomic64_set ((atomic64_t *)&adev->wb.wb[ring->wptr_offs], ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG ();/* only DOORBELL method supported on gfx9 now */ +dev_warn (adev->dev, +"gfx_v9_4_3_ring_set_wptr_compute() requires doorbell!\n" ); } }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 40/43 drm/amdgpu/gfx10: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +10 -8
@@ -4580,7 +4580,7 @@ static const struct amdgpu_gfx_funcs gfx_v10_0_gfx_funcs = {static void gfx_v10_0_gpu_early_init (struct amdgpu_device *adev) { -u32 gb_addr_config; +u32 gb_addr_config =0 ;switch (amdgpu_ip_version (adev,GC_HWIP ,0 )) {case IP_VERSION (10 ,1 ,10 ):
@@ -4620,7 +4620,6 @@ static void gfx_v10_0_gpu_early_init(struct amdgpu_device *adev) gb_addr_config =CYAN_SKILLFISH_GB_ADDR_CONFIG_GOLDEN ;break ;default : -BUG ();break ; }
@@ -8594,13 +8593,16 @@ static u64 gfx_v10_0_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v10_0_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"gfx_v10_0_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -8613,7 +8615,7 @@ static void gfx_v10_0_ring_set_wptr_compute(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG ();/* only DOORBELL method supported on gfx10 now */ +dev_warn (adev->dev,"gfx_v10_0_ring_set_wptr_compute() requires doorbell!\n" ); } }
@@ -9371,7 +9373,7 @@ static void gfx_v10_0_handle_priv_fault(struct amdgpu_device *adev, }break ;default : -BUG (); +break ; } }
@@ -9441,7 +9443,7 @@ static int gfx_v10_0_kiq_set_interrupt_state(struct amdgpu_device *adev, }break ;default : -BUG ();/* kiq only support GENERIC2_INT now */ +/* kiq only support GENERIC2_INT now */ break ; }return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 41/43 drm/amdgpu/gfx11: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +9 -8
@@ -1135,8 +1135,7 @@ static int gfx_v11_0_gpu_early_init(struct amdgpu_device *adev) adev->gfx.config.sc_earlyz_tile_fifo_size =0x300 ;break ;default : -BUG (); -break ; +return -EINVAL ; }return 0 ;
@@ -5959,13 +5958,16 @@ static u64 gfx_v11_0_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v11_0_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"gfx_v11_0_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -5979,7 +5981,7 @@ static void gfx_v11_0_ring_set_wptr_compute(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG ();/* only DOORBELL method supported on gfx11 now */ +dev_warn (adev->dev,"gfx_v11_0_ring_set_wptr_compute() requires doorbell!\n" ); } }
@@ -6731,7 +6733,6 @@ static void gfx_v11_0_handle_priv_fault(struct amdgpu_device *adev, }break ;default : -BUG ();break ; } }
@@ -6811,7 +6812,7 @@ static int gfx_v11_0_kiq_set_interrupt_state(struct amdgpu_device *adev, }break ;default : -BUG ();/* kiq only support GENERIC2_INT now */ +/* kiq only support GENERIC2_INT now */ break ; }return 0 ;
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 42/43 drm/amdgpu/gfx12: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +8 -7
@@ -964,8 +964,7 @@ static int gfx_v12_0_gpu_early_init(struct amdgpu_device *adev) adev->gfx.config.sc_earlyz_tile_fifo_size =0x4C0 ;break ;default : -BUG (); -break ; +return -EINVAL ; }return 0 ;
@@ -4455,13 +4454,16 @@ static u64 gfx_v12_0_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v12_0_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"gfx_v12_0_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -4475,7 +4477,7 @@ static void gfx_v12_0_ring_set_wptr_compute(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG ();/* only DOORBELL method supported on gfx12 now */ +dev_warn (adev->dev,"gfx_v12_0_ring_set_wptr_compute() requires doorbell!\n" ); } }
@@ -5048,7 +5050,6 @@ static void gfx_v12_0_handle_priv_fault(struct amdgpu_device *adev, }break ;default : -BUG ();break ; } }
Signature · 1 line
2.54.0
Alex Deucher
maintainerPATCH 43/43 drm/amdgpu/gfx12.1: drop all BUG()s
In reply to Alex DeucherThere's no need to crash the kernel for these cases.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +8 -6
@@ -770,8 +770,7 @@ static int gfx_v12_1_gpu_early_init(struct amdgpu_device *adev) adev->gfx.config.sc_earlyz_tile_fifo_size =0x4C0 ;break ;default : -BUG (); -break ; +return -EINVAL ; }return 0 ;
@@ -3387,13 +3386,16 @@ static u64 gfx_v12_1_ring_get_rptr_compute(struct amdgpu_ring *ring)static u64 gfx_v12_1_ring_get_wptr_compute (struct amdgpu_ring *ring) { +struct amdgpu_device *adev = ring->adev;u64 wptr;/* XXX check if swapping is necessary on BE */ -if (ring->use_doorbell) +if (ring->use_doorbell) { wptr =atomic64_read ((atomic64_t *)ring->wptr_cpu_addr); -else -BUG (); + }else { +dev_warn (adev->dev,"gfx_v12_1_ring_get_wptr_compute() requires doorbell!\n" ); + wptr =0 ; + }return wptr; }
@@ -3407,7 +3409,7 @@ static void gfx_v12_1_ring_set_wptr_compute(struct amdgpu_ring *ring) ring->wptr);WDOORBELL64 (ring->doorbell_index, ring->wptr); }else { -BUG ();/* only DOORBELL method supported on gfx12 now */ +dev_warn (adev->dev,"gfx_v12_1_ring_set_wptr_compute() requires doorbell!\n" ); } }
Signature · 1 line
2.54.0
Ping on this series?
Quoted 25 lines · Alex Deucher
There's no need to crash the kernel for these cases.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +0
-4@@ -6256,9 +6256,6 @@ static void gfx_v8_0_ring_emit_fence_compute(struct amdgpu_ring *ring,static void gfx_v8_0_ring_emit_fence_kiq (struct amdgpu_ring *ring,u64 addr,u64 seq,unsigned int flags) { -/* we only allocate 32bit for each seq wb address */ -BUG_ON (flags &AMDGPU_FENCE_FLAG_64BIT ); -/* write fence seq to the "addr" */ amdgpu_ring_write (ring,PACKET3 (PACKET3_WRITE_DATA ,3 )); amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | --2.54.0