Skip to contentSkip to conversation

powerpc: Add irqtrace support to 32-bit powerpc

RFC/PATCH Dale Farnsworth 3 participants 7 messages Feb 1, 2008 – Apr 4, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

It seems to work on my prpmc2800 board with a ppc7447.

Dale Farnsworth <[email protected]>
---

 arch/powerpc/Kconfig           |    1 -
 arch/powerpc/kernel/entry_32.S |   80 ++++++++++++++++++++++++++++-
 arch/powerpc/kernel/setup_32.c |    2 +
 include/asm-powerpc/hw_irq.h   |   20 ++++----
 include/asm-powerpc/system.h   |    3 +-
 5 files changed, 90 insertions(+), 16 deletions(-)
arch/powerpc/Kconfig +0 -1
index c313e68..933e98b 100644
@@ -52,7 +52,6 @@ config STACKTRACE_SUPPORT
 
 config TRACE_IRQFLAGS_SUPPORT
 	bool
-	depends on PPC64
 	default y
 
 config LOCKDEP_SUPPORT
arch/powerpc/kernel/entry_32.S +77 -3

151 lines not on this page · raw message

arch/powerpc/kernel/setup_32.c +2 -0
index cd870a8..725dd18 100644
@@ -120,6 +120,8 @@ unsigned long __init early_init(unsigned long dt_ptr)
  */
 void __init machine_init(unsigned long dt_ptr, unsigned long phys)
 {
+	lockdep_init();
+
 	/* Enable early debugging if any specified (see udbg.h) */
 	udbg_early_init();
 
include/asm-powerpc/hw_irq.h +10 -10
index ad8c9f7..a5f347a 100644
@@ -63,13 +63,13 @@ extern void iseries_handle_interrupts(void);
 
 #if defined(CONFIG_BOOKE)
 #define SET_MSR_EE(x)	mtmsr(x)
-#define local_irq_restore(flags)	__asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
+#define raw_local_irq_restore(flags)	__asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
 #else
 #define SET_MSR_EE(x)	mtmsr(x)
-#define local_irq_restore(flags)	mtmsr(flags)
+#define raw_local_irq_restore(flags)	mtmsr(flags)
 #endif
 
-static inline void local_irq_disable(void)
+static inline void raw_local_irq_disable(void)
 {
 #ifdef CONFIG_BOOKE
 	__asm__ __volatile__("wrteei 0": : :"memory");
@@ -81,7 +81,7 @@ static inline void local_irq_disable(void)
 #endif
 }
 
-static inline void local_irq_enable(void)
+static inline void raw_local_irq_enable(void)
 {
 #ifdef CONFIG_BOOKE
 	__asm__ __volatile__("wrteei 1": : :"memory");
@@ -93,7 +93,7 @@ static inline void local_irq_enable(void)
 #endif
 }
 
-static inline void local_irq_save_ptr(unsigned long *flags)
+static inline void raw_local_irq_save_ptr(unsigned long *flags)
 {
 	unsigned long msr;
 	msr = mfmsr();
@@ -106,12 +106,12 @@ static inline void local_irq_save_ptr(unsigned long *flags)
 	__asm__ __volatile__("": : :"memory");
 }
 
-#define local_save_flags(flags)	((flags) = mfmsr())
-#define local_irq_save(flags)	local_irq_save_ptr(&flags)
-#define irqs_disabled()		((mfmsr() & MSR_EE) == 0)
+#define raw_local_save_flags(flags)	((flags) = mfmsr())
+#define raw_local_irq_save(flags)	raw_local_irq_save_ptr(&flags)
+#define raw_irqs_disabled()		((mfmsr() & MSR_EE) == 0)
+#define raw_irqs_disabled_flags(flags)	(((flags) & MSR_EE) == 0)
 
-#define hard_irq_enable()	local_irq_enable()
-#define hard_irq_disable()	local_irq_disable()
+#define hard_irq_disable()		raw_local_irq_disable()
 
 #endif /* CONFIG_PPC64 */
 
include/asm-powerpc/system.h +1 -2
index 87be8c3..b8024b9 100644
@@ -5,8 +5,7 @@
 #define _ASM_POWERPC_SYSTEM_H
 
 #include <linux/kernel.h>
-
-#include <asm/hw_irq.h>
+#include <linux/irqflags.h>
 
 /*
  * Memory barrier.
Signature · 1 line
1.5.3.4
#1 lore raw
Quoted 4 lines · Dale Farnsworth

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

Cool. Except that Ben's patch doesn't work for me on my quad G5 and I still haven't had time to figure out why... We should try to get this up for .26 now that we obviously missed .25. Anybody else have a quad G5 to test on?

I can test this patch on my powerbook too.

johannes

#2 lore raw
In reply to Dale Farnsworth
Quoted 6 lines · Dale Farnsworth

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

It seems to work on my prpmc2800 board with a ppc7447.

At first it appears to work on my powerbook (with Ben's latest version of the 64-bit patch), but then it seems to cause random corruption, I've had a crash in the ext3 code and one in console_callback(), both of which I cannot otherwise explain.

johannes

#3 lore raw
Quoted 6 lines · Johannes Berg
Quoted 5 lines · Dale Farnsworth

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

Quoted 6 lines
Quoted 1 line

It seems to work on my prpmc2800 board with a ppc7447.

At first it appears to work on my powerbook (with Ben's latest version of the 64-bit patch), but then it seems to cause random corruption, I've had a crash in the ext3 code and one in console_callback(), both of which I cannot otherwise explain.

FWIW, same kernel without the patch works fine.

johannes

#4 lore raw
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Johannes Berg
Quoted 5 lines · Dale Farnsworth

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

It seems to work on my prpmc2800 board with a ppc7447.

At first it appears to work on my powerbook (with Ben's latest version of the 64-bit patch), but then it seems to cause random corruption, I've had a crash in the ext3 code and one in console_callback(), both of which I cannot otherwise explain.

FWIW, same kernel without the patch works fine.

My apologies, Johannes. I made some unwarranted assumptions about register usage in the lowest-level exception handlers. While it worked on my 7447 board, I saw similar random failures on the 85xx (booke) system I tried.

Thanks for testing this.

I'll follow up with a revised patch.

-Dale

#5 lore raw
Quoted 5 lines

My apologies, Johannes. I made some unwarranted assumptions about register usage in the lowest-level exception handlers. While it worked on my 7447 board, I saw similar random failures on the 85xx (booke) system I tried.

No harm done, just wanted to give it a try and let you know it failed.

Quoted 3 lines

Thanks for testing this.

I'll follow up with a revised patch.

Great, thanks! I'll test that as well then.

johannes

#6 lore raw
In reply to Dale Farnsworth
Quoted 17 lines · Dale Farnsworth
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Johannes Berg
Quoted 5 lines · Dale Farnsworth

This adds the low level irq tracing hooks for 32-bit powerpc. This patch applies on top of Benjamin Herrenschmidt's patch that provides similar support for 64-bit powerpc. See
<http://ozlabs.org/pipermail/linuxppc-dev/2007-October/044361.html>

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

It seems to work on my prpmc2800 board with a ppc7447.

At first it appears to work on my powerbook (with Ben's latest version of the 64-bit patch), but then it seems to cause random corruption, I've had a crash in the ext3 code and one in console_callback(), both of which I cannot otherwise explain.

FWIW, same kernel without the patch works fine.

Quoted 8 lines

My apologies, Johannes. I made some unwarranted assumptions about register usage in the lowest-level exception handlers. While it worked on my 7447 board, I saw similar random failures on the 85xx (booke) system I tried.

Thanks for testing this.

I'll follow up with a revised patch.

BTW. We don't try to trace the EE changes in the hash code. I suppose that's fair enough but probably worth putting a comment on somewhere.

Cheers,
Ben.