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_4_3.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 2a36647b975a9..0c1987fd34f7a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -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");
        }
 }
 
-- 
2.54.0

Reply via email to