summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 6b27c9f1..76b9d4db 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -28,6 +28,8 @@
28#include <dt-bindings/soc/gm20b-fuse.h> 28#include <dt-bindings/soc/gm20b-fuse.h>
29#include <dt-bindings/soc/gp10b-fuse.h> 29#include <dt-bindings/soc/gp10b-fuse.h>
30 30
31#include <soc/tegra/fuse.h>
32
31#include <nvgpu/dma.h> 33#include <nvgpu/dma.h>
32#include <nvgpu/kmem.h> 34#include <nvgpu/kmem.h>
33#include <nvgpu/nvgpu_common.h> 35#include <nvgpu/nvgpu_common.h>
@@ -684,9 +686,8 @@ static int gk20a_pm_railgate(struct device *dev)
684{ 686{
685 struct gk20a_platform *platform = dev_get_drvdata(dev); 687 struct gk20a_platform *platform = dev_get_drvdata(dev);
686 int ret = 0; 688 int ret = 0;
687#ifdef CONFIG_DEBUG_FS
688 struct gk20a *g = get_gk20a(dev); 689 struct gk20a *g = get_gk20a(dev);
689 690#ifdef CONFIG_DEBUG_FS
690 g->pstats.last_rail_gate_start = jiffies; 691 g->pstats.last_rail_gate_start = jiffies;
691 692
692 if (g->pstats.railgating_cycle_count >= 1) 693 if (g->pstats.railgating_cycle_count >= 1)
@@ -698,10 +699,17 @@ static int gk20a_pm_railgate(struct device *dev)
698 699
699 if (platform->railgate) 700 if (platform->railgate)
700 ret = platform->railgate(dev); 701 ret = platform->railgate(dev);
702 if (ret) {
703 nvgpu_err(g, "failed to railgate platform, err=%d", ret);
704 return ret;
705 }
701 706
702#ifdef CONFIG_DEBUG_FS 707#ifdef CONFIG_DEBUG_FS
703 g->pstats.last_rail_gate_complete = jiffies; 708 g->pstats.last_rail_gate_complete = jiffies;
704#endif 709#endif
710 ret = tegra_fuse_clock_disable();
711 if (ret)
712 nvgpu_err(g, "failed to disable tegra fuse clock, err=%d", ret);
705 713
706 return ret; 714 return ret;
707} 715}
@@ -710,9 +718,14 @@ static int gk20a_pm_unrailgate(struct device *dev)
710{ 718{
711 struct gk20a_platform *platform = dev_get_drvdata(dev); 719 struct gk20a_platform *platform = dev_get_drvdata(dev);
712 int ret = 0; 720 int ret = 0;
713#ifdef CONFIG_DEBUG_FS
714 struct gk20a *g = get_gk20a(dev); 721 struct gk20a *g = get_gk20a(dev);
715 722
723 ret = tegra_fuse_clock_enable();
724 if (ret) {
725 nvgpu_err(g, "failed to enable tegra fuse clock, err=%d", ret);
726 return ret;
727 }
728#ifdef CONFIG_DEBUG_FS
716 g->pstats.last_rail_ungate_start = jiffies; 729 g->pstats.last_rail_ungate_start = jiffies;
717 if (g->pstats.railgating_cycle_count >= 1) 730 if (g->pstats.railgating_cycle_count >= 1)
718 g->pstats.total_rail_gate_time_ms = 731 g->pstats.total_rail_gate_time_ms =