2022-09-01 13:16:10

by Rajendra Nayak

[permalink] [raw]
Subject: [PATCH 0/4] soc: qcom: icc-bwmon: Add support for llcc and cpu bwmon on sc7280

This patchset adds support for cpu bwmon (bwmon4) and llcc bwmon (bwmon5) found
on sc7280 SoC.

Patchset is based on top of series [1] that adds support for llcc bwmon on sdm845

[1]
https://patchwork.kernel.org/project/linux-arm-msm/list/?series=663695&state=*

Rajendra Nayak (4):
dt-bindings: interconnect: qcom,msm8998-bwmon: Add support for sc7280
BWMONs
soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON
soc: qcom: icc-bwmon: force clear counter/irq registers
arm64: dts: qcom: sc7280: Add cpu and llcc BWMON

.../interconnect/qcom,msm8998-bwmon.yaml | 2 +
arch/arm64/boot/dts/qcom/sc7280.dtsi | 76 +++++++++++++++++++
drivers/soc/qcom/icc-bwmon.c | 21 +++++
3 files changed, 99 insertions(+)

--
2.17.1


2022-09-01 13:16:36

by Rajendra Nayak

[permalink] [raw]
Subject: [PATCH 2/4] soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON

Add support for sc7280 BWMON instance measuring traffic between LLCC and
memory with the v5 register layout.

Signed-off-by: Rajendra Nayak <[email protected]>
---
drivers/soc/qcom/icc-bwmon.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
index 47c2c3e7bb3f..44a10009b45e 100644
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -656,6 +656,18 @@ static const struct icc_bwmon_data sdm845_llcc_bwmon_data = {
.regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
};

+static const struct icc_bwmon_data sc7280_llcc_bwmon_data = {
+ .sample_ms = 4,
+ .count_unit_kb = 64,
+ .default_highbw_kbps = 800 * 1024, /* 800 MBps */
+ .default_medbw_kbps = 256 * 1024, /* 256 MBps */
+ .default_lowbw_kbps = 0,
+ .zone1_thres_count = 16,
+ .zone3_thres_count = 1,
+ .regmap_fields = sdm845_llcc_bwmon_reg_fields,
+ .regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
+};
+
static const struct of_device_id bwmon_of_match[] = {
{
.compatible = "qcom,msm8998-bwmon",
@@ -663,6 +675,9 @@ static const struct of_device_id bwmon_of_match[] = {
}, {
.compatible = "qcom,sdm845-llcc-bwmon",
.data = &sdm845_llcc_bwmon_data
+ }, {
+ .compatible = "qcom,sc7280-llcc-bwmon",
+ .data = &sc7280_llcc_bwmon_data
},
{}
};
--
2.17.1

2022-09-01 15:50:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/4] soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON

On 01/09/2022 15:47, Rajendra Nayak wrote:
> Add support for sc7280 BWMON instance measuring traffic between LLCC and
> memory with the v5 register layout.
>
> Signed-off-by: Rajendra Nayak <[email protected]>
> ---
> drivers/soc/qcom/icc-bwmon.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
> index 47c2c3e7bb3f..44a10009b45e 100644
> --- a/drivers/soc/qcom/icc-bwmon.c
> +++ b/drivers/soc/qcom/icc-bwmon.c
> @@ -656,6 +656,18 @@ static const struct icc_bwmon_data sdm845_llcc_bwmon_data = {
> .regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
> };
>
> +static const struct icc_bwmon_data sc7280_llcc_bwmon_data = {
> + .sample_ms = 4,
> + .count_unit_kb = 64,

This makes me wonder if I put correct count unit for SDM845 LLCC...

Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2022-09-02 04:24:36

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH 2/4] soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON



On 9/1/2022 8:57 PM, Krzysztof Kozlowski wrote:
> On 01/09/2022 15:47, Rajendra Nayak wrote:
>> Add support for sc7280 BWMON instance measuring traffic between LLCC and
>> memory with the v5 register layout.
>>
>> Signed-off-by: Rajendra Nayak <[email protected]>
>> ---
>> drivers/soc/qcom/icc-bwmon.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
>> index 47c2c3e7bb3f..44a10009b45e 100644
>> --- a/drivers/soc/qcom/icc-bwmon.c
>> +++ b/drivers/soc/qcom/icc-bwmon.c
>> @@ -656,6 +656,18 @@ static const struct icc_bwmon_data sdm845_llcc_bwmon_data = {
>> .regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
>> };
>>
>> +static const struct icc_bwmon_data sc7280_llcc_bwmon_data = {
>> + .sample_ms = 4,
>> + .count_unit_kb = 64,
>
> This makes me wonder if I put correct count unit for SDM845 LLCC...

These numbers seem to vary from SoC to SoC, I looked up the sdm845.dtsi from
the CAF kernels [1] and it seems like it should be 4096 instead of 1024?

[1] https://source.codeaurora.org/quic/la/kernel/msm-4.9/tree/arch/arm64/boot/dts/qcom/sdm845.dtsi

>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
>
> Best regards,
> Krzysztof

2022-09-05 13:57:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/4] soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON

On 02/09/2022 06:04, Rajendra Nayak wrote:
>
>
> On 9/1/2022 8:57 PM, Krzysztof Kozlowski wrote:
>> On 01/09/2022 15:47, Rajendra Nayak wrote:
>>> Add support for sc7280 BWMON instance measuring traffic between LLCC and
>>> memory with the v5 register layout.
>>>
>>> Signed-off-by: Rajendra Nayak <[email protected]>
>>> ---
>>> drivers/soc/qcom/icc-bwmon.c | 15 +++++++++++++++
>>> 1 file changed, 15 insertions(+)
>>>
>>> diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
>>> index 47c2c3e7bb3f..44a10009b45e 100644
>>> --- a/drivers/soc/qcom/icc-bwmon.c
>>> +++ b/drivers/soc/qcom/icc-bwmon.c
>>> @@ -656,6 +656,18 @@ static const struct icc_bwmon_data sdm845_llcc_bwmon_data = {
>>> .regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
>>> };
>>>
>>> +static const struct icc_bwmon_data sc7280_llcc_bwmon_data = {
>>> + .sample_ms = 4,
>>> + .count_unit_kb = 64,
>>
>> This makes me wonder if I put correct count unit for SDM845 LLCC...
>
> These numbers seem to vary from SoC to SoC,

Hm, then it is probably ok.

> I looked up the sdm845.dtsi from
> the CAF kernels [1] and it seems like it should be 4096 instead of 1024?

The SDM845 v2 DTSI was saying 64 kB for CPU bwmon and indeed 4 MB for
LLCC. I think I took 1 MB from default value from the msm-4.9 driver and
it matched my measurements. I need to test it again and maybe fix it to
4 MB.

Best regards,
Krzysztof