summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/clk_gp106.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2018-02-07 20:14:22 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-12 15:09:37 -0400
commit6e0de56121a47d383e1505145ab0140dcd604896 (patch)
tree0ad5457fe119fd46481eb1ae4dc6c995b853d014 /drivers/gpu/nvgpu/gp106/clk_gp106.c
parent3df619f68afa6b23a33d7da072315755de38a30b (diff)
gpu: nvgpu: gp106: fix freq scale in debugfs nodes
For better precision dramdiv4 (MCLK/4) counter is used to measure MCLK frequency. But the scaling factor of 2 must be taken into account when reporting dramdiv2_rec_clk1. The issue was not affecting other counters which use scale=1. Bug 200386061 Change-Id: Ib3891f3f2dd4206ac36aa3e3290810144f4aa339 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1654536 (cherry picked from commit 6a68207c90feab1caee737013ab7cd5bb3863fb6) Reviewed-on: https://git-master.nvidia.com/r/1657209 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/clk_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index b8a1ba3d..2ac2ce5a 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP106 Clocks 2 * GP106 Clocks
3 * 3 *
4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -236,7 +236,8 @@ static int gp106_get_rate_show(void *data , u64 *val) {
236 struct namemap_cfg *c = (struct namemap_cfg *) data; 236 struct namemap_cfg *c = (struct namemap_cfg *) data;
237 struct gk20a *g = c->g; 237 struct gk20a *g = c->g;
238 238
239 *val = c->is_counter ? gp106_get_rate_cntr(g, c) : 0 /* TODO PLL read */; 239 *val = c->is_counter ? (u64)c->scale * gp106_get_rate_cntr(g, c) :
240 0 /* TODO PLL read */;
240 return 0; 241 return 0;
241} 242}
242DEFINE_SIMPLE_ATTRIBUTE(get_rate_fops, gp106_get_rate_show, NULL, "%llu\n"); 243DEFINE_SIMPLE_ATTRIBUTE(get_rate_fops, gp106_get_rate_show, NULL, "%llu\n");