forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/soc/rockchip/rockchip_debug.c
....@@ -59,7 +59,7 @@
5959 #include <linux/irq.h>
6060 #include <linux/delay.h>
6161
62
-#include "../../staging/android/fiq_debugger/fiq_debugger_priv.h"
62
+#include "fiq_debugger/fiq_debugger_priv.h"
6363 #include "rockchip_debug.h"
6464
6565 #define EDPCSR_LO 0x0a0
....@@ -425,7 +425,7 @@
425425 struct irq_desc *desc;
426426
427427 if (i > nr_irqs)
428
- return 0;
428
+ return -1;
429429
430430 /* print header and calculate the width of the first column */
431431 if (i == 0) {
....@@ -433,24 +433,24 @@
433433 j *= 10;
434434
435435 buf += sprintf(buf, "%*s", prec + 8, "");
436
- for_each_online_cpu(j)
436
+ for_each_possible_cpu(j)
437437 buf += sprintf(buf, "CPU%-8d", j);
438438 buf += sprintf(buf, "\n");
439439 }
440440
441441 desc = irq_to_desc(i);
442
- if (!desc)
442
+ if (!desc || (desc->status_use_accessors & IRQ_HIDDEN))
443443 goto outsparse;
444444
445445 if (desc->kstat_irqs)
446
- for_each_online_cpu(j)
446
+ for_each_possible_cpu(j)
447447 any_count |= *per_cpu_ptr(desc->kstat_irqs, j);
448448
449
- if ((!desc->action || (desc->action && desc->action == &chained_action)) && !any_count)
449
+ if ((!desc->action) && !any_count)
450450 goto outsparse;
451451
452452 buf += sprintf(buf, "%*d: ", prec, i);
453
- for_each_online_cpu(j)
453
+ for_each_possible_cpu(j)
454454 buf += sprintf(buf, "%10u ", desc->kstat_irqs ?
455455 *per_cpu_ptr(desc->kstat_irqs, j) : 0);
456456
....@@ -463,7 +463,7 @@
463463 buf += sprintf(buf, " %8s", "None");
464464 }
465465 if (desc->irq_data.domain)
466
- buf += sprintf(buf, " %*d", prec, (int) desc->irq_data.hwirq);
466
+ buf += sprintf(buf, " %*lu", prec, desc->irq_data.hwirq);
467467 else
468468 buf += sprintf(buf, " %*s", prec, "");
469469 #ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
....@@ -480,8 +480,9 @@
480480 }
481481
482482 sprintf(buf, "\n");
483
-outsparse:
484483 return 0;
484
+outsparse:
485
+ return -1;
485486 }
486487
487488 static void rockchip_panic_notify_dump_irqs(void)
....@@ -570,14 +571,15 @@
570571 return -ENODEV;
571572
572573 atomic_notifier_chain_register(&panic_notifier_list,
573
- &rockchip_panic_nb);
574
+ &rockchip_panic_nb);
575
+ if (IS_ENABLED(CONFIG_NO_GKI)) {
576
+ if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
577
+ atomic_notifier_chain_register(&hardlock_notifier_list,
578
+ &rockchip_panic_nb);
574579
575
- if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
576
- atomic_notifier_chain_register(&hardlock_notifier_list,
577
- &rockchip_panic_nb);
578
-
579
- atomic_notifier_chain_register(&rcu_stall_notifier_list,
580
- &rockchip_panic_nb);
580
+ atomic_notifier_chain_register(&rcu_stall_notifier_list,
581
+ &rockchip_panic_nb);
582
+ }
581583
582584 return 0;
583585 }
....@@ -589,13 +591,14 @@
589591
590592 atomic_notifier_chain_unregister(&panic_notifier_list,
591593 &rockchip_panic_nb);
594
+ if (IS_ENABLED(CONFIG_NO_GKI)) {
595
+ if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
596
+ atomic_notifier_chain_unregister(&hardlock_notifier_list,
597
+ &rockchip_panic_nb);
592598
593
- if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
594
- atomic_notifier_chain_unregister(&hardlock_notifier_list,
599
+ atomic_notifier_chain_unregister(&rcu_stall_notifier_list,
595600 &rockchip_panic_nb);
596
-
597
- atomic_notifier_chain_unregister(&rcu_stall_notifier_list,
598
- &rockchip_panic_nb);
601
+ }
599602
600603 while (rockchip_cpu_debug[i])
601604 iounmap(rockchip_cpu_debug[i++]);