diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 36 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 1 |
2 files changed, 0 insertions, 37 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index b282db89..1b9047c0 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1471,24 +1471,6 @@ clean_up: | |||
1471 | return err; | 1471 | return err; |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | static inline bool check_gp_put(struct gk20a *g, | ||
1475 | struct channel_gk20a *c) | ||
1476 | { | ||
1477 | u32 put; | ||
1478 | /* gp_put changed unexpectedly since last update? */ | ||
1479 | put = gk20a_bar1_readl(g, | ||
1480 | c->userd_gpu_va + 4 * ram_userd_gp_put_w()); | ||
1481 | if (c->gpfifo.put != put) { | ||
1482 | /*TBD: BUG_ON/teardown on this*/ | ||
1483 | gk20a_err(dev_from_gk20a(g), "gp_put changed unexpectedly " | ||
1484 | "since last update, channel put = %u, ram put = %u\n", | ||
1485 | c->gpfifo.put, put); | ||
1486 | c->gpfifo.put = put; | ||
1487 | return false; /* surprise! */ | ||
1488 | } | ||
1489 | return true; /* checked out ok */ | ||
1490 | } | ||
1491 | |||
1492 | /* Update with this periodically to determine how the gpfifo is draining. */ | 1474 | /* Update with this periodically to determine how the gpfifo is draining. */ |
1493 | static inline u32 update_gp_get(struct gk20a *g, | 1475 | static inline u32 update_gp_get(struct gk20a *g, |
1494 | struct channel_gk20a *c) | 1476 | struct channel_gk20a *c) |
@@ -1890,11 +1872,6 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work) | |||
1890 | vm = c->vm; | 1872 | vm = c->vm; |
1891 | platform = gk20a_get_platform(c->g->dev); | 1873 | platform = gk20a_get_platform(c->g->dev); |
1892 | 1874 | ||
1893 | mutex_lock(&c->submit_lock); | ||
1894 | |||
1895 | /* gp_put check needs to be done inside submit lock */ | ||
1896 | check_gp_put(c->g, c); | ||
1897 | |||
1898 | gk20a_channel_cancel_job_clean_up(c, false); | 1875 | gk20a_channel_cancel_job_clean_up(c, false); |
1899 | 1876 | ||
1900 | mutex_lock(&c->jobs_lock); | 1877 | mutex_lock(&c->jobs_lock); |
@@ -1948,7 +1925,6 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work) | |||
1948 | } | 1925 | } |
1949 | 1926 | ||
1950 | mutex_unlock(&c->jobs_lock); | 1927 | mutex_unlock(&c->jobs_lock); |
1951 | mutex_unlock(&c->submit_lock); | ||
1952 | 1928 | ||
1953 | if (c->update_fn) | 1929 | if (c->update_fn) |
1954 | schedule_work(&c->update_fn_work); | 1930 | schedule_work(&c->update_fn_work); |
@@ -2088,15 +2064,12 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2088 | goto clean_up; | 2064 | goto clean_up; |
2089 | } | 2065 | } |
2090 | 2066 | ||
2091 | mutex_lock(&c->submit_lock); | ||
2092 | |||
2093 | mutex_lock(&c->sync_lock); | 2067 | mutex_lock(&c->sync_lock); |
2094 | if (!c->sync) { | 2068 | if (!c->sync) { |
2095 | c->sync = gk20a_channel_sync_create(c); | 2069 | c->sync = gk20a_channel_sync_create(c); |
2096 | if (!c->sync) { | 2070 | if (!c->sync) { |
2097 | err = -ENOMEM; | 2071 | err = -ENOMEM; |
2098 | mutex_unlock(&c->sync_lock); | 2072 | mutex_unlock(&c->sync_lock); |
2099 | mutex_unlock(&c->submit_lock); | ||
2100 | goto clean_up; | 2073 | goto clean_up; |
2101 | } | 2074 | } |
2102 | new_sync_created = true; | 2075 | new_sync_created = true; |
@@ -2107,7 +2080,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2107 | if (g->ops.fifo.resetup_ramfc && new_sync_created) { | 2080 | if (g->ops.fifo.resetup_ramfc && new_sync_created) { |
2108 | err = g->ops.fifo.resetup_ramfc(c); | 2081 | err = g->ops.fifo.resetup_ramfc(c); |
2109 | if (err) { | 2082 | if (err) { |
2110 | mutex_unlock(&c->submit_lock); | ||
2111 | goto clean_up; | 2083 | goto clean_up; |
2112 | } | 2084 | } |
2113 | } | 2085 | } |
@@ -2130,7 +2102,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2130 | } | 2102 | } |
2131 | } | 2103 | } |
2132 | if (err) { | 2104 | if (err) { |
2133 | mutex_unlock(&c->submit_lock); | ||
2134 | goto clean_up; | 2105 | goto clean_up; |
2135 | } | 2106 | } |
2136 | 2107 | ||
@@ -2147,7 +2118,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2147 | err = c->sync->incr(c->sync, &incr_cmd, | 2118 | err = c->sync->incr(c->sync, &incr_cmd, |
2148 | &post_fence, need_sync_fence); | 2119 | &post_fence, need_sync_fence); |
2149 | if (err) { | 2120 | if (err) { |
2150 | mutex_unlock(&c->submit_lock); | ||
2151 | goto clean_up; | 2121 | goto clean_up; |
2152 | } | 2122 | } |
2153 | 2123 | ||
@@ -2206,7 +2176,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2206 | user_gpfifo, | 2176 | user_gpfifo, |
2207 | length0 * sizeof(*user_gpfifo)); | 2177 | length0 * sizeof(*user_gpfifo)); |
2208 | if (err) { | 2178 | if (err) { |
2209 | mutex_unlock(&c->submit_lock); | ||
2210 | goto clean_up; | 2179 | goto clean_up; |
2211 | } | 2180 | } |
2212 | 2181 | ||
@@ -2214,7 +2183,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2214 | user_gpfifo + length0, | 2183 | user_gpfifo + length0, |
2215 | length1 * sizeof(*user_gpfifo)); | 2184 | length1 * sizeof(*user_gpfifo)); |
2216 | if (err) { | 2185 | if (err) { |
2217 | mutex_unlock(&c->submit_lock); | ||
2218 | goto clean_up; | 2186 | goto clean_up; |
2219 | } | 2187 | } |
2220 | 2188 | ||
@@ -2227,7 +2195,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2227 | user_gpfifo, | 2195 | user_gpfifo, |
2228 | num_entries * sizeof(*user_gpfifo)); | 2196 | num_entries * sizeof(*user_gpfifo)); |
2229 | if (err) { | 2197 | if (err) { |
2230 | mutex_unlock(&c->submit_lock); | ||
2231 | goto clean_up; | 2198 | goto clean_up; |
2232 | } | 2199 | } |
2233 | 2200 | ||
@@ -2272,8 +2239,6 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
2272 | c->userd_gpu_va + 4 * ram_userd_gp_put_w(), | 2239 | c->userd_gpu_va + 4 * ram_userd_gp_put_w(), |
2273 | c->gpfifo.put); | 2240 | c->gpfifo.put); |
2274 | 2241 | ||
2275 | mutex_unlock(&c->submit_lock); | ||
2276 | |||
2277 | trace_gk20a_channel_submitted_gpfifo(dev_name(c->g->dev), | 2242 | trace_gk20a_channel_submitted_gpfifo(dev_name(c->g->dev), |
2278 | c->hw_chid, | 2243 | c->hw_chid, |
2279 | num_entries, | 2244 | num_entries, |
@@ -2309,7 +2274,6 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid) | |||
2309 | init_waitqueue_head(&c->ref_count_dec_wq); | 2274 | init_waitqueue_head(&c->ref_count_dec_wq); |
2310 | mutex_init(&c->ioctl_lock); | 2275 | mutex_init(&c->ioctl_lock); |
2311 | mutex_init(&c->jobs_lock); | 2276 | mutex_init(&c->jobs_lock); |
2312 | mutex_init(&c->submit_lock); | ||
2313 | mutex_init(&c->last_submit.fence_lock); | 2277 | mutex_init(&c->last_submit.fence_lock); |
2314 | mutex_init(&c->timeout.lock); | 2278 | mutex_init(&c->timeout.lock); |
2315 | mutex_init(&c->sync_lock); | 2279 | mutex_init(&c->sync_lock); |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 74c920e4..fbf1ad9e 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -120,7 +120,6 @@ struct channel_gk20a { | |||
120 | 120 | ||
121 | struct list_head jobs; | 121 | struct list_head jobs; |
122 | struct mutex jobs_lock; | 122 | struct mutex jobs_lock; |
123 | struct mutex submit_lock; | ||
124 | 123 | ||
125 | struct vm_gk20a *vm; | 124 | struct vm_gk20a *vm; |
126 | 125 | ||