aboutsummaryrefslogtreecommitdiff
path: root/arch/blackfin/kernel/traps.c
AgeCommit message (Collapse)Author
2010-03-09Blackfin: remove trailing space in messagesFrans Pop
Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-03-09Blackfin: fill out the signal si_addr when sending a SIGBUS/SIGSEGVBarry Song
Some userspace applications use this member in diagnosing crashes. It also makes some LTP tests pass (i.e. the Blackfin arch behaves more like everyone else). Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-03-09Blackfin: fix up mm locking in address dumpingGraf Yang
The locking code in the address dumper needs to grab the mm's mmap_sem so that other CPUs do not get an inconsistent view. On UP systems this really wasn't a problem, but it is easy to trigger a race on SMP systems when another CPU removes a mapping. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-03-09Blackfin: fix decoding of opcodes 41-47 in decode_instruction()Roel Kluin
This condition allowed only decoding of opcode 0x0040 Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-16Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (88 commits) Blackfin: Convert BUG() to use unreachable() Blackfin: define __NR_recvmmsg Blackfin: drop duplicate sched_clock Blackfin: NOMPU: skip DMA ICPLB hole when it is redundant Blackfin: MPU: add missing __init markings Blackfin: add support for TIF_NOTIFY_RESUME Blackfin: kgdb_test: clean up code a bit Blackfin: convert kgdbtest to proc_fops Blackfin: convert cyc2ns() to clocksource_cyc2ns() Blackfin: ip0x: pull in asm/portmux.h for P_xxx defines Blackfin: drop unused ax88180 resources Blackfin: bf537-stamp: add ADF702x network driver resources Blackfin: bf537-stamp: add CAN resources Blackfin: bf537-stamp: add AD5258 i2c address Blackfin: bf537-stamp: add adau1761 i2c address Blackfin: bf537-stamp: add adau1371 i2c address Blackfin: bf537-stamp: add ADP8870 resources Blackfin: bf537-stamp: kill AD714x board-specific Kconfigs Blackfin: bf537-stamp: update ADP5520 resources Blackfin: bf537-stamp: add ADXL346 orientation sensing support ...
2009-12-15Blackfin: workaround anomaly 05000310Barry Song
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 <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15Blackfin: don't walk VMAs when oopsingRobin Getz
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 <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-15Blackfin: don't give CPU its own line in traps outputMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-14genirq: Convert irq_desc.lock to raw_spinlockThomas Gleixner
Convert locks which cannot be sleeping locks in preempt-rt to raw_spinlocks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Ingo Molnar <mingo@elte.hu>
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-10-07Blackfin: mass clean up of copyright/licensing infoRobin Getz
Bill Gatliff & David Brownell pointed out we were missing some copyrights, and licensing terms in some of the files in ./arch/blackfin, so this fixes things, and cleans them up. It also removes: - verbose GPL text(refer to the top level ./COPYING file) - file names (you are looking at the file) - bug url (it's in the ./MAINTAINERS file) - "or later" on GPL-2, when we did not have that right It also allows some Blackfin-specific assembly files to be under a BSD like license (for people to use them outside of Linux). Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: use raw_smp_processor_id() in exception codeYi Li
When preempt debugging is enabled, smp_processor_id() may utilize the "current" structure. This may not be safe to access under all exceptions due to it being in dynamically allocated memory. So in exception code, make sure we use raw_smp_processor_id() instead to get at the real value directly. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: do not trace the exception handlerYi Li
Since the exception handler cannot cause exceptions, we cannot trace it without easily causing double faults and crashing the system. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: improve double fault debug handlingGraf Yang
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>
2009-09-16Blackfin: fix MPU handling of invalid memory accessesGraf Yang
The protect_page() function was incorrectly setting up the hardware tables based on possible access capabilities rather than the actual requested values. This means we would grant more access to mmap-ed pages than we should have. Once we fix this, we need to tweak the signal generated by such accesses to aline ourselves with other ports. This allows the LTP mmap0{5,6,7} cases to run properly. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: do not try displaying the end of the stackSonic Zhang
The end of the stack may not be valid (and that could be OK), so do not attempt to parse it. If we do, we might use a bad pointer in kernel space which makes things panic(). Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: cleanup traps decode_address() a bitMike Frysinger
Unify the address display to shrink the code, and add missing decoding of a few special Blackfin-specific regions (L1 ROM and MMRs). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: export show_stack() to modulesPhilippe Gerum
Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-16Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]Robin Getz
We handle many exceptions at EVT5 (hardware error level) so that we can catch exceptions in our exception handling code. Today - if the global interrupt enable bit (IPEND[4]) is set (interrupts disabled) our trap handling code goes into a infinite loop, since we need interrupts to be on to defer things to EVT5. Normal kernel code should not trigger this for any reason as IPEND[4] gets cleared early (when doing an interrupt context save) and the kernel stack there should be sane (or something much worse is happening in the system). But there have been a few times where this has happened, so this change makes sure we dump a proper crash message even when things have gone south. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: work around anomaly 05000189Robin Getz
Similar to anomaly 05000281 but not as bad, we cannot return to the instruction causing a fault otherwise we'll trigger a second false exception. The system can still recover, but it isn't correct. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: restore exception banner when dumping crash infoMike Frysinger
Previous unification code put the exception banner behind the "is oops" logic when it should have been printed all the time. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-16Blackfin: work around anomaly 05000281Robin Getz
Add missing anomaly workaround for anomaly 05000281 - we can't return to instructions which cause hardware errors otherwise we trigger the error again which means we go into an infinite loop of handling, returning, and retriggering. This work around confuses gdb when the error occurs as the PC will seemed to have moved, so a better long term fix will need to be figured out, but for now this is better than an infinite crash loop. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-08Remove multiple KERN_ prefixes from printk formatsJoe Perches
Commit 5fd29d6ccbc98884569d6f3105aeca70858b3e0f ("printk: clean up handling of log-levels and newlines") changed printk semantics. printk lines with multiple KERN_<level> prefixes are no longer emitted as before the patch. <level> is now included in the output on each additional use. Remove all uses of multiple KERN_<level>s in formats. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-22Blackfin: unify memory region checks between kgdb and trapsMike Frysinger
The kgdb (in multiple places) and traps code developed pretty much identical checks for how to access different regions of the Blackfin memory map, but each wasn't 100%, so unify them to avoid duplication, bitrot, and bugs with edge cases. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13Blackfin: push down exception oops checkingMike Frysinger
Rather than maintain a duplicate list of valid exceptions we can take in the kernel both in the first if() check and the switch() check, delay the oops check to after the switch(). All valid exceptions will have returned by this point leaving only the invalid ones. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13Blackfin: fix trap_c() exit pathsMike Frysinger
The trap_c() code pushes the hardware trace status onto the stack, but doesn't always restore it when returning from some trap code paths. So unify the exit code paths to all head to the end of the function. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-13Blackfin: add support for GENERIC_BUGMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: fix unused warnings after nommu updateMike Frysinger
The massive nommu update (8feae131) left the local variable "vml" unused, so punt it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: export the last exception cause via debugfsRobin Getz
We have some test code that runs in userspace that exercises the exception handling of the Blackfin pretty thoroughly. Part of the validation process is checking the exact exception triggered, so export the last one seen to userspace via debugfs when debugging is enabled for the test code to check. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: include system/processor info in dump messagesRobin Getz
People often copy & paste crash messages without surrounding context, so include common useful information like system/processor stats in the crash summary. This should smooth over the report/test cycle a bit more. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add workaround for anomaly 05000461Robin Getz
Returning too fast with a bad RETI can trigger false errors. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: make sure stack is accessible before dumping itRobin Getz
When displaying a crash dump, make sure accessing the stack is safe so we don't crash at the same time. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: do not append newlines to panic() messagesMike Frysinger
The panic() function already handles newlines for us. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-04Blackfin arch: Add a few more instructions that can cause the trace buffer ↵Robin Getz
to be discontiguous Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add one more check on `fp' to prevent double faultJie Zhang
Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: don't accidently re-enable interruptsRobin Getz
Make sure we don't accidently re-enable interrupts if we are being called in atomic context Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-08NOMMU: Make VMAs per MM as for MMU-mode linuxDavid Howells
Make VMAs per mm_struct as for MMU-mode linux. This solves two problems: (1) In SYSV SHM where nattch for a segment does not reflect the number of shmat's (and forks) done. (2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an exec'ing process when VM_EXECUTABLE is specified, regardless of the fact that a VMA might be shared and already have its vm_mm assigned to another process or a dead process. A new struct (vm_region) is introduced to track a mapped region and to remember the circumstances under which it may be shared and the vm_list_struct structure is discarded as it's no longer required. This patch makes the following additional changes: (1) Regions are now allocated with alloc_pages() rather than kmalloc() and with no recourse to __GFP_COMP, so the pages are not composite. Instead, each page has a reference on it held by the region. Anything else that is interested in such a page will have to get a reference on it to retain it. When the pages are released due to unmapping, each page is passed to put_page() and will be freed when the page usage count reaches zero. (2) Excess pages are trimmed after an allocation as the allocation must be made as a power-of-2 quantity of pages. (3) VMAs are added to the parent MM's R/B tree and mmap lists. As an MM may end up with overlapping VMAs within the tree, the VMA struct address is appended to the sort key. (4) Non-anonymous VMAs are now added to the backing inode's prio list. (5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of the backing region. The VMA and region structs will be split if necessary. (6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory segment instead of all the attachments at that addresss. Multiple shmat()'s return the same address under NOMMU-mode instead of different virtual addresses as under MMU-mode. (7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode. (8) /proc/maps is now the global list of mapped regions, and may list bits that aren't actually mapped anywhere. (9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount of RAM currently allocated by mmap to hold mappable regions that can't be mapped directly. These are copies of the backing device or file if not anonymous. These changes make NOMMU mode more similar to MMU mode. The downside is that NOMMU mode requires some extra memory to track things over NOMMU without this patch (VMAs are no longer shared, and there are now region structs). Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Mike Frysinger <vapier.adi@gmail.com> Acked-by: Paul Mundt <lethal@linux-sh.org>
2009-01-07Blackfin arch: Print FP at level KERN_NOTICEJie Zhang
Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-01-07Blackfin arch: merge adeos blackfin part to arch/blackfin/Yi Li
[Mike Frysinger <vapier.adi@gmail.com>: - handle bf531/bf532/bf534/bf536 variants in ipipe.h - cleanup IPIPE logic for bfin_set_irq_handler() - cleanup ipipe asm code a bit and add missing ENDPROC() - simplify IPIPE code in trap_c - unify some of the IPIPE code and fix style - simplify DO_IRQ_L1 handling with ipipe code - revert IRQ_SW_INT# addition from ipipe merge - remove duplicate get_{c,s}clk() prototypes ] Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-11-18Blackfin arch: do not define decode_instruction if hwtrace is turned offMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-11-18Blackfin arch: SMP supporting patchset: Blackfin kernel and memory ↵Graf Yang
management code Blackfin dual core BF561 processor can support SMP like features. https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like In this patch, we provide SMP extend to Blackfin kernel and memory management code Singed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-28Blackfin arch: Fix typo when adding CONFIG_DEBUG_VERBOSERobin Getz
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-27Blackfin arch: handle case of d_path() returning error in decode_address()Tim Pepper
d_path() can return an error. Most of its callers do something or other to make up something sane in that case. Do similar for blackfin's decode_address() call to d_path(). Signed-off-by: Tim Pepper <lnxninja@linux.vnet.ibm.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-10Blackfin arch: Add optional verbose debugRobin Getz
Add optional verbose debug - which when turned off, quiets down userspace errors. Saves ~8k of code/data for production systems Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-09Blackfin arch: Fix bug - HW Errors never recover on BF548Robin Getz
The kernel does not properly clear the EBIU Error Master (EBIU_ERRMST) Register on BF548, which causes the kernel to panic. We need to make sure that we clear the EBIU_ERRMST (necessary on BF54x) Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-09Blackfin arch: Fix bug - kernel build with config kernel debugging with ↵Sonic Zhang
remote gdb fails Add some comment and fix duplicated VEC_EXCPT02 Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-08Blackfin arch: Use DTEST rather than DMA to poke at L1 SRAM during exception ↵Robin Getz
context Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-08Blackfin arch: Make sure we protect except 2 properly, and print out memory ↵Robin Getz
properly Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-08Blackfin arch: Better error handling of unknown exceptionsRobin Getz
Better error handling of unknown exceptions, allows userspace to do a EXCPT n instruction for a not installed exception handler, and the kernel doesn't crash (like it use to before this). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2008-10-13Blackfin arch: add supporting for kgdbSonic Zhang
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>