mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7
@ 2023-09-25  3:22 Jing Zhang
  2023-09-25  9:34 ` Robin Murphy
  2023-09-29 17:06 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Jing Zhang @ 2023-09-25  3:22 UTC (permalink / raw)
  To: Robin Murphy, Ilkka Koskinen, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, linux-kernel, Shuai Xue, Zhuo Song

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")
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 913dc04..6b50bc5 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -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]))
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7
  2023-09-25  3:22 [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 Jing Zhang
@ 2023-09-25  9:34 ` Robin Murphy
  2023-09-29 17:06 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Robin Murphy @ 2023-09-25  9:34 UTC (permalink / raw)
  To: Jing Zhang, Ilkka Koskinen, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, linux-kernel, Shuai Xue, Zhuo Song

On 2023-09-25 04:22, Jing Zhang wrote:
> 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... :(

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
> Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
> ---
>   drivers/perf/arm-cmn.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index 913dc04..6b50bc5 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -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]))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7
  2023-09-25  3:22 [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 Jing Zhang
  2023-09-25  9:34 ` Robin Murphy
@ 2023-09-29 17:06 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2023-09-29 17:06 UTC (permalink / raw)
  To: Robin Murphy, Mark Rutland, Ilkka Koskinen, Jing Zhang
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel,
	Shuai Xue, linux-arm-kernel, Zhuo Song

On Mon, 25 Sep 2023 11:22:32 +0800, Jing Zhang wrote:
> 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,
-- 
Will

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-29 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25  3:22 [PATCH] perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 Jing Zhang
2023-09-25  9:34 ` Robin Murphy
2023-09-29 17:06 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®