Skip to content

Commit 22b2e2d

Browse files
committed
Merge tag 'riscv-for-linus-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A pair of device tree fixes for the Polarfire SOC - A fix to avoid overflowing the PMU counter array when firmware incorrectly reports the number of supported counters, which manifests on OpenSBI versions prior to 1.1 * tag 'riscv-for-linus-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: perf: RISC-V: fix access beyond allocated array riscv: dts: microchip: use an mpfs specific l2 compatible dt-bindings: riscv: sifive-l2: add a PolarFire SoC compatible
2 parents 2fc1171 + 20e0fba commit 22b2e2d

File tree

3 files changed

+51
-32
lines changed

3 files changed

+51
-32
lines changed

Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ description:
1717
acts as directory-based coherency manager.
1818
All the properties in ePAPR/DeviceTree specification applies for this platform.
1919

20-
allOf:
21-
- $ref: /schemas/cache-controller.yaml#
22-
2320
select:
2421
properties:
2522
compatible:
@@ -33,11 +30,16 @@ select:
3330

3431
properties:
3532
compatible:
36-
items:
37-
- enum:
38-
- sifive,fu540-c000-ccache
39-
- sifive,fu740-c000-ccache
40-
- const: cache
33+
oneOf:
34+
- items:
35+
- enum:
36+
- sifive,fu540-c000-ccache
37+
- sifive,fu740-c000-ccache
38+
- const: cache
39+
- items:
40+
- const: microchip,mpfs-ccache
41+
- const: sifive,fu540-c000-ccache
42+
- const: cache
4143

4244
cache-block-size:
4345
const: 64
@@ -72,29 +74,46 @@ properties:
7274
The reference to the reserved-memory for the L2 Loosely Integrated Memory region.
7375
The reserved memory node should be defined as per the bindings in reserved-memory.txt.
7476
75-
if:
76-
properties:
77-
compatible:
78-
contains:
79-
const: sifive,fu540-c000-ccache
77+
allOf:
78+
- $ref: /schemas/cache-controller.yaml#
8079

81-
then:
82-
properties:
83-
interrupts:
84-
description: |
85-
Must contain entries for DirError, DataError and DataFail signals.
86-
maxItems: 3
87-
cache-sets:
88-
const: 1024
89-
90-
else:
91-
properties:
92-
interrupts:
93-
description: |
94-
Must contain entries for DirError, DataError, DataFail, DirFail signals.
95-
minItems: 4
96-
cache-sets:
97-
const: 2048
80+
- if:
81+
properties:
82+
compatible:
83+
contains:
84+
enum:
85+
- sifive,fu740-c000-ccache
86+
- microchip,mpfs-ccache
87+
88+
then:
89+
properties:
90+
interrupts:
91+
description: |
92+
Must contain entries for DirError, DataError, DataFail, DirFail signals.
93+
minItems: 4
94+
95+
else:
96+
properties:
97+
interrupts:
98+
description: |
99+
Must contain entries for DirError, DataError and DataFail signals.
100+
maxItems: 3
101+
102+
- if:
103+
properties:
104+
compatible:
105+
contains:
106+
const: sifive,fu740-c000-ccache
107+
108+
then:
109+
properties:
110+
cache-sets:
111+
const: 2048
112+
113+
else:
114+
properties:
115+
cache-sets:
116+
const: 1024
98117

99118
additionalProperties: false
100119

arch/riscv/boot/dts/microchip/mpfs.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
ranges;
186186

187187
cctrllr: cache-controller@2010000 {
188-
compatible = "sifive,fu540-c000-ccache", "cache";
188+
compatible = "microchip,mpfs-ccache", "sifive,fu540-c000-ccache", "cache";
189189
reg = <0x0 0x2010000 0x0 0x1000>;
190190
cache-block-size = <64>;
191191
cache-level = <2>;

drivers/perf/riscv_pmu_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int pmu_sbi_get_ctrinfo(int nctr)
473473
if (!pmu_ctr_list)
474474
return -ENOMEM;
475475

476-
for (i = 0; i <= nctr; i++) {
476+
for (i = 0; i < nctr; i++) {
477477
ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_GET_INFO, i, 0, 0, 0, 0, 0);
478478
if (ret.error)
479479
/* The logical counter ids are not expected to be contiguous */

0 commit comments

Comments
 (0)