summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-10-02 08:25:53 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:49 -0400
commita870ff1d294126a3b46db4e0fdc14276035a2840 (patch)
treeb4bb2e094ff77d57636ba887ecd3e14f8fc04689 /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
parent23d15214ae7d1e98b33552cd4cd2346cfea5725f (diff)
gpu: nvgpu: Remove get and put client routines
gk20a_get_client() and gk20a_put_client() routines are effectively dead code. The GPU has been using pm_runtime for reference counting whether the device should be turned on or off, and gk20a_get_client() and gk20a_put_client() have had no positive effect on the behaviour. In worst case these functions trigger some issues as they may trigger code paths that should not be run. There is also a race between get/put and busy/idle. This patch removes the functions and reworks as_gk20a.c to correctly use gk20a_busy()/gk20a_idle() where put/get was required. Additionally, finalize_poweron() is moved to gk20a_busy(), similarly as it was with gk20a_get_client(). If pm_runtime is not in use, the device is only powered on and never off. Currently this affects vgpu power management since it does not use pm_runtime yet. Bug 1562096 Change-Id: I3162655f83457e9caccd9264eed36b5d51e60c52 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/414998 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 6969a3a7..fbc93fc3 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -25,7 +25,6 @@
25 25
26int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp) 26int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
27{ 27{
28 int err;
29 struct gk20a *g; 28 struct gk20a *g;
30 29
31 gk20a_dbg_fn(""); 30 gk20a_dbg_fn("");
@@ -35,22 +34,13 @@ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
35 34
36 filp->private_data = g->dev; 35 filp->private_data = g->dev;
37 36
38 err = gk20a_get_client(g);
39 if (err) {
40 gk20a_dbg_fn("fail to get channel!");
41 return err;
42 }
43
44 return 0; 37 return 0;
45} 38}
46 39
47int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp) 40int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp)
48{ 41{
49 struct platform_device *dev = filp->private_data;
50
51 gk20a_dbg_fn(""); 42 gk20a_dbg_fn("");
52 43
53 gk20a_put_client(get_gk20a(dev));
54 return 0; 44 return 0;
55} 45}
56 46
@@ -177,21 +167,15 @@ static int gk20a_ctrl_alloc_as(
177 } 167 }
178 fd_install(fd, file); 168 fd_install(fd, file);
179 169
180 err = gk20a_get_client(g);
181 if (err)
182 goto clean_up;
183
184 err = gk20a_as_alloc_share(&g->as, args->big_page_size, &as_share); 170 err = gk20a_as_alloc_share(&g->as, args->big_page_size, &as_share);
185 if (err) 171 if (err)
186 goto clean_up_client; 172 goto clean_up;
187 173
188 file->private_data = as_share; 174 file->private_data = as_share;
189 175
190 args->as_fd = fd; 176 args->as_fd = fd;
191 return 0; 177 return 0;
192 178
193clean_up_client:
194 gk20a_put_client(g);
195clean_up: 179clean_up:
196 put_unused_fd(fd); 180 put_unused_fd(fd);
197 return err; 181 return err;