aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2009-07-22 07:56:24 -0400
committerMike Frysinger <vapier@gentoo.org>2009-09-16 21:31:57 -0400
commit01b9f4b0ed3b1111b2080a3c9bcb66df1fdf48b7 (patch)
tree0963b346d63cc7ee44e3e769cc8435d224e17a87 /arch/blackfin/kernel
parent858c5e9abc5c614b2eceb6a361118f31821ac968 (diff)
Blackfin: improve double fault debug handling
Since the hardware only provides reporting for the last exception handled, and the values are valid only when executing the exception handler, we need to save the context for reporting at a later point. While we do this for one exception, it doesn't work properly when handling a second one as the original exception is clobbered by the double fault. So when double fault debugging is enabled, create a dedicated shadow of these values and save/restore out of there. Now the crash report properly displays the first exception as well as the second one. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/asm-offsets.c6
-rw-r--r--arch/blackfin/kernel/traps.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index 8ad4f2c69961..f05d1b99b0ef 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -153,6 +153,12 @@ int main(void)
153 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr)); 153 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr));
154 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx)); 154 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx));
155 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat)); 155 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat));
156#ifdef CONFIG_DEBUG_DOUBLEFAULT
157 DEFINE(PDA_DF_DCPLB, offsetof(struct blackfin_pda, dcplb_doublefault_addr));
158 DEFINE(PDA_DF_ICPLB, offsetof(struct blackfin_pda, icplb_doublefault_addr));
159 DEFINE(PDA_DF_SEQSTAT, offsetof(struct blackfin_pda, seqstat_doublefault));
160 DEFINE(PDA_DF_RETX, offsetof(struct blackfin_pda, retx_doublefault));
161#endif
156#ifdef CONFIG_SMP 162#ifdef CONFIG_SMP
157 /* Inter-core lock (in L2 SRAM) */ 163 /* Inter-core lock (in L2 SRAM) */
158 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot)); 164 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot));
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 644e35e33553..0904430d4137 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -229,12 +229,12 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
229 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 229 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
230 unsigned int cpu = smp_processor_id(); 230 unsigned int cpu = smp_processor_id();
231 char buf[150]; 231 char buf[150];
232 decode_address(buf, cpu_pda[cpu].retx); 232 decode_address(buf, cpu_pda[cpu].retx_doublefault);
233 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", 233 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
234 (unsigned int)cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE, buf); 234 (unsigned int)cpu_pda[cpu].seqstat_doublefault & SEQSTAT_EXCAUSE, buf);
235 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr); 235 decode_address(buf, cpu_pda[cpu].dcplb_doublefault_addr);
236 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf); 236 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf);
237 decode_address(buf, cpu_pda[cpu].icplb_fault_addr); 237 decode_address(buf, cpu_pda[cpu].icplb_doublefault_addr);
238 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf); 238 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf);
239 239
240 decode_address(buf, fp->retx); 240 decode_address(buf, fp->retx);