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 -EINVAL;
428
+ return -1;
429429
430430 /* print header and calculate the width of the first column */
431431 if (i == 0) {
....@@ -439,15 +439,15 @@
439439 }
440440
441441 desc = irq_to_desc(i);
442
- if (!desc)
443
- return -EINVAL;
442
+ if (!desc || (desc->status_use_accessors & IRQ_HIDDEN))
443
+ goto outsparse;
444444
445445 if (desc->kstat_irqs)
446446 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)
450
- return -EINVAL;
449
+ if ((!desc->action) && !any_count)
450
+ goto outsparse;
451451
452452 buf += sprintf(buf, "%*d: ", prec, i);
453453 for_each_possible_cpu(j)
....@@ -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
....@@ -481,6 +481,8 @@
481481
482482 sprintf(buf, "\n");
483483 return 0;
484
+outsparse:
485
+ return -1;
484486 }
485487
486488 static void rockchip_panic_notify_dump_irqs(void)
....@@ -569,14 +571,15 @@
569571 return -ENODEV;
570572
571573 atomic_notifier_chain_register(&panic_notifier_list,
572
- &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);
573579
574
- if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
575
- atomic_notifier_chain_register(&hardlock_notifier_list,
576
- &rockchip_panic_nb);
577
-
578
- atomic_notifier_chain_register(&rcu_stall_notifier_list,
579
- &rockchip_panic_nb);
580
+ atomic_notifier_chain_register(&rcu_stall_notifier_list,
581
+ &rockchip_panic_nb);
582
+ }
580583
581584 return 0;
582585 }
....@@ -588,13 +591,14 @@
588591
589592 atomic_notifier_chain_unregister(&panic_notifier_list,
590593 &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);
591598
592
- if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR))
593
- atomic_notifier_chain_unregister(&hardlock_notifier_list,
599
+ atomic_notifier_chain_unregister(&rcu_stall_notifier_list,
594600 &rockchip_panic_nb);
595
-
596
- atomic_notifier_chain_unregister(&rcu_stall_notifier_list,
597
- &rockchip_panic_nb);
601
+ }
598602
599603 while (rockchip_cpu_debug[i])
600604 iounmap(rockchip_cpu_debug[i++]);