sfrench/cifs-2.6.git
10 years agoMerge tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 20 Jun 2013 13:06:57 +0000 (15:06 +0200)]
Merge tag 'davinci-for-v3.11/soc-v2' of git://git./linux/kernel/git/nsekhar/linux-davinci into next/soc

From Sekhar Nori:

DaVinci SoC changes for v3.11

This pull request moves DaVinci EDMA library to
arch/arm/common so it can be used by OMAP based AM335x.
This is a temporary step until all drivers are converted
to use the dmaengine driver in drivers/dma/edma.c.

Several drivers like SPI, MMC/SD have already been converted.
Some like audio are pending.

The other two patches in the pull request are cleanup in nature.

* tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: edma: remove unused transfer controller handlers
  ARM: davinci: move private EDMA API to arm/common
  ARM: davinci: remove __init atrribute from function declaration

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: u300: only build for ARCH_MULTI_V5
Arnd Bergmann [Thu, 20 Jun 2013 00:26:37 +0000 (02:26 +0200)]
ARM: u300: only build for ARCH_MULTI_V5

This avoids impossible platform combinations, as we cannot
build a combined V5 + V6/V7 kernel.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoMerge tag 'imx-soc-3.11' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/soc
Arnd Bergmann [Thu, 20 Jun 2013 00:14:59 +0000 (02:14 +0200)]
Merge tag 'imx-soc-3.11' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/soc

From Shawn Guo:

imx soc changes for 3.11:

* New SoCs i.MX6 Sololite and Vybrid VF610 support
* imx5 and imx6 clock fixes and additions
* Update clock driver to use of_clk_init() function
* Refactor restart routine mxc_restart() to get it work for DT boot
  as well
* Clean up mxc specific ulpi access ops
* imx defconfig updates

* tag 'imx-soc-3.11' of git://git.linaro.org/people/shawnguo/linux-2.6: (29 commits)
  ARM: imx_v6_v7_defconfig: Enable Vybrid VF610
  ARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default
  ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd
  ARM: imx_v6_v7_defconfig: Enable PWM and backlight options
  ARM: imx: Remove mxc specific ulpi access ops
  ARM: imx: add initial support for VF610
  ARM: imx: add VF610 clock support
  ARM: imx_v6_v7_defconfig: enable parallel display
  ARM: imx: clk: No need to initialize phandle struct
  ARM: imx: irq-common: Include header to avoid sparse warning
  ARM: imx: Enable mx6 solo-lite support
  ARM: imx6: use common of_clk_init() call to initialize clocks
  ARM: imx6q: call of_clk_init() to register fixed rate clocks
  ARM: imx: imx_v6_v7_defconfig: Select CONFIG_DRM_IMX_TVE
  ARM: i.MX6: clk: add different DualLite MLB clock config
  ARM i.MX5: Add S/PDIF clocks
  ARM i.MX53: Add SATA clock
  ARM: imx6q: clk: add the eim_slow clock
  ARM: imx: remove MLB PLL from pllv3
  ARM: imx: disable pll8_mlb in mx6q_clks
  ...

Conflicts:
arch/arm/Kconfig.debug (simple add/add conflict)

Includes an update to 3.10-rc6

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'u300-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/linus...
Arnd Bergmann [Wed, 19 Jun 2013 23:51:18 +0000 (01:51 +0200)]
Merge tag 'u300-multiplatform' of git://git./linux/kernel/git/linusw/linux-stericsson into next/soc

From Linus Walleij:

Device Tree and Multiplatform support for U300:
- Add devicetree support to timer, pinctrl (probe), I2C block,
  watchdog, DMA controller and clocks.
- Piecewise add a device tree containing all peripherals.
- Delete the ATAG boot path.
- Delete redundant platform data and board files.
- Convert to multiplatform.

* tag 'u300-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: (40 commits)
  ARM: u300: switch to using syscon regmap for board
  ARM: u300: Update MMC configs for u300 defconfig
  spi: pl022: use DMA by default when probing from DT
  pinctrl: get rid of all platform data for coh901
  ARM: u300: convert MMC/SD clock to device tree
  ARM: u300: move the gated system controller clocks to DT
  i2c: stu300: do not request a specific clock name
  clk: move the U300 fixed and fixed-factor to DT
  ARM: u300: remove register definition file
  ARM: u300: add syscon node
  ARM: u300 use module_spi_driver to register driver
  ARM: u300: delete remnant machine headers
  ARM: u300: convert to multiplatform
  ARM: u300: localize <mach/u300-regs.h>
  ARM: u300: delete <mach/irqs.h>
  ARM: u300: delete <mach/hardware.h>
  ARM: u300: push down syscon registers
  ARM: u300: remove deps from debug macro
  ARM: u300: move debugmacro to debug includes
  ARM: u300: delete all static board data
  ...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'integrator-pci-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Wed, 19 Jun 2013 23:00:15 +0000 (01:00 +0200)]
Merge tag 'integrator-pci-for-arm-soc' of git://git./linux/kernel/git/linusw/linux-integrator into next/soc

From Linus Walleij:

This is a patch series that:
- Pulls the Integrator/AP PCI bridge driver into one file
- Adds full device tree support for it
- Keeps ATAG support around for the time being

* tag 'integrator-pci-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  ARM: integrator: basic PCIv3 device tree support
  ARM: integrator: move static ioremapping into PCIv3 driver
  ARM: integrator: move VGA base assignment
  ARM: integrator: remap PCIv3 base dynamically
  ARM: integrator: move V3 register definitions into driver
  ARM: integrator: move PCI base address grab to probe
  ARM: integrator: grab PCI error IRQ in probe()
  ARM: integrator: convert PCIv3 bridge to platform device
  ARM: integrator: merge PCIv3 driver into one file
  ARM: pci: create pci_common_init_dev()
  Documentation/devicetree: add a small note on PCI

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'keystone-soc-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Tue, 18 Jun 2013 07:23:04 +0000 (00:23 -0700)]
Merge tag 'keystone-soc-for-arm-soc' of git://git./linux/kernel/git/ssantosh/linux-keystone into next/soc

From Santosh Shilimkar:
SOC support for Keystone II devices:
- Minimal machine and device-tree support with arch_timers and console UART
- Reboot hook using PLL reset
- Low level debug support using UART
- SMP boot support

* tag 'keystone-soc-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone:
  ARM: keystone: Enable SMP support on Keystone machines
  ARM: keystone: Add minimal TI Keystone platform support
  ARM: dts: keystone: Add minimal Keystone SOC device tree data

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoARM: edma: remove unused transfer controller handlers
Matt Porter [Wed, 6 Mar 2013 16:15:32 +0000 (11:15 -0500)]
ARM: edma: remove unused transfer controller handlers

Fix build on OMAP, the irqs are undefined on AM33xx.
These error interrupt handlers were hardcoded as disabled
so since they are unused code, simply remove them.

Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
10 years agoARM: davinci: move private EDMA API to arm/common
Matt Porter [Wed, 6 Mar 2013 16:15:31 +0000 (11:15 -0500)]
ARM: davinci: move private EDMA API to arm/common

Move mach-davinci/dma.c to common/edma.c so it can be used
by OMAP (specifically AM33xx) as well.

Signed-off-by: Matt Porter <mporter@ti.com>
Acked-by: Chris Ball <cjb@laptop.org> # davinci_mmc.c
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
[nsekhar@ti.com: dropped davinci sffsdr changes]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
10 years agoARM: keystone: Enable SMP support on Keystone machines
Santosh Shilimkar [Mon, 10 Jun 2013 16:20:17 +0000 (12:20 -0400)]
ARM: keystone: Enable SMP support on Keystone machines

Add basic SMP support for Keystone machines. This does not
include support for CPU hotplug for now.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
10 years agoARM: keystone: Add minimal TI Keystone platform support
Santosh Shilimkar [Mon, 10 Jun 2013 15:27:13 +0000 (11:27 -0400)]
ARM: keystone: Add minimal TI Keystone platform support

Texas Instruments Keystone family of multi-core devices are
based on ARM Cortex A15. Patch adds basic definitions for a
new Keystone sub-architecture in ARM.

The TCI66xxK2H Communications Infrastructure Keystone SoCs
are member of the C66x family based on TI's new KeyStone 2
multi-core SoC Architecture designed specifically for high
performance wireless and networking infrastructure applications.
The SOCs contains many subsystems like Cortex A15 ARM CorePacs,
C66XX DSP CorePacs, MSMC memory controller, Tera Net bus,
IP Network, Navigator, Hyperlink, 1G/10G Ethernet, Radio layers
and queue based communication systems.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
10 years agoARM: dts: keystone: Add minimal Keystone SOC device tree data
Santosh Shilimkar [Mon, 10 Jun 2013 15:33:31 +0000 (11:33 -0400)]
ARM: dts: keystone: Add minimal Keystone SOC device tree data

Add minimal device tree data for Keystone2 based SOCs. Patch
contains mainly ARM related SOC data and nothing about EVM specific
yet.

Cc: Grant Likely <grant.likely@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
10 years agoARM: u300: switch to using syscon regmap for board
Linus Walleij [Thu, 13 Jun 2013 19:21:31 +0000 (21:21 +0200)]
ARM: u300: switch to using syscon regmap for board

This switches the code using a local remapping of the
system controller to enable the U300 board to be
self-powered over to making the U300-specific syscon
compatible with the MFD generic syscon driver, selecting
the generic syscon driver, and augmenting the board
power code to pick the regmap and manipulate the syscon
from the regmap side of things.

Cc: Dong Aisheng <dong.aisheng@linaro.org>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: Update MMC configs for u300 defconfig
Ulf Hansson [Mon, 27 May 2013 12:41:55 +0000 (14:41 +0200)]
ARM: u300: Update MMC configs for u300 defconfig

Enable MMC_UNSAFE_RESUME to be accomplish a proper suspend/resume cycle
for SD/SDIO/(e)MMC.

ARMMMCI host driver supports clock gating through runtime PM, thus
MMC_CLKGATE is not needed. Moreover ARMMMCI can do scatter-gather which
means we can explicity disable MMC_BLOCK_BOUNCE, since it's default
enabled, to skip unnecessary bounce buffer copying.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agospi: pl022: use DMA by default when probing from DT
Linus Walleij [Thu, 23 May 2013 17:46:40 +0000 (19:46 +0200)]
spi: pl022: use DMA by default when probing from DT

In the past we controlled the selection of DMA for a certain
host by a boolean switch in the platform data. Currently
there is no way to enable DMA on a PL022 probed from the
device tree. Let's default to trying to obtain DMA channels
in the DT case, and then we can always fail (and thus fall
back to PIO mode).

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agopinctrl: get rid of all platform data for coh901
Linus Walleij [Thu, 23 May 2013 18:09:43 +0000 (20:09 +0200)]
pinctrl: get rid of all platform data for coh901

This deletes the dependency on any platform data for
the COH901 pin controller. There is only one user in the
kernel, and if we at some point want to support more
variants, they shall provide their variant info through
the device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: convert MMC/SD clock to device tree
Linus Walleij [Thu, 23 May 2013 17:18:28 +0000 (19:18 +0200)]
ARM: u300: convert MMC/SD clock to device tree

This converts the last of the U300 clocks to being probed from
the device tree.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: move the gated system controller clocks to DT
Linus Walleij [Thu, 23 May 2013 13:42:33 +0000 (15:42 +0200)]
ARM: u300: move the gated system controller clocks to DT

This moves the slow, fast, AHB bridge and "rest" clocks on
the U300 system controller over to registration from the
device tree.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoi2c: stu300: do not request a specific clock name
Linus Walleij [Thu, 23 May 2013 13:26:29 +0000 (15:26 +0200)]
i2c: stu300: do not request a specific clock name

We have used the default clock associated with the block
for a long time, only heuristics in the clock system has
made this work anyway. This needs to be done away with as
we start probing this driver and its clocks exclusively
from the device tree.

Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoclk: move the U300 fixed and fixed-factor to DT
Linus Walleij [Thu, 23 May 2013 09:09:57 +0000 (11:09 +0200)]
clk: move the U300 fixed and fixed-factor to DT

This converts the fixed and fixed-factor clocks in the U300
platform to register themselves from the device tree.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: remove register definition file
Linus Walleij [Wed, 22 May 2013 14:20:27 +0000 (16:20 +0200)]
ARM: u300: remove register definition file

Now that the core file is the only one actually using any
of the base addresses, we can delete that header and move
the base address definitions into the one and only core
file.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: add syscon node
Linus Walleij [Wed, 22 May 2013 14:15:13 +0000 (16:15 +0200)]
ARM: u300: add syscon node

This adds a device tree node for the U300 system controller
and remaps this dynamically instead of using hard-coded
virtual addresses. The board power set-up code is altered
to fetch a reference to the syscon using ampersand <&syscon>
notation. This way of passing a pointer to the syscon will
also be used by the clocks.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300 use module_spi_driver to register driver
Peter Huewe [Mon, 20 May 2013 20:22:04 +0000 (22:22 +0200)]
ARM: u300 use module_spi_driver to register driver

Removing some boilerplate by using module_spi_driver instead of calling
register and unregister in the otherwise empty init/exit functions.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: delete remnant machine headers
Linus Walleij [Thu, 2 May 2013 16:07:11 +0000 (18:07 +0200)]
ARM: u300: delete remnant machine headers

Two files remain in <mach/*> for U300: timex.h and
uncompress.h. The former is done away with by using
defaults, the latter is unused in multiplatform.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: convert to multiplatform
Linus Walleij [Thu, 2 May 2013 16:01:46 +0000 (18:01 +0200)]
ARM: u300: convert to multiplatform

Now that we removed our dependency on <mach/*> the U300
can be converted to mutliplatform. Remove the invalid restriction
that U300 would not support AUTO_ZRELADDR (it does) and update
the defconfig in the process.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: localize <mach/u300-regs.h>
Linus Walleij [Thu, 2 May 2013 15:12:33 +0000 (17:12 +0200)]
ARM: u300: localize <mach/u300-regs.h>

This register base file is now only used in the machine
itself so move it down into mach-u300.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: delete <mach/irqs.h>
Linus Walleij [Thu, 2 May 2013 15:05:05 +0000 (17:05 +0200)]
ARM: u300: delete <mach/irqs.h>

All IRQs are now obtained from the device tree, and this file
is unused, so delete it.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: delete <mach/hardware.h>
Linus Walleij [Thu, 2 May 2013 15:03:03 +0000 (17:03 +0200)]
ARM: u300: delete <mach/hardware.h>

This file is now unused and can be deleted.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: push down syscon registers
Linus Walleij [Thu, 2 May 2013 14:56:15 +0000 (16:56 +0200)]
ARM: u300: push down syscon registers

Get rid of the <mach/syscon.h> header as a prerequisite for
multiplatform support. Do this by pushing the registers down
to their respective drivers and deleting the unused remainder.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: remove deps from debug macro
Linus Walleij [Thu, 2 May 2013 15:00:29 +0000 (17:00 +0200)]
ARM: u300: remove deps from debug macro

This rids the dependency to <mach/hardware.h> (which is an
implicit dependency to <mach/u300-regs.h>) from the U300
debug macro. Take this opportunity to update the file
header.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: move debugmacro to debug includes
Linus Walleij [Thu, 2 May 2013 14:34:19 +0000 (16:34 +0200)]
ARM: u300: move debugmacro to debug includes

This moves the U300 debug macro to the debug headers to
make way for multiplatform support.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: delete all static board data
Linus Walleij [Mon, 22 Apr 2013 09:29:30 +0000 (11:29 +0200)]
ARM: u300: delete all static board data

We have now transferred all the U300 peripherals to the device
tree, so we just select USE_OF, and delete all static board data,
then require that this platform shall be booted using the device
tree and nothing else.

This gets rid of the MMCI (PL180), PL022, and serial PL011
platform data entries and more.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: add FSMC flash into the device tree
Linus Walleij [Mon, 22 Apr 2013 09:00:02 +0000 (11:00 +0200)]
ARM: u300: add FSMC flash into the device tree

This registers the U300 FSMC flash controller from the
device tree, and defines the three partitions. Skip the
BBT scan as in the current platform data.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: probe the U300 dummy-spichip from device tree
Linus Walleij [Sun, 21 Apr 2013 19:39:46 +0000 (21:39 +0200)]
ARM: u300: probe the U300 dummy-spichip from device tree

This probes the U300 dummy-spichip from the device tree
and adds the apropriate node to the tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: add SPI PL022 to the device tree
Linus Walleij [Fri, 19 Apr 2013 12:56:46 +0000 (14:56 +0200)]
ARM: u300: add SPI PL022 to the device tree

This registers the PL022 PrimeCell from the U300 device
tree. We make a new copy of the platform data for the
device tree boot path, as the old platform data is in an
older file which will be going away.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: add the COH 901 318 DMAC to device tree
Linus Walleij [Fri, 19 Apr 2013 11:44:25 +0000 (13:44 +0200)]
ARM: u300: add the COH 901 318 DMAC to device tree

This adds the COH 901 318 DMA controller to the U300
device tree. All devices now converted to device tree
so far will start to find their DMA channels.

Note that the U300 is not yet using the device tree
to obtain DMA channels, but this is a first step.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: augment device tree with DMA channels
Linus Walleij [Thu, 2 May 2013 08:38:52 +0000 (10:38 +0200)]
ARM: u300: augment device tree with DMA channels

This adds DMA channel assignments to the MMC/SD-controller
and the two UARTs already in the U300 device tree, as we
have now defined a way to obtain DMA channels from the
device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agodma: coh901318: add devicetree support
Linus Walleij [Fri, 19 Apr 2013 11:42:55 +0000 (13:42 +0200)]
dma: coh901318: add devicetree support

This adds support for probing the COH 901 318 DMA controller
and channels from the device tree.

Contains portions of a sketch patch from Arnd Bergmann.

Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: enable MMC/SD card from device tree
Linus Walleij [Wed, 10 Apr 2013 12:34:00 +0000 (14:34 +0200)]
ARM: u300: enable MMC/SD card from device tree

This adds support for the U300 MMC/SD card slot from the device
tree boot. No other changes needed.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: support regulators in the device tree
Linus Walleij [Fri, 19 Apr 2013 08:51:59 +0000 (10:51 +0200)]
ARM: u300: support regulators in the device tree

Now that we have enabled board power and the AB3100 regulators,
put the regulator data into the device tree and enable it so
we can start to tie regulators to devices. To begin with we're
only supplying the power to the board itself.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: set up board power from device tree
Linus Walleij [Fri, 19 Apr 2013 08:50:42 +0000 (10:50 +0200)]
ARM: u300: set up board power from device tree

This adds support for setting up the board power from the
device tree on the U300. We use a board-specific node in the
device tree for the S365 board and bind a regulator for the
board power to this node.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: u300: add RTC to device tree
Linus Walleij [Fri, 19 Apr 2013 11:22:57 +0000 (13:22 +0200)]
ARM: u300: add RTC to device tree

This adds the COH 901 331 RTC to the U300 device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agortc: coh901331: add devicetree support
Linus Walleij [Fri, 19 Apr 2013 11:03:13 +0000 (13:03 +0200)]
rtc: coh901331: add devicetree support

This add devicetree probe support to the COH 901 331 RTC
driver.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoARM: imx_v6_v7_defconfig: Enable Vybrid VF610
Fabio Estevam [Sat, 15 Jun 2013 22:14:33 +0000 (19:14 -0300)]
ARM: imx_v6_v7_defconfig: Enable Vybrid VF610

Let VF610 SoC support be built by default.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default
Nicolin Chen [Thu, 13 Jun 2013 11:51:04 +0000 (19:51 +0800)]
ARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default

Enable imx-wm8962 and PM_RUNTIME, essential for WM8962 CODEC driver.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd
Nicolin Chen [Thu, 13 Jun 2013 11:50:56 +0000 (19:50 +0800)]
ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd

WM8962 needs 24MHz clock for its MCLK, so choose PLL4 as the parent of clko1.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx_v6_v7_defconfig: Enable PWM and backlight options
Fabio Estevam [Thu, 6 Jun 2013 15:56:30 +0000 (12:56 -0300)]
ARM: imx_v6_v7_defconfig: Enable PWM and backlight options

These options are useful for controlling backlight contrast via PWM.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: Remove mxc specific ulpi access ops
Markus Pargmann [Thu, 6 Jun 2013 12:41:57 +0000 (14:41 +0200)]
ARM: imx: Remove mxc specific ulpi access ops

There are ulpi access ops implemented in drivers/usb/phy/phy-ulpi.c.
mxc access ops implement the same access operations within mach-imx. This
patch removes the mxc ulpi file and uses phy-ulpi instead for
imx_otg_ulpi_create.

phy-ulpi successfully tested with i.MX27 Phytec phyCARD-S (pca100).

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: add initial support for VF610
Jingchang Lu [Tue, 28 May 2013 09:12:21 +0000 (17:12 +0800)]
ARM: imx: add initial support for VF610

Add initial support for Freescale Vybrid VF610 SoC.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: add VF610 clock support
Jingchang Lu [Tue, 28 May 2013 09:12:20 +0000 (17:12 +0800)]
ARM: imx: add VF610 clock support

Add clock support for Vybrid VF610. It uses dtc macro support to
define all clock IDs in vf610-clock.h to keep clock IDs coherence
between kernel and DT.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx_v6_v7_defconfig: enable parallel display
Rogerio Pimentel [Fri, 24 May 2013 14:09:31 +0000 (11:09 -0300)]
ARM: imx_v6_v7_defconfig: enable parallel display

Enable paralell display by default

Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: clk: No need to initialize phandle struct
Fabio Estevam [Fri, 24 May 2013 19:55:42 +0000 (16:55 -0300)]
ARM: imx: clk: No need to initialize phandle struct

commit 84344b43c (ARM: i.MX5: Allow DT clock providers) introduce the following
sparse warning:

arch/arm/mach-imx/clk.c:12:43: warning: Using plain integer as NULL pointer

There is no need to initialize phandle, so remove it.

Cc: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: irq-common: Include header to avoid sparse warning
Fabio Estevam [Fri, 24 May 2013 19:55:41 +0000 (16:55 -0300)]
ARM: imx: irq-common: Include header to avoid sparse warning

Fix the following sparse warning:

arch/arm/mach-imx/irq-common.c:24:5: warning: symbol 'mxc_set_irq_fiq' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: Enable mx6 solo-lite support
Fabio Estevam [Thu, 23 May 2013 23:41:48 +0000 (20:41 -0300)]
ARM: imx: Enable mx6 solo-lite support

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx6: use common of_clk_init() call to initialize clocks
Shawn Guo [Tue, 21 May 2013 01:58:51 +0000 (09:58 +0800)]
ARM: imx6: use common of_clk_init() call to initialize clocks

Instead of explicitly calling clock initialization functions, we can
declare the functions with CLK_OF_DECLARE() and then call common
of_clk_init() to have them invoked properly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx6q: call of_clk_init() to register fixed rate clocks
Shawn Guo [Mon, 20 May 2013 14:39:19 +0000 (22:39 +0800)]
ARM: imx6q: call of_clk_init() to register fixed rate clocks

As the fixed rate clocks are defined in device tree, we can just call
of_clk_init() to register them.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: imx_v6_v7_defconfig: Select CONFIG_DRM_IMX_TVE
Fabio Estevam [Mon, 20 May 2013 13:59:57 +0000 (10:59 -0300)]
ARM: imx: imx_v6_v7_defconfig: Select CONFIG_DRM_IMX_TVE

Let the mx53 TVE driver be built by default.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: i.MX6: clk: add different DualLite MLB clock config
Dirk Behme [Sat, 18 May 2013 07:25:28 +0000 (09:25 +0200)]
ARM: i.MX6: clk: add different DualLite MLB clock config

The CCM_CBCMR register (address 0x02C4018) has different meaning
between the i.MX6 Quad/Dual and the i.MX6 Solo/DualLite.

Compared to the i.MX6 Quad/Dual, the CCM_CBCMR register in the
i.MX6 Solo/DualLite reuses the gpu2d_core bits for the MLB clock
configuration.

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM i.MX5: Add S/PDIF clocks
Philipp Zabel [Fri, 17 May 2013 13:49:03 +0000 (15:49 +0200)]
ARM i.MX5: Add S/PDIF clocks

This patch adds the S/PDIF clocks for i.MX51 and i.MX53. Tested on i.MX53.
The i.MX51 has a second set of spdif_root clock dividers, and on i.MX53
there is an additional input to the spdif_xtal mux.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM i.MX53: Add SATA clock
Sascha Hauer [Fri, 17 May 2013 13:49:02 +0000 (15:49 +0200)]
ARM i.MX53: Add SATA clock

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx6q: clk: add the eim_slow clock
Huang Shijie [Fri, 17 May 2013 09:15:23 +0000 (17:15 +0800)]
ARM: imx6q: clk: add the eim_slow clock

Add the eim_slow clock, since the weim needs it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: remove MLB PLL from pllv3
Jiada Wang [Fri, 17 May 2013 08:40:45 +0000 (17:40 +0900)]
ARM: imx: remove MLB PLL from pllv3

MLB PLL should be handled internally in MLB driver,
so remove it from pllv3.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
CC: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: disable pll8_mlb in mx6q_clks
Jiada Wang [Fri, 17 May 2013 08:40:44 +0000 (17:40 +0900)]
ARM: imx: disable pll8_mlb in mx6q_clks

The MLB PLL clock's operation doesn't fit for clock framework and
it should be handled internally in MLB driver.
Remove initialization of pll8_mlb clock device but leave its
declaration in mx6q_clks to avoid affecting imx6q clock numbering.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
CC: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: add initial support for imx6sl
Shawn Guo [Fri, 3 May 2013 03:24:47 +0000 (11:24 +0800)]
ARM: imx: add initial support for imx6sl

Add initial support for i.MX6 SoloLite.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: enable low-level debug support for imx6sl
Shawn Guo [Fri, 3 May 2013 03:21:03 +0000 (11:21 +0800)]
ARM: imx: enable low-level debug support for imx6sl

Enable low-level debug support for i.MX6 SoloLite by adding the debug
port definitions for the SoC.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: add clock support for imx6sl
Shawn Guo [Fri, 3 May 2013 03:06:46 +0000 (11:06 +0800)]
ARM: imx: add clock support for imx6sl

Add clock support for i.MX6 SoloLite.  It uses the dtc marco support to
define all clock IDs in imx6sl-clock.h, which will be included by both
clock driver and device tree sources, so that the data will stay sync
all the time between kernel and DT.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: create mxc_arch_reset_init_dt() for DT boot
Shawn Guo [Fri, 10 May 2013 02:19:01 +0000 (10:19 +0800)]
ARM: imx: create mxc_arch_reset_init_dt() for DT boot

The mxc_arch_reset_init() uses static mapping and calls clk_get_sys() to
get clock.  It's suitable for non-DT boot but not for DT boot where
dynamic mapping and of_clk_get() should be used instead.  Create
mxc_arch_reset_init_dt() as the DT variant of mxc_arch_reset_init(),
and change DT platforms to use it.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: move clk_prepare() out from mxc_restart()
Shawn Guo [Fri, 10 May 2013 01:13:44 +0000 (09:13 +0800)]
ARM: imx: move clk_prepare() out from mxc_restart()

It's inappropriate to call clk_prepare() in mxc_restart(), because the
restart routine could be called in atomic context.  Move clk_get() and
clk_prepare() into mxc_arch_reset_init() and only have the atomic part
clk_enable() be called in mxc_restart().

As a result, mxc_arch_reset_init() needs to be called after clk gets
initialized.

While there, it also changes printk(KERN_ERR ...) to pr_err() and adds
__init annotation for mxc_arch_reset_init().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: imx: include <asm/io.h> in hardware.h
Shawn Guo [Fri, 10 May 2013 01:08:07 +0000 (09:08 +0800)]
ARM: imx: include <asm/io.h> in hardware.h

As IOMEM is referenced in hardware.h, <asm/io.h> should be included
there.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: i.MX6: clk: add i.MX6 DualLite differences
Dirk Behme [Fri, 3 May 2013 09:08:45 +0000 (11:08 +0200)]
ARM: i.MX6: clk: add i.MX6 DualLite differences

The CCM_CBCMR register (address 0x02C4018) has different meaning
between the i.MX6 Quad/Dual and the i.MX6 Solo/DualLite.

Compared to the i.MX6 Quad/Dual, the CCM_CBCMR register in the
i.MX6 Solo/DualLite doesn't have a gpu3d_shader configuration and
moves the gpu2_core configuration at that place.

Handle these i.MX6 Quad/Dual vs. i.MX6 Solo/DualLite clock differences
by using cpu_is_mx6dl().

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoARM: i.MX6: add i.MX6 specific L2 cache configuration
Dirk Behme [Fri, 26 Apr 2013 08:13:56 +0000 (10:13 +0200)]
ARM: i.MX6: add i.MX6 specific L2 cache configuration

To improve the performance and power consumption add an i.MX6
specific L2 cache initialization.

This configuration is taken from Freescale's kernel patch

"ENGR00153601 [MX6]Adjust L2 cache parameter" [1]

with two additional improvements:

a) The L2X0_POWER_CTRL has only the two bits we set. So no need
   to read the register before. Remove the register read done
   in Freescale's patch.

b) In the L2X0_PREFETCH_CTRL register, besides the double linefill (bit[30]),
   additionally enable the instruction and data prefetch (bit[29-28]).

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[1] http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/arch/arm/mach-mx6/mm.c?h=imx_3.0.35_12.09.01&id=814656410b40c67a10b25300e51b0477b2bb96d1

10 years agoARM: i.MX5: Allow DT clock providers
Martin Fuzzey [Tue, 23 Apr 2013 12:16:59 +0000 (20:16 +0800)]
ARM: i.MX5: Allow DT clock providers

Currently clock providers defined in the DT are not registered
on i.MX5 platforms since of_clk_init() is not called.

This is not a problem for the SOC's own clocks, which are registered
in code,  but prevents the DT being used to define clocks for external
hardware.

Fix this by calling of_clk_init() and actually using the DT to obtain
the 4 SOC fixed clocks.
These are already defined in the DT but were previously just used to
manually obtain the rate.

Fall back to the old scheme for non DT platforms.

Since the same method may be useful for other i.MX platforms
implement the imx_obtain_fixed_clock() function in common code.

Actually changing other i.MX platforms to use this should be done
later by someone with access to the appropriate hardware.

Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoLinux 3.10-rc6 v3.10-rc6
Linus Torvalds [Sat, 15 Jun 2013 21:51:07 +0000 (11:51 -1000)]
Linux 3.10-rc6

10 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sat, 15 Jun 2013 21:49:48 +0000 (11:49 -1000)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "These are a little later than I planned on since I got caught up with
  handling merges for 3.11 most of the week.

  Another week, another batch of fixes for arm-soc platforms.

  Again, nothing controversial.  A few more than would be ideal, but all
  are valid fixes.  In particular the prima2 panic patch is critical
  since it fixes a problem where multiplatform kernels panic on all but
  prima2 hardware."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: SAMSUNG: pm: Adjust for pinctrl- and DT-enabled platforms
  ARM: prima2: fix incorrect panic usage
  arm: mvebu: armada-xp-{gp,openblocks-ax3-4}: specify PCIe range
  ARM: Kirkwood: handle mv88f6282 cpu in __kirkwood_variant().
  ARM: omap3: clock: fix wrong container_of in clock36xx.c
  ARM: dts: OMAP5: Fix missing PWM capability to timer nodes
  ARM: dts: omap4-panda|sdp: Fix mux for twl6030 IRQ pin and msecure line
  ARM: dts: AM33xx: Fix properties on gpmc node
  arm: omap2: fix AM33xx hwmod infos for UART2
  ARM: OMAP3: Fix iva2_pwrdm settings for 3703

10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sat, 15 Jun 2013 21:47:56 +0000 (11:47 -1000)]
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Fix RTNL locking in batman-adv, from Matthias Schiffer.

 2) Don't allow non-passthrough macvlan devices to set NOPROMISC via
    netlink, otherwise we can end up with corrupted promisc counter
    values on the device.  From Michael S Tsirkin.

 3) Fix stmmac driver build with debugging defines enabled, from Dinh
    Nguyen.

 4) Make sure name string we give in socket address in AF_PACKET is NULL
    terminated, from Daniel Borkmann.

 5) Fix leaking of two uninitialized bytes of memory to userspace in
    l2tp, from Guillaume Nault.

 6) Clear IPCB(skb) before tunneling otherwise we touch dangling IP
    options state and crash.  From Saurabh Mohan.

 7) Fix suspend/resume for davinci_mdio by using suspend_late and
    resume_early.  From Mugunthan V N.

 8) Don't tag ip_tunnel_init_net and ip_tunnel_delete_net with
    __net_{init,exit}, they can be called outside of those contexts.
    From Eric Dumazet.

 9) Fix RX length error in sh_eth driver, from Yoshihiro Shimoda.

10) Fix missing sctp_outq initialization in some code paths of SCTP
    stack, from Neil Horman.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits)
  sctp: fully initialize sctp_outq in sctp_outq_init
  netiucv: Hold rtnl between name allocation and device registration.
  tulip: Properly check dma mapping result
  net: sh_eth: fix incorrect RX length error if R8A7740
  ip_tunnel: remove __net_init/exit from exported functions
  drivers: net: davinci_mdio: restore mdio clk divider in mdio resume
  drivers: net: davinci_mdio: moving mdio resume earlier than cpsw ethernet driver
  net/ipv4: ip_vti clear skb cb before tunneling.
  tg3: Wait for boot code to finish after power on
  l2tp: Fix sendmsg() return value
  l2tp: Fix PPP header erasure and memory leak
  bonding: fix igmp_retrans type and two related races
  bonding: reset master mac on first enslave failure
  packet: packet_getname_spkt: make sure string is always 0-terminated
  net: ethernet: stmicro: stmmac: Fix compile error when STMMAC_XMIT_DEBUG used
  be2net: Fix 32-bit DMA Mask handling
  xen-netback: don't de-reference vif pointer after having called xenvif_put()
  macvlan: don't touch promisc without passthrough
  batman-adv: Don't handle address updates when bla is disabled
  batman-adv: forward late OGMs from best next hop
  ...

10 years agoARM: integrator: basic PCIv3 device tree support
Linus Walleij [Fri, 1 Mar 2013 01:20:55 +0000 (02:20 +0100)]
ARM: integrator: basic PCIv3 device tree support

This registers the memory ranges for I/O, non-prefetched and
prefetched memory and configuration space for the PCIv3 bridge
and let us fetch these basic memory resources from the device
tree in the device tree boot path. Remove the stepping stone
platform device. This is an either/or approach - the platform
data path is mutually exclusive to the plain platform data
path and provided addresses from the device tree have to be
correct.

This adds the interrupt-map property to the PCIv3 DTS file
and makes the bridge obtain mappings from the device tree.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Sat, 15 Jun 2013 05:25:04 +0000 (19:25 -1000)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Pull powerpc fixes from Benjamin Herrenschmidt:
 "So here are 3 fixes still for 3.10.  Fixes are simple, bugs are nasty
  (though not recent regressions, nasty enough) and all targeted at
  stable"

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Fix missing/delayed calls to irq_work
  powerpc: Fix emulation of illegal instructions on PowerNV platform
  powerpc: Fix stack overflow crash in resume_kernel when ftracing

10 years agosmp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu().
David Daney [Fri, 14 Jun 2013 18:13:59 +0000 (11:13 -0700)]
smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu().

Thanks to commit f91eb62f71b3 ("init: scream bloody murder if interrupts
are enabled too early"), "bloody murder" is now being screamed.

With a MIPS OCTEON config, we use on_each_cpu() in our
irq_chip.irq_bus_sync_unlock() function.  This gets called in early as a
result of the time_init() call.  Because the !SMP version of
on_each_cpu() unconditionally enables irqs, we get:

    WARNING: at init/main.c:560 start_kernel+0x250/0x410()
    Interrupts were enabled early
    CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.0-rc5-Cavium-Octeon+ #801
    Call Trace:
      show_stack+0x68/0x80
      warn_slowpath_common+0x78/0xb0
      warn_slowpath_fmt+0x38/0x48
      start_kernel+0x250/0x410

Suggested fix: Do what we already do in the SMP version of
on_each_cpu(), and use local_irq_save/local_irq_restore.  Because we
need a flags variable, make it a static inline to avoid name space
issues.

[ Change from v1: Convert on_each_cpu to a static inline function, add
  #include <linux/irqflags.h> to avoid build breakage on some files.

  on_each_cpu_mask() and on_each_cpu_cond() suffer the same problem as
  on_each_cpu(), but they are not causing !SMP bugs for me, so I will
  defer changing them to a less urgent patch. ]

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sat, 15 Jun 2013 05:18:56 +0000 (19:18 -1000)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull VFS fixes from Al Viro:
 "Several fixes + obvious cleanup (you've missed a couple of open-coded
  can_lookup() back then)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  snd_pcm_link(): fix a leak...
  use can_lookup() instead of direct checks of ->i_op->lookup
  move exit_task_namespaces() outside of exit_notify()
  fput: task_work_add() can fail if the caller has passed exit_task_work()
  ncpfs: fix rmdir returns Device or resource busy

10 years agoMerge tag 'for-linus-v3.10-rc6' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Sat, 15 Jun 2013 05:16:31 +0000 (19:16 -1000)]
Merge tag 'for-linus-v3.10-rc6' of git://oss.sgi.com/xfs/xfs

Pull xfs fixes from Ben Myers:
 - Remove noisy warnings about experimental support which spams the logs
 - Add padding to align directory and attr structures correctly
 - Set block number on child buffer on a root btree split
 - Disable verifiers during log recovery for non-CRC filesystems

* tag 'for-linus-v3.10-rc6' of git://oss.sgi.com/xfs/xfs:
  xfs: don't shutdown log recovery on validation errors
  xfs: ensure btree root split sets blkno correctly
  xfs: fix implicit padding in directory and attr CRC formats
  xfs: don't emit v5 superblock warnings on write

10 years agoMerge tag 'char-misc-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sat, 15 Jun 2013 05:15:36 +0000 (19:15 -1000)]
Merge tag 'char-misc-3.10-rc5' of git://git./linux/kernel/git/gregkh/char-misc

Pull char / misc fixes from Greg Kroah-Hartman:
 "Here are some small mei driver fixes for 3.10-rc6 that fix some
  reported problems"

* tag 'char-misc-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  mei: me: clear interrupts on the resume path
  mei: nfc: fix nfc device freeing
  mei: init: Flush scheduled work before resetting the device

10 years agoMerge tag 'usb-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sat, 15 Jun 2013 05:14:39 +0000 (19:14 -1000)]
Merge tag 'usb-3.10-rc5' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are some small USB driver fixes that resolve some reported
  problems for 3.10-rc6

  Nothing major, just 3 USB serial driver fixes, and two chipidea fixes"

* tag 'usb-3.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: chipidea: fix id change handling
  usb: chipidea: fix no transceiver case
  USB: pl2303: fix device initialisation at open
  USB: spcp8x5: fix device initialisation at open
  USB: f81232: fix device initialisation at open

10 years agopowerpc: Fix missing/delayed calls to irq_work
Benjamin Herrenschmidt [Sat, 15 Jun 2013 02:13:40 +0000 (12:13 +1000)]
powerpc: Fix missing/delayed calls to irq_work

When replaying interrupts (as a result of the interrupt occurring
while soft-disabled), in the case of the decrementer, we are exclusively
testing for a pending timer target. However we also use decrementer
interrupts to trigger the new "irq_work", which in this case would
be missed.

This change the logic to force a replay in both cases of a timer
boundary reached and a decrementer interrupt having actually occurred
while disabled. The former test is still useful to catch cases where
a CPU having been hard-disabled for a long time completely misses the
interrupt due to a decrementer rollover.

CC: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
10 years agopowerpc: Fix emulation of illegal instructions on PowerNV platform
Paul Mackerras [Fri, 14 Jun 2013 10:07:41 +0000 (20:07 +1000)]
powerpc: Fix emulation of illegal instructions on PowerNV platform

Normally, the kernel emulates a few instructions that are unimplemented
on some processors (e.g. the old dcba instruction), or privileged (e.g.
mfpvr).  The emulation of unimplemented instructions is currently not
working on the PowerNV platform.  The reason is that on these machines,
unimplemented and illegal instructions cause a hypervisor emulation
assist interrupt, rather than a program interrupt as on older CPUs.
Our vector for the emulation assist interrupt just calls
program_check_exception() directly, without setting the bit in SRR1
that indicates an illegal instruction interrupt.  This fixes it by
making the emulation assist interrupt set that bit before calling
program_check_interrupt().  With this, old programs that use no-longer
implemented instructions such as dcba now work again.

CC: <stable@vger.kernel.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc: Fix stack overflow crash in resume_kernel when ftracing
Michael Ellerman [Thu, 13 Jun 2013 11:04:56 +0000 (21:04 +1000)]
powerpc: Fix stack overflow crash in resume_kernel when ftracing

It's possible for us to crash when running with ftrace enabled, eg:

  Bad kernel stack pointer bffffd12 at c00000000000a454
  cpu 0x3: Vector: 300 (Data Access) at [c00000000ffe3d40]
      pc: c00000000000a454: resume_kernel+0x34/0x60
      lr: c00000000000335c: performance_monitor_common+0x15c/0x180
      sp: bffffd12
     msr: 8000000000001032
     dar: bffffd12
   dsisr: 42000000

If we look at current's stack (paca->__current->stack) we see it is
equal to c0000002ecab0000. Our stack is 16K, and comparing to
paca->kstack (c0000002ecab3e30) we can see that we have overflowed our
kernel stack. This leads to us writing over our struct thread_info, and
in this case we have corrupted thread_info->flags and set
_TIF_EMULATE_STACK_STORE.

Dumping the stack we see:

  3:mon> t c0000002ecab0000
  [c0000002ecab0000c00000000002131c .performance_monitor_exception+0x5c/0x70
  [c0000002ecab0080c00000000000335c performance_monitor_common+0x15c/0x180
  --- Exception: f01 (Performance Monitor) at c0000000000fb2ec .trace_hardirqs_off+0x1c/0x30
  [c0000002ecab0370c00000000016fdb0 .trace_graph_entry+0xb0/0x280 (unreliable)
  [c0000002ecab0410c00000000003d038 .prepare_ftrace_return+0x98/0x130
  [c0000002ecab04b0c00000000000a920 .ftrace_graph_caller+0x14/0x28
  [c0000002ecab0520c0000000000d6b58 .idle_cpu+0x18/0x90
  [c0000002ecab05a0c00000000000a934 .return_to_handler+0x0/0x34
  [c0000002ecab0620c00000000001e660 .timer_interrupt+0x160/0x300
  [c0000002ecab06d0c0000000000025dc decrementer_common+0x15c/0x180
  --- Exception: 901 (Decrementer) at c0000000000104d4 .arch_local_irq_restore+0x74/0xa0
  [c0000002ecab09c0c0000000000fe044 .trace_hardirqs_on+0x14/0x30 (unreliable)
  [c0000002ecab0fb0c00000000016fe3c .trace_graph_entry+0x13c/0x280
  [c0000002ecab1050c00000000003d038 .prepare_ftrace_return+0x98/0x130
  [c0000002ecab10f0c00000000000a920 .ftrace_graph_caller+0x14/0x28
  [c0000002ecab1160c0000000000161f0 .__ppc64_runlatch_on+0x10/0x40
  [c0000002ecab11d0c00000000000a934 .return_to_handler+0x0/0x34
  --- Exception: 901 (Decrementer) at c0000000000104d4 .arch_local_irq_restore+0x74/0xa0

  ... and so on

__ppc64_runlatch_on() is called from RUNLATCH_ON in the exception entry
path. At that point the irq state is not consistent, ie. interrupts are
hard disabled (by the exception entry), but the paca soft-enabled flag
may be out of sync.

This leads to the local_irq_restore() in trace_graph_entry() actually
enabling interrupts, which we do not want. Because we have not yet
reprogrammed the decrementer we immediately take another decrementer
exception, and recurse.

The fix is twofold. Firstly make sure we call DISABLE_INTS before
calling RUNLATCH_ON. The badly named DISABLE_INTS actually reconciles
the irq state in the paca with the hardware, making it safe again to
call local_irq_save/restore().

Although that should be sufficient to fix the bug, we also mark the
runlatch routines as notrace. They are called very early in the
exception entry and we are asking for trouble tracing them. They are
also fairly uninteresting and tracing them just adds unnecessary
overhead.

[ This regression was introduced by fe1952fc0afb9a2e4c79f103c08aef5d13db1873
  "powerpc: Rework runlatch code" by myself --BenH
]

CC: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agosnd_pcm_link(): fix a leak...
Al Viro [Wed, 5 Jun 2013 18:07:08 +0000 (14:07 -0400)]
snd_pcm_link(): fix a leak...

in case when snd_pcm_stream_linked(substream) is true, we end up leaking
group.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agouse can_lookup() instead of direct checks of ->i_op->lookup
Al Viro [Thu, 6 Jun 2013 23:33:47 +0000 (19:33 -0400)]
use can_lookup() instead of direct checks of ->i_op->lookup

a couple of places got missed back when Linus has introduced that one...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agomove exit_task_namespaces() outside of exit_notify()
Oleg Nesterov [Fri, 14 Jun 2013 19:09:49 +0000 (21:09 +0200)]
move exit_task_namespaces() outside of exit_notify()

exit_notify() does exit_task_namespaces() after
forget_original_parent(). This was needed to ensure that ->nsproxy
can't be cleared prematurely, an exiting child we are going to
reparent can do do_notify_parent() and use the parent's (ours) pid_ns.

However, after 32084504 "pidns: use task_active_pid_ns in
do_notify_parent" ->nsproxy != NULL is no longer needed, we rely
on task_active_pid_ns().

Move exit_task_namespaces() from exit_notify() to do_exit(), after
exit_fs() and before exit_task_work().

This solves the problem reported by Andrey, free_ipc_ns()->shm_destroy()
does fput() which needs task_work_add().

Note: this particular problem can be fixed if we change fput(), and
that change makes sense anyway. But there is another reason to move
the callsite. The original reason for exit_task_namespaces() from
the middle of exit_notify() was subtle and it has already gone away,
now this looks confusing. And this allows us do simplify exit_notify(),
we can avoid unlock/lock(tasklist) and we can use ->exit_state instead
of PF_EXITING in forget_original_parent().

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agofput: task_work_add() can fail if the caller has passed exit_task_work()
Oleg Nesterov [Fri, 14 Jun 2013 19:09:47 +0000 (21:09 +0200)]
fput: task_work_add() can fail if the caller has passed exit_task_work()

fput() assumes that it can't be called after exit_task_work() but
this is not true, for example free_ipc_ns()->shm_destroy() can do
this. In this case fput() silently leaks the file.

Change it to fallback to delayed_fput_work if task_work_add() fails.
The patch looks complicated but it is not, it changes the code from

if (PF_KTHREAD) {
schedule_work(...);
return;
}
task_work_add(...)

to
if (!PF_KTHREAD) {
if (!task_work_add(...))
return;
/* fallback */
}
schedule_work(...);

As for shm_destroy() in particular, we could make another fix but I
think this change makes sense anyway. There could be another similar
user, it is not safe to assume that task_work_add() can't fail.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agoMerge tag 'tegra-for-3.11-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/swarr...
Olof Johansson [Sat, 15 Jun 2013 01:11:31 +0000 (18:11 -0700)]
Merge tag 'tegra-for-3.11-soc' of git://git./linux/kernel/git/swarren/linux-tegra into next/soc

From Stephen Warren:
ARM: tegra: core SoC support enhancements

This branch contains fixes and enhancement for core Tegra Soc support:
* CPU hotplug support for Tegra114.
* Some preliminary work on Tegra114 CPU sleep modes.
* Minor fix for EMC table DT parsing.

* tag 'tegra-for-3.11-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: don't pass CPU ID to tegra_{set,clear}_cpu_in_lp2
  ARM: tegra: cpuidle: using IS_ENABLED for multi SoCs management in init func
  ARM: tegra: hook tegra_tear_down_cpu function in the PM suspend init function
  ARM: tegra: cpuidle: move the init function behind the suspend init function
  ARM: tegra: remove ifdef in the tegra_resume
  ARM: tegra: add cpu_disable for hotplug
  ARM: tegra114: add CPU hotplug support
  clk: tegra114: implement wait_for_reset and disable_clock for tegra_cpu_car_ops
  ARM: tegra114: add power up sequence for warm boot CPU
  ARM: tegra: make tegra_resume can work for Tegra114
  ARM: tegra: skip SCU and PL310 code when CPU is not Cortex-A9
  ARM: tegra: add an assembly marco to check Tegra SoC ID
  ARM: tegra: emc: correction of ram-code parsing from dt

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'renesas-soc2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
Olof Johansson [Sat, 15 Jun 2013 01:00:00 +0000 (18:00 -0700)]
Merge tag 'renesas-soc2-for-v3.11' of git://git./linux/kernel/git/horms/renesas into next/soc

From Simon Horman:
Second Round of Renesas ARM-based SoC updates for v3.11

* Ether device name updates for r8a7778 and r8a7779 Sergei Shtylyov
* Extended clock and driver coverage for r8a7778 by Goda-san and Morimoto-san
* Extended clock and coverage for r8a73a4 and r8a7790 by  Guennadi Liakhovetski
* HSCIF support for r8a7790 by Ulrich Hecht

* tag 'renesas-soc2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: add clock definitions and aliases for MMCIF and SDHI
  ARM: shmobile: r8a73a4: add clock definitions and aliases for MMCIF and SDHI
  ARM: shmobile: r8a7778: add support MMC driver
  ARM: shmobile: r8a7778: add support HSPI driver
  ARM: shmobile: r8a7778: add support I2C driver
  ARM: shmobile: r8a7778: add support MMC clock
  ARM: shmobile: r8a7778: add support HSPI clock
  ARM: shmobile: r8a7778: add support I2C clock
  ARM: shmobile: r8a7790: HSCIF support
  ARM: shmobile: r8a7778: fix Ether device name
  ARM: shmobile: r8a7779: fix Ether device name

Signed-off-by: Olof Johansson <olof@lixom.net>
Conflicts:
arch/arm/mach-shmobile/clock-r8a7778.c
arch/arm/mach-shmobile/include/mach/r8a7778.h

10 years agoMerge tag 'renesas-phy-rcar-usb-for-v3.11' of git://git.kernel.org/pub/scm/linux...
Olof Johansson [Sat, 15 Jun 2013 00:36:30 +0000 (17:36 -0700)]
Merge tag 'renesas-phy-rcar-usb-for-v3.11' of git://git./linux/kernel/git/horms/renesas into next/soc

From Simon Horman:
Renesas USB updates for v3.11

These updates are by Sergei Shtylyov to clean-up USB support
present for R8A7779/Marzen and then extend USB support coverage to
R8A7778/BOCK-W.

* tag 'renesas-phy-rcar-usb-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: BOCK-W: add USB support
  ARM: shmobile: r8a7778: add USB support
  phy-rcar-usb: add R8A7778 support
  phy-rcar-usb: handle platform data
  ARM: shmobile: Marzen: pass platform data to USB PHY device
  phy-rcar-usb: add platform data
  phy-rcar-usb: correct base address
  ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
  phy-rcar-usb: remove EHCI internal buffer setup
  ARM: shmobile: r8a7779: setup EHCI internal buffer
  ehci-platform: add pre_setup() method to platform data
  ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code

Conflicts:
arch/arm/mach-shmobile/board-marzen.c
arch/arm/mach-shmobile/setup-r8a7778.c

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'regmap-3.11' of git://git.infradead.org/users/jcooper/linux into next/soc
Olof Johansson [Fri, 14 Jun 2013 22:18:25 +0000 (15:18 -0700)]
Merge tag 'regmap-3.11' of git://git.infradead.org/users/jcooper/linux into next/soc

mvebu register map changes for v3.11

This series removes the hardcoded register base address for mvebu.

Depends:
 - mvebu/fixes-non-critical (up to tags/fixes-non-3.11-1)
 - mvebu/cleanup (up to tags/cleanup-3.11-3)

* tag 'regmap-3.11' of git://git.infradead.org/users/jcooper/linux:
  arm: mvebu: disable DEBUG_LL/EARLY_PRINTK in defconfig
  arm: mvebu: add another earlyprintk Kconfig option
  arm: mvebu: don't hardcode the physical address for mvebu-mbus
  arm: mvebu: don't hardcode a physical address in headsmp.S
  arm: mvebu: remove hardcoded static I/O mapping
  arm: mvebu: move cache and mvebu-mbus initialization later
  arm: mvebu: avoid hardcoded virtual address in coherency code
  arm: mvebu: remove dependency of SMP init on static I/O mapping
  arm: mvebu: fix length of Ethernet registers area in .dtsi
  arm: mvebu: fix length of SATA registers area in .dtsi
  arm: mvebu: mark functions of armada-370-xp.c as static
  ARM: mvebu: Remove init_irq declaration in machine description
  ARM: Orion: Remove redundant init_dma_coherent_pool_size()

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'omap-for-v3.11/omap5-signed' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Fri, 14 Jun 2013 21:33:11 +0000 (14:33 -0700)]
Merge tag 'omap-for-v3.11/omap5-signed' of git://git./linux/kernel/git/tmlind/linux-omap into next/soc

From Tony Lindgren:
Omap5 SoC data via Paul Walmsley <paul@pwsan.com:

Add support for the OMAP5 SoC family.

As part of the transition to DT, no board files will be used
for OMAP5.  The hwmod data is gradually being transitioned
away from arch/arm/mach-omap2: IRQ, DMA, and memory map data
has been moved to DT.  Hopefully the dev_attr and clock role
data will be the next step.

Basic test logs are available here, although not for OMAP5,
since I don't have an OMAP5 board:
http://www.pwsan.com/omap/testlogs/omap5_v3.10/20130608130949/

* tag 'omap-for-v3.11/omap5-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP5: Remove unused include for ocp2scp
  ARM: OMAP5: Enable build and frameowrk initialisations
  ARM: OMAP5: voltagedomain data: Add OMAP5 voltage domain data
  ARM: OMAP5: hwmod data: Create initial OMAP5 SOC hwmod data
  ARM: OMAP5: powerdomain data: Add OMAP54XX data and update the header
  ARM: OMAP5: clockdomain data: Add OMAP54XX data and update the header
  ARM: OMAP5: SCRM: Add OMAP54XX header file.
  ARM: OMAP5: PRCM: Add OMAP54XX local MPU PRCM registers
  ARM: OMAP4+: PRCM MPU: Move function prototypes to common header for re-use
  ARM: OMAP5: CM: Add OMAP54XX register and bitfield files
  ARM: OMAP4+: CM: Move function prototypes to common header for re-use
  ARM: OMAP5: PRM: Add OMAP54XX register and bitfield files
  ARM: OMAP4+: PRM: Move function prototypes to common header for re-use

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'omap-for-v3.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Fri, 14 Jun 2013 21:31:36 +0000 (14:31 -0700)]
Merge tag 'omap-for-v3.11/soc-signed' of git://git./linux/kernel/git/tmlind/linux-omap into next/soc

From Tony Lindgren:
Omap SoC changes. Mostly improves am33xx support, and adds
minimal support for am43x SoCs.

* tag 'omap-for-v3.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: AM43x: SRAM base and size
  ARM: OMAP2+: AM43x: GP or HS ?
  ARM: OMAP2+: AM43x: early init
  ARM: OMAP2+: AM43x: static mapping
  ARM: OMAP2+: AM437x: SoC revision detection
  ARM: OMAP2+: AM43x: soc_is support
  ARM: OMAP2+: AM43x: kbuild
  ARM: OMAP2+: AM43x: Kconfig
  ARM: OMAP2+: separate out OMAP4 restart
  ARM: AM33XX: clk: Add clock node for EHRPWM TBCLK
  ARM: OMAP3: clock data: get rid of unused USB host clock aliases and dummies
  ARM: OMAP2+: AM33xx: Add missing reset status info to GFX hwmod
  + Linux 3.10-rc5

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'omap-for-v3.11/pm-signed' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Fri, 14 Jun 2013 21:30:23 +0000 (14:30 -0700)]
Merge tag 'omap-for-v3.11/pm-signed' of git://git./linux/kernel/git/tmlind/linux-omap into next/soc

From Tony Lindgren:
Omap PM changes via Kevin Hilman <khilman@linaro.org>:

OMAP PM cleanups for v3.10

* tag 'omap-for-v3.11/pm-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP4+: PM: Consolidate OMAP4 PM code to re-use it for OMAP5
  ARM: OMAP4+: Make secondary_startup function name more consistent
  ARM: OMAP4+: PM: Consolidate MPU subsystem PM code for re-use
  ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

10 years agoxfs: don't shutdown log recovery on validation errors
Dave Chinner [Wed, 12 Jun 2013 02:19:06 +0000 (12:19 +1000)]
xfs: don't shutdown log recovery on validation errors

Unfortunately, we cannot guarantee that items logged multiple times
and replayed by log recovery do not take objects back in time. When
they are taken back in time, the go into an intermediate state which
is corrupt, and hence verification that occurs on this intermediate
state causes log recovery to abort with a corruption shutdown.

Instead of causing a shutdown and unmountable filesystem, don't
verify post-recovery items before they are written to disk. This is
less than optimal, but there is no way to detect this issue for
non-CRC filesystems If log recovery successfully completes, this
will be undone and the object will be consistent by subsequent
transactions that are replayed, so in most cases we don't need to
take drastic action.

For CRC enabled filesystems, leave the verifiers in place - we need
to call them to recalculate the CRCs on the objects anyway. This
recovery problem can be solved for such filesystems - we have a LSN
stamped in all metadata at writeback time that we can to determine
whether the item should be replayed or not. This is a separate piece
of work, so is not addressed by this patch.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
(cherry picked from commit 9222a9cf86c0d64ffbedf567412b55da18763aa3)

10 years agoxfs: ensure btree root split sets blkno correctly
Dave Chinner [Wed, 12 Jun 2013 02:19:08 +0000 (12:19 +1000)]
xfs: ensure btree root split sets blkno correctly

For CRC enabled filesystems, the BMBT is rooted in an inode, so it
passes through a different code path on root splits than the
freespace and inode btrees. This is much less traversed by xfstests
than the other trees. When testing on a 1k block size filesystem,
I've been seeing ASSERT failures in generic/234 like:

XFS: Assertion failed: cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_private.b.allocated == 0, file: fs/xfs/xfs_btree.c, line: 317

which are generally preceded by a lblock check failure. I noticed
this in the bmbt stats:

$ pminfo -f xfs.btree.block_map

xfs.btree.block_map.lookup
    value 39135

xfs.btree.block_map.compare
    value 268432

xfs.btree.block_map.insrec
    value 15786

xfs.btree.block_map.delrec
    value 13884

xfs.btree.block_map.newroot
    value 2

xfs.btree.block_map.killroot
    value 0
.....

Very little coverage of root splits and merges. Indeed, on a 4k
filesystem, block_map.newroot and block_map.killroot are both zero.
i.e. the code is not exercised at all, and it's the only generic
btree infrastructure operation that is not exercised by a default run
of xfstests.

Turns out that on a 1k filesystem, generic/234 accounts for one of
those two root splits, and that is somewhat of a smoking gun. In
fact, it's the same problem we saw in the directory/attr code where
headers are memcpy()d from one block to another without updating the
self describing metadata.

Simple fix - when copying the header out of the root block, make
sure the block number is updated correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
(cherry picked from commit ade1335afef556df6538eb02e8c0dc91fbd9cc37)

10 years agoxfs: fix implicit padding in directory and attr CRC formats
Dave Chinner [Wed, 12 Jun 2013 02:19:07 +0000 (12:19 +1000)]
xfs: fix implicit padding in directory and attr CRC formats

Michael L. Semon has been testing CRC patches on a 32 bit system and
been seeing assert failures in the directory code from xfs/080.
Thanks to Michael's heroic efforts with printk debugging, we found
that the problem was that the last free space being left in the
directory structure was too small to fit a unused tag structure and
it was being corrupted and attempting to log a region out of bounds.
Hence the assert failure looked something like:

.....
#5 calling xfs_dir2_data_log_unused() 36 32
#1 4092 4095 4096
#2 8182 8183 4096
XFS: Assertion failed: first <= last && last < BBTOB(bp->b_length), file: fs/xfs/xfs_trans_buf.c, line: 568

Where #1 showed the first region of the dup being logged (i.e. the
last 4 bytes of a directory buffer) and #2 shows the corrupt values
being calculated from the length of the dup entry which overflowed
the size of the buffer.

It turns out that the problem was not in the logging code, nor in
the freespace handling code. It is an initial condition bug that
only shows up on 32 bit systems. When a new buffer is initialised,
where's the freespace that is set up:

[  172.316249] calling xfs_dir2_leaf_addname() from xfs_dir_createname()
[  172.316346] #9 calling xfs_dir2_data_log_unused()
[  172.316351] #1 calling xfs_trans_log_buf() 60 63 4096
[  172.316353] #2 calling xfs_trans_log_buf() 4094 4095 4096

Note the offset of the first region being logged? It's 60 bytes into
the buffer. Once I saw that, I pretty much knew that the bug was
going to be caused by this.

Essentially, all direct entries are rounded to 8 bytes in length,
and all entries start with an 8 byte alignment. This means that we
can decode inplace as variables are naturally aligned. With the
directory data supposedly starting on a 8 byte boundary, and all
entries padded to 8 bytes, the minimum freespace in a directory
block is supposed to be 8 bytes, which is large enough to fit a
unused data entry structure (6 bytes in size). The fact we only have
4 bytes of free space indicates a directory data block alignment
problem.

And what do you know - there's an implicit hole in the directory
data block header for the CRC format, which means the header is 60
byte on 32 bit intel systems and 64 bytes on 64 bit systems. Needs
padding. And while looking at the structures, I found the same
problem in the attr leaf header. Fix them both.

Note that this only affects 32 bit systems with CRCs enabled.
Everything else is just fine. Note that CRC enabled filesystems created
before this fix on such systems will not be readable with this fix
applied.

Reported-by: Michael L. Semon <mlsemon35@gmail.com>
Debugged-by: Michael L. Semon <mlsemon35@gmail.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
(cherry picked from commit 8a1fd2950e1fe267e11fc8c85dcaa6b023b51b60)

10 years agoxfs: don't emit v5 superblock warnings on write
Dave Chinner [Mon, 27 May 2013 06:38:19 +0000 (16:38 +1000)]
xfs: don't emit v5 superblock warnings on write

We write the superblock every 30s or so which results in the
verifier being called. Right now that results in this output
every 30s:

XFS (vda): Version 5 superblock detected. This kernel has EXPERIMENTAL support enabled!
Use of these features in this kernel is at your own risk!

And spamming the logs.

We don't need to check for whether we support v5 superblocks or
whether there are feature bits we don't support set as these are
only relevant when we first mount the filesytem. i.e. on superblock
read. Hence for the write verification we can just skip all the
checks (and hence verbose output) altogether.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
(cherry picked from commit 34510185abeaa5be9b178a41c0a03d30aec3db7e)

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Fri, 14 Jun 2013 05:34:14 +0000 (22:34 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "This is an assortment of crash fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: stop all workers before cleaning up roots
  Btrfs: fix use-after-free bug during umount
  Btrfs: init relocate extent_io_tree with a mapping
  btrfs: Drop inode if inode root is NULL
  Btrfs: don't delete fs_roots until after we cleanup the transaction