@@ -1735,8 +1735,38 @@ int radeon_gpu_reset(struct radeon_device *rdev)
radeon_pm_compute_clocks(rdev);
if (!r) {
- r = radeon_ib_ring_tests(rdev);
- if (r && ring_data[RADEON_RING_TYPE_GFX_INDEX])
+ bool retry = false;
+
+ for (i = 0; i < RADEON_NUM_RINGS; ++i) {
+ struct radeon_ring *ring = &rdev->ring[i];
+
+ if (!ring->ready)
+ continue;
+
+ r = radeon_ib_test(rdev, i, ring);
+ if (!r)
+ continue;
+
+ ring->ready = false;
+ dev_err(rdev->dev, "failed testing IB on ring %d (%d)\n", i, r);
+
+ if (ring_data[i]) {
+ retry = true;
+ continue;
+ } else {
+ radeon_fence_driver_force_completion(rdev, i);
+ rdev->needs_reset = false;
+ r = 0;
+ }
+
+ if (i == RADEON_RING_TYPE_GFX_INDEX) {
+ dev_err(rdev->dev, "disabling acceleration\n");
+ rdev->accel_working = false;
+ break;
+ }
+ }
+
+ if (retry)
r = -EAGAIN;
}