interconnect: qcom: icc-rpm: Fix bandwidth calculations
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Mon, 19 Jun 2023 13:04:47 +0000 (15:04 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sat, 15 Jul 2023 16:54:45 +0000 (09:54 -0700)
commit17fc623e0f728c35b82a0e79cd4f3b8aab495663
tree023dfbd4a351259c0b38b09c69008b0b6db8e158
parent3b7480106bf8ac2666d901e42bf9835959f79e7f
interconnect: qcom: icc-rpm: Fix bandwidth calculations

Up until now, we've been aggregating the bandwidth values and only
dividing them by the bus width of the source node. This was completely
wrong, as different nodes on a given path may (and usually do) have
varying bus widths.  That in turn, resulted in the calculated clock rates
being completely bogus - usually they ended up being much higher, as
NoC_A<->NoC_B links are very wide.

Since we're not using the aggregate bandwidth value for anything other
than clock rate calculations, remodel qcom_icc_bus_aggregate() to
calculate the per-context clock rate for a given provider, taking into
account the bus width of every individual node.

Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver")
Reported-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Georgi Djakov <djakov@kernel.org>
Link: https://lore.kernel.org/r/20230526-topic-smd_icc-v7-22-09c78c175546@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/interconnect/qcom/icc-rpm.c