pandora-kernel.git
9 years agoarm: omap: intc: switch over to linear irq domain intc-for-v3.18
Felipe Balbi [Tue, 9 Sep 2014 00:54:58 +0000 (17:54 -0700)]
arm: omap: intc: switch over to linear irq domain

now that we don't need to support legacy board-files,
we can completely switch over to a linear irq domain
and make use of irq_alloc_domain_generic_chips() to
allocate all generic irq chips for us.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: get rid of ifdef hack
Felipe Balbi [Tue, 9 Sep 2014 00:54:57 +0000 (17:54 -0700)]
arm: omap: irq: get rid of ifdef hack

we don't need the ifdef if we have omap_nr_pending
telling us how many pending registers we have
on current platform. This solves a possible
problem where we could try to handle bogus
interrupts on OMAP2 and OMAP3 if using single
zImage kernel, because we would end up reading
the following pending FIQ register.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: introduce omap_nr_pending
Felipe Balbi [Tue, 9 Sep 2014 00:54:57 +0000 (17:54 -0700)]
arm: omap: irq: introduce omap_nr_pending

that variable will tell us how many INTC_PENDING_IRQn
registers we have. It'll be used on a following patch
to cleanup omap_intc_handle_irq() a bit.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: remove nr_irqs argument
Felipe Balbi [Tue, 9 Sep 2014 00:54:55 +0000 (17:54 -0700)]
arm: omap: irq: remove nr_irqs argument

we can set our global omap_nr_irqs early on
and drop the extra argument to omap_init_irq().

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: remove unnecessary header
Felipe Balbi [Tue, 9 Sep 2014 00:54:54 +0000 (17:54 -0700)]
arm: omap: irq: remove unnecessary header

There's no need for that header to be included.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: drop omap2_intc_handle_irq()
Felipe Balbi [Tue, 9 Sep 2014 00:54:52 +0000 (17:54 -0700)]
arm: omap: irq: drop omap2_intc_handle_irq()

that was just a no-op wrapper around omap_intc_handle_irq
anyway.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: drop omap3_intc_handle_irq()
Felipe Balbi [Tue, 9 Sep 2014 00:54:52 +0000 (17:54 -0700)]
arm: omap: irq: drop omap3_intc_handle_irq()

now that we're calling set_handle_irq() from
init_irq(), we can safely drop all callers to
omap3_intc_handle_irq() and its definition.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: call set_handle_irq() from .init_irq
Felipe Balbi [Tue, 9 Sep 2014 00:54:52 +0000 (17:54 -0700)]
arm: omap: irq: call set_handle_irq() from .init_irq

the idea is that board-files won't need to set
.handle_irq on their machine_descs, which lets
us drop a little more pointless code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: move some more code around
Felipe Balbi [Tue, 9 Sep 2014 00:54:51 +0000 (17:54 -0700)]
arm: omap: irq: move some more code around

We want .init_irq to call set_irq_handle() for
legacy platforms. Note that this code will also
be dropped once omap2/3 devices are completely
moved to DT.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: boot: dts: omap2/3/am33xx: drop ti,intc-size
Felipe Balbi [Tue, 9 Sep 2014 00:54:49 +0000 (17:54 -0700)]
arm: boot: dts: omap2/3/am33xx: drop ti,intc-size

we are now infering number of IRQ lines based
on correct compatible flag, which renders this
binding completely useless.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: drop ti,intc-size support
Felipe Balbi [Tue, 9 Sep 2014 00:54:48 +0000 (17:54 -0700)]
arm: omap: irq: drop ti,intc-size support

we don't need that anymore since specific
devices are passing correct compatible flags.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: boot: dts: am33xx/omap3: fix intc compatible flag
Felipe Balbi [Tue, 9 Sep 2014 00:54:48 +0000 (17:54 -0700)]
arm: boot: dts: am33xx/omap3: fix intc compatible flag

that way, our intc driver can figure out how
many IRQ lines INTC has.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: use compatible flag to figure out number of IRQ lines
Felipe Balbi [Tue, 9 Sep 2014 00:54:47 +0000 (17:54 -0700)]
arm: omap: irq: use compatible flag to figure out number of IRQ lines

so far, only am33xx has 128 lines, all other devices
have only 96.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: add specific compatibles for omap3 and am33xx devices
Felipe Balbi [Tue, 9 Sep 2014 00:54:46 +0000 (17:54 -0700)]
arm: omap: irq: add specific compatibles for omap3 and am33xx devices

with this, we can use a compatible flag to figure
out how many irq lines are wired up, no need for
our TI-specific ti,intc-size binding.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: drop .handle_irq and .init_irq fields
Felipe Balbi [Tue, 9 Sep 2014 00:54:45 +0000 (17:54 -0700)]
arm: omap: irq: drop .handle_irq and .init_irq fields

now we can safely drop those fields from our machine_desc.

While at that, also drop the now unused omap_intc_of_init()
definition.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: use IRQCHIP_DECLARE macro
Felipe Balbi [Tue, 9 Sep 2014 00:54:43 +0000 (17:54 -0700)]
arm: omap: irq: use IRQCHIP_DECLARE macro

IRQCHIP_DECLARE macro is used to declare the same
of_device_id structure for irqchips, it's just
a helper. No functional changes.

Note that we're temporarily including irqchip.h
with its full path, until we move this driver
to drivers/irqchip/.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: call set_handle_irq() from intc_of_init
Felipe Balbi [Tue, 9 Sep 2014 00:54:43 +0000 (17:54 -0700)]
arm: omap: irq: call set_handle_irq() from intc_of_init

this will let us drop .handle_irq and .init_irq fields
from our generic machine_descs.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: make intc_of_init static
Felipe Balbi [Tue, 9 Sep 2014 00:54:43 +0000 (17:54 -0700)]
arm: omap: irq: make intc_of_init static

nobody uses that function outside of this file,
so we don't need to expose it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: reorganize code a little bit
Felipe Balbi [Tue, 9 Sep 2014 00:54:42 +0000 (17:54 -0700)]
arm: omap: irq: reorganize code a little bit

no functional changes, just moving code around.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: always define omap3 support
Felipe Balbi [Tue, 9 Sep 2014 00:54:40 +0000 (17:54 -0700)]
arm: omap: irq: always define omap3 support

remove ifdef around omap3 INTC support. This
will make it easier to reuse code for PM.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: rename omap3_intc_regs
Felipe Balbi [Tue, 9 Sep 2014 00:54:38 +0000 (17:54 -0700)]
arm: omap: irq: rename omap3_intc_regs

just to make it clearer that it can
be used on all omaps.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: remove unnecessary base_addr argument
Felipe Balbi [Tue, 9 Sep 2014 00:54:37 +0000 (17:54 -0700)]
arm: omap: irq: remove unnecessary base_addr argument

omap_intc_handle_irq now had an unnecessary
base_addr argument. Let's remove it and fix
all callers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: switch over to intc_readl on omap_intc_handle_irq
Felipe Balbi [Tue, 9 Sep 2014 00:54:37 +0000 (17:54 -0700)]
arm: omap: irq: switch over to intc_readl on omap_intc_handle_irq

an almost blind conversion from readl_relaxed
to our newly introduced intc_readl().

While at that, also remove some hardcoded
register addresses.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: remove unused macro
Felipe Balbi [Tue, 9 Sep 2014 00:54:37 +0000 (17:54 -0700)]
arm: omap: irq: remove unused macro

no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: remove rest of irq_banks usage
Felipe Balbi [Tue, 9 Sep 2014 00:54:35 +0000 (17:54 -0700)]
arm: omap: irq: remove rest of irq_banks usage

now we can finally remove the pointless irq_banks
array.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: add a global omap_nr_irqs variable
Felipe Balbi [Tue, 9 Sep 2014 00:54:34 +0000 (17:54 -0700)]
arm: omap: irq: add a global omap_nr_irqs variable

this will cache number of irqs. Also in preparation
for removal of irq_banks array.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: start to remove irq_banks array
Felipe Balbi [Tue, 9 Sep 2014 00:54:32 +0000 (17:54 -0700)]
arm: omap: irq: start to remove irq_banks array

We have a single bank in that array, this patch
is in preparation to remove that array. It just
shifts everything to a new set of functions
for register IO while also removing old ones.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: define INTC_ILR0 register
Felipe Balbi [Tue, 9 Sep 2014 00:54:32 +0000 (17:54 -0700)]
arm: omap: irq: define INTC_ILR0 register

this is currently used as a hardcoded 0x100
offset.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoarm: omap: irq: make omap_irq_base global
Felipe Balbi [Tue, 9 Sep 2014 00:54:31 +0000 (17:54 -0700)]
arm: omap: irq: make omap_irq_base global

This is in preparation for removing the pointless
irq_banks array.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoMerge branch 'omap-for-v3.18/fixes-not-urgent' into omap-for-v3.18/intc-v2
Tony Lindgren [Thu, 11 Sep 2014 20:03:25 +0000 (13:03 -0700)]
Merge branch 'omap-for-v3.18/fixes-not-urgent' into omap-for-v3.18/intc-v2

9 years agoARM: OMAP2+: make of_device_ids const fixes-v3.18-not-urgent
Uwe Kleine-König [Wed, 10 Sep 2014 08:26:17 +0000 (10:26 +0200)]
ARM: OMAP2+: make of_device_ids const

of_device_ids (i.e. compatible strings and the respective data) are not
supposed to change at runtime. All functions working with of_device_ids
provided by <linux/of.h> work with const of_device_ids. So mark the
non-const function parameters and structs for OMAP2+ as const, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoARM: omap2: make arrays containing machine compatible strings const
Uwe Kleine-König [Thu, 11 Sep 2014 19:29:01 +0000 (21:29 +0200)]
ARM: omap2: make arrays containing machine compatible strings const

The definition

static const char *omap3_boards_compat[] __initconst = {

defines a changable array of constant strings. That is you must not do:

*omap3_boards_compat[0] = 'f';

but

omap3_boards_compat[0] = "another string";

is fine. So the annotation __initconst is wrong and yields a compiler
error when other really const variables are added with __initconst.

As the struct machine_desc member dt_compat is declared as

const char *const *dt_compat;

making the arrays const is the better alternative over changing all
annotations to __initdata.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoARM: dts: OMAP3+: Add PRM interrupt
Nishanth Menon [Fri, 22 Aug 2014 14:03:50 +0000 (09:03 -0500)]
ARM: dts: OMAP3+: Add PRM interrupt

Provide OMAP3, 4 and OMAP5 with interrupt number for PRM

And for DRA7, provide crossbar number for prm interrupt.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoARM: omap: Remove stray ARCH_HAS_OPP references
Mark Brown [Sat, 6 Sep 2014 10:14:16 +0000 (11:14 +0100)]
ARM: omap: Remove stray ARCH_HAS_OPP references

OPP is now a normal kernel library selected by its users rather than a
feature that architectures need to enable so ARCH_HAS_OPP serves no
function any more - remove the selects.

Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoARM: DRA7: Add hook in SoC initcalls to enable pm initialization
Rajendra Nayak [Fri, 22 Aug 2014 14:02:34 +0000 (09:02 -0500)]
ARM: DRA7: Add hook in SoC initcalls to enable pm initialization

With consolidated code, now we can add the required hooks for
DRA7 to enable power management.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[nm@ti.com: minor modifications]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoMerge branch 'pull/v3.18/for-omap-soc' of https://github.com/nmenon/linux-2.6-playgro...
Tony Lindgren [Mon, 8 Sep 2014 22:20:15 +0000 (15:20 -0700)]
Merge branch 'pull/v3.18/for-omap-soc' of https://github.com/nmenon/linux-2.6-playground into omap-for-v3.18/soc

9 years agoMerge branch 'pull/v3.18/powerdomain-fixes' of https://github.com/nmenon/linux-2...
Tony Lindgren [Mon, 8 Sep 2014 22:04:24 +0000 (15:04 -0700)]
Merge branch 'pull/v3.18/powerdomain-fixes' of https://github.com/nmenon/linux-2.6-playground into omap-for-v3.18/fixes-not-urgent

9 years agoARM: OMAP5: Add hook in SoC initcalls to enable pm initialization
Santosh Shilimkar [Tue, 20 May 2014 21:19:23 +0000 (16:19 -0500)]
ARM: OMAP5: Add hook in SoC initcalls to enable pm initialization

With consolidated code, now we can add the required hooks for
OMAP5 to enable power management.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: minor rebase updates]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: Enable CPU RET on suspend
Rajendra Nayak [Mon, 27 May 2013 10:16:44 +0000 (15:46 +0530)]
ARM: OMAP5 / DRA7: Enable CPU RET on suspend

On OMAP5 / DRA7, prevent a CPU powerdomain OFF and resulting MPU OSWR
and instead attempt a CPU RET and side effect, MPU RET in suspend.

NOTE: the hardware was originally designed to be capable of achieving
deep power states such as OFF and OSWR, however due to various issues
and risks, deepest valid state was determined to be CSWR - hence we use
the errata framework to handle this case.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[nm@ti.com: updates]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM: Provide a dummy startup function for CPU hotplug
Santosh Shilimkar [Fri, 6 Jun 2014 22:30:43 +0000 (17:30 -0500)]
ARM: OMAP5 / DRA7: PM: Provide a dummy startup function for CPU hotplug

Dont assume that all OMAP4+ code will be able to use OMAP4 hotplug
logic. On OMAP5, DRA7, we do not need this in place yet, also,
currently the CPU startup pointer is located in omap4_cpu_pm_info
instead of cpu_pm_ops.

So, isolate the function to hotplug_restart pointer in cpu_pm_ops
where it should have belonged, initalize them as per valid startup
pointers for OMAP4430/60 as in current logic, however provide
dummy_cpu_resume to be the startup location as well.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: split this out of original code and isolate it]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM: Avoid all SAR saves
Rajendra Nayak [Fri, 3 May 2013 10:04:40 +0000 (15:34 +0530)]
ARM: OMAP5 / DRA7: PM: Avoid all SAR saves

Get rid of all assumptions about always having a sar base on *all*
OMAP4+ platforms. We dont need one on DRA7 and it is not necessary at
this point for OMAP5 either.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[nm@ti.com: Split and optimize]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM: Enable Mercury retention mode on CPUx powerdomains
Santosh Shilimkar [Thu, 12 Apr 2012 11:31:52 +0000 (17:01 +0530)]
ARM: OMAP5 / DRA7: PM: Enable Mercury retention mode on CPUx powerdomains

In addition to the standard power-management technique, the OMAP5 / DRA7
MPU subsystem also employs an SR3-APG (mercury) power management
technology to reduce leakage.

It allows for full logic and memories retention on MPU_C0 and MPU_C1 and
is controlled by the PRCM_MPU. Only "Fast-mode" is supported on the
OMAP5 and DRA7 family of processors.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: minor consolidation]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM / wakeupgen: Enables ES2 PM mode by default
Santosh Shilimkar [Fri, 8 Feb 2013 11:37:31 +0000 (17:07 +0530)]
ARM: OMAP5 / DRA7: PM / wakeupgen: Enables ES2 PM mode by default

Enables MPUSS ES2 power management mode using ES2_PM_MODE in
AMBA_IF_MODE register.

0x0: OMAP5 ES1 behavior, CPU cores would enter and exit OFF mode together.
     Broken! Fortunately, we do not support this anymore.
0x1: OMAP5 ES2, DRA7 behavior, CPU cores are allowed to enter/exit OFF mode
     independently.

This is one time settings thanks to always ON domain.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: minor conflict resolutions, consolidation for DRA7]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM: Set MPUSS-EMIF clock-domain static dependency
Santosh Shilimkar [Wed, 6 Feb 2013 10:21:45 +0000 (15:51 +0530)]
ARM: OMAP5 / DRA7: PM: Set MPUSS-EMIF clock-domain static dependency

With EMIF clock-domain put under hardware supervised control, memory
corruption and untraceable crashes are observed on OMAP5. Further
investigation revealed that there is a weakness in the PRCM on this
specific dynamic depedency.

The recommendation is to set MPUSS static dependency towards EMIF
clock-domain to avoid issues. This recommendation holds good for DRA7
family of devices as well.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[rnayak@ti.com: DRA7]
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[nm@ti.com: conflict resolution, dra7]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: OMAP5 / DRA7: PM: Update CPU context register offset
Santosh Shilimkar [Wed, 6 Feb 2013 14:09:07 +0000 (19:39 +0530)]
ARM: OMAP5 / DRA7: PM: Update CPU context register offset

On OMAP5, RM_CPUi_CPUi_CONTEXT offset has changed. Update the code
so that same code works for OMAP4+ devices. DRA7 and OMAP5 have the same
context offset as well.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[rnayak@ti.com: for DRA7]
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[nm@ti.com: rebase, split/merge etc..]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
9 years agoARM: AM437x: use pdata quirks for pinctrl information
Keerthy [Mon, 7 Apr 2014 06:24:49 +0000 (11:54 +0530)]
ARM: AM437x: use pdata quirks for pinctrl information

Provide pdata-quirks for Am437x processor family.

Signed-off-by: Keerthy <j-keerthy@ti.com>
9 years agoARM: DRA7: use pdata quirks for pinctrl information
Nishanth Menon [Fri, 23 May 2014 04:39:54 +0000 (23:39 -0500)]
ARM: DRA7: use pdata quirks for pinctrl information

Provide pdata-quirks for DRA7 processor family.

Signed-off-by: Nishanth Menon <nm@ti.com>
9 years agoARM: OMAP5: use pdata quirks for pinctrl information
Nishanth Menon [Thu, 22 May 2014 20:19:29 +0000 (15:19 -0500)]
ARM: OMAP5: use pdata quirks for pinctrl information

Provide pdata-quirks for OMAP5 processor family.

Signed-off-by: Nishanth Menon <nm@ti.com>
9 years agoARM: OMAP4+: PM: Use only valid low power state for CPU hotplug
Nishanth Menon [Thu, 24 Jul 2014 15:24:19 +0000 (10:24 -0500)]
ARM: OMAP4+: PM: Use only valid low power state for CPU hotplug

Not all SoCs support OFF mode - for example DRA74/72. So, use valid
power state during CPU hotplug.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: PM: use only valid low power state for suspend
Nishanth Menon [Fri, 6 Jun 2014 06:17:37 +0000 (01:17 -0500)]
ARM: OMAP4+: PM: use only valid low power state for suspend

We are using power domain state as RET and logic state as OFF. This
state is OSWR. This may not always be supported on ALL power domains. In
fact, on certain power domains, this might result in a hang on certain
platforms. Instead, depend on powerdomain data to provide accurate
information about the supported powerdomain states and use the
appropriate function to query and use it as part of suspend path.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: PM: Make logic state programmable
Nishanth Menon [Fri, 6 Jun 2014 02:40:39 +0000 (21:40 -0500)]
ARM: OMAP4+: PM: Make logic state programmable

Move the logic state as different for each power domain. This allows us
to customize the deepest power state we should target over all for each
powerdomain in the follow on patches.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP2+: powerdomain: introduce logic for finding valid power domain
Nishanth Menon [Fri, 6 Jun 2014 06:04:20 +0000 (01:04 -0500)]
ARM: OMAP2+: powerdomain: introduce logic for finding valid power domain

powerdomain configuration in OMAP is done using PWRSTCTRL register for
each power domain. However, PRCM lets us write any value we'd like to
the logic and power domain target states, however the SoC integration
tends to actually function only at a few discrete states. These valid
states are already in our powerdomains_xxx_data.c file.

So, provide a function to easily query valid low power state that the
power domain is allowed to go to.

Based on work originally done by Jean Pihet <j-pihet@ti.com>
https://patchwork.kernel.org/patch/1325091/ . There is no attempt to
create a new powerdomain solution here, except fixing issues seen
attempting invalid programming attempts. Future consolidation to the
generic powerdomain framework should consider this requirement as
well.

Similar solutions have been done in product kernels in the past such
as:
https://android.googlesource.com/kernel/omap.git/+blame/android-omap-panda-3.0/arch/arm/mach-omap2/pm44xx.c

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP2+: powerdomain: pwrdm_for_each_clkdm iterate only valid clkdms
Nishanth Menon [Sat, 7 Jun 2014 00:36:41 +0000 (19:36 -0500)]
ARM: OMAP2+: powerdomain: pwrdm_for_each_clkdm iterate only valid clkdms

No need to invoke callback when the clkdm pointer is NULL.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP5: powerdomain data: fix powerdomain powerstate
Nishanth Menon [Wed, 20 Aug 2014 13:13:16 +0000 (08:13 -0500)]
ARM: OMAP5: powerdomain data: fix powerdomain powerstate

Update the power domain power states for final production chip
capability. OFF mode, OSWR etc have been descoped for various domains.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP: DRA7: powerdomain data: fix powerdomain powerstate
Nishanth Menon [Fri, 6 Jun 2014 06:21:51 +0000 (01:21 -0500)]
ARM: OMAP: DRA7: powerdomain data: fix powerdomain powerstate

DRA7 supports only CSWR for CPU, MPU power domains. Core power domain
supports upto INA.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP3+: PRM: register interrupt information from DT
Nishanth Menon [Tue, 12 Aug 2014 12:05:19 +0000 (07:05 -0500)]
ARM: OMAP3+: PRM: register interrupt information from DT

Allow the PRM interrupt information to be picked up from device tree.
OMAP3 may use legacy boot and needs to be compatible with old dtbs
(without interrupt populated), for these, we use the value which is
pre-populated.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: PRM: Enable wakeup capability for OMAP5, DRA7
Nishanth Menon [Mon, 11 Aug 2014 19:58:23 +0000 (14:58 -0500)]
ARM: OMAP4+: PRM: Enable wakeup capability for OMAP5, DRA7

OMAP5 and DRA7 can now use pinctrl based I/O daisychain wakeup
capability. So, enable the support.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: PRM: remove "wkup" event
Nishanth Menon [Fri, 23 May 2014 05:20:37 +0000 (00:20 -0500)]
ARM: OMAP4+: PRM: remove "wkup" event

"wkup" event at bit offset 0 exists only on OMAP3.
OMAP4430/60 PRM_IRQSTATUS_A9, OMAP5/DRA7 PRM_IRQSTATUS_MPU

register bit 0 is DPLL_CORE_RECAL_ST not wakeup event like OMAP3.

The same applies to AM437x as well.

Remove the wrong definition.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: PRM: register interrupt information from DT
Nishanth Menon [Thu, 22 May 2014 20:19:29 +0000 (15:19 -0500)]
ARM: OMAP4+: PRM: register interrupt information from DT

Allow the PRM interrupt information to be picked up from device tree.
the only exception is for OMAP4 which uses values pre-populated and allows
compatibility with older dtb.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4: PRM: use the generic prm_inst to allow logic to be abstracted
Nishanth Menon [Thu, 22 May 2014 20:00:55 +0000 (15:00 -0500)]
ARM: OMAP4: PRM: use the generic prm_inst to allow logic to be abstracted

use the generic function to pick up the prm_instance for a generic logic
which can be reused from OMAP4+

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: OMAP4+: prminst: provide function to find prm_dev instance offset
Nishanth Menon [Thu, 22 May 2014 19:53:54 +0000 (14:53 -0500)]
ARM: OMAP4+: prminst: provide function to find prm_dev instance offset

PRM device instance can vary depending on SoC. We already handle the
same during reset of the device, However, this is also needed
for other logic instances. So, first abstract this out to a generic
function.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
9 years agoARM: dts: am335x-bone*: Fix model name and update compatibility information
Nishanth Menon [Wed, 3 Sep 2014 16:03:10 +0000 (11:03 -0500)]
ARM: dts: am335x-bone*: Fix model name and update compatibility information

Beaglebone white and beaglebone black differ in tiny little aspects.
This is the reason why we maintain seperate dts for these platforms.
However, there is no real way to decode from dtb which platform it is
since compatible and model name are the same for both platforms.

Fix this so that beaglebone black and beaglebone are identifiable,
while maintaining compatibility for older zImages which might use old
beaglebone compatible flag for black as well.

Reported-by: Tom Rini <trini@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoARM: dts: omap4-panda: Fix model and SoC family details
Nishanth Menon [Thu, 28 Aug 2014 20:45:03 +0000 (15:45 -0500)]
ARM: dts: omap4-panda: Fix model and SoC family details

Currently we claim that omap4-panda and omap4-panda-es are essentially
the same, but they are not since PandaBoard-ES uses OMAP4460 and
PandaBoard uses OMAP4430.

So, split the common definition and make the model name available.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
9 years agoLinux 3.17-rc3
Linus Torvalds [Mon, 1 Sep 2014 01:23:04 +0000 (18:23 -0700)]
Linux 3.17-rc3

9 years agoMerge tag 'xtensa-20140830' of git://github.com/czankel/xtensa-linux
Linus Torvalds [Mon, 1 Sep 2014 00:08:42 +0000 (17:08 -0700)]
Merge tag 'xtensa-20140830' of git://github.com/czankel/xtensa-linux

Pull Xtensa updates from Chris Zankel:
 "Xtensa improvements for 3.17:
   - support highmem on cores with aliasing data cache.  Enable highmem
     on kc705 by default
   - simplify addition of new core variants (no need to modify Kconfig /
     Makefiles)
   - improve robustness of unaligned access handler and its interaction
     with window overflow/underflow exception handlers
   - deprecate atomic and spill registers syscalls
   - clean up Kconfig: remove orphan MATH_EMULATION, sort 'select'
     statements
   - wire up renameat2 syscall.

  Various fixes:
   - fix address checks in dma_{alloc,free}_coherent (runtime BUG)
   - fix access to THREAD_RA/THREAD_SP/THREAD_DS (debug build breakage)
   - fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
     (runtime unrecoverable exception)
   - fix a6 and a7 handling in fast_syscall_xtensa (runtime userspace
     register clobbering)
   - fix kernel/user jump out of fast_unaligned (potential runtime
     unrecoverabl exception)
   - replace termios IOCTL code definitions with constants (userspace
     build breakage)"

* tag 'xtensa-20140830' of git://github.com/czankel/xtensa-linux: (25 commits)
  xtensa: deprecate fast_xtensa and fast_spill_registers syscalls
  xtensa: don't allow overflow/underflow on unaligned stack
  xtensa: fix a6 and a7 handling in fast_syscall_xtensa
  xtensa: allow single-stepping through unaligned load/store
  xtensa: move invalid unaligned instruction handler closer to its users
  xtensa: make fast_unaligned store restartable
  xtensa: add double exception fixup handler for fast_unaligned
  xtensa: fix kernel/user jump out of fast_unaligned
  xtensa: configure kc705 for highmem
  xtensa: support highmem in aliasing cache flushing code
  xtensa: support aliasing cache in kmap
  xtensa: support aliasing cache in k[un]map_atomic
  xtensa: implement clear_user_highpage and copy_user_highpage
  xtensa: fix TLBTEMP_BASE_2 region handling in fast_second_level_miss
  xtensa: allow fixmap and kmap span more than one page table
  xtensa: make fixmap region addressing grow with index
  xtensa: fix access to THREAD_RA/THREAD_SP/THREAD_DS
  xtensa: add renameat2 syscall
  xtensa: fix address checks in dma_{alloc,free}_coherent
  xtensa: replace IOCTL code definitions with constants
  ...

9 years agounicore32: Fix build error
Guenter Roeck [Sun, 31 Aug 2014 18:14:26 +0000 (11:14 -0700)]
unicore32: Fix build error

unicore32 builds fail with

  arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
  arch/unicore32/kernel/signal.c:257: error: ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c:279: error: ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
  arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
  arch/unicore32/kernel/signal.c: In function ‘do_signal’:
  arch/unicore32/kernel/signal.c:376: error: implicit declaration of function ‘get_signsl’
  make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
  make: *** [arch/unicore32/kernel/signal.o] Error 2

Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
signal_setup_done()").

This code never even compiled.  Reverting the patch does not work, since
previously used functions no longer exist, so try to fix it up.  Compile
tested only.

Fixes: 649671c90eaf ("unicore32: Use get_signal() signal_setup_done()")
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Linus Torvalds [Mon, 1 Sep 2014 00:02:57 +0000 (17:02 -0700)]
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
 "Various assorted fixes:

   - a couple of patches from Mark Rutland to resolve an errata with
     Cortex-A15 CPUs.
   - fix cpuidle for the CPU part ID changes in the last merge window
   - add support for a relocation which ARM binutils is generating in
     some circumstances"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8130/1: cpuidle/cpuidle-big_little: fix reading cpu id part number
  ARM: 8129/1: errata: work around Cortex-A15 erratum 830321 using dummy strex
  ARM: 8128/1: abort: don't clear the exclusive monitors
  ARM: 8127/1: module: add support for R_ARM_TARGET1 relocations

9 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Mon, 1 Sep 2014 00:01:19 +0000 (17:01 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "Here's the weekly batch of fixes from arm-soc.

  The delta is a largeish negative delta, due to revert of SMP support
  for Broadcom's STB SoC -- it was accidentally merged before some
  issues had been addressed, so they will make a new attempt for 3.18.
  I didn't see a need for a full revert of the whole platform due to
  this, we're keeping the rest enabled.

  The rest is mostly:

   - a handful of DT fixes for i.MX (Hummingboard/Cubox-i in particular)
   - some MTD/NAND fixes for OMAP
   - minor DT fixes for shmobile
   - warning fix for UP builds on vexpress/spc

  There's also a couple of patches that wires up hwmod on TI's DRA7 SoC
  so it can boot.  Drivers and the rest had landed for 3.17, and it's
  small and isolated so it made sense to pick up now even if it's not a
  bugfix"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (23 commits)
  vexpress/spc: fix a build warning on array bounds
  ARM: DRA7: hwmod: Add dra74x and dra72x specific ocp interface lists
  ARM: DRA7: Add support for soc_is_dra74x() and soc_is_dra72x() variants
  MAINTAINERS: catch special Rockchip code locations
  ARM: dts: microsom-ar8035: MDIO pad must be set open drain
  ARM: dts: omap54xx-clocks: Fix the l3 and l4 clock rates
  ARM: brcmstb: revert SMP support
  ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled
  ARM: dts: Enable UART wake-up events for beagleboard
  ARM: dts: Remove twl6030 clk32g "regulator"
  ARM: OMAP2+: omap_device: remove warning that clk alias already exists
  ARM: OMAP: fix %d confusingly prefixed with 0x in format string
  ARM: dts: DRA7: fix interrupt-cells for GPIO
  mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()
  ARM: dts: omap3430-sdp: Revert to using software ECC for NAND
  ARM: OMAP2+: GPMC: Support Software ECC scheme via DT
  mtd: nand: omap: Revert to using software ECC by default
  ARM: dts: hummingboard/cubox-i: change SPDIF output to be more descriptive
  ARM: dts: hummingboard/cubox-i: add USB OC pinctrl configuration
  ARM: shmobile: r8a7791: add missing 0x0100 for SDCKCR
  ...

9 years agovexpress/spc: fix a build warning on array bounds
Alex Shi [Wed, 16 Jul 2014 11:21:56 +0000 (19:21 +0800)]
vexpress/spc: fix a build warning on array bounds

With ARCH_VEXPRESS_SPC option, kernel build has the following
warning:

arch/arm/mach-vexpress/spc.c: In function ‘ve_spc_clk_init’:
arch/arm/mach-vexpress/spc.c:431:38: warning: array subscript is below array bounds [-Warray-bounds]
  struct ve_spc_opp *opps = info->opps[cluster];
                                      ^
since 'cluster' maybe '-1' in UP system. This patch does a active
checking to fix this issue.

Signed-off-by: Alex Shi <alex.shi@linaro.org>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
9 years agoMerge tag 'for-v3.17-rc/omap-dra72x-d74x-support-a' of git://git.kernel.org/pub/scm...
Olof Johansson [Sun, 31 Aug 2014 17:19:09 +0000 (10:19 -0700)]
Merge tag 'for-v3.17-rc/omap-dra72x-d74x-support-a' of git://git./linux/kernel/git/pjw/omap-pending into fixes

Pull "ARM: OMAP2+: DRA72x/DRA74x basic support" from Tony Lindgren:

Add basic subarchitecture support for the DRA72x and DRA74x.  These
are OMAP2+ derivative SoCs.  This should be low-risk to existing OMAP
platforms.

Basic build, boot, and PM test logs are available here:

http://www.pwsan.com/omap/testlogs/hwmod-a-early-v3.17-rc/20140827194314/

* tag 'for-v3.17-rc/omap-dra72x-d74x-support-a' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending:
  ARM: DRA7: hwmod: Add dra74x and dra72x specific ocp interface lists
  ARM: DRA7: Add support for soc_is_dra74x() and soc_is_dra72x() variants

Signed-off-by: Olof Johansson <olof@lixom.net>
9 years agoMerge tag 'spi-v3.17-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Linus Torvalds [Sun, 31 Aug 2014 17:09:07 +0000 (10:09 -0700)]
Merge tag 'spi-v3.17-rc3-2' of git://git./linux/kernel/git/broonie/spi

Pull spi bugfixes from Mark Brown:
 "A smattering of bug fixes for the SPI subsystem, all in driver code
  which has seen active work recently and none of them with any great
  global impact.

  There's also a new ACPI ID for the pxa2xx driver which required no
  code changes and the addition of kerneldoc for some structure fields
  that were missing it and generating warnings during documentation
  builds as a result"

* tag 'spi-v3.17-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: sh-msiof: Fix transmit-only DMA transfers
  spi/rockchip: Avoid accidentally turning off the clock
  spi: dw: fix kernel crash due to NULL pointer dereference
  spi: dw-pci: fix bug when regs left uninitialized
  spi: davinci: fix SPI_NO_CS functionality
  spi/rockchip: fixup incorrect dma direction setting
  spi/pxa2xx: Add ACPI ID for Intel Braswell
  spi: spi-au1550: fix build failure
  spi: rspi: Fix leaking of unused DMA descriptors
  spi: sh-msiof: Fix leaking of unused DMA descriptors
  spi: Add missing kerneldoc bits
  spi/omap-mcspi: Fix the spi task hangs waiting dma_rx

9 years agoMerge remote-tracking branch 'spi/fix/sh-msiof' into spi-linus
Mark Brown [Sun, 31 Aug 2014 12:46:19 +0000 (13:46 +0100)]
Merge remote-tracking branch 'spi/fix/sh-msiof' into spi-linus

9 years agoMerge tag 'spi-v3.17-rc3' into spi-linus
Mark Brown [Sun, 31 Aug 2014 12:46:19 +0000 (13:46 +0100)]
Merge tag 'spi-v3.17-rc3' into spi-linus

spi: Bug fixes for v3.17

A smattering of bug fixes for the SPI subsystem, all in driver code
which has seen active work recently and none of them with any great
global impact.

There's also a new ACPI ID for the pxa2xx driver which required no code
changes and the addition of kerneldoc for some structure fields that
were missing it and generating warnings during documentation builds as a
result.

# gpg: Signature made Sun 31 Aug 2014 13:19:12 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

9 years agospi: sh-msiof: Fix transmit-only DMA transfers
Geert Uytterhoeven [Thu, 7 Aug 2014 12:07:43 +0000 (14:07 +0200)]
spi: sh-msiof: Fix transmit-only DMA transfers

Fix tx/rx mixup, which broke transmit-only transfers.

Introduced by commit 4240305f7cbdc7782aa8bc40cc702775d9ac0839
("spi: sh-msiof: Fix leaking of unused DMA descriptors").

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
9 years agoMerge tag 'locks-v3.17-3' of git://git.samba.org/jlayton/linux
Linus Torvalds [Sun, 31 Aug 2014 04:04:37 +0000 (21:04 -0700)]
Merge tag 'locks-v3.17-3' of git://git.samba.org/jlayton/linux

Pull file locking bugfx from Jeff Layton:
 "Just a bugfix for a bug that crept in to v3.15.  It's in a rather rare
  error path, and I'm not aware of anyone having hit it, but it's worth
  fixing for v3.17"

* tag 'locks-v3.17-3' of git://git.samba.org/jlayton/linux:
  locks: pass correct "before" pointer to locks_unlink_lock in generic_add_lease

9 years agoMerge remote-tracking branches 'spi/fix/au1550', 'spi/fix/davinci', 'spi/fix/doc...
Mark Brown [Sat, 30 Aug 2014 18:28:04 +0000 (19:28 +0100)]
Merge remote-tracking branches 'spi/fix/au1550', 'spi/fix/davinci', 'spi/fix/doc', 'spi/fix/dw', 'spi/fix/omap-mcspi', 'spi/fix/pxa2xx', 'spi/fix/rockchip' and 'spi/fix/rspi' into spi-linus

9 years agoMerge remote-tracking branch 'spi/fix/sh-msiof' into spi-linus
Mark Brown [Sat, 30 Aug 2014 18:28:03 +0000 (19:28 +0100)]
Merge remote-tracking branch 'spi/fix/sh-msiof' into spi-linus

9 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 30 Aug 2014 00:22:27 +0000 (17:22 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
 "One patch to avoid assigning interrupts we don't actually have on
  non-PC platforms, and two patches that addresses bugs in the new
  IOAPIC assignment code"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, irq, PCI: Keep IRQ assignment for runtime power management
  x86: irq: Fix bug in setting IOAPIC pin attributes
  x86: Fix non-PC platform kernel crash on boot due to NULL dereference

9 years agoMerge tag 'pm+acpi-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sat, 30 Aug 2014 00:18:48 +0000 (17:18 -0700)]
Merge tag 'pm+acpi-3.17-rc3' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:

 - Fix for an ACPI regression related to the handling of fixed events
   that caused netlink routines to be (incorrectly) run in interrupt
   context from Lan Tianyu

 - Fix for an ACPI EC driver regression on Acer Aspire V5-573G that
   caused AC/battery plug/unplug and video brightness change
   notifications to be delayed on that machine from Lv Zheng

 - Fix for an ACPI device enumeration regression that caused ACPI driver
   probe to fail for some devices where it succeeded before (Rafael J
   Wysocki)

 - intel_pstate driver fix to prevent it from printing an information
   message for every CPU in the system on every boot from Andi Kleen

 - s5pv210 cpufreq driver fix to remove an __init annotation from a
   routine that in fact can be called at any time after init too from
   Mark Brown

 - New Intel Braswell device ID for the ACPI LPSS (Low-Power Subsystem)
   driver from Alan Cox

 - New Intel Braswell CPU ID for intel_pstate from Mika Westerberg

* tag 'pm+acpi-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: s5pv210: Remove spurious __init annotation
  cpufreq: intel_pstate: Add CPU ID for Braswell processor
  intel_pstate: Turn per cpu printk into pr_debug
  ACPI / LPSS: Add ACPI IDs for Intel Braswell
  ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC
  ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set
  ACPI: Run fixed event device notifications in process context
  ACPI / scan: Allow ACPI drivers to bind to PNP device objects

9 years agoMerge branch 'akpm' (fixes from Andrew Morton)
Linus Torvalds [Fri, 29 Aug 2014 23:28:29 +0000 (16:28 -0700)]
Merge branch 'akpm' (fixes from Andrew Morton)

Merge patches from Andrew Morton:
 "22 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (22 commits)
  kexec: purgatory: add clean-up for purgatory directory
  Documentation/kdump/kdump.txt: add ARM description
  flush_icache_range: export symbol to fix build errors
  tools: selftests: fix build issue with make kselftests target
  ocfs2: quorum: add a log for node not fenced
  ocfs2: o2net: set tcp user timeout to max value
  ocfs2: o2net: don't shutdown connection when idle timeout
  ocfs2: do not write error flag to user structure we cannot copy from/to
  x86/purgatory: use approprate -m64/-32 build flag for arch/x86/purgatory
  drivers/rtc/rtc-s5m.c: re-add support for devices without irq specified
  xattr: fix check for simultaneous glibc header inclusion
  kexec: remove CONFIG_KEXEC dependency on crypto
  kexec: create a new config option CONFIG_KEXEC_FILE for new syscall
  x86,mm: fix pte_special versus pte_numa
  hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked
  mm/zpool: use prefixed module loading
  zram: fix incorrect stat with failed_reads
  lib: turn CONFIG_STACKTRACE into an actual option.
  mm: actually clear pmd_numa before invalidating
  memblock, memhotplug: fix wrong type in memblock_find_in_range_node().
  ...

9 years agokexec: purgatory: add clean-up for purgatory directory
Michael Welling [Fri, 29 Aug 2014 22:19:13 +0000 (15:19 -0700)]
kexec: purgatory: add clean-up for purgatory directory

Without this patch the kexec-purgatory.c and purgatory.ro files are not
removed after make mrproper.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoDocumentation/kdump/kdump.txt: add ARM description
HuKeping [Fri, 29 Aug 2014 22:19:11 +0000 (15:19 -0700)]
Documentation/kdump/kdump.txt: add ARM description

Add arm specific parts to kdump kernel documentation.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Haren Myneni <hbabu@us.ibm.com>
Cc: Rob Landley <rob@landley.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoflush_icache_range: export symbol to fix build errors
Pranith Kumar [Fri, 29 Aug 2014 22:19:09 +0000 (15:19 -0700)]
flush_icache_range: export symbol to fix build errors

Fix building errors occuring due to a missing export of
flush_icache_range() in

kisskb.ellerman.id.au/kisskb/buildresult/11677809/

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined!

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Chris Zankel <chris@zankel.net>
Acked-by: Max Filippov <jcmvbkbc@gmail.com> [xtensa]
Cc: Noam Camus <noamc@ezchip.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Acked-by: Zhigang Lu <zlu@tilera.com> [tile]
Cc: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agotools: selftests: fix build issue with make kselftests target
Phong Tran [Fri, 29 Aug 2014 22:19:06 +0000 (15:19 -0700)]
tools: selftests: fix build issue with make kselftests target

Fix the typo of ARCH when running 'make kselftests'.  Change the 'X86'
to 'x86'.  Test by compilation.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Shuah Khan <shuah.kh@samsung.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: quorum: add a log for node not fenced
Junxiao Bi [Fri, 29 Aug 2014 22:19:04 +0000 (15:19 -0700)]
ocfs2: quorum: add a log for node not fenced

For debug use, we can see from the log whether the fence decision is
made and why it is not fenced.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: o2net: set tcp user timeout to max value
Junxiao Bi [Fri, 29 Aug 2014 22:19:02 +0000 (15:19 -0700)]
ocfs2: o2net: set tcp user timeout to max value

When tcp retransmit timeout(15mins), the connection will be closed.
Pending messages may be lost during this time.  So we set tcp user
timeout to override the retransmit timeout to the max value.  This is OK
for ocfs2 since we have disk heartbeat, if peer crash, the disk
heartbeat will timeout and it will be evicted, if disk heartbeat not
timeout and connection idle for a long time, then this means the cluster
enters split-brain state, since fence can't happen, we'd better keep the
connection and wait network recover.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: o2net: don't shutdown connection when idle timeout
Junxiao Bi [Fri, 29 Aug 2014 22:19:00 +0000 (15:19 -0700)]
ocfs2: o2net: don't shutdown connection when idle timeout

This patch series is to fix a possible message lost bug in ocfs2 when
network go bad.  This bug will cause ocfs2 hung forever even network
become good again.

The messages may lost in this case.  After the tcp connection is
established between two nodes, an idle timer will be set to check its
state periodically, if no messages are received during this time, idle
timer will timeout, it will shutdown the connection and try to
reconnect, so pending messages in tcp queues will be lost.  This
messages may be from dlm.  Dlm may get hung in this case.  This may
cause the whole ocfs2 cluster hung.

This is very possible to happen when network state goes bad.  Do the
reconnect is useless, it will fail if network state is still bad.  Just
waiting there for network recovering may be a good idea, it will not
lost messages and some node will be fenced until cluster goes into
split-brain state, for this case, Tcp user timeout is used to override
the tcp retransmit timeout.  It will timeout after 25 days, user should
have notice this through the provided log and fix the network, if they
don't, ocfs2 will fall back to original reconnect way.

This patch (of 3):

Some messages in the tcp queue maybe lost if we shutdown the connection
and reconnect when idle timeout.  If packets lost and reconnect success,
then the ocfs2 cluster maybe hung.

To fix this, we can leave the connection there and do the fence decision
when idle timeout, if network recover before fence dicision is made, the
connection survive without lost any messages.

This bug can be saw when network state go bad.  It may cause ocfs2 hung
forever if some packets lost.  With this fix, ocfs2 will recover from
hung if network becomes good again.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: do not write error flag to user structure we cannot copy from/to
Ben Hutchings [Fri, 29 Aug 2014 22:18:58 +0000 (15:18 -0700)]
ocfs2: do not write error flag to user structure we cannot copy from/to

If we failed to copy from the structure, writing back the flags leaks 31
bits of kernel memory (the rest of the ir_flags field).

In any case, if we cannot copy from/to the structure, why should we
expect putting just the flags to work?

Also make sure ocfs2_info_handle_freeinode() returns the right error
code if the copy_to_user() fails.

Fixes: ddee5cdb70e6 ('Ocfs2: Add new OCFS2_IOC_INFO ioctl for ocfs2 v8.')
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Joel Becker <jlbec@evilplan.org>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agox86/purgatory: use approprate -m64/-32 build flag for arch/x86/purgatory
Vivek Goyal [Fri, 29 Aug 2014 22:18:55 +0000 (15:18 -0700)]
x86/purgatory: use approprate -m64/-32 build flag for arch/x86/purgatory

Thomas reported that build of x86_64 kernel was failing for him.  He is
using 32bit tool chain.

Problem is that while compiling purgatory, I have not specified -m64
flag.  And 32bit tool chain must be assuming -m32 by default.

Following is error message.

(mini) [~/work/linux-2.6] make
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      arch/x86/purgatory/purgatory.o
arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in
the 32 bit mode

Fix it by explicitly passing appropriate -m64/-m32 build flag for
purgatory.

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Tested-by: Thomas Glanzmann <thomas@glanzmann.de>
Suggested-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrivers/rtc/rtc-s5m.c: re-add support for devices without irq specified
Bartlomiej Zolnierkiewicz [Fri, 29 Aug 2014 22:18:53 +0000 (15:18 -0700)]
drivers/rtc/rtc-s5m.c: re-add support for devices without irq specified

The rtc-s5m driver used to support devices without irq specified in the
past.  Re-add this support.

The patch fixes boot for Insignal's Exynos4412 based Origen board.

Error messages before the patch:

  ...
  Unable to handle kernel NULL pointer dereference at virtual address 00000094
  pgd = c0004000
  [00000094] *pgd=00000000
  Internal error: Oops: 5 [#1] PREEMPT SMP ARM
  Modules linked in:
  CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.16.0-next-20140804-00008-ga59480f-dirty #701
  task: ea80f000 ti: ea882000 task.ti: ea882000
  PC is at regmap_irq_get_virq+0x0/0x28
  LR is at s5m_rtc_probe+0xdc/0x310
  pc : [<c02574fc>]    lr : [<c02de75c>]    psr: 80000153
  sp : ea883e48  ip : 00000000  fp : 00000000
  r10: 0000000c  r9 : c05de7ac  r8 : eaabc600
  r7 : eaa6b4d0  r6 : c0439e8c  r5 : eaabc610  r4 : eab30e50
  r3 : 00000000  r2 : 00000000  r1 : 0000000c  r0 : 00000000
  Flags: Nzcv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
  Control: 10c5387d  Table: 4000404a  DAC: 00000015
  Process swapper/0 (pid: 1, stack limit = 0xea882240)
  Backtrace:
    regmap_irq_get_virq
    s5m_rtc_probe
    platform_drv_probe
    driver_probe_device
    __driver_attach
    bus_for_each_dev
    bus_add_driver
    driver_register
    do_one_initcall
    kernel_init_freeable
    kernel_init
  ---[ end trace a954d7f019122700 ]---
  Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
  ...

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoxattr: fix check for simultaneous glibc header inclusion
Filipe Brandenburger [Fri, 29 Aug 2014 22:18:51 +0000 (15:18 -0700)]
xattr: fix check for simultaneous glibc header inclusion

The guard was introduced in commit ea1a8217b06b ("xattr: guard against
simultaneous glibc header inclusion") but it is using #ifdef to check
for a define that is either set to 1 or 0.  Fix it to use #if instead.

* Without this patch:

  $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null
  include/uapi/linux/xattr.h:19:0: warning: "XATTR_CREATE" redefined [enabled by default]
   #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
   ^
  /usr/include/x86_64-linux-gnu/sys/xattr.h:32:0: note: this is the location of the previous definition
   #define XATTR_CREATE XATTR_CREATE
   ^

* With this patch:

  $ { echo "#include <sys/xattr.h>"; echo "#include <linux/xattr.h>"; } | gcc -E -Iinclude/uapi - >/dev/null
  (no warnings)

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Cc: Allan McRae <allan@archlinux.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agokexec: remove CONFIG_KEXEC dependency on crypto
Vivek Goyal [Fri, 29 Aug 2014 22:18:49 +0000 (15:18 -0700)]
kexec: remove CONFIG_KEXEC dependency on crypto

New system call depends on crypto.  As it did not have a separate config
option, CONFIG_KEXEC was modified to select CRYPTO and CRYPTO_SHA256.

But now previous patch introduced a new config option for new syscall.
So CONFIG_KEXEC does not require crypto.  Remove that dependency.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agokexec: create a new config option CONFIG_KEXEC_FILE for new syscall
Vivek Goyal [Fri, 29 Aug 2014 22:18:46 +0000 (15:18 -0700)]
kexec: create a new config option CONFIG_KEXEC_FILE for new syscall

Currently new system call kexec_file_load() and all the associated code
compiles if CONFIG_KEXEC=y.  But new syscall also compiles purgatory
code which currently uses gcc option -mcmodel=large.  This option seems
to be available only gcc 4.4 onwards.

Hiding new functionality behind a new config option will not break
existing users of old gcc.  Those who wish to enable new functionality
will require new gcc.  Having said that, I am trying to figure out how
can I move away from using -mcmodel=large but that can take a while.

I think there are other advantages of introducing this new config
option.  As this option will be enabled only on x86_64, other arches
don't have to compile generic kexec code which will never be used.  This
new code selects CRYPTO=y and CRYPTO_SHA256=y.  And all other arches had
to do this for CONFIG_KEXEC.  Now with introduction of new config
option, we can remove crypto dependency from other arches.

Now CONFIG_KEXEC_FILE is available only on x86_64.  So whereever I had
CONFIG_X86_64 defined, I got rid of that.

For CONFIG_KEXEC_FILE, instead of doing select CRYPTO=y, I changed it to
"depends on CRYPTO=y".  This should be safer as "select" is not
recursive.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Tested-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agox86,mm: fix pte_special versus pte_numa
Hugh Dickins [Fri, 29 Aug 2014 22:18:44 +0000 (15:18 -0700)]
x86,mm: fix pte_special versus pte_numa

Sasha Levin has shown oopses on ffffea0003480048 and ffffea0003480008 at
mm/memory.c:1132, running Trinity on different 3.16-rc-next kernels:
where zap_pte_range() checks page->mapping to see if PageAnon(page).

Those addresses fit struct pages for pfns d2001 and d2000, and in each
dump a register or a stack slot showed d2001730 or d2000730: pte flags
0x730 are PCD ACCESSED PROTNONE SPECIAL IOMAP; and Sasha's e820 map has
a hole between cfffffff and 100000000, which would need special access.

Commit c46a7c817e66 ("x86: define _PAGE_NUMA by reusing software bits on
the PMD and PTE levels") has broken vm_normal_page(): a PROTNONE SPECIAL
pte no longer passes the pte_special() test, so zap_pte_range() goes on
to try to access a non-existent struct page.

Fix this by refining pte_special() (SPECIAL with PRESENT or PROTNONE) to
complement pte_numa() (SPECIAL with neither PRESENT nor PROTNONE).  A
hint that this was a problem was that c46a7c817e66 added pte_numa() test
to vm_normal_page(), and moved its is_zero_pfn() test from slow to fast
path: This was papering over a pte_special() snag when the zero page was
encountered during zap.  This patch reverts vm_normal_page() to how it
was before, relying on pte_special().

It still appears that this patch may be incomplete: aren't there other
places which need to be handling PROTNONE along with PRESENT?  For
example, pte_mknuma() clears _PAGE_PRESENT and sets _PAGE_NUMA, but on a
PROT_NONE area, that would make it pte_special().  This is side-stepped
by the fact that NUMA hinting faults skipped PROT_NONE VMAs and there
are no grounds where a NUMA hinting fault on a PROT_NONE VMA would be
interesting.

Fixes: c46a7c817e66 ("x86: define _PAGE_NUMA by reusing software bits on the PMD and PTE levels")
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: <stable@vger.kernel.org> [3.16]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agohugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked
Michal Hocko [Fri, 29 Aug 2014 22:18:42 +0000 (15:18 -0700)]
hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked

spin_lock may be an empty struct for !SMP configurations and so
arch_spin_is_locked may return unconditional 0 and trigger the VM_BUG_ON
even when the lock is held.

Replace spin_is_locked by lockdep_assert_held.  We will not BUG anymore
but it is questionable whether crashing makes a lot of sense in the
uncharge path.  Uncharge happens after the last page reference was
released so nobody should touch the page and the function doesn't update
any shared state except for res counter which uses synchronization of
its own.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm/zpool: use prefixed module loading
Kees Cook [Fri, 29 Aug 2014 22:18:40 +0000 (15:18 -0700)]
mm/zpool: use prefixed module loading

To avoid potential format string expansion via module parameters, do not
use the zpool type directly in request_module() without a format string.
Additionally, to avoid arbitrary modules being loaded via zpool API
(e.g.  via the zswap_zpool_type module parameter) add a "zpool-" prefix
to the requested module, as well as module aliases for the existing
zpool types (zbud and zsmalloc).

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Acked-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agozram: fix incorrect stat with failed_reads
Chao Yu [Fri, 29 Aug 2014 22:18:37 +0000 (15:18 -0700)]
zram: fix incorrect stat with failed_reads

Since we allocate a temporary buffer in zram_bvec_read to handle partial
page operations in commit 924bd88d703e ("Staging: zram: allow partial
page operations"), our ->failed_reads value may be incorrect as we do
not increase its value when failing to allocate the temporary buffer.

Let's fix this issue and correct the annotation of failed_reads.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agolib: turn CONFIG_STACKTRACE into an actual option.
Dave Jones [Fri, 29 Aug 2014 22:18:35 +0000 (15:18 -0700)]
lib: turn CONFIG_STACKTRACE into an actual option.

I was puzzled why /proc/$$/stack had disappeared, until I figured out I
had disabled the last debug option that did a 'select STACKTRACE'.  This
patch makes the option show up at config time, so it can be enabled
without enabling any of the more heavyweight debug options.

Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: actually clear pmd_numa before invalidating
Matthew Wilcox [Fri, 29 Aug 2014 22:18:33 +0000 (15:18 -0700)]
mm: actually clear pmd_numa before invalidating

Commit 67f87463d3a3 ("mm: clear pmd_numa before invalidating") cleared
the NUMA bit in a copy of the PMD entry, but then wrote back the
original

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomemblock, memhotplug: fix wrong type in memblock_find_in_range_node().
Tang Chen [Fri, 29 Aug 2014 22:18:31 +0000 (15:18 -0700)]
memblock, memhotplug: fix wrong type in memblock_find_in_range_node().

In memblock_find_in_range_node(), we defined ret as int.  But it should
be phys_addr_t because it is used to store the return value from
__memblock_find_range_bottom_up().

The bug has not been triggered because when allocating low memory near
the kernel end, the "int ret" won't turn out to be negative.  When we
started to allocate memory on other nodes, and the "int ret" could be
minus.  Then the kernel will panic.

A simple way to reproduce this: comment out the following code in
numa_init(),

        memblock_set_bottom_up(false);

and the kernel won't boot.

Reported-by: Xishi Qiu <qiuxishi@huawei.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Tested-by: Xishi Qiu <qiuxishi@huawei.com>
Cc: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>