Skip to contentSkip to conversation

perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7

PATCH Applied Jing Zhang 3 participants 3 messages Sep 25, 2023 – Sep 29, 2023

Subsystems (2)
lore
Share & tools
lore

Jing Zhang

author
#0 lore raw

PATCH 1/1 perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7

The register por_dt_pmovsr Bits[7:0] indicates overflow from counters 7 to 0. But in arm_cmn_handle_irq(), only handled the overflow status of Bits[3:0] which results in unhandled overflow status of counters 4 to 7.

So let the overflow status of DTC counters 4 to 7 to be handled.

Fixes 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
index 913dc04..6b50bc5 100644
@@ -1972,7 +1972,7 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
 		u64 delta;
 		int i;
 
-		for (i = 0; i < CMN_DTM_NUM_COUNTERS; i++) {
+		for (i = 0; i < CMN_DT_NUM_COUNTERS; i++) {
 			if (status & (1U << i)) {
 				ret = IRQ_HANDLED;
 				if (WARN_ON(!dtc->counters[i]))
Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jing Zhang

The register por_dt_pmovsr Bits[7:0] indicates overflow from counters 7 to 0. But in arm_cmn_handle_irq(), only handled the overflow status of Bits[3:0] which results in unhandled overflow status of counters 4 to 7.

So let the overflow status of DTC counters 4 to 7 to be handled.

Oh dear goodness, how has such a stupid typo managed to exist for 4 years? Truly this is a brown paper bag moment... :(

Quoted 19 lines
Fixes 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
---
  drivers/perf/arm-cmn.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
index 913dc04..6b50bc5 100644
@@ -1972,7 +1972,7 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
  		u64 delta;
  		int i;
 
-		for (i = 0; i < CMN_DTM_NUM_COUNTERS; i++) {
+		for (i = 0; i < CMN_DT_NUM_COUNTERS; i++) {
  			if (status & (1U << i)) {
  				ret = IRQ_HANDLED;
  				if (WARN_ON(!dtc->counters[i]))
maintainer Applied
#2 lore raw
In reply to Jing Zhang
Quoted 8 lines · Jing Zhang

The register por_dt_pmovsr Bits[7:0] indicates overflow from counters 7 to 0. But in arm_cmn_handle_irq(), only handled the overflow status of Bits[3:0] which results in unhandled overflow status of counters 4 to 7.

So let the overflow status of DTC counters 4 to 7 to be handled.

[...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7

      https://git.kernel.org/arm64/c/7f949f6f54ff

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev