Skip to contentSkip to conversation

hotplug: eliminate warning Unknown IPI message 0x1

PATCH New Bill Carson 2 participants 4 messages Feb 10, 2012 – Feb 13, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hotplug: eliminate warning Unknown IPI message 0x1

Hi, All

Does the second parameter of gic_raise_softirq(const struct cpumask *mask, unsigned int irq) have special meaning? because most of the callers have 1 for this, while 0 for mach-highbank. This hard code value also causes hotplug warnings:

/sys/devices/system/cpu # echo 0 > cpu3/online
CPU3: shutdown
/sys/devices/system/cpu # echo 1 > cpu3/online
CPU3: Booted secondary processor
Calibrating delay loop (skipped) already calibrated this CPU
CPU3: Unknown IPI message 0x1

IMHO, it's necessary to introduce a new ipi_msg_type to eliminate this warning. And I did the testing on vexpress board, so far so good.

So any comments?

Bill Carson(1)
hotplug: Introduce a new ipi_msg_type to eliminate phony warning

---
 arch/arm/include/asm/hardirq.h    |    2 +-
 arch/arm/kernel/smp.c             |    5 +++++
 arch/arm/plat-versatile/platsmp.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/1 hotplug: eliminate warning "Unknown IPI message 0x1"

When playing hotplug on vexpress board, a tiny warning pops out.

/sys/devices/system/cpu # echo 0 > cpu3/online
CPU3: shutdown
/sys/devices/system/cpu # echo 1 > cpu3/online
CPU3: Booted secondary processor
Calibrating delay loop (skipped) already calibrated this CPU
CPU3: Unknown IPI message 0x1

      ^^^^^^^

It's a phony warning caused by handle_IPI as a result of calling gic_raise_softirq(cpumask_of(cpu), 1). Introducing a new ipi_msg_type IPI_WAKEUP_CPU to make this warning go away.

with this patch, now hotplug looks like:

/sys/devices/system/cpu # echo 0 > cpu3/online ; echo 1 > cpu3/online \
cat /proc/interrupts
CPU3: shutdown
CPU3: Booted secondary processor
Calibrating delay loop (skipped) already calibrated this CPU CPU3 got wake up!

           CPU0       CPU1       CPU2       CPU3
 29:       5743       5730       5721       5711       GIC  twd
 34:         27          0          0          0       GIC  timer
 36:          0          0          0          0       GIC  rtc-pl031
 37:        262          0          0          0       GIC  uart-pl011
 41:          0          0          0          0       GIC  mmci-pl18x (cmd)
 42:          0          0          0          0       GIC  mmci-pl18x (pio)
 44:          9          0          0          0       GIC  kmi-pl050
 45:        101          0          0          0       GIC  kmi-pl050
 47:          0          0          0          0       GIC  eth0
IPI0:          0          0          0          0  Timer broadcast interrupts
IPI1:        466        463         59         13  Rescheduling interrupts
IPI2:          0          2          2          2  Function call interrupts
IPI3:          0          0          0          6  Single function call interrupts
IPI4:          0          0          0          0  CPU stop interrupts
IPI5:          0          1          1          2  CPU wakeup interrupts
Err:          0
---
 arch/arm/include/asm/hardirq.h    |    2 +-
 arch/arm/kernel/smp.c             |    5 +++++
 arch/arm/plat-versatile/platsmp.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
arch/arm/include/asm/hardirq.h +1 -1
index 436e60b..2740c2a 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 +5 -0
index cdeb727..7418e13 100644
@@ -56,6 +56,7 @@ enum ipi_msg_type {
 	IPI_CALL_FUNC,
 	IPI_CALL_FUNC_SINGLE,
 	IPI_CPU_STOP,
+	IPI_WAKEUP_CPU,
 };
 
 int __cpuinit __cpu_up(unsigned int cpu)
@@ -393,6 +394,7 @@ static const char *ipi_types[NR_IPI] = {
 	S(IPI_CALL_FUNC, "Function call interrupts"),
 	S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"),
 	S(IPI_CPU_STOP, "CPU stop interrupts"),
+	S(IPI_WAKEUP_CPU, "CPU wakeup interrupts"),
 };
 
 void show_ipi_list(struct seq_file *p, int prec)
@@ -558,6 +560,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
 		ipi_cpu_stop(cpu);
 		irq_exit();
 		break;
+	case IPI_WAKEUP_CPU:
+		pr_info("CPU%u got wake up!\n", cpu);
+		break;
 
 	default:
 		printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n",
arch/arm/plat-versatile/platsmp.c +1 -1
index 49c7db4..7188034 100644
@@ -85,7 +85,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	 * the boot monitor to read the system wide flags register,
 	 * and branch to the address found there.
 	 */
-	gic_raise_softirq(cpumask_of(cpu), 1);
+	gic_raise_softirq(cpumask_of(cpu), 7 /* IPI_WAKEUP_CPU */);
 
 	timeout = jiffies + (1 * HZ);
 	while (time_before(jiffies, timeout)) {
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/1 hotplug: eliminate warning "Unknown IPI message 0x1"

Quoted 8 lines · Bill Carson

When playing hotplug on vexpress board, a tiny warning pops out.

/sys/devices/system/cpu # echo 0 > cpu3/online
CPU3: shutdown
/sys/devices/system/cpu # echo 1 > cpu3/online
CPU3: Booted secondary processor
Calibrating delay loop (skipped) already calibrated this CPU
CPU3: Unknown IPI message 0x1

Quoted 4 lines
      ^^^^^^^

It's a phony warning caused by handle_IPI as a result of calling gic_raise_softirq(cpumask_of(cpu), 1). Introducing a new ipi_msg_type IPI_WAKEUP_CPU to make this warning go away.

NAK. I want people to move to SGI0 for this, so that we can have SGI1-N as the proper IPIs. The reason _I_ haven't done this is because it's totally unclear whether anyone relies on the current IPI number.

#3 lore raw

PATCH 1/1 hotplug: eliminate warning "Unknown IPI message 0x1"

Quoted 14 lines · Russell King - ARM Linux
Quoted 8 lines · Bill Carson

When playing hotplug on vexpress board, a tiny warning pops out.

/sys/devices/system/cpu # echo 0> cpu3/online
CPU3: shutdown
/sys/devices/system/cpu # echo 1> cpu3/online
CPU3: Booted secondary processor
Calibrating delay loop (skipped) already calibrated this CPU
CPU3: Unknown IPI message 0x1

Quoted 4 lines
       ^^^^^^^

It's a phony warning caused by handle_IPI as a result of calling gic_raise_softirq(cpumask_of(cpu), 1). Introducing a new ipi_msg_type IPI_WAKEUP_CPU to make this warning go away.

Quoted 4 lines

NAK. I want people to move to SGI0 for this, so that we can have SGI1-N as the proper IPIs. The reason _I_ haven't done this is because it's totally unclear whether anyone relies on the current IPI number.

Thanks for your explanation, now I understand what's going on here.

Signature · 4 lines
I am a slow learner
but I will keep trying to fight for my dreams!

--bill