Commit graph

119717 commits

Author SHA1 Message Date
Sam Ravnborg 5e53879008 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>
2008-12-04 09:17:16 -08:00
Sam Ravnborg 14ae84c993 sparc: gitignore a few files
With this 'git status' no longer reports any new files
At least not for a sparc allnoconfig build

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:15 -08:00
Sam Ravnborg c489326939 sparc: clean boot/
Leave all cleaning to boot/Makefile
and delete zImage too when we do a 'make clean'

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:14 -08:00
Sam Ravnborg db5ea21a14 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>
2008-12-04 09:17:13 -08:00
Sam Ravnborg b5db854a91 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>
2008-12-04 09:17:12 -08:00
Sam Ravnborg 104495a1ce sparc64: use vmlinux.lds.S from sparc
Previous commit made them identical so use the sparc version

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:12 -08:00
Sam Ravnborg 1b1fbbcaad sparc,sparc64: prepare vmlinux.lds.S for unification
This patch makes the two vmlinux.lds.S files identical
and serve as documentation for the changes in each file.

This mainly add stuffs to sparc32 that is otherwise only
used by sparc64 and thus it should have no effect.

Build tested only.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:11 -08:00
David S. Miller 63ef34827c sparc64: Provide oprofile pseudo-NMI on Niagara.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:10 -08:00
David S. Miller 3178a07c33 sparc64: Add performance counter hypervisor calls for sun4v.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:09 -08:00
David S. Miller 6a5726dd6f sparc64: Add save_stack_trace_tsk().
And this allows us to indicate HAVE_LATENCYTOP_SUPPORT.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:09 -08:00
Al Viro 3a29db3222 sparc32: pdev_to_pnode() is used from __devinit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:08 -08:00
David S. Miller 64273d08df sparc32: Don't btfixup cache flush ops for viking multiple times.
Just do it once.

Pointed out by Al Viro.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:07 -08:00
Stephen Rothwell 9acee190c8 sparc: combine unistd_{32,64}.h
This is complicated a little because compat_audit.c wants to see only
the 32bit syscall numbers, but is being built in a 64bit compile.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:06 -08:00
David S. Miller 422e23ea08 sparc64: Use NMI oprofile profiling on cheetah and derivative cpus.
We use clock cycle counter, adjusted to HZ.

This can be extended to sun4v based processors as well, as they
also have a proper overflow interrupt facility for the performance
counters.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:05 -08:00
David S. Miller 456cad8e4e sparc64: Add write_pic() helper.
It writes the %pic register, keeping mind of processor bugs.

Implement reset_pic() in terms of it.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:05 -08:00
David S. Miller f9aad60010 sparc64: Block NMIs in critical section of context switch.
In these instructions we load the new thread register, switch
the register window, and setup the new frame pointer.

All of these must appear atomic, and things will explode if
we take a PIL=15 NMI interrupt in the middle of this sequence.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:04 -08:00
David S. Miller 5565736e44 sparc64: Make special trap return path for TRAP_NMI().
We don't want the rtrap path to try and run softirqs or
anything like that when returning from a PIL==15 NMI.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:03 -08:00
David S. Miller b4f4372f96 sparc64: Make %pil level 15 a pseudo-NMI.
So that we can profile code even in a local_irq_disable() section,
only write 14 (instead of 15) into the %pil register to disable IRQs.

This allows PIL level 15 to serve as a pseudo NMI.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:02 -08:00
David S. Miller c6afec5e4d 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>
2008-12-04 09:17:01 -08:00
David S. Miller 2c2551ab99 sparc64: Add interface for registering a performance counter IRQ handler.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:17:00 -08:00
David S. Miller 0871420fad 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>
2008-12-04 09:16:59 -08:00
Sam Ravnborg 27137e5285 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>
2008-12-04 09:16:59 -08:00
Sam Ravnborg c37ddd936d sparc: prepare mm/ for unification
- rename files where sparc64 has similar files to _32.c
- Restructure Makefile
- Sneak in -Werror as we have for sparc64

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:58 -08:00
Sam Ravnborg 7c979c49c9 sparc64: unify arch/sparc64/oprofile/
A simple:

   diff arch/sparc64/oprofile/init.c arch/sparc/oprofile/init.c
   diff arch/sparc64/oprofile/Makefile arch/sparc/oprofile/Makefile

revealed that the directories were equal.
So let sparc64 point to the sparc version and drop the sparc64 oprofile dir

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:57 -08:00
Sam Ravnborg 5115f39c20 sparc64: unify math-emu
Move relavent files to sparc/math-emu and
adjust path/include accordingly.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:56 -08:00
Sam Ravnborg 774434bf33 sparc: prepare math-emu for unification
Add _32 to filenames to make them 32 bit unique

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:56 -08:00
Sam Ravnborg d59b3706a9 sparc: cleanup math-emu
- Drop unused assignment from Makefile
- Replace EXTRA_CFLAGS with ccflags-y
- Delete unused file

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:55 -08:00
Sam Ravnborg b0cdd599db sparc,sparc64: add BITS to arch Makefile
BITS will be used to simplify unified Makefiles

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:54 -08:00
Sam Ravnborg 26b4c91218 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>
2008-12-04 09:16:53 -08:00
Sam Ravnborg 4b27e0e118 sparc: add "Bus options" to Kconfig
To align with sparc64 add a "Bus options" menu
This has the additiona advantage that all
bus options are kept together

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:52 -08:00
Sam Ravnborg 12e271a84e sparc: add menu "Executable file formats"
This is what we use in sparc64 - make sparc equal

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:52 -08:00
Sam Ravnborg 71899704d6 sparc: use Kconfig.hz
We already has the proper definition in place in param.h.
So use the common Kconfig.hz file

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:51 -08:00
Sam Ravnborg 655ab9940e sparc: drop UNIX98_PTYS from arch Kconfig
We have it in drivers/char/Kconfig
There is no need to ask twice

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:50 -08:00
Sam Ravnborg b498e42498 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>
2008-12-04 09:16:49 -08:00
Sam Ravnborg 35da3e3914 sparc: refactor Kconfig a little
Mode declaration of SPARC up in the top
to match the structure of sparc64 Kconfig

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:48 -08:00
Sam Ravnborg 5bb28a57a2 sparc: unify Kconfig.debug
Let sparc and sparc64 use the same Kconfig.debug

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:48 -08:00
David S. Miller 293666b7a1 sparc64: Stop using memory barriers for atomics and locks.
The kernel always executes in the TSO memory model now,
so none of this stuff is necessary any more.

With helpful feedback from Nick Piggin.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:47 -08:00
David S. Miller 64f2dde3f7 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>
2008-12-04 09:16:46 -08:00
David S. Miller c9bb6003dd of: Fix comment, sparc no longer uses of_device objects on special busses.
It only uses of_platform_bus_type.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:45 -08:00
David S. Miller 86821d18f9 sparc64: Rework auxio driver to save some text space.
Use common functions instead of inlining and duplicating logic
over and over to handle the SBUS vs. EBUS cases.

Before:

   text	   data	    bss	    dec	    hex	filename
    715	    568	     16	   1299	    513	arch/sparc64/kernel/auxio.o

After:

   text	   data	    bss	    dec	    hex	filename
    631	    568	     16	   1215	    4bf	arch/sparc64/kernel/auxio.o

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:16:44 -08:00
David S. Miller 6d1e428a4e Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-12-04 09:16:14 -08:00
Hong H. Pham 410d2c8187 sparc64: Sync FPU state in VIS emulation handler.
Copy the FPU state to the task's thread_info->fpregs for the VIS emulation
functions to access.

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-04 09:12:57 -08:00
Joseph Myers 726c12f57d 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>
2008-12-03 19:36:05 -08:00
Linus Torvalds feaf3848a8 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
2008-12-03 16:45:56 -08:00
Linus Torvalds a771132783 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  powerpc/83xx: Fix MCU support merge issue in mpc8349emitx.dts
  powerpc: Fix dma_map_sg() cache flushing on non coherent platforms
2008-12-03 16:41:15 -08:00
Linus Torvalds 2433c41789 Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.28' of git://linux-nfs.org/~bfields/linux:
  NLM: client-side nlm_lookup_host() should avoid matching on srcaddr
  nfsd: use of unitialized list head on error exit in nfs4recover.c
  Add a reference to sunrpc in svc_addsock
  nfsd: clean up grace period on early exit
2008-12-03 16:40:37 -08:00
Linus Torvalds cd92a17eec iTCO_wdt: fix typo when setting TCO_EN bit
The code used '&= 0x00002000' when it tried to set the TCO_EN bit, which
obviously didn't set that bit at all, but instead just reset all the
other bits in the SMI_EN register.

This bug seemingly caused various random behavior, with Frans Pop
reporting that X.org just silently hung at startup and Rafael Wysocki
reports the fan spinning with full speed.

See
	http://lkml.org/lkml/2008/12/3/178
	http://bugzilla.kernel.org/show_bug.cgi?id=12162

The problem seems to have been triggered by "[WATCHDOG] iTCO_wdt :
problem with rebooting on new ICH9 based motherboards" (commit
7cd5b08be3), but the bogus code existed
before that too (in the "supermicro_old_pre_stop()" function), it just
apparently never showed up due to different logic.

In that commit the broken code got moved around and now gets executed
much more.

Reported-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Frans Pop <elendil@planet.nl>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-03 16:20:19 -08:00
Rusty Russell e8e8e80ee0 sparc: asm/bitops.h should define __fls
bitops_64.h includes the generic one; pretty sure 32 should too.

(Found by using __fls in generic code and breaking sparc defconfig build:
 thanks Stephen and linux-next!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-03 16:04:52 -08:00
Anton Vorontsov dafdb61313 powerpc/83xx: Fix MCU support merge issue in mpc8349emitx.dts
Just found the merge issue in 442746989d
("powerpc/83xx: Add support for MCU microcontroller in .dts files"):
the commit adds the MCU controller node into the DMA node, which is
wrong because the MCU sits on the I2C bus. Fix this by moving the MCU
node into the I2C controller node.

The original patch[1] was OK though. ;-)

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-12-03 09:56:02 -06:00
Milan Broz 0e435ac26e block: fix setting of max_segment_size and seg_boundary mask
Fix setting of max_segment_size and seg_boundary mask for stacked md/dm
devices.

When stacking devices (LVM over MD over SCSI) some of the request queue
parameters are not set up correctly in some cases by default, namely
max_segment_size and and seg_boundary mask.

If you create MD device over SCSI, these attributes are zeroed.

Problem become when there is over this mapping next device-mapper mapping
- queue attributes are set in DM this way:

request_queue   max_segment_size  seg_boundary_mask
SCSI                65536             0xffffffff
MD RAID1                0                      0
LVM                 65536                 -1 (64bit)

Unfortunately bio_add_page (resp.  bio_phys_segments) calculates number of
physical segments according to these parameters.

During the generic_make_request() is segment cout recalculated and can
increase bio->bi_phys_segments count over the allowed limit.  (After
bio_clone() in stack operation.)

Thi is specially problem in CCISS driver, where it produce OOPS here

    BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);

(MAXSEGENTRIES is 31 by default.)

Sometimes even this command is enough to cause oops:

  dd iflag=direct if=/dev/<vg>/<lv> of=/dev/null bs=128000 count=10

This command generates bios with 250 sectors, allocated in 32 4k-pages
(last page uses only 1024 bytes).

For LVM layer, it allocates bio with 31 segments (still OK for CCISS),
unfortunatelly on lower layer it is recalculated to 32 segments and this
violates CCISS restriction and triggers BUG_ON().

The patch tries to fix it by:

 * initializing attributes above in queue request constructor
   blk_queue_make_request()

 * make sure that blk_queue_stack_limits() inherits setting

 (DM uses its own function to set the limits because it
 blk_queue_stack_limits() was introduced later.  It should probably switch
 to use generic stack limit function too.)

 * sets the default seg_boundary value in one place (blkdev.h)

 * use this mask as default in DM (instead of -1, which differs in 64bit)

Bugs related to this:
https://bugzilla.redhat.com/show_bug.cgi?id=471639
http://bugzilla.kernel.org/show_bug.cgi?id=8672

Signed-off-by: Milan Broz <mbroz@redhat.com>
Reviewed-by: Alasdair G Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-12-03 12:55:55 +01:00