]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agoMerge branch 'devel-stable' into for-next
Russell King [Mon, 12 Sep 2011 07:56:38 +0000 (08:56 +0100)]
Merge branch 'devel-stable' into for-next

Conflicts:
arch/arm/mach-imx/mach-cpuimx27.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mm/dma-mapping.c

12 years agoMerge branches 'amba', 'fixes', 'gpio', 'io' (early part), 'misc', 'p2v', 'pgt' and...
Russell King [Mon, 12 Sep 2011 07:56:20 +0000 (08:56 +0100)]
Merge branches 'amba', 'fixes', 'gpio', 'io' (early part), 'misc', 'p2v', 'pgt' and 'pm' into for-next

12 years agoARM: 7087/2: mach-integrator: get timer frequency from clock
Linus Walleij [Thu, 8 Sep 2011 20:23:15 +0000 (21:23 +0100)]
ARM: 7087/2: mach-integrator: get timer frequency from clock

We already have a clock definition for the 24MHz clock in
the Integrator, use that instead of some unclear defines
from the platform.h header. Also delete the senseless
comment that the file shouldn't be edited, I just edited it
and the world didn't come to an end, so it's obviously
false. If anyone still has the mentioned ".s file" and the
s2h awk script generating that header, raise your hand
(and give me your files).

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7086/2: mach-integrator: modernize clock event registration
Linus Walleij [Thu, 8 Sep 2011 20:22:32 +0000 (21:22 +0100)]
ARM: 7086/2: mach-integrator: modernize clock event registration

Drop mult, shift and delta calculations and let the
clockevent core scale this as appropriate.

Set the minimum interval to 1 rather than 15 (0xf), there
is nothing in the data sheets I have indicating that 15
should be some minimum value.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7085/2: mach-integrator: clockevent supports oneshot mode
Linus Walleij [Thu, 8 Sep 2011 20:21:42 +0000 (21:21 +0100)]
ARM: 7085/2: mach-integrator: clockevent supports oneshot mode

The Integrator AP timer has no problem supporting oneshot
ticks with proper code, so let's do it so we can have
NOHZ configured in for this platform too.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7084/1: mach-integrator: retire some timer macros
Linus Walleij [Thu, 8 Sep 2011 08:11:40 +0000 (09:11 +0100)]
ARM: 7084/1: mach-integrator: retire some timer macros

These macros are not used by anything since the switch to
generic time in commit b9cedda230793cbf58eb012ddadedd490cc8e129
so let's retire them.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7078/1: Footbridge: Sort KConfig Options alphabetically
Peter Hüwe [Mon, 5 Sep 2011 20:03:02 +0000 (21:03 +0100)]
ARM: 7078/1: Footbridge: Sort KConfig Options alphabetically

As per request of rmk, the options should be sorted alphabetically.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7026/1: simpad: replace ARM specific LED code
Jochen Friedrich [Thu, 18 Aug 2011 20:51:39 +0000 (21:51 +0100)]
ARM: 7026/1: simpad: replace ARM specific LED code

Remove the legacy ARM LED code for simpad devices and
register a stadard LED platform device using GPIO line
instead.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7025/1: simpad: add GPIO based device definitions.
Jochen Friedrich [Thu, 18 Aug 2011 20:51:06 +0000 (21:51 +0100)]
ARM: 7025/1: simpad: add GPIO based device definitions.

Register keyboard, polled keyboard and I2C platform
devices based on GPIOs.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7024/1: simpad: Cleanup CS3 accessors.
Jochen Friedrich [Thu, 18 Aug 2011 20:50:31 +0000 (21:50 +0100)]
ARM: 7024/1: simpad: Cleanup CS3 accessors.

- prepend CS3 accessors by simpad_ to indicate they
  are specific to simpad devices.
- use spinlock to protect shadow register.
- implement 8 read-only pins.
- use readl/writel macros so barriers are used where
  necessary.
- register CS3 as GPIO controller with 24 pins
  (16 output only and 8 input only).
- fix PCMCIA driver to access the read-only pins
  rather than the shadow register for status bits.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7027/1: simpad: Add ucb1x00 GPIO definitions and register GPIO
Jochen Friedrich [Thu, 18 Aug 2011 20:53:57 +0000 (21:53 +0100)]
ARM: 7027/1: simpad: Add ucb1x00 GPIO definitions and register GPIO

Add ucb1x00 GPIO definitions to simpad.h and add gpio_base
to ucb1x00 platform device so the pins are available using
the GPIO API.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7082/1: platform_device: pdev_archdata: add omap_device pointer
Kevin Hilman [Tue, 6 Sep 2011 20:04:10 +0000 (21:04 +0100)]
ARM: 7082/1: platform_device: pdev_archdata: add omap_device pointer

Add omap_device pointer to the ARM-specific arch data in the
platform_device.  This will be used to attach OMAP-specific
device-data to the platform device with device lifetime.

Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7017/1: Use generic BUG() handler
Simon Glass [Tue, 16 Aug 2011 22:44:26 +0000 (23:44 +0100)]
ARM: 7017/1: Use generic BUG() handler

ARM uses its own BUG() handler which makes its output slightly different
from other archtectures.

One of the problems is that the ARM implementation doesn't report the function
with the BUG() in it, but always reports the PC being in __bug(). The generic
implementation doesn't have this problem.

Currently we get something like:

kernel BUG at fs/proc/breakme.c:35!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
...
PC is at __bug+0x20/0x2c

With this patch it displays:

kernel BUG at fs/proc/breakme.c:35!
Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP
...
PC is at write_breakme+0xd0/0x1b4

This implementation uses an undefined instruction to implement BUG, and sets up
a bug table containing the relevant information. Many versions of gcc do not
support %c properly for ARM (inserting a # when they shouldn't) so we work
around this using distasteful macro magic.

v1: Initial version to replace existing ARM BUG() implementation with something
more similar to other architectures.

v2: Add Thumb support, remove backtrace whitespace output changes. Change to
use macros instead of requiring the asm %d flag to work (thanks to
Dave Martin <dave.martin@linaro.org>)

v3: Remove old BUG() implementation in favor of this one.
Remove the Backtrace: message (will submit this separately).
Use ARM_EXIT_KEEP() so that some architectures can dump exit text at link time
thanks to Stephen Boyd <sboyd@codeaurora.org> (although since we always
define GENERIC_BUG this might be academic.)
Rebase to linux-2.6.git master.

v4: Allow BUGS in modules (these were not reported correctly in v3)
(thanks to Stephen Boyd <sboyd@codeaurora.org> for suggesting that.)
Remove __bug() as this is no longer needed.

v5: Add %progbits as the section flags.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7073/1: debug: augment DEBUG_LL Kconfig help to clarify behaviour
Will Deacon [Thu, 1 Sep 2011 18:04:44 +0000 (19:04 +0100)]
ARM: 7073/1: debug: augment DEBUG_LL Kconfig help to clarify behaviour

Enabled DEBUG_LL hardcodes the UART address into the kernel and results
in a non-portable kernel image. Since this option is only intended for
use when debugging early boot failures, supporting multiple platforms
in such a configuration is not the intended use-case.

This patch documents this limitation in the DEBUG_LL Kconfig help text,
so that users are aware of the portability restrictions that are associated
with enabling low-level debugging support.

Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7072/1: debug: use kconfig choice for selecting DEBUG_LL UART
Will Deacon [Thu, 1 Sep 2011 17:58:51 +0000 (18:58 +0100)]
ARM: 7072/1: debug: use kconfig choice for selecting DEBUG_LL UART

Enabling CONFIG_DEBUG_LL (which is required for earlyprintk) hardwires
the debug UART address into the kernel, so that we can print before the
platform is initialised.

If the user inadvertently selects multiple platforms with DEBUG_LL
enabled, the UART address may not be correct and will likely cause the
kernel to hang in the very early stages of boot.

This patch, based on a skeleton from Russell, uses a Kconfig choice for
selecting the DEBUG_LL UART, therefore allowing the user to make a
choice about the supported platform when DEBUG_LL is enabled.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7068/1: process: change from __backtrace to dump_stack in show_regs
Laura Abbott [Wed, 31 Aug 2011 01:04:06 +0000 (02:04 +0100)]
ARM: 7068/1: process: change from __backtrace to dump_stack in show_regs

Currently, show_regs calls __backtrace which does
nothing if CONFIG_FRAME_POINTER is not set. Switch to
dump_stack which handles both CONFIG_FRAME_POINTER and
CONFIG_ARM_UNWIND correctly.

__backtrace is now superseded by dump_stack in general
and show_regs was the last caller so remove __backtrace
as well.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7064/1: vexpress: Use wfi macro in platform_do_lowpower.
Nick Bowler [Wed, 24 Aug 2011 17:55:37 +0000 (18:55 +0100)]
ARM: 7064/1: vexpress: Use wfi macro in platform_do_lowpower.

Current Versatile Express CPU hotplug code includes a hardcoded WFI
instruction, in ARM encoding.  When the kernel is compiled in Thumb-2
mode, this is invalid and causes the machine to hang hard when a CPU
is offlined.

Using the wfi macro (which uses the appropriate assembler mnemonic)
causes the correct instruction to be emitted in either case.  As a
consequence of this change, an apparently vestigial "cc" clobber is
dropped from the asm (the macro uses "memory" only).

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7061/1: gic: convert logical CPU numbers into physical numbers
Will Deacon [Tue, 23 Aug 2011 21:20:03 +0000 (22:20 +0100)]
ARM: 7061/1: gic: convert logical CPU numbers into physical numbers

The GIC driver must convert logical CPU numbers passed in from Linux
into physical CPU numbers that are understood by the hardware.

This patch uses the new cpu_logical_map macro for performing the
conversion inside the GIC driver.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7060/1: smp: populate logical CPU mapping during boot
Will Deacon [Tue, 23 Aug 2011 21:19:29 +0000 (22:19 +0100)]
ARM: 7060/1: smp: populate logical CPU mapping during boot

To allow booting Linux on a CPU with physical ID != 0, we need to
provide a mapping from the logical CPU number to the physical CPU
number.

This patch adds such a mapping and populates it during boot.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7031/1: entry: Fix Thumb-2 undef handling for multi-CPU kernels
Dave Martin [Fri, 19 Aug 2011 17:00:08 +0000 (18:00 +0100)]
ARM: 7031/1: entry: Fix Thumb-2 undef handling for multi-CPU kernels

When v6 and >=v7 boards are supported in the same kernel, the
__und_usr code currently makes a build-time assumption that Thumb-2
instructions occurring in userspace don't need to be supported.
Strictly speaking this is incorrect.

This patch fixes the above case by doing a run-time check on the
CPU architecture in these cases.  This only affects kernels which
support v6 and >=v7 CPUs together: plain v6 and plain v7 kernels
are unaffected.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Reviewed-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7030/1: entry: Remove unnecessary masking when decoding Thumb-2 instructions
Dave Martin [Fri, 19 Aug 2011 16:59:27 +0000 (17:59 +0100)]
ARM: 7030/1: entry: Remove unnecessary masking when decoding Thumb-2 instructions

When testing whether a Thumb-2 instruction is 32 bits long or not,
the masking done in order to test bits 11-15 of the first
instruction halfword won't affect the result of the comparison, so
remove it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Reviewed-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7029/1: Make cpu_architecture into a global variable
Dave Martin [Fri, 19 Aug 2011 16:58:35 +0000 (17:58 +0100)]
ARM: 7029/1: Make cpu_architecture into a global variable

The CPU architecture really should not be changing at runtime, so
make it a global variable instead of a function.

The cpu_architecture() function declared in <asm/system.h> remains
the correct way to read this variable from C code.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Reviewed-by: Jon Medhurst <tixy@yxit.co.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7022/1: allow to detect conflicting zreladdrs
Sascha Hauer [Wed, 17 Aug 2011 13:24:52 +0000 (14:24 +0100)]
ARM: 7022/1: allow to detect conflicting zreladdrs

Boards used to specify zreladdr in their Makefile.boot with
zreladdr-y := x, so conflicting zreladdrs were silently overwritten.
This patch changes this to zreladdr-y += x, so that we end
up with multiple words in zreladdr in such a case. We can
detect this later and complain if necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7021/1: Check for multiple load addresses before building a uImage
Sascha Hauer [Wed, 17 Aug 2011 13:23:46 +0000 (14:23 +0100)]
ARM: 7021/1: Check for multiple load addresses before building a uImage

uImages need a load address specified. This makes them
incompatible with multiple zreladdrs. Catch this error
before building an uImage so that we do not end up with
broken uImages. The load address can still be specified
with LOADADDR= on the command line.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7020/1: Check for multiple zreladdrs
Sascha Hauer [Wed, 17 Aug 2011 13:22:11 +0000 (14:22 +0100)]
ARM: 7020/1: Check for multiple zreladdrs

Without CONFIG_AUTO_ZRELADDR being set the kernel needs a single
zreladdr for building zImages. Bail out if we detect multiple
zreladdrs without CONFIG_AUTO_ZRELADDR.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7006/1: Migrate to asm-generic wrapper support
Stephen Boyd [Tue, 26 Jul 2011 17:45:54 +0000 (18:45 +0100)]
ARM: 7006/1: Migrate to asm-generic wrapper support

With d8ecc5c (kbuild: asm-generic support, 2011-04-27) we can
remove a handful of asm-generic wrappers in ARM code. Since the
generic version of sizes.h doesn't contain SZ_48M, we replace
the 4 users of SZ_48M with the equivalent SZ_32M + SZ_16M.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Imre Kaloz <kaloz@openwrt.org>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7009/1: l2x0: Add OF based initialization
Rob Herring [Wed, 3 Aug 2011 17:12:05 +0000 (18:12 +0100)]
ARM: 7009/1: l2x0: Add OF based initialization

This adds probing for ARM L2x0 cache controllers via device tree. Support
includes the L210, L220, and PL310 controllers. The binding allows setting
up cache RAM latencies and filter addresses (PL310 only).

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7011/1: Add ARM cpu topology definition
Vincent Guittot [Mon, 8 Aug 2011 12:21:59 +0000 (13:21 +0100)]
ARM: 7011/1: Add ARM cpu topology definition

The affinity between ARM processors is defined in the MPIDR register.
We can identify which processors are in the same cluster,
and which ones have performance interdependency. We can define the
cpu topology of ARM platform, that is then used by sched_mc and sched_smt.

The default state of sched_mc and sched_smt config is disable.
When enabled, the behavior of the scheduler can be modified with
sched_mc_power_savings and sched_smt_power_savings sysfs interfaces.

Changes since v4 :
*  Remove unnecessary parentheses and blank lines

Changes since v3 :
* Update the format of printk message
* Remove blank line

Changes since v2 :
* Update the commit message and some comments

Changes since v1 :
* Update the commit message
* Add read_cpuid_mpidr in arch/arm/include/asm/cputype.h
* Modify header of arch/arm/kernel/topology.c
* Modify tests and manipulation of MPIDR's bitfields
* Modify the place and dependancy of the config
* Modify Noop functions

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge branch 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur...
Linus Torvalds [Sun, 11 Sep 2011 00:28:46 +0000 (17:28 -0700)]
Merge branch 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm

* 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm:
  ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort
  ARM: 7080/1: l2x0: make sure I&D are not locked down on init
  ARM: 7081/1: mach-integrator: fix the clocksource
  NET: am79c961: fix race in link status code
  ARM: 7067/1: mm: keep significant bits in pfn_valid

12 years agoARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort
Janusz Krzysztofik [Thu, 8 Sep 2011 17:45:40 +0000 (18:45 +0100)]
ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort

Commit be020f8618ca, "ARM: entry: abort-macro: specify registers to be
used for macros", while replacing register numbers with macro parameter
names, mismatched the name used for r1. For me, this resulted in user
space built for EABI with -march=armv4t -mtune=arm920t -mthumb-interwork
-mthumb broken on my OMAP1510 based Amstrad Delta (old ABI and no thumb
still worked for me though).

Fix this by using correct parameter name fsr instead of mismatched psr,
used by callers for another purpose.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agobacklight: Declare backlight_types[] const
Bart Van Assche [Sat, 10 Sep 2011 18:13:01 +0000 (20:13 +0200)]
backlight: Declare backlight_types[] const

Since backlight_types[] isn't modified, let's declare it const.  That
was probably the intention of the author of commit bb7ca747f8d6
("backlight: add backlight type"), via which the "const char const *"
construct was introduced.  The duplicate const was detected by sparse.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Sat, 10 Sep 2011 17:19:15 +0000 (10:19 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
  md/raid1,10: Remove use-after-free bug in make_request.
  md/raid10: unify handling of write completion.
  Avoid dereferencing a 'request_queue' after last close.

12 years agomd: Fix handling for devices from 2TB to 4TB in 0.90 metadata.
NeilBrown [Sat, 10 Sep 2011 07:21:28 +0000 (17:21 +1000)]
md: Fix handling for devices from 2TB to 4TB in 0.90 metadata.

0.90 metadata uses an unsigned 32bit number to count the number of
kilobytes used from each device.
This should allow up to 4TB per device.
However we multiply this by 2 (to get sectors) before casting to a
larger type, so sizes above 2TB get truncated.

Also we allow rdev->sectors to be larger than 4TB, so it is possible
for the array to be resized larger than the metadata can handle.
So make sure rdev->sectors never exceeds 4TB when 0.90 metadata is in
used.

Also the sanity check at the end of super_90_load should include level
1 as it used ->size too. (RAID0 and Linear don't use ->size at all).

Reported-by: Pim Zandbergen <P.Zandbergen@macroscoop.nl>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid1,10: Remove use-after-free bug in make_request.
NeilBrown [Sat, 10 Sep 2011 07:21:23 +0000 (17:21 +1000)]
md/raid1,10: Remove use-after-free bug in make_request.

A single request to RAID1 or RAID10 might result in multiple
requests if there are known bad blocks that need to be avoided.

To detect if we need to submit another write request we test:
  if (sectors_handled < (bio->bi_size >> 9)) {

However this is after we call **_write_done() so the 'bio' no longer
belongs to us - the writes could have completed and the bio freed.

So move the **_write_done call until after the test against
bio->bi_size.

This addresses https://bugzilla.kernel.org/show_bug.cgi?id=41862

Reported-by: Bruno Wolff III <bruno@wolff.to>
Tested-by: Bruno Wolff III <bruno@wolff.to>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomd/raid10: unify handling of write completion.
NeilBrown [Sat, 10 Sep 2011 07:21:17 +0000 (17:21 +1000)]
md/raid10: unify handling of write completion.

A write can complete at two different places:
1/ when the last member-device write completes, through
   raid10_end_write_request
2/ in make_request() when we remove the initial bias from ->remaining.

These two should do exactly the same thing and the comment says they
do, but they don't.

So factor the correct code out into a function and call it in both
places.  This makes the code much more similar to RAID1.

The difference is only significant if there is an error, and they
usually take a while, so it is unlikely that there will be an error
already when make_request is completing, so this is unlikely to cause
real problems.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAvoid dereferencing a 'request_queue' after last close.
NeilBrown [Sat, 10 Sep 2011 07:20:21 +0000 (17:20 +1000)]
Avoid dereferencing a 'request_queue' after last close.

On the last close of an 'md' device which as been stopped, the device
is destroyed and in particular the request_queue is freed.  The free
is done in a separate thread so it might happen a short time later.

__blkdev_put calls bdev_inode_switch_bdi *after* ->release has been
called.

Since commit f758eeabeb96f878c860e8f110f94ec8820822a9
bdev_inode_switch_bdi will dereference the 'old' bdi, which lives
inside a request_queue, to get a spin lock.  This causes the last
close on an md device to sometime take a spin_lock which lives in
freed memory - which results in an oops.

So move the called to bdev_inode_switch_bdi before the call to
->release.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoPCI: Remove MRRS modification from MPS setting code
Jon Mason [Thu, 8 Sep 2011 21:41:18 +0000 (16:41 -0500)]
PCI: Remove MRRS modification from MPS setting code

Modifying the Maximum Read Request Size to 0 (value of 128Bytes) has
massive negative ramifications on some devices.  Without knowing which
devices have this issue, do not modify from the default value when
walking the PCI-E bus in pcie_bus_safe mode.  Also, make pcie_bus_safe
the default procedure.

Tested-by: Sven Schnelle <svens@stackframe.org>
Tested-by: Simon Kirby <sim@hostway.ca>
Tested-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-and-tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-and-tested-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
References: https://bugzilla.kernel.org/show_bug.cgi?id=42162
Signed-off-by: Jon Mason <mason@myri.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix pointer dereference before call to pcie_bus_configure_settings
Shyam Iyer [Thu, 8 Sep 2011 21:41:17 +0000 (16:41 -0500)]
Fix pointer dereference before call to pcie_bus_configure_settings

Commit b03e7495a862 ("PCI: Set PCI-E Max Payload Size on fabric")
introduced a potential NULL pointer dereference in calls to
pcie_bus_configure_settings due to attempts to access pci_bus self
variables when the self pointer is NULL.

To correct this, verify that the self pointer in pci_bus is non-NULL
before dereferencing it.

Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: Jon Mason <mason@myri.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus' of git://dev.laptop.org/users/cjb/mmc
Linus Torvalds [Fri, 9 Sep 2011 22:50:25 +0000 (15:50 -0700)]
Merge branch 'for-linus' of git://dev.laptop.org/users/cjb/mmc

* 'for-linus' of git://dev.laptop.org/users/cjb/mmc:
  mmc: sdhci-s3c: Fix mmc card I/O problem
  mmc: sd: UHS-I bus speed should be set last in UHS initialization
  mmc: sdhi: initialise mmc_data->flags before use
  mmc: core: use non-reentrant workqueue for clock gating
  mmc: core: prevent aggressive clock gating racing with ios updates
  mmc: rename mmc_host_clk_{ungate|gate} to mmc_host_clk_{hold|release}
  mmc: sdhci-esdhc-imx: add missing inclusion of linux/module.h

12 years agoMerge branch 'for-linus' of git://ceph.newdream.net/git/ceph-client
Linus Torvalds [Fri, 9 Sep 2011 22:48:34 +0000 (15:48 -0700)]
Merge branch 'for-linus' of git://ceph.newdream.net/git/ceph-client

* 'for-linus' of git://ceph.newdream.net/git/ceph-client:
  libceph: fix leak of osd structs during shutdown
  ceph: fix memory leak
  ceph: fix encoding of ino only (not relative) paths
  libceph: fix msgpool

12 years agovfs: automount should ignore LOOKUP_FOLLOW
Miklos Szeredi [Mon, 5 Sep 2011 16:06:26 +0000 (18:06 +0200)]
vfs: automount should ignore LOOKUP_FOLLOW

Prior to 2.6.38 automount would not trigger on either stat(2) or
lstat(2) on the automount point.

After 2.6.38, with the introduction of the ->d_automount()
infrastructure, stat(2) and others would start triggering automount
while lstat(2), etc. still would not.  This is a regression and a
userspace ABI change.

Problem originally reported here:

  http://thread.gmane.org/gmane.linux.kernel.autofs/6098

It appears that there was an attempt at fixing various userspace tools
to not trigger the automount.  But since the stat system call is
rather common it is impossible to "fix" all userspace.

This patch reverts the original behavior, which is to not trigger on
stat(2) and other symlink following syscalls.

[ It's not really clear what the right behavior is.  Apparently Solaris
  does the "automount on stat, leave alone on lstat".  And some programs
  can get unhappy when "stat+open+fstat" ends up giving a different
  result from the fstat than from the initial stat.

  But the change in 2.6.38 resulted in problems for some people, so
  we're going back to old behavior.  Maybe we can re-visit this
  discussion at some future date  - Linus ]

Reported-by: Leonardo Chiquitto <leonardo.lists@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Ian Kent <raven@themaw.net>
Cc: David Howells <dhowells@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 8 Sep 2011 23:49:32 +0000 (16:49 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine/ste_dma40: fix memory leak due to prepared descriptors
  dmaengine/ste_dma40: fix Oops due to double free of client descriptor
  dmaengine/ste_dma40: remove duplicate call to d40_pool_lli_free().
  dmaengine/ste_dma40: add missing kernel doc for pending_queue

12 years agoMerge branch 'for-linus' of git://opensource.wolfsonmicro.com/regmap
Linus Torvalds [Thu, 8 Sep 2011 23:47:52 +0000 (16:47 -0700)]
Merge branch 'for-linus' of git://opensource.wolfsonmicro.com/regmap

* 'for-linus' of git://opensource.wolfsonmicro.com/regmap:
  regmap: Remove bitrotted module_put()s

12 years agoMerge branch 'for-linus' of git://twin.jikos.cz/jikos/hid
Linus Torvalds [Thu, 8 Sep 2011 23:45:37 +0000 (16:45 -0700)]
Merge branch 'for-linus' of git://twin.jikos.cz/jikos/hid

* 'for-linus' of git://twin.jikos.cz/jikos/hid:
  HID: wacom: Unregister sysfs attributes on remove
  HID: wacom: Fix error path of power-supply initialization
  HID: add support for HuiJia USB Gamepad connector
  HID: magicmouse: ignore 'ivalid report id' while switching modes, v2
  HID: magicmouse: Set resolution of touch surfaces

12 years agoMerge branch 'for-31-rc5/i2c-fixes' of git://git.fluff.org/bjdooks/linux
Linus Torvalds [Thu, 8 Sep 2011 23:42:34 +0000 (16:42 -0700)]
Merge branch 'for-31-rc5/i2c-fixes' of git://git.fluff.org/bjdooks/linux

* 'for-31-rc5/i2c-fixes' of git://git.fluff.org/bjdooks/linux:
  i2c-tegra: fix possible race condition after tx
  i2c-tegra: add I2C_FUNC_SMBUS_EMUL
  i2c-tegra: Add of_match_table
  i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths

12 years agoMerge branch 'amd/fixes' of git://git.8bytes.org/scm/iommu
Linus Torvalds [Thu, 8 Sep 2011 23:39:47 +0000 (16:39 -0700)]
Merge branch 'amd/fixes' of git://git.8bytes.org/scm/iommu

* 'amd/fixes' of git://git.8bytes.org/scm/iommu:
  iommu/amd: Don't take domain->lock recursivly
  iommu/amd: Make sure iommu->need_sync contains correct value

12 years agoregulator: fix kernel-doc warning in consumer.h
Randy Dunlap [Thu, 8 Sep 2011 17:16:47 +0000 (10:16 -0700)]
regulator: fix kernel-doc warning in consumer.h

Fix kernel-doc warning about internal/private data by marking it
as "private:" so that kernel-doc will ignore it.

  Warning(include/linux/regulator/consumer.h:128): No description found for parameter 'ret'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agowireless: fix kernel-doc warning in net/cfg80211.h
Randy Dunlap [Thu, 8 Sep 2011 17:16:50 +0000 (10:16 -0700)]
wireless: fix kernel-doc warning in net/cfg80211.h

Fix kernel-doc warning in net/cfg80211.h:

  Warning(include/net/cfg80211.h:1884): No description found for parameter 'registered'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoARM: 7083/1: rewrite U300 GPIO to use gpiolib
Linus Walleij [Thu, 8 Sep 2011 08:04:51 +0000 (09:04 +0100)]
ARM: 7083/1: rewrite U300 GPIO to use gpiolib

This rewrites the U300 GPIO so as to use gpiolib and
struct gpio_chip instead of just generic GPIO, hiding
all the platform specifics and passing in GPIO chip
variant as platform data at runtime instead of the
compiletime kludges.

As a result <mach/gpio.h> is now empty for U300 and
using just defaults.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Debian kernel maintainers <debian-kernel@lists.debian.org>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge branch 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip
Linus Torvalds [Wed, 7 Sep 2011 20:03:48 +0000 (13:03 -0700)]
Merge branch 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip

* 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip:
  rtc: twl: Fix registration vs. init order
  rtc: Initialized rtc_time->tm_isdst
  rtc: Fix RTC PIE frequency limit
  rtc: rtc-twl: Remove lockdep related local_irq_enable()
  rtc: rtc-twl: Switch to using threaded irq
  rtc: ep93xx: Fix 'rtc' may be used uninitialized warning
  alarmtimers: Avoid possible denial of service with high freq periodic timers
  alarmtimers: Memset itimerspec passed into alarm_timer_get
  alarmtimers: Avoid possible null pointer traversal

12 years agoMerge branch 'sched-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip
Linus Torvalds [Wed, 7 Sep 2011 20:01:34 +0000 (13:01 -0700)]
Merge branch 'sched-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip

* 'sched-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip:
  sched: Fix a memory leak in __sdt_free()
  sched: Move blk_schedule_flush_plug() out of __schedule()
  sched: Separate the scheduler entry for preemption

12 years agoMerge branch 'perf-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip
Linus Torvalds [Wed, 7 Sep 2011 20:00:11 +0000 (13:00 -0700)]
Merge branch 'perf-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip

* 'perf-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip:
  x86, perf: Check that current->mm is alive before getting user callchain
  perf_event: Fix broken calc_timer_values()
  perf events: Fix slow and broken cgroup context switch code

12 years agoMerge branch 'linux-next' of git://git.infradead.org/ubifs-2.6 and git://git.infradea...
Linus Torvalds [Wed, 7 Sep 2011 16:51:43 +0000 (09:51 -0700)]
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6 and git://git.infradead.org/ubi-2.6

* branch 'linux-next' of git://git.infradead.org/ubifs-2.6:
  UBIFS: not build debug messages with CONFIG_UBIFS_FS_DEBUG disabled

* branch 'linux-next' of git://git.infradead.org/ubi-2.6:
  UBI: do not link debug messages when debugging is disabled

12 years agoMerge branch 'hwmon-for-linus' of git://github.com/groeck/linux
Linus Torvalds [Wed, 7 Sep 2011 15:11:43 +0000 (08:11 -0700)]
Merge branch 'hwmon-for-linus' of git://github.com/groeck/linux

* 'hwmon-for-linus' of git://github.com/groeck/linux:
  hwmon: (ucd9000/ucd9200) Optimize array walk
  hwmon: (max16065) Add chip access warning to documentation
  hwmon: (max16065) Fix current calculation

12 years agoMerge branch 'for-linus' of git://github.com/ericvh/linux
Linus Torvalds [Wed, 7 Sep 2011 14:48:00 +0000 (07:48 -0700)]
Merge branch 'for-linus' of git://github.com/ericvh/linux

* 'for-linus' of git://github.com/ericvh/linux:
  fs/9p: Use protocol-defined value for lock/getlock 'type' field.
  fs/9p: Always ask new inode in lookup for cache mode disabled
  fs/9p: Add OS dependent open flags in 9p protocol
  net/9p: Fix kernel crash with msize 512K
  fs/9p: Don't update file type when updating file attributes
  fs/9p: Add fid before dentry instantiation

12 years agoMerge branch 'stable/bug.fixes' of git://oss.oracle.com/git/kwilk/xen
Linus Torvalds [Wed, 7 Sep 2011 14:46:48 +0000 (07:46 -0700)]
Merge branch 'stable/bug.fixes' of git://oss.oracle.com/git/kwilk/xen

* 'stable/bug.fixes' of git://oss.oracle.com/git/kwilk/xen:
  xen/smp: Warn user why they keel over - nosmp or noapic and what to use instead.
  xen: x86_32: do not enable iterrupts when returning from exception in interrupt context
  xen: use maximum reservation to limit amount of usable RAM

12 years agoMerge branch 'kvm-updates/3.1' of git://github.com/avikivity/kvm
Linus Torvalds [Wed, 7 Sep 2011 14:45:43 +0000 (07:45 -0700)]
Merge branch 'kvm-updates/3.1' of git://github.com/avikivity/kvm

* 'kvm-updates/3.1' of git://github.com/avikivity/kvm:
  KVM: Fix instruction size issue in pvclock scaling

12 years agoMerge branches 'upstream-fixes' and 'magicmouse' into for-linus
Jiri Kosina [Wed, 7 Sep 2011 11:53:17 +0000 (13:53 +0200)]
Merge branches 'upstream-fixes' and 'magicmouse' into for-linus

12 years agoHID: wacom: Unregister sysfs attributes on remove
David Herrmann [Mon, 5 Sep 2011 16:45:29 +0000 (18:45 +0200)]
HID: wacom: Unregister sysfs attributes on remove

HID devices can be hotplugged so we should unregister all sysfs attributes when
removing a driver. Otherwise, manually unloading the wacom-driver will not
remove the sysfs attributes. Only when the device is disconnected, they are
removed, eventually.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: wacom: Fix error path of power-supply initialization
David Herrmann [Mon, 5 Sep 2011 16:45:28 +0000 (18:45 +0200)]
HID: wacom: Fix error path of power-supply initialization

power_supply_unregister() must not be called if power_supply_register() failed.
The wdata->psy.dev pointer may point to invalid memory after a failed
power_supply_register() and hence wacom_remove() will fail while calling
power_supply_unregister().

This changes the wacom_probe function to fail if it cannot register the
power_supply devices. If we would want to keep the previous behaviour we had to
keep some flag about the power_supply state and check it on wacom_remove, but
this seems inappropriate here. Hence, we simply fail, too, if
power_supply_register fails.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoARM: 7077/1: LPAE: Use a mask for physical addresses in page table entries
Catalin Marinas [Mon, 5 Sep 2011 16:52:36 +0000 (17:52 +0100)]
ARM: 7077/1: LPAE: Use a mask for physical addresses in page table entries

With LPAE, the physical address mask is 40-bit while the page table
entry is 64-bit. This patch introduces PHYS_MASK for the 2-level page
table format, defined as ~0UL.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7076/1: LPAE: Add (pte|pmd)val_t type definitions as u32
Catalin Marinas [Mon, 5 Sep 2011 16:51:56 +0000 (17:51 +0100)]
ARM: 7076/1: LPAE: Add (pte|pmd)val_t type definitions as u32

This patch defines the (pte|pmd)val_t as u32 and changes the page table
types to be based on these. The PMD bits are converted to the
corresponding type using the _AT macro.

The flush_pmd_entry/clean_pmd_entry argument was changed to (void *) to
allow them to be used with both PGD and PMD pointers and avoid code
duplication.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7075/1: LPAE: Factor out 2-level page table definitions into separate files
Catalin Marinas [Mon, 5 Sep 2011 16:41:02 +0000 (17:41 +0100)]
ARM: 7075/1: LPAE: Factor out 2-level page table definitions into separate files

This patch moves page table definitions from asm/page.h, asm/pgtable.h
and asm/ptgable-hwdef.h into corresponding *-2level* files.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7080/1: l2x0: make sure I&D are not locked down on init
Linus Walleij [Tue, 6 Sep 2011 06:45:46 +0000 (07:45 +0100)]
ARM: 7080/1: l2x0: make sure I&D are not locked down on init

Fighting unfixed U-Boots and other beasts that may the cache in
a locked-down state when starting the kernel, we make sure to
disable all cache lock-down when initializing the l2x0 so we
are in a known state.

Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: Adrian Bunk <adrian.bunk@movial.com>
Cc: Rob Herring <robherring2@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reported-by: Jan Rinze <janrinze@gmail.com>
Tested-by: Robert Marklund <robert.marklund@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7081/1: mach-integrator: fix the clocksource
Linus Walleij [Tue, 6 Sep 2011 07:08:13 +0000 (08:08 +0100)]
ARM: 7081/1: mach-integrator: fix the clocksource

I was intrigued by the fact that the clock stood still on
the Integrator, but it wasn't strange at all, because the
timer was set up all wrong and probably has been for a
while. With this patch the clock starts ticking again:
make the timer periodic (reload), |= on the divisor bit
and load the timer before starting it.

Cc: stable@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7079/1: spi: Fix builderror in spi-pl022.c
Peter Hüwe [Mon, 5 Sep 2011 20:07:23 +0000 (21:07 +0100)]
ARM: 7079/1: spi: Fix builderror in spi-pl022.c

This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add
runtime PM support to core Primecell driver") which unfortunately was a little
bit incomplete and did contain a typo (11 instead of 22).
I'm not sure how this patch could have been tested back then, if it
doesn't even compile ;)

The build failure was:
drivers/spi/spi-pl022.c:2292: error: 'adev' undeclared (first use in
this function)
drivers/spi/spi-pl022.c:2344: error: 'pl022_suspend' undeclared here
(not in a function)

The build failure appears e.g. for the u8500 and realview defconfig.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoi2c-tegra: fix possible race condition after tx
Doug Anderson [Tue, 30 Aug 2011 17:46:10 +0000 (11:46 -0600)]
i2c-tegra: fix possible race condition after tx

In tegra_i2c_fill_tx_fifo, once we have finished pushing all the bytes
to the I2C hardware controller, the interrupt might happen before we
have updated i2c_dev->msg_buf_remaining at the end of the function.
Then, in tegra_i2c_isr, we will call again tegra_i2c_fill_tx_fifo
triggering weird behaviour. This has been shown to happen under real
conditions.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
12 years agoi2c-tegra: add I2C_FUNC_SMBUS_EMUL
Mike Rapoport [Tue, 30 Aug 2011 17:46:09 +0000 (11:46 -0600)]
i2c-tegra: add I2C_FUNC_SMBUS_EMUL

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
12 years agoi2c-tegra: Add of_match_table
John Bonesio [Tue, 30 Aug 2011 17:46:08 +0000 (11:46 -0600)]
i2c-tegra: Add of_match_table

This patch was intended to be part of 7ca2d1a105a239e300b937e9c41a10a4bd08f569
"i2c: Tegra: Add DeviceTree support". However, an early version of that patch,
which was missing a chunk, was applied to next-i2c. This change is that
missing chunk.

Signed-off-by: John Bonesio <bones@secretlab.ca>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
12 years agoi2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
Axel Lin [Tue, 30 Aug 2011 06:37:37 +0000 (14:37 +0800)]
i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
12 years agohwmon: (ucd9000/ucd9200) Optimize array walk
Jean Delvare [Wed, 31 Aug 2011 15:53:41 +0000 (11:53 -0400)]
hwmon: (ucd9000/ucd9200) Optimize array walk

Rewrite the loop walking the id array during probe. The new code is
better adapted to a null-terminated array, and is also clearer and
more efficient than the original.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Axel Lin <axel.lin@gmail.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agohwmon: (max16065) Add chip access warning to documentation
Guenter Roeck [Tue, 30 Aug 2011 05:53:20 +0000 (22:53 -0700)]
hwmon: (max16065) Add chip access warning to documentation

The chips supported by the max16065 driver should not be accessed using direct
i2ctools commands. Add warning to driver documentation to alert users.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
12 years agohwmon: (max16065) Fix current calculation
Guenter Roeck [Sun, 28 Aug 2011 20:01:49 +0000 (13:01 -0700)]
hwmon: (max16065) Fix current calculation

Current calculation is completely wrong. Add missing brackets to fix it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 3.0+
12 years agofs/9p: Use protocol-defined value for lock/getlock 'type' field.
Jim Garlick [Sat, 20 Aug 2011 18:51:18 +0000 (00:21 +0530)]
fs/9p: Use protocol-defined value for lock/getlock 'type' field.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agofs/9p: Always ask new inode in lookup for cache mode disabled
Aneesh Kumar K.V [Tue, 16 Aug 2011 16:49:28 +0000 (22:19 +0530)]
fs/9p: Always ask new inode in lookup for cache mode disabled

This make sure we don't end up reusing the unlinked inode object.
The ideal way is to use inode i_generation. But i_generation is
not available in userspace always.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agofs/9p: Add OS dependent open flags in 9p protocol
Aneesh Kumar K.V [Wed, 3 Aug 2011 14:25:32 +0000 (19:55 +0530)]
fs/9p: Add OS dependent open flags in 9p protocol

Some of the flags are OS/arch dependent we add a 9p
protocol value which maps to asm-generic/fcntl.h values in Linux
Based on the original patch from Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agonet/9p: Fix kernel crash with msize 512K
Aneesh Kumar K.V [Wed, 17 Aug 2011 16:56:04 +0000 (16:56 +0000)]
net/9p: Fix kernel crash with msize 512K

With msize equal to 512K (PAGE_SIZE * VIRTQUEUE_NUM), we hit multiple
crashes. This patch fix those.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
12 years agofs/9p: Don't update file type when updating file attributes
Aneesh Kumar K.V [Mon, 25 Jul 2011 18:06:33 +0000 (18:06 +0000)]
fs/9p: Don't update file type when updating file attributes

We should only update attributes that we can change on stat2inode.
Also do file type initialization in v9fs_init_inode.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
12 years agofs/9p: Add fid before dentry instantiation
Aneesh Kumar K.V [Mon, 25 Jul 2011 18:06:32 +0000 (18:06 +0000)]
fs/9p: Add fid before dentry instantiation

d_instantiate marks the dentry positive. So a parallel lookup and mkdir of
the directory can find dentry that doesn't have fid attached. This can result
in both the code path doing v9fs_fid_add which results in v9fs_dentry leak.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
12 years agoregmap: Remove bitrotted module_put()s
Mark Brown [Mon, 5 Sep 2011 15:07:47 +0000 (08:07 -0700)]
regmap: Remove bitrotted module_put()s

The conversion to per bus type registration functions means we don't need
to do module_get()s to hold the bus types in memory (their users will link
to them) so we removed all those calls. This left module_put() calls in
the cleanup paths which aren't needed and which cause unbalanced puts if
we ever try to unload anything.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agodmaengine/ste_dma40: fix memory leak due to prepared descriptors
Per Forlin [Mon, 29 Aug 2011 11:33:35 +0000 (13:33 +0200)]
dmaengine/ste_dma40: fix memory leak due to prepared descriptors

Prepared descriptors that are not submitted will not be freed. Add
prepared descriptor to a list to be able to release them upon
dmaengine_terminate_all().

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agodmaengine/ste_dma40: fix Oops due to double free of client descriptor
Per Forlin [Mon, 29 Aug 2011 11:33:34 +0000 (13:33 +0200)]
dmaengine/ste_dma40: fix Oops due to double free of client descriptor

The client list may exist in two lists at the same time. This makes free
fail since the same desc is freed multiple times. Remove desc from
client list when adding it to the pending queue. Move free of client owned
descriptors from free_dma() to terminate_all().

Unable to handle kernel paging request at virtual address 00100104
pgd = dea8c000
[00100104] *pgd=1ea62831, *pte=00000000, *ppte=00000000
Internal error: Oops: 817 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.1.0-rc3+ #58)
PC is at d40_free_chan_resources+0x64/0x330

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agodmaengine/ste_dma40: remove duplicate call to d40_pool_lli_free().
Per Forlin [Mon, 29 Aug 2011 11:33:33 +0000 (13:33 +0200)]
dmaengine/ste_dma40: remove duplicate call to d40_pool_lli_free().

d40_desc_free() already calls d40_pool_lli_free().

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agodmaengine/ste_dma40: add missing kernel doc for pending_queue
Per Forlin [Mon, 29 Aug 2011 11:33:32 +0000 (13:33 +0200)]
dmaengine/ste_dma40: add missing kernel doc for pending_queue

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
12 years agoARM: 7074/1: gpio: davinci: eliminate unused variable warnings
Axel Lin [Mon, 5 Sep 2011 02:29:04 +0000 (03:29 +0100)]
ARM: 7074/1: gpio: davinci: eliminate unused variable warnings

Since commit 5093aec872e5be7a55d8dd2b639e8a3818dc19db
"arm: davinci: Cleanup irq chip code", the variable 'mask' and 'g'
are not being used.

This patch eliminate below unused variable warnings:

  CC      drivers/gpio/gpio-davinci.o
drivers/gpio/gpio-davinci.c: In function 'gpio_irq_type':
drivers/gpio/gpio-davinci.c:234: warning: unused variable 'mask'
drivers/gpio/gpio-davinci.c:233: warning: unused variable 'g'

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoNET: am79c961: fix race in link status code
Russell King [Mon, 5 Sep 2011 07:58:29 +0000 (08:58 +0100)]
NET: am79c961: fix race in link status code

The link status code operates from a timer, and writes the index
register without first taking a lock.  A well-placed interrupt
between writing the index register and reading the data register
could change the index register on us, which will return wrong data.
Add the necessary lock.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoLinux 3.1-rc5 v3.1-rc5
Linus Torvalds [Sun, 4 Sep 2011 22:45:10 +0000 (15:45 -0700)]
Linux 3.1-rc5

12 years agoARM: pm: add L2 cache cleaning for suspend
Russell King [Thu, 1 Sep 2011 10:57:59 +0000 (11:57 +0100)]
ARM: pm: add L2 cache cleaning for suspend

We need to ensure that state is pushed out from the L2 cache when
suspending so that the resume paths can access their data before the
MMU and caches have been re-initialized.  Add the necessary calls to
__cpu_suspend_save().

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: convert some assembly to C
Russell King [Thu, 1 Sep 2011 10:52:33 +0000 (11:52 +0100)]
ARM: pm: convert some assembly to C

Convert some of the sleep.S guts to C code, which makes it easier to
use our macros and to add L2 cache handling.  We provide a helper
function, __cpu_suspend_save(), which deals with saving the common
state, setting up for resume, and flushing caches.

The remainder left as assembly code is the saving of the CPU general
purpose registers, and allocating space on the stack to save the CPU
specific registers and resume state.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: get rid of cpu_resume_turn_mmu_on
Russell King [Wed, 31 Aug 2011 22:26:18 +0000 (23:26 +0100)]
ARM: pm: get rid of cpu_resume_turn_mmu_on

We don't require cpu_resume_turn_mmu_on as we can combine the ldr
instruction with the following code provided we ensure that
cpu_resume_mmu is aligned for older CPUs.  Note that we also align
to a 32-byte boundary to ensure that the code can't cross a section
boundary.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: no need to save/restore context ID register
Russell King [Sun, 28 Aug 2011 09:30:34 +0000 (10:30 +0100)]
ARM: pm: no need to save/restore context ID register

There is no need to save and restore the context ID register on ARMv6
and ARMv7 with a temporary page table as we write the context ID
register when we switch back to the real page tables for the thread.

Moreover, the temporary page tables do not contain any non-global
mappings, so the context ID value should not be used.  To be safe,
initialize the register to a reserved context ID value.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: only use preallocated page table during resume
Russell King [Sat, 27 Aug 2011 21:39:09 +0000 (22:39 +0100)]
ARM: pm: only use preallocated page table during resume

Only use the preallocated page table during the resume, not while
suspending.  This avoids the overhead of having to switch unnecessarily
to the resume page table in the suspend path.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: preallocate a page table for suspend/resume
Russell King [Fri, 26 Aug 2011 19:28:52 +0000 (20:28 +0100)]
ARM: pm: preallocate a page table for suspend/resume

Preallocate a page table and setup an identity mapping for the MMU
enable code.  This means we don't have to "borrow" a page table to
do this, avoiding complexities with L2 cache coherency.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: pm: force non-zero return value from __cpu_suspend when aborting
Russell King [Sat, 27 Aug 2011 10:17:36 +0000 (11:17 +0100)]
ARM: pm: force non-zero return value from __cpu_suspend when aborting

Ensure that the return value from __cpu_suspend is non-zero when
aborting.  Zero indicates a successful suspend occurred.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: 7067/1: mm: keep significant bits in pfn_valid
Mark Rutland [Tue, 30 Aug 2011 16:45:10 +0000 (17:45 +0100)]
ARM: 7067/1: mm: keep significant bits in pfn_valid

When ARCH_HAS_HOLES_MEMORYMODEL is selected, pfn_valid calls
memblock_is_memory to test validity of a pfn:

> memblock_is_memory(pfn << PAGE_SHIFT);

On LPAE systems this cuts off the top bits, as the shift occurs before
the value is promoted to a phys_addr_t.

This patch replaces the shift with a call to __pfn_to_phys (which casts
pfn to phys_addr_t before shifting), preventing the loss of significant
bits.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 2 Sep 2011 15:27:01 +0000 (08:27 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon/kms: make sure pci max read request size is valid on evergreen+ (v2)
  drm/radeon/kms: set a default max_pixel_clock

12 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 2 Sep 2011 15:25:23 +0000 (08:25 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: fix ->write_inode return values
  xfs: fix xfs_mark_inode_dirty during umount
  xfs: deprecate the nodelaylog mount option

12 years agoiommu/amd: Don't take domain->lock recursivly
Joerg Roedel [Fri, 2 Sep 2011 12:19:50 +0000 (14:19 +0200)]
iommu/amd: Don't take domain->lock recursivly

The domain_flush_devices() function takes the domain->lock.
But this function is only called from update_domain() which
itself is already called unter the domain->lock. This causes
a deadlock situation when the dma-address-space of a domain
grows larger than 1GB.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
12 years agoiommu/amd: Make sure iommu->need_sync contains correct value
Joerg Roedel [Fri, 2 Sep 2011 12:10:32 +0000 (14:10 +0200)]
iommu/amd: Make sure iommu->need_sync contains correct value

The value is only set to true but never set back to false,
which causes to many completion-wait commands to be sent to
hardware. Fix it with this patch.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
12 years agoMerge branch 'fortglx/3.1/tip/timers/rtc' of git://git.linaro.org/people/jstultz...
Thomas Gleixner [Fri, 2 Sep 2011 08:50:05 +0000 (10:50 +0200)]
Merge branch 'fortglx/3.1/tip/timers/rtc' of git://git.linaro.org/people/jstultz/linux into timers/urgent