gpu: nvgpu: remove submit lock

Remove submit lock since we have moved to use
more fine-grained locks

Remove API check_gp_put() since we cannot call
it in submit path due to latencies and we cannot
call it in gk20a_channel_clean_up_jobs() anymore
since it will fail there without the lock

Bug 200187553

Change-Id: I05b9fa95c9009000e13232d8fa567336eeee11c6
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1120411
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Deepak Nibade
2016-04-05 18:49:24 +05:30
committed by Terje Bergstrom
parent e0c9da1fe9
commit c8d17e9167
2 changed files with 0 additions and 37 deletions

View File

@@ -1471,24 +1471,6 @@ clean_up:
return err;
}
static inline bool check_gp_put(struct gk20a *g,
struct channel_gk20a *c)
{
u32 put;
/* gp_put changed unexpectedly since last update? */
put = gk20a_bar1_readl(g,
c->userd_gpu_va + 4 * ram_userd_gp_put_w());
if (c->gpfifo.put != put) {
/*TBD: BUG_ON/teardown on this*/
gk20a_err(dev_from_gk20a(g), "gp_put changed unexpectedly "
"since last update, channel put = %u, ram put = %u\n",
c->gpfifo.put, put);
c->gpfifo.put = put;
return false; /* surprise! */
}
return true; /* checked out ok */
}
/* Update with this periodically to determine how the gpfifo is draining. */
static inline u32 update_gp_get(struct gk20a *g,
struct channel_gk20a *c)
@@ -1890,11 +1872,6 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work)
vm = c->vm;
platform = gk20a_get_platform(c->g->dev);
mutex_lock(&c->submit_lock);
/* gp_put check needs to be done inside submit lock */
check_gp_put(c->g, c);
gk20a_channel_cancel_job_clean_up(c, false);
mutex_lock(&c->jobs_lock);
@@ -1948,7 +1925,6 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work)
}
mutex_unlock(&c->jobs_lock);
mutex_unlock(&c->submit_lock);
if (c->update_fn)
schedule_work(&c->update_fn_work);
@@ -2088,15 +2064,12 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
goto clean_up;
}
mutex_lock(&c->submit_lock);
mutex_lock(&c->sync_lock);
if (!c->sync) {
c->sync = gk20a_channel_sync_create(c);
if (!c->sync) {
err = -ENOMEM;
mutex_unlock(&c->sync_lock);
mutex_unlock(&c->submit_lock);
goto clean_up;
}
new_sync_created = true;
@@ -2107,7 +2080,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
if (g->ops.fifo.resetup_ramfc && new_sync_created) {
err = g->ops.fifo.resetup_ramfc(c);
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
}
@@ -2130,7 +2102,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
}
}
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
@@ -2147,7 +2118,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
err = c->sync->incr(c->sync, &incr_cmd,
&post_fence, need_sync_fence);
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
@@ -2206,7 +2176,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
user_gpfifo,
length0 * sizeof(*user_gpfifo));
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
@@ -2214,7 +2183,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
user_gpfifo + length0,
length1 * sizeof(*user_gpfifo));
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
@@ -2227,7 +2195,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
user_gpfifo,
num_entries * sizeof(*user_gpfifo));
if (err) {
mutex_unlock(&c->submit_lock);
goto clean_up;
}
@@ -2272,8 +2239,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
c->userd_gpu_va + 4 * ram_userd_gp_put_w(),
c->gpfifo.put);
mutex_unlock(&c->submit_lock);
trace_gk20a_channel_submitted_gpfifo(dev_name(c->g->dev),
c->hw_chid,
num_entries,
@@ -2309,7 +2274,6 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid)
init_waitqueue_head(&c->ref_count_dec_wq);
mutex_init(&c->ioctl_lock);
mutex_init(&c->jobs_lock);
mutex_init(&c->submit_lock);
mutex_init(&c->last_submit.fence_lock);
mutex_init(&c->timeout.lock);
mutex_init(&c->sync_lock);

View File

@@ -120,7 +120,6 @@ struct channel_gk20a {
struct list_head jobs;
struct mutex jobs_lock;
struct mutex submit_lock;
struct vm_gk20a *vm;