diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
| commit | 24a77daf3d80bddcece044e6dc3675e427eef3f3 (patch) | |
| tree | 2c5e0b0bea394d6fe62c5d5857c252e83e48ac48 /arch/powerpc/kernel/traps.c | |
| parent | e389f9aec689209724105ae80a6c91fd2e747bc9 (diff) | |
| parent | f900e9777fc9b65140cb9570438597bc8fae56ab (diff) | |
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
[POWERPC] remove kernel module option for booke wdt
[POWERPC] Avoid putting cpu node twice
[POWERPC] Spinlock initializer cleanup
[POWERPC] ppc4xx_sgdma needs dma-mapping.h
[POWERPC] arch/powerpc/sysdev/timer.c build fix
[POWERPC] get_property cleanups
[POWERPC] Remove the unused HTDMSOUND driver
[POWERPC] cell: cbe_cpufreq cleanup and crash fix
[POWERPC] Declare enable_kernel_spe in a header
[POWERPC] Add dt_xlate_addr() to bootwrapper
[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
[POWERPC] Add uartlite boot console driver for the zImage wrapper
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
[POWERPC] Merge common virtex header files
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
[POWERPC] Clean up cpufreq Kconfig dependencies
...
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
| -rw-r--r-- | arch/powerpc/kernel/traps.c | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 17724fb2067f..f7862224fe85 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
| @@ -90,21 +90,11 @@ EXPORT_SYMBOL(unregister_die_notifier); | |||
| 90 | * Trap & Exception support | 90 | * Trap & Exception support |
| 91 | */ | 91 | */ |
| 92 | 92 | ||
| 93 | static DEFINE_SPINLOCK(die_lock); | ||
| 94 | |||
| 95 | int die(const char *str, struct pt_regs *regs, long err) | ||
| 96 | { | ||
| 97 | static int die_counter; | ||
| 98 | |||
| 99 | if (debugger(regs)) | ||
| 100 | return 1; | ||
| 101 | |||
| 102 | console_verbose(); | ||
| 103 | spin_lock_irq(&die_lock); | ||
| 104 | bust_spinlocks(1); | ||
| 105 | #ifdef CONFIG_PMAC_BACKLIGHT | 93 | #ifdef CONFIG_PMAC_BACKLIGHT |
| 94 | static void pmac_backlight_unblank(void) | ||
| 95 | { | ||
| 106 | mutex_lock(&pmac_backlight_mutex); | 96 | mutex_lock(&pmac_backlight_mutex); |
| 107 | if (machine_is(powermac) && pmac_backlight) { | 97 | if (pmac_backlight) { |
| 108 | struct backlight_properties *props; | 98 | struct backlight_properties *props; |
| 109 | 99 | ||
| 110 | props = &pmac_backlight->props; | 100 | props = &pmac_backlight->props; |
| @@ -113,26 +103,67 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
| 113 | backlight_update_status(pmac_backlight); | 103 | backlight_update_status(pmac_backlight); |
| 114 | } | 104 | } |
| 115 | mutex_unlock(&pmac_backlight_mutex); | 105 | mutex_unlock(&pmac_backlight_mutex); |
| 106 | } | ||
| 107 | #else | ||
| 108 | static inline void pmac_backlight_unblank(void) { } | ||
| 116 | #endif | 109 | #endif |
| 117 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); | 110 | |
| 111 | int die(const char *str, struct pt_regs *regs, long err) | ||
| 112 | { | ||
| 113 | static struct { | ||
| 114 | spinlock_t lock; | ||
| 115 | u32 lock_owner; | ||
| 116 | int lock_owner_depth; | ||
| 117 | } die = { | ||
| 118 | .lock = __SPIN_LOCK_UNLOCKED(die.lock), | ||
| 119 | .lock_owner = -1, | ||
| 120 | .lock_owner_depth = 0 | ||
| 121 | }; | ||
| 122 | static int die_counter; | ||
| 123 | unsigned long flags; | ||
| 124 | |||
| 125 | if (debugger(regs)) | ||
| 126 | return 1; | ||
| 127 | |||
| 128 | oops_enter(); | ||
| 129 | |||
| 130 | if (die.lock_owner != raw_smp_processor_id()) { | ||
| 131 | console_verbose(); | ||
| 132 | spin_lock_irqsave(&die.lock, flags); | ||
| 133 | die.lock_owner = smp_processor_id(); | ||
| 134 | die.lock_owner_depth = 0; | ||
| 135 | bust_spinlocks(1); | ||
| 136 | if (machine_is(powermac)) | ||
| 137 | pmac_backlight_unblank(); | ||
| 138 | } else { | ||
| 139 | local_save_flags(flags); | ||
| 140 | } | ||
| 141 | |||
| 142 | if (++die.lock_owner_depth < 3) { | ||
| 143 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); | ||
| 118 | #ifdef CONFIG_PREEMPT | 144 | #ifdef CONFIG_PREEMPT |
| 119 | printk("PREEMPT "); | 145 | printk("PREEMPT "); |
| 120 | #endif | 146 | #endif |
| 121 | #ifdef CONFIG_SMP | 147 | #ifdef CONFIG_SMP |
| 122 | printk("SMP NR_CPUS=%d ", NR_CPUS); | 148 | printk("SMP NR_CPUS=%d ", NR_CPUS); |
| 123 | #endif | 149 | #endif |
| 124 | #ifdef CONFIG_DEBUG_PAGEALLOC | 150 | #ifdef CONFIG_DEBUG_PAGEALLOC |
| 125 | printk("DEBUG_PAGEALLOC "); | 151 | printk("DEBUG_PAGEALLOC "); |
| 126 | #endif | 152 | #endif |
| 127 | #ifdef CONFIG_NUMA | 153 | #ifdef CONFIG_NUMA |
| 128 | printk("NUMA "); | 154 | printk("NUMA "); |
| 129 | #endif | 155 | #endif |
| 130 | printk("%s\n", ppc_md.name ? "" : ppc_md.name); | 156 | printk("%s\n", ppc_md.name ? ppc_md.name : ""); |
| 157 | |||
| 158 | print_modules(); | ||
| 159 | show_regs(regs); | ||
| 160 | } else { | ||
| 161 | printk("Recursive die() failure, output suppressed\n"); | ||
| 162 | } | ||
| 131 | 163 | ||
| 132 | print_modules(); | ||
| 133 | show_regs(regs); | ||
| 134 | bust_spinlocks(0); | 164 | bust_spinlocks(0); |
| 135 | spin_unlock_irq(&die_lock); | 165 | die.lock_owner = -1; |
| 166 | spin_unlock_irqrestore(&die.lock, flags); | ||
| 136 | 167 | ||
| 137 | if (kexec_should_crash(current) || | 168 | if (kexec_should_crash(current) || |
| 138 | kexec_sr_activated(smp_processor_id())) | 169 | kexec_sr_activated(smp_processor_id())) |
| @@ -145,6 +176,7 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
| 145 | if (panic_on_oops) | 176 | if (panic_on_oops) |
| 146 | panic("Fatal exception"); | 177 | panic("Fatal exception"); |
| 147 | 178 | ||
| 179 | oops_exit(); | ||
| 148 | do_exit(err); | 180 | do_exit(err); |
| 149 | 181 | ||
| 150 | return 0; | 182 | return 0; |
