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 <huibin.hong@rock-chips.com> Change-Id: I63a9788bbcafdc3f6bb3e49668d0f54a6e0efff0
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user