firefly-linux-kernel-4.4.55.git
10 years agoMerge tag 'mvebu-drivers-3.15-2' of git://git.infradead.org/linux-mvebu into next...
Arnd Bergmann [Mon, 17 Mar 2014 10:14:34 +0000 (11:14 +0100)]
Merge tag 'mvebu-drivers-3.15-2' of git://git.infradead.org/linux-mvebu into next/drivers

Merge "mvebu drivers for v3.15" from Jason Cooper:

pull request #1:

 - mvebu mbus
    - use of_find_matching_node_and_match

 - rtc
    - use PTR_ERR_OR_ZERO in isl12057
    - work around issue in mv where date returned is 2038

 - kirkwood -> mach-mvebu
    - various Kconfig oneliners to allow building kirkwood in -mvebu/

pull request #2:

 - reset
    - re-use qnap-poweroff driver for Synology NASs

* tag 'mvebu-drivers-3.15-2' of git://git.infradead.org/linux-mvebu:
  Power: Reset: Generalize qnap-poweroff to work on Synology devices.
  drivers: Enable building of Kirkwood drivers for mach-mvebu
  rtc: mv: reset date if after year 2038
  rtc: isl12057: use PTR_ERR_OR_ZERO to fix coccinelle warnings
  bus: mvebu-mbus: make use of of_find_matching_node_and_match

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'socfpga_updates_for_3.15_v2' of git://git.rocketboards.org/linux-socfpga...
Arnd Bergmann [Mon, 17 Mar 2014 09:26:40 +0000 (10:26 +0100)]
Merge tag 'socfpga_updates_for_3.15_v2' of git://git.rocketboards.org/linux-socfpga-next into next/drivers

Merge "SOCFPGA updates for 3.15 version 2" from Dinh Nguyen:

*Update SOCFPGA DTS to include ethernet, sd/mmc, and clock fixes
*Add stmmac ethernet glue layer
*Update socfpga_defconfig to include sd/mmc, and micrel_phy

* tag 'socfpga_updates_for_3.15_v2' of git://git.rocketboards.org/linux-socfpga-next:
  dts: socfpga: Add sysmgr node so the gmac can use to reference
  dts: socfpga: Add support for SD/MMC on the SOCFPGA platform
  dts: socfpga: Update clock entry to support multiple parents
  ARM: socfpga: Update socfpga_defconfig
  dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac.
  net: stmmac: Add SOCFPGA glue driver

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'renesas-clock4-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Mon, 17 Mar 2014 07:50:41 +0000 (00:50 -0700)]
Merge tag 'renesas-clock4-for-v3.15' of git://git./linux/kernel/git/horms/renesas into next/drivers

Merge "Fourth Round of Renesas ARM Based SoC Clock Updates for v3.15" from
Simon Horman:

r8a7791 (R-Car M2) SoC
* Correct SCIFA3-5 clocks

* tag 'renesas-clock4-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks

Signed-off-by: Olof Johansson\ 1 <olof@lixom.net\ 1>
10 years agoMerge tag 'renesas-clock3-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Mon, 17 Mar 2014 07:48:44 +0000 (00:48 -0700)]
Merge tag 'renesas-clock3-for-v3.15' of git://git./linux/kernel/git/horms/renesas into next/drivers

Merge "Third Round of Renesas ARM Based SoC Clock Updates for v3.15" from Simon
Horman:

r7s72100 (RZ/A1H) SoC
* Correct bus clock calculation

* tag 'renesas-clock3-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r7s72100: fix bus clock calculation

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'renesas-clock2-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Mon, 17 Mar 2014 07:47:52 +0000 (00:47 -0700)]
Merge tag 'renesas-clock2-for-v3.15' of git://git./linux/kernel/git/horms/renesas into next/drivers

Merge "Second Round of Renesas ARM Based SoC Clock Updates for v3.15" from
Simon Horman:

r8a7790 (R-Car H2) SoC
- Add sound SCU clock support

r8a7791 (R-Car M2) SoC
- Remove legacy clock aliases for DT devices

* tag 'renesas-clock2-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: add sound SCU clock support
  ARM: shmobile: r8a7791: Remove legacy clock aliases for DT devices

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'renesas-clock-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Mon, 17 Mar 2014 07:36:37 +0000 (00:36 -0700)]
Merge tag 'renesas-clock-for-v3.15' of git://git./linux/kernel/git/horms/renesas into next/drivers

Merge "Renesas ARM Based SoC Clock Updates for v3.15" from Simon Horman:

* r7s72100 SoC (RZ/A1H)
  - Add clock for SH Ethernet
  - Add RSPI clocks

* r8a7791 (R-Car M2)
  - Add QSPI and SDHI clocks

* r8a7790 (R-Car H2)
  - Add audio clock
  - Remove legacy DT clocks
  - Correct SYS DMAC clock defines

* tag 'renesas-clock-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: Remove legacy r8a7790 DT clocks
  ARM: shmobile: Add r8a7791 legacy SDHI clocks
  ARM: shmobile: r8a7790: Correct SYS DMAC clock defines
  ARM: shmobile: r7s72100: Add clock for r7s72100-ether
  ARM: shmobile: r8a7791 clock: add QSPI clocks
  ARM: shmobile: r7s72100 clock: Add RSPI clocks for DT
  ARM: shmobile: r7s72100 clock: Add RSPI clocks
  ARM: shmobile: r8a7790: add audio clock
  ARM: shmobile: r8a7778: add audio clock in new style

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoARM: shmobile: r8a7791: Fix SCIFA3-5 clocks
Geert Uytterhoeven [Wed, 12 Mar 2014 18:40:39 +0000 (19:40 +0100)]
ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks

The MSTP clocks for SCIFA3-5 are MSTP1106-1108, not MSTP1105-1107

Also reinsert them at the correct position to preserve sort order.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agodts: socfpga: Add sysmgr node so the gmac can use to reference
Dinh Nguyen [Mon, 10 Mar 2014 04:12:14 +0000 (23:12 -0500)]
dts: socfpga: Add sysmgr node so the gmac can use to reference

commit[7e0b4cd dts: socfpga: Add DTS entry for adding the stmmac glue
layer for stmmac.] references the sysmgr through its phandle. This patch
adds the appropriate sysmgr node for the gmac to use.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
10 years agodts: socfpga: Add support for SD/MMC on the SOCFPGA platform
Dinh Nguyen [Tue, 18 Feb 2014 02:31:02 +0000 (20:31 -0600)]
dts: socfpga: Add support for SD/MMC on the SOCFPGA platform

Introduce "altr,socfpga-dw-mshc" to enable Altera's SOCFPGA platform
specific implementation of the dw_mmc driver.

Also add the "syscon" binding to the "altr,sys-mgr" node. The clock
driver can use the syscon driver to toggle the register for the SD/MMC
clock phase shift settings.

Finally, fix an indentation error for the sysmgr node.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agoMerge tag 'omap-for-v3.15/crossbar-signed' of git://git.kernel.org/pub/scm/linux...
Olof Johansson [Sun, 9 Mar 2014 07:32:26 +0000 (23:32 -0800)]
Merge tag 'omap-for-v3.15/crossbar-signed' of git://git./linux/kernel/git/tmlind/linux-omap into next/drivers

Merge OMAP crossbar support from Tony Lindgren:

Add support for GIC crossbar that routes interrupts on newer omaps.

Looks like people wanted these merged via the omap tree as it's
the only user for the GIC crossbar.

* tag 'omap-for-v3.15/crossbar-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: DRA: Enable Crossbar IP support for DRA7XX
  ARM: OMAP4+: Correct Wakeup-gen code to use physical irq number
  DRIVERS: IRQCHIP: CROSSBAR: Add support for Crossbar IP
  DRIVERS: IRQCHIP: IRQ-GIC: Add support for routable irqs

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'mvebu-watchdog-3.15-2' of git://git.infradead.org/linux-mvebu into next...
Olof Johansson [Sun, 9 Mar 2014 06:03:58 +0000 (22:03 -0800)]
Merge tag 'mvebu-watchdog-3.15-2' of git://git.infradead.org/linux-mvebu into next/drivers

mvebu watchdog driver changes for v3.15 (incremental #2)
- remove warnings by using %pa for phys_addr_t

* tag 'mvebu-watchdog-3.15-2' of git://git.infradead.org/linux-mvebu:
  watchdog: orion_wdt: Use %pa to print 'phys_addr_t'

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'armsoc/for-3.15/drivers' of git://github.com/broadcom/mach-bcm into next...
Arnd Bergmann [Thu, 6 Mar 2014 04:53:03 +0000 (05:53 +0100)]
Merge tag 'armsoc/for-3.15/drivers' of git://github.com/broadcom/mach-bcm into next/drivers

Merge "ARM: mach-bcm: bcm281xx clock driver" from Matt Porter:

This pull request contains the Broadcom bcm281xx
clock driver series. This series is being merged
through the arm-soc tree because there is an
ordering dependency where the driver *must* be
merged before the related dts changes. This is
a result of the bcm281xx dts already containing
dummy fixed clock nodes that must be updated.

* tag 'armsoc/for-3.15/drivers' of git://github.com/broadcom/mach-bcm:
  clk: bcm281xx: don't disable unused peripheral clocks
  clk: bcm281xx: add initial clock framework support

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: shmobile: r7s72100: fix bus clock calculation
Wolfram Sang [Fri, 28 Feb 2014 09:32:55 +0000 (10:32 +0100)]
ARM: shmobile: r7s72100: fix bus clock calculation

The picture in the datasheet is a little misleading, yet the divider of
the bus_clk is 1/3 and not 2/3.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoPower: Reset: Generalize qnap-poweroff to work on Synology devices.
Andrew Lunn [Wed, 19 Feb 2014 20:02:35 +0000 (06:02 +1000)]
Power: Reset: Generalize qnap-poweroff to work on Synology devices.

The Synology NAS devices use a very similar mechanism to QNAP NAS
devices to power off. Both send a single charactor command to a PIC,
over the second serial port. However the baud rate and the command
differ. Generalize the driver to support this.

Signed-off-by: Ben Peddell <klightspeed@killerwolves.net>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agodts: socfpga: Update clock entry to support multiple parents
Dinh Nguyen [Wed, 19 Feb 2014 20:56:38 +0000 (14:56 -0600)]
dts: socfpga: Update clock entry to support multiple parents

The periph_pll and sdram_pll can have multiple parents. Update the device tree
to list all the possible parents for the PLLs. Add an entry for the the
f2s_sdram_ref_clk, which is a possible parent for the sdram_pll.

Also remove the clock-frequency entry in the f2s_periph_ref_clk, as this
property should be placed in dts file.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
10 years agoARM: socfpga: Update socfpga_defconfig
Dinh Nguyen [Wed, 17 Jul 2013 21:17:16 +0000 (16:17 -0500)]
ARM: socfpga: Update socfpga_defconfig

CONFIG_MICREL_PHY=y
CONFIG_EXT3_FS=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
CONFIG_MMC=y
CONFIG_MMC_DW=y

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
10 years agodts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac.
Dinh Nguyen [Thu, 6 Feb 2014 22:48:43 +0000 (16:48 -0600)]
dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac.

This patch adds the dts bindings documenation for the Altera SOCFPGA glue
layer for the Synopsys STMMAC ethernet driver.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
v3: Remove stray empty line at end of socfpga_cyclone5_socdk.dts
v2: Use the dwmac-sti as an example for a glue layer and split patch up
to have dts as a separate patch. Also cc dts maintainers since there is
a new binding.

10 years agoMerge branch 'crossbar_3.14_rc1' of git://github.com/Sricharanti/sricharan into omap...
Tony Lindgren [Fri, 28 Feb 2014 21:35:02 +0000 (13:35 -0800)]
Merge branch 'crossbar_3.14_rc1' of git://github.com/Sricharanti/sricharan into omap-for-v3.15/crossbar

10 years agonet: stmmac: Add SOCFPGA glue driver
Dinh Nguyen [Thu, 6 Feb 2014 22:19:50 +0000 (16:19 -0600)]
net: stmmac: Add SOCFPGA glue driver

Like the STi series SOCs, Altera's SOCFPGA also needs a glue layer on top of the
Synopsys gmac IP.

This patch adds the platform driver for the glue layer which configures the IP
before the generic STMMAC driver takes over.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
v3: Remove stray empty line at end of dwmac-socfpga.c.
v2: Use the dwmac-sti as an example for a glue layer and split patch up
to have dts as a separate patch. Also cc dts maintainers since there is
a new binding.

10 years agowatchdog: orion_wdt: Use %pa to print 'phys_addr_t'
Fabio Estevam [Tue, 25 Feb 2014 16:17:33 +0000 (13:17 -0300)]
watchdog: orion_wdt: Use %pa to print 'phys_addr_t'

When building an ARM multi_v7_defconfig with LPAE option selected we get the
following build warning:

drivers/watchdog/orion_wdt.c:272:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'phys_addr_t' [-Wformat=]

Fix it by using %pa to print 'phys_addr_t'.

Reported-by: Olof's autobuilder <build@lixom.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agodrivers: cci: Export CCI PMU revision
Punit Agrawal [Wed, 19 Feb 2014 12:17:03 +0000 (12:17 +0000)]
drivers: cci: Export CCI PMU revision

The event numbering changed between revision r0 and r1 of the CCI
PMU. Expose this to userspace to allow tooling to handle the
differences in event numbers.

Suggested-by: Drew Richardson <Drew.Richardson@arm.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agodrivers: cci: Extend support to CCI revisions > r1p2
Punit Agrawal [Wed, 19 Feb 2014 12:17:02 +0000 (12:17 +0000)]
drivers: cci: Extend support to CCI revisions > r1p2

The driver queries the CCI IP revision to distinguish between r0 and r1
scheme for event numbers and currently supports upto version r1p2. To
minimise code churn every time there's a new version of the IP, assume
that event numbering doesn't change for revisions > r1p0 (which is
the case).

The driver will still need an update for future revisions that change
the event numbers.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'qcom-drivers-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Tue, 25 Feb 2014 17:10:24 +0000 (18:10 +0100)]
Merge tag 'qcom-drivers-for-3.15' of git://git./linux/kernel/git/galak/linux-qcom into next/drivers

Merge "qcom driver changes for v3.15" from Kumar Gala:

We've split Qualcomm MSM support into legacy and multiplatform.  These
drivers are only relevant on the multiplatform supported SoCs so switch the
Kconfig depends to ARCH_QCOM.

* tag 'qcom-drivers-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom:
  gpio: msm: switch Kconfig to ARCH_QCOM depends
  hwrng: msm: switch Kconfig to ARCH_QCOM depends
  power: reset: msm - switch Kconfig to ARCH_QCOM depends
  drm/msm: drop ARCH_MSM Kconfig depend
  tty: serial: msm: Enable building msm_serial for ARCH_QCOM

10 years agoMerge branch 'qcom/cleanup' into next/drivers
Arnd Bergmann [Tue, 25 Feb 2014 17:09:27 +0000 (18:09 +0100)]
Merge branch 'qcom/cleanup' into next/drivers

* qcom/cleanup:
  ARM: qcom: Rename various msm prefixed functions to qcom
  clocksource: qcom: split building of legacy vs multiplatform support
  ARM: qcom: Split Qualcomm support into legacy and multiplatform
  clocksource: qcom: Move clocksource code out of mach-msm
  ARM: msm: kill off hotplug.c
  ARM: msm: Remove pen_release usage
  ARM: dts: msm: split out msm8660 and msm8960 soc into dts include

This cleanup branch is a dependency for the following qcom driver changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoirqchip: VIC: export vic_init_cascaded
Arnd Bergmann [Mon, 24 Feb 2014 21:19:24 +0000 (22:19 +0100)]
irqchip: VIC: export vic_init_cascaded

vic_init_cascaded is called by integrator impd1 code that can
be a loadable module, so the function has to be exported.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoMerge tag 'mvebu-watchdog-3.15' of git://git.infradead.org/linux-mvebu into next...
Arnd Bergmann [Tue, 25 Feb 2014 16:50:08 +0000 (17:50 +0100)]
Merge tag 'mvebu-watchdog-3.15' of git://git.infradead.org/linux-mvebu into next/drivers

mvebu watchdog driver changes for v3.15

 - orion watchdog
    - cleanup and extend driver to support Armada 370 and Armada XP

Depends:
 - tags/irqchip-mvebu-fixes-3.14 (already pulled by tglx)
    - both are based on v3.14-rc1

* tag 'mvebu-watchdog-3.15' of git://git.infradead.org/linux-mvebu:
  watchdog: orion: Enable the build on ARCH_MVEBU
  watchdog: orion: Add support for Armada 370 and Armada XP SoC
  watchdog: orion: Add per-compatible watchdog start implementation
  watchdog: orion: Add per-compatible clock initialization
  watchdog: orion: Introduce per-compatible of_device_id data
  watchdog: orion: Introduce an orion_watchdog device structure
  watchdog: orion: Remove unneeded BRIDGE_CAUSE clear
  watchdog: orion: Make RSTOUT register a separate resource
  watchdog: orion: Handle the interrupt so it's properly acked
  watchdog: orion: Make sure the watchdog is initially stopped
  watchdog: orion: Remove unused macros
  watchdog: orion: Use atomic access for shared registers
  watchdog: orion: Add clock error handling

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'irqchip-mvebu-fixes-3.14' of git://git.infradead.org/linux-mvebu into...
Arnd Bergmann [Tue, 25 Feb 2014 16:49:13 +0000 (17:49 +0100)]
Merge tag 'irqchip-mvebu-fixes-3.14' of git://git.infradead.org/linux-mvebu into next/drivers

irqchip mvebu fixes for v3.14

 - orion:
    - fixes for clearing bridge cause register, and clearing stale interrupts

* tag 'irqchip-mvebu-fixes-3.14' of git://git.infradead.org/linux-mvebu:
  irqchip: orion: Fix getting generic chip pointer.
  irqchip: orion: clear stale interrupts in irq_startup
  irqchip: orion: use handle_edge_irq on bridge irqs
  irqchip: orion: clear bridge cause register on init

This is a dependency for the mvebu watchdog changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'davinci-for-v3.15/nand' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Tue, 25 Feb 2014 16:42:59 +0000 (17:42 +0100)]
Merge tag 'davinci-for-v3.15/nand' of git://git./linux/kernel/git/nsekhar/linux-davinci into next/drivers

A patch to break dependency of DaVinci NAND
driver with mach-davinci. Required for reuse
of driver on other platforms (keystone).

* tag 'davinci-for-v3.15/nand' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: aemif: get rid of davinci-nand driver dependency on aemif

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agogpio: msm: switch Kconfig to ARCH_QCOM depends
Kumar Gala [Tue, 11 Feb 2014 20:08:06 +0000 (14:08 -0600)]
gpio: msm: switch Kconfig to ARCH_QCOM depends

We've split Qualcomm MSM support into legacy and multiplatform.  The gpio
msm-v2 driver is only relevant on the multiplatform supported SoCs so
switch the Kconfig depends to ARCH_QCOM.

CC: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
10 years agoclk: bcm281xx: don't disable unused peripheral clocks
Alex Elder [Fri, 14 Feb 2014 18:29:19 +0000 (12:29 -0600)]
clk: bcm281xx: don't disable unused peripheral clocks

Add the CLK_IGNORE_UNUSED flag when setting up a peripheral clock.
This prevents unused clocks from getting disabled, and by doing
this we can use the common clock code even before we've resolved
all the spots that need to get a reference to their clock.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Matt Porter <mporter@linaro.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agoclk: bcm281xx: add initial clock framework support
Alex Elder [Fri, 14 Feb 2014 18:29:18 +0000 (12:29 -0600)]
clk: bcm281xx: add initial clock framework support

Add code for device tree support of clocks in the BCM281xx family of
SoCs.  Machines in this family use peripheral clocks implemented by
"Kona" clock control units (CCUs).  (Other Broadcom SoC families use
Kona style CCUs as well, but support for them is not yet upstream.)

A BCM281xx SoC has multiple CCUs, each of which manages a set of
clocks on the SoC.  A Kona peripheral clock is composite clock that
may include a gate, a parent clock multiplexor, and zero, one
or two dividers.  There is a variety of gate types, and many gates
implement hardware-managed gating (often called "auto-gating").
Most dividers divide their input clock signal by an integer value
(one or more).  There are also "fractional" dividers which allow
division by non-integer values.  To accomodate such dividers,
clock rates and dividers are generally maintained by the code in
"scaled" form, which allows integer and fractional dividers to
be handled in a uniform way.

If present, the gate for a Kona peripheral clock must be enabled
when a change is made to its multiplexor or one of its dividers.
Additionally, dividers and multiplexors have trigger registers which
must be used whenever the divider value or selected parent clock is
changed.  The same trigger is often used for a divider and
multiplexor, and a BCM281xx peripheral clock occasionally has two
triggers.

The gate, dividers, and parent clock selector are treated in this
code as "components" of a peripheral clock.  Their functionality is
implemented directly--e.g. the common clock framework gate
implementation is not used for a Kona peripheral clock gate.  (This
has being considered though, and the intention is to evolve this
code to leverage common code as much as possible.)

The source code is divided into three general portions:

    drivers/clk/bcm/clk-kona.h
    drivers/clk/bcm/clk-kona.c
        These implement the basic Kona clock functionality,
        including the clk_ops methods and various routines to
        manipulate registers and interpret their values.  This
        includes some functions used to set clocks to a desired
        initial state (though this feature is only partially
        implemented here).

    drivers/clk/bcm/clk-kona-setup.c
        This contains generic run-time initialization code for
        data structures representing Kona CCUs and clocks.  This
        encapsulates the clock structure initialization that can't
        be done statically.  Note that there is a great deal of
        validity-checking code here, making explicit certain
        assumptions in the code.   This is mostly useful for adding
        new clock definitions and could possibly be disabled for
        production use.

    drivers/clk/bcm/clk-bcm281xx.c
        This file defines the specific CCUs used by BCM281XX family
        SoCs, as well as the specific clocks implemented by each.
        It declares a device tree clock match entry for each CCU
        defined.

    include/dt-bindings/clock/bcm281xx.h
        This file defines the selector (index) values used to
        identify a particular clock provided by a CCU.  It consists
        entirely of C preprocessor constants, to be used by both the
        C source and device tree source files.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Matt Porter <mporter@linaro.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
10 years agodrivers: Enable building of Kirkwood drivers for mach-mvebu
Andrew Lunn [Sat, 22 Feb 2014 19:15:00 +0000 (20:15 +0100)]
drivers: Enable building of Kirkwood drivers for mach-mvebu

With the move of kirkwood into mach-mvebu, drivers Kconfig need
tweeking to allow the kirkwood specific drivers to be built.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoARM: shmobile: r8a7790: add sound SCU clock support
Kuninori Morimoto [Wed, 19 Feb 2014 03:28:11 +0000 (19:28 -0800)]
ARM: shmobile: r8a7790: add sound SCU clock support

This is needed to use SRC (= Sampling Rate Converter).
MSTP1017 is defined top of MSTPxxx list to avoid runtime error,
since it is parent clock of MSTP1031 - MSTP1022

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791: Remove legacy clock aliases for DT devices
Laurent Pinchart [Wed, 19 Feb 2014 17:03:31 +0000 (18:03 +0100)]
ARM: shmobile: r8a7791: Remove legacy clock aliases for DT devices

Now that the r8a7791 DT platforms use the common clock framework,
there's no need to manually create clock aliases for devices
instantiated through DT, as those devices will reference their clocks
directly in the device tree. Remove those aliases.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Remove legacy r8a7790 DT clocks
Magnus Damm [Wed, 12 Feb 2014 04:09:37 +0000 (13:09 +0900)]
ARM: shmobile: Remove legacy r8a7790 DT clocks

The DT device case is handled by CCF these days, so get
rid of DT devices from the legacy clocks for r8a7790.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Add r8a7791 legacy SDHI clocks
Magnus Damm [Wed, 12 Feb 2014 04:26:01 +0000 (13:26 +0900)]
ARM: shmobile: Add r8a7791 legacy SDHI clocks

Add legacy r8a7791 SDHI clocks. This to allow the SDHI devices
to be used by legacy Koelsch board support.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: Correct SYS DMAC clock defines
Simon Horman [Thu, 6 Feb 2014 00:25:01 +0000 (09:25 +0900)]
ARM: shmobile: r8a7790: Correct SYS DMAC clock defines

This brings the implementation into line with the documentation.

This problem was introduced when SYS DMAC clock defines were added by
ac991dce6498b5fc ("ARM: shmobile: r8a7790: Add clock index macros for DT
sources") in v3.13-rc2. I do not believe this results in any problems as
these defines do not appear to be used anywhere yet.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: Add clock for r7s72100-ether
Simon Horman [Sun, 15 Dec 2013 07:24:53 +0000 (16:24 +0900)]
ARM: shmobile: r7s72100: Add clock for r7s72100-ether

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791 clock: add QSPI clocks
Geert Uytterhoeven [Tue, 4 Feb 2014 15:24:00 +0000 (16:24 +0100)]
ARM: shmobile: r8a7791 clock: add QSPI clocks

The QSPI clock divider value depends on the MD1, MD2, and MD3 mode
switches.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100 clock: Add RSPI clocks for DT
Geert Uytterhoeven [Tue, 4 Feb 2014 15:23:58 +0000 (16:23 +0100)]
ARM: shmobile: r7s72100 clock: Add RSPI clocks for DT

Add DT-style ("%08x.spi") clocks, as Genmai doesn't use the common
clock framework yet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100 clock: Add RSPI clocks
Geert Uytterhoeven [Tue, 4 Feb 2014 15:23:55 +0000 (16:23 +0100)]
ARM: shmobile: r7s72100 clock: Add RSPI clocks

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: add audio clock
Kuninori Morimoto [Tue, 14 Jan 2014 02:25:39 +0000 (18:25 -0800)]
ARM: shmobile: r8a7790: add audio clock

Current audio clock doesn't have dependency to device/driver,
but, it is not good design for DT support.
To avoid branch merge conflict issue,
it uses this load map, and this patch is 1) part.
 1) add old/new style clock in platform
 2) add new style clock method in driver
 3) remove old tyle clock from platform

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7778: add audio clock in new style
Kuninori Morimoto [Tue, 14 Jan 2014 02:25:27 +0000 (18:25 -0800)]
ARM: shmobile: r8a7778: add audio clock in new style

Current audio clock doesn't have dependency to device/driver,
but, it is not good design for DT support.
To avoid branch merge conflict issue,
it uses this load map, and this patch is 1) part.
 1) add new style clock in platform
 2) add new style clock method in driver
 3) remove old tyle clock from platform

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: davinci: aemif: get rid of davinci-nand driver dependency on aemif
Ivan Khoronzhuk [Thu, 30 Jan 2014 11:03:40 +0000 (13:03 +0200)]
ARM: davinci: aemif: get rid of davinci-nand driver dependency on aemif

The problem that the set timings code contains the call of Davinci
platform function davinci_aemif_setup_timing() which is not
accessible if kernel is built for another platform like Keystone.

The Keysone platform is going to use TI AEMIF driver.
If TI AEMIF is used we don't need to set timings and bus width.
It is done by AEMIF driver.

To get rid of davinci-nand driver dependency on aemif platform code
we moved aemif code to davinci platform.

The platform AEMIF code (aemif.c) has to be removed once Davinci
will be converted to DT and use ti-aemif.c driver.

Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
[nsekhar@ti.com: fixed checkpatch error and a build breakage due to
 missing include, rebased onto l2-mtd/master]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
10 years agowatchdog: orion: Enable the build on ARCH_MVEBU
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:35 +0000 (20:00 -0300)]
watchdog: orion: Enable the build on ARCH_MVEBU

After adding support for Armada 370/XP SoC let's enable the build on
these platforms.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Add support for Armada 370 and Armada XP SoC
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:31 +0000 (20:00 -0300)]
watchdog: orion: Add support for Armada 370 and Armada XP SoC

Using the added infrastructure for handling SoC differences,
this commit adds support for the watchdog controller available
in Armada 370 and Armada XP SoCs.

Also, and because the AXP clock initialization uses of_clk_get_by_name,
this commit changes the orion clock initialization to use clk_get() and
adds a proper clk_put() on the common exit/error paths.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Add per-compatible watchdog start implementation
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:30 +0000 (20:00 -0300)]
watchdog: orion: Add per-compatible watchdog start implementation

To handle differences between SoCs this commit adds per-compatible
string start() function for the watchdog kick-off. This is preparation
work and makes no functionality changes to the current driver.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Add per-compatible clock initialization
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:29 +0000 (20:00 -0300)]
watchdog: orion: Add per-compatible clock initialization

Following the introduction of the compatible-data field,
it's now possible to further abstract the clock initialization.
This will allow to support SoC with a different clock setup.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Introduce per-compatible of_device_id data
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:28 +0000 (20:00 -0300)]
watchdog: orion: Introduce per-compatible of_device_id data

This commit adds an orion_watchdog_data structure to hold compatible-data
information. This allows to remove the driver-wide definition and to
be able to add support for multiple compatible-strings in the future.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Introduce an orion_watchdog device structure
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:27 +0000 (20:00 -0300)]
watchdog: orion: Introduce an orion_watchdog device structure

In order to prepare to support multiple compatible-strings, this
commit adds a device structure to hold the driver's state.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Remove unneeded BRIDGE_CAUSE clear
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:26 +0000 (20:00 -0300)]
watchdog: orion: Remove unneeded BRIDGE_CAUSE clear

After adding the IRQ request, the BRIDGE_CAUSE bit should be cleared by the
bridge interrupt controller. There's no longer a need to do it in the watchdog
driver, so we can simply remove it.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Make RSTOUT register a separate resource
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:25 +0000 (20:00 -0300)]
watchdog: orion: Make RSTOUT register a separate resource

In order to support other SoC, it's required to distinguish
the 'control' timer register, from the 'rstout' register
that enables system reset on watchdog expiration.

To prevent a compatibility break, this commit adds a fallback
to a hardcoded RSTOUT address.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Handle the interrupt so it's properly acked
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:24 +0000 (20:00 -0300)]
watchdog: orion: Handle the interrupt so it's properly acked

DT-enabled plaforms, where the irqchip driver for the brigde interrupt
controller is available, can handle the watchdog IRQ properly. Therefore,
request the interrupt and add a dummy handler that merely calls panic().

This is done in order to have an initial 'ack' of the interruption,
which clears the watchdog state.

Furthermore, since some platforms don't have such IRQ, this commit
makes the interrupt specification optional.

Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Make sure the watchdog is initially stopped
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:23 +0000 (20:00 -0300)]
watchdog: orion: Make sure the watchdog is initially stopped

Having the watchdog initially fully stopped is important to avoid
any spurious watchdog triggers, in case the registers are not in
its reset state.

If the watchdog rstout is enabled and the watchdog counter running,
this initial stop is not performed, to comply with the 'nowayout'
parameter.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Remove unused macros
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:22 +0000 (20:00 -0300)]
watchdog: orion: Remove unused macros

These are not used anywhere so it's safe to remove them.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Use atomic access for shared registers
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:21 +0000 (20:00 -0300)]
watchdog: orion: Use atomic access for shared registers

Since the timer control register is shared with the clocksource driver,
use the recently introduced atomic_io_clear_set() to access such register.
Given the watchdog core already provides serialization for all the
watchdog ops, this commit allows to remove the spinlock entirely.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agowatchdog: orion: Add clock error handling
Ezequiel Garcia [Mon, 10 Feb 2014 23:00:20 +0000 (20:00 -0300)]
watchdog: orion: Add clock error handling

This commit adds a check for clk_prepare_enable success and introduces
an error path to disable the clock properly.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agortc: mv: reset date if after year 2038
Thomas Petazzoni [Tue, 18 Feb 2014 13:26:06 +0000 (14:26 +0100)]
rtc: mv: reset date if after year 2038

Dates after January, 19th 2038 are badly handled by userspace due to
the time being stored on 32 bits. This causes issues on some Marvell
platform on which the RTC is initialized by default to a date that's
beyond 2038, causing a really weird behavior of the RTC.

In order to avoid that, reset the date to a sane value if the RTC is
beyond 2038.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoMerge tag 'integrator-for-v3.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Olof Johansson [Fri, 21 Feb 2014 22:45:36 +0000 (14:45 -0800)]
Merge tag 'integrator-for-v3.15-1' of git://git./linux/kernel/git/linusw/linux-integrator into next/drivers

Merge "Integrator/Versatile base patch stack for the v3.15 series"
from Linus Walleij:

"this is a set of patches I have sent for review and failed to get ACKs
from the proper subsystem maintainers after repeated pings. However I
now need to have this rotated in linux-next as a base for multiplatform,
so please pull it in, it is all ARM drivers anyway. Russell pointed out
some things and these have been fixed and iterated in this series."

- Move integrator clock definitions to the device tree, alter
  clock and timer drivers accordingly.

- Alter the VIC irqchip driver to support cascaded VICs off
  a parent IRQ controller.

- Update the IM-PD1 plugin code to use managed resources.

- Register the VIC on the IM-PD1.

- Select the PL061 GPIO block for the IM-PD1 on the
  Integrator/AP.

* tag 'integrator-for-v3.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  ARM: integrator: select GPIO block
  ARM: integrator: register the IM-PD1 VIC
  ARM: integrator: use managed resources for the IM-PD1
  irqchip: support cascaded VICs
  irqchip: vic: update the base IRQ member correctly
  clk: versatile: respect parent rate in ICST clock
  clk: versatile: pass a parent to the ICST clock
  ARM: integrator: switch to fetch clocks from device tree
  ARM: SP804: make Integrator/CP timer pick clock from DT
  ARM: integrator: define clocks in the device trees

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoirqchip: orion: Fix getting generic chip pointer.
Andrew Lunn [Thu, 6 Feb 2014 23:41:58 +0000 (00:41 +0100)]
irqchip: orion: Fix getting generic chip pointer.

Enabling SPARSE_IRQ shows up a bug in the irq-orion bridge interrupt
handler. The bridge interrupt is implemented using a single generic
chip. Thus the parameter passed to irq_get_domain_generic_chip()
should always be zero.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Fixes: 9dbd90f17e4f ("irqchip: Add support for Marvell Orion SoCs")
Cc: <stable@vger.kernel.org> # v3.11+
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agohwrng: msm: switch Kconfig to ARCH_QCOM depends
Kumar Gala [Thu, 30 Jan 2014 20:43:49 +0000 (14:43 -0600)]
hwrng: msm: switch Kconfig to ARCH_QCOM depends

We've split Qualcomm MSM support into legacy and multiplatform.  The RNG
driver is only relevant on the multiplatform supported SoCs so switch the
Kconfig depends to ARCH_QCOM.

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
CC: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
10 years agoMerge tag 'renesas-soc-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git...
Olof Johansson [Thu, 20 Feb 2014 08:34:58 +0000 (00:34 -0800)]
Merge tag 'renesas-soc-for-v3.15' of git://git./linux/kernel/git/horms/renesas into next/drivers

Merge "Renesas ARM Based SoC Updates for v3.15" from Simon Horman:

* r7s72100 SoC (RZ/A1H)
  - Add i2c clocks (portion missing from previous patch due to miss-merge)

* r8a7791 (R-Car M2)
  - Add SATA clocks
  - Add ZS clock
  - Wait for status on all MSTP clocks
 -- Add I2C and VIN clocks

* r8a7790 (R-Car H2)
  - Add PCI USB host clock support
  - Add Audio DMAC, SATA and VIN clocks
  - Add Audio DMAC support

* r8a7779 (R-Car H1)
  - Wait for status on selected MSTP clocks

* tag 'renesas-soc-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: Add PCI USB host clock support
  ARM: shmobile: r7s72100: really add i2c clocks
  ARM: shmobile: r8a7791: Add SATA clocks
  ARM: shmobile: r8a7791: Add ZS clock
  ARM: shmobile: r8a7790: Add SATA clocks
  ARM: shmobile: r8a7790: Add VIN clock support
  ARM: shmobile: r8a7790: add Audio DMAC support
  ARM: shmobile: r8a7790: add Audio DMAC clock
  ARM: shmobile: r8a7791: Wait for status on all MSTP clocks
  ARM: shmobile: r8a7791: Add VIN clocks
  ARM: shmobile: r8a7791: Add I2C clocks
  ARM: shmobile: r8a7790: Wait for status on all MSTP clocks
  ARM: shmobile: r8a7779: Wait for status on selected MSTP clocks
  ARM: shmobile: wait for MSTP clock status to toggle, when enabling it

10 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 18 Feb 2014 18:04:09 +0000 (10:04 -0800)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Miscellaneous ext4 bug fixes for v3.14"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  jbd2: fix use after free in jbd2_journal_start_reserved()
  ext4: don't leave i_crtime.tv_sec uninitialized
  ext4: fix online resize with a non-standard blocks per group setting
  ext4: fix online resize with very large inode tables
  ext4: don't try to modify s_flags if the the file system is read-only
  ext4: fix error paths in swap_inode_boot_loader()
  ext4: fix xfstest generic/299 block validity failures

10 years agortc: isl12057: use PTR_ERR_OR_ZERO to fix coccinelle warnings
Fengguang Wu [Tue, 18 Feb 2014 18:00:21 +0000 (18:00 +0000)]
rtc: isl12057: use PTR_ERR_OR_ZERO to fix coccinelle warnings

drivers/rtc/rtc-isl12057.c:278:1-3: WARNING: PTR_RET can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: coccinelle/api/ptr_ret.cocci

CC: Arnaud Ebalard <arno@natisbad.org>
CC: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agojbd2: fix use after free in jbd2_journal_start_reserved()
Dan Carpenter [Tue, 18 Feb 2014 01:33:01 +0000 (20:33 -0500)]
jbd2: fix use after free in jbd2_journal_start_reserved()

If start_this_handle() fails then it leads to a use after free of
"handle".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Mon, 17 Feb 2014 21:51:00 +0000 (13:51 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

Pull Ceph fixes from Sage Weil:
 "We have some patches fixing up ACL support issues from Zheng and
  Guangliang and a mount option to enable/disable this support.  (These
  fixes were somewhat delayed by the Chinese holiday.)

  There is also a small fix for cached readdir handling when directories
  are fragmented"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: fix __dcache_readdir()
  ceph: add acl, noacl options for cephfs mount
  ceph: make ceph_forget_all_cached_acls() static inline
  ceph: add missing init_acl() for mkdir() and atomic_open()
  ceph: fix ceph_set_acl()
  ceph: fix ceph_removexattr()
  ceph: remove xattr when null value is given to setxattr()
  ceph: properly handle XATTR_CREATE and XATTR_REPLACE

10 years agoMerge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Mon, 17 Feb 2014 21:50:11 +0000 (13:50 -0800)]
Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French:
 "Three cifs fixes, the most important fixing the problem with passing
  bogus pointers with writev (CVE-2014-0069).

  Two additional cifs fixes are still in review (including the fix for
  an append problem which Al also discovered)"

* 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
  CIFS: Fix too big maxBuf size for SMB3 mounts
  cifs: ensure that uncached writes handle unmapped areas correctly
  [CIFS] Fix cifsacl mounts over smb2 to not call cifs

10 years agoFS-Cache: Handle removal of unadded object to the fscache_object_list rb tree
David Howells [Mon, 17 Feb 2014 15:01:47 +0000 (15:01 +0000)]
FS-Cache: Handle removal of unadded object to the fscache_object_list rb tree

When FS-Cache allocates an object, the following sequence of events can
occur:

 -->fscache_alloc_object()
    -->cachefiles_alloc_object() [via cache->ops->alloc_object]
    <--[returns new object]
    -->fscache_attach_object()
    <--[failed]
    -->cachefiles_put_object() [via cache->ops->put_object]
       -->fscache_object_destroy()
          -->fscache_objlist_remove()
             -->rb_erase() to remove the object from fscache_object_list.

resulting in a crash in the rbtree code.

The problem is that the object is only added to fscache_object_list on
the success path of fscache_attach_object() where it calls
fscache_objlist_add().

So if fscache_attach_object() fails, the object won't have been added to
the objlist rbtree.  We do, however, unconditionally try to remove the
object from the tree.

Thanks to NeilBrown for finding this and suggesting this solution.

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: (a customer of) NeilBrown <neilb@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoreiserfs: fix utterly brain-damaged indentation.
Dave Jones [Mon, 17 Feb 2014 21:21:24 +0000 (16:21 -0500)]
reiserfs: fix utterly brain-damaged indentation.

This has been this way for years, and every time I stumble across it I
lose my lunch.  After coming across it for the nth time in the Coverity
results, I had to overcome the bystander effect and do something about
it.

This ignores the 79 column limit in favor of making it look like C
instead of gibberish.

The correct thing to do here would be to lose some of the indentation by
breaking this function up into several smaller ones.  I might do that at
some point if I have the stomach to look at this again.

(Also some of those overlong ternary operations would likely be more
readable as regular if's)

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge tag 'dma-buf-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits...
Linus Torvalds [Mon, 17 Feb 2014 20:42:45 +0000 (12:42 -0800)]
Merge tag 'dma-buf-for-3.14' of git://git./linux/kernel/git/sumits/dma-buf

Pull dma-buf fix from Sumit Semwal:
 "Just some debugfs output updates.

  There's another patch related to dma-buf, but it'll get upstreamed via
  Greg KH's pull request"

* tag 'dma-buf-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits/dma-buf:
  dma-buf: update debugfs output

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt...
Linus Torvalds [Mon, 17 Feb 2014 20:40:36 +0000 (12:40 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/egtvedt/linux-avr32

Pull AVR32 fixes from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: add generic vga.h to Kbuild
  avr32: add generic ioremap_wc() definition in io.h
  avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use
  avr32: fix missing module.h causing build failure in mimc200/fram.c

10 years agoceph: fix __dcache_readdir()
Yan, Zheng [Thu, 13 Feb 2014 11:40:26 +0000 (19:40 +0800)]
ceph: fix __dcache_readdir()

If directory is fragmented, readdir() read its dirfrags one by one.
After reading all dirfrags, the corresponding dentries are sorted in
(frag_t, off) order in the dcache. If dentries of a directory are all
cached, __dcache_readdir() can use the cached dentries to satisfy
readdir syscall. But when checking if a given dentry is after the
position of readdir, __dcache_readdir() compares numerical value of
frag_t directly. This is wrong, it should use ceph_frag_compare().

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoceph: add acl, noacl options for cephfs mount
Sage Weil [Sun, 16 Feb 2014 18:05:29 +0000 (10:05 -0800)]
ceph: add acl, noacl options for cephfs mount

Make the 'acl' option dependent on having ACL support compiled in.  Make
the 'noacl' option work even without it so that one can always ask it to
be off and not error out on mount when it is not supported.

Signed-off-by: Guangliang Zhao <lucienchao@gmail.com>
Signed-off-by: Sage Weil <sage@inktank.com>
10 years agoceph: make ceph_forget_all_cached_acls() static inline
Guangliang Zhao [Sun, 16 Feb 2014 16:35:52 +0000 (08:35 -0800)]
ceph: make ceph_forget_all_cached_acls() static inline

Signed-off-by: Guangliang Zhao <lucienchao@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Sage Weil <sage@inktank.com>
10 years agoceph: add missing init_acl() for mkdir() and atomic_open()
Yan, Zheng [Tue, 11 Feb 2014 04:55:05 +0000 (12:55 +0800)]
ceph: add missing init_acl() for mkdir() and atomic_open()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoceph: fix ceph_set_acl()
Yan, Zheng [Tue, 11 Feb 2014 05:08:51 +0000 (13:08 +0800)]
ceph: fix ceph_set_acl()

If acl is equivalent to file mode permission bits, ceph_set_acl()
needs to remove any existing acl xattr. Use __ceph_setxattr() to
handle both setting and removing acl xattr cases, it doesn't return
-ENODATA when there is no acl xattr.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoceph: fix ceph_removexattr()
Yan, Zheng [Tue, 11 Feb 2014 05:23:09 +0000 (13:23 +0800)]
ceph: fix ceph_removexattr()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoceph: remove xattr when null value is given to setxattr()
Yan, Zheng [Tue, 11 Feb 2014 05:04:19 +0000 (13:04 +0800)]
ceph: remove xattr when null value is given to setxattr()

For the setxattr request, introduce a new flag CEPH_XATTR_REMOVE
to distinguish null value case from the zero-length value case.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoceph: properly handle XATTR_CREATE and XATTR_REPLACE
Yan, Zheng [Tue, 11 Feb 2014 05:01:19 +0000 (13:01 +0800)]
ceph: properly handle XATTR_CREATE and XATTR_REPLACE

return -EEXIST if XATTR_CREATE is set and xattr alread exists.
return -ENODATA if XATTR_REPLACE is set but xattr does not exist.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
10 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Mon, 17 Feb 2014 20:36:49 +0000 (12:36 -0800)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Pull powerpc fixes from Ben Herrenschmidt:
 "Here are some more powerpc fixes for 3.14

  The main one is a nasty issue with the NUMA balancing support which
  requires a small generic change and the addition of a new accessor to
  set _PAGE_NUMA.  Both have been reviewed and acked by Mel and Rik.

  The changelog should have plenty of details but basically, without
  this fix, we get random user segfaults and/or corruptions due to
  missing TLB/hash flushes.  Aneesh series of 3 patches fixes it.

  We have some vDSO vs.  perf fixes from Anton, some small EEH fixes
  from Gavin, a ppc32 regression vs the stack overflow detector, and a
  fix for the way we handle PCIe host bridge speed settings on pseries
  (which is needed for proper operations of AMD graphics cards on
  Power8)"

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/eeh: Disable EEH on reboot
  powerpc/eeh: Cleanup on eeh_subsystem_enabled
  powerpc/powernv: Rework EEH reset
  powerpc: Use unstripped VDSO image for more accurate profiling data
  powerpc: Link VDSOs at 0x0
  mm: Use ptep/pmdp_set_numa() for updating _PAGE_NUMA bit
  mm: Dirty accountable change only apply to non prot numa case
  powerpc/mm: Add new "set" flag argument to pte/pmd update function
  powerpc/pseries: Add Gen3 definitions for PCIE link speed
  powerpc/pseries: Fix regression on PCI link speed
  powerpc: Set the correct ksp_limit on ppc32 when switching to irq stack

10 years agoprintk: fix syslog() overflowing user buffer
Linus Torvalds [Mon, 17 Feb 2014 20:24:45 +0000 (12:24 -0800)]
printk: fix syslog() overflowing user buffer

This is not a buffer overflow in the traditional sense: we don't
overflow any *kernel* buffers, but we do mis-count the amount of data we
copy back to user space for the SYSLOG_ACTION_READ_ALL case.

In particular, if the user buffer is too small to hold everything, and
*if* there is a continuation line at just the right place, we can end up
giving the user more data than he asked for.

The reason is that we first count up the number of bytes all the log
records contains, then we walk the records again until we've skipped the
records at the beginning that won't fit, and then we walk the rest of
the records and copy them to the user space buffer.

And in between that "skip the initial records that won't fit" and the
"copy the records that *will* fit to user space", we reset the 'prev'
variable that contained the record information for the last record not
copied.  That meant that when we started copying to user space, we now
had a different character count than what we had originally calculated
in the first record walk-through.

The fix is to simply not clear the 'prev' flags value (in both cases
where we had the same logic: syslog_print_all and kmsg_dump_get_buffer:
the latter is used for pstore-like dumping)

Reported-and-tested-by: Debabrata Banerjee <dbanerje@akamai.com>
Acked-by: Kay Sievers <kay@vrfy.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoavr32: add generic vga.h to Kbuild
Chen Gang [Sun, 16 Feb 2014 11:36:06 +0000 (19:36 +0800)]
avr32: add generic vga.h to Kbuild

Need add generic "vga.h", or can not pass building for allmodconfig,
the related error:

    CC [M]  drivers/gpu/drm/drm_irq.o
  In file included from include/linux/vgaarb.h:34,
                   from drivers/gpu/drm/drm_irq.c:42:
  include/video/vga.h:22:21: error: asm/vga.h: No such file or directory

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Acked-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
10 years agoavr32: add generic ioremap_wc() definition in io.h
Chen Gang [Sun, 16 Feb 2014 11:39:30 +0000 (19:39 +0800)]
avr32: add generic ioremap_wc() definition in io.h

Need generic ioremap_wc(), or can not pass compiling with allmodconfig,
the related error:

    CC [M]  drivers/gpu/drm/drm_bufs.o
  drivers/gpu/drm/drm_bufs.c: In function 'drm_addmap_core':
  drivers/gpu/drm/drm_bufs.c:217: error: implicit declaration of function 'ioremap_wc'
  drivers/gpu/drm/drm_bufs.c:218: warning: assignment makes pointer from integer without a cast

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Acked-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
10 years agoavr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use
Chen Gang [Sat, 1 Feb 2014 12:35:54 +0000 (20:35 +0800)]
avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use

For avr32 cross compiler, do not define '__linux__' internally, so it
will cause issue with allmodconfig.

The related error:

    CC [M]  fs/coda/psdev.o
  In file included from include/linux/coda.h:64,
                   from fs/coda/psdev.c:45:
  include/uapi/linux/coda.h:221: error: expected specifier-qualifier-list before 'u_quad_t'

The related toolchain version (which only download, not re-compile):

  [root@gchen linux-next]# /upstream/toolchain/download/avr32-gnu-toolchain-linux_x86/bin/avr32-gcc -v
  Using built-in specs.
  Target: avr32
  Configured with: /data2/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/src/gcc/configure --target=avr32 --host=i686-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --enable-languages=c,c++ --disable-nls --disable-libssp --disable-libstdcxx-pch --with-dwarf2 --enable-version-specific-runtime-libs --disable-shared --enable-doc --with-mpfr-lib=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86/lib --with-mpfr-include=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86/include --with-gmp=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --with-mpc=/home/toolsbuild/jenkins-knuth/workspace/avr32-gnu-toolchain/avr32-gnu-toolchain-linux_x86 --enable-__cxa_atexit --disable-shared --with-newlib --with-pkgversion=AVR_32_bit_GNU_Toolchain_3.4.2_435 --with-bugurl=http://www
.atmel.com/avr
  Thread model: single
  gcc version 4.4.7 (AVR_32_bit_GNU_Toolchain_3.4.2_435)

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Acked-by: Hans-Christian Egtvedt <hegtvedt@cisco.com>
Cc: stable@vger.kernel.org
10 years agoavr32: fix missing module.h causing build failure in mimc200/fram.c
Paul Gortmaker [Fri, 10 Jan 2014 14:29:39 +0000 (09:29 -0500)]
avr32: fix missing module.h causing build failure in mimc200/fram.c

Causing this:

In file included from arch/avr32/boards/mimc200/fram.c:13:
include/linux/miscdevice.h:51: error: field 'list' has incomplete type
include/linux/miscdevice.h:55: error: expected specifier-qualifier-list before 'mode_t'
arch/avr32/boards/mimc200/fram.c:42: error: 'THIS_MODULE' undeclared here (not in a function)

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: stable@vger.kernel.org
10 years agoext4: don't leave i_crtime.tv_sec uninitialized
Theodore Ts'o [Mon, 17 Feb 2014 00:29:32 +0000 (19:29 -0500)]
ext4: don't leave i_crtime.tv_sec uninitialized

If the i_crtime field is not present in the inode, don't leave the
field uninitialized.

Fixes: ef7f38359 ("ext4: Add nanosecond timestamps")
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
10 years agopowerpc/eeh: Disable EEH on reboot
Gavin Shan [Wed, 12 Feb 2014 07:24:56 +0000 (15:24 +0800)]
powerpc/eeh: Disable EEH on reboot

We possiblly detect EEH errors during reboot, particularly in kexec
path, but it's impossible for device drivers and EEH core to handle
or recover them properly.

The patch registers one reboot notifier for EEH and disable EEH
subsystem during reboot. That means the EEH errors is going to be
cleared by hardware reset or second kernel during early stage of
PCI probe.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc/eeh: Cleanup on eeh_subsystem_enabled
Gavin Shan [Wed, 12 Feb 2014 07:24:55 +0000 (15:24 +0800)]
powerpc/eeh: Cleanup on eeh_subsystem_enabled

The patch cleans up variable eeh_subsystem_enabled so that we needn't
refer the variable directly from external. Instead, we will use
function eeh_enabled() and eeh_set_enable() to operate the variable.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc/powernv: Rework EEH reset
Gavin Shan [Wed, 12 Feb 2014 07:24:54 +0000 (15:24 +0800)]
powerpc/powernv: Rework EEH reset

When doing reset in order to recover the affected PE, we issue
hot reset on PE primary bus if it's not root bus. Otherwise, we
issue hot or fundamental reset on root port or PHB accordingly.
For the later case, we didn't cover the situation where PE only
includes root port and it potentially causes kernel crash upon
EEH error to the PE.

The patch reworks the logic of EEH reset to improve the code
readability and also avoid the kernel crash.

Cc: stable@vger.kernel.org
Reported-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc: Use unstripped VDSO image for more accurate profiling data
Anton Blanchard [Wed, 12 Feb 2014 06:18:50 +0000 (17:18 +1100)]
powerpc: Use unstripped VDSO image for more accurate profiling data

We are seeing a lot of hits in the VDSO that are not resolved by perf.
A while(1) gettimeofday() loop shows the issue:

27.64%  [vdso]  [.] 0x000000000000060c
22.57%  [vdso]  [.] 0x0000000000000628
16.88%  [vdso]  [.] 0x0000000000000610
12.39%  [vdso]  [.] __kernel_gettimeofday
 6.09%  [vdso]  [.] 0x00000000000005f8
 3.58%  test    [.] 00000037.plt_call.gettimeofday@@GLIBC_2.18
 2.94%  [vdso]  [.] __kernel_datapage_offset
 2.90%  test    [.] main

We are using a stripped VDSO image which means only symbols with
relocation info can be resolved. There isn't a lot of point to
stripping the VDSO, the debug info is only about 1kB:

4680 arch/powerpc/kernel/vdso64/vdso64.so
5815 arch/powerpc/kernel/vdso64/vdso64.so.dbg

By using the unstripped image, we can resolve all the symbols in the
VDSO and the perf profile data looks much better:

76.53%  [vdso]  [.] __do_get_tspec
12.20%  [vdso]  [.] __kernel_gettimeofday
 5.05%  [vdso]  [.] __get_datapage
 3.20%  test    [.] main
 2.92%  test    [.] 00000037.plt_call.gettimeofday@@GLIBC_2.18

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc: Link VDSOs at 0x0
Anton Blanchard [Wed, 12 Feb 2014 06:17:05 +0000 (17:17 +1100)]
powerpc: Link VDSOs at 0x0

perf is failing to resolve symbols in the VDSO. A while (1)
gettimeofday() loop shows:

93.99%  [vdso]  [.] 0x00000000000005e0
 3.12%  test    [.] 00000037.plt_call.gettimeofday@@GLIBC_2.18
 2.81%  test    [.] main

The reason for this is that we are linking our VDSO shared libraries
at 1MB, which is a little weird. Even though this is uncommon, Alan
points out that it is valid and we should probably fix perf userspace.

Regardless, I can't see a reason why we are doing this. The code
is all position independent and we never rely on the VDSO ending
up at 1M (and we never place it there on 64bit tasks).

Changing our link address to 0x0 fixes perf VDSO symbol resolution:

73.18%  [vdso]  [.] 0x000000000000060c
12.39%  [vdso]  [.] __kernel_gettimeofday
 3.58%  test    [.] 00000037.plt_call.gettimeofday@@GLIBC_2.18
 2.94%  [vdso]  [.] __kernel_datapage_offset
 2.90%  test    [.] main

We still have some local symbol resolution issues that will be
fixed in a subsequent patch.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agomm: Use ptep/pmdp_set_numa() for updating _PAGE_NUMA bit
Aneesh Kumar K.V [Wed, 12 Feb 2014 03:43:38 +0000 (09:13 +0530)]
mm: Use ptep/pmdp_set_numa() for updating _PAGE_NUMA bit

Archs like ppc64 doesn't do tlb flush in set_pte/pmd functions when using
a hash table MMU for various reasons (the flush is handled as part of
the PTE modification when necessary).

ppc64 thus doesn't implement flush_tlb_range for hash based MMUs.

Additionally ppc64 require the tlb flushing to be batched within ptl locks.

The reason to do that is to ensure that the hash page table is in sync with
linux page table.

We track the hpte index in linux pte and if we clear them without flushing
hash and drop the ptl lock, we can have another cpu update the pte and can
end up with duplicate entry in the hash table, which is fatal.

We also want to keep set_pte_at simpler by not requiring them to do hash
flush for performance reason. We do that by assuming that set_pte_at() is
never *ever* called on a PTE that is already valid.

This was the case until the NUMA code went in which broke that assumption.

Fix that by introducing a new pair of helpers to set _PAGE_NUMA in a
way similar to ptep/pmdp_set_wrprotect(), with a generic implementation
using set_pte_at() and a powerpc specific one using the appropriate
mechanism needed to keep the hash table in sync.

Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agomm: Dirty accountable change only apply to non prot numa case
Aneesh Kumar K.V [Wed, 12 Feb 2014 03:43:37 +0000 (09:13 +0530)]
mm: Dirty accountable change only apply to non prot numa case

So move it within the if loop

Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc/mm: Add new "set" flag argument to pte/pmd update function
Aneesh Kumar K.V [Wed, 12 Feb 2014 03:43:36 +0000 (09:13 +0530)]
powerpc/mm: Add new "set" flag argument to pte/pmd update function

pte_update() is a powerpc-ism used to change the bits of a PTE
when the access permission is being restricted (a flush is
potentially needed).

It uses atomic operations on when needed and handles the hash
synchronization on hash based processors.

It is currently only used to clear PTE bits and so the current
implementation doesn't provide a way to also set PTE bits.

The new _PAGE_NUMA bit, when set, is actually restricting access
so it must use that function too, so this change adds the ability
for pte_update() to also set bits.

We will use this later to set the _PAGE_NUMA bit.

Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc/pseries: Add Gen3 definitions for PCIE link speed
Kleber Sacilotto de Souza [Fri, 17 Jan 2014 13:56:52 +0000 (11:56 -0200)]
powerpc/pseries: Add Gen3 definitions for PCIE link speed

Rev3 of the PCI Express Base Specification defines a Supported Link
Speeds Vector where the bit definitions within this field are:

Bit 0 - 2.5 GT/s
Bit 1 - 5.0 GT/s
Bit 2 - 8.0 GT/s

This vector definition is used by the platform firmware to export the
maximum and current link speeds of the PCI bus via the
"ibm,pcie-link-speed-stats" device-tree property.

This patch updates pseries_root_bridge_prepare() to detect Gen3
speed buses (defined by 0x04).

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc/pseries: Fix regression on PCI link speed
Kleber Sacilotto de Souza [Fri, 17 Jan 2014 13:56:51 +0000 (11:56 -0200)]
powerpc/pseries: Fix regression on PCI link speed

Commit 5091f0c (powerpc/pseries: Fix PCIE link speed endian issue)
introduced a regression on the PCI link speed detection using the
device-tree property. The ibm,pcie-link-speed-stats property is composed
of two 32-bit integers, the first one being the maxinum link speed and
the second the current link speed. The changes introduced by the
aforementioned commit are considering just the first integer.

Fix this issue by changing how the property is accessed, using the
helper functions to properly access the array of values. The explicit
byte swapping is not needed anymore here, since it's done by the helper
functions.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agopowerpc: Set the correct ksp_limit on ppc32 when switching to irq stack
Kevin Hao [Fri, 17 Jan 2014 04:25:28 +0000 (12:25 +0800)]
powerpc: Set the correct ksp_limit on ppc32 when switching to irq stack

Guenter Roeck has got the following call trace on a p2020 board:
  Kernel stack overflow in process eb3e5a00, r1=eb79df90
  CPU: 0 PID: 2838 Comm: ssh Not tainted 3.13.0-rc8-juniper-00146-g19eca00 #4
  task: eb3e5a00 ti: c0616000 task.ti: ef440000
  NIP: c003a420 LR: c003a410 CTR: c0017518
  REGS: eb79dee0 TRAP: 0901   Not tainted (3.13.0-rc8-juniper-00146-g19eca00)
  MSR: 00029000 <CE,EE,ME>  CR: 24008444  XER: 00000000
  GPR00: c003a410 eb79df90 eb3e5a00 00000000 eb05d900 00000001 65d87646 00000000
  GPR08: 00000000 020b8000 00000000 00000000 44008442
  NIP [c003a420] __do_softirq+0x94/0x1ec
  LR [c003a410] __do_softirq+0x84/0x1ec
  Call Trace:
  [eb79df90] [c003a410] __do_softirq+0x84/0x1ec (unreliable)
  [eb79dfe0] [c003a970] irq_exit+0xbc/0xc8
  [eb79dff0] [c000cc1c] call_do_irq+0x24/0x3c
  [ef441f20] [c00046a8] do_IRQ+0x8c/0xf8
  [ef441f40] [c000e7f4] ret_from_except+0x0/0x18
  --- Exception: 501 at 0xfcda524
      LR = 0x10024900
  Instruction dump:
  7c781b78 3b40000a 3a73b040 543c0024 3a800000 3b3913a0 7ef5bb78 48201bf9
  5463103a 7d3b182e 7e89b92e 7c008146 <3ba000007e7e9b78 48000014 57fff87f
  Kernel panic - not syncing: kernel stack overflow
  CPU: 0 PID: 2838 Comm: ssh Not tainted 3.13.0-rc8-juniper-00146-g19eca00 #4
  Call Trace:

The reason is that we have used the wrong register to calculate the
ksp_limit in commit cbc9565ee826 (powerpc: Remove ksp_limit on ppc64).
Just fix it.

As suggested by Benjamin Herrenschmidt, also add the C prototype of the
function in the comment in order to avoid such kind of errors in the
future.

Cc: stable@vger.kernel.org # 3.12
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 years agoLinux 3.14-rc3
Linus Torvalds [Sun, 16 Feb 2014 21:30:25 +0000 (13:30 -0800)]
Linux 3.14-rc3

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Sun, 16 Feb 2014 19:05:27 +0000 (11:05 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "We have a small collection of fixes in my for-linus branch.

  The big thing that stands out is a revert of a new ioctl.  Users
  haven't shipped yet in btrfs-progs, and Dave Sterba found a better way
  to export the information"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: use right clone root offset for compressed extents
  btrfs: fix null pointer deference at btrfs_sysfs_add_one+0x105
  Btrfs: unset DCACHE_DISCONNECTED when mounting default subvol
  Btrfs: fix max_inline mount option
  Btrfs: fix a lockdep warning when cleaning up aborted transaction
  Revert "btrfs: add ioctl to export size of global metadata reservation"

10 years agoMerge tag 'dt-fixes-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh...
Linus Torvalds [Sun, 16 Feb 2014 19:03:58 +0000 (11:03 -0800)]
Merge tag 'dt-fixes-for-3.14' of git://git./linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:
 "Fix booting on PPC boards.  Changes to of_match_node matching caused
  the serial port on some PPC boards to stop working.  Reverted the
  change and reimplement to split matching between new style compatible
  only matching and fallback to old matching algorithm"

* tag 'dt-fixes-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: search the best compatible match first in __of_match_node()
  Revert "OF: base: match each node compatible against all given matches first"