summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
diff options
context:
space:
mode:
authorDavid Nieto <dmartineznie@nvidia.com>2017-03-13 21:45:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-24 00:05:35 -0400
commit2a502bdd5f3c93b87286456ca901ad43b0f14906 (patch)
treeaba5c18b07b393e0306588d9ba4707a6c272ae6b /drivers/gpu/nvgpu/gk20a/sched_gk20a.c
parenta84f601fbaf6b40e14a321eda1e83d93e55cebba (diff)
gpu: nvgpu: pass gk20a struct to gk20a_busy
After driver remove, the device structure passed in gk20a_busy can be invalid. To solve this the prototype of the function is modified to pass the gk20a struct instead of the device pointer. bug 200277762 JIRA: EVLR-1023 Change-Id: I08eb74bd3578834d45115098ed9936ebbb436fdf Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1320194 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sched_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/sched_gk20a.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
index 6b372489..3185b211 100644
--- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c
@@ -233,13 +233,13 @@ static int gk20a_sched_dev_ioctl_tsg_set_timeslice(
233 if (!kref_get_unless_zero(&tsg->refcount)) 233 if (!kref_get_unless_zero(&tsg->refcount))
234 return -ENXIO; 234 return -ENXIO;
235 235
236 err = gk20a_busy(g->dev); 236 err = gk20a_busy(g);
237 if (err) 237 if (err)
238 goto done; 238 goto done;
239 239
240 err = gk20a_tsg_set_timeslice(tsg, arg->timeslice); 240 err = gk20a_tsg_set_timeslice(tsg, arg->timeslice);
241 241
242 gk20a_idle(g->dev); 242 gk20a_idle(g);
243 243
244done: 244done:
245 kref_put(&tsg->refcount, gk20a_tsg_release); 245 kref_put(&tsg->refcount, gk20a_tsg_release);
@@ -266,13 +266,13 @@ static int gk20a_sched_dev_ioctl_tsg_set_runlist_interleave(
266 if (!kref_get_unless_zero(&tsg->refcount)) 266 if (!kref_get_unless_zero(&tsg->refcount))
267 return -ENXIO; 267 return -ENXIO;
268 268
269 err = gk20a_busy(g->dev); 269 err = gk20a_busy(g);
270 if (err) 270 if (err)
271 goto done; 271 goto done;
272 272
273 err = gk20a_tsg_set_runlist_interleave(tsg, arg->runlist_interleave); 273 err = gk20a_tsg_set_runlist_interleave(tsg, arg->runlist_interleave);
274 274
275 gk20a_idle(g->dev); 275 gk20a_idle(g);
276 276
277done: 277done:
278 kref_put(&tsg->refcount, gk20a_tsg_release); 278 kref_put(&tsg->refcount, gk20a_tsg_release);
@@ -389,11 +389,11 @@ int gk20a_sched_dev_open(struct inode *inode, struct file *filp)
389 gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "g=%p", g); 389 gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "g=%p", g);
390 390
391 if (!sched->sw_ready) { 391 if (!sched->sw_ready) {
392 err = gk20a_busy(g->dev); 392 err = gk20a_busy(g);
393 if (err) 393 if (err)
394 goto free_ref; 394 goto free_ref;
395 395
396 gk20a_idle(g->dev); 396 gk20a_idle(g);
397 } 397 }
398 398
399 if (!nvgpu_mutex_tryacquire(&sched->busy_lock)) { 399 if (!nvgpu_mutex_tryacquire(&sched->busy_lock)) {
@@ -538,7 +538,7 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused)
538 int i; 538 int i;
539 int err; 539 int err;
540 540
541 err = gk20a_busy(g->dev); 541 err = gk20a_busy(g);
542 if (err) 542 if (err)
543 return err; 543 return err;
544 544
@@ -563,7 +563,7 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused)
563 563
564 nvgpu_mutex_release(&sched->status_lock); 564 nvgpu_mutex_release(&sched->status_lock);
565 565
566 gk20a_idle(g->dev); 566 gk20a_idle(g);
567 567
568 return 0; 568 return 0;
569} 569}
@@ -597,13 +597,13 @@ void gk20a_sched_ctrl_tsg_added(struct gk20a *g, struct tsg_gk20a *tsg)
597 gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "tsgid=%u", tsg->tsgid); 597 gk20a_dbg(gpu_dbg_fn | gpu_dbg_sched, "tsgid=%u", tsg->tsgid);
598 598
599 if (!sched->sw_ready) { 599 if (!sched->sw_ready) {
600 err = gk20a_busy(g->dev); 600 err = gk20a_busy(g);
601 if (err) { 601 if (err) {
602 WARN_ON(err); 602 WARN_ON(err);
603 return; 603 return;
604 } 604 }
605 605
606 gk20a_idle(g->dev); 606 gk20a_idle(g);
607 } 607 }
608 608
609 nvgpu_mutex_acquire(&sched->status_lock); 609 nvgpu_mutex_acquire(&sched->status_lock);