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.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 86abd36b..a7289b66 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -458,10 +458,10 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset)
458 * If User disables rail gating, we take one more 458 * If User disables rail gating, we take one more
459 * extra refcount 459 * extra refcount
460 */ 460 */
461 if (g->user_railgate_disabled) 461 if (g->can_railgate)
462 target_ref_cnt = 2;
463 else
464 target_ref_cnt = 1; 462 target_ref_cnt = 1;
463 else
464 target_ref_cnt = 2;
465 nvgpu_mutex_acquire(&platform->railgate_lock); 465 nvgpu_mutex_acquire(&platform->railgate_lock);
466 466
467 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS, 467 nvgpu_timeout_init(g, &timeout, GK20A_WAIT_FOR_IDLE_MS,
@@ -964,7 +964,7 @@ static int gk20a_pm_suspend(struct device *dev)
964 struct gk20a_platform *platform = dev_get_drvdata(dev); 964 struct gk20a_platform *platform = dev_get_drvdata(dev);
965 struct gk20a *g = get_gk20a(dev); 965 struct gk20a *g = get_gk20a(dev);
966 int ret = 0; 966 int ret = 0;
967 int idle_usage_count = g->user_railgate_disabled ? 1 : 0; 967 int idle_usage_count = 0;
968 968
969 if (!g->power_on) { 969 if (!g->power_on) {
970 if (!pm_runtime_enabled(dev)) 970 if (!pm_runtime_enabled(dev))
@@ -1020,23 +1020,19 @@ static int gk20a_pm_init(struct device *dev)
1020 1020
1021 nvgpu_log_fn(g, " "); 1021 nvgpu_log_fn(g, " ");
1022 1022
1023 /* Initialise pm runtime */ 1023 /*
1024 if (g->railgate_delay) { 1024 * Initialise pm runtime. For railgate disable
1025 * case, set autosuspend delay to negative which
1026 * will suspend runtime pm
1027 */
1028 if (g->railgate_delay && g->can_railgate)
1025 pm_runtime_set_autosuspend_delay(dev, 1029 pm_runtime_set_autosuspend_delay(dev,
1026 g->railgate_delay); 1030 g->railgate_delay);
1027 pm_runtime_use_autosuspend(dev); 1031 else
1028 } 1032 pm_runtime_set_autosuspend_delay(dev, -1);
1029 1033
1030 if (g->can_railgate) { 1034 pm_runtime_use_autosuspend(dev);
1031 pm_runtime_enable(dev); 1035 pm_runtime_enable(dev);
1032 if (!pm_runtime_enabled(dev))
1033 gk20a_pm_unrailgate(dev);
1034 else
1035 gk20a_pm_railgate(dev);
1036 } else {
1037 __pm_runtime_disable(dev, false);
1038 gk20a_pm_unrailgate(dev);
1039 }
1040 1036
1041 return err; 1037 return err;
1042} 1038}