gpu: nvgpu: don't skip setting same clk in arbiter

In the current setting, clock arbiter skips setting
the clock if its already set previously. The value
set by the arbiter is stored in
"struct nvgpu_clk_arb->actual" whenever the clock is
updated via the arbiter. However, DVFS might also
update the clock and the updates are not synchronized
with the arbiter. Hence, ensure that any clock
requests are always updated i.e. the requested rate is
set even if the previous rate remains the same.

In the devfreq scale() part, scale emc when clk_arb
is active and skip setting of clocks.

Note that this is cherry-pick from dev-main. Previously
merged cherry-pick is not complete.

Bug 3666615
Bug 3852824

Change-Id: I480a816434dcd59d18a287954a536fd7061c707c
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822685
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Debarshi Dutta
2022-06-13 12:18:42 +05:30
committed by mobile promotions
parent 27f3fc61a3
commit 6965343d13
3 changed files with 11 additions and 3 deletions

View File

@@ -100,6 +100,9 @@ static void nvgpu_init_vars(struct gk20a *g)
/* Init the clock req count to 0 */
nvgpu_atomic_set(&g->clk_arb_global_nr, 0);
/* Atomic set doesn't guarantee a barrier */
nvgpu_smp_wmb();
nvgpu_mutex_init(&l->ctrl_privs_lock);
nvgpu_init_list_node(&l->ctrl_privs);