Hi Bruce,

On 5/14/21 10:38 AM, Bruce Ashfield wrote:
merged to 5.10, but this doesn't apply to linux-yocto-dev (5.12.2).

There is a little context difference. I will send a new patch for linux-yocto-dev soon.

Sorry for any confusion caused.

Thanks,

Quanyang



Bruce

In message: [PATCH][linux-yocto][linux-yocto 
v5.10/standard/sdkv5.4/xlnx-soc][linux-yocto-dev standard/xlnx-soc] arm: fix 
IPI_CPU_BACKTRACE wrong number and handler missing issue
on 12/05/2021 quanyang.wang wrote:

From: Quanyang Wang <[email protected]>

IPI_CPU_BACKTRACE should be 7 not 8 and the handler for IPI_CPU_BACKTRACE
was dropped when I porting SDK patches. Let's add it back to fix the issue
when echo "l" to /proc/sysrq-trigger failed.

Signed-off-by: Quanyang Wang <[email protected]>
---
  arch/arm/kernel/smp.c | 18 ++++++++++++++----
  1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 137e4bf0c7c9..eb759a366a01 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -66,12 +66,11 @@ enum ipi_msg_type {
        IPI_CPU_STOP,
        IPI_IRQ_WORK,
        IPI_COMPLETION,
-       NR_IPI_P = NR_IPI,
        /*
         * CPU_BACKTRACE is special and not included in NR_IPI
         * or tracable with trace_ipi_*
         */
-       IPI_CPU_BACKTRACE = NR_IPI,
+       IPI_CPU_BACKTRACE,
        /*
         * SGI8-15 can be reserved by secure firmware, and thus may
         * not be usable by the kernel. Please keep the above limited
@@ -82,7 +81,7 @@ enum ipi_msg_type {
static int ipi_irq_base __read_mostly;
  static int nr_ipi __read_mostly = NR_IPI;
-static struct irq_desc *ipi_desc[MAX_IPI] __read_mostly;
+static struct irq_desc *ipi_desc[NR_IPI] __read_mostly;
static void ipi_setup(int cpu); @@ -530,6 +529,7 @@ struct ipi { static void ipi_cpu_stop(void);
  static void ipi_complete(void);
+static void ipi_cpu_backtrace(void);
#define IPI_DESC_STRING_IPI_WAKEUP "CPU wakeup interrupts"
  #define IPI_DESC_STRING_IPI_TIMER "Timer broadcast interrupts"
@@ -538,6 +538,7 @@ static void ipi_complete(void);
  #define IPI_DESC_STRING_IPI_CPU_STOP "CPU stop interrupts"
  #define IPI_DESC_STRING_IPI_IRQ_WORK "IRQ work interrupts"
  #define IPI_DESC_STRING_IPI_COMPLETION "completion interrupts"
+#define IPI_DESC_STRING_IPI_CPU_BACKTRACE "CPU backtrace interrupts"
#define IPI_DESC_STR(x) IPI_DESC_STRING_ ## x @@ -550,6 +551,7 @@ static const char* ipi_desc_strings[] __tracepoint_string =
                        [IPI_CPU_STOP] = IPI_DESC_STR(IPI_CPU_STOP),
                        [IPI_IRQ_WORK] = IPI_DESC_STR(IPI_IRQ_WORK),
                        [IPI_COMPLETION] = IPI_DESC_STR(IPI_COMPLETION),
+                       [IPI_CPU_BACKTRACE] = IPI_DESC_STR(IPI_CPU_BACKTRACE),
                };
@@ -571,6 +573,7 @@ static struct ipi ipi_types[NR_IPI] = {
        S(IPI_IRQ_WORK, irq_work_run),
  #endif
        S(IPI_COMPLETION, ipi_complete),
+       S(IPI_CPU_BACKTRACE, ipi_cpu_backtrace),
  };
@@ -669,6 +672,13 @@ static void ipi_complete(void)
        complete(per_cpu(cpu_completion, cpu));
  }
+static void ipi_cpu_backtrace(void)
+{
+       printk_nmi_enter();
+       nmi_cpu_backtrace(get_irq_regs());
+       printk_nmi_exit();
+}
+
  /*
   * Main handler for inter-processor interrupts
   */
@@ -758,7 +768,7 @@ void __init set_smp_ipi_range(int ipi_base, int n)
  {
        int i;
- nr_ipi = min(n, MAX_IPI);
+       nr_ipi = min(n, NR_IPI);
for (i = 0; i < nr_ipi; i++) {
                int err;
--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9872): 
https://lists.yoctoproject.org/g/linux-yocto/message/9872
Mute This Topic: https://lists.yoctoproject.org/mt/82764306/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to