firefly-linux-kernel-4.4.55.git
11 years agoARM: at91: pm9g45: add mmc support
Jean-Christophe PLAGNIOL-VILLARD [Mon, 19 Nov 2012 16:46:24 +0000 (00:46 +0800)]
ARM: at91: pm9g45: add mmc support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: Animeo IP: add mmc support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 15 Nov 2012 13:56:27 +0000 (21:56 +0800)]
ARM: at91: Animeo IP: add mmc support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: dt: add mmc pinctrl for Atmel reference boards
Jean-Christophe PLAGNIOL-VILLARD [Mon, 19 Nov 2012 16:38:18 +0000 (00:38 +0800)]
ARM: at91: dt: add mmc pinctrl for Atmel reference boards

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: dt: at91sam9: add mmc pinctrl support
Jean-Christophe PLAGNIOL-VILLARD [Fri, 16 Nov 2012 00:24:17 +0000 (08:24 +0800)]
ARM: at91: dt: at91sam9: add mmc pinctrl support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91/dts: add nodes for atmel hsmci controllers for atmel boards
Ludovic Desroches [Mon, 19 Nov 2012 11:24:02 +0000 (12:24 +0100)]
ARM: at91/dts: add nodes for atmel hsmci controllers for atmel boards

Add mci controller nodes to atmel boards.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91/dts: add nodes for atmel hsmci controllers for atmel SOCs
Ludovic Desroches [Mon, 19 Nov 2012 11:23:36 +0000 (12:23 +0100)]
ARM: at91/dts: add nodes for atmel hsmci controllers for atmel SOCs

Add mci controller nodes to atmel SOCs.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: add clocks for DT entries
Ludovic Desroches [Mon, 19 Nov 2012 11:19:53 +0000 (12:19 +0100)]
ARM: at91: add clocks for DT entries

Add clocks to clock lookup table for DT entries.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoMerge branch 'delivery/pinctrl-at91-3.8' of http://github.com/at91linux/linux-at91...
Linus Walleij [Wed, 21 Nov 2012 09:48:33 +0000 (10:48 +0100)]
Merge branch 'delivery/pinctrl-at91-3.8' of github.com/at91linux/linux-at91 into at91

11 years agoARM: at91: add Somfy Animeo IP board support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 15 Nov 2012 13:56:27 +0000 (21:56 +0800)]
ARM: at91: add Somfy Animeo IP board support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Add AT91RM9200EK board device tree
Joachim Eastwood [Sun, 28 Oct 2012 18:31:11 +0000 (18:31 +0000)]
ARM: AT91: Add AT91RM9200EK board device tree

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Add AT91RM9200 device tree
Joachim Eastwood [Sun, 28 Oct 2012 18:31:10 +0000 (18:31 +0000)]
ARM: AT91: Add AT91RM9200 device tree

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Add AT91RM9200 DT board
Joachim Eastwood [Sun, 28 Oct 2012 18:31:09 +0000 (18:31 +0000)]
ARM: AT91: Add AT91RM9200 DT board

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Add usart/tc/pio/ohci DT clock lookup to AT91RM9200
Joachim Eastwood [Sun, 28 Oct 2012 18:31:08 +0000 (18:31 +0000)]
ARM: AT91: Add usart/tc/pio/ohci DT clock lookup to AT91RM9200

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Add DT support to AT91RM9200 System Timer
Joachim Eastwood [Sun, 28 Oct 2012 18:31:07 +0000 (18:31 +0000)]
ARM: AT91: Add DT support to AT91RM9200 System Timer

Based on AT91 PIT DT patch from Jean-Christophe PLAGNIOL-VILLARD.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: AT91: Fix build failure on board-dt
Joachim Eastwood [Sun, 28 Oct 2012 18:31:06 +0000 (18:31 +0000)]
ARM: AT91: Fix build failure on board-dt

We need CONFIG_SOC_AT91SAM9 to get the at91sam926x_timer
symbol used in board-dt.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: add Ronetix pm9g45 board support
Jean-Christophe PLAGNIOL-VILLARD [Thu, 18 Oct 2012 06:10:21 +0000 (14:10 +0800)]
ARM: at91: add Ronetix pm9g45 board support

CPU Module with ATMEL AT91SAM9G45
http://www.ronetix.at/pm9g45.html

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: dt: at91sam9260: split rts and cts pinctrl not
Jean-Christophe PLAGNIOL-VILLARD [Sun, 18 Nov 2012 23:30:01 +0000 (07:30 +0800)]
ARM: at91: dt: at91sam9260: split rts and cts pinctrl not

as we just use the rts and not the rts & cts for rs485

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91: fix usart/uart namimg in pinctrl
Jean-Christophe PLAGNIOL-VILLARD [Sun, 18 Nov 2012 22:40:01 +0000 (06:40 +0800)]
ARM: at91: fix usart/uart namimg in pinctrl

USART are the full pin uart
DBGU the debug Unit
UART the two pin uart

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoARM: at91sam9: add macb pinctrl support
Jean-Christophe PLAGNIOL-VILLARD [Tue, 23 Oct 2012 02:19:11 +0000 (10:19 +0800)]
ARM: at91sam9: add macb pinctrl support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agopinctrl: at91 add deglitch, debounce, pull down and schmitt trigger mux option support
Jean-Christophe PLAGNIOL-VILLARD [Wed, 26 Sep 2012 06:57:45 +0000 (14:57 +0800)]
pinctrl: at91 add deglitch, debounce, pull down and schmitt trigger mux option support

add :
 set_deglitch: enable/disable deglitch
 set_debounce: enable/disable debounce
 set_pulldown: enable/disable pulldown
 disable_schmitt_trig: disable schmitt trigger

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agopinctrl: at91: provide gpio names
Jean-Christophe PLAGNIOL-VILLARD [Tue, 6 Nov 2012 16:33:34 +0000 (00:33 +0800)]
pinctrl: at91: provide gpio names

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
11 years agoMerge branch 'at91' into devel
Linus Walleij [Sun, 11 Nov 2012 18:12:33 +0000 (19:12 +0100)]
Merge branch 'at91' into devel

11 years agoARM: SPEAr: Add plgpio node in device tree dtsi files
Viresh Kumar [Sat, 27 Oct 2012 09:51:39 +0000 (15:21 +0530)]
ARM: SPEAr: Add plgpio node in device tree dtsi files

This patch adds plgpio nodes in SPEAr DT files.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: SPEAr: Add gpio ranges support
Viresh Kumar [Sat, 27 Oct 2012 09:51:38 +0000 (15:21 +0530)]
pinctrl: SPEAr: Add gpio ranges support

Most of SPEAr SoCs, which support pinctrl, can configure & use pads as gpio.
This patch gpio enable support for SPEAr pinctrl drivers.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: iron out include ladder mistakes
Linus Walleij [Tue, 6 Nov 2012 16:16:39 +0000 (17:16 +0100)]
gpiolib: iron out include ladder mistakes

The <*/gpio.h> includes are updated again: now we need to account
for the problem introduced by commit:
595679a8038584df7b9398bf34f61db3c038bfea
"gpiolib: fix up function prototypes etc"

Actually we need static inlines in include/asm-generic/gpio.h
as well since we may have GPIOLIB but not PINCTRL.
Make sure to move all the CONFIG_PINCTRL business
to the end of the file so we are sure we have
declared struct gpio_chip.

And we need to keep the static inlines in <linux/gpio.h>
but here for the !CONFIG_GENERIC_GPIO case, and then we
may as well throw in a few warnings like the other
prototypes there, if someone would have the bad taste
of compiling without GENERIC_GPIO even.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: separation of pin concerns
Linus Walleij [Tue, 6 Nov 2012 15:03:35 +0000 (16:03 +0100)]
gpiolib: separation of pin concerns

The fact that of_gpiochip_add_pin_range() and
gpiochip_add_pin_range() share too much code is fragile and
will invariably mean that bugs need to be fixed in two places
instead of one.

So separate the concerns of gpiolib.c and gpiolib-of.c and
have the latter call the former as back-end. This is necessary
also when going forward with other device descriptions such
as ACPI.

This is done by:

- Adding a return code to gpiochip_add_pin_range() so we can
  reliably check whether this succeeds.

- Get rid of the custom of_pinctrl_add_gpio_range() from
  pinctrl. Instead create of_pinctrl_get() to just retrive the
  pin controller per se from an OF node. This composite
  function was just begging to be deleted, it was way to
  purpose-specific.

- Use pinctrl_dev_get_name() to get the name of the retrieved
  pin controller and use that to call back into the generic
  gpiochip_add_pin_range().

Now the pin range is only allocated and tied to a pin
controller from the core implementation in gpiolib.c.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: call pin removal in chip removal function
Linus Walleij [Tue, 6 Nov 2012 14:15:44 +0000 (15:15 +0100)]
gpiolib: call pin removal in chip removal function

This makes us call gpiochio_remove_pin_ranges() in the
gpiochip_remove() function, so we get rid of ranges when
freeing the chip.

Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: remove duplicate pin range code
Linus Walleij [Tue, 6 Nov 2012 14:03:47 +0000 (15:03 +0100)]
gpiolib: remove duplicate pin range code

Commit 69e1601bca88809dc118abd1becb02c15a02ec71
"gpiolib: provide provision to register pin ranges"

Introduced both of_gpiochip_remove_pin_range() and
gpiochip_remove_pin_ranges(). But the contents are exactly
the same so remove the OF one and rely on the range deletion
in the core.

Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib-of: staticize the pin range calls
Linus Walleij [Tue, 6 Nov 2012 13:58:55 +0000 (14:58 +0100)]
gpiolib-of: staticize the pin range calls

Commit 69e1601bca88809dc118abd1becb02c15a02ec71
"gpiolib: provide provision to register pin ranges"

Declared the of_gpiochip_[add|remove]_pin_range() global
while they should be static as they are only ever used in
this file. Let's convert them to static.

Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: fix up function prototypes etc
Linus Walleij [Tue, 6 Nov 2012 13:49:39 +0000 (14:49 +0100)]
gpiolib: fix up function prototypes etc

Commit 69e1601bca88809dc118abd1becb02c15a02ec71
"gpiolib: provide provision to register pin ranges"

Got most of it's function prototypes wrong, so fix this up by:

- Moving the void declarations into static inlines in
  <linux/gpio.h> (previously the actual prototypes were declared
  here...)

- Declare the gpiochip_add_pin_range() and
  gpiochip_remove_pin_ranges() functions in <asm-generic/gpio.h>
  together with the pin range struct declaration itself.

- Actually only implement these very functions in gpiolib.c
  if CONFIG_PINCTRL is set.

- Additionally export the symbols since modules will need to
  be able to do this.

Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sirf: Staticize non-exported symbol
Axel Lin [Mon, 5 Nov 2012 13:44:28 +0000 (21:44 +0800)]
pinctrl: sirf: Staticize non-exported symbol

Staticize sirfsoc_gpio_irq_map() function.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: u300: Staticize non-exported symbols
Axel Lin [Mon, 5 Nov 2012 13:42:16 +0000 (21:42 +0800)]
pinctrl: u300: Staticize non-exported symbols

Staticize u300_pin_config_get() and u300_pin_config_set() functions.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl/u300: use managed resources
Linus Walleij [Wed, 17 Oct 2012 17:17:56 +0000 (19:17 +0200)]
pinctrl/u300: use managed resources

This converts the U300 pin controller to use managed resources
(devm_*) for it's memory region.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl/coh901: convert to use managed resources
Linus Walleij [Wed, 17 Oct 2012 16:49:05 +0000 (18:49 +0200)]
pinctrl/coh901: convert to use managed resources

This switches the COH 901 pin controller to use managed
resources (devm_*) for memory remaps, clocks, etc.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl/coh901: use irqdomain, allocate irqdescs
Linus Walleij [Wed, 17 Oct 2012 16:31:20 +0000 (18:31 +0200)]
pinctrl/coh901: use irqdomain, allocate irqdescs

This switches the COH 901 pinctrl driver to allocate its GPIO
IRQs dynamically, and start to use a linear irqdomain to map
from the hardware IRQs.

This way we can cut away the complex allocation of IRQ numbers
from the <mach/irqs.h> file.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: U300: bump IRQs to offset 32
Linus Walleij [Wed, 17 Oct 2012 11:16:46 +0000 (13:16 +0200)]
ARM: U300: bump IRQs to offset 32

The U300 IRQs were bumped once to offset to 1 (in order to avoid
using IRQ 0 which is now NO_IRQ). This was OK as we were still
passing the number of irqs in the .nr_irqs field of the machine,
with descriptors allocated at boot time.

However .nr_irqs should be 0, leading the system to reserve the
first 16 IRQs. Then the VIC driver will complain that IRQs 1
thru 15 are pre-allocated, so to avoid this and use free
descriptors, move all IRQs up to offset 32.

This will all be done away with as we migrate to device tree,
so it is an interim solution.

Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: SPEAr: Add plgpio driver
Viresh Kumar [Sat, 27 Oct 2012 09:51:37 +0000 (15:21 +0530)]
pinctrl: SPEAr: Add plgpio driver

Most of SPEAr SoCs, which support pinctrl, can configure & use
pads as gpio. This patch adds plgpio driver for configuring
these pads as gpio.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpiolib: provide provision to register pin ranges
Shiraz Hashim [Sat, 27 Oct 2012 09:51:36 +0000 (15:21 +0530)]
gpiolib: provide provision to register pin ranges

pinctrl subsystem needs gpio chip base to prepare set of gpio
pin ranges, which a given pinctrl driver can handle. This is
important to handle pinctrl gpio request calls in order to
program a given pin properly for gpio operation.

As gpio base is allocated dynamically during gpiochip
registration, presently there exists no clean way to pass this
information to the pinctrl subsystem.

After few discussions from [1], it was concluded that may be
gpio controller reporting the pin range it supports, is a
better way than pinctrl subsystem directly registering it.

[1] http://comments.gmane.org/gmane.linux.ports.arm.kernel/184816

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
[Edited documentation a bit]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoRevert "pinctrl: remove pinctrl_remove_gpio_range"
Viresh Kumar [Sat, 27 Oct 2012 09:51:35 +0000 (15:21 +0530)]
Revert "pinctrl: remove pinctrl_remove_gpio_range"

This reverts earlier commit which removed
pinctrl_remove_gpio_range(), because at that time there
weren't any more users of that routine. It was removed as the
removal of ranges was done in unregister of pinctrl.

But as we are now registering stuff from gpiolib, we may
remove and insert a gpio module multiple times. So, we
need this routine again.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: exynos: Add terminating entry for of_device_id table
Axel Lin [Fri, 2 Nov 2012 13:46:13 +0000 (21:46 +0800)]
pinctrl: exynos: Add terminating entry for of_device_id table

The of_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sirf: enable the driver support new SiRFmarco SoC
Barry Song [Thu, 27 Sep 2012 09:56:30 +0000 (17:56 +0800)]
pinctrl: sirf: enable the driver support new SiRFmarco SoC

The driver supports old up SiRFprimaII SoCs, this patch makes it support
the new SiRFmarco as well.
SiRFmarco, as a SMP SoC, adds new SIRFSOC_GPIO_PAD_EN_CLR registers, to
disable GPIO pad, we should write 1 to the corresponding bit in the new
CLEAR register instead of writing 0 to SIRFSOC_GPIO_PAD_EN.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: mvebu: move to its own directory
Thomas Petazzoni [Wed, 24 Oct 2012 21:38:58 +0000 (23:38 +0200)]
pinctrl: mvebu: move to its own directory

Like the spear platform, the mvebu platform has multiple files: one
core file, and then one file per SoC family. More files will be added
later, as support for mach-orion5x and mach-mv78xx0 SoCs is added to
pinctrl-mvebu. For those reasons, having a separate subdirectory,
drivers/pinctrl/mvebu/ makes sense, and it had already been suggested
by Linus Wallej when the driver was originally submitted.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: mvebu: remove useless include
Thomas Petazzoni [Wed, 24 Oct 2012 21:38:57 +0000 (23:38 +0200)]
pinctrl: mvebu: remove useless include

Including the core.h header for the pinctrl subsystem is not
necessary, and it is actually causing problems when moving the
pinctrl-mvebu drivers into a separate subdirectory.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: mvebu: allow plat-orion architectures to use pinctrl-mvebu
Thomas Petazzoni [Wed, 24 Oct 2012 21:38:56 +0000 (23:38 +0200)]
pinctrl: mvebu: allow plat-orion architectures to use pinctrl-mvebu

The mach-kirkwood and mach-dove architectures have not yet been
integrated into the mach-mvebu directory, which should ultimately
contain the support for all Marvell SoCs from the Engineering Business
Unit.

However, before this can happen, we need to let mach-kirkwood and
mach-dove use the pinctrl-mvebu driver, which supports the kirkwood
and dove SoC families. In order to do that, we make this driver
available as soon as PLAT_ORION is selected, instead of using
ARCH_MVEBU as a condition. In the long term, PLAT_ORION should
disappear and be fully replaced by ARCH_MVEBU, but the plan is to make
the migration step by step, by first having the existing mach-*
directories for Marvell SoCs converge on several infrastructures,
including the pinctrl one.

Also, like the spear pinctrl driver, we put all pinctrl-mvebu Kconfig
options under a if, in order to avoid having certain options
(PINCTRL_DOVE, PINCTRL_KIRKWOOD, etc.) selecting an option
(PINCTLR_MVEBU) which itself has a dependency (on ARCH_MVEBU). In this
a construct, the dependency is in fact ignored due to the selects.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: reserve pins when states are activated
Linus Walleij [Wed, 17 Oct 2012 18:51:54 +0000 (20:51 +0200)]
pinctrl: reserve pins when states are activated

This switches the way that pins are reserved for multiplexing:

We used to do this when the map was parsed, at the creation of
the settings inside the pinctrl handle, in pinmux_map_to_setting().

However this does not work for us, because we want to use the
same set of pins with different devices at different times: the
current code assumes that the pin groups in a pinmux state will
only be used with one single device, albeit different groups can
be active at different times. For example if a single I2C driver
block is used to drive two different busses located on two
pin groups A and B, then the pins for all possible states of a
function are reserved when fetching the pinctrl handle: the
I2C bus can choose either set A or set B by a mux state at
runtime, but all pins in both group A and B (the superset) are
effectively reserved for that I2C function and mapped to the
device. Another device can never get in and use the pins in
group A, even if the device/function is using group B at the
moment.

Instead: let use reserve the pins when the state is activated
and drop them when the state is disabled, i.e. when we move to
another state. This way different devices/functions can use the
same pins at different times.

We know that this is an odd way of doing things, but we really
need to switch e.g. an SD-card slot to become a tracing output
sink at runtime: we plug in a special "tracing card" then mux
the pins that used to be an SD slot around to the tracing
unit and push out tracing data there instead of SD-card
traffic.

As a side effect pinmux_free_setting() is unused but the stubs
are kept for future additions of code.

Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Jean Nicolas Graux <jean-nicolas.graux@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoLinux 3.7-rc5
Linus Torvalds [Sun, 11 Nov 2012 12:44:33 +0000 (13:44 +0100)]
Linux 3.7-rc5

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sat, 10 Nov 2012 21:03:49 +0000 (22:03 +0100)]
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:
 "Bug fixes galore, mostly in drivers as is often the case:

  1) USB gadget and cdc_eem drivers need adjustments to their frame size
     lengths in order to handle VLANs correctly.  From Ian Coolidge.

  2) TIPC and several network drivers erroneously call tasklet_disable
     before tasklet_kill, fix from Xiaotian Feng.

  3) r8169 driver needs to apply the WOL suspend quirk to more chipsets,
     fix from Cyril Brulebois.

  4) Fix multicast filters on RTL_GIGA_MAC_VER_35 r8169 chips, from
     Nathan Walp.

  5) FDB netlink dumps should use RTM_NEWNEIGH as the message type, not
     zero.  From John Fastabend.

  6) Fix smsc95xx tx checksum offload on big-endian, from Steve
     Glendinning.

  7) __inet_diag_dump() needs to repsect and report the error value
     returned from inet_diag_lock_handler() rather than ignore it.
     Otherwise if an inet diag handler is not available for a particular
     protocol, we essentially report success instead of giving an error
     indication.  Fix from Cyrill Gorcunov.

  8) When the QFQ packet scheduler sees TSO/GSO packets it does not
     handle things properly, and in fact ends up corrupting it's
     datastructures as well as mis-schedule packets.  Fix from Paolo
     Valente.

  9) Fix oopser in skb_loop_sk(), from Eric Leblond.

  10) CXGB4 passes partially uninitialized datastructures in to FW
      commands, fix from Vipul Pandya.

  11) When we send unsolicited ipv6 neighbour advertisements, we should
      send them to the link-local allnodes multicast address, as per
      RFC4861.  Fix from Hannes Frederic Sowa.

  12) There is some kind of bug in the usbnet's kevent deferral
      mechanism, but more immediately when it triggers an uncontrolled
      stream of kernel messages spam the log.  Rate limit the error log
      message triggered when this problem occurs, as sending thousands
      of error messages into the kernel log doesn't help matters at all,
      and in fact makes further diagnosis more difficult.

      From Steve Glendinning.

  13) Fix gianfar restore from hibernation, from Wang Dongsheng.

  14) The netlink message attribute sizes are wrong in the ipv6 GRE
      driver, it was using the size of ipv4 addresses instead of ipv6
      ones :-) Fix from Nicolas Dichtel."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  gre6: fix rtnl dump messages
  gianfar: ethernet vanishes after restoring from hibernation
  usbnet: ratelimit kevent may have been dropped warnings
  ipv6: send unsolicited neighbour advertisements to all-nodes
  net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
  usb: gadget: g_ether: fix frame size check for 802.1Q
  cxgb4: Fix initialization of SGE_CONTROL register
  isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
  cxgb4: Initialize data structures before using.
  af-packet: fix oops when socket is not present
  pkt_sched: enable QFQ to support TSO/GSO
  net: inet_diag -- Return error code if protocol handler is missed
  net: bnx2x: Fix typo in bnx2x driver
  smsc95xx: fix tx checksum offload for big endian
  rtnetlink: Use nlmsg type RTM_NEWNEIGH from dflt fdb dump
  ptp: update adjfreq callback description
  r8169: allow multicast packets on sub-8168f chipset.
  r8169: Fix WoL on RTL8168d/8111d.
  drivers/net: use tasklet_kill in device remove/close process
  tipc: do not use tasklet_disable before tasklet_kill

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Sat, 10 Nov 2012 20:58:34 +0000 (21:58 +0100)]
Merge git://git./linux/kernel/git/davem/sparc

Pull sparc fixes from David Miller:
 "Several build/bug fixes for sparc, including:

  1) Configuring a mix of static vs.  modular sparc64 crypto modules
     didn't work, remove an ill-conceived attempt to only have to build
     the device match table for these drivers once to fix the problem.

     Reported by Meelis Roos.

  2) Make the montgomery multiple/square and mpmul instructions actually
     usable in 32-bit tasks.  Essentially this involves providing 32-bit
     userspace with a way to use a 64-bit stack when it needs to.

  3) Our sparc64 atomic backoffs don't yield cpu strands properly on
     Niagara chips.  Use pause instruction when available to achieve
     this, otherwise use a benign instruction we know blocks the strand
     for some time.

  4) Wire up kcmp

  5) Fix the build of various drivers by removing the unnecessary
     blocking of OF_GPIO when SPARC.

  6) Fix unintended regression wherein of_address_to_resource stopped
     being provided.  Fix from Andreas Larsson.

  7) Fix NULL dereference in leon_handle_ext_irq(), also from Andreas
     Larsson."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Fix build with mix of modular vs. non-modular crypto drivers.
  sparc: Support atomic64_dec_if_positive properly.
  of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again
  sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq
  sparc: Add sparc support for platform_get_irq()
  sparc: Allow OF_GPIO on sparc.
  qlogicpti: Fix build warning.
  sparc: Wire up sys_kcmp.
  sparc64: Improvde documentation and readability of atomic backoff code.
  sparc64: Use pause instruction when available.
  sparc64: Fix cpu strand yielding.
  sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads.

11 years agoMerge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sat, 10 Nov 2012 05:59:35 +0000 (06:59 +0100)]
Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Jeff Layton.

* 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Do not lookup hashed negative dentry in cifs_atomic_open
  cifs: fix potential buffer overrun in cifs.idmap handling code

11 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
Linus Torvalds [Sat, 10 Nov 2012 05:58:20 +0000 (06:58 +0100)]
Merge tag 'arm64-fixes' of git://git./linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 fixes from Catalin Marinas:
 - correct argument type (pgprot_t) when calling __ioremap()
 - PCI_IOBASE virtual address change
 - use architected event for CPU cycle counter
 - fix ELF core dumping
 - select CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION
 - missing completion for secondary CPU boot
 - booting on systems with all memory beyond 4GB

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
  arm64: mm: fix booting on systems with no memory below 4GB
  arm64: smp: add missing completion for secondary boot
  arm64: compat: select CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  arm64: elf: fix core dumping definitions for GP and FP registers
  arm64: perf: use architected event for CPU cycle counter
  arm64: Move PCI_IOBASE closer to MODULES_VADDR
  arm64: Use pgprot_t as the last argument when invoking __ioremap()

11 years agoMerge tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 10 Nov 2012 05:56:21 +0000 (06:56 +0100)]
Merge tag 'stable/for-linus-3.7-rc5-tag' of git://git./linux/kernel/git/konrad/xen

Pull Xen fixes from Konrad Rzeszutek Wilk:
 "There are three ARM compile fixes (we forgot to export certain
  functions and if the drivers are built as an module - we go belly-up).

  There is also an mismatch of irq_enter() / exit_idle() calls sequence
  which were fixed some time ago in other piece of codes, but failed to
  appear in the Xen code.

  Lastly a fix for to help in the field with troubleshooting in case we
  cannot get the appropriate parameter and also fallback code when
  working with very old hypervisors."

Bug-fixes:
 - Fix compile issues on ARM.
 - Fix hypercall fallback code for old hypervisors.
 - Print out which HVM parameter failed if it fails.
 - Fix idle notifier call after irq_enter.

* tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/arm: Fix compile errors when drivers are compiled as modules (export more).
  xen/arm: Fix compile errors when drivers are compiled as modules.
  xen/generic: Disable fallback build on ARM.
  xen/events: fix RCU warning, or Call idle notifier after irq_enter()
  xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
  xen/hypercall: fix hypercall fallback code for very old hypervisors

11 years agosparc64: Fix build with mix of modular vs. non-modular crypto drivers.
David S. Miller [Sat, 10 Nov 2012 04:53:32 +0000 (20:53 -0800)]
sparc64: Fix build with mix of modular vs. non-modular crypto drivers.

We tried linking in a single built object to hold the device table,
but only works if all of the sparc64 crypto modules get built the same
way (modular vs. non-modular).

Just include the device ID stub into each driver source file so that
the table gets compiled into the correct result in all cases.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosparc: Support atomic64_dec_if_positive properly.
David S. Miller [Sat, 10 Nov 2012 03:37:59 +0000 (19:37 -0800)]
sparc: Support atomic64_dec_if_positive properly.

Sparc32 already supported it, as a consequence of using the
generic atomic64 implementation.  And the sparc64 implementation
is rather trivial.

This allows us to set ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE for all
of sparc, and avoid the annoying warning from lib/atomic64_test.c

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoof/address: sparc: Declare of_address_to_resource() as an extern function for sparc...
Andreas Larsson [Tue, 6 Nov 2012 00:12:03 +0000 (00:12 +0000)]
of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again

This bug-fix makes sure that of_address_to_resource is defined extern for sparc
so that the sparc-specific implementation of of_address_to_resource() is once
again used when including include/linux/of_address.h in a sparc context. A
number of drivers in mainline relies on this function working for sparc.

The bug was introduced in a850a7554442f08d3e910c6eeb4ee216868dda1e, "of/address:
add empty static inlines for !CONFIG_OF". Contrary to that commit title, the
static inlines are added for !CONFIG_OF_ADDRESS, and CONFIG_OF_ADDRESS is never
defined for sparc. This is good behavior for the other functions in
include/linux/of_address.h, as the extern functions defined in
drivers/of/address.c only gets linked when OF_ADDRESS is configured. However,
for of_address_to_resource there exists a sparc-specific implementation in
arch/sparc/arch/sparc/kernel/of_device_common.c

Solution suggested by: Sam Ravnborg <sam@ravnborg.org>

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq
Andreas Larsson [Tue, 30 Oct 2012 00:09:46 +0000 (00:09 +0000)]
sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq

If an irq is being unlinked concurrently with leon_handle_ext_irq,
irq_map[eirq] might be null in leon_handle_ext_irq. Make sure that
this is not dereferenced.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosparc: Add sparc support for platform_get_irq()
Andreas Larsson [Mon, 29 Oct 2012 23:26:56 +0000 (23:26 +0000)]
sparc: Add sparc support for platform_get_irq()

This adds sparc support for platform_get_irq that in the normal case use
platform_get_resource() to get an irq. This standard approach fails for sparc as
there are no resources of type IORESOURCE_IRQ for irqs for sparc.

Cross platform drivers can then use this standard platform function and work on
sparc instead of having to have a special case for sparc.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogre6: fix rtnl dump messages
Nicolas Dichtel [Fri, 9 Nov 2012 05:34:56 +0000 (05:34 +0000)]
gre6: fix rtnl dump messages

Spotted after a code review.
Introduced by c12b395a46646bab69089ce7016ac78177f6001f (gre: Support GRE over
IPv6).

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogianfar: ethernet vanishes after restoring from hibernation
Wang Dongsheng [Fri, 9 Nov 2012 04:43:51 +0000 (04:43 +0000)]
gianfar: ethernet vanishes after restoring from hibernation

If a gianfar ethernet device is down prior to hibernating a
system, it will no longer be present upon system restore.

For example:

~# ifconfig eth0 down
~# echo disk > /sys/power/state

  <trigger a restore from hibernation>

~# ifconfig eth0 up
SIOCSIFFLAGS: No such device

This happens because the restore function bails out early upon
finding devices that were not up at hibernation.  In doing so,
it never gets to the netif_device_attach call at the end of
the restore function.  Adding the netif_device_attach as done
here also makes the gfar_restore code consistent with what is
done in the gfar_resume code.

Cc: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agousbnet: ratelimit kevent may have been dropped warnings
Steve Glendinning [Thu, 8 Nov 2012 06:26:21 +0000 (06:26 +0000)]
usbnet: ratelimit kevent may have been dropped warnings

when something goes wrong, a flood of these messages can be
generated by usbnet (thousands per second).  This doesn't
generally *help* the condition so this patch ratelimits the
rate of their generation.

There's an underlying problem in usbnet's kevent deferral
mechanism which needs fixing, specifically that events *can*
get dropped and not handled.  This patch doesn't address this,
but just mitigates fallout caused by the current implemention.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: send unsolicited neighbour advertisements to all-nodes
Hannes Frederic Sowa [Tue, 6 Nov 2012 16:18:41 +0000 (16:18 +0000)]
ipv6: send unsolicited neighbour advertisements to all-nodes

As documented in RFC4861 (Neighbor Discovery for IP version 6) 7.2.6.,
unsolicited neighbour advertisements should be sent to the all-nodes
multicast address.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 9 Nov 2012 20:35:51 +0000 (21:35 +0100)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes (again) from Dave Airlie:
 "dropped the ball on a vmware patch, so two more fixes for vmwgfx are
  here, one for hibernate issue, one for a BUG trigger."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/vmwgfx: Fix a case where the code would BUG when trying to pin GMR memory
  drm/vmwgfx: Fix hibernation device reset

11 years agoMerge tag '3.7-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Linus Torvalds [Fri, 9 Nov 2012 20:33:53 +0000 (21:33 +0100)]
Merge tag '3.7-pci-fixes' of git://git./linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:
 "Power management:
    - PCI/PM: Fix proc config reg access for D3cold and bridge
      suspending
    - PCI/PM: Resume device before shutdown
    - PCI/PM: Fix deadlock when unbinding device if parent in D3cold
  Hotplug:
    -  PCI/portdrv: Don't create hotplug slots unless port supports
       hotplug"

* tag '3.7-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI/portdrv: Don't create hotplug slots unless port supports hotplug
  PCI/PM: Fix proc config reg access for D3cold and bridge suspending
  PCI/PM: Resume device before shutdown
  PCI/PM: Fix deadlock when unbinding device if parent in D3cold

11 years agoMerge tag 'mmc-fixes-for-3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 9 Nov 2012 20:32:33 +0000 (21:32 +0100)]
Merge tag 'mmc-fixes-for-3.7-rc5' of git://git./linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:
 - sdhci: fix a NULL dereference at resume-time, seen on OLPC XO-4
 - sdhci: fix against 3.7-rc1 for UHS modes without a vqmmc regulator
 - sdhci-of-esdhc: disable CMD23 on boards where it's broken
 - sdhci-s3c: fix against 3.7-rc1 for card detection with runtime PM
 - dw_mmc, omap_hsmmc: fix potential NULL derefs, compiler warnings

* tag 'mmc-fixes-for-3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: sdhci-s3c: fix the card detection in runtime-pm
  mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare
  mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
  mmc: dw_mmc: fix modular build for exynos back-end
  mmc: sdhci: fix NULL dereference in sdhci_request() tuning
  mmc: sdhci: fix IS_ERR() checking of regulator_get()
  mmc: fix sdhci-dove probe/removal
  mmc: sh_mmcif: fix use after free
  mmc: sdhci-pci: fix 'Invalid iomem size' error message condition
  mmc: mxcmmc: Fix MODULE_ALIAS
  mmc: omap_hsmmc: fix NULL pointer dereference for dt boot
  mmc: omap_hsmmc: fix host reference after mmc_free_host
  mmc: dw_mmc: fix multiple drv_data NULL dereferences
  mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
  mmc: sdhci-of-esdhc: disable CMD23 for some Freescale SoCs
  mmc: dw_mmc: remove _dev_info compile warning
  mmc: dw_mmc: convert the variable type of irq

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 9 Nov 2012 17:10:20 +0000 (18:10 +0100)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This push fixes a potential panic in cryptd which may occur with
  crypto drivers such as aesni-intel."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: cryptd - disable softirqs in cryptd_queue_worker to prevent data corruption

11 years agoMerge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 9 Nov 2012 17:08:04 +0000 (18:08 +0100)]
Merge tag 'sound-3.7' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Most of commits are for stable and regression fixes.  Except for one
  fix for a regression in 3.7-rc4, there are all driver local changes,
  so nothing too much to worry."

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: Fix card refcount unbalance
  ALSA: hda - Add new codec ALC668 and ALC900 (default name ALC1150)
  ALSA: hda - Improve HP depop when system enter to S3
  ALSA: usb-audio: Fix crash at re-preparing the PCM stream
  ALSA: hdspm - Fix sync check reporting on RME RayDAT
  ALSA: hda - Add pin fixups for ASUS G75
  ALSA: hda - Fix invalid connections in VT1802 codec
  ALSA: hda - Fix empty DAC filling in patch_via.c
  ALSA: hda - Force to reset IEC958 status bits for AD codecs
  ALSA: es1968: Add ESS vendor ID to pm_whitelist
  ALSA: HDA: Mark CS260x immutable structures const
  ALSA: HDA: Fix digital microphone on CS420x
  ALSA: hda: Cirrus: Fix coefficient index for beep configuration
  ALSA: hda - support Teradici 2200 host card audio
  ALSA: Fix typo in drivers sound

11 years agoxen/arm: Fix compile errors when drivers are compiled as modules (export more).
Stefano Stabellini [Thu, 8 Nov 2012 15:58:55 +0000 (15:58 +0000)]
xen/arm: Fix compile errors when drivers are compiled as modules (export more).

The commit 911dec0db4de6ccc544178a8ddaf9cec0a11d533
"xen/arm: Fix compile errors when drivers are compiled as modules." exports
the neccessary functions. But to guard ourselves against out-of-tree modules
and future drivers hitting this, lets export all of the relevant
hypercalls.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11 years agodrm/vmwgfx: Fix a case where the code would BUG when trying to pin GMR memory
Thomas Hellstrom [Fri, 9 Nov 2012 09:45:14 +0000 (10:45 +0100)]
drm/vmwgfx: Fix a case where the code would BUG when trying to pin GMR memory

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
Cc: stable@vger.kernel.org
Cc: linux-graphics-maintainer@vmware.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/vmwgfx: Fix hibernation device reset
Thomas Hellstrom [Fri, 9 Nov 2012 09:05:57 +0000 (10:05 +0100)]
drm/vmwgfx: Fix hibernation device reset

The device would not reset properly when resuming from hibernation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
Cc: stable@vger.kernel.org
Cc: linux-graphics-maintainer@vmware.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoMerge tag 'pinctrl-for-v3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 9 Nov 2012 05:59:04 +0000 (06:59 +0100)]
Merge tag 'pinctrl-for-v3.7-rc5' of git://git./linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:

 - A set of SPEAr pinctrl fixes that recently arrived

 - A fixup for the Samsung/Exynos Kconfig deps

* tag 'pinctrl-for-v3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: samsung and exynos need to depend on OF && GPIOLIB
  pinctrl: SPEAr1340: Add clcd sleep mode pin configuration
  pinctrl: SPEAr1340: Make DDR reset & clock pads as gpio
  pinctrl: SPEAr1310: add register entries for enabling pad direction
  pinctrl: SPEAr1310: Separate out pci pins from pcie_sata pin group
  pinctrl: SPEAr1310: Fix value of PERIP_CFG reigster and MCIF_SEL_SHIFT
  pinctrl: SPEAr1310: fix clcd high resolution pin group name
  pinctrl: SPEAr320: Correct pad mux entries for rmii/smii
  pinctrl: SPEAr3xx: correct register space to configure pwm
  pinctrl: SPEAr: Don't update all non muxreg bits on pinctrl_disable

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Fri, 9 Nov 2012 05:57:56 +0000 (06:57 +0100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "A couple of bug fixes.  I keep the fingers crossed that we now got
  transparent huge pages ready for prime time."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/cio: fix length calculation in idset.c
  s390/sclp: fix addressing mode clobber
  s390: Move css limits from drivers/s390/cio/ to include/asm/.
  s390/thp: respect page protection in pmd_none() and pmd_present()
  s390/mm: use pmd_large() instead of pmd_huge()
  s390/cio: suppress 2nd path verification during resume

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Fri, 9 Nov 2012 05:56:23 +0000 (06:56 +0100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

Pull HID fix from Jiri Kosina:
 "This reverts a patch that causes regression in binding between HID
  devices and drivers during device unplug/replug cycle."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: hidraw: put old deallocation mechanism in place

11 years agoMerge branch 'akpm' (Fixes from Andrew)
Linus Torvalds [Fri, 9 Nov 2012 05:53:02 +0000 (06:53 +0100)]
Merge branch 'akpm' (Fixes from Andrew)

Merge misc fixes from Andrew Morton:
 "Five fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (5 patches)
  h8300: add missing L1_CACHE_SHIFT
  mm: bugfix: set current->reclaim_state to NULL while returning from kswapd()
  fanotify: fix missing break
  revert "epoll: support for disabling items, and a self-test app"
  checkpatch: improve network block comment style checking

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 9 Nov 2012 05:49:24 +0000 (06:49 +0100)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Just radeon and nouveau, mostly regressions fixers, and a couple of
  radeon register checker fixes."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau: fix acpi edid retrieval
  drm/nvc0/disp: fix regression in vblank semaphore release
  drm/nv40/mpeg: fix context handling
  drm/nv40/graph: fix typo in type names
  drm/nv41/vm: fix typo in type name
  drm/radeon/si: add some missing regs to the VM reg checker
  drm/radeon/cayman: add some missing regs to the VM reg checker
  drm/radeon/dce3: switch back to old pll allocation order for discrete

11 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty...
Linus Torvalds [Fri, 9 Nov 2012 05:47:55 +0000 (06:47 +0100)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/rusty/linux

Pull virtio and module fixes from Rusty Russell:
 "YA module signing build tweak, and two cc'd to stable."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio: Don't access index after unregister.
  modules: don't break modules_install on external modules with no key.
  module: fix out-by-one error in kallsyms

11 years agoMerge tag 'for-linus-v3.7-rc5' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 9 Nov 2012 05:42:51 +0000 (06:42 +0100)]
Merge tag 'for-linus-v3.7-rc5' of git://oss.sgi.com/xfs/xfs

Pull xfs bugfixes from Ben Myers:

 - fix for large transactions spanning multiple iclog buffers

 - zero the allocation_args structure on the stack before using it to
   determine whether to use a worker for allocation
 - move allocation stack switch to xfs_bmapi_allocate in order to
   prevent deadlock on AGF buffers

 - growfs no longer reads in garbage for new secondary superblocks

 - silence a build warning

 - ensure that invalid buffers never get written to disk while on free
   list

 - don't vmap inode cluster buffers during free

 - fix buffer shutdown reference count mismatch

 - fix reading of wrapped log data

* tag 'for-linus-v3.7-rc5' of git://oss.sgi.com/xfs/xfs:
  xfs: fix reading of wrapped log data
  xfs: fix buffer shudown reference count mismatch
  xfs: don't vmap inode cluster buffers during free
  xfs: invalidate allocbt blocks moved to the free list
  xfs: silence uninitialised f.file warning.
  xfs: growfs: don't read garbage for new secondary superblocks
  xfs: move allocation stack switch up to xfs_bmapi_allocate
  xfs: introduce XFS_BMAPI_STACK_SWITCH
  xfs: zero allocation_args on the kernel stack
  xfs: only update the last_sync_lsn when a transaction completes

11 years agoh8300: add missing L1_CACHE_SHIFT
Fengguang Wu [Thu, 8 Nov 2012 23:53:41 +0000 (15:53 -0800)]
h8300: add missing L1_CACHE_SHIFT

Fix the build error

  lib/atomic64.c: In function 'lock_addr':
  lib/atomic64.c:40:11: error: 'L1_CACHE_SHIFT' undeclared (first use in this function)
  lib/atomic64.c:40:11: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: bugfix: set current->reclaim_state to NULL while returning from kswapd()
Takamori Yamaguchi [Thu, 8 Nov 2012 23:53:39 +0000 (15:53 -0800)]
mm: bugfix: set current->reclaim_state to NULL while returning from kswapd()

In kswapd(), set current->reclaim_state to NULL before returning, as
current->reclaim_state holds reference to variable on kswapd()'s stack.

In rare cases, while returning from kswapd() during memory offlining,
__free_slab() and freepages() can access the dangling pointer of
current->reclaim_state.

Signed-off-by: Takamori Yamaguchi <takamori.yamaguchi@jp.sony.com>
Signed-off-by: Aaditya Kumar <aaditya.kumar@ap.sony.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agofanotify: fix missing break
Eric Paris [Thu, 8 Nov 2012 23:53:37 +0000 (15:53 -0800)]
fanotify: fix missing break

Anders Blomdell noted in 2010 that Fanotify lost events and provided a
test case.  Eric Paris confirmed it was a bug and posted a fix to the
list

  https://groups.google.com/forum/?fromgroups=#!topic/linux.kernel/RrJfTfyW2BE

but never applied it.  Repeated attempts over time to actually get him
to apply it have never had a reply from anyone who has raised it

So apply it anyway

Signed-off-by: Alan Cox <alan@linux.intel.com>
Reported-by: Anders Blomdell <anders.blomdell@control.lth.se>
Cc: Eric Paris <eparis@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agorevert "epoll: support for disabling items, and a self-test app"
Andrew Morton [Thu, 8 Nov 2012 23:53:35 +0000 (15:53 -0800)]
revert "epoll: support for disabling items, and a self-test app"

Revert commit 03a7beb55b9f ("epoll: support for disabling items, and a
self-test app") pending resolution of the issues identified by Michael
Kerrisk, copied below.

We'll revisit this for 3.8.

: I've taken a look at this patch as it currently stands in 3.7-rc1, and
: done a bit of testing. (By the way, the test program
: tools/testing/selftests/epoll/test_epoll.c does not compile...)
:
: There are one or two places where the behavior seems a little strange,
: so I have a question or two at the end of this mail. But other than
: that, I want to check my understanding so that the interface can be
: correctly documented.
:
: Just to go though my understanding, the problem is the following
: scenario in a multithreaded application:
:
: 1. Multiple threads are performing epoll_wait() operations,
:    and maintaining a user-space cache that contains information
:    corresponding to each file descriptor being monitored by
:    epoll_wait().
:
: 2. At some point, a thread wants to delete (EPOLL_CTL_DEL)
:    a file descriptor from the epoll interest list, and
:    delete the corresponding record from the user-space cache.
:
: 3. The problem with (2) is that some other thread may have
:    previously done an epoll_wait() that retrieved information
:    about the fd in question, and may be in the middle of using
:    information in the cache that relates to that fd. Thus,
:    there is a potential race.
:
: 4. The race can't solved purely in user space, because doing
:    so would require applying a mutex across the epoll_wait()
:    call, which would of course blow thread concurrency.
:
: Right?
:
: Your solution is the EPOLL_CTL_DISABLE operation. I want to
: confirm my understanding about how to use this flag, since
: the description that has accompanied the patches so far
: has been a bit sparse
:
: 0. In the scenario you're concerned about, deleting a file
:    descriptor means (safely) doing the following:
:    (a) Deleting the file descriptor from the epoll interest list
:        using EPOLL_CTL_DEL
:    (b) Deleting the corresponding record in the user-space cache
:
: 1. It's only meaningful to use this EPOLL_CTL_DISABLE in
:    conjunction with EPOLLONESHOT.
:
: 2. Using EPOLL_CTL_DISABLE without using EPOLLONESHOT in
:    conjunction is a logical error.
:
: 3. The correct way to code multithreaded applications using
:    EPOLL_CTL_DISABLE and EPOLLONESHOT is as follows:
:
:    a. All EPOLL_CTL_ADD and EPOLL_CTL_MOD operations should
:       should EPOLLONESHOT.
:
:    b. When a thread wants to delete a file descriptor, it
:       should do the following:
:
:       [1] Call epoll_ctl(EPOLL_CTL_DISABLE)
:       [2] If the return status from epoll_ctl(EPOLL_CTL_DISABLE)
:           was zero, then the file descriptor can be safely
:           deleted by the thread that made this call.
:       [3] If the epoll_ctl(EPOLL_CTL_DISABLE) fails with EBUSY,
:           then the descriptor is in use. In this case, the calling
:           thread should set a flag in the user-space cache to
:           indicate that the thread that is using the descriptor
:           should perform the deletion operation.
:
: Is all of the above correct?
:
: The implementation depends on checking on whether
: (events & ~EP_PRIVATE_BITS) == 0
: This replies on the fact that EPOLL_CTL_AD and EPOLL_CTL_MOD always
: set EPOLLHUP and EPOLLERR in the 'events' mask, and EPOLLONESHOT
: causes those flags (as well as all others in ~EP_PRIVATE_BITS) to be
: cleared.
:
: A corollary to the previous paragraph is that using EPOLL_CTL_DISABLE
: is only useful in conjunction with EPOLLONESHOT. However, as things
: stand, one can use EPOLL_CTL_DISABLE on a file descriptor that does
: not have EPOLLONESHOT set in 'events' This results in the following
: (slightly surprising) behavior:
:
: (a) The first call to epoll_ctl(EPOLL_CTL_DISABLE) returns 0
:     (the indicator that the file descriptor can be safely deleted).
: (b) The next call to epoll_ctl(EPOLL_CTL_DISABLE) fails with EBUSY.
:
: This doesn't seem particularly useful, and in fact is probably an
: indication that the user made a logic error: they should only be using
: epoll_ctl(EPOLL_CTL_DISABLE) on a file descriptor for which
: EPOLLONESHOT was set in 'events'. If that is correct, then would it
: not make sense to return an error to user space for this case?

Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: "Paton J. Lewis" <palewis@adobe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agocheckpatch: improve network block comment style checking
Joe Perches [Thu, 8 Nov 2012 23:53:29 +0000 (15:53 -0800)]
checkpatch: improve network block comment style checking

Some comment styles in net and drivers/net are flagged inappropriately.

Avoid proclaiming inline comments like:
int a = b; /* some comment */
and block comments like:
/*********************
 * some comment
 ********************/
are defective.

Tested with
$ cat drivers/net/t.c
/* foo */

/*
 * foo
 */

/* foo
 */

/* foo
 * bar */

/****************************
 * some long block comment
 ***************************/

struct foo {
int bar; /* another test */
};
$

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: David Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Fri, 9 Nov 2012 04:57:02 +0000 (14:57 +1000)]
Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

just some misc regression fixes and typo fixes.

* 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau: fix acpi edid retrieval
  drm/nvc0/disp: fix regression in vblank semaphore release
  drm/nv40/mpeg: fix context handling
  drm/nv40/graph: fix typo in type names
  drm/nv41/vm: fix typo in type name

11 years agovirtio: Don't access index after unregister.
Cornelia Huck [Fri, 9 Nov 2012 04:24:12 +0000 (14:54 +1030)]
virtio: Don't access index after unregister.

Virtio wants to release used indices after the corresponding
virtio device has been unregistered. However, virtio does not
hold an extra reference, giving up its last reference with
device_unregister(), making accessing dev->index afterwards
invalid.

I actually saw problems when testing my (not-yet-merged)
virtio-ccw code:

- device_add virtio-net,id=xxx
-> creates device virtio<n> with n>0

- device_del xxx
-> deletes virtio<n>, but calls ida_simple_remove with an
   index of 0

- device_add virtio-net,id=xxx
-> tries to add virtio0, which is still in use...

So let's save the index we want to release before calling
device_unregister().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Cc: stable@kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agodrm/nouveau: fix acpi edid retrieval
Maarten Lankhorst [Thu, 8 Nov 2012 16:19:38 +0000 (17:19 +0100)]
drm/nouveau: fix acpi edid retrieval

Commit c0077061e7ea accidentally inverted the logic for nouveau_acpi_edid,
causing it to only show a connector as connected when the edid could not
be retrieved with acpi.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/disp: fix regression in vblank semaphore release
Kelly Doran [Wed, 7 Nov 2012 00:02:04 +0000 (10:02 +1000)]
drm/nvc0/disp: fix regression in vblank semaphore release

Signed-off-by: Kelly Doran <kel.p.doran@gmail.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv40/mpeg: fix context handling
Marcin Slusarz [Tue, 6 Nov 2012 21:48:51 +0000 (22:48 +0100)]
drm/nv40/mpeg: fix context handling

It slipped in thanks to typeless API.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv40/graph: fix typo in type names
Marcin Slusarz [Tue, 6 Nov 2012 21:48:50 +0000 (22:48 +0100)]
drm/nv40/graph: fix typo in type names

nv04_graph_priv / nv04_graph_chan are not defined in this context...

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv41/vm: fix typo in type name
Marcin Slusarz [Tue, 6 Nov 2012 21:48:49 +0000 (22:48 +0100)]
drm/nv41/vm: fix typo in type name

It's a miracle it compiles at all - nv04_vm_priv does not exist
anywhere in the tree.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agoMerge branch 'drm-fixes-3.7' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 9 Nov 2012 03:29:07 +0000 (13:29 +1000)]
Merge branch 'drm-fixes-3.7' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

Just some minor fixes for VM reg check and a regression fix for dce3 plls

* 'drm-fixes-3.7' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon/si: add some missing regs to the VM reg checker
  drm/radeon/cayman: add some missing regs to the VM reg checker
  drm/radeon/dce3: switch back to old pll allocation order for discrete

11 years agoxfs: fix reading of wrapped log data
Dave Chinner [Fri, 2 Nov 2012 00:38:44 +0000 (11:38 +1100)]
xfs: fix reading of wrapped log data

Commit 4439647 ("xfs: reset buffer pointers before freeing them") in
3.0-rc1 introduced a regression when recovering log buffers that
wrapped around the end of log. The second part of the log buffer at
the start of the physical log was being read into the header buffer
rather than the data buffer, and hence recovery was seeing garbage
in the data buffer when it got to the region of the log buffer that
was incorrectly read.

Cc: <stable@vger.kernel.org> # 3.0.x, 3.2.x, 3.4.x 3.6.x
Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: fix buffer shudown reference count mismatch
Dave Chinner [Fri, 2 Nov 2012 03:23:12 +0000 (14:23 +1100)]
xfs: fix buffer shudown reference count mismatch

When we shut down the filesystem, we have to unpin and free all the
buffers currently active in the CIL. To do this we unpin and remove
them in one operation as a result of a failed iclogbuf write. For
buffers, we do this removal via a simultated IO completion of after
marking the buffer stale.

At the time we do this, we have two references to the buffer - the
active LRU reference and the buf log item.  The LRU reference is
removed by marking the buffer stale, and the active CIL reference is
by the xfs_buf_iodone() callback that is run by
xfs_buf_do_callbacks() during ioend processing (via the bp->b_iodone
callback).

However, ioend processing requires one more reference - that of the
IO that it is completing. We don't have this reference, so we free
the buffer prematurely and use it after it is freed. For buffers
marked with XBF_ASYNC, this leads to assert failures in
xfs_buf_rele() on debug kernels because the b_hold count is zero.

Fix this by making sure we take the necessary IO reference before
starting IO completion processing on the stale buffer, and set the
XBF_ASYNC flag to ensure that IO completion processing removes all
the active references from the buffer to ensure it is fully torn
down.

Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: don't vmap inode cluster buffers during free
Dave Chinner [Fri, 2 Nov 2012 00:38:42 +0000 (11:38 +1100)]
xfs: don't vmap inode cluster buffers during free

Inode buffers do not need to be mapped as inodes are read or written
directly from/to the pages underlying the buffer. This fixes a
regression introduced by commit 611c994 ("xfs: make XBF_MAPPED the
default behaviour").

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: invalidate allocbt blocks moved to the free list
Dave Chinner [Fri, 2 Nov 2012 00:38:41 +0000 (11:38 +1100)]
xfs: invalidate allocbt blocks moved to the free list

When we free a block from the alloc btree tree, we move it to the
freelist held in the AGFL and mark it busy in the busy extent tree.
This typically happens when we merge btree blocks.

Once the transaction is committed and checkpointed, the block can
remain on the free list for an indefinite amount of time.  Now, this
isn't the end of the world at this point - if the free list is
shortened, the buffer is invalidated in the transaction that moves
it back to free space. If the buffer is allocated as metadata from
the free list, then all the modifications getted logged, and we have
no issues, either. And if it gets allocated as userdata direct from
the freelist, it gets invalidated and so will never get written.

However, during the time it sits on the free list, pressure on the
log can cause the AIL to be pushed and the buffer that covers the
block gets pushed for write. IOWs, we end up writing a freed
metadata block to disk. Again, this isn't the end of the world
because we know from the above we are only writing to free space.

The problem, however, is for validation callbacks. If the block was
on old btree root block, then the level of the block is going to be
higher than the current tree root, and so will fail validation.
There may be other inconsistencies in the block as well, and
currently we don't care because the block is in free space. Shutting
down the filesystem because a freed block doesn't pass write
validation, OTOH, is rather unfriendly.

So, make sure we always invalidate buffers as they move from the
free space trees to the free list so that we guarantee they never
get written to disk while on the free list.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Phil White <pwhite@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: silence uninitialised f.file warning.
Dave Chinner [Thu, 25 Oct 2012 06:22:30 +0000 (17:22 +1100)]
xfs: silence uninitialised f.file warning.

Uninitialised variable build warning introduced by 2903ff0 ("switch
simple cases of fget_light to fdget"), gcc is not smart enough to
work out that the variable is not used uninitialised, and the commit
removed the initialisation at declaration that the old variable had.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: growfs: don't read garbage for new secondary superblocks
Dave Chinner [Tue, 9 Oct 2012 03:50:52 +0000 (14:50 +1100)]
xfs: growfs: don't read garbage for new secondary superblocks

When updating new secondary superblocks in a growfs operation, the
superblock buffer is read from the newly grown region of the
underlying device. This is not guaranteed to be zero, so violates
the underlying assumption that the unused parts of superblocks are
zero filled. Get a new buffer for these secondary superblocks to
ensure that the unused regions are zero filled correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: move allocation stack switch up to xfs_bmapi_allocate
Dave Chinner [Fri, 5 Oct 2012 01:06:59 +0000 (11:06 +1000)]
xfs: move allocation stack switch up to xfs_bmapi_allocate

Switching stacks are xfs_alloc_vextent can cause deadlocks when we
run out of worker threads on the allocation workqueue. This can
occur because xfs_bmap_btalloc can make multiple calls to
xfs_alloc_vextent() and even if xfs_alloc_vextent() fails it can
return with the AGF locked in the current allocation transaction.

If we then need to make another allocation, and all the allocation
worker contexts are exhausted because the are blocked waiting for
the AGF lock, holder of the AGF cannot get it's xfs-alloc_vextent
work completed to release the AGF.  Hence allocation effectively
deadlocks.

To avoid this, move the stack switch one layer up to
xfs_bmapi_allocate() so that all of the allocation attempts in a
single switched stack transaction occur in a single worker context.
This avoids the problem of an allocation being blocked waiting for
a worker thread whilst holding the AGF.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: introduce XFS_BMAPI_STACK_SWITCH
Dave Chinner [Fri, 5 Oct 2012 01:06:58 +0000 (11:06 +1000)]
xfs: introduce XFS_BMAPI_STACK_SWITCH

Certain allocation paths through xfs_bmapi_write() are in situations
where we have limited stack available. These are almost always in
the buffered IO writeback path when convertion delayed allocation
extents to real extents.

The current stack switch occurs for userdata allocations, which
means we also do stack switches for preallocation, direct IO and
unwritten extent conversion, even those these call chains have never
been implicated in a stack overrun.

Hence, let's target just the single stack overun offended for stack
switches. To do that, introduce a XFS_BMAPI_STACK_SWITCH flag that
the caller can pass xfs_bmapi_write() to indicate it should switch
stacks if it needs to do allocation.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: zero allocation_args on the kernel stack
Mark Tinguely [Thu, 20 Sep 2012 18:16:45 +0000 (13:16 -0500)]
xfs: zero allocation_args on the kernel stack

Zero the kernel stack space that makes up the xfs_alloc_arg structures.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: only update the last_sync_lsn when a transaction completes
Dave Chinner [Mon, 8 Oct 2012 10:56:12 +0000 (21:56 +1100)]
xfs: only update the last_sync_lsn when a transaction completes

The log write code stamps each iclog with the current tail LSN in
the iclog header so that recovery knows where to find the tail of
thelog once it has found the head. Normally this is taken from the
first item on the AIL - the log item that corresponds to the oldest
active item in the log.

The problem is that when the AIL is empty, the tail lsn is dervied
from the the l_last_sync_lsn, which is the LSN of the last iclog to
be written to the log. In most cases this doesn't happen, because
the AIL is rarely empty on an active filesystem. However, when it
does, it opens up an interesting case when the transaction being
committed to the iclog spans multiple iclogs.

That is, the first iclog is stamped with the l_last_sync_lsn, and IO
is issued. Then the next iclog is setup, the changes copied into the
iclog (takes some time), and then the l_last_sync_lsn is stamped
into the header and IO is issued. This is still the same
transaction, so the tail lsn of both iclogs must be the same for log
recovery to find the entire transaction to be able to replay it.

The problem arises in that the iclog buffer IO completion updates
the l_last_sync_lsn with it's own LSN. Therefore, If the first iclog
completes it's IO before the second iclog is filled and has the tail
lsn stamped in it, it will stamp the LSN of the first iclog into
it's tail lsn field. If the system fails at this point, log recovery
will not see a complete transaction, so the transaction will no be
replayed.

The fix is simple - the l_last_sync_lsn is updated when a iclog
buffer IO completes, and this is incorrect. The l_last_sync_lsn
shoul dbe updated when a transaction is completed by a iclog buffer
IO. That is, only iclog buffers that have transaction commit
callbacks attached to them should update the l_last_sync_lsn. This
means that the last_sync_lsn will only move forward when a commit
record it written, not in the middle of a large transaction that is
rolling through multiple iclog buffers.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoarm64: mm: fix booting on systems with no memory below 4GB
Will Deacon [Thu, 8 Nov 2012 16:00:16 +0000 (16:00 +0000)]
arm64: mm: fix booting on systems with no memory below 4GB

Booting on a system with all of its memory above the 4GB boundary breaks
for two reasons:

(1) We still try to create a non-empty DMA32 zone
(2) no-bootmem limits allocations to 0xffffffff

This patch fixes these issues for ARM64.

Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoarm64: smp: add missing completion for secondary boot
Will Deacon [Wed, 7 Nov 2012 17:00:05 +0000 (17:00 +0000)]
arm64: smp: add missing completion for secondary boot

Commit 149c24151e85 ("ARM: SMP: use a timing out completion for cpu
hotplug") modified arm's CPU up path to use completions. It seems that
we only got half of this patch for arm64, so add the missing call to
complete.

Reported-by: Jon Brawn <jon.brawn@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>