diff options
author | Arun Kannan <akannan@nvidia.com> | 2018-03-05 17:32:08 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-23 15:12:52 -0400 |
commit | e9a6d179a42e7bdd6bb4876fb14f4ff7ab0df852 (patch) | |
tree | f2700ecb7c4f04041f9b333e6c8fe888bef7e082 /drivers/gpu/nvgpu/gk20a/clk_gk20a.h | |
parent | 0e3181a5d710a4ef066c81ec9d699dbcb3d9c995 (diff) |
gpu: nvgpu: cache gpu clk rate
Cache the rate used in clk_set_rate().
Return that cached rate on clk_get_rate(), don't read from hardware.
This cached rate is used to avoid duplicate requests to clk_set_rate().
Motivation is to support multiple governors for gpu clk.
Reading clock from hardware is unreliable in multi-governor situation.
Relying on hardware clock value could mislead the kernel gpu governor
in its scaling calculations.
Bug 2051688
Change-Id: I43fc056eea6f69fe0889c45640fcb892b658071c
Signed-off-by: Arun Kannan <akannan@nvidia.com>
(cherry picked from commit 7f819a9ba707e6e905168b00b0f3bf6348e86188)
Reviewed-on: https://git-master.nvidia.com/r/1662759
Reviewed-on: https://git-master.nvidia.com/r/1668919
Reviewed-by: Automatic_Commit_Validation_User
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/gk20a/clk_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/clk_gk20a.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h index ec7022aa..d84e5969 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2011 - 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2011 - 2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -96,6 +96,9 @@ struct clk_gk20a { | |||
96 | #if defined(CONFIG_COMMON_CLK) | 96 | #if defined(CONFIG_COMMON_CLK) |
97 | struct clk *tegra_clk; | 97 | struct clk *tegra_clk; |
98 | struct clk_hw hw; | 98 | struct clk_hw hw; |
99 | |||
100 | /* scaling rate */ | ||
101 | unsigned long cached_rate; | ||
99 | #endif | 102 | #endif |
100 | struct pll gpc_pll; | 103 | struct pll gpc_pll; |
101 | struct pll gpc_pll_last; | 104 | struct pll gpc_pll_last; |