mbox series

[0/4] Fix up icc clock rate calculation on some platforms

Message ID 20230726-topic-icc_coeff-v1-0-31616960818c@linaro.org
Headers show
Series Fix up icc clock rate calculation on some platforms | expand

Message

Konrad Dybcio July 26, 2023, 4:25 p.m. UTC
Certain platforms require that some buses (or individual nodes) make
some additional changes to the clock rate formula, throwing in some
magic, Qualcomm-defined coefficients, to account for "inefficiencies".

Add the framework for it and utilize it on a couple SoCs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Konrad Dybcio (4):
      interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients
      interconnect: qcom: qcm2290: Set AB coefficients
      interconnect: qcom: sdm660: Set AB/IB coefficients
      interconnect: qcom: msm8996: Set AB/IB coefficients

 drivers/interconnect/qcom/icc-rpm.c | 10 +++++++++-
 drivers/interconnect/qcom/icc-rpm.h |  5 +++++
 drivers/interconnect/qcom/msm8996.c |  8 ++++++--
 drivers/interconnect/qcom/qcm2290.c |  3 +++
 drivers/interconnect/qcom/sdm660.c  |  4 ++++
 5 files changed, 27 insertions(+), 3 deletions(-)
---
base-commit: 1e25dd7772483f477f79986d956028e9f47f990a
change-id: 20230726-topic-icc_coeff-b053d5409b9f

Best regards,

Comments

Konrad Dybcio July 26, 2023, 5:19 p.m. UTC | #1
On 26.07.2023 19:16, Stephan Gerhold wrote:
> On Wed, Jul 26, 2023 at 06:25:43PM +0200, Konrad Dybcio wrote:
>> Presumably due to the hardware being so complex, some nodes (or busses)
>> have different (usually higher) requirements for bandwidth than what
>> the usual calculations would suggest.
>>
> 
> Weird. I just hope this was never abused to workaround other broken
> configuration. A nice round ib_percent = 200 has mostly the same effect as
> 
>   - Doubling the requested peek bandwidth in the consumer driver (perhaps
>     they were too lazy to fix the driver in downstream at some point)
>   - Halving the node buswidth
> 
> It's probably hard to say for sure...
As per usual..

[...]

>>  
>>  	/*
>> @@ -315,6 +317,12 @@ static void qcom_icc_bus_aggregate(struct icc_provider *provider, u64 *agg_clk_r
>>  			else
>>  				agg_avg_rate = qn->sum_avg[i];
>>  
>> +			percent = qp->ab_percent ? qp->ab_percent : 100;
>> +			agg_avg_rate = mult_frac(percent, agg_avg_rate, 100);
> 
> 			if (qp->ab_percent)
> 				agg_avg_rate = mult_frac(qp->ab_percent, agg_avg_rate, 100);
> 
> Would be likely more efficient (no calculation if unspecified) and not
> much harder to read.
Oh right!

> 
>> +
>> +			percent = qn->ib_percent ? qn->ib_percent : 100;
>> +			agg_peak_rate = mult_frac(percent, qn->max_peak[i], 100);
>> +
> 
> agg_peak_rate doesn't seem to be used anywhere else? 🤔
Whoooooops....

Konrad