The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to stable@vger.kernel.org.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x a4e5af27e6f6a8b0d14bc0d7eb04f4a6c7291586 # <resolve conflicts, build, test, etc.> git commit -s git send-email --to 'stable@vger.kernel.org' --in-reply-to '2024100719-exploring-umbrella-b6ca@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
a4e5af27e6f6 ("clk: qcom: clk-rpmh: Fix overflow in BCM vote") 2cf7a4cbcb4e ("clk: qcom: rpmh: Simplify clk_rpmh_bcm_send_cmd()") dad4e7fda4bd ("clk: qcom: clk-rpmh: Wait for completion when enabling clocks")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a4e5af27e6f6a8b0d14bc0d7eb04f4a6c7291586 Mon Sep 17 00:00:00 2001 From: Mike Tipton quic_mdtipton@quicinc.com Date: Fri, 9 Aug 2024 10:51:29 +0530 Subject: [PATCH] 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: 04053f4d23a4 ("clk: qcom: clk-rpmh: Add IPA clock support") Cc: stable@vger.kernel.org Signed-off-by: Mike Tipton quic_mdtipton@quicinc.com Reviewed-by: Taniya Das quic_tdas@quicinc.com Signed-off-by: Imran Shaik quic_imrashai@quicinc.com Link: https://lore.kernel.org/r/20240809-clk-rpmh-bcm-vote-fix-v2-1-240c584b7ef9@q... Signed-off-by: Bjorn Andersson andersson@kernel.org
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);
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: 04053f4d23a4 ("clk: qcom: clk-rpmh: Add IPA clock support") Cc: stable@vger.kernel.org Signed-off-by: Mike Tipton quic_mdtipton@quicinc.com Reviewed-by: Taniya Das quic_tdas@quicinc.com Signed-off-by: Imran Shaik quic_imrashai@quicinc.com Link: https://lore.kernel.org/r/20240809-clk-rpmh-bcm-vote-fix-v2-1-240c584b7ef9@q... Signed-off-by: Bjorn Andersson andersson@kernel.org (cherry picked from commit a4e5af27e6f6a8b0d14bc0d7eb04f4a6c7291586) Signed-off-by: Mike Tipton quic_mdtipton@quicinc.com --- drivers/clk/qcom/clk-rpmh.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index d7586e26acd8..f83ac6e8d660 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -270,6 +270,8 @@ static int clk_rpmh_bcm_send_cmd(struct clk_rpmh *c, bool enable) cmd_state = c->aggr_state; }
+ cmd_state = min(cmd_state, BCM_TCS_CMD_VOTE_MASK); + if (c->last_sent_aggr_state == cmd_state) { mutex_unlock(&rpmh_clk_lock); return 0;
linux-stable-mirror@lists.linaro.org