mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
clk: qcom: clk-rpmh: Fix overflow in BCM vote
Valid frequencies may result in BCM votes that exceed the max HW value. Set vote ceiling to BCM_TCS_CMD_VOTE_MASK to ensure the votes aren't truncated, which can result in lower frequencies than desired. Change-Id: I6d64815ee93c5c604ec0bea86eca00aca570bb9e Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
This commit is contained in:
parent
73db1046f1
commit
8941f6ff4b
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
|
|
@ -280,6 +280,9 @@ static int clk_rpmh_bcm_send_cmd(struct clk_rpmh *c, bool enable)
|
|||
cmd_state = c->aggr_state;
|
||||
}
|
||||
|
||||
if (cmd_state > BCM_TCS_CMD_VOTE_MASK)
|
||||
cmd_state = BCM_TCS_CMD_VOTE_MASK;
|
||||
|
||||
if (c->last_sent_aggr_state == cmd_state) {
|
||||
mutex_unlock(&rpmh_clk_lock);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue