From 13a1320cf59023bda187a0bd5ad0cdee95beb9b1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 10:14:53 +0000 Subject: Blackfin: don't give CPU its own line in traps output Signed-off-by: Mike Frysinger --- arch/blackfin/kernel/traps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/blackfin/kernel/traps.c') diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 78cb3d38f899..89835ac58a8a 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c @@ -976,12 +976,12 @@ void dump_bfin_process(struct pt_regs *fp) !((unsigned long)current & 0x3) && current->pid) { verbose_printk(KERN_NOTICE "CURRENT PROCESS:\n"); if (current->comm >= (char *)FIXED_CODE_START) - verbose_printk(KERN_NOTICE "COMM=%s PID=%d\n", + verbose_printk(KERN_NOTICE "COMM=%s PID=%d", current->comm, current->pid); else - verbose_printk(KERN_NOTICE "COMM= invalid\n"); + verbose_printk(KERN_NOTICE "COMM= invalid"); - printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu); + printk(KERN_CONT " CPU=%d\n", current_thread_info()->cpu); if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" -- cgit v1.2.3 From dbc5e6989e2261c965bae5269d26ed1641e1534c Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Thu, 5 Nov 2009 15:44:44 +0000 Subject: Blackfin: don't walk VMAs when oopsing If we're double faulting, then we have to assume the VMAs are not safe as broken pointers here will prevent full trace output for the double fault. Shouldn't be a big problem though as rarely is a double fault caused by code in userspace. Signed-off-by: Robin Getz Signed-off-by: Mike Frysinger --- arch/blackfin/kernel/traps.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/blackfin/kernel/traps.c') diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 89835ac58a8a..427294c47f1b 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c @@ -119,6 +119,15 @@ static void decode_address(char *buf, unsigned long address) return; } + /* + * Don't walk any of the vmas if we are oopsing, it has been known + * to cause problems - corrupt vmas (kernel crashes) cause double faults + */ + if (oops_in_progress) { + strcat(buf, "/* kernel dynamic memory (maybe user-space) */"); + return; + } + /* looks like we're off in user-land, so let's walk all the * mappings of all our processes and see if we can't be a whee * bit more specific -- cgit v1.2.3 From a00b4fe5ce4b98f7c4457fffdb392d7bfece2e78 Mon Sep 17 00:00:00 2001 From: Barry Song Date: Fri, 27 Nov 2009 09:18:21 +0000 Subject: Blackfin: workaround anomaly 05000310 While fetching instructions at the boundary of L1 instruction SRAM, a false External Memory Addressing Error might be triggered. We should ignore this and continue on our way to avoid random crashes. Because hardware errors are not exact in the Blackfin architecture, we need to catch a few more common cases when the code flow changes and the signal is finally delivered. Signed-off-by: Barry Song Signed-off-by: Mike Frysinger --- arch/blackfin/kernel/traps.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'arch/blackfin/kernel/traps.c') diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 427294c47f1b..e4fd516ce482 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c @@ -524,6 +524,36 @@ asmlinkage notrace void trap_c(struct pt_regs *fp) break; /* External Memory Addressing Error */ case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR): + if (ANOMALY_05000310) { + static unsigned long anomaly_rets; + + if ((fp->pc >= (L1_CODE_START + L1_CODE_LENGTH - 512)) && + (fp->pc < (L1_CODE_START + L1_CODE_LENGTH))) { + /* + * A false hardware error will happen while fetching at + * the L1 instruction SRAM boundary. Ignore it. + */ + anomaly_rets = fp->rets; + goto traps_done; + } else if (fp->rets == anomaly_rets) { + /* + * While boundary code returns to a function, at the ret + * point, a new false hardware error might occur too based + * on tests. Ignore it too. + */ + goto traps_done; + } else if ((fp->rets >= (L1_CODE_START + L1_CODE_LENGTH - 512)) && + (fp->rets < (L1_CODE_START + L1_CODE_LENGTH))) { + /* + * If boundary code calls a function, at the entry point, + * a new false hardware error maybe happen based on tests. + * Ignore it too. + */ + goto traps_done; + } else + anomaly_rets = 0; + } + info.si_code = BUS_ADRERR; sig = SIGBUS; strerror = KERN_NOTICE HWC_x3(KERN_NOTICE); -- cgit v1.2.3