Skip to contentSkip to conversation

ARM: smp: Fix Unknown IPI message 0x1

PATCH New Santosh Shilimkar 4 participants 8 messages Jan 17, 2011 – Jan 21, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Commit 'ad3b6993' converted ARM smp_cross_call() to take IPI number as a parameter to handle more event than SGI and do_IPI was suppose to recover SGI number. But the do_IPI doesn't consider it and it's getting detected as 'Unknown IPI message 0x1' with ipi numbers are moved to starts from 'IPI_TIMER=2"

There can be 16 different SGI but only SGI1 is used as IPI so only that one is handled in do_IPI as IPI_CPU_START.

Added IPI_CPU_START because it wasn't used and thought it's appropriate. Not sure whether its the right one.

---
 arch/arm/include/asm/hardirq.h |    2 +-
 arch/arm/kernel/smp.c          |   11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)
arch/arm/include/asm/hardirq.h +1 -1
index 89ad180..2635c8b 100644
@@ -5,7 +5,7 @@
 #include <linux/threads.h>
 #include <asm/irq.h>
 
-#define NR_IPI	5
+#define NR_IPI	6
 
 typedef struct {
 	unsigned int __softirq_pending;
arch/arm/kernel/smp.c +8 -3
index 4539ebc..f089e35 100644
@@ -48,6 +48,7 @@
 struct secondary_data secondary_data;
 
 enum ipi_msg_type {
+	IPI_CPU_START = 1,
 	IPI_TIMER = 2,
 	IPI_RESCHEDULE,
 	IPI_CALL_FUNC,
@@ -387,7 +388,8 @@ void arch_send_call_function_single_ipi(int cpu)
 }
 
 static const char *ipi_types[NR_IPI] = {
-#define S(x,s)	[x - IPI_TIMER] = s
+#define S(x, s)	[x - IPI_CPU_START] = s
+	S(IPI_CPU_START, "CPU start interrupts"),
 	S(IPI_TIMER, "Timer broadcast interrupts"),
 	S(IPI_RESCHEDULE, "Rescheduling interrupts"),
 	S(IPI_CALL_FUNC, "Function call interrupts"),
@@ -552,10 +554,13 @@ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
 	unsigned int cpu = smp_processor_id();
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
-	if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI)
-		__inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]);
+	if (ipinr >= IPI_CPU_START && ipinr < IPI_TIMER + NR_IPI)
+		__inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_CPU_START]);
 
 	switch (ipinr) {
+	case IPI_CPU_START:
+		/* Wake up from WFI/WFE using SGI */
+		break;
 	case IPI_TIMER:
 		ipi_timer();
 		break;
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 11 lines · Santosh Shilimkar

Commit 'ad3b6993' converted ARM smp_cross_call() to take IPI number as a parameter to handle more event than SGI and do_IPI was suppose to recover SGI number. But the do_IPI doesn't consider it and it's getting detected as 'Unknown IPI message 0x1' with ipi numbers are moved to starts from 'IPI_TIMER=2"

There can be 16 different SGI but only SGI1 is used as IPI so only that one is handled in do_IPI as IPI_CPU_START.

Added IPI_CPU_START because it wasn't used and thought it's appropriate. Not sure whether its the right one.

Background:
- we start at 2 because we don't know whether platforms have hard-wired SGI1 for startup.
- we don't trap SGI1 at all because we don't use it.
- there's nothing stopping platforms using another SGI to wakeup - we don't want to be adding more of this code.

I'd much rather see platforms deciding whether they need to use SGI1 or whether they can switch to SGI0 instead - and we make SGI0 be the "ignored wakeup" SGI. If everyone can do that, we get rid of the silly offset entirely.

#2 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 22 lines

-----Original Message-----
From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
Sent: Monday, January 17, 2011 5:31 PM
To: Santosh Shilimkar
Cc: linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] ARM: smp: Fix Unknown IPI message 0x1

Quoted 1 line · Santosh Shilimkar

Commit 'ad3b6993' converted ARM smp_cross_call() to take IPI

number

Quoted 1 line

as a parameter to handle more event than SGI and do_IPI was

suppose

Quoted 9 lines

to recover SGI number. But the do_IPI doesn't consider it and it's getting detected as 'Unknown IPI message 0x1' with ipi numbers are moved to starts from 'IPI_TIMER=2"

There can be 16 different SGI but only SGI1 is used as IPI so only that one is handled in do_IPI as IPI_CPU_START.

Added IPI_CPU_START because it wasn't used and thought it's appropriate. Not sure whether its the right one.

Quoted 9 lines

Background:
- we start at 2 because we don't know whether platforms have hard- wired
SGI1 for startup.
- we don't trap SGI1 at all because we don't use it.
- there's nothing stopping platforms using another SGI to wakeup - we
don't want to be adding more of this code.

OK.

Quoted 4 lines

I'd much rather see platforms deciding whether they need to use SGI1 or whether they can switch to SGI0 instead - and we make SGI0 be the "ignored wakeup" SGI. If everyone can do that, we get rid of the silly offset entirely.

This should be ok. May be Catalin can comment on choice of SGI1 in generic smp_cross_call().

I found below messge in boot which made me to make this patch. 'CPU1: Unknown IPI message 0x1'

Regards,
Santosh

#3 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 2 lines · Santosh Shilimkar

This should be ok. May be Catalin can comment on choice of SGI1 in generic smp_cross_call().

It's something that came from ARMs early SMP work (in 2002 iirc), and was carried forward. What I don't know is whether there was any boot protocol documentation produced which said "you will wait for any SGI" or "you will wait for SGI1".

#4 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Santosh Shilimkar

This should be ok. May be Catalin can comment on choice of SGI1 in generic smp_cross_call().

It's something that came from ARMs early SMP work (in 2002 iirc), and was carried forward. What I don't know is whether there was any boot protocol documentation produced which said "you will wait for any SGI" or "you will wait for SGI1".

At least on the ARM Ltd platforms, the boot monitor waits for any interrupt (it is in WFI). I can't tell about other platforms.

Signature · 1 line
Catalin
#5 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 15 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Monday, January 17, 2011 5:57 PM
To: Russell King - ARM Linux
Cc: Santosh Shilimkar; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] ARM: smp: Fix Unknown IPI message 0x1

Quoted 2 lines · Russell King - ARM Linux
Quoted 1 line · Santosh Shilimkar

This should be ok. May be Catalin can comment on choice of SGI1

in

Quoted 3 lines
Quoted 1 line

generic smp_cross_call().

It's something that came from ARMs early SMP work (in 2002 iirc),

and

Quoted 9 lines
Quoted 1 line

was carried forward. What I don't know is whether there was any

boot

Quoted 1 line

protocol documentation produced which said "you will wait for any

SGI"

Quoted 1 line

or "you will wait for SGI1".

At least on the ARM Ltd platforms, the boot monitor waits for any interrupt (it is in WFI). I can't tell about other platforms.

Same for OMAP4. Any SGI will do.

Regards,
Santosh

#6 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 11 lines · Santosh Shilimkar
Quoted 10 lines

-----Original Message-----
From: Catalin Marinas [mailto:catalin.marinas at arm.com]
Sent: Monday, January 17, 2011 5:57 PM
To: Russell King - ARM Linux
Cc: Santosh Shilimkar; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] ARM: smp: Fix Unknown IPI message 0x1

At least on the ARM Ltd platforms, the boot monitor waits for any interrupt (it is in WFI). I can't tell about other platforms.

Same for OMAP4. Any SGI will do.

Ok, so we can convert OMAP, Realview, Versatile Express to use SGI0... that's a start!

#7 lore raw

PATCH 1/1 ARM: smp: Fix Unknown IPI message 0x1

Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Santosh Shilimkar

Same for OMAP4. Any SGI will do.

Quoted 8 lines

Ok, so we can convert OMAP, Realview, Versatile Express to use SGI0... that's a start!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

SGI0 works fine for msm as well.

Jeff

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.