2021-08-12 18:46:32

by Bhaskara Budiredla

[permalink] [raw]
Subject: [PATCH v3 0/2] drivers: perf: Add Marvell CN10K LLC-TAD pmu driver

This series introduces performance monitor driver to Last-level-cache
tag-and-data (LLC-TAD) PMU which is an intergral part of Marvell CN10K SoCs.
The configuration and functionality of the TAD PMU is covered in patch 1.
The device tree bindings are dealt in patch 2.

v3:
- rebased on kernel v5.14-rc5
- disable sampling events via PERF_PMU_CAP_NO_INTERRUPT (Will Deacon)
- convert tad pmu bindings to schema (Will Deacon)
- replace tighter semantics with *_relaxed() accesses (Will Deacon)
- use PMU_EVENT_ATTR_ID generic macro (Will Deacon)
- allow cleanup of allocations through devm_kcalloc() (Will Deacon)

v2:
- rebased on kernel v5.13-rc3

Bhaskara Budiredla (2):
drivers: perf: Add LLC-TAD perf counter support
dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD PMU
bindings

.../bindings/perf/marvell-cn10k-tad.yaml | 45 ++
drivers/perf/Kconfig | 7 +
drivers/perf/Makefile | 1 +
drivers/perf/marvell_cn10k_tad_pmu.c | 429 ++++++++++++++++++
4 files changed, 482 insertions(+)
create mode 100644 Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
create mode 100644 drivers/perf/marvell_cn10k_tad_pmu.c

--
2.17.1


2021-08-12 20:22:38

by Bhaskara Budiredla

[permalink] [raw]
Subject: [PATCH 2/2] dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings

Add device tree bindings for Last-level-cache Tag-and-data
(LLC-TAD) unit PMU for Marvell CN10K SoCs.

Signed-off-by: Bhaskara Budiredla <[email protected]>
---
.../bindings/perf/marvell-cn10k-tad.yaml | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml

diff --git a/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml b/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
new file mode 100644
index 000000000000..f66c5c31ecd8
--- /dev/null
+++ b/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/perf/marvell-cn10k-tad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell CN10K LLC-TAD performance monitor
+
+maintainers:
+ - Bhaskara Budiredla <[email protected]>
+
+description: |
+ The Tag-and-Data units (TADs) maintain coherence and contain CN10K
+ shared on-chip last level cache (LLC). The tad pmu measures the
+ performance of last-level cache. Each tad pmu supports up to eight
+ counters.
+
+ The DT setup comprises of number of tad blocks, the sizes of pmu
+ regions, tad blocks and overall base address of the HW.
+
+properties:
+ compatible:
+ const: marvell,cn10k-tad-pmu
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - tad-cnt
+ - tad-page-size
+ - tad-pmu-page-size
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ tad_pmu@0x87e280000000 {
+ compatible = "marvell,cn10k-tad-pmu";
+ tad-cnt = <1>;
+ tad-page-size = <0x1000>;
+ tad-pmu-page-size = <0x1000>;
+ reg = <0x87e2 0x80000000 0x0 0x1000>;
+ };
--
2.17.1

2021-08-13 12:14:36

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/2] dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings

On Thu, 12 Aug 2021 23:12:09 +0530, Bhaskara Budiredla wrote:
> Add device tree bindings for Last-level-cache Tag-and-data
> (LLC-TAD) unit PMU for Marvell CN10K SoCs.
>
> Signed-off-by: Bhaskara Budiredla <[email protected]>
> ---
> .../bindings/perf/marvell-cn10k-tad.yaml | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/perf/marvell-cn10k-tad.example.dts:19.32-25.11: Warning (unit_address_format): /example-0/tad_pmu@0x87e280000000: unit name should not have leading "0x"
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.example.dt.yaml: example-0: tad_pmu@0x87e280000000:reg:0: [34786, 2147483648, 0, 4096] is too long
From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.example.dt.yaml: example-0: 'tad_pmu@0x87e280000000' does not match any of the regexes: '.*-names$', '.*-supply$', '^#.*-cells$', '^#[a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+(,[0-9a-fA-F]+)*$', '^__.*__$', 'pinctrl-[0-9]+'
From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/dt-core.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.example.dt.yaml: tad_pmu@0x87e280000000: 'tad-cnt', 'tad-page-size', 'tad-pmu-page-size' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1516395

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-08-17 09:13:35

by Bhaskara Budiredla

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH 2/2] dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings

Hi Rob,

Thanks for the steps. I seeing minimum version error, though the dtschema is latest.

$ make dt_binding_check
sort: -:2: disorder: 0
ERROR: dtschema minimum version is v2021.2.1
Documentation/devicetree/bindings/Makefile:12: recipe for target 'check_dtschema_version' failed
make[1]: *** [check_dtschema_version] Error 1
Makefile:1418: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2

$ pip3 show dtschema
Name: dtschema
Version: 2021.7
Summary: DeviceTree validation schema and tools
Home-page: https://github.com/devicetree-org/dt-schema
Author: Rob Herring
Author-email: [email protected]
License: BSD

Thanks,
Bhaskara

>-----Original Message-----
>From: Rob Herring <[email protected]>
>Sent: Friday, August 13, 2021 5:41 PM
>To: Bhaskara Budiredla <[email protected]>
>Cc: [email protected]; [email protected];
>[email protected]; Sunil Kovvuri Goutham <[email protected]>;
>[email protected]; [email protected]; linux-
>[email protected]
>Subject: [EXT] Re: [PATCH 2/2] dt-bindings: perf: Add YAML schemas for
>Marvell CN10K LLC-TAD pmu bindings
>
>External Email
>
>----------------------------------------------------------------------
>On Thu, 12 Aug 2021 23:12:09 +0530, Bhaskara Budiredla wrote:
>> Add device tree bindings for Last-level-cache Tag-and-data
>> (LLC-TAD) unit PMU for Marvell CN10K SoCs.
>>
>> Signed-off-by: Bhaskara Budiredla <[email protected]>
>> ---
>> .../bindings/perf/marvell-cn10k-tad.yaml | 45 +++++++++++++++++++
>> 1 file changed, 45 insertions(+)
>> create mode 100644
>> Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
>>
>
>My bot found errors running 'make DT_CHECKER_FLAGS=-m
>dt_binding_check'
>on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
>yamllint warnings/errors:
>
>dtschema/dtc warnings/errors:
>Documentation/devicetree/bindings/perf/marvell-cn10k-
>tad.example.dts:19.32-25.11: Warning (unit_address_format): /example-
>0/tad_pmu@0x87e280000000: unit name should not have leading "0x"
>/builds/robherring/linux-dt-
>review/Documentation/devicetree/bindings/perf/marvell-cn10k-
>tad.example.dt.yaml: example-0: tad_pmu@0x87e280000000:reg:0: [34786,
>2147483648, 0, 4096] is too long
> From schema: /usr/local/lib/python3.8/dist-
>packages/dtschema/schemas/reg.yaml
>/builds/robherring/linux-dt-
>review/Documentation/devicetree/bindings/perf/marvell-cn10k-
>tad.example.dt.yaml: example-0: 'tad_pmu@0x87e280000000' does not
>match any of the regexes: '.*-names$', '.*-supply$', '^#.*-cells$', '^#[a-zA-Z0-
>9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}$', '^[a-zA-Z][a-zA-Z0-9,+\\-
>._]{0,63}@[0-9a-fA-F]+(,[0-9a-fA-F]+)*$', '^__.*__$', 'pinctrl-[0-9]+'
> From schema: /usr/local/lib/python3.8/dist-
>packages/dtschema/schemas/dt-core.yaml
>/builds/robherring/linux-dt-
>review/Documentation/devicetree/bindings/perf/marvell-cn10k-
>tad.example.dt.yaml: tad_pmu@0x87e280000000: 'tad-cnt', 'tad-page-size',
>'tad-pmu-page-size' do not match any of the regexes: 'pinctrl-[0-9]+'
> From schema: /builds/robherring/linux-dt-
>review/Documentation/devicetree/bindings/perf/marvell-cn10k-tad.yaml
>
>doc reference errors (make refcheckdocs):
>
>See https://urldefense.proofpoint.com/v2/url?u=https-
>3A__patchwork.ozlabs.org_patch_1516395&d=DwIBAg&c=nKjWec2b6R0mOy
>Paz7xtfQ&r=9P_lSljSO7KnQNkCGsgu9x_Op4mstSdqWN3Olr4bUv0&m=Kqfvr5E
>wn5St-
>WmEqTDaMI6uM6H5x0uiuOxZTYd15Gc&s=NYt8Ae1pxJhBgLN5asKagq1BUQi_
>gqK_RBkBSmcCvAU&e=
>
>This check can fail if there are any dependencies. The base for a patch series is
>generally the most recent rc1.
>
>If you already ran 'make dt_binding_check' and didn't see the above error(s),
>then make sure 'yamllint' is installed and dt-schema is up to
>date:
>
>pip3 install dtschema --upgrade
>
>Please check and re-submit.

2021-09-07 18:28:05

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [EXT] Re: [PATCH 2/2] dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings

On Tue, Aug 17, 2021 at 4:11 AM Bhaskara Budiredla
<[email protected]> wrote:
>
> Hi Rob,
>
> Thanks for the steps. I seeing minimum version error, though the dtschema is latest.
>
> $ make dt_binding_check
> sort: -:2: disorder: 0
> ERROR: dtschema minimum version is v2021.2.1
> Documentation/devicetree/bindings/Makefile:12: recipe for target 'check_dtschema_version' failed
> make[1]: *** [check_dtschema_version] Error 1
> Makefile:1418: recipe for target 'dt_binding_check' failed
> make: *** [dt_binding_check] Error 2
>
> $ pip3 show dtschema
> Name: dtschema
> Version: 2021.7
> Summary: DeviceTree validation schema and tools
> Home-page: https://github.com/devicetree-org/dt-schema
> Author: Rob Herring
> Author-email: [email protected]
> License: BSD

Check your PATH?

What does 'dt-doc-validate --version' give you?

Rob