Paul Mundt [Fri, 13 Jul 2007 00:30:57 +0000 (09:30 +0900)]
sh: Update r7785rp defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 13 Jul 2007 00:30:31 +0000 (09:30 +0900)]
sh: Export div symbols for GCC 4.2 and ST GCC.
GCC 4.2 can emit integer variants of the FP division routines, so
these need to be exported in order to keep the modules happy.
4.1.x versions of the ST compiler have these things backported,
and so also generate these symbols (whereas vanilla gcc 4.1.x
does not), so handle the __GNUC_STM_RELEASE__ case to accomodate
updated versions of the 4.1.x toolchain.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Erik Johansson [Thu, 12 Jul 2007 07:37:00 +0000 (16:37 +0900)]
sh: fix race in parallel out-of-tree build
Depending on which of the three dependencies for archprepare (in
arch/sh/Makefile) get built first, the directory include/asm-sh may or
may not exist when the maketools target is built. If the directory does
not exist, awk will fail to generate machtypes.h. This patch fixes this
by creating the directory before awk is executed.
Signed-off-by: Erik Johansson <erik.johansson@motorola.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Kristoffer Ericson [Thu, 12 Jul 2007 01:47:08 +0000 (10:47 +0900)]
sh: Kill off dead mach.c for hp6xx.
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Kristoffer Ericson [Thu, 12 Jul 2007 01:44:41 +0000 (10:44 +0900)]
sh: hd64461.h cleanup and added comments.
Now that we dont have PIO mapping anymore we need to make sure we
got the correct value in our headers. Some well needed comments
have also been added.
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Robert P. J. Day [Thu, 12 Jul 2007 01:41:52 +0000 (10:41 +0900)]
sh: Update the alignment when 4K stacks are used.
Use the newly added .bss.page_aligned section for aligning the stacks
rather than THREAD_SIZE.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Thu, 12 Jul 2007 01:40:36 +0000 (10:40 +0900)]
sh: Add a .bss.page_aligned section for 4K stacks.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Thu, 12 Jul 2007 00:48:54 +0000 (09:48 +0900)]
sh: Don't let SH-4A clobber SH-4 CFLAGS.
Older compilers don't support the -m4a{,nofpu} flags, which has the
side-effect of allowing FP operations to be emitted. Switch this to
incremental tuning, so we at least have -m4-nofpu as a fallback for
the gcc3 toolchains.
Without this, certain modules emit references to __udivsi3_i4 and
__sdivsi3_i4.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 22:28:11 +0000 (07:28 +0900)]
sh: Add parport stub for SuperIO ports.
Some boards have SuperIOs with PC-style parports, toss in the stub so
these can be supported.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 22:25:56 +0000 (07:25 +0900)]
sh: Drop -Wa,-dsp for DSP tuning.
We already hand off the proper ISA variant with the dsp specifier
appended, so we don't need to explicitly set -dsp. This causes some
confusion with certain toolchains that are restricted to -dsp family
opcodes artificially.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 19:09:02 +0000 (04:09 +0900)]
sh: Update dreamcast defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 19:05:06 +0000 (04:05 +0900)]
fb: pvr2fb: A few more __devinit annotations for PCI.
In the PCI + hotplug case we end up with some bogus references between
the PCI driver path and the DC path. In order to fix this, we have to
rework the common init path for __devinit, as well as moving all of the
data that it references to __devinidata.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 18:38:51 +0000 (03:38 +0900)]
fb: pvr2fb: Fix up section mismatch warnings.
A few minor things were broken here. fix and var screeninfo should have
been __devinitdata, board_list[] gets renamed to board_driver[] so the
modpost matching does the right thing, and we properly discard some of
the unused exit sections.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 18:36:06 +0000 (03:36 +0900)]
sh: Select IPR-IRQ for SH7091.
Fixes a compile failure for the Dreamcast.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 01:58:04 +0000 (10:58 +0900)]
sh: Correct __xdiv64_32/div64_32 return value size.
These should be returning a uint32_t, whereas they were erroneously
returning a u64 before. As the register sizes are 32-bits, this doesn't
really make a lot of sense.
Reported-by: Katsuya MATSUBARA <matsu@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Nobuhiro Iwamatsu [Fri, 6 Jul 2007 01:26:03 +0000 (10:26 +0900)]
sh: Fix timer-tmu build for SH-3.
With the TMU register definitions being renamed on SH-4, SH-3 ended up
breaking. Update the TSTR define to match the SH-4 convention.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 6 Jul 2007 01:22:59 +0000 (10:22 +0900)]
sh: Add cpu and mach links to CLEAN_FILES.
These weren't being cleaned up, so add them to the CLEAN_FILES.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 20 Jun 2007 09:29:27 +0000 (18:29 +0900)]
Merge branch 'x3'
Paul Mundt [Wed, 20 Jun 2007 09:27:10 +0000 (18:27 +0900)]
sh: Preliminary support for the SH-X3 CPU.
This adds basic support for UP SH-X3.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 20 Jun 2007 09:23:49 +0000 (18:23 +0900)]
sh: Hook up hard_smp_processor_id() for INTC2 block.
We need to know the CPU ID in order to calculate the mask and ack
registers effectively. Stub this in for UP.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 20 Jun 2007 09:09:10 +0000 (18:09 +0900)]
sh: Update se7722 defconfig.
Hook up the multi-node stuff for the SE7722.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 20 Jun 2007 09:01:52 +0000 (18:01 +0900)]
sh: Fix up cf-enabler dependency for SE boards.
This was using CONFIG_SH_SOLUTION_ENGINE, where we really wanted
CONFIG_SOLUTION_ENGINE. While we're at it, move the whole CF
enabler mess somewhere better suited.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 18 Jun 2007 10:02:47 +0000 (19:02 +0900)]
sh: Check oops_may_print() in unhandled fault.
Only print out pgd/pte data in the oops path if oops_may_print()
holds true. Follows the i386 implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Kaz Kojima [Mon, 18 Jun 2007 04:58:32 +0000 (13:58 +0900)]
sh: Fix up futex implementation.
SH is able to support a complete futex implementation on UP by way
of gUSA. However, IRQ toggling must be done for the old CPUs that
don't have movli.l/movco.l (LL/SC) instructions. Provide a default
implementation that does this, so it's possible to optimize for
newer CPUs.
Follows the same scheme as the current asm-sh/atomic-*.h headers.
Signed-off-by: Kaz Kojima <kkojima@rr.iij4u.or.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 15 Jun 2007 10:45:33 +0000 (19:45 +0900)]
sh: Update SH-2/SH-2A defconfigs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Magnus Damm [Fri, 15 Jun 2007 09:56:19 +0000 (18:56 +0900)]
sh: rework ipr code
This patch reworks the ipr code by grouping the offset array together
with the ipr_data structure in a new data structure called ipr_desc.
This new structure also contains the name of the controller in struct
irq_chip. The idea behind putting struct irq_chip in there is that we
can use offsetof() to locate the base addresses in the irq_chip
callbacks. This strategy has much in common with the recently merged
intc2 code.
One logic change has been made - the original ipr code enabled the
interrupts by default but with this patch they are all disabled by
default.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 15 Jun 2007 09:30:42 +0000 (18:30 +0900)]
sh: Only support PMB for SH-X cores.
We don't have a PMB for SH-X2 or later, so only enable it for
the few CPUs that support it. Fixes up the boot for SH4AL-DSP.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Magnus Damm [Fri, 15 Jun 2007 01:41:54 +0000 (10:41 +0900)]
sh: rework intc2 code
The shared intc2 code currently contains cpu-specific #ifdefs.
This is a tad unclean and it prevents us from using the shared code
to drive board-specific irqs on the se7780 board.
This patch reworks the intc2 code by moving the base addresses of
the intc2 registers into struct intc2_desc. This new structure also
contains the name of the controller in struct irq_chip. The idea
behind putting struct irq_chip in there is that we can use offsetof()
to locate the base addresses in the irq_chip callbacks.
One logic change has been made - the original shared intc2 code
enabled the interrupts by default but with this patch they are all
disabled by default.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 06:57:42 +0000 (15:57 +0900)]
sh: Fix up the math-emu build.
math-emu wasn't converted for the trap_no/errno_code changes,
get it building again.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 06:56:31 +0000 (15:56 +0900)]
sh: Kill off broken dma page ops.
There's no point in keeping these around, they've been broken
for some time, and the dmaenging/async_tx framework provides a
far more reasonable interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 06:35:34 +0000 (15:35 +0900)]
fs: hugetlbfs: Disable for shnommu.
SH can turn CONFIG_MMU on and off, don't let us get to a state
where hugetlbfs/hugetlbpage gets built when building for nommu.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 06:33:44 +0000 (15:33 +0900)]
sh: Fixup misaligned data for sh2 lockdep.
lockdep/irqflags tracing on SH-2 ends up with a misaligned
branch, fix it.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 06:32:07 +0000 (15:32 +0900)]
sh: Tidy up dependencies for SH-2 build.
SH-2 can presently get in to some pretty bogus states, so
we tidy up the dependencies a bit and get it all building
again.
This gets us a bit closer to a functional allyesconfig
and allmodconfig, though there are still a few things to
fix up.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Yoshihiro Shimoda [Mon, 11 Jun 2007 01:26:56 +0000 (10:26 +0900)]
sh: Provide a defconfig for R7780MP.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 11 Jun 2007 01:18:45 +0000 (10:18 +0900)]
sh: Compile fix for SH7604 removal.
There was a last remaining reference to CPU_SH7604 that broke
the build, kill that off too.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Robert P. J. Day [Fri, 8 Jun 2007 02:56:31 +0000 (11:56 +0900)]
sh: Warn against direct inclusion of <asm/rwsem.h>.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 8 Jun 2007 02:55:28 +0000 (11:55 +0900)]
sh: Kill off dead SH7604 support.
This was added during 2.5.x, but was never moved along. This
can easily be resurrected if someone has one they wish to work
with, but it's not worth keeping around in its current form.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Thu, 7 Jun 2007 02:32:52 +0000 (11:32 +0900)]
sh: memory hot-add for sparsemem users support.
This enables simple hotplug support for sparsemem users. Presently
this only permits memory being added in to node 0 on ZONE_NORMAL.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Thu, 7 Jun 2007 02:29:37 +0000 (11:29 +0900)]
sh: Fix up cpu to node mapping in sysfs.
Currently cpu_to_node() is always 0 in the UP case, though
we do want to have the CPU association linked in under sysfs
even in the cases where we're only on a single CPU.
Fix this up, so we have the cpu0 link on all of the available
nodes that don't already have a CPU link of their own.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 10:05:11 +0000 (19:05 +0900)]
sh: Fix the SH7722 flatmem build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 10:04:22 +0000 (19:04 +0900)]
sh: Make NUMA depend on sparsemem.
The only platforms that are supporting NUMA are doing so via
sparsemem, so update the dependency.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 08:58:56 +0000 (17:58 +0900)]
sh: URAM node support for SH7722.
This adds the URAM block on SH7722 as a separate node.
Sparsemem is required for this, or it can simply be disabled
by explicitly selecting a flatmem model.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 08:52:19 +0000 (17:52 +0900)]
sh: Support for multiple nodes.
This adds basic support for multiple nodes on SH machines.
This is primarily useful for boards with many different
memory blocks that are otherwise unused (SH7722/SH7785 URAM
and so forth).
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 03:23:06 +0000 (12:23 +0900)]
sh: Use asm/sections.h for linker section symbols.
Kill off a bunch of externs, and use sections.h instead..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 6 Jun 2007 03:09:54 +0000 (12:09 +0900)]
sh: Fix up max_zone_pfns[] with multiple nodes.
Currently using multiple nodes tramples the ZONE_NORMAL
max low pfn, tidy up the logic a bit to get it all working
as expected.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 4 Jun 2007 06:46:56 +0000 (15:46 +0900)]
sh: Default to 4-byte alignment for SLUB objects.
Slub currently defaults to 8-byte alignment for the kmalloc
and slab minalign values, where 4 will suffice. In the slab
case BYTES_PER_WORD == 4 already, so defining the minalign
values outright doesn't cause any regressions there either.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 4 Jun 2007 05:37:04 +0000 (14:37 +0900)]
sh: Wire up mempolicy syscalls.
Wire up mbind and get/set_mempolicy() in their reserved places.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 08:26:13 +0000 (17:26 +0900)]
sh: Tidy compiler warnings for SH-2A build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 08:25:42 +0000 (17:25 +0900)]
sh: Wrap CPU tuning through cc-option.
Some compilers don't support the explicit CPU tuning, while binutils
is still able to handle the special subtype-specific opcodes. Make
the CFLAG optional, falling back on the compiler default if nothing
better exists.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 08:23:14 +0000 (17:23 +0900)]
sh: Enable IPR-IRQ for SH7206.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 08:04:36 +0000 (17:04 +0900)]
sh: Mark sparsemem regions present earlier.
We have to call in to sparse_memory_present_with_active_regions()
earlier in order for sparsemem to be happy. This was being called
too late, and was causing troubles with the platforms that needed
to enable sparsemem.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 05:21:13 +0000 (14:21 +0900)]
sh: Register multiple nodes in topology_init().
If we have multiple nodes, register these at topology_init() time.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Fri, 1 Jun 2007 05:19:22 +0000 (14:19 +0900)]
sh: Allow for bootmem debug support.
Handy for debugging bootmem troubles.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 23 May 2007 08:48:36 +0000 (17:48 +0900)]
sh: sparsemem support.
This implements basic sparsemem support for SH. Presently this only
uses static sparsemem, and we still permit explicit selection of
flatmem. Those boards that want sparsemem can select it as usual.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Wed, 23 May 2007 08:40:56 +0000 (17:40 +0900)]
sh: pfn_valid() depends on flatmem.
pfn_valid() is already defined in the sparsemem case, so we only
need to define this for CONFIG_FLATMEM.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Nobuhiro Iwamatsu [Wed, 23 May 2007 03:56:24 +0000 (12:56 +0900)]
sh: Add L-BOX RE2 to mach-types.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Takashi YOSHII [Wed, 23 May 2007 03:34:13 +0000 (12:34 +0900)]
sh: Align .machvec.init section on a 4-byte boundary.
.machvec.init can be misaligned with the recent machvec changes,
forcibly align it on the boundary that it expects, as before.
Signed-off-by: Takashi YOSHII <takashi.yoshii.ze@hitachi.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Tue, 15 May 2007 07:25:47 +0000 (16:25 +0900)]
sh: Fix SH-4 CPU selects.
Now that select no longer works for selecting the "closest" CPU,
we have to explicitly reference the precise sub-type in the few
places where it actually matters (presently only setup code and
some legacy sh-sci cruft).
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Tue, 15 May 2007 06:38:30 +0000 (15:38 +0900)]
sh: Rip out special unknown machvec.
This kills off the BareCPU board as a "special" machvec, rather,
we leave this as a default for when no other vector is available,
or when we want to use it in combination with other vectors for
testing with generic ops. As sh_mv is copied out anyways (or
overloaded when an alternate vector is explicitly selected), this
doesn't consume any additional memory.
The generic machvec can be forcibly selected with sh_mv=generic,
or by not having any other boards enabled.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Tue, 15 May 2007 06:19:34 +0000 (15:19 +0900)]
sh: Kill off machvec aliases.
We now throw all of the machvecs in to .machvec.init and either
select one on the command line, or copy out the first (and
usually only) one to sh_mv. The rest are freed as usual.
This gets rid of all of the silly sh_mv aliasing and makes the
selection explicit rather than link-order dependent.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 10:12:37 +0000 (19:12 +0900)]
sh: Get multiple boards in one image working again.
This tidies up the build rules and permits multiple boards to be
linked in to the same kernel. The earlier Kconfig work ensures that
the CPU configuration is consistent across the boards, as this is
the only thing that we can't do dynamically.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 08:48:00 +0000 (17:48 +0900)]
sh: Fixup cmdline handling from machvec changes.
The command line wasn't being saved off properly after the machvec
changes went in, fix it up.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 08:29:12 +0000 (17:29 +0900)]
sh: Rework CPU/board dependencies.
This was a big mess, rework the logic a bit so that we constrain
to a particular subtype and figure out the board support based
on that. This makes building subtype specific kernels supporting
multiple boards possible again.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 08:26:34 +0000 (17:26 +0900)]
sh: Shut up SH2-DSP compile warnings.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 06:59:09 +0000 (15:59 +0900)]
sh: Fixup machvec support.
This fixes up much of the machvec handling, allowing for it to be
overloaded on boot. Making practical use of this still requires
some Kconfig munging, however.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 03:52:56 +0000 (12:52 +0900)]
sh: __user annotations for __get/__put_user().
This adds in some more __user annotations. These weren't being
handled properly in some of the __get_user and __put_user paths,
so tidy those up.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Paul Mundt [Mon, 14 May 2007 03:50:43 +0000 (12:50 +0900)]
sh: Split out CPU topology initialization.
Split out the CPU topology initialization to a separate file,
and switch it to a percpu type, rather than an NR_CPUS array.
At the same time, switch to only registering present CPUs,
rather than using the possible CPU map.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Bryan Wu [Tue, 5 Jun 2007 03:02:01 +0000 (11:02 +0800)]
RAMFS NOMMU: missed POSIX UID/GID inode attribute checking
This bug was caught by LTP testcase fchmod06 on Blackfin platform.
In the manpage of fchmod, "EPERM: The effective UID does not match the
owner of the file, and the process is not privileged (Linux: it does not
have the CAP_FOWNER capability)."
But the ramfs nommu code missed the inode_change_ok POSIX UID/GID
verification. This patch fixed this.
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 8 Jun 2007 00:10:19 +0000 (17:10 -0700)]
Merge git://git.linux-xtensa.org/kernel/xtensa-feed
* git://git.linux-xtensa.org/kernel/xtensa-feed:
Xtensa: use asm-generic/fcntl.h
[XTENSA] Remove non-rt signal handling
[XTENSA] Move common sections into bss sections
[XTENSA] clean-up header files
[XTENSA] Use generic 64-bit division
[XTENSA] Remove multi-exported symbols from xtensa_ksyms.c
[XTENSA] fix sources using deprecated assembler directive
[XTENSA] Spelling fixes in arch/xtensa
[XTENSA] fix bit operations in bitops.h
Linus Torvalds [Fri, 8 Jun 2007 00:09:01 +0000 (17:09 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver.
[SPARC64]: Fix 2 bugs in PCI Sabre bus scanning.
Linus Torvalds [Fri, 8 Jun 2007 00:08:06 +0000 (17:08 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
xfrm: Add security check before flushing SAD/SPD
[NET_SCHED]: Fix filter double free
[NET]: Avoid duplicate netlink notification when changing link state
[UDP]: Revert 2-pass hashing changes.
[AF_UNIX]: Fix stream recvmsg() race.
[NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check
[NETFILTER]: ip_tables: fix compat related crash
[NETFILTER]: nf_conntrack: fix helper module unload races
[RTNETLINK]: ifindex 0 does not exist
[NETLINK]: Mark netlink policies const
[TCP] tcp_probe: Attach printf attribute properly to printl().
[TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer().
[NET]: Merge dst_discard_in and dst_discard_out.
[RFKILL]: Make rfkill->name const
[IPV4]: Restore old behaviour of default config values
[IPV4]: Add default config support after inetdev_init
[IPV4]: Convert IPv4 devconf to an array
[IPV4]: Only panic if inetdev_init fails for loopback
[TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack
[BNX2]: Update version and reldate.
...
Steven Rostedt [Thu, 7 Jun 2007 03:34:04 +0000 (23:34 -0400)]
enable interrupts in user path of page fault.
This is a minor fix, but what is currently there is essentially wrong.
In do_page_fault, if the faulting address from user code happens to be
in kernel address space (int *p = (int*)-1; p = 0xbed;) then the
do_page_fault handler will jump over the local_irq_enable with the
goto bad_area_nosemaphore;
But the first line there sees this is user code and goes through the
process of sending a signal to send SIGSEGV to the user task. This whole
time interrupts are disabled and the task can not be preempted by a
higher priority task.
This patch always enables interrupts in the user path of the
bad_area_nosemaphore.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 8 Jun 2007 00:02:29 +0000 (17:02 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] pxa: fix pxa27x keyboard driver
[ARM] Fix 4417/1: Serial: Fix AMBA drivers locking
[ARM] 4421/1: AT91: Value of _KEY fields.
[ARM] Solve buggy smp_processor_id() usage
[ARM] 4422/1: Fix default value handling in gpio_direction_output (PXA)
[ARM] 4419/1: AT91: SAM9 USB clocks check for suspending
[ARM] 4418/1: AT91: Number of programmable clocks differs
[ARM] 4392/2: Do not corrupt the SP register in compressed/head.S
Linus Torvalds [Fri, 8 Jun 2007 00:00:37 +0000 (17:00 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Fix warning by moving do_default_vi into CONFIG_CPU_MIPSR2_SRS
[MIPS] Fix some minor typoes in arch/mips/Kconfig.
[MIPS] Remove prototype for deleted function qemu_handle_int
[MIPS] Fix some system calls with long long arguments
[MIPS] Make dma_map_sg handle sg elements which are longer than one page
[MIPS] Drop __ARCH_WANT_SYS_FADVISE64
[MIPS] Fix VGA corruption on RM300C
[MIPS] RM300: Fix MMIO problems by marking the PCI INT ACK region busy
[MIPS] EMMA2RH: remove dead KGDB code
[MIPS] Remove duplicate fpu enable hazard code.
[MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler.
Peter Zijlstra [Wed, 6 Jun 2007 09:39:40 +0000 (11:39 +0200)]
frv: build fix
In file included from /usr/src/linux-2.6-2/net/ipv4/ip_input.c:118:
include2/asm/system.h:245: error: parse error before "__cmpxchg_32"
include2/asm/system.h:245: error: parse error before '*' token
include2/asm/system.h:245: warning: type defaults to `int' in declaration of `__cmpxchg_32'
include2/asm/system.h:245: warning: function declaration isn't a prototype
include2/asm/system.h:245: warning: data definition has no type or storage class
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David S. Miller [Thu, 7 Jun 2007 23:58:22 +0000 (16:58 -0700)]
[SPARC64]: Fix SBUS IRQ regression caused by PCI-E driver.
We used to access the 64-bit IRQ IMAP and ICLR registers of bus
controllers 4-bytes in and as a 32-bit register word, since only the
low 32-bits were relevant. This seemed like a good idea at the time.
But the PCI-E controller requires full 8-byte 64-bit access to
these registers, so we switched over to accessing them fully.
SBUS was not adjusted properly, which broke interrupts completely.
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 6 Jun 2007 21:03:08 +0000 (14:03 -0700)]
[SPARC64]: Fix 2 bugs in PCI Sabre bus scanning.
If we are on hummingbird, bus runs at 66MHZ.
pbm->pci_bus should be setup with the result of pci_scan_one_pbm()
or else we deref NULL pointers in the error interrupt handlers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Joy Latten [Mon, 4 Jun 2007 23:05:57 +0000 (19:05 -0400)]
xfrm: Add security check before flushing SAD/SPD
Currently we check for permission before deleting entries from SAD and
SPD, (see security_xfrm_policy_delete() security_xfrm_state_delete())
However we are not checking for authorization when flushing the SPD and
the SAD completely. It was perhaps missed in the original security hooks
patch.
This patch adds a security check when flushing entries from the SAD and
SPD. It runs the entire database and checks each entry for a denial.
If the process attempting the flush is unable to remove all of the
entries a denial is logged the the flush function returns an error
without removing anything.
This is particularly useful when a process may need to create or delete
its own xfrm entries used for things like labeled networking but that
same process should not be able to delete other entries or flush the
entire database.
Signed-off-by: Joy Latten<latten@austin.ibm.com>
Signed-off-by: Eric Paris <eparis@parisplace.org>
Signed-off-by: James Morris <jmorris@namei.org>
Patrick McHardy [Tue, 5 Jun 2007 23:06:59 +0000 (16:06 -0700)]
[NET_SCHED]: Fix filter double free
cbq and atm destroy their filters twice when destroying inner classes
during qdisc destruction.
Reported-and-tested-by: Strobl Anton <a.strobl@aws-it.at>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Thomas Graf [Tue, 5 Jun 2007 23:03:03 +0000 (16:03 -0700)]
[NET]: Avoid duplicate netlink notification when changing link state
When changing the link state from userspace not affecting any other
flags. Two duplicate notification are being sent, once as action
in the NETDEV_UP/NETDEV_DOWN notification chain and a second time
when comparing old and new device flags after the change has been
completed. Although harmless, the duplicates should be avoided.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Jun 2007 22:18:43 +0000 (15:18 -0700)]
[UDP]: Revert 2-pass hashing changes.
This reverts changesets:
6aaf47fa48d3c44280810b1b470261d340e4ed87
b7b5f487ab39bc10ed0694af35651a03d9cb97ff
de34ed91c4ffa4727964a832c46e624dd1495cf5
fc038410b4b1643766f8033f4940bcdb1dace633
There are still some correctness issues recently
discovered which do not have a known fix that doesn't
involve doing a full hash table scan on port bind.
So revert for now.
Signed-off-by: David S. Miller <davem@davemloft.net>
Miklos Szeredi [Tue, 5 Jun 2007 20:10:29 +0000 (13:10 -0700)]
[AF_UNIX]: Fix stream recvmsg() race.
A recv() on an AF_UNIX, SOCK_STREAM socket can race with a
send()+close() on the peer, causing recv() to return zero, even though
the sent data should be received.
This happens if the send() and the close() is performed between
skb_dequeue() and checking sk->sk_shutdown in unix_stream_recvmsg():
process A skb_dequeue() returns NULL, there's no data in the socket queue
process B new data is inserted onto the queue by unix_stream_sendmsg()
process B sk->sk_shutdown is set to SHUTDOWN_MASK by unix_release_sock()
process A sk->sk_shutdown is checked, unix_release_sock() returns zero
I'm surprised nobody noticed this, it's not hard to trigger. Maybe
it's just (un)luck with the timing.
It's possible to work around this bug in userspace, by retrying the
recv() once in case of a zero return value.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Akinobu Mita [Tue, 5 Jun 2007 19:56:53 +0000 (12:56 -0700)]
[NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check
The return value from textsearch_prepare() needs to be checked
by IS_ERR(). Because it returns error code as a pointer.
Cc: "Brian J. Murrell" <netfilter@interlinx.bc.ca>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Mishin [Tue, 5 Jun 2007 19:56:09 +0000 (12:56 -0700)]
[NETFILTER]: ip_tables: fix compat related crash
check_compat_entry_size_and_hooks iterates over the matches and calls
compat_check_calc_match, which loads the match and calculates the
compat offsets, but unlike the non-compat version, doesn't call
->checkentry yet. On error however it calls cleanup_matches, which in
turn calls ->destroy, which can result in crashes if the destroy
function (validly) expects to only get called after the checkentry
function.
Add a compat_release_match function that only drops the module reference
on error and rename compat_check_calc_match to compat_find_calc_match to
reflect the fact that it doesn't call the checkentry function.
Reported by Jan Engelhardt <jengelh@linux01.gwdg.de>
Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHarrdy [Tue, 5 Jun 2007 19:55:27 +0000 (12:55 -0700)]
[NETFILTER]: nf_conntrack: fix helper module unload races
When a helper module is unloaded all conntracks refering to it have their
helper pointer NULLed out, leading to lots of races. In most places this
can be fixed by proper use of RCU (they do already check for != NULL,
but in a racy way), additionally nf_conntrack_expect_related needs to
bail out when no helper is present.
Also remove two paranoid BUG_ONs in nf_conntrack_proto_gre that are racy
and not worth fixing.
Signed-off-by: Patrick McHarrdy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Tue, 5 Jun 2007 19:40:01 +0000 (12:40 -0700)]
[RTNETLINK]: ifindex 0 does not exist
ifindex == 0 does not exist and implies we should do a lookup by name if
one was given.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Tue, 5 Jun 2007 19:38:30 +0000 (12:38 -0700)]
[NETLINK]: Mark netlink policies const
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Jun 2007 07:19:24 +0000 (00:19 -0700)]
[TCP] tcp_probe: Attach printf attribute properly to printl().
GCC doesn't like the way Stephen initially did it:
net/ipv4/tcp_probe.c:83: warning: empty declaration
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Tue, 5 Jun 2007 07:16:12 +0000 (00:16 -0700)]
[TCP]: Use LIMIT_NETDEBUG in tcp_retransmit_timer().
LIMIT_NETDEBUG allows the admin to disable some warning messages (echo 0
>/proc/sys/net/core/warnings).
The "TCP: Treason uncloaked!" message can use this facility.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Denis Cheng [Tue, 5 Jun 2007 07:06:57 +0000 (00:06 -0700)]
[NET]: Merge dst_discard_in and dst_discard_out.
Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ivo van Doorn [Tue, 5 Jun 2007 07:04:46 +0000 (00:04 -0700)]
[RFKILL]: Make rfkill->name const
The rfkill name can be made const safely,
this makes the compiler happy when drivers make
it point to some const string used elsewhere.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 5 Jun 2007 06:36:06 +0000 (23:36 -0700)]
[IPV4]: Restore old behaviour of default config values
Previously inet devices were only constructed when addresses are added
(or rarely in ipmr). Therefore the default config values they get are
the ones at the time of these operations.
Now that we're creating inet devices earlier, this changes the
behaviour of default config values in an incompatible way (see bug
#8519).
This patch creates a compromise by setting the default values at the
same point as before but only for those that have not been explicitly
set by the user since the inet device's creation.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 5 Jun 2007 06:35:37 +0000 (23:35 -0700)]
[IPV4]: Add default config support after inetdev_init
Previously once inetdev_init has been called on a device any changes
made to ipv4_devconf_dflt would have no effect on that device's
configuration.
This creates a problem since we have moved the point where
inetdev_init is called from when an address is added to where the
device is registered.
This patch is the first half of a set that tries to mimic the old
behaviour while still calling inetdev_init.
It propagates any changes to ipv4_devconf_dflt to those devices that
have not had the corresponding attribute set.
The next patch will forcibly set all values at the point where
inetdev_init was previously called.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 5 Jun 2007 06:34:44 +0000 (23:34 -0700)]
[IPV4]: Convert IPv4 devconf to an array
This patch converts the ipv4_devconf config members (everything except
sysctl) to an array. This allows easier manipulation which will be
needed later on to provide better management of default config values.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 5 Jun 2007 06:34:08 +0000 (23:34 -0700)]
[IPV4]: Only panic if inetdev_init fails for loopback
When I made the inetdev_init call work on all devices I incorrectly
left in the panic call as well. It is obviously undesirable to
panic on an allocation failure for a normal network device. This
patch moves the panic call under the loopback if clause.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Tue, 5 Jun 2007 04:32:46 +0000 (21:32 -0700)]
[TCP]: Honour sk_bound_dev_if in tcp_v4_send_ack
A time_wait socket inherits sk_bound_dev_if from the original socket,
but it is not used when sending ACK packets using ip_send_reply.
Fix by passing the oif to ip_send_reply in struct ip_reply_arg and
use it for output routing.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Jun 2007 04:24:42 +0000 (21:24 -0700)]
[BNX2]: Update version and reldate.
Update to version 1.5.11.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Jun 2007 04:24:07 +0000 (21:24 -0700)]
[BNX2]: Fix occasional counter corruption on 5708.
The statistics block DMA on 5708 can be messed up occasionally on the
average of about once per hour. If the user is reading the counters
within one second after the corruption, the counters will be all
messed up. One second later, the counters will be ok again until the
next corruption occurs.
The workaround is to disable the periodic statistics DMA. Instead,
we manually trigger the DMA once a second in bnx2_timer(). This
manual trigger of the DMA avoids the problem.
As a consequence, we can only allow 0 or 1 second settings for
ethtool -C statistics block.
Thanks to Jean-Daniel Pauget <jd@disjunkt.com> and
CaT <cat@zip.com.au> for reporting this rare problem.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Jun 2007 04:23:06 +0000 (21:23 -0700)]
[BNX2]: Enable DMA on 5709.
Add missing code to enable DMA on 5709 A1. The bit is a no-op on A0
and therefore can be set on all 5709 chips.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Jun 2007 04:22:24 +0000 (21:22 -0700)]
[BNX2]: Add missing wait in bnx2_init_5709_context().
For correctness, we need to wait for the MEM_INIT bit to be cleared
in the BNX2_CTX_COMMAND register before proceeding.
[Added return -EBUSY when the MEM_INIT bit doesn't clear, suggested
by Jeff Garzik.]
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>