Skip to contentSkip to conversation

ARM: disable interrupt before spinning endlessly

PATCH New Shawn Guo 3 participants 5 messages Jul 9, 2012 – Jul 30, 2012 Arm (32-bit)

lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 ARM: disable interrupt before spinning endlessly

The CPU will endlessly spin at the end of machine_halt and machine_restart calls. However, this will lead to a soft lockup warning after about 20 seconds, if CONFIG_LOCKUP_DETECTOR is enabled, as system timer is still alive.

Disable interrupt before going to spin endlessly, so that the lockup warning will never be seen.

---
 arch/arm/kernel/process.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/kernel/process.c +2 -0
index 19c95ea..693b744 100644
@@ -247,6 +247,7 @@ void machine_shutdown(void)
 void machine_halt(void)
 {
 	machine_shutdown();
+	local_irq_disable();
 	while (1);
 }
 
@@ -268,6 +269,7 @@ void machine_restart(char *cmd)
 
 	/* Whoops - the platform was unable to reboot. Tell the user! */
 	printk("Reboot failed -- System halted\n");
+	local_irq_disable();
 	while (1);
 }
 
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/1 ARM: disable interrupt before spinning endlessly

Russell,

I took this patch as a trivial one and just put it into the patch system as 7466/1, though I have got neither Reviewed-by nor Tested-by with the patch on the list for several days.

Regards,
Shawn

Quoted 38 lines · Shawn Guo

The CPU will endlessly spin at the end of machine_halt and machine_restart calls. However, this will lead to a soft lockup warning after about 20 seconds, if CONFIG_LOCKUP_DETECTOR is enabled, as system timer is still alive.

Disable interrupt before going to spin endlessly, so that the lockup warning will never be seen.

---
 arch/arm/kernel/process.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/kernel/process.c +2 -0
index 19c95ea..693b744 100644
@@ -247,6 +247,7 @@ void machine_shutdown(void)
 void machine_halt(void)
 {
 	machine_shutdown();
+	local_irq_disable();
 	while (1);
 }
 
@@ -268,6 +269,7 @@ void machine_restart(char *cmd)
 
 	/* Whoops - the platform was unable to reboot. Tell the user! */
 	printk("Reboot failed -- System halted\n");
+	local_irq_disable();
 	while (1);
 }
 
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/1 ARM: disable interrupt before spinning endlessly

In reply to Shawn Guo

Dear Shawn Guo,

Quoted 5 lines

The CPU will endlessly spin at the end of machine_halt and machine_restart calls. However, this will lead to a soft lockup warning after about 20 seconds, if CONFIG_LOCKUP_DETECTOR is enabled, as system timer is still alive.

Quoted 8 lines

Disable interrupt before going to spin endlessly, so that the lockup warning will never be seen.

---
 arch/arm/kernel/process.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

I just got back from a conference, I'd gladly test. But my mx28 doesn't boot at all with latest -next. Any idea why?

Best regards,
Marek Vasut

#3 lore raw

PATCH 1/1 ARM: disable interrupt before spinning endlessly

In reply to Shawn Guo
Quoted 11 lines · Shawn Guo

The CPU will endlessly spin at the end of machine_halt and machine_restart calls. However, this will lead to a soft lockup warning after about 20 seconds, if CONFIG_LOCKUP_DETECTOR is enabled, as system timer is still alive.

Disable interrupt before going to spin endlessly, so that the lockup warning will never be seen.

---

Should this also be Cc'd to stable when it's committed?

author
#4 lore raw

PATCH 1/1 ARM: disable interrupt before spinning endlessly

Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines · Shawn Guo

The CPU will endlessly spin at the end of machine_halt and machine_restart calls. However, this will lead to a soft lockup warning after about 20 seconds, if CONFIG_LOCKUP_DETECTOR is enabled, as system timer is still alive.

Quoted 8 lines
Quoted 6 lines

Disable interrupt before going to spin endlessly, so that the lockup warning will never be seen.

---

Should this also be Cc'd to stable when it's committed?

Yes, I forgot it.

I assume you will take care of it when you commit it to your tree. Otherwise, please let me know and I will resubmit the patch.

Signature · 2 lines
Regards,
Shawn