Sam Ravnborg [Fri, 12 Dec 2008 04:28:59 +0000 (20:28 -0800)]
sparc64: do not export pus_fs_struct
Al asked: BTW, why does sparc64 export put_fs_struct? Grepping the
kernel tree did not show any users of an exported put_fs_struct - so
drop the export.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Mon, 8 Dec 2008 09:08:24 +0000 (01:08 -0800)]
sparc: fix sparse warnings in irq_32.c
Fix following sparse warnings:
symbol 'static_irqaction' was not declared. Should it be static?
symbol 'static_irq_count' was not declared. Should it be static?
symbol 'irq_action_lock' was not declared. Should it be static?
symbol 'unexpected_irq' was not declared. Should it be static?
symbol 'handler_irq' was not declared. Should it be static?
returning void-valued expression
returning void-valued expression
returning void-valued expression
symbol 'init_IRQ' was not declared. Should it be static?
Warnings were fixed by addding proper declarations
and fixing return path of a few functions.
There remains several warnings all related to the floppy driver.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Mon, 8 Dec 2008 09:04:59 +0000 (01:04 -0800)]
sparc: fix sparse warnings in traps_32.c
o add decalrations to entry.h for functions only used from assembler
o add declaratiosn to kernel.h for functions only used from .c
o removed unused functions/extern declarations
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 7 Dec 2008 08:46:33 +0000 (00:46 -0800)]
sparc: Restore irq_trans_init() call in prom_create_node().
This broke sparc64 in various ways.
Add an empty dummy hook in sparc32's prom_32.c so that we
can potentially handle things on that side similarly, and
in particular avoid a prom_common.c ifdef :-)
Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Sun, 7 Dec 2008 08:04:30 +0000 (00:04 -0800)]
sparc: unify kernel/cpu
o use cpu_32.c as base
o move all sparc64 definitions to the common cpu.c
o use ifdef for the parts that differs and use cpu_32 as base
o spitfire.h required a CONFIG_SPARC64 guard to fix build on 32 bit
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 6 Dec 2008 06:18:40 +0000 (22:18 -0800)]
sparc: Always set AUDIT_ARCH, not just on sparc64.
Without fancy makefile rules it's not straightforward
to prevent both arch/sparc/kernel/audit.o and lib/audit.o
from both being used on sparc32.
Since arch/sparc/kernel/audit.c is identical to lib/audit.c
except some CONFIG_COMPAT protected sections of code, just
use it on sparc32 too as that's the simplest way to fix
this.
Signed-off-by: David S. Miller <davem@davemloft.net>
Add final len assignment in sparc64's get_one_property() (it's necessary
to avoid unchecked return value warnings on the sparc32 side),
and mark name argument const on sparc32's copy.
Signed-off-by: David S. Miller <davem@davemloft.net>
Nicolas Palix [Thu, 4 Dec 2008 05:10:57 +0000 (21:10 -0800)]
sparc: Add missing of_node_put
of_node_put is needed before discarding a value received from
of_find_node_by_name, eg in error handling code or when the device
node is no longer used.
The semantic match that catches the bug is as follows:
(http://www.emn.fr/x-info/coccinelle/)
n@p1 = of_find_node_by_name(...)
...
if (!n) S
... when != of_node_put(n)
when != n1 = f(n,...)
when != E = n
when any
when strict
(
return \(0\|<+...n...+>\|ptr\);
|
return@p2 ...;
|
of_node_put(n);
|
n1 = f(n,...)
|
E = n
)
Sam Ravnborg [Wed, 3 Dec 2008 11:14:26 +0000 (03:14 -0800)]
sparc,sparc64: unify boot/
Simple unification:
o renamed piggyback to *_32.c/*_64.c
o copied content of Makefile from sparc64 to sparc and guard it
o updated sparc/boot/.gitignore
o deleted remaining files in sparc64/boot
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Wed, 3 Dec 2008 11:11:52 +0000 (03:11 -0800)]
sparc,sparc64: unify kernel/
o Move all files from sparc64/kernel/ to sparc/kernel
- rename as appropriate
o Update sparc/Makefile to the changes
o Update sparc/kernel/Makefile to include the sparc64 files
NOTE: This commit changes link order on sparc64!
Link order had to change for either of sparc32 and sparc64.
And assuming sparc64 see more testing than sparc32 change link
order on sparc64 where issues will be caught faster.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Wed, 3 Dec 2008 11:08:37 +0000 (03:08 -0800)]
sparc: prepare kernel/ for unification
o sparc32 files with identical names to sparc64 renamed to <name>_32.S
o introduced a few Kconfig helpers to simplify Makefile logic
o refactored Makefile to prepare for unification
- use obj-$(CONFIG_SPARC32) for sparc32 specific files
- use <name>_$(BITS) for files where sparc64 has a _64 variant
- sparc64 directly include a few files where sparc32 builds them,
refer to these files directly (no BITS)
- sneaked in -Werror as used by sparc64
o modified sparc/Makefile to use the new names for head/init_task
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Wed, 3 Dec 2008 11:10:25 +0000 (03:10 -0800)]
sparc,sparc64: unify lib/
o Renamed files in sparc64 to <name>_64.S when identical
to sparc32 files.
o iomap.c were equal for sparc32 and sparc64
o adjusted sparc/Makefile now we have only one lib/
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Sun, 30 Nov 2008 06:16:52 +0000 (22:16 -0800)]
sparc,sparc64: unify prom/
- all files with identical names copied and renamed to *_64.c
- the remaning files copied as is
- added sparc64 specific files to sparc/prom/Makefile
- teach sparc64 Makefile to look into sparc/prom/
- delete unused Makefile from sparc64/prom/
linking order was not kept for sparc64 with this change.
It was not possible to keep linking order for both sparc and sparc64
and as sparc64 see more testing than sparc it was natural to
break linking order on sparc64. Should it have any effect it
would be detected sooner this way.
printf_32.c and printf_64.c are obvious candidates to be merged
but they are not 100% equal so that was left for later
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Wed, 3 Dec 2008 07:17:12 +0000 (23:17 -0800)]
sparc,sparc64: unify Makefile
To unify Makefile for sparc and sparc64 a few other steps was needed:
1) separate defconfig files for sparc and sparc64 is required,
so locate these in arch/sparc/configs
2) removoval of hack in toplevel Makefile to deal with that
headers was in a separate directory compared to the rest
The unification of the Makefile required usage of several
foo-$(CONFIG_SPARCnn) +=
due to a few directories pending unification.
This will be cleaned up when we unify the remaining directories.
Included in this patch are the deletion of a few files in
sparc64 as they are no longer needed: Makefile + Kconfig.
arch/sparc64/ will after this patch is applied only
have four directories (prom, lib, kernel, boot)
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Wed, 3 Dec 2008 07:15:42 +0000 (23:15 -0800)]
sparc: refactor Makefile
The btfixup step needs knowledge of all the .o files,
but there is no need to pass them in independent variables.
Simplify it to use only two variables.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Sun, 30 Nov 2008 05:51:05 +0000 (21:51 -0800)]
sparc,sparc64: unify asm-offsets.c
sparc64 does not use constants generated from asm-offsets
but to prepare it to do so the parts that could be
shared do now generate constants for sparc64 too.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 24 Nov 2008 05:50:16 +0000 (21:50 -0800)]
sparc: Include drivers/pcmcia/Kconfig
Stephen Rothwell pointed out that pcmcia can't be enabled on sparc64.
There is an empty non-prompt PCMCIA explicit entry in
arch/sparc/Kconfig but that doesn't do anything.
32-bit sparc needs a small hack to make this work, since it doesn't
use the generic IRQ layer yes. We have to provide a dummy definition
of probe_irq_mask(), since this is used by the yenta socket driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 17 Nov 2008 07:49:24 +0000 (23:49 -0800)]
sparc64: Add tsb-ratio sysctl.
Add a sysctl to tweak the RSS limit used to decide when to grow
the TSB for an address space.
In order to avoid expensive divides and multiplies only simply
positive and negative powers of two are supported.
The function computed takes the number of TSB translations that will
fit at one time in the TSB of a given size, and either adds or
subtracts a percentage of entries. This final value is the
RSS limit.
See tsb_size_to_rss_limit().
Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Mon, 17 Nov 2008 04:08:45 +0000 (20:08 -0800)]
sparc,sparc64: unify mm/
- move all sparc64/mm/ files to arch/sparc/mm/
- commonly named files are named _64.c
- add files to sparc/mm/Makefile preserving link order
- delete now unused sparc64/mm/Makefile
- sparc64 now finds mm/ in sparc
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Mon, 17 Nov 2008 04:01:17 +0000 (20:01 -0800)]
sparc,sparc64: unify Kconfig files
Merge all of sparc64 Kconfig to sparc Kconfig.
The merge was checked by:
- visual inspection in menuconfig
- result of allnoconfig, allmodconfig, allyesconfig was checked before and after
- result of a number of randconfig was checked before and after
scripts/diffconfig was used to check if the config differed before and after
The validity of the test was checked by on purpose introducing
a few bugs - and they were all caught by first run.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Sat, 15 Nov 2008 21:41:31 +0000 (13:41 -0800)]
sparc64: added more config options to the menus
moved a few config entries inside a menu so we
do not clutter the first screen up with a lot of detailed
config options.
The structure now remotely resemble the structure for i386
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 30 Oct 2008 04:25:00 +0000 (21:25 -0700)]
sparc64: Run the kernel always in the TSO memory model.
The fact of the matter is, all UltraSPARC-III and later chips only
implement TSO. They don't implement PSO and RMO memory models at all.
Only the Ultra-I and Ultra-II family chips implement RMO and they are
only helped marginally by using this setting when executing kernel
code.
The big plus to doing this is that we can eliminate all of the non-Sync
memory barriers in the kernel except for the ones used in the optimized
memcpy/memset code (these use block load and store operations which
have their own memory ordering rules).
Signed-off-by: David S. Miller <davem@davemloft.net>
Joseph Myers [Thu, 4 Dec 2008 03:36:05 +0000 (19:36 -0800)]
sparc64: Fix VIS emulation bugs
This patch fixes some bugs in VIS emulation that cause the GCC test
failure
FAIL: gcc.target/sparc/pdist-3.c execution test
for both 32-bit and 64-bit testing on hardware lacking these
instructions. The emulation code for the pdist instruction uses
RS1(insn) for both source registers rs1 and rs2, which is obviously
wrong and leads to the instruction doing nothing (the observed
problem), and further inspection of the code shows that RS1 uses a
shift of 24 and RD a shift of 25, which clearly cannot both be right;
examining SPARC documentation indicates the correct shift for RS1 is
14.
This patch fixes the bug if single-stepping over the affected
instruction in the debugger, but not if the testcase is run
standalone. For that, Wind River has another patch I hope they will
send as a followup to this patch submission.
Signed-off-by: Joseph Myers <joseph@codesourcery.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Thu, 4 Dec 2008 00:45:56 +0000 (16:45 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: fix setting of max_segment_size and seg_boundary mask
block: internal dequeue shouldn't start timer
block: set disk->node_id before it's being used
When block layer fails to map iov, it calls bio_unmap_user to undo