Revert "Revert "gpu: nvgpu: move check_gp_put() and update_gp_get() to worker""
Deepak Nibade [Mon, 11 Jan 2016 10:20:33 +0000 (15:20 +0530)]
This reverts commit f5eac948ab8a6729c549d98fa6aa8751ed94095f.

Bug 200165480

Change-Id: Ie94c375463d51829d7696f4bf07830f4c8206bdd
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/931023
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Tested-by: Roopa Ranganathan <rranganathan@nvidia.com>

drivers/gpu/nvgpu/gk20a/channel_gk20a.c

index 4f6a40a..fd94667 100644 (file)
@@ -1562,9 +1562,14 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed)
 
        trace_gk20a_channel_update(c->hw_chid);
 
+       update_gp_get(c->g, c);
        wake_up(&c->submit_wq);
 
        mutex_lock(&c->submit_lock);
+
+       /* gp_put check needs to be done inside submit lock */
+       check_gp_put(c->g, c);
+
        mutex_lock(&c->jobs_lock);
        list_for_each_entry_safe(job, n, &c->jobs, list) {
                struct gk20a *g = c->g;
@@ -1703,8 +1708,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
                                          flags,
                                          fence ? fence->id : 0,
                                          fence ? fence->value : 0);
-       check_gp_put(g, c);
-       update_gp_get(g, c);
 
        gk20a_dbg_info("pre-submit put %d, get %d, size %d",
                c->gpfifo.put, c->gpfifo.get, c->gpfifo.entry_num);