Skip to contentSkip to conversation

MIPS: Fix crash that occurs when function tracing is enabled

PATCH In review Al Cooper 2 participants 2 messages Nov 15, 2012 MIPS

lore
Share & tools
lore

Al Cooper

author
#0 lore raw

PATCH 1/1 MIPS: Fix crash that occurs when function tracing is enabled

A recent patch changed some irq routines from inlines to functions. These routines are called by the tracer code. Now that they're functions, if they are compiled for function tracing they will call the tracer and crash the system due to infinite recursion. The fix disables tracing in these functions by using "notrace" in the function definition.

---
 arch/mips/lib/mips-atomic.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/lib/mips-atomic.c +4 -4
index e091430..cd160be 100644
@@ -56,7 +56,7 @@ __asm__(
 	"	.set	pop						\n"
 	"	.endm							\n");
 
-void arch_local_irq_disable(void)
+notrace void arch_local_irq_disable(void)
 {
 	preempt_disable();
 	__asm__ __volatile__(
@@ -93,7 +93,7 @@ __asm__(
 	"	.set	pop						\n"
 	"	.endm							\n");
 
-unsigned long arch_local_irq_save(void)
+notrace unsigned long arch_local_irq_save(void)
 {
 	unsigned long flags;
 	preempt_disable();
@@ -135,7 +135,7 @@ __asm__(
 	"	.set	pop						\n"
 	"	.endm							\n");
 
-void arch_local_irq_restore(unsigned long flags)
+notrace void arch_local_irq_restore(unsigned long flags)
 {
 	unsigned long __tmp1;
 
@@ -159,7 +159,7 @@ void arch_local_irq_restore(unsigned long flags)
 EXPORT_SYMBOL(arch_local_irq_restore);
 
 
-void __arch_local_irq_restore(unsigned long flags)
+notrace void __arch_local_irq_restore(unsigned long flags)
 {
 	unsigned long __tmp1;
 
Signature · 1 line
1.7.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Al Cooper

A recent patch changed some irq routines from inlines to functions. These routines are called by the tracer code. Now that they're functions, if they are compiled for function tracing they will call the tracer and crash the system due to infinite recursion. The fix disables tracing in these functions by using "notrace" in the function definition.

Makes sense,

Quoted 9 lines
---
  arch/mips/lib/mips-atomic.c |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/lib/mips-atomic.c +0 -0
index e091430..cd160be 100644

arch/mips/lib/mips-atomic.c __asm__( · line 60

Quoted 6 lines
arch/mips/lib/mips-atomic.c +1 -1
@@ -56,7 +56,7 @@ __asm__(
  	"	.set	pop						\n"
  	"	.endm							\n");
 
-void arch_local_irq_disable(void)
+notrace void arch_local_irq_disable(void)
  {

.
.
.