aboutsummaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2009-06-12module: cleanup FIXME comments about trimming exception table entries.Rusty Russell
Everyone cut and paste this comment from my original one. We now do it generically, so cut the comments. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Amerigo Wang <amwang@redhat.com>
2009-06-12module: trim exception table on init free.Rusty Russell
It's theoretically possible that there are exception table entries which point into the (freed) init text of modules. These could cause future problems if other modules get loaded into that memory and cause an exception as we'd see the wrong fixup. The only case I know of is kvm-intel.ko (when CONFIG_CC_OPTIMIZE_FOR_SIZE=n). Amerigo fixed this long-standing FIXME in the x86 version, but this patch is more general. This implements trim_init_extable(); most archs are simple since they use the standard lib/extable.c sort code. Alpha and IA64 use relative addresses in their fixups, so thier trimming is a slight variation. Sparc32 is unique; it doesn't seem to define ARCH_HAS_SORT_EXTABLE, yet it defines its own sort_extable() which overrides the one in lib. It doesn't sort, so we have to mark deleted entries instead of actually trimming them. Inspired-by: Amerigo Wang <amwang@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: linux-alpha@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: linux-ia64@vger.kernel.org
2009-06-12module: merge module_alloc() finallyAmerigo Wang
As Christoph Hellwig suggested, module_alloc() actually can be unified for i386 and x86_64 (of course, also UML). Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: 'Ingo Molnar' <mingo@elte.hu> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-06-12uml module: fix uml build process due to this mergeAmerigo Wang
Due to the previous merge, uml needs to be fixed. Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-06-12x86 module: merge the rest functions with macrosAmerigo Wang
Merge the rest functions together, with proper preprocessing directives. Finally remove module_{32|64}.c. Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-06-12x86 module: merge the same functions in module_32.c and module_64.cAmerigo Wang
Merge the same functions both in module_32.c and module_64.c into module.c. This is the first step to merge both of them finally. Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-06-12perf_counter/x86: Add a quirk for Atom processorsYong Wang
The fixed-function performance counters do not work on current Atom processors. Use the general-purpose ones instead. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <20090612080855.GA2286@ywang-moblin2.bj.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-06-12x86: make zap_low_mapping could be used earlyYinghai Lu
Only one cpu is there, just call __flush_tlb for it. Fixes the following boot warning on x86: [ 0.000000] Memory: 885032k/915540k available (5993k kernel code, 29844k reserved, 3842k data, 428k init, 0k highmem) [ 0.000000] virtual kernel memory layout: [ 0.000000] fixmap : 0xffe17000 - 0xfffff000 (1952 kB) [ 0.000000] vmalloc : 0xf8615000 - 0xffe15000 ( 120 MB) [ 0.000000] lowmem : 0xc0000000 - 0xf7e15000 ( 894 MB) [ 0.000000] .init : 0xc19a5000 - 0xc1a10000 ( 428 kB) [ 0.000000] .data : 0xc15da4bb - 0xc199af6c (3842 kB) [ 0.000000] .text : 0xc1000000 - 0xc15da4bb (5993 kB) [ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok. [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: at kernel/smp.c:369 smp_call_function_many+0x50/0x1b0() [ 0.000000] Hardware name: System Product Name [ 0.000000] Modules linked in: [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip #52504 [ 0.000000] Call Trace: [ 0.000000] [<c104aa16>] warn_slowpath_common+0x65/0x95 [ 0.000000] [<c104aa58>] warn_slowpath_null+0x12/0x15 [ 0.000000] [<c1073bbe>] smp_call_function_many+0x50/0x1b0 [ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41 [ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41 [ 0.000000] [<c1073d4f>] smp_call_function+0x31/0x58 [ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41 [ 0.000000] [<c104f635>] on_each_cpu+0x26/0x65 [ 0.000000] [<c10374b5>] flush_tlb_all+0x19/0x1b [ 0.000000] [<c1032ab3>] zap_low_mappings+0x4d/0x56 [ 0.000000] [<c15d64b5>] ? printk+0x14/0x17 [ 0.000000] [<c19b42a8>] mem_init+0x23d/0x245 [ 0.000000] [<c19a56a1>] start_kernel+0x17a/0x2d5 [ 0.000000] [<c19a5347>] ? unknown_bootoption+0x0/0x19a [ 0.000000] [<c19a5039>] __init_begin+0x39/0x41 [ 0.000000] ---[ end trace 4eaa2a86a8e2da22 ]--- Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
2009-06-12Blackfin: fix sparseirq/kstat_irqs falloutMike Frysinger
The sparseirq changes (d7e51e66) played poorly with the Blackfin irqchip implementation as we're still using the old hardirq method. Our bad irq structure had a NULL kstat_irqs field so when all the common code tries to increment this field, everything goes big bada boom. 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: fix length checking in kgdb_ebin2memRoel Kluin
The kgdb_ebin2mem() was decrementing the count variable to do parsing, but then later still tries to use it based on its original meaning. So leave it untouched and use a different variable to walk the memory. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: kgdb: fix up error return valuesMike Frysinger
The Blackfin kgdb code was all passing back positive errno values when it really should have been using negative errno values. Reported-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: push access_ok() L1 attribute downMike Frysinger
There is no need for the L1 attribute to be on the prototype of the access_ok() function as all consumers of the function do not care where it lives -- they'll always use pcrel calls to get to it. This prevents pointless recompiles of most of the system when this config option changes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: punt duplicated search_exception_table() prototypeMike Frysinger
The common code already has a prototype for this function and we don't use it anywhere in the Blackfin code, so punt it from the Blackfin headers. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add missing access_ok() checks to user functionsRobin Getz
The core string/clear user functions weren't checking the user pointers which caused kernel crashes with some bad programs and tests (like LTP). Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: convert early_printk EVT init to a loopMike Frysinger
The EVT registers are all contiguous in the memory map, so using a loop to initialize them all rather than hardcoding the list results in much better generated code (a hardware loop rather than a whole bunch of individual loads). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: document the lsl variants of the L1 allocatorMike Frysinger
Make sure the meaning of "lsl" is covered somewhere and it is clear why we somewhat duplicate the sram alloc/free functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: rename Blackfin relocs according to the toolchainMike Frysinger
The latest Blackfin toolchain has fixed its relocation scheme to match other ports: always use R_BFIN_ prefix and capitalize everything. This brings the kernel in line with those fixes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: check SIC defines rather than variant namesMike Frysinger
Rather than having to maintain a hard coded list of Blackfin variants, use the SIC defines themselves. This fixes build problems on BF51x/BF538 under some configurations as they were missing from one of the lists. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add SSYNC to set_dma_sg() for descriptor fetchingSonic Zhang
Make sure the internal core buffers are flushed before telling the DMA engine to fetch the descriptor structure so that it gets the right values. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: convert SMP to only use generic time frameworkGraf Yang
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: bf548-ezkit/bf537-stamp: add resources for ADXL345/346Michael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: override default uClinux MTD addr/sizeMike Frysinger
Due to a processor anomaly (05000263 to be exact), most Blackfin parts cannot keep the embedded filesystem image directly after the kernel in RAM. Instead, the filesystem needs to be relocated to the end of memory. As such, we need to tweak the map addr/size during boot for Blackfin systems. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: fix command line corruption with DEBUG_DOUBLEFAULTMike Frysinger
Commit 6b3087c6 (which introduced Blackfin SMP) broke command line passing when the DEBUG_DOUBLEFAULT config option was enabled. Switch the code to using a scratch register and not R7 which holds the command line. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: fix handling of initial L1 reservationGraf Yang
This restores some L1 reservation logic that was lost during the Blackfin SMP merge. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: merge sram init functionsGraf Yang
Now that the sram_init() function exists only to call the bfin_sram_init() after the punting of the reserve_pda() function, simply merge the two to avoid pointless overhead. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: drop unused reserve_pda() functionGraf Yang
The Per-processor Data Area isn't actually reserved by this function, and all it ended up doing was issuing a printk(), so punt it. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: update gptimers APIMichael Hennerich
First we fix the prototypes for functions that return boolean values by using "int" rather than "uint16_t". Then we introduce a get_gptimer_run() function for checking the current run status of a timer, and then we add a disable_gptimers_sync() function which parallels disable_gptimers() with corresponding normal "_sync" behavior. Signed-off-by: Michael Hennerich <michael.hennerich@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: make deferred hardware errors more exactRobin Getz
Hardware errors on the Blackfin architecture are queued by nature of the hardware design. Things that could generate a hardware level queue up at the system interface and might not process until much later, at which point the system would send a notification back to the core. As such, it is possible for user space code to do something that would trigger a hardware error, but have it delay long enough for the process context to switch. So when the hardware error does signal, we mistakenly evaluate it as a different process or as kernel context and panic (erp!). This makes it pretty difficult to find the offending context. But wait, there is good news somewhere. By forcing a SSYNC in the interrupt entry, we force all pending queues at the system level to be processed and all hardware errors to be signaled. Then we check the current interrupt state to see if the hardware error is now signaled. If so, we re-queue the current interrupt and return thus allowing the higher priority hardware error interrupt to process properly. Since we haven't done any other context processing yet, the right context will be selected and killed. There is still the possibility that the exact offending instruction will be unknown, but at least we'll have a much better idea of where to look. The downside of course is that this causes system-wide syncs at every interrupt point which results in significant performance degradation. Since this situation should not occur in any properly configured system (as hardware errors are triggered by things like bad pointers), make it a debug configuration option and disable it by default. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add note about anomaly 05000242 being worked aroundMike Frysinger
Document anomaly 05000242 workaround in source code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: work around anomaly 05000220Graf Yang
When possible, work around anomaly 05000220 (external memory is write back cached, but L2 is not cached). If not possible, detect the conditions at build time and reject any qualifying configurations. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: rename some Blackfin driversMike Frysinger
Try to keep the naming conventions consistent, so: SPI_ADC_BF533 -> BFIN_SPI_ADC TWI_LCD -> BFIN_TWI_LCD Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: make sure MPU CPLB for first 1k is marked as validRobin Getz
This way we properly catch and kill applications that jump to a NULL ptr. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add workaround for anomaly 05000287Graf Yang
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: add support for gptimer0 as a tick sourceGraf Yang
For systems where the core cycles are not a usable tick source (like SMP or cycles gets updated), enable gptimer0 as an alternative. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: annotate anomaly 05000120Graf Yang
Add some notes for anomaly 05000120 to make sure we work around it. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: BF518F-EZBRD: handle required portmuxing of async pinsGraf Yang
The two high address lines on the BF51x are not dedicated which means we need to handle them like any other peripheral pin if we want to access the upper 2MB of parallel flash. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: detect anomaly 05000274Sonic Zhang
Detect and reject operating conditions for anomaly 05000274 since the problem cannot be worked around in software. Signed-off-by: Sonic Zhang <sonic.zhang@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-06-12Blackfin: workaround anomaly 05000227Mike Frysinger
Workaround anomaly 05000227 by only using the scratch pad for stack when absolutely necessary. The core code which reprograms clocks really only touches MMRs directly with constants. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: delete unused sys_getpagesize() functionMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: work around anomaly 05000287Graf Yang
Make sure we work around anomaly 05000287 by configuring different port preferences for the data cache. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: punt useless GPIO init callMike Frysinger
This init code existed only to dump a printk(), and not even a useful one. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: annotate anomaly 05000119 in core DMA codeRobin Getz
Add a reminder note to avoid the DMA_DONE bit in our DMA core code. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: document anomaly 05000234 workaroundRobin Getz
Note the reason for using CHIPD over DSPID. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Blackfin: fix early L1 relocation crashRobin Getz
Our early L1 relocate code may implicitly call code which lives in L1 memory. This is due to the dma_memcpy() rewrite that made the DMA code lockless and safe to be used by multiple processes. If we start the early DMA memcpy to relocate things into L1 instruction but then our DMA memcpy code calls a function that lives in L1, things fall apart. As such, create a small dedicated DMA memcpy routine that we can assume sanity at boot time. Reported-by: Filip Van Rillaer <filip.vanrillaer@oneaccess-net.com> Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>