summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-11-09 13:42:56 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-10 13:30:28 -0500
commit6911b4d48c414279731580f1212e29e4b691b04c (patch)
tree5e40ec887a5b4482917931c8bda0f3a2fe447769 /drivers/gpu/nvgpu
parent83bdf33b56b231784987028c9c3c461097a962aa (diff)
gpu: nvgpu: enable/disable tegra fuse clock
GPU hardware block needs tegra fuse clock to mirror gpu fuses from tegra fuses to gpu domain. Tegra fuse driver provided following APIs to enable/disable tegra fuse clock: int tegra_fuse_clock_enable(void); int tegra_fuse_clock_disable(void); To ensure that tegra fuse clock is disabled by nvgpu driver when gpu hardware block is not in use by: Calling tegra_fuse_clock_enable() while doing gk20a_pm_unrailgate() and calling tegra_fuse_clock_disable() while doing gk20a_pm_railgate(). Bug 2019897 Change-Id: I61688829fd9a8b0c1ffa9d34db6393550f333866 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1595297 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-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 =