There's no need to crash the kernel for these cases.
Signed-off-by: Alex Deucher <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 570dc90c187ec..3e00983e30937 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -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");
}
}
--
2.54.0