]> Git Repo - linux.git/commitdiff
drm/lima: fix recovering from PLBU out of memory
authorVasily Khoruzhick <[email protected]>
Sat, 15 Feb 2020 03:50:26 +0000 (19:50 -0800)
committerQiang Yu <[email protected]>
Mon, 17 Feb 2020 02:45:57 +0000 (10:45 +0800)
It looks like on PLBU_OUT_OF_MEM interrupt we need to resume from where we
stopped, i.e. new PLBU heap start is old end. Also update end address
in GP frame to grow heap on 2nd and subsequent out of memory interrupts.

Fixes: 2081e8dcf1ee ("drm/lima: recover task by enlarging heap buffer")
Signed-off-by: Vasily Khoruzhick <[email protected]>
Signed-off-by: Qiang Yu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/lima/lima_gp.c

index 52b210f9a60547283b26923eaad524eb7d91d40c..d8841c870d906ab6dcc8269b23a8f13ddb14ee67 100644 (file)
@@ -231,8 +231,13 @@ static int lima_gp_task_recover(struct lima_sched_pipe *pipe)
        }
 
        gp_write(LIMA_GP_INT_MASK, LIMA_GP_IRQ_MASK_USED);
+       /* Resume from where we stopped, i.e. new start is old end */
+       gp_write(LIMA_GP_PLBU_ALLOC_START_ADDR,
+                f[LIMA_GP_PLBU_ALLOC_END_ADDR >> 2]);
+       f[LIMA_GP_PLBU_ALLOC_END_ADDR >> 2] =
+               f[LIMA_GP_PLBU_ALLOC_START_ADDR >> 2] + task->heap->heap_size;
        gp_write(LIMA_GP_PLBU_ALLOC_END_ADDR,
-                f[LIMA_GP_PLBU_ALLOC_START_ADDR >> 2] + task->heap->heap_size);
+                f[LIMA_GP_PLBU_ALLOC_END_ADDR >> 2]);
        gp_write(LIMA_GP_CMD, LIMA_GP_CMD_UPDATE_PLBU_ALLOC);
        return 0;
 }
This page took 0.056244 seconds and 4 git commands to generate.