Message ID | 20240809-clk-rpmh-bcm-vote-fix-v2-1-240c584b7ef9@quicinc.com (mailing list archive) |
---|---|
State | Awaiting Upstream, archived |
Headers | show |
Series | [v2] clk: qcom: clk-rpmh: Fix overflow in BCM vote | expand |
On Fri, 09 Aug 2024 10:51:29 +0530, Imran Shaik wrote: > 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. > > Applied, thanks! [1/1] clk: qcom: clk-rpmh: Fix overflow in BCM vote commit: a4e5af27e6f6a8b0d14bc0d7eb04f4a6c7291586 Best regards,
diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index bb82abeed88f..4acde937114a 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -263,6 +263,8 @@ static int clk_rpmh_bcm_send_cmd(struct clk_rpmh *c, bool enable) cmd_state = 0; } + cmd_state = min(cmd_state, BCM_TCS_CMD_VOTE_MASK); + if (c->last_sent_aggr_state != cmd_state) { cmd.addr = c->res_addr; cmd.data = BCM_TCS_CMD(1, enable, 0, cmd_state);