MALI: midgard: ARM: patch for fence timeout in monkey test
authorchenzhen <chenzhen@rock-chips.com>
Fri, 4 Nov 2016 01:29:41 +0000 (09:29 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 7 Nov 2016 03:05:32 +0000 (11:05 +0800)
comes from mali support case [TAC674871].

Change-Id: I5e7c54190e24eea0306a9d64545482c6209a2c0d
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
drivers/gpu/arm/midgard/mali_kbase_js.c

index ac6c3ce333ed7442d121fd1c75ccd3c1a65be615..c591ebbcd861f9e373c601b2dfffec25b84ab437 100644 (file)
@@ -1595,6 +1595,9 @@ static kbasep_js_release_result kbasep_js_runpool_release_ctx_internal(
        if (new_ref_count == 0 &&
                (!kbasep_js_is_submit_allowed(js_devdata, kctx) ||
                                                        kbdev->pm.suspending)) {
+               int num_slots = kbdev->gpu_props.num_job_slots;
+               int slot;
+
                /* Last reference, and we've been told to remove this context
                 * from the Run Pool */
                dev_dbg(kbdev->dev, "JS: RunPool Remove Context %p because as_busy_refcount=%d, jobs=%d, allowed=%d",
@@ -1637,6 +1640,14 @@ static kbasep_js_release_result kbasep_js_runpool_release_ctx_internal(
                 * other thread will be operating in this
                 * code whilst we are
                 */
+
+               /* Recalculate pullable status for all slots */
+               for (slot = 0; slot < num_slots; slot++) {
+                       if (kbase_js_ctx_pullable(kctx, slot, false))
+                               kbase_js_ctx_list_add_pullable_nolock(kbdev,
+                                               kctx, slot);
+               }
+
                spin_unlock_irqrestore(&js_devdata->runpool_irq.lock, flags);
 
                kbase_backend_release_ctx_noirq(kbdev, kctx);