diff options
author | Peng Liu <pengliu@nvidia.com> | 2019-03-13 13:30:54 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-05-10 09:43:12 -0400 |
commit | 27625718c4b2e400650885f8c892860c6c7434fd (patch) | |
tree | f82dfe6e8ce494b5330e39270f829ccd05f0447d /drivers/gpu/nvgpu/os/linux/clk.c | |
parent | af95d14bb08850ed449eebae227faca800747108 (diff) |
Revert "gpu: nvgpu: cache gpu clk rate"
This reverts commit e9a6d179a42e ("gpu: nvgpu: cache gpu clk rate")
- Real clock rate doesn't always equal clock rate requested by caller
- call of clk_set_rate() and update of cached_rate are not atomic
- Real root cause for Bug 2051688 is in bpmp and gboost design
Bug 2538692
Change-Id: I9248e0c69e2271ed2d0070587db59afa6f8160f2
Signed-off-by: Peng Liu <pengliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109708
(cherry picked from commit cc70f89bb4efd106b81c2da5ecd6cbeb69c990d8)
Reviewed-on: https://git-master.nvidia.com/r/2113647
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aaron Tian <atian@nvidia.com>
Tested-by: Aaron Tian <atian@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/clk.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/clk.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/clk.c b/drivers/gpu/nvgpu/os/linux/clk.c index 36c13577..6575a037 100644 --- a/drivers/gpu/nvgpu/os/linux/clk.c +++ b/drivers/gpu/nvgpu/os/linux/clk.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Linux clock support | 2 | * Linux clock support |
3 | * | 3 | * |
4 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -38,13 +38,9 @@ static unsigned long nvgpu_linux_clk_get_rate(struct gk20a *g, u32 api_domain) | |||
38 | switch (api_domain) { | 38 | switch (api_domain) { |
39 | case CTRL_CLK_DOMAIN_GPCCLK: | 39 | case CTRL_CLK_DOMAIN_GPCCLK: |
40 | if (g->clk.tegra_clk) | 40 | if (g->clk.tegra_clk) |
41 | ret = g->clk.cached_rate ? | 41 | ret = clk_get_rate(g->clk.tegra_clk); |
42 | g->clk.cached_rate : | ||
43 | clk_get_rate(g->clk.tegra_clk); | ||
44 | else | 42 | else |
45 | ret = platform->cached_rate ? | 43 | ret = clk_get_rate(platform->clk[0]); |
46 | platform->cached_rate : | ||
47 | clk_get_rate(platform->clk[0]); | ||
48 | break; | 44 | break; |
49 | case CTRL_CLK_DOMAIN_PWRCLK: | 45 | case CTRL_CLK_DOMAIN_PWRCLK: |
50 | ret = clk_get_rate(platform->clk[1]); | 46 | ret = clk_get_rate(platform->clk[1]); |
@@ -66,15 +62,10 @@ static int nvgpu_linux_clk_set_rate(struct gk20a *g, | |||
66 | 62 | ||
67 | switch (api_domain) { | 63 | switch (api_domain) { |
68 | case CTRL_CLK_DOMAIN_GPCCLK: | 64 | case CTRL_CLK_DOMAIN_GPCCLK: |
69 | if (g->clk.tegra_clk) { | 65 | if (g->clk.tegra_clk) |
70 | ret = clk_set_rate(g->clk.tegra_clk, rate); | 66 | ret = clk_set_rate(g->clk.tegra_clk, rate); |
71 | if (!ret) | 67 | else |
72 | g->clk.cached_rate = rate; | ||
73 | } else { | ||
74 | ret = clk_set_rate(platform->clk[0], rate); | 68 | ret = clk_set_rate(platform->clk[0], rate); |
75 | if (!ret) | ||
76 | platform->cached_rate = rate; | ||
77 | } | ||
78 | break; | 69 | break; |
79 | case CTRL_CLK_DOMAIN_PWRCLK: | 70 | case CTRL_CLK_DOMAIN_PWRCLK: |
80 | ret = clk_set_rate(platform->clk[1], rate); | 71 | ret = clk_set_rate(platform->clk[1], rate); |