Skip to content

Commit a4e5af2

Browse files
Mike Tiptonandersson
authored andcommitted
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. Fixes: 04053f4 ("clk: qcom: clk-rpmh: Add IPA clock support") Cc: [email protected] Signed-off-by: Mike Tipton <[email protected]> Reviewed-by: Taniya Das <[email protected]> Signed-off-by: Imran Shaik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent db30c11 commit a4e5af2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/clk/qcom/clk-rpmh.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ static int clk_rpmh_bcm_send_cmd(struct clk_rpmh *c, bool enable)
263263
cmd_state = 0;
264264
}
265265

266+
cmd_state = min(cmd_state, BCM_TCS_CMD_VOTE_MASK);
267+
266268
if (c->last_sent_aggr_state != cmd_state) {
267269
cmd.addr = c->res_addr;
268270
cmd.data = BCM_TCS_CMD(1, enable, 0, cmd_state);

0 commit comments

Comments
 (0)