summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_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/channel_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/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index bcc05079..eaea5a77 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -726,7 +726,6 @@ int gk20a_channel_release(struct inode *inode, struct file *filp)
726 gk20a_free_channel(ch, true); 726 gk20a_free_channel(ch, true);
727 gk20a_idle(ch->g->dev); 727 gk20a_idle(ch->g->dev);
728 728
729 gk20a_put_client(g);
730 filp->private_data = NULL; 729 filp->private_data = NULL;
731 return 0; 730 return 0;
732} 731}
@@ -788,23 +787,14 @@ static int __gk20a_channel_open(struct gk20a *g, struct file *filp)
788 787
789 trace_gk20a_channel_open(dev_name(&g->dev->dev)); 788 trace_gk20a_channel_open(dev_name(&g->dev->dev));
790 789
791 err = gk20a_get_client(g);
792 if (err) {
793 gk20a_err(dev_from_gk20a(g),
794 "failed to get client ref");
795 return err;
796 }
797
798 err = gk20a_busy(g->dev); 790 err = gk20a_busy(g->dev);
799 if (err) { 791 if (err) {
800 gk20a_put_client(g);
801 gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err); 792 gk20a_err(dev_from_gk20a(g), "failed to power on, %d", err);
802 return err; 793 return err;
803 } 794 }
804 ch = gk20a_open_new_channel(g); 795 ch = gk20a_open_new_channel(g);
805 gk20a_idle(g->dev); 796 gk20a_idle(g->dev);
806 if (!ch) { 797 if (!ch) {
807 gk20a_put_client(g);
808 gk20a_err(dev_from_gk20a(g), 798 gk20a_err(dev_from_gk20a(g),
809 "failed to get f"); 799 "failed to get f");
810 return -ENOMEM; 800 return -ENOMEM;