From 8327f4dc04e3ef4060911de3e0321b280ea86ff1 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Wed, 7 Dec 2022 08:11:38 +0000 Subject: [PATCH] soc: rockchip: debug: fix rockchip_show_interrupts issue before: [ 1021.059400] CPU0 CPU1 CPU2 CPU3 [ 1231.452838] CPU0 CPU1 CPU2 CPU3 [ 1231.453400] CPU0 CPU1 CPU2 CPU3 [ 1231.453976] 3: 11749 9904 10346 8975 GICv2 30 Level arch_timer [ 1231.454745] 3: 11749 9904 10346 8975 GICv2 30 Level arch_timer [ 1231.455512] 3: 11749 9904 10346 8975 GICv2 30 Level arch_timer [ 1231.456293] 6: 0 0 0 0 GICv2 203 Level arm-pmu [ 1231.457060] 7: 0 0 0 0 GICv2 204 Level arm-pmu after: [ 1021.059400] CPU0 CPU1 CPU2 CPU3 [ 1231.455512] 3: 11749 9904 10346 8975 GICv2 30 Level arch_timer [ 1231.456293] 6: 0 0 0 0 GICv2 203 Level arm-pmu Signed-off-by: Huibin Hong Change-Id: I63a9788bbcafdc3f6bb3e49668d0f54a6e0efff0 --- drivers/soc/rockchip/rockchip_debug.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/soc/rockchip/rockchip_debug.c b/drivers/soc/rockchip/rockchip_debug.c index f6777deee0ae..97002bcb7c95 100644 --- a/drivers/soc/rockchip/rockchip_debug.c +++ b/drivers/soc/rockchip/rockchip_debug.c @@ -425,7 +425,7 @@ static int rockchip_show_interrupts(char *p, int irq) struct irq_desc *desc; if (i > nr_irqs) - return 0; + return -EINVAL; /* print header and calculate the width of the first column */ if (i == 0) { @@ -433,24 +433,24 @@ static int rockchip_show_interrupts(char *p, int irq) j *= 10; buf += sprintf(buf, "%*s", prec + 8, ""); - for_each_online_cpu(j) + for_each_possible_cpu(j) buf += sprintf(buf, "CPU%-8d", j); buf += sprintf(buf, "\n"); } desc = irq_to_desc(i); if (!desc) - goto outsparse; + return -EINVAL; if (desc->kstat_irqs) - for_each_online_cpu(j) + for_each_possible_cpu(j) any_count |= *per_cpu_ptr(desc->kstat_irqs, j); if ((!desc->action || (desc->action && desc->action == &chained_action)) && !any_count) - goto outsparse; + return -EINVAL; buf += sprintf(buf, "%*d: ", prec, i); - for_each_online_cpu(j) + for_each_possible_cpu(j) buf += sprintf(buf, "%10u ", desc->kstat_irqs ? *per_cpu_ptr(desc->kstat_irqs, j) : 0); @@ -480,7 +480,6 @@ static int rockchip_show_interrupts(char *p, int irq) } sprintf(buf, "\n"); -outsparse: return 0; }