firefly-linux-kernel-4.4.55.git
11 years agoMerge branch 'tracking-armlt-cci' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:50 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-cci' into lsk-3.10-vexpress

Conflicts:
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts

11 years agoMerge branch 'tracking-armlt-mcpm' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:44 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-mcpm' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-tc2-dt' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:44 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-tc2-dt' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-misc-fixes' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:43 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-misc-fixes' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-clcd' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:43 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-clcd' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-hdlcd' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:42 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-hdlcd' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-ve-updates' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:37 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-ve-updates' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-rtsm' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:37 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-rtsm' into lsk-3.10-vexpress

11 years agoMerge branch 'tracking-armlt-config' into lsk-3.10-vexpress
Jon Medhurst [Wed, 17 Jul 2013 11:01:36 +0000 (12:01 +0100)]
Merge branch 'tracking-armlt-config' into lsk-3.10-vexpress

11 years agoSupport CCI PMU in perf
Punit Agrawal [Thu, 20 Sep 2012 15:39:25 +0000 (16:39 +0100)]
Support CCI PMU in perf

CCI400 has a set of counters that can be used to profile different
transations at CCI master and slave interfaces. These counters can
observe different kinds of transations passing through the CCI and
provide a system-level view of activity.

This patch adds support for CCI PMU by extending the existing CCI
driver.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agodrivers: ARM CCI: Add a platform driver stub for the PMU
Jon Medhurst [Fri, 10 May 2013 13:47:27 +0000 (14:47 +0100)]
drivers: ARM CCI: Add a platform driver stub for the PMU

This is a hack to enable the old CCI PMU patches to be used with the new
CCI driver. The CCI PMU is (mis)represented by a separate node in TC2
device-tree.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Add CCI nodes to TC2 device-tree
Jon Medhurst [Fri, 10 May 2013 13:37:37 +0000 (14:37 +0100)]
ARM: vexpress: Add CCI nodes to TC2 device-tree

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agodrivers/bus: arm-cci: function to enable CCI ports from early boot code
Nicolas Pitre [Wed, 22 May 2013 03:34:41 +0000 (23:34 -0400)]
drivers/bus: arm-cci: function to enable CCI ports from early boot code

This provides cci_enable_port_for_self().  This is the counterpart to
cci_disable_port_by_cpu(self).

This is meant to be called from the MCPM machine specific power_up_setup
callback code when the appropriate affinity level needs to be initialized.
The code therefore has to be position independent as the MMU is still off
and it cannot rely on any stack space.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Dave Martin <dave.martin@linaro.org>
11 years agodrivers: bus: add ARM CCI support
Lorenzo Pieralisi [Fri, 13 Jul 2012 14:55:52 +0000 (15:55 +0100)]
drivers: bus: add ARM CCI support

On ARM multi-cluster systems coherency between cores running on
different clusters is managed by the cache-coherent interconnect (CCI).
It allows broadcasting of TLB invalidates and memory barriers and it
guarantees cache coherency at system level through snooping of slave
interfaces connected to it.

This patch enables the basic infrastructure required in Linux to handle and
programme the CCI component.

Non-local variables used by the CCI management functions called by power
down function calls after disabling the cache must be flushed out to main
memory in advance, otherwise incoherency of those values may occur if they
are sitting in the cache of some other CPU when power down functions
execute. Driver code ensures that relevant data structures are flushed
from inner and outer caches after the driver probe is completed.

CCI slave port resources are linked to set of CPUs through bus masters
phandle properties that link the interface resources to masters node in
the device tree.

Documentation describing the CCI DT bindings is provided with the patch.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
11 years agoARM: introduce a standalone CONFIG_BIG_LITTLE option
Nicolas Pitre [Tue, 19 Mar 2013 20:07:17 +0000 (16:07 -0400)]
ARM: introduce a standalone CONFIG_BIG_LITTLE option

The BIG_LITTLE config option is independent from the MCPM one.
Semantically, they cover different things.  MCPM can be used on non
b.L systems for example.

Signed-of-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: mcpm: Make all mcpm functions notrace
Dave Martin [Wed, 20 Feb 2013 17:34:20 +0000 (17:34 +0000)]
ARM: mcpm: Make all mcpm  functions notrace

The functions in mcpm_entry.c are mostly intended for use during
scary cache and coherency disabling sequences, or do other things
which confuse trace ...  like powering a CPU down and not
returning.  Similarly for the backend code.

For simplicity, this patch just makes whole files notrace.
There should be more than enough traceable points on the paths to
these functions, but we can be more fine-grained later if there is
a need for it.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
11 years agoARM: vexpress: Select multi-cluster SMP operation if required
Jon Medhurst [Wed, 30 Jan 2013 09:12:55 +0000 (09:12 +0000)]
ARM: vexpress: Select multi-cluster SMP operation if required

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
11 years agoARM: Enable selection of SMP operations at boot time
Jon Medhurst [Tue, 21 May 2013 13:40:51 +0000 (13:40 +0000)]
ARM: Enable selection of SMP operations at boot time

Add a new 'smp_init' hook to machine_desc so platforms can specify a
function to be used to setup smp ops instead of having a statically
defined value.  The hook must return true when smp_ops are initialized.
If false the static mdesc->smp_ops will be used by default.

Add the definition of "bool" by including the linux/types.h file to
asm/mach/arch.h and make it self-contained.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
11 years agoarm: introduce psci_smp_ops
Stefano Stabellini [Tue, 21 May 2013 14:24:11 +0000 (14:24 +0000)]
arm: introduce psci_smp_ops

Rename virt_smp_ops to psci_smp_ops and move them to arch/arm/kernel/psci_smp.c.
Remove mach-virt/platsmp.c, now unused.
Compile psci_smp if CONFIG_ARM_PSCI and CONFIG_SMP.

Add a cpu_die smp_op based on psci_ops.cpu_off.

Initialize PSCI before setting smp_ops in setup_arch.

If PSCI is available on the platform, prefer psci_smp_ops over the
platform smp_ops.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Will Deacon <will.deacon@arm.com>
CC: arnd@arndb.de
CC: marc.zyngier@arm.com
CC: linux@arm.linux.org.uk
CC: nico@linaro.org
CC: rob.herring@calxeda.com
11 years agoARM: bL boot on A7 cluster
Vincent Guittot [Fri, 17 May 2013 09:20:19 +0000 (11:20 +0200)]
ARM: bL boot on A7 cluster

Ensure that A7 cluster will be mapped on CPU0-2

Suggested-by: Chris Redpath <Chris.Redpath@arm.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
11 years agoARM: vexpress: update TC2 dts to support multiple PMUs
Sudeep KarkadaNagesha [Mon, 16 Jul 2012 12:29:43 +0000 (12:29 +0000)]
ARM: vexpress: update TC2 dts to support multiple PMUs

This patch adds support for both A15 and A7 PMUs on vexpress TC2

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
11 years agoARM: vexpress: Add CPU clock-frequencies to TC2 device-tree
Jon Medhurst [Tue, 26 Mar 2013 13:06:53 +0000 (13:06 +0000)]
ARM: vexpress: Add CPU clock-frequencies to TC2 device-tree

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Update TC2 memory to 2GB
Jon Medhurst [Tue, 26 Mar 2013 13:04:51 +0000 (13:04 +0000)]
ARM: vexpress: Update TC2 memory to 2GB

All TC2 boards 'in the wild' will have 2GB of memory, so lets make it
all available.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Add proper DT support for the dual cluster V2P-CA15_CA7 CoreTile
Liviu Dudau [Fri, 29 Jun 2012 16:50:14 +0000 (17:50 +0100)]
ARM: vexpress: Add proper DT support for the dual cluster V2P-CA15_CA7 CoreTile

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoarm: versatile: don't mark pen as __INIT
Mark Rutland [Mon, 10 Jun 2013 15:07:24 +0000 (16:07 +0100)]
arm: versatile: don't mark pen as __INIT

When booting fewer cores than are physically present on a versatile
platform (e.g. when passing maxcpus=N on the command line), some
secondary cores may remain in the holding pen, which is marked __INIT.
Late in the boot process, the memory comprising the holding pen will be
released to the kernel for more general use, and may be overwritten with
arbitrary data, which can cause the held secondaries to start behaving
unpredictably. This can lead to all manner of odd behaviour from the
kernel.

Instead don't mark the section as __INIT. This means we can't reuse the
pen memory, but we won't get secondaries corrupting the rest of the
kernel.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
11 years agotimer: Avoid masking EVENTEN bit in CNTKCTL register
Mathieu J. Poirier [Tue, 11 Jun 2013 23:07:50 +0000 (17:07 -0600)]
timer: Avoid masking EVENTEN bit in CNTKCTL register

Will Deacon has a better solution and his patch should
be coming in soon.  In the mean time please consider for inclusion.

This is an in-between solution that prevents the EVENTEN bit in
the CNTKCTL register from being mask, resulting in events between
clusters being lost.

Bug: LP1188778

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
11 years agoARM: vexpress: Select CONFIG_ARM_ERRATA_643719
Jon Medhurst [Thu, 6 Jun 2013 13:36:40 +0000 (14:36 +0100)]
ARM: vexpress: Select CONFIG_ARM_ERRATA_643719

The CA9X4 CoreTile suffers from this errata and as a consequence has
reboot and shutdown crashes since the cpu hotplug changes introduced in
Linux 3.10. (Commit bca7a5a04933 "ARM: cpu hotplug: remove majority of
cache flushing from platforms")

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agonet: smc91x: Do not cast pointer to int
Catalin Marinas [Thu, 9 May 2013 08:48:54 +0000 (08:48 +0000)]
net: smc91x: Do not cast pointer to int

The patch removes a compiler warning when casting the ioaddr pointer to
(unsigned int) in the smc_probe() function of the smc91x.c driver. The
casting is now done to (unsigned long).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoARM: LPAE: Invalidate the TLB for module addresses during translation fault
Catalin Marinas [Thu, 23 Feb 2012 17:16:41 +0000 (17:16 +0000)]
ARM: LPAE: Invalidate the TLB for module addresses during translation fault

During the free_pgtables() call all user and modules/pkmap entries are
removed. If a translation fault for the modules/pkmap area occurs before
we switched away from the current pgd, do_translation_fault() would copy
the init_mm pud into the user pud.

There is a small window between pud_clear() and pmd_free_tlb() in
free_pmd_range() where the pud entry was cleared but the TLB has not
been invalidated yet and the CPU may have cached the original (valid)
pud entry in the TLB. A scenario like below would get stuck in
continuous prefetch abort:

1. Current process exiting. The modules pmd entries not populated
2. exit_mmap() -> ... -> pmd_free_tlb()
3. pud_clear() for the 1GB pud containing user stack and modules (no TLB
   invalidation yet)
4. Interrupt -> module interrupt routine
5. Level 2 (pmd) translation fault occurs when executing the module
   interrupt routine. The CPU previously cached (TLB) the old valid pud
   value for the modules area, so we don't get a level 1 translation
   fault
6. do_translation fault() copies the pud_k into the pud
7. Linux returns to the faulty instruction. Goes back to 5

At point 7, since the CPU still has the old pud value, it goes back to
point 5 and never gets out of this loop. With this patch, the stale pud
TLB entry is invalidated after point 6 and the subsequent prefetch abort
doesn't occur.

Reported-by: Tony Thompson <Anthony.Thompson@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoARM: vexpress: configure CLCD driver device tree support for A9 CoreTile
Ryan Harkin [Thu, 26 Jul 2012 18:05:10 +0000 (19:05 +0100)]
ARM: vexpress: configure CLCD driver device tree support for A9 CoreTile

Configuration for the amba-clcd PL111 driver is added to the A9 CoreTile's DTS
file.

Configuration of the motherboard CLCD driver is disabled in the DTSI files to
prevent duplicate CLCD drivers being registered.

A generic set of CLCD panel descriptions has been split into its own DTSI file.
Currently, only XVGA and VGA monitors are described.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoamba-clcd: separate ioremap framebuffer from DMA implementation
Will Deacon [Mon, 28 Jan 2013 12:06:58 +0000 (12:06 +0000)]
amba-clcd: separate ioremap framebuffer from DMA implementation

The amba-clcd device can be configured to use either DMA or, when this
feature is not available, an ioremapped frambuffer in static ram.

In the case of the latter, we must take care not to pass ioremapped
addresses to dma_common_mmap, since this expects only addresses from
dma_mmap_coherent, which reside in the kernel linear mapping.

This patch reworks the fb initialisation code so that either DMA or IO
implementations of the mmap/remove functions are chosen as appropriate.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoamba-clcd: Only use dma_alloc_writecombine() if the arch supports it
Catalin Marinas [Fri, 4 Jan 2013 12:56:49 +0000 (12:56 +0000)]
amba-clcd: Only use dma_alloc_writecombine() if the arch supports it

This patch hides the dma_(alloc|free)_writecombine() calls behind macros
to allow the amba-clcd.c to be used on architectures that do not provide
this DMA API. With this patch, the *_writecombine() API is only used on
ARM (AArch32).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoamba-clcd: Remove check for 'reg' value in clcdfb_probe
Jon Medhurst [Wed, 10 Oct 2012 12:27:25 +0000 (13:27 +0100)]
amba-clcd: Remove check for 'reg' value in clcdfb_probe

This check was attempting to ensure only one clcd device in the
device-tree was probed, however the check fails in the valid case where
the device is a child of another device and the 'reg' value is a offset
from the start of that other device, not an absolute address. This
occurs on vexpress with the motherboard clcd being a child of iofga.

For now, we will just have to rely on there only being one display
device specified in device-tree.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoamba-clcd: Add Device Tree support to amba-clcd driver
Jon Medhurst [Thu, 28 Mar 2013 15:57:56 +0000 (15:57 +0000)]
amba-clcd: Add Device Tree support to amba-clcd driver

Add support to parse the display configuration from device tree.

If the board does not provide platform specific functions in the struct
clcd_board contained with the amba device info, then defaults are provided
by the driver.

The device tree configuration can either ask for a DMA setup or provide a
framebuffer address to be remapped into the driver.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
11 years agoARM HDLCD: Fix clock initialisation sequence
Jon Medhurst [Fri, 14 Jun 2013 17:30:08 +0000 (18:30 +0100)]
ARM HDLCD: Fix clock initialisation sequence

This reworks HDLCD initialisation to mirror how CLCD does this, in
particular to prepare the clock immediately after it has been got which
ensures that we don't try and enable clocks before they were prepared,
e.g. in the former clk_enable after register_framebuffer().

The reason this issue wasn't noticed before is that we have been
setting CONFIG_FRAMEBUFFER_CONSOLE and this caused
register_framebuffer() to trigger the creation of a console which calls
hdlcd_set_par(), which in turn was preparing and enabling the clock.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Update TC2 device tree for HDLCD hack
Jon Medhurst [Tue, 26 Mar 2013 13:06:11 +0000 (13:06 +0000)]
ARM: vexpress: Update TC2 device tree for HDLCD hack

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: vexpress: Add support for HDLCD
Jon Medhurst [Wed, 13 Jun 2012 09:01:28 +0000 (10:01 +0100)]
ARM: vexpress: Add support for HDLCD

This is a temporary solution to get everything running.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Fix compilation on Linux 3.9
Jon Medhurst [Tue, 5 Mar 2013 01:24:57 +0000 (09:24 +0800)]
ARM HDLCD: Fix compilation on Linux 3.9

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Changes to get HDLCD working with 've-updates'
Jon Medhurst [Thu, 4 Oct 2012 11:38:06 +0000 (12:38 +0100)]
ARM HDLCD: Changes to get HDLCD working with 've-updates'

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Enable HDLCD_NO_VIRTUAL_SCREEN on Android
Jon Medhurst [Fri, 13 Jul 2012 13:25:50 +0000 (14:25 +0100)]
ARM HDLCD: Enable HDLCD_NO_VIRTUAL_SCREEN on Android

This is a hack which prevents annoying screen flicker in the Android UI.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Add developer option to remove double-height framebuffers
Chris Redpath [Thu, 12 Jul 2012 11:33:13 +0000 (12:33 +0100)]
ARM HDLCD: Add developer option to remove double-height framebuffers

This option can be used with Android to push the graphics subsystem into a
different composition strategy which is more effective when used on hardware
where the framebuffer memory is not cacheable.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
11 years agoARM HDLCD: Review comments from Liviu - extraneous memcpy
Chris Redpath [Fri, 29 Jun 2012 15:07:46 +0000 (16:07 +0100)]
ARM HDLCD: Review comments from Liviu - extraneous memcpy

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Reviewed-By: Liviu Dudau <liviu.dudau@arm.com>
11 years agoARM HDLCD: Add useful functions to HDLCD driver for system integration
Chris Redpath [Fri, 29 Jun 2012 15:07:08 +0000 (16:07 +0100)]
ARM HDLCD: Add useful functions to HDLCD driver for system integration

During TC2 integration a bad config option resulted in HDLCD memory reads
not being serviced often enough. This lead to unsightly screen blanking.

These options allow the developer to count the number of underruns and
to control the color used by HDLCD when an underrun prevents accessing
pixel data. The combination of these two options allow easy diagnosis
of HDLCD underrun conditions.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
11 years agoARM HDLCD: Change default byte ordering to match Android assumption
Chris Redpath [Fri, 29 Jun 2012 12:10:35 +0000 (13:10 +0100)]
ARM HDLCD: Change default byte ordering to match Android assumption

Change color byte location in 32-bit word from argb to abgr to match
the assumption made in Android when 32-bit color displays are used.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
11 years agoARM HDLCD: Get it working under Android.
Dietmar Eggemann [Thu, 21 Jun 2012 16:16:33 +0000 (17:16 +0100)]
ARM HDLCD: Get it working under Android.

Add a shortcut when set_par is called to only change the yoffset. Android is
doing that instead of calling pan_display to flip the framebuffer.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
11 years agoARM HDLCD: Fixup driver to resemble ARM's latest codebase.
Jon Medhurst [Fri, 13 Jul 2012 12:32:48 +0000 (13:32 +0100)]
ARM HDLCD: Fixup driver to resemble ARM's latest codebase.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Add missing clk_{un}prepare calls
Jon Medhurst [Wed, 13 Jun 2012 08:45:43 +0000 (09:45 +0100)]
ARM HDLCD: Add missing clk_{un}prepare calls

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM HDLCD: Add support for ARM High Definition LCD.
Liviu Dudau [Wed, 18 Jan 2012 16:52:04 +0000 (16:52 +0000)]
ARM HDLCD: Add support for ARM High Definition LCD.

The ARM HDLCD device is now found in various new Versatile Express coretiles.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agomfd: vexpress: Make the driver optional for arm and arm64
Pawel Moll [Tue, 11 Jun 2013 10:56:02 +0000 (11:56 +0100)]
mfd: vexpress: Make the driver optional for arm and arm64

The driver can be used on either arm or arm64 platforms, but
the latter doesn't have any platform-specific configuration
options, so it must be possible to manually enable the driver.

As the gpiolib is optional for arm64 arch, the gpio/led code
must be compiled conditionally.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agopower/reset: Make the vexpress driver optional on arm and arm64
Pawel Moll [Mon, 10 Jun 2013 15:12:01 +0000 (16:12 +0100)]
power/reset: Make the vexpress driver optional on arm and arm64

The driver can be used on either arm or arm64 platforms, but
the latter doesn't have any platform-specific configuration
options, so it must be possible to manually enable the driver.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoclk: vexpress: Make the clock drivers directly available for arm64
Pawel Moll [Mon, 10 Jun 2013 15:05:07 +0000 (16:05 +0100)]
clk: vexpress: Make the clock drivers directly available for arm64

The new arm64 architecture has no idea of platform or machine, so
it doesn't have to define ARCH_VEXPRESS configuration option at
all. To allow user to select the drivers at all, make it depend
on ARM64 as well.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoclk: vexpress: Use full node name to identify individual clocks
Pawel Moll [Mon, 10 Jun 2013 15:05:06 +0000 (16:05 +0100)]
clk: vexpress: Use full node name to identify individual clocks

Previously all the clocks were reported as "osc". Now it will be
something like "/dcc/osc@0".

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
11 years agovideo: Make vexpress DVI driver depend on CONFIG_FB
Jon Medhurst [Tue, 15 Jan 2013 17:45:19 +0000 (17:45 +0000)]
video: Make vexpress DVI driver depend on CONFIG_FB

The driver uses symbols from fbmem.c so if CONFIG_FB is not
selected we get build errors like:

drivers/built-in.o: In function `vexpress_dvi_fb_select':
 :(.text+0x1b6c): undefined reference to `lock_fb_info'
 :(.text+0x1ba0): undefined reference to `registered_fb'

Note, this is only a partial solution because we still have a
problem if CONFIG_FB is selected as a module.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agovideo: Versatile Express DVI output driver
Pawel Moll [Mon, 17 Sep 2012 17:09:28 +0000 (18:09 +0100)]
video: Versatile Express DVI output driver

Versatile Express' DVI video output can be connected to one the three
sources - motherboard's CLCD controller or a video signal generated
by one of the daughterboards.

This driver configures the muxer FPGA so the output displays content
of one of the framebuffers in the system (0 by default, can be changed
by user writing to the "fb" sysfs attribute of the muxfpga device).

It will also set up the display formatter mode and keep it up
to date with mode changes requested by the user (eg. with fbset
tool).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
11 years agortsm: fixup for new CCI driver
Jon Medhurst [Tue, 14 May 2013 14:22:02 +0000 (15:22 +0100)]
rtsm: fixup for new CCI driver

We include the compatible string "arm,cci" because the semihosting
bootwrapper searches for this to initialise the CCI before boot.

The boot-wrapper will need updating for the new CCI device-tree
bindings when they are stable, then we can remove this old compatible
string from the RTSM device-trees.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: rtsm_ve-v2p-ca15x?-ca7x?.dts: update dcscb compatible string
Nicolas Pitre [Wed, 20 Mar 2013 04:33:24 +0000 (00:33 -0400)]
ARM: rtsm_ve-v2p-ca15x?-ca7x?.dts: update dcscb compatible string

... to match the version that was approved during upstream review.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
11 years agoARM: RTSM: add DCSCB address definition to ca15x*-ca7x* .dts files
Nicolas Pitre [Thu, 29 Nov 2012 21:37:51 +0000 (16:37 -0500)]
ARM: RTSM: add DCSCB address definition to ca15x*-ca7x* .dts files

11 years agoARM: dts: Update RTSM dtbs for CLCD changes
Jon Medhurst [Wed, 30 Jan 2013 12:04:47 +0000 (12:04 +0000)]
ARM: dts: Update RTSM dtbs for CLCD changes

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Conflicts:
arch/arm/boot/dts/rtsm_ve-motherboard.dtsi

11 years agoARM: dts: Changes to get RTSM working with Linux 3.8
Jon Medhurst [Wed, 30 Jan 2013 12:02:46 +0000 (12:02 +0000)]
ARM: dts: Changes to get RTSM working with Linux 3.8

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: dts: Add RTSM dtb's to Makefile.boot
Jon Medhurst [Fri, 28 Sep 2012 12:22:23 +0000 (13:22 +0100)]
ARM: dts: Add RTSM dtb's to Makefile.boot

So they are built by 'make dtbs' and so will appear in Linaro's
Ubuntu kernel package.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: dts: Add device trees for RTSM
Jon Medhurst [Wed, 15 Aug 2012 16:28:28 +0000 (17:28 +0100)]
ARM: dts: Add device trees for RTSM

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoARM: VExpress: PSCI: Compile PSCI code by default
Liviu Dudau [Wed, 13 Mar 2013 15:42:07 +0000 (15:42 +0000)]
ARM: VExpress: PSCI: Compile PSCI code by default

Compile support for PSCI by default and let the command line decide
whether support for SMC calls gets enabled or not.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
11 years agoconfigs: vexpress-tuning: Re-enable CONFIG_THUMB2_KERNEL
Jon Medhurst [Tue, 19 Mar 2013 20:14:31 +0000 (20:14 +0000)]
configs: vexpress-tuning: Re-enable CONFIG_THUMB2_KERNEL

Performace and power don't appear to be improved by building for ARM,
in fact, there's a suggestion it uses slightly more power.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress-tuning: Re-enable tracing and profiling options
Jon Medhurst [Fri, 15 Mar 2013 13:08:32 +0000 (13:08 +0000)]
configs: vexpress-tuning: Re-enable tracing and profiling options

For now, lets play safe and not disable any tracing and profiling
options in case these are expected to be present for benchmarking
purposes.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress-tuning: Add fragment for better performance
Jon Medhurst [Wed, 13 Mar 2013 10:56:22 +0000 (10:56 +0000)]
configs: vexpress-tuning: Add fragment for better performance

Use ARM rather than Thumb2 and disable debug and trace features which
aren't essential. (Some trace features are still needed to avoid
breaking Gator).

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Enable TC2 power management options
Jon Medhurst [Thu, 26 Jul 2012 14:01:40 +0000 (15:01 +0100)]
configs: vexpress: Enable TC2 power management options

Note, for the sake of a faster boot and better performance, we default
to maximum CPU clock frequency (CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE)
and will rely on user-side scripts on Android and Ubuntu to change this
as appropriate for big.LITTLE power saving. E.g. changing LITTLE cores
to 'ondemand'.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Extra options needed for TC2
Jon Medhurst [Thu, 5 Jul 2012 10:20:51 +0000 (11:20 +0100)]
configs: vexpress: Extra options needed for TC2

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Enable LEDs
Jon Medhurst [Wed, 30 Jan 2013 18:44:20 +0000 (18:44 +0000)]
configs: vexpress: Enable LEDs

To provide access to LEDs enable

  CONFIG_LEDS_CLASS=y
  CONFIG_LEDS_GPIO=y

(LED's are available from user side under under /sys/class/leds)

To use the motherboard LEDs to show CPU activity...

  CONFIG_LEDS_TRIGGERS=y
  CONFIG_LEDS_TRIGGER_HEARTBEAT=y
  CONFIG_LEDS_TRIGGER_CPU=y

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Changes needed for Linux 3.9
Jon Medhurst [Tue, 5 Mar 2013 03:54:20 +0000 (11:54 +0800)]
configs: vexpress: Changes needed for Linux 3.9

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Changes needed for Linux 3.8
Jon Medhurst [Tue, 2 Oct 2012 10:53:06 +0000 (11:53 +0100)]
configs: vexpress: Changes needed for Linux 3.8

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Enable CONFIG_SMC91X
Jon Medhurst [Thu, 26 Jul 2012 14:49:50 +0000 (15:49 +0100)]
configs: vexpress: Enable CONFIG_SMC91X

This is the ethernet device RTSM models and we want normal vexpress
kernels also working on RTSM.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoconfigs: vexpress: Basic board config fragment
Jon Medhurst [Fri, 8 Jun 2012 15:42:20 +0000 (16:42 +0100)]
configs: vexpress: Basic board config fragment

Signed-off-by: Jon Medhurst <tixy@linaro.org>
11 years agoLinux 3.10
Linus Torvalds [Sun, 30 Jun 2013 22:13:29 +0000 (15:13 -0700)]
Linux 3.10

11 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Sun, 30 Jun 2013 22:08:15 +0000 (15:08 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Pull another powerpc fix from Benjamin Herrenschmidt:
 "I mentioned that while we had fixed the kernel crashes, EEH error
  recovery didn't always recover...  It appears that I had a fix for
  that already in powerpc-next (with a stable CC).

  I cherry-picked it today and did a few tests and it seems that things
  now work quite well.  The patch is also pretty simple, so I see no
  reason to wait before merging it."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/eeh: Fix fetching bus for single-dev-PE

11 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sun, 30 Jun 2013 22:06:25 +0000 (15:06 -0700)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is a set of seven bug fixes.  Several fcoe fixes for locking
  problems, initiator issues and a VLAN API change, all of which could
  eventually lead to data corruption, one fix for a qla2xxx locking
  problem which could lead to multiple completions of the same request
  (and subsequent data corruption) and a use after free in the ipr
  driver.  Plus one minor MAINTAINERS file update"

(only six bugfixes in this pull, since I had already pulled the fcoe API
fix directly from Robert Love)

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] ipr: Avoid target_destroy accessing memory after it was freed
  [SCSI] qla2xxx: Fix for locking issue between driver ISR and mailbox routines
  MAINTAINERS: Fix fcoe mailing list
  libfc: extend ex_lock to protect all of fc_seq_send
  libfc: Correct check for initiator role
  libfcoe: Fix Conflicting FCFs issue in the fabric

11 years agopowerpc/eeh: Fix fetching bus for single-dev-PE
Gavin Shan [Wed, 5 Jun 2013 07:34:02 +0000 (15:34 +0800)]
powerpc/eeh: Fix fetching bus for single-dev-PE

While running Linux as guest on top of phyp, we possiblly have
PE that includes single PCI device. However, we didn't return
its PCI bus correctly and it leads to failure on recovery from
EEH errors for single-dev-PE. The patch fixes the issue.

Cc: <stable@vger.kernel.org> # v3.7+
Cc: Steve Best <sbest@us.ibm.com>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Sun, 30 Jun 2013 00:02:48 +0000 (17:02 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Pull powerpc fixes from Ben Herrenschmidt:
 "We discovered some breakage in our "EEH" (PCI Error Handling) code
  while doing error injection, due to a couple of regressions.  One of
  them is due to a patch (37f02195bee9 "powerpc/pci: fix PCI-e devices
  rescan issue on powerpc platform") that, in hindsight, I shouldn't
  have merged considering that it caused more problems than it solved.

  Please pull those two fixes.  One for a simple EEH address cache
  initialization issue.  The other one is a patch from Guenter that I
  had originally planned to put in 3.11 but which happens to also fix
  that other regression (a kernel oops during EEH error handling and
  possibly hotplug).

  With those two, the couple of test machines I've hammered with error
  injection are remaining up now.  EEH appears to still fail to recover
  on some devices, so there is another problem that Gavin is looking
  into but at least it's no longer crashing the kernel."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/pci: Improve device hotplug initialization
  powerpc/eeh: Add eeh_dev to the cache during boot

11 years agoARM: dt: Only print warning, not WARN() on bad cpu map in device tree
Olof Johansson [Sat, 29 Jun 2013 23:25:14 +0000 (16:25 -0700)]
ARM: dt: Only print warning, not WARN() on bad cpu map in device tree

Due to recent changes and expecations of proper cpu bindings, there are
now cases for many of the in-tree devicetrees where a WARN() will hit
on boot due to badly formatted /cpus nodes.

Downgrade this to a pr_warn() to be less alarmist, since it's not a
new problem.

Tested on Arndale, Cubox, Seaboard and Panda ES. Panda hits the WARN
without this, the others do not.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agopowerpc/pci: Improve device hotplug initialization
Guenter Roeck [Mon, 10 Jun 2013 17:18:08 +0000 (10:18 -0700)]
powerpc/pci: Improve device hotplug initialization

Commit 37f02195b (powerpc/pci: fix PCI-e devices rescan issue on powerpc
platform) fixes a problem with interrupt and DMA initialization on hot
plugged devices. With this commit, interrupt and DMA initialization for
hot plugged devices is handled in the pci device enable function.

This approach has a couple of drawbacks. First, it creates two code paths
for device initialization, one for hot plugged devices and another for devices
known during the initial PCI scan. Second, the initialization code for hot
plugged devices is only called when the device is enabled, ie typically
in the probe function. Also, the platform specific setup code is called each
time pci_enable_device() is called, not only once during device discovery,
meaning it is actually called multiple times, once for devices discovered
during the initial scan and again each time a driver is re-loaded.

The visible result is that interrupt pins are only assigned to hot plugged
devices when the device driver is loaded. Effectively this changes the PCI
probe API, since pci_dev->irq and the device's dma configuration will now
only be valid after pci_enable() was called at least once. A more subtle
change is that platform specific PCI device setup is moved from device
discovery into the driver's probe function, more specifically into the
pci_enable_device() call.

To fix the inconsistencies, add new function pcibios_add_device.
Call pcibios_setup_device from pcibios_setup_bus_devices if device setup
is not complete, and from pcibios_add_device if bus setup is complete.

With this change, device setup code is moved back into device initialization,
and called exactly once for both static and hot plugged devices.

[ This also fixes a regression introduced by the above patch which
  causes dev->irq to be overwritten under some cirumstances after
  MSIs have been enabled for the device which leads to crashes due
  to the MSI core "hijacking" dev->irq to store the base MSI number
  and not the LSI. --BenH
]

Cc: Yuanquan Chen <Yuanquan.Chen@freescale.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hiroo Matsumoto <matsumoto.hiroo@jp.fujitsu.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Sat, 29 Jun 2013 18:34:18 +0000 (11:34 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a crash in the crypto layer exposed by an SCTP test tool"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algboss - Hold ref count on larval

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sat, 29 Jun 2013 18:32:05 +0000 (11:32 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm/qxl fix from Dave Airlie:
 "Bad me forgot an access check, possible security issue, but since this
  is the first kernel with it, should be fine to just put it in now"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/qxl: add missing access check for execbuffer ioctl

11 years agoFix: kernel/ptrace.c: ptrace_peek_siginfo() missing __put_user() validation
Mathieu Desnoyers [Fri, 28 Jun 2013 13:49:46 +0000 (09:49 -0400)]
Fix: kernel/ptrace.c: ptrace_peek_siginfo() missing __put_user() validation

This __put_user() could be used by unprivileged processes to write into
kernel memory.  The issue here is that even if copy_siginfo_to_user()
fails, the error code is not checked before __put_user() is executed.

Luckily, ptrace_peek_siginfo() has been added within the 3.10-rc cycle,
so it has not hit a stable release yet.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Sat, 29 Jun 2013 17:31:15 +0000 (10:31 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

Pull Ceph fix from Sage Weil:
 "This is a recently spotted regression in the snapshot behavior...

  It turns out several tests weren't being run in the nightlies so this
  took a while to spot"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  rbd: send snapshot context with writes

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sat, 29 Jun 2013 17:30:31 +0000 (10:30 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull ubifs fixes from Al Viro:
 "A couple of ubifs readdir/lseek race fixes.  Stable fodder, really
  nasty..."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  UBIFS: fix a horrid bug
  UBIFS: prepare to fix a horrid bug

11 years agoMerge tag 'for-linus-20130628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowe...
Linus Torvalds [Sat, 29 Jun 2013 17:28:52 +0000 (10:28 -0700)]
Merge tag 'for-linus-20130628' of git://git./linux/kernel/git/dhowells/linux-mn10300

Pull two MN10300 fixes from David Howells:
 "The first fixes a problem with passing arrays rather than pointers to
  get_user() where __typeof__ then wants to declare and initialise an
  array variable which gcc doesn't like.

  The second fixes a problem whereby putting mem=xxx into the kernel
  command line causes init=xxx to get an incorrect value."

* tag 'for-linus-20130628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-mn10300:
  mn10300: Use early_param() to parse "mem=" parameter
  mn10300: Allow to pass array name to get_user()

11 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 29 Jun 2013 17:27:19 +0000 (10:27 -0700)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull timer fix from Thomas Gleixner:
 "Correct an ordering issue in the tick broadcast code.  I really wish
  we'd get compensation for pain and suffering for each line of code we
  write to work around dysfunctional timer hardware."

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick: Fix tick_broadcast_pending_mask not cleared

11 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 29 Jun 2013 17:26:50 +0000 (10:26 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fix from Ingo Molnar:
 "One more fix for a recently discovered bug"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Disable monitoring on setuid processes for regular users

11 years agoUBIFS: fix a horrid bug
Artem Bityutskiy [Fri, 28 Jun 2013 11:15:15 +0000 (14:15 +0300)]
UBIFS: fix a horrid bug

Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
in the middle of 'ubifs_readdir()'.

This means that 'file->private_data' can be freed while 'ubifs_readdir()' uses
it, and this is a very bad bug: not only 'ubifs_readdir()' can return garbage,
but this may corrupt memory and lead to all kinds of problems like crashes an
security holes.

This patch fixes the problem by using the 'file->f_version' field, which
'->llseek()' always unconditionally sets to zero. We set it to 1 in
'ubifs_readdir()' and whenever we detect that it became 0, we know there was a
seek and it is time to clear the state saved in 'file->private_data'.

I tested this patch by writing a user-space program which runds readdir and
seek in parallell. I could easily crash the kernel without these patches, but
could not crash it with these patches.

Cc: stable@vger.kernel.org
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agoUBIFS: prepare to fix a horrid bug
Artem Bityutskiy [Fri, 28 Jun 2013 11:15:14 +0000 (14:15 +0300)]
UBIFS: prepare to fix a horrid bug

Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no
mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are
in the middle of 'ubifs_readdir()'.

First of all, this means that 'file->private_data' can be freed while
'ubifs_readdir()' uses it.  But this particular patch does not fix the problem.
This patch is only a preparation, and the fix will follow next.

In this patch we make 'ubifs_readdir()' stop using 'file->f_pos' directly,
because 'file->f_pos' can be changed by '->llseek()' at any point. This may
lead 'ubifs_readdir()' to returning inconsistent data: directory entry names
may correspond to incorrect file positions.

So here we introduce a local variable 'pos', read 'file->f_pose' once at very
the beginning, and then stick to 'pos'. The result of this is that when
'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of
'ubifs_readdir()', the latter "wins".

Cc: stable@vger.kernel.org
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
11 years agomn10300: Use early_param() to parse "mem=" parameter
Akira Takeuchi [Fri, 28 Jun 2013 15:53:03 +0000 (16:53 +0100)]
mn10300: Use early_param() to parse "mem=" parameter

This fixes the problem that "init=" options may not be passed to kernel
correctly.

parse_mem_cmdline() of mn10300 arch gets rid of "mem=" string from
redboot_command_line. Then init_setup() parses the "init=" options from
static_command_line, which is a copy of redboot_command_line, and keeps
the pointer to the init options in execute_command variable.

Since the commit 026cee0 upstream (params: <level>_initcall-like kernel
parameters), static_command_line becomes overwritten by saved_command_line at
do_initcall_level(). Notice that saved_command_line is a command line
which includes "mem=" string.

As a result, execute_command may point to weird string by the length of
"mem=" parameter.
I noticed this problem when using the command line like this:

    mem=128M console=ttyS0,115200 init=/bin/sh

Here is the processing flow of command line parameters.
    start_kernel()
      setup_arch(&command_line)
         parse_mem_cmdline(cmdline_p)
           * strcpy(boot_command_line, redboot_command_line);
           * Remove "mem=xxx" from redboot_command_line.
           * *cmdline_p = redboot_command_line;
      setup_command_line(command_line) <-- command_line is redboot_command_line
        * strcpy(saved_command_line, boot_command_line)
        * strcpy(static_command_line, command_line)
      parse_early_param()
        strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
        parse_early_options(tmp_cmdline);
          parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param);
      parse_args("Booting ..", static_command_line, ...);
        init_setup() <-- save the pointer in execute_command
      rest_init()
        kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);

At this point, execute_command points to "/bin/sh" string.

    kernel_init()
      kernel_init_freeable()
        do_basic_setup()
          do_initcalls()
            do_initcall_level()
              (*) strcpy(static_command_line, saved_command_line);

Here, execute_command gets to point to "200" string !!

Signed-off-by: David Howells <dhowells@redhat.com>
11 years agomn10300: Allow to pass array name to get_user()
Akira Takeuchi [Fri, 28 Jun 2013 15:53:01 +0000 (16:53 +0100)]
mn10300: Allow to pass array name to get_user()

This fixes the following compile error:

CC block/scsi_ioctl.o
block/scsi_ioctl.c: In function 'sg_scsi_ioctl':
block/scsi_ioctl.c:449: error: invalid initializer

Signed-off-by: David Howells <dhowells@redhat.com>
11 years agodrm/qxl: add missing access check for execbuffer ioctl
Dave Airlie [Fri, 28 Jun 2013 03:27:40 +0000 (13:27 +1000)]
drm/qxl: add missing access check for execbuffer ioctl

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agopowerpc/eeh: Add eeh_dev to the cache during boot
Thadeu Lima de Souza Cascardo [Thu, 27 Jun 2013 21:00:10 +0000 (18:00 -0300)]
powerpc/eeh: Add eeh_dev to the cache during boot

commit f8f7d63fd96ead101415a1302035137a866f8998 ("powerpc/eeh: Trace eeh
device from I/O cache") broke EEH on pseries for devices that were
present during boot and have not been hotplugged/DLPARed.

eeh_check_failure will get the eeh_dev from the cache, and will get
NULL. eeh_addr_cache_build adds the addresses to the cache, but eeh_dev
for the giving pci_device is not set yet. Just reordering the call to
eeh_addr_cache_insert_dev works fine. The ordering is similar to the one
in eeh_add_device_late.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agorbd: send snapshot context with writes
Josh Durgin [Wed, 26 Jun 2013 19:56:17 +0000 (12:56 -0700)]
rbd: send snapshot context with writes

Sending the right snapshot context with each write is required for
snapshots to work. Due to the ordering of calls, the snapshot context
is never set for any requests. This causes writes to the current
version of the image to be reflected in all snapshots, which are
supposed to be read-only.

This happens because rbd_osd_req_format_write() sets the snapshot
context based on obj_request->img_request. At this point, however,
obj_request->img_request has not been set yet, to the snapshot context
is set to NULL. Fix this by moving rbd_img_obj_request_add(), which
sets obj_request->img_request, before the osd request formatting
calls.

This resolves:
    http://tracker.ceph.com/issues/5465

Reported-by: Karol Jurak <karol.jurak@gmail.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
11 years agoMerge tag 'fcoe1' into fixes
James Bottomley [Thu, 27 Jun 2013 06:08:22 +0000 (23:08 -0700)]
Merge tag 'fcoe1' into fixes

This patch fixes a critical bug that was introduced in 3.9
related to VLAN tagging FCoE frames.

11 years agoMerge tag 'fcoe' into fixes
James Bottomley [Thu, 27 Jun 2013 06:07:53 +0000 (23:07 -0700)]
Merge tag 'fcoe' into fixes

3.10 fixes

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Thu, 27 Jun 2013 05:24:37 +0000 (19:24 -1000)]
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Found via trinity:

    If you connect up an ipv6 socket to an ipv4 mapped address then an
    ipv6 one, sendmsg() can croak because ip6_sk_dst_check() assumes the
    route cached in the socket is an ipv6 one.  In this case there is an
    ipv4 route attached, so it gets stomped on.

    Reported by Dave Jones and Hannes Frederic Sowa, fixed by Eric
    Dumazet.

 2) AF_KEY notifications leak some kernel memory to userspace, fix from
    Mathias Krause.

 3) DLCI calls __dev_get_by_name() without proper locking, and dlci_del
    doesn't validate that the device being deleted is actually a DLCI
    one.  Fixes from Li Zefan.

 4) Length check on bluetooth l2cap information responses is wrong, each
    response type has a different lenth, so we should make sure it's in
    a given range rather than enforce one single valid length.  From
    Jaganath Kanakkassery.

 5) Receive FIFO overflow is really easy to trigger in stress scenerios
    in the sh_eth driver, but the event isn't being handled properly at
    all.  Specifically, the mask of error interrupts doesn't include the
    event so we never clear it, resulting in the driver becomming wedged
    processing an interrupt that never gets cleared.

    Fix from Sergei Shtylyov.

 6) qlcnic sleeps while holding a spinlock, use mdelay() instead of
    msleep().  From Shahed Shaikh.

 7) Missing curly braces causes SIP netfilter NAT module to always drop
    packets.  Fix from Balazs Peter Odor.

 8) ipt_ULOG in netfilter passes the wrong value to timer setup, causing
    the timer to dereference crap when it fires.  Fix from Gao Feng.

 9) Missing RCU protection around txq->axq_acq traversal in
    ath_txq_schedule().  Fix from Felix Fietkau.

10) Idle state transition test in ath9k_htc_config() is reversed, fix
    from Sujith Manoharan.

11) IPV6 forwarding handles unicast Router Alert packets incorrectly.
    It tests the wrong option state.  Previously opt->ra being non-zero
    indicated a router alert marking in the SKB, but now it's indicated
    by a bit in opt->flags.  Fix from YOSHIFUJI Hideaki.

12) SKB leak in GRE tunnel GSO handling, from Eric Dumazet.

13) get_user_pages_fast() error handling in TUN and MACVTAP use the same
    local variable for the base index and the loop iterator for page
    traversal, oops! Fix from Michael S Tsirkin.

14) ipv6_get_lladdr() can fail, and we must therefore check it's return
    value in inet6_set_iftoken().  For from Hannes Frederic Sowa.

15) If you change an interface name and meanwhile can sneak in something
    that looks up the name (like SO_BINDTODEVICE or SIOCGIFNAME) we can
    deadlock with CONFIG_PREEMPT=n.  Fix this by providing a helper
    function that properly uses raw_seqcount_begin().  From Nicolas
    Schichan.

16) Chain noise calibration test is inverted in iwlwifi, fix from
    Nikolay Martynov.

17) Properly set TX iwlwifi descriptor flags for back requests.  Fix
    from Emmanuel Grumbach.

18) We can't assume skb_transport_header() is set in xt_TCPOPTSTRAP
    module, fix from Pablo Neira Ayuso.

19) Some crummy APs don't provide the proper High Throughput info in
    association response frames.  Add a workaround by assume we'll use
    whatever is in the beacon/probe.  Fix from Johannes Berg.

20) mac80211 call to rate_idx_match_mask() swaps two arguments (mask and
    channel width).  Fix from Simon Wunderlich.

21) xt_TCPMSS (like xt_TCPOPTSTRAP) must not try to handle fragmented
    frames.  Fix from Phil Oester.

22) Fix rate control regression causing iwlwifi/iwlegacy chips to use
    1Mbit/s on pre-11n networks.  From Moshe Benji and Stanslaw Gruszka.

23) Disable brcmsmac power-save functions, they cause regressions.  From
    Arend van Spriel.

24) Enforce a sane minimum MTU in l2cap_build_cmd() otherwise we can
    easily crash.  Fix from Anderson Lizardo.

25) If a learning packet arrives during vxlan_stop() we crash, easily
    fixed by checking netif_running().  From Stephen Hemminger.

26) Static vxlan FDB entries should not be migrated, also from Stephen.

27) skb_clone() failures not handled in vxlan_xmit(), oops.  Also from
    Stephen.

28) Add minimal driver for AR816x/AR817x ethernet chips, from Johannes
    Berg.

29) Fix regression in userspace VLAN acceleration control, added by the
    802.1ad support changes.  Fix from Fernando Luis Vazquez Cao.

30) Interval selection for MLD queries in the bridging code was
    reversed.  Fix from Linus Lüssing.

31) ipv6's ndisc_send_redirect() erroneously writes to the packet we
    received not the packet we are building to send out.  Fix from
    Matthias Schiffer.

32) Don't free netdev before unregistering it, in usb_8dev can driver.
    From Marc Kleine-Budde.

33) Fix nl80211 attribute buffer races, from Johannes Berg.

34) Although netlink_diag.h is under uapi/ it isn't present in Kbuild.
    From Stephen Hemminger.

35) Wrong address and family passed to MD5 key lookups in TCP, from
    Aydin Arik.

36) phy_type attribute created by SFC driver should not be writable.
    From Ben Hutchings.

37) Receive/Transmit queue allocations in pxa168_eth and mv643xx_eth
    should use kzalloc().  Otherwise if setup fails half-way, we'll
    dereference garbage when trying to teardown the rings.  From Lubomir
    Rintel.

38) Fix double-allocation of dst (resulting in unfreeable net device) in
    ipv6's init_loopback().  From Gao Feng.

39) Fix fragmentation handling SKB leak in netfilter conntrack, we were
    freeing the wrong skb pointer.  From Phil Oester.

40) Don't report "-1" (SPEED_UNKNOWN) in bond_miimon_commit(), from
    Nikolay Aleksandrov.

41) davinci_cpdma doesn't check for DMA mapping errors, letting the
    device scribble to random addresses.  From Sebastian Siewior.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
  dlci: validate the net device in dlci_del()
  dlci: acquire rtnl_lock before calling __dev_get_by_name()
  af_key: fix info leaks in notify messages
  ipv6: ip6_sk_dst_check() must not assume ipv6 dst
  net: fix kernel deadlock with interface rename and netdev name retrieval.
  net/tg3: Avoid delay during MMIO access
  ipv6: check return value of ipv6_get_lladdr
  macvtap: fix recovery from gup errors
  tun: fix recovery from gup errors
  gre: fix a possible skb leak
  ipv6: Process unicast packet with Router Alert by checking flag in skb.
  ath9k_htc: Handle IDLE state transition properly
  ath9k: fix an RCU issue in calling ieee80211_get_tx_rates
  netfilter: ipt_ULOG: fix incorrect setting of ulog timer
  netfilter: ctnetlink: send event when conntrack label was modified
  netfilter: nf_nat_sip: fix mangling
  qlcnic: Do not sleep while holding spinlock
  drivers: net: cpsw: fix compilation error with cpsw driver
  tcp: doc : fix the syncookies default value
  sh_eth: fix misreporting of transmit abort
  ...

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Thu, 27 Jun 2013 05:23:15 +0000 (19:23 -1000)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull i915 drm fixes from Dave Airlie:
 "These should be the last two fixes for i915, one is for a fence leak
  killing X on some older GPUs, and one is a late regression partial
  revert for an swiotlb/xen/i915 interaction, Konrad has promised to
  figure out the proper answer, and this patch is the best thing to do
  at this stage to avoid regressing"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: make compact dma scatter lists creation work with SWIOTLB backend.
  drm/i915: Restore fences after resume and GPU resets

11 years agodlci: validate the net device in dlci_del()
Zefan Li [Wed, 26 Jun 2013 07:31:58 +0000 (15:31 +0800)]
dlci: validate the net device in dlci_del()

We triggered an oops while running trinity with 3.4 kernel:

BUG: unable to handle kernel paging request at 0000000100000d07
IP: [<ffffffffa0109738>] dlci_ioctl+0xd8/0x2d4 [dlci]
PGD 640c0d067 PUD 0
Oops: 0000 [#1] PREEMPT SMP
CPU 3
...
Pid: 7302, comm: trinity-child3 Not tainted 3.4.24.09+ 40 Huawei Technologies Co., Ltd. Tecal RH2285          /BC11BTSA
RIP: 0010:[<ffffffffa0109738>]  [<ffffffffa0109738>] dlci_ioctl+0xd8/0x2d4 [dlci]
...
Call Trace:
  [<ffffffff8137c5c3>] sock_ioctl+0x153/0x280
  [<ffffffff81195494>] do_vfs_ioctl+0xa4/0x5e0
  [<ffffffff8118354a>] ? fget_light+0x3ea/0x490
  [<ffffffff81195a1f>] sys_ioctl+0x4f/0x80
  [<ffffffff81478b69>] system_call_fastpath+0x16/0x1b
...

It's because the net device is not a dlci device.

Reported-by: Li Jinyue <lijinyue@huawei.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodlci: acquire rtnl_lock before calling __dev_get_by_name()
Zefan Li [Wed, 26 Jun 2013 07:29:54 +0000 (15:29 +0800)]
dlci: acquire rtnl_lock before calling __dev_get_by_name()

Otherwise the net device returned can be freed at anytime.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>