diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sched.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/sched.c b/drivers/gpu/nvgpu/common/linux/sched.c index e6211790..a7da020c 100644 --- a/drivers/gpu/nvgpu/common/linux/sched.c +++ b/drivers/gpu/nvgpu/common/linux/sched.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <nvgpu/kmem.h> | 22 | #include <nvgpu/kmem.h> |
23 | #include <nvgpu/log.h> | 23 | #include <nvgpu/log.h> |
24 | #include <nvgpu/bug.h> | 24 | #include <nvgpu/bug.h> |
25 | #include <nvgpu/barrier.h> | ||
25 | 26 | ||
26 | #include "gk20a/gk20a.h" | 27 | #include "gk20a/gk20a.h" |
27 | #include "gk20a/gr_gk20a.h" | 28 | #include "gk20a/gr_gk20a.h" |
@@ -190,6 +191,8 @@ static int gk20a_sched_dev_ioctl_get_params(struct gk20a_sched_ctrl *sched, | |||
190 | if (tsgid >= f->num_channels) | 191 | if (tsgid >= f->num_channels) |
191 | return -EINVAL; | 192 | return -EINVAL; |
192 | 193 | ||
194 | nvgpu_speculation_barrier(); | ||
195 | |||
193 | tsg = &f->tsg[tsgid]; | 196 | tsg = &f->tsg[tsgid]; |
194 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) | 197 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) |
195 | return -ENXIO; | 198 | return -ENXIO; |
@@ -223,6 +226,8 @@ static int gk20a_sched_dev_ioctl_tsg_set_timeslice( | |||
223 | if (tsgid >= f->num_channels) | 226 | if (tsgid >= f->num_channels) |
224 | return -EINVAL; | 227 | return -EINVAL; |
225 | 228 | ||
229 | nvgpu_speculation_barrier(); | ||
230 | |||
226 | tsg = &f->tsg[tsgid]; | 231 | tsg = &f->tsg[tsgid]; |
227 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) | 232 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) |
228 | return -ENXIO; | 233 | return -ENXIO; |
@@ -256,6 +261,8 @@ static int gk20a_sched_dev_ioctl_tsg_set_runlist_interleave( | |||
256 | if (tsgid >= f->num_channels) | 261 | if (tsgid >= f->num_channels) |
257 | return -EINVAL; | 262 | return -EINVAL; |
258 | 263 | ||
264 | nvgpu_speculation_barrier(); | ||
265 | |||
259 | tsg = &f->tsg[tsgid]; | 266 | tsg = &f->tsg[tsgid]; |
260 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) | 267 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) |
261 | return -ENXIO; | 268 | return -ENXIO; |
@@ -316,6 +323,8 @@ static int gk20a_sched_dev_ioctl_get_tsg(struct gk20a_sched_ctrl *sched, | |||
316 | if (tsgid >= f->num_channels) | 323 | if (tsgid >= f->num_channels) |
317 | return -EINVAL; | 324 | return -EINVAL; |
318 | 325 | ||
326 | nvgpu_speculation_barrier(); | ||
327 | |||
319 | tsg = &f->tsg[tsgid]; | 328 | tsg = &f->tsg[tsgid]; |
320 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) | 329 | if (!nvgpu_ref_get_unless_zero(&tsg->refcount)) |
321 | return -ENXIO; | 330 | return -ENXIO; |
@@ -351,6 +360,8 @@ static int gk20a_sched_dev_ioctl_put_tsg(struct gk20a_sched_ctrl *sched, | |||
351 | if (tsgid >= f->num_channels) | 360 | if (tsgid >= f->num_channels) |
352 | return -EINVAL; | 361 | return -EINVAL; |
353 | 362 | ||
363 | nvgpu_speculation_barrier(); | ||
364 | |||
354 | nvgpu_mutex_acquire(&sched->status_lock); | 365 | nvgpu_mutex_acquire(&sched->status_lock); |
355 | if (!NVGPU_SCHED_ISSET(tsgid, sched->ref_tsg_bitmap)) { | 366 | if (!NVGPU_SCHED_ISSET(tsgid, sched->ref_tsg_bitmap)) { |
356 | nvgpu_mutex_release(&sched->status_lock); | 367 | nvgpu_mutex_release(&sched->status_lock); |