GitHub/mt8127/android_kernel_alcatel_ttab.git
14 years agoMerge branch 'sh/clkfwk'
Paul Mundt [Thu, 13 May 2010 08:45:44 +0000 (17:45 +0900)]
Merge branch 'sh/clkfwk'

14 years agosh: simplify WARN usage in SH clock driver
Guennadi Liakhovetski [Tue, 4 May 2010 14:15:09 +0000 (14:15 +0000)]
sh: simplify WARN usage in SH clock driver

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Check return value of clk_get on ms7724
Kuninori Morimoto [Thu, 13 May 2010 01:08:37 +0000 (01:08 +0000)]
sh: Check return value of clk_get on ms7724

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Check return value of clk_get on ecovec24
Kuninori Morimoto [Thu, 13 May 2010 01:08:33 +0000 (01:08 +0000)]
sh: Check return value of clk_get on ecovec24

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: move sh clock-cpg.c contents to drivers/sh/clk-cpg.c
Magnus Damm [Tue, 11 May 2010 13:29:34 +0000 (13:29 +0000)]
sh: move sh clock-cpg.c contents to drivers/sh/clk-cpg.c

Move the CPG helpers to drivers/sh/clk-cpg.c V2.

This to allow SH-Mobile ARM to share the code with
SH. All functions except the legacy CPG stuff is moved.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: move sh clock.c contents to drivers/sh/clk.
Magnus Damm [Tue, 11 May 2010 13:29:25 +0000 (13:29 +0000)]
sh: move sh clock.c contents to drivers/sh/clk.

This patch is V2 of the SH clock framework move from
arch/sh/kernel/cpu/clock.c to drivers/sh/clk.c. All
code except the following functions are moved:
clk_init(), clk_get() and clk_put().

The init function is still kept in clock.c since it
depends on the SH-specific machvec implementation.

The symbols clk_get() and clk_put() already exist in
the common ARM clkdev code, those symbols are left in
the SH tree to avoid duplicating them for SH-Mobile ARM.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: move sh asm/clock.h contents to linux/sh_clk.h V2
Magnus Damm [Tue, 11 May 2010 13:29:17 +0000 (13:29 +0000)]
sh: move sh asm/clock.h contents to linux/sh_clk.h V2

This patch is V2 of the clock framework move from
arch/sh/include/asm/clock.h to include/linux/sh_clk.h
and updates the include paths for files that will be
shared between SH and SH-Mobile ARM.

The file asm/clock.h is still kept in this version,
this to depend on as few files as possible at this
point. We keep SH specific stuff in there.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: remove unused clock lookup
Magnus Damm [Tue, 11 May 2010 09:37:12 +0000 (09:37 +0000)]
sh: remove unused clock lookup

Now when all clocks are registered using clkdev,
get rid of the special SH-specific clock lookup.

Also ditch the unused module ref counting code.
This patch syncs the SH behaviour with ARM.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch boards to clkdev
Magnus Damm [Tue, 11 May 2010 09:37:05 +0000 (09:37 +0000)]
sh: switch boards to clkdev

This patch converts the remaining board clocks
to use clkdev for lookup if needed. The unused
name and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh4-202 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:57 +0000 (09:36 +0000)]
sh: switch sh4-202 to clkdev

This patch converts the remaining sh4-202 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch shx3 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:48 +0000 (09:36 +0000)]
sh: switch shx3 to clkdev

This patch converts the remaining shx3 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7757 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:40 +0000 (09:36 +0000)]
sh: switch sh7757 to clkdev

This patch converts the remaining sh7757 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7763 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:32 +0000 (09:36 +0000)]
sh: switch sh7763 to clkdev

This patch converts the remaining sh7763 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7780 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:24 +0000 (09:36 +0000)]
sh: switch sh7780 to clkdev

This patch converts the remaining sh7780 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7786 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:16 +0000 (09:36 +0000)]
sh: switch sh7786 to clkdev

This patch converts the remaining sh7786 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7785 to clkdev
Magnus Damm [Tue, 11 May 2010 09:36:03 +0000 (09:36 +0000)]
sh: switch sh7785 to clkdev

This patch converts the remaining sh7785 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7366 to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:55 +0000 (09:35 +0000)]
sh: switch sh7366 to clkdev

This patch converts the remaining sh7366 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7343 to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:45 +0000 (09:35 +0000)]
sh: switch sh7343 to clkdev

This patch converts the remaining sh7343 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7722 to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:38 +0000 (09:35 +0000)]
sh: switch sh7722 to clkdev

This patch converts the remaining sh7722 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7723 to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:27 +0000 (09:35 +0000)]
sh: switch sh7723 to clkdev

This patch converts the remaining sh7723 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch sh7724 to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:19 +0000 (09:35 +0000)]
sh: switch sh7724 to clkdev

This patch converts the remaining sh7724 clocks
to use clkdev for lookup. The now unused name
and id from struct clk are also removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: switch legacy clocks to clkdev
Magnus Damm [Tue, 11 May 2010 09:35:11 +0000 (09:35 +0000)]
sh: switch legacy clocks to clkdev

This patch converts the legacy clocks to register
using clkdev. Also the clock name is removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: get rid of div4 clock name
Magnus Damm [Tue, 11 May 2010 07:06:13 +0000 (07:06 +0000)]
sh: get rid of div4 clock name

Remove the name parameter from SH_CLK_DIV4() and
adjust the processor specific code. The lookup
happens using clkdev so the name is unused.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7786 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:06:05 +0000 (07:06 +0000)]
sh: sh7786 div4 clkdev lookup

Add sh7786 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7785 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:58 +0000 (07:05 +0000)]
sh: sh7785 div4 clkdev lookup

Add sh7785 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7366 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:50 +0000 (07:05 +0000)]
sh: sh7366 div4 clkdev lookup

Add sh7366 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7343 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:42 +0000 (07:05 +0000)]
sh: sh7343 div4 clkdev lookup

Add sh7343 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7724 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:32 +0000 (07:05 +0000)]
sh: sh7724 div4 clkdev lookup

Add sh7724 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7723 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:25 +0000 (07:05 +0000)]
sh: sh7723 div4 clkdev lookup

Add sh7723 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7722 div4 clkdev lookup
Magnus Damm [Tue, 11 May 2010 07:05:17 +0000 (07:05 +0000)]
sh: sh7722 div4 clkdev lookup

Add sh7722 DIV4 clocks to the clkdev lookup list.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: div4 reparent workaround
Magnus Damm [Tue, 11 May 2010 07:05:09 +0000 (07:05 +0000)]
sh: div4 reparent workaround

Update the div4 set_parent() callback to use the
flags instead of name to determine parent index.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: get rid of mstp32 clock name and id
Magnus Damm [Tue, 11 May 2010 05:00:47 +0000 (05:00 +0000)]
sh: get rid of mstp32 clock name and id

Remove the name and the id from SH_CLK_MSTP32().
Now when lookups are handled by clkdev they are
not needed anymore.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7786 mstp32 clkdev lookup
Magnus Damm [Tue, 11 May 2010 05:00:38 +0000 (05:00 +0000)]
sh: sh7786 mstp32 clkdev lookup

Add sh7786 MSTP clocks to the clkdev lookup table.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7786 mstp32 index rework
Magnus Damm [Tue, 11 May 2010 05:00:30 +0000 (05:00 +0000)]
sh: sh7786 mstp32 index rework

This patch adds sh7786 MSTP enums for mstp_clks[] index.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7785 mstp32 clkdev lookup
Magnus Damm [Tue, 11 May 2010 05:00:22 +0000 (05:00 +0000)]
sh: sh7785 mstp32 clkdev lookup

Add sh7785 MSTP clocks to the clkdev lookup table.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7785 mstp32 index rework
Magnus Damm [Tue, 11 May 2010 05:00:14 +0000 (05:00 +0000)]
sh: sh7785 mstp32 index rework

This patch adds sh7785 MSTP enums for mstp_clks[] index.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7366 mstp32 clkdev lookup
Magnus Damm [Tue, 11 May 2010 05:00:06 +0000 (05:00 +0000)]
sh: sh7366 mstp32 clkdev lookup

Add sh7366 MSTP clocks to the clkdev lookup table.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7366 mstp32 index rework
Magnus Damm [Tue, 11 May 2010 04:59:58 +0000 (04:59 +0000)]
sh: sh7366 mstp32 index rework

This patch adds sh7366 MSTP enums for mstp_clks[] index.
The MSTP bit for the SIU is removed as well since it is
not included in the documentation. Most likely an old
copy paste error from sh7722.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7343 mstp32 clkdev lookup
Magnus Damm [Tue, 11 May 2010 04:59:50 +0000 (04:59 +0000)]
sh: sh7343 mstp32 clkdev lookup

Add sh7343 MSTP clocks to the clkdev lookup table.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7343 mstp32 index rework
Magnus Damm [Tue, 11 May 2010 04:59:43 +0000 (04:59 +0000)]
sh: sh7343 mstp32 index rework

This patch adds sh7343 MSTP enums for mstp_clks[] index.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoMerge branches 'sh/clkfwk' and 'sh/kexec'
Paul Mundt [Tue, 11 May 2010 02:53:11 +0000 (11:53 +0900)]
Merge branches 'sh/clkfwk' and 'sh/kexec'

14 years agosh: clkfwk: Use debugfs_remove_recursive() for rewinding
Hiroshi DOYU [Mon, 10 May 2010 11:50:55 +0000 (14:50 +0300)]
sh: clkfwk: Use debugfs_remove_recursive() for rewinding

Rewinding each debugfs entries to unregister if an error happens.

Based on the commit ca4caa4e1d45f9542fa54263974d0ef637157b4a

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: get rid of div6 clock names
Magnus Damm [Mon, 10 May 2010 14:02:09 +0000 (14:02 +0000)]
sh: get rid of div6 clock names

Get rid of div6 clock names on
sh7343/sh7366/sh7722/sh7723/sh7724

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: tie in div6 clocks using clkdev
Magnus Damm [Mon, 10 May 2010 14:01:55 +0000 (14:01 +0000)]
sh: tie in div6 clocks using clkdev

Use clkdev for div6 lookup on SH-Mobile processors:
sh7343/sh7366/sh7722/sh7723/sh7724

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: get rid of hwblk clock names
Magnus Damm [Mon, 10 May 2010 14:01:44 +0000 (14:01 +0000)]
sh: get rid of hwblk clock names

Remove the clock name from sh7722/sh7723/sh7724
hwblk clocks. Lookup is handled by clkdev.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: allow registering clocks without name
Magnus Damm [Mon, 10 May 2010 14:01:34 +0000 (14:01 +0000)]
sh: allow registering clocks without name

Modify the SuperH clock code to support struct clk
with NULL as name. Such clocks will not be hooked
up to debugfs.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: tie in hwblk clocks using clkdev
Magnus Damm [Mon, 10 May 2010 14:01:22 +0000 (14:01 +0000)]
sh: tie in hwblk clocks using clkdev

Use clkdev for lookup of hwblk clocks on
sh7722/sh7723/sh7724.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: scif and tmu clkdev changes
Magnus Damm [Mon, 10 May 2010 14:01:12 +0000 (14:01 +0000)]
sh: scif and tmu clkdev changes

Modify sh7722/sh7723/sh7724 to use clkdev for
TMU and SCIF clock lookups.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: hwblk index rework
Magnus Damm [Mon, 10 May 2010 14:01:02 +0000 (14:01 +0000)]
sh: hwblk index rework

Rework the sh7722/sh7723/sh7724 hwblk code to use the
hwblk id as index in the mstp clock array.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: shuffle the elfcorehdr handling over to the crash dump code.
Paul Mundt [Fri, 7 May 2010 08:58:55 +0000 (17:58 +0900)]
sh: shuffle the elfcorehdr handling over to the crash dump code.

The elfcorehdr parsing was just tossed in setup.c, but nothing outside of
the crash dump code/vmcore bits require it, so we just move it out of the
way, as per ppc.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Ensure that X2 TLB settings are reflected in vmcore.
Paul Mundt [Fri, 7 May 2010 08:14:00 +0000 (17:14 +0900)]
sh: Ensure that X2 TLB settings are reflected in vmcore.

This rolls in the X2TLB config settings for vmcore.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: flag kdump as broken on SMP for now.
Paul Mundt [Fri, 7 May 2010 07:39:09 +0000 (16:39 +0900)]
sh: flag kdump as broken on SMP for now.

There's still quite a bit of shootdown logic that needs to be hacked up
to support SMP for kdump properly, so just add in a BROKEN_ON_SMP
dependency for now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Make initrd detection more robust.
Paul Mundt [Thu, 6 May 2010 06:09:45 +0000 (15:09 +0900)]
sh: Make initrd detection more robust.

Various boot loaders go to various extents to thwart the initrd detection
logic (mostly on account of not being able to be bothered with adhering
to the established boot ABI), so we make the detection logic a bit more
robust. This makes it possible to work around the SDK7786's firmware's
attempts to thwart compressed image booting. Victory is mine.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: native_cpu_disable() build error when CONFIG_HOTPLUG_CPU=n
Matt Fleming [Wed, 28 Apr 2010 11:11:30 +0000 (11:11 +0000)]
sh: native_cpu_disable() build error when CONFIG_HOTPLUG_CPU=n

arch/sh/kernel/smp.c:164: error: conflicting types for 'native_cpu_disable'
/home/matt/src/kernels/sh-2.6/arch/sh/include/asm/smp.h:48: error: previous declaration of 'native_cpu_disable' was here

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: add CONFIG_VIRTUALIZATION for virtio support
Magnus Damm [Wed, 28 Apr 2010 05:46:11 +0000 (05:46 +0000)]
sh: add CONFIG_VIRTUALIZATION for virtio support

Add CONFIG_VIRTUALIZATION to the SH architecture
and include the virtio code there. Used to enable
the virtio drivers under QEMU.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: make latencytop available on SMP, too.
Paul Mundt [Tue, 27 Apr 2010 07:41:12 +0000 (16:41 +0900)]
sh: make latencytop available on SMP, too.

The UP dependency was inherited from ARM, which seems to have run in to
it due to the stacktrace code not being available for SMP in certain
cases, as we don't have this particular limitation there is no specific
need to block on the SMP dependency.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoMerge branch 'sh/smp'
Paul Mundt [Mon, 26 Apr 2010 10:11:51 +0000 (19:11 +0900)]
Merge branch 'sh/smp'

14 years agosh: CPU hotplug support for SH-X3 SMP.
Paul Mundt [Mon, 26 Apr 2010 10:09:57 +0000 (19:09 +0900)]
sh: CPU hotplug support for SH-X3 SMP.

This wires up CPU hotplug for SH-X3 SMP CPUs. Presently only secondary
cores can be hotplugged given that the boot CPU has to contend with the
broadcast timer. When real local timers are implemented this restriction
can be lifted.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: CPU hotplug support.
Paul Mundt [Mon, 26 Apr 2010 10:08:55 +0000 (19:08 +0900)]
sh: CPU hotplug support.

This adds preliminary support for CPU hotplug for SH SMP systems.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: cache secondary CPUs idle loop.
Paul Mundt [Mon, 26 Apr 2010 09:59:47 +0000 (18:59 +0900)]
sh: cache secondary CPUs idle loop.

This provides a cache of the secondary CPUs idle loop for the cases where
hotplug simply enters a low power state instead of resetting or powering
off the core.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: flag smp_store_cpu_info() __cpuinit.
Paul Mundt [Mon, 26 Apr 2010 09:55:01 +0000 (18:55 +0900)]
sh: flag smp_store_cpu_info() __cpuinit.

smp_store_cpu_info() is presently flagged as __init, but is called by
start_secondary() which is __cpuinit, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: provide percpu CPU states for hotplug notifiers.
Paul Mundt [Mon, 26 Apr 2010 09:49:58 +0000 (18:49 +0900)]
sh: provide percpu CPU states for hotplug notifiers.

This provides percpu CPU states in preparation for CPU hotplug and the
associated notifier chains.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Make sure all SH-X3 cores are populated in the present CPU map.
Paul Mundt [Mon, 26 Apr 2010 09:44:04 +0000 (18:44 +0900)]
sh: Make sure all SH-X3 cores are populated in the present CPU map.

This iterates over the maximum number of CPUs we plan to support and
makes sure they're all set in the present CPU map.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: convert online CPU map twiddling to cpumask.
Paul Mundt [Mon, 26 Apr 2010 09:39:50 +0000 (18:39 +0900)]
sh: convert online CPU map twiddling to cpumask.

This converts from cpu_set() for the online map to set_cpu_online().
The two online map modifiers were the last remaining manual map
manipulation bits, with this in place everything now goes through
cpumask.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: arch/sh/kernel/setup.c needs asm/smp.h.
Paul Mundt [Mon, 26 Apr 2010 09:35:44 +0000 (18:35 +0900)]
sh: arch/sh/kernel/setup.c needs asm/smp.h.

With the platform ops migration, the definitions still need to be
included in the CONFIG_SMP=n case, so make the asm/smp.h include
explicit.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Flag present CPUs hotpluggable in topology registration.
Paul Mundt [Mon, 26 Apr 2010 09:20:29 +0000 (18:20 +0900)]
sh: Flag present CPUs hotpluggable in topology registration.

When registering CPUs in the topology initialization ensure that all of
the present CPUs are flagged as hotpluggable.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: mach-sdk7786: update defconfig for compressed kernel image.
Paul Mundt [Mon, 26 Apr 2010 08:45:34 +0000 (17:45 +0900)]
sh: mach-sdk7786: update defconfig for compressed kernel image.

Now that compressed image loading is possible for sdk7786, drop the
vmlinux.bin default image target and update the defconfig accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Kill off dangling goto labels from oom-killer rework.
Paul Mundt [Mon, 26 Apr 2010 07:15:17 +0000 (16:15 +0900)]
sh: Kill off dangling goto labels from oom-killer rework.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoMerge branch 'sh/stable-updates'
Paul Mundt [Mon, 26 Apr 2010 07:08:27 +0000 (16:08 +0900)]
Merge branch 'sh/stable-updates'

Conflicts:
arch/sh/kernel/dwarf.c
drivers/dma/shdma.c

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoSH: fix error paths in DMA driver
Guennadi Liakhovetski [Mon, 19 Apr 2010 08:39:39 +0000 (08:39 +0000)]
SH: fix error paths in DMA driver

If channel allocation is failing, mark the channel unused and give PM a chance
to power down the hardware.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: sh7751 pci controller io port fix
Magnus Damm [Thu, 22 Apr 2010 06:21:10 +0000 (06:21 +0000)]
sh: sh7751 pci controller io port fix

This patch updates the sh7751 pci code to handle io ports
correctly. The code is based on the sh7788x implementation.

Tested on a R2D-1 board with CONFIG_8139TOO_PIO=y.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Fix maximum number of SCIF ports in R2D defconfigs
Magnus Damm [Thu, 22 Apr 2010 06:06:04 +0000 (06:06 +0000)]
sh: Fix maximum number of SCIF ports in R2D defconfigs

Update the R2D defconfigs to bump up the maximum
number of SCIF ports on the system.

Fixes a broken serial console regression added
by cd5f107628ab89c5dec5ad923f1c27f4cba41972.

Reported-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Alexandre Courbot <alex@dcl.info.waseda.ac.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoSH: fix TS field shift calculation for DMA drivers
Guennadi Liakhovetski [Wed, 21 Apr 2010 15:14:19 +0000 (15:14 +0000)]
SH: fix TS field shift calculation for DMA drivers

CHCR_TS_HIGH_SHIFT is defined as a shift of TS high bits in CHCR register,
relative to low bits. The TS_INDEX2VAL() macro has to take this into account.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/mfleming/sh-2.6
Paul Mundt [Mon, 26 Apr 2010 06:54:48 +0000 (15:54 +0900)]
Merge branch 'master' of /linux/kernel/git/mfleming/sh-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/mfleming/sh-2.6:
  sh: Use correct mask when comparing PMB DATA array values
  sh: Do not try merging two 128MB PMB mappings
  sh: Fix zImage load address when CONFIG_32BIT=y
  sh: Fix address to decompress at when CONFIG_32BIT=y
  sh: Assembly friendly __pa and __va definitions

14 years agoSH: constify multiple DMA related objects and references to them
Guennadi Liakhovetski [Wed, 21 Apr 2010 15:36:49 +0000 (15:36 +0000)]
SH: constify multiple DMA related objects and references to them

Lists of DMA channels and slaves are not changed, make them constant. Besides,
SH7724 channel and slave configuration of both DMA controllers is identical,
remove the extra copy of the configuration data.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: invoke oom-killer from page fault
Nick Piggin [Thu, 22 Apr 2010 16:06:26 +0000 (16:06 +0000)]
sh: invoke oom-killer from page fault

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-sh@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sun, 25 Apr 2010 23:28:56 +0000 (16:28 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  ipv6: Fix inet6_csk_bind_conflict()
  e100: Fix the TX workqueue race

14 years agoipv6: Fix inet6_csk_bind_conflict()
Eric Dumazet [Sun, 25 Apr 2010 22:09:42 +0000 (15:09 -0700)]
ipv6: Fix inet6_csk_bind_conflict()

Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
introduced a bug on IPV6 part.
We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
IPV6.

Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosh: Use correct mask when comparing PMB DATA array values
Matt Fleming [Sun, 25 Apr 2010 19:18:41 +0000 (20:18 +0100)]
sh: Use correct mask when comparing PMB DATA array values

Previously we were masking the PMB DATA array values with the value of
__MEMORY_START | PMB_V, which misses some PFN bits off the mask.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
14 years agosh: Do not try merging two 128MB PMB mappings
Matt Fleming [Sun, 25 Apr 2010 16:29:07 +0000 (17:29 +0100)]
sh: Do not try merging two 128MB PMB mappings

There is a logic error in pmb_merge() that means we will incorrectly try
to merge two 128MB PMB mappings into one mapping. However, 256MB isn't a
valid PMB map size and pmb_merge() will actually drop the second 128MB
mapping.

This patch allows my SDK7786 board to boot when configured with
CONFIG_MEMORY_SIZE=0x10000000.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
14 years agosh: Fix zImage load address when CONFIG_32BIT=y
Matt Fleming [Sat, 24 Apr 2010 12:34:44 +0000 (13:34 +0100)]
sh: Fix zImage load address when CONFIG_32BIT=y

We can't necessarily use the P1SEG region to access RAM when running in
32BIT mode, so use CONFIG_MEMORY_START as the base address.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
14 years agosh: Fix address to decompress at when CONFIG_32BIT=y
Matt Fleming [Sat, 24 Apr 2010 12:28:20 +0000 (13:28 +0100)]
sh: Fix address to decompress at when CONFIG_32BIT=y

When running in 32BIT mode the P1SEG region doesn't necessarily provide
a window onto RAM (it depends how the bootloader setup the PMB). The
correct location to place the decompressed kernel is the physical
address of _text.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
14 years agosh: Assembly friendly __pa and __va definitions
Matt Fleming [Sat, 24 Apr 2010 10:12:12 +0000 (11:12 +0100)]
sh: Assembly friendly __pa and __va definitions

This patch defines ___pa and ___va which return the physical and virtual
address of an address, respectively. These macros are suitable for
calling from assembly because they don't include the C casts required by
__pa and __va.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Sun, 25 Apr 2010 17:01:51 +0000 (10:01 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: Issue the discard operation *before* releasing the blocks to be reused
  ext4: Fix buffer head leaks after calls to ext4_get_inode_loc()
  ext4: Fix possible lost inode write in no journal mode

14 years agoe100: Fix the TX workqueue race
Alan Cox [Sun, 25 Apr 2010 04:09:29 +0000 (21:09 -0700)]
e100: Fix the TX workqueue race

Nothing stops the workqueue being left to run in parallel with close or a
few other operations. This causes double unmaps and the like.

See kerneloops.org #1041230 for an example

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Sat, 24 Apr 2010 18:35:21 +0000 (11:35 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] use max load in conservative governor
  [CPUFREQ] fix a lockdep warning

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sat, 24 Apr 2010 18:34:17 +0000 (11:34 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (22 commits)
  gianfar: Fix potential oops during OF address translation
  fsl_pq_mdio: Fix kernel oops during OF address translation
  tcp: bind() fix when many ports are bound
  rdma: potential ERR_PTR dereference
  rtnetlink: potential ERR_PTR dereference
  net: ipv6 bind to device issue
  ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
  drivers/net/usb: Add new driver ipheth
  cxgb3: fix linkup issue
  X25 fix dead unaccepted sockets
  KS8851: NULL pointer dereference if list is empty
  net: 3c574_cs fix stats.tx_bytes counter
  xfrm6: ensure to use the same dev when building a bundle
  can: Fix possible NULL pointer dereference in ems_usb.c
  net: Fix an RCU warning in dev_pick_tx()
  ipv6: Fix tcp_v6_send_response transport header setting.
  bridge: add a missing ntohs()
  8139too: Fix a typo in the function name.
  mac80211: pass HT changes to driver when off channel
  mac80211: remove bogus TX agg state assignment
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Sat, 24 Apr 2010 18:32:12 +0000 (11:32 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: Ensure we re-enable devices on resume
  x86/PCI: parse additional host bridge window resource types
  PCI: revert broken device warning
  PCI aerdrv: use correct bit defines and add 2ms delay to aer_root_reset
  x86/PCI: ignore Consumer/Producer bit in ACPI window descriptions

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platf...
Linus Torvalds [Sat, 24 Apr 2010 18:31:57 +0000 (11:31 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  eeepc-laptop: add missing sparse_keymap_free
  eeepc-wmi: Build fix
  asus: don't modify bluetooth/wlan on boot
  dell-wmi: Fix memory leak
  eeepc-wmi: add backlight support
  eeepc-wmi: use a platform device as parent device of all sub-devices
  eeepc-wmi: add an eeepc_wmi context structure

14 years agoinitramfs: handle unrecognised decompressor when unpacking
Phillip Lougher [Fri, 23 Apr 2010 17:18:11 +0000 (13:18 -0400)]
initramfs: handle unrecognised decompressor when unpacking

The unpack routine fails to handle the decompress_method() returning
unrecognised decompressor (compress_name == NULL).  This results in the
routine looping eventually oopsing on an out of bounds memory access.

Note this bug is usually hidden, only triggering on trailing junk after
one or more correct compressed blocks.  The case of the compressed archive
being complete junk is (by accident?) caught by the if (state != Reset)
check because state is initialised to Start, but not updated due to the
decompressor not having been called.  Obviously if the junk is trailing a
correctly decompressed buffer, state == Reset from the previous call to
the decompressor.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoksm: check for ERR_PTR from follow_page()
Dan Carpenter [Fri, 23 Apr 2010 17:18:10 +0000 (13:18 -0400)]
ksm: check for ERR_PTR from follow_page()

The follow_page() function can potentially return -EFAULT so I added
checks for this.

Also I silenced an uninitialized variable warning on my version of gcc
(version 4.3.2).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Izik Eidus <ieidus@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoVMware Balloon driver
Dmitry Torokhov [Fri, 23 Apr 2010 17:18:08 +0000 (13:18 -0400)]
VMware Balloon driver

This is a standalone version of VMware Balloon driver.  Ballooning is a
technique that allows hypervisor dynamically limit the amount of memory
available to the guest (with guest cooperation).  In the overcommit
scenario, when hypervisor set detects that it needs to shuffle some
memory, it instructs the driver to allocate certain number of pages, and
the underlying memory gets returned to the hypervisor.  Later hypervisor
may return memory to the guest by reattaching memory to the pageframes and
instructing the driver to "deflate" balloon.

We are submitting a standalone driver because KVM maintainer (Avi Kivity)
expressed opinion (rightly) that our transport does not fit well into
virtqueue paradigm and thus it does not make much sense to integrate with
virtio.

There were also some concerns whether current ballooning technique is the
right thing.  If there appears a better framework to achieve this we are
prepared to evaluate and switch to using it, but in the meantime we'd like
to get this driver upstream.

We want to get the driver accepted in distributions so that users do not
have to deal with an out-of-tree module and many distributions have
"upstream first" requirement.

The driver has been shipping for a number of years and users running on
VMware platform will have it installed as part of VMware Tools even if it
will not come from a distribution, thus there should not be additional
risk in pulling the driver into mainline.  The driver will only activate
if host is VMware so everyone else should not be affected at all.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agofs/block_dev.c: fix performance regression in O_DIRECT|O_SYNC writes to block devices
Anton Blanchard [Fri, 23 Apr 2010 17:18:06 +0000 (13:18 -0400)]
fs/block_dev.c: fix performance regression in O_DIRECT|O_SYNC writes to block devices

We are seeing a large regression in database performance on recent
kernels.  The database opens a block device with O_DIRECT|O_SYNC and a
number of threads write to different regions of the file at the same time.

A simple test case is below.  I haven't defined DEVICE since getting it
wrong will destroy your data :) On an 3 disk LVM with a 64k chunk size we
see about 17MB/sec and only a few threads in IO wait:

procs  -----io---- -system-- -----cpu------
 r  b     bi    bo   in   cs us sy id wa st
 0  3      0 16170  656 2259  0  0 86 14  0
 0  2      0 16704  695 2408  0  0 92  8  0
 0  2      0 17308  744 2653  0  0 86 14  0
 0  2      0 17933  759 2777  0  0 89 10  0

Most threads are blocking in vfs_fsync_range, which has:

        mutex_lock(&mapping->host->i_mutex);
        err = fop->fsync(file, dentry, datasync);
        if (!ret)
                ret = err;
        mutex_unlock(&mapping->host->i_mutex);

commit 148f948ba877f4d3cdef036b1ff6d9f68986706a (vfs: Introduce new
helpers for syncing after writing to O_SYNC file or IS_SYNC inode) offers
some explanation of what is going on:

    Use these new helpers for syncing from generic VFS functions. This makes
    O_SYNC writes to block devices acquire i_mutex for syncing. If we really
    care about this, we can make block_fsync() drop the i_mutex and reacquire
    it before it returns.

Thanks Jan for such a good commit message!  As well as dropping i_mutex,
Christoph suggests we should remove the call to sync_blockdev():

> sync_blockdev is an overcomplicated alias for filemap_write_and_wait on
> the block device inode, which is exactly what we did just before calling
> into ->fsync

The patch below incorporates both suggestions. With it the testcase improves
from 17MB/s to 68M/sec:

procs  -----io---- -system-- -----cpu------
 r  b     bi    bo   in   cs us sy id wa st
 0  7      0 65536 1000 3878  0  0 70 30  0
 0 34      0 69632 1016 3921  0  1 46 53  0
 0 57      0 69632 1000 3921  0  0 55 45  0
 0 53      0 69640  754 4111  0  0 81 19  0

Testcase:

#define _GNU_SOURCE
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define NR_THREADS 64
#define BUFSIZE (64 * 1024)

#define DEVICE "/dev/mapper/XXXXXX"

#define ALIGN(VAL, SIZE) (((VAL)+(SIZE)-1) & ~((SIZE)-1))

static int fd;

static void *doit(void *arg)
{
unsigned long offset = (long)arg;
char *b, *buf;

b = malloc(BUFSIZE + 1024);
buf = (char *)ALIGN((unsigned long)b, 1024);
memset(buf, 0, BUFSIZE);

while (1)
pwrite(fd, buf, BUFSIZE, offset);
}

int main(int argc, char *argv[])
{
int flags = O_RDWR|O_DIRECT;
int i;
unsigned long offset = 0;

if (argc > 1 && !strcmp(argv[1], "O_SYNC"))
flags |= O_SYNC;

fd = open(DEVICE, flags);
if (fd == -1) {
perror("open");
exit(1);
}

for (i = 0; i < NR_THREADS-1; i++) {
pthread_t tid;
pthread_create(&tid, NULL, doit, (void *)offset);
offset += BUFSIZE;
}
doit((void *)offset);

return 0;
}

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolib/vsprintf.c: add missing EXPORT_SYMBOL(simple_strtoll)
Hans Verkuil [Fri, 23 Apr 2010 17:18:04 +0000 (13:18 -0400)]
lib/vsprintf.c: add missing EXPORT_SYMBOL(simple_strtoll)

Add a missing EXPORT_SYMBOL.

I must be the first person that wants to use this function :-)

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agow1: fix omap 1-wire driver compilation
Amit Kucheria [Fri, 23 Apr 2010 17:18:03 +0000 (13:18 -0400)]
w1: fix omap 1-wire driver compilation

Fixes the following error:

  drivers/w1/masters/omap_hdq.c: In function 'hdq_wait_for_flag':
  drivers/w1/masters/omap_hdq.c:137: error: implicit declaration of function 'schedule_timeout_uninterruptible'
  drivers/w1/masters/omap_hdq.c: In function 'hdq_write_byte':
  drivers/w1/masters/omap_hdq.c:177: error: 'TASK_UNINTERRUPTIBLE' undeclared (first use in this function)
  drivers/w1/masters/omap_hdq.c:177: error: (Each undeclared identifier is reported only once
  drivers/w1/masters/omap_hdq.c:177: error: for each function it appears in.)
  drivers/w1/masters/omap_hdq.c:177: error: implicit declaration of function 'schedule_timeout'
  drivers/w1/masters/omap_hdq.c: In function 'hdq_isr':
  drivers/w1/masters/omap_hdq.c:221: error: 'TASK_NORMAL' undeclared (first use in this function)
  drivers/w1/masters/omap_hdq.c: In function 'omap_hdq_break':
  drivers/w1/masters/omap_hdq.c:316: error: 'TASK_UNINTERRUPTIBLE' undeclared (first use in this function)

Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agormap: anon_vma_prepare() can leak anon_vma_chain
Oleg Nesterov [Fri, 23 Apr 2010 17:18:01 +0000 (13:18 -0400)]
rmap: anon_vma_prepare() can leak anon_vma_chain

If find_mergeable_anon_vma() succeeds but another thread installs
->anon_vma before we take ptl, then allocated == NULL but avc should be
freed.  Change the code to check avc != NULL to detect this case.

Also, a couple of whitespace changes to make the critical section more
visible.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agokeys: fix an RCU warning
David Howells [Fri, 23 Apr 2010 17:18:00 +0000 (13:18 -0400)]
keys: fix an RCU warning

Fix the following RCU warning:

  ===================================================
  [ INFO: suspicious rcu_dereference_check() usage. ]
  ---------------------------------------------------
  security/keys/request_key.c:116 invoked rcu_dereference_check() without protection!

This was caused by doing:

[root@andromeda ~]# keyctl newring fred @s
539196288
[root@andromeda ~]# keyctl request2 user a a 539196288
request_key: Required key not available

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolib: fix the use of LZO to decompress initramfs images
Albin Tonnerre [Fri, 23 Apr 2010 17:17:58 +0000 (13:17 -0400)]
lib: fix the use of LZO to decompress initramfs images

This patch fixes 2 issues with the LZO decompressor:

- It doesn't handle the case where a block isn't compressed at all.  In
  this case, calling lzo1x_decompress_safe will fail, so we need to just
  use memcpy() instead (the upstream LZO code does something similar)

- Since commit 54291362d2a5738e1b0495df2abcb9e6b0563a3f ("initramfs: add
  missing decompressor error check") , the decompressor return code is
  checked in the init/initramfs.c The LZO decompressor didn't return the
  expected value, causing the initramfs code to falsely believe a
  decompression error occured

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Tested-by: bert schulze <spambemyguest@googlemail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agohugetlb: fix infinite loop in get_futex_key() when backed by huge pages
Mel Gorman [Fri, 23 Apr 2010 17:17:56 +0000 (13:17 -0400)]
hugetlb: fix infinite loop in get_futex_key() when backed by huge pages

If a futex key happens to be located within a huge page mapped
MAP_PRIVATE, get_futex_key() can go into an infinite loop waiting for a
page->mapping that will never exist.

See https://bugzilla.redhat.com/show_bug.cgi?id=552257 for more details
about the problem.

This patch makes page->mapping a poisoned value that includes
PAGE_MAPPING_ANON mapped MAP_PRIVATE.  This is enough for futex to
continue but because of PAGE_MAPPING_ANON, the poisoned value is not
dereferenced or used by futex.  No other part of the VM should be
dereferencing the page->mapping of a hugetlbfs page as its page cache is
not on the LRU.

This patch fixes the problem with the test case described in the bugzilla.

[akpm@linux-foundation.org: mel cant spel]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Darren Hart <darren@dvhart.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agow1: w1 temp: fix negative termperature calculation
Ian Dall [Fri, 23 Apr 2010 17:17:53 +0000 (13:17 -0400)]
w1: w1 temp: fix negative termperature calculation

Fix regression caused by commit 507e2fbaaacb6f164b4125b87c5002f95143174b
("w1: w1 temp calculation overflow fix") whereby negative temperatures for
the DS18B20 are not converted properly.

When the temperature exceeds 32767 milli-degrees the temperature overflows
to -32768 millidegrees.  These are both well within the -55 - +125 degree
range for the sensor.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=12646

Signed-of-by: Ian Dall <ian@beware.dropbear.id.au>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Tested-by: Karsten Elfenbein <kelfe@gmx.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>