drm/msm: gpu: Only sync fences on rings that exist
authorJordan Crouse <jcrouse@codeaurora.org>
Wed, 13 Dec 2017 20:45:44 +0000 (13:45 -0700)
committerRob Clark <robdclark@gmail.com>
Wed, 13 Dec 2017 20:52:06 +0000 (15:52 -0500)
The fault recovery code tries to sync fences on all possible rings
instead of only the rings that actually exist which will fault the
kernel when the number of rings are less than the maximum amount.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_gpu.c

index a335ad43c4eb33e7a42605aa8fa2d8b5f1a7b904..6fbc2fc259ce28d77e83ba65e409dd520467009a 100644 (file)
@@ -308,7 +308,7 @@ static void recover_worker(struct work_struct *work)
         * needs to happen after msm_rd_dump_submit() to ensure that the
         * bo's referenced by the offending submit are still around.
         */
-       for (i = 0; i < ARRAY_SIZE(gpu->rb); i++) {
+       for (i = 0; i < gpu->nr_rings; i++) {
                struct msm_ringbuffer *ring = gpu->rb[i];
 
                uint32_t fence = ring->memptrs->fence;