summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/as_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/as_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/as_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
index a3c8c1ec..01c05d00 100644
--- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
@@ -59,11 +59,11 @@ int gk20a_as_alloc_share(struct gk20a_as *as,
59 as_share->id = generate_as_share_id(as_share->as); 59 as_share->id = generate_as_share_id(as_share->as);
60 60
61 /* this will set as_share->vm. */ 61 /* this will set as_share->vm. */
62 err = gk20a_busy(g->dev); 62 err = gk20a_busy(g);
63 if (err) 63 if (err)
64 goto failed; 64 goto failed;
65 err = g->ops.mm.vm_alloc_share(as_share, big_page_size, flags); 65 err = g->ops.mm.vm_alloc_share(as_share, big_page_size, flags);
66 gk20a_idle(g->dev); 66 gk20a_idle(g);
67 67
68 if (err) 68 if (err)
69 goto failed; 69 goto failed;
@@ -87,14 +87,14 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share)
87 87
88 gk20a_dbg_fn(""); 88 gk20a_dbg_fn("");
89 89
90 err = gk20a_busy(g->dev); 90 err = gk20a_busy(g);
91 91
92 if (err) 92 if (err)
93 goto release_fail; 93 goto release_fail;
94 94
95 err = gk20a_vm_release_share(as_share); 95 err = gk20a_vm_release_share(as_share);
96 96
97 gk20a_idle(g->dev); 97 gk20a_idle(g);
98 98
99release_fail: 99release_fail:
100 release_as_share_id(as_share->as, as_share->id); 100 release_as_share_id(as_share->as, as_share->id);
@@ -375,7 +375,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
375 return -EFAULT; 375 return -EFAULT;
376 } 376 }
377 377
378 err = gk20a_busy(g->dev); 378 err = gk20a_busy(g);
379 if (err) 379 if (err)
380 return err; 380 return err;
381 381
@@ -449,7 +449,7 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
449 break; 449 break;
450 } 450 }
451 451
452 gk20a_idle(g->dev); 452 gk20a_idle(g);
453 453
454 if ((err == 0) && (_IOC_DIR(cmd) & _IOC_READ)) 454 if ((err == 0) && (_IOC_DIR(cmd) & _IOC_READ))
455 if (copy_to_user((void __user *)arg, buf, _IOC_SIZE(cmd))) 455 if (copy_to_user((void __user *)arg, buf, _IOC_SIZE(cmd)))