From: Bjorn Andersson Date: Tue, 5 Dec 2023 22:14:00 +0000 (-0800) Subject: interconnect: qcom: icc-rpm: Fix peak rate calculation X-Git-Tag: v6.7-rc7~4^2~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9085b23b668ad5aca62df4f071b306a47152e6b3;p=thirdparty%2Fkernel%2Flinux.git interconnect: qcom: icc-rpm: Fix peak rate calculation Per the commit message of commit 'dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients")', the peak rate should be 100/ib_percent. But, in what looks like a typical typo, the numerator value is discarded in the calculation. Update the implementation to match the described intention. Fixes: dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231205-qcom_icc_calc_rate-typo-v1-1-9d4378dcf53e@quicinc.com Signed-off-by: Georgi Djakov --- diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 628e651c555cb..dbacb2a7af508 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -307,7 +307,7 @@ static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_icc_node if (qn->ib_coeff) { agg_peak_rate = qn->max_peak[ctx] * 100; - agg_peak_rate = div_u64(qn->max_peak[ctx], qn->ib_coeff); + agg_peak_rate = div_u64(agg_peak_rate, qn->ib_coeff); } else { agg_peak_rate = qn->max_peak[ctx]; }