summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index ebc25a26..708190f2 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -312,7 +312,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
312 * If User disables rail gating, we take one more 312 * If User disables rail gating, we take one more
313 * extra refcount 313 * extra refcount
314 */ 314 */
315 if (platform->user_railgate_disabled) 315 if (g->user_railgate_disabled)
316 target_ref_cnt = 2; 316 target_ref_cnt = 2;
317 else 317 else
318 target_ref_cnt = 1; 318 target_ref_cnt = 1;
@@ -339,7 +339,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
339 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS, 339 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS,
340 NVGPU_TIMER_CPU_TIMER); 340 NVGPU_TIMER_CPU_TIMER);
341 341
342 if (platform->can_railgate && !force_reset) { 342 if (g->can_railgate && !force_reset) {
343 /* 343 /*
344 * Case 1 : GPU railgate is supported 344 * Case 1 : GPU railgate is supported
345 * 345 *
@@ -349,7 +349,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset)
349 pm_runtime_put_sync(dev); 349 pm_runtime_put_sync(dev);
350 350
351 /* add sufficient delay to allow GPU to rail gate */ 351 /* add sufficient delay to allow GPU to rail gate */
352 nvgpu_msleep(platform->railgate_delay); 352 nvgpu_msleep(g->railgate_delay);
353 353
354 /* check in loop if GPU is railgated or not */ 354 /* check in loop if GPU is railgated or not */
355 do { 355 do {
@@ -757,7 +757,7 @@ static int gk20a_pm_suspend(struct device *dev)
757 struct gk20a *g = get_gk20a(dev); 757 struct gk20a *g = get_gk20a(dev);
758 int ret = 0; 758 int ret = 0;
759 759
760 if (platform->user_railgate_disabled) 760 if (g->user_railgate_disabled)
761 gk20a_idle_nosuspend(dev); 761 gk20a_idle_nosuspend(dev);
762 762
763 if (atomic_read(&dev->power.usage_count) > 1) { 763 if (atomic_read(&dev->power.usage_count) > 1) {
@@ -780,7 +780,7 @@ static int gk20a_pm_suspend(struct device *dev)
780 return 0; 780 return 0;
781 781
782fail: 782fail:
783 if (platform->user_railgate_disabled) 783 if (g->user_railgate_disabled)
784 gk20a_busy_noresume(dev); 784 gk20a_busy_noresume(dev);
785 785
786 return ret; 786 return ret;
@@ -789,10 +789,9 @@ fail:
789static int gk20a_pm_resume(struct device *dev) 789static int gk20a_pm_resume(struct device *dev)
790{ 790{
791 struct gk20a *g = get_gk20a(dev); 791 struct gk20a *g = get_gk20a(dev);
792 struct gk20a_platform *platform = dev_get_drvdata(dev);
793 int ret = 0; 792 int ret = 0;
794 793
795 if (platform->user_railgate_disabled) 794 if (g->user_railgate_disabled)
796 gk20a_busy_noresume(dev); 795 gk20a_busy_noresume(dev);
797 796
798 if (!g->suspended) 797 if (!g->suspended)
@@ -815,19 +814,19 @@ static const struct dev_pm_ops gk20a_pm_ops = {
815 814
816int gk20a_pm_init(struct device *dev) 815int gk20a_pm_init(struct device *dev)
817{ 816{
818 struct gk20a_platform *platform = dev_get_drvdata(dev); 817 struct gk20a *g = get_gk20a(dev);
819 int err = 0; 818 int err = 0;
820 819
821 gk20a_dbg_fn(""); 820 gk20a_dbg_fn("");
822 821
823 /* Initialise pm runtime */ 822 /* Initialise pm runtime */
824 if (platform->railgate_delay) { 823 if (g->railgate_delay) {
825 pm_runtime_set_autosuspend_delay(dev, 824 pm_runtime_set_autosuspend_delay(dev,
826 platform->railgate_delay); 825 g->railgate_delay);
827 pm_runtime_use_autosuspend(dev); 826 pm_runtime_use_autosuspend(dev);
828 } 827 }
829 828
830 if (platform->can_railgate) { 829 if (g->can_railgate) {
831 pm_runtime_enable(dev); 830 pm_runtime_enable(dev);
832 if (!pm_runtime_enabled(dev)) 831 if (!pm_runtime_enabled(dev))
833 gk20a_pm_unrailgate(dev); 832 gk20a_pm_unrailgate(dev);