firefly-linux-kernel-4.4.55.git
9 years agopowerpc: Make corenet64_defconfig a bit more useful
Benjamin Herrenschmidt [Fri, 27 Feb 2015 03:09:37 +0000 (14:09 +1100)]
powerpc: Make corenet64_defconfig a bit more useful

CONFIG_BLK_DEV_SD, SR, ... are needed for pretty much any SATA or USB
storage device (corenet32_defconfig has them) and modern any with
systemd needs the CGROUPS gunk.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agopowerpc/85xx: workaround for chips with MSI hardware errata
Hongtao Jia [Thu, 26 Feb 2015 07:23:08 +0000 (15:23 +0800)]
powerpc/85xx: workaround for chips with MSI hardware errata

The MPIC version 2.0 has a MSI errata (errata PIC1 of mpc8544), It causes
that neither MSI nor MSI-X can work fine. This is a workaround to allow
MSI-X to function properly.

Signed-off-by: Liu Shuo <soniccat.liu@gmail.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agopowerpc/mpic: Add get_version API both for internal and external use
Hongtao Jia [Wed, 10 Apr 2013 02:52:55 +0000 (10:52 +0800)]
powerpc/mpic: Add get_version API both for internal and external use

MPIC version is useful information for both mpic_alloc() and mpic_init().
The patch provide an API to get MPIC version for reusing the code.
Also, some other IP block may need MPIC version for their own use.
The API for external use is also provided.

This function had been previously added but was removed by commit
5e86bfde9cd93f2 ("powerpc/mpic: remove unused functions") due to the
lack of a user.  This function will be used by "powerpc/mpic: Add
get_version API both for internal and external use".

Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
[scottwood@freescale.com: changelog update]
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agopowerpc/mpc85xx: Add FMan platform support
Igal Liberman [Wed, 18 Feb 2015 14:04:45 +0000 (16:04 +0200)]
powerpc/mpc85xx: Add FMan platform support

Get the FMan devices/sub-nodes (MAC, MDIO, etc.) auto-probed

Signed-off-by: Igal Liberman <Igal.Liberman@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agopowerpc/dts: Remove B4860 emulator support
Emil Medve [Tue, 3 Feb 2015 23:16:48 +0000 (17:16 -0600)]
powerpc/dts: Remove B4860 emulator support

Probably we should have not upstreamed this in the first place

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
9 years agopowerpc/pseries: Introduce api_version to migration sysfs interface
Tyrel Datwyler [Thu, 5 Mar 2015 02:25:38 +0000 (18:25 -0800)]
powerpc/pseries: Introduce api_version to migration sysfs interface

The /sys/kernel/mobility/migration interface was added all the way back
in 2.6.37. However, the drmgr userspace tool was never augmented to use
this interface to perfrom migrations. Instead it has continued using a
faux rtas call coupled with performing the device tree update processing
in userspace and communicating it back to the kernel via the ugly
/proc/ppc64/ofdt interface.

Up until 3.12 the device tree update code in the kernel was badly broken
and bit rotting. This code was fixed in 3.12 and is now utilized by the
kernel suspend code as of 3.15. The kernel is now better suited to
handle the post-mobility fixup of the device tree and drmgr should be
transitioned to using the sysfs migration interface.

This patch introduces the api_version sysfs file to /sys/kernel/mobility
as a means for drmgr to query the current implementation level of the
kernel migration code. This initial versioning indicates it is capable
of perfroming all current PAPR requirements for migration including the
post-mobility firmware activation and device tree update.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/32: %pF is only for function pointers
Scott Wood [Thu, 12 Mar 2015 03:13:46 +0000 (22:13 -0500)]
powerpc/32: %pF is only for function pointers

Use %pS for actual addresses, otherwise you'll get bad output
on arches like ppc64 where %pF expects a function descriptor.  Even on
other architectures, refrain from setting a bad example that people
copy.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: use kbuild generic-y where possible
Fabian Frederick [Wed, 11 Mar 2015 19:13:34 +0000 (20:13 +0100)]
powerpc: use kbuild generic-y where possible

Replace one line asm-generic include files declared in
arch/powerpc/include/asm/ by generic-y declaration
which creates arch/powerpc/include/generated/asm equivalent.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: Fix return value from power7_nap() et al.
Paul Mackerras [Thu, 19 Mar 2015 23:10:18 +0000 (10:10 +1100)]
powerpc/powernv: Fix return value from power7_nap() et al.

The power7_nap(), power7_sleep() and power7_winkle() functions are
called from pnv_smp_cpu_kill_self(), which expects them to return the
SRR1 value set by the hardware on wakeup, or 0 if no nap/sleep/winkle
occurred.  However, in the case where an interrupt needs to be
replayed, the logic in power7_powersave_common (the common code for
power7_nap et al.) doesn't set r3 to 0 in this case.  Instead what we
get as the return value is the selector for the type of power-saving
mode requested (1, 2 or 3).  In fact this should not affect the
operation of pnv_smp_cpu_kill_self(), but it is better to get this
correct, so this adds an instruction to set r3 to 0 in this case.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Spelling s/embeeded/embedded/
Geert Uytterhoeven [Wed, 18 Mar 2015 16:29:13 +0000 (17:29 +0100)]
powerpc: Spelling s/embeeded/embedded/

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Convert relocs_check to a shell script using grep
Stephen Rothwell [Wed, 18 Mar 2015 05:46:16 +0000 (16:46 +1100)]
powerpc: Convert relocs_check to a shell script using grep

This runs a bit faster and removes another use of perl from
the kernel build.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-By: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Move Power Macintosh drivers to generic byteswappers
David Gibson [Tue, 3 Feb 2015 05:36:21 +0000 (16:36 +1100)]
powerpc: Move Power Macintosh drivers to generic byteswappers

ppc has special instruction forms to efficiently load and store values
in non-native endianness.  These can be accessed via the arch-specific
{ld,st}_le{16,32}() inlines in arch/powerpc/include/asm/swab.h.

However, gcc is perfectly capable of generating the byte-reversing
load/store instructions when using the normal, generic cpu_to_le*() and
le*_to_cpu() functions eaning the arch-specific functions don't have much
point.

Worse the "le" in the names of the arch specific functions is now
misleading, because they always generate byte-reversing forms, but some
ppc machines can now run a little-endian kernel.

To start getting rid of the arch-specific forms, this patch removes them
from all the old Power Macintosh drivers, replacing them with the
generic byteswappers.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/rtas: Make timestamp related code y2038-safe
Hari Bathini [Thu, 5 Feb 2015 19:37:17 +0000 (01:07 +0530)]
powerpc/rtas: Make timestamp related code y2038-safe

While we are here, let us make timestamp related code y2038-safe.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: Add pstore support on powernv
Hari Bathini [Thu, 5 Feb 2015 19:36:52 +0000 (01:06 +0530)]
powerpc/powernv: Add pstore support on powernv

This patch extends pstore, a generic interface to platform dependent
persistent storage, support for powernv  platform to capture certain
useful information, during dying moments. Such support is already in
place for  pseries platform. This patch re-uses most of that code.

It is a common practice to compile kernels with both CONFIG_PPC_PSERIES=y
and CONFIG_PPC_POWERNV=y. The code in nvram_init_oops_partition() routine
still works as intended, as the caller is platform specific code which
passes the appropriate value for "rtas_partition_exists" parameter.
In all other places, where CONFIG_PPC_PSERIES or CONFIG_PPC_POWERNV
flag is used in this patchset, it is to reduce the kernel size in cases
where this flag is not set and doesn't have any impact logic wise.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopstore: Add pstore type id for PPC64 opal nvram partition
Hari Bathini [Thu, 5 Feb 2015 19:36:28 +0000 (01:06 +0530)]
pstore: Add pstore type id for PPC64 opal nvram partition

This patch adds a new PPC64 partition type to be used for opal
specific nvram partition. A new partition type is needed as none
of the existing type matches this partition type.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/nvram: Move generic code for nvram and pstore
Hari Bathini [Thu, 5 Feb 2015 19:36:04 +0000 (01:06 +0530)]
powerpc/nvram: Move generic code for nvram and pstore

With minor checks, we can move most of the code for nvram
under pseries to a common place to be re-used by other
powerpc platforms like powernv. This patch moves such
common code to arch/powerpc/kernel/nvram_64.c file.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[mpe: Move select of ZLIB_DEFLATE to PPC64 to fix the build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/numa: Reset node_possible_map to only node_online_map
Nishanth Aravamudan [Tue, 10 Mar 2015 23:50:59 +0000 (16:50 -0700)]
powerpc/numa: Reset node_possible_map to only node_online_map

Raghu noticed an issue with excessive memory allocation on power with a
simple cgroup test, specifically, in mem_cgroup_css_alloc ->
for_each_node -> alloc_mem_cgroup_per_zone_info(), which ends up blowing
up the kmalloc-2048 slab (to the order of 200MB for 400 cgroup
directories).

The underlying issue is that NODES_SHIFT on power is 8 (256 NUMA nodes
possible), which defines node_possible_map, which in turn defines the
value of nr_node_ids in setup_nr_node_ids and the iteration of
for_each_node.

In practice, we never see a system with 256 NUMA nodes, and in fact, we
do not support node hotplug on power in the first place, so the nodes
that are online when we come up are the nodes that will be present for
the lifetime of this kernel. So let's, at least, drop the NUMA possible
map down to the online map at runtime. This is similar to what x86 does
in its initialization routines.

mem_cgroup_css_alloc should also be fixed to only iterate over
memory-populated nodes and handle hotplug, but that is a separate
change.

Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/kernel: Rename copy_thread() 'arg' argument to 'kthread_arg'
Alex Dowad [Fri, 13 Mar 2015 18:14:46 +0000 (20:14 +0200)]
powerpc/kernel: Rename copy_thread() 'arg' argument to 'kthread_arg'

The 'arg' argument to copy_thread() is only ever used when forking a new
kernel thread. Hence, rename it to 'kthread_arg' for clarity.

Signed-off-by: Alex Dowad <alexinbeijing@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agoselftests/powerpc: Rename TARGETS in powerpc selftests makefile
Michael Ellerman [Wed, 18 Mar 2015 01:02:41 +0000 (12:02 +1100)]
selftests/powerpc: Rename TARGETS in powerpc selftests makefile

This patch changes the name of the make variable TARGETS, to prevent it
from colliding with a value set by the user on the command line (as they
are recommended to do by tools/testing/selftests/README.txt).

Without this patch, "make -C tools/testing/selftests TARGETS=powerpc"
will fail.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agoselftests/powerpc: Add test for VPHN
Greg Kurz [Mon, 23 Feb 2015 15:14:44 +0000 (16:14 +0100)]
selftests/powerpc: Add test for VPHN

The goal is to verify vphn_unpack_associativity() parses VPHN numbers
correctly. We feed it with a variety of input values and compare with
expected results.

PAPR+ does not say much about VPHN parsing: I came up with a list of
tests that check many simple cases and some corner ones. I wouldn't
dare to say the list is exhaustive though.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
[mpe: Rework harness logic, rename to test-vphn, add -m64]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
9 years agopowerpc/vphn: parsing code rewrite
Greg Kurz [Mon, 23 Feb 2015 15:14:37 +0000 (16:14 +0100)]
powerpc/vphn: parsing code rewrite

The current VPHN parsing logic has some flaws that this patch aims to fix:

1) when the value 0xffff is read, the value 0xffffffff gets added to the
   the output list and its element count isn't incremented. This is wrong.
   According to PAPR+ the domain identifiers are packed into a sequence
   terminated by the "reserved value of all ones". This means that 0xffff
   is a stream terminator.

2) the combination of byteswaps and casts make the code hardly readable.
   Let's parse the stream one 16-bit field at a time instead.

3) it is assumed that the hypercall returns 12 32-bit values packed into
   6 64-bit registers. According to PAPR+, the domain identifiers may be
   streamed as 16-bit values. Let's increase the number of expected numbers
   to 24.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/vphn: move VPHN parsing logic to a separate file
Greg Kurz [Mon, 23 Feb 2015 15:14:31 +0000 (16:14 +0100)]
powerpc/vphn: move VPHN parsing logic to a separate file

The goal behind this patch is to be able to write userland tests for the
VPHN parsing code.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/vphn: move endianness fixing to vphn_unpack_associativity()
Greg Kurz [Mon, 23 Feb 2015 15:14:25 +0000 (16:14 +0100)]
powerpc/vphn: move endianness fixing to vphn_unpack_associativity()

The first argument to vphn_unpack_associativity() is a const long *, but the
parsing code expects __be64 values actually. Let's move the endian fixing
down for consistency.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/vphn: clarify the H_HOME_NODE_ASSOCIATIVITY API
Greg Kurz [Mon, 23 Feb 2015 15:14:19 +0000 (16:14 +0100)]
powerpc/vphn: clarify the H_HOME_NODE_ASSOCIATIVITY API

The number of values returned by the H_HOME_NODE_ASSOCIATIVITY h_call deserves
to be explicitly defined, for a better understanding of the code.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: kill PPC_OF
Kevin Hao [Thu, 12 Mar 2015 12:32:50 +0000 (20:32 +0800)]
powerpc: kill PPC_OF

We have set CONFIG_PPC_OF to always 'y' in commit 0a498d96a332
("powerpc: set CONFIG_PPC_OF=y always for ARCH=powerpc") nine years
ago. And the arch/ppc also has gone away for many years. The OF
functionality was also moved to a common place and be used by many
archs. So it does make no sense to keep such a option in the current
kernel. Just kill it.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: kconfig: replace PPC_OF with PPC
Kevin Hao [Thu, 12 Mar 2015 12:32:49 +0000 (20:32 +0800)]
fbdev: kconfig: replace PPC_OF with PPC

The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: remove the unnecessary includes of ppc specific header files
Kevin Hao [Thu, 12 Mar 2015 12:32:48 +0000 (20:32 +0800)]
fbdev: remove the unnecessary includes of ppc specific header files

In the current kernel, we don't need to include these arch specific
header files for ppc.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: riva: remove the dependency on PPC_OF
Kevin Hao [Thu, 12 Mar 2015 12:32:47 +0000 (20:32 +0800)]
fbdev: riva: remove the dependency on PPC_OF

The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: nvidia: remove the dependency on PPC_OF
Kevin Hao [Thu, 12 Mar 2015 12:32:46 +0000 (20:32 +0800)]
fbdev: nvidia: remove the dependency on PPC_OF

The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: imsttfb: remove the dependency on PPC_OF
Kevin Hao [Thu, 12 Mar 2015 12:32:45 +0000 (20:32 +0800)]
fbdev: imsttfb: remove the dependency on PPC_OF

The OF functionality has moved to a common place and be used by many
archs. So we don't need to depend on PPC_OF option any more. This is
a preparation for killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: radeon: replace PPC_OF with PPC
Kevin Hao [Thu, 12 Mar 2015 12:32:44 +0000 (20:32 +0800)]
fbdev: radeon: replace PPC_OF with PPC

The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agofbdev: aty128fb: replace PPC_OF with PPC
Kevin Hao [Thu, 12 Mar 2015 12:32:43 +0000 (20:32 +0800)]
fbdev: aty128fb: replace PPC_OF with PPC

The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agosata_svw: remove the dependency on PPC_OF
Kevin Hao [Thu, 12 Mar 2015 12:32:42 +0000 (20:32 +0800)]
sata_svw: remove the dependency on PPC_OF

The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powermac: Cleaning up missing null-terminate in conjunction with strncpy
Rickard Strandqvist [Sat, 26 Jul 2014 16:45:05 +0000 (18:45 +0200)]
powerpc/powermac: Cleaning up missing null-terminate in conjunction with strncpy

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And removed unnecessary magic numbers.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agoselftests/powerpc: Build the copyloops with -maltivec
Michael Ellerman [Tue, 17 Mar 2015 04:16:12 +0000 (15:16 +1100)]
selftests/powerpc: Build the copyloops with -maltivec

The recent change to remove the vrX defines exposed the fact that we are
building the copyloops tests without altivec enabled. It depends on the
toolchain as to whether altivec is on by default or not, so it only
breaks on some toolchains. But we should always enable it.

Fixes: c2ce6f9f3dc0 ("powerpc: Change vrX register defines to vX to match gcc and glibc")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/via-pmu: fix OF node leak in Keylargo init
Phil Carmody [Tue, 16 Sep 2014 22:00:54 +0000 (01:00 +0300)]
powerpc/via-pmu: fix OF node leak in Keylargo init

If we of_find_node_by_name() then we must of_node_put() too.

Signed-off-by: Phil Carmody <pc+lkml@asdf.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/via-pmu: fix error path in find_via_pmu()
Phil Carmody [Tue, 16 Sep 2014 22:00:53 +0000 (01:00 +0300)]
powerpc/via-pmu: fix error path in find_via_pmu()

Cleanup was not in the reverse order from the set-up, so not all
the gotos made sense, and also it was being avoided completely upon
failure of init_pmu().

Signed-off-by: Phil Carmody <pc+lkml@asdf.org>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc: Remove duplicate cacheable_memcpy/memzero functions
Kyle Moffett [Tue, 15 Nov 2011 02:32:10 +0000 (21:32 -0500)]
powerpc: Remove duplicate cacheable_memcpy/memzero functions

These functions are only used from one place each.  If the cacheable_*
versions really are more efficient, then those changes should be
migrated into the common code instead.

NOTE: The old routines are just flat buggy on kernels that support
      hardware with different cacheline sizes.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pseries: Implement memory hotplug remove in the kernel
Nathan Fontenot [Tue, 10 Feb 2015 19:49:22 +0000 (13:49 -0600)]
powerpc/pseries: Implement memory hotplug remove in the kernel

This patch adds the ability to do memory hotplug remove in the kernel.

Currently the operation to hotplug remove memory is handled by the drmgr
command which performs the operation by performing some work in user-space
and making requests to the kernel to handle other pieces. By moving all
of the work to the kernel we can do the remove faster, and provide a common
code path to do memory hotplug for both the PowerVM and PowerKVM environments.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pseries: Implement memory hotplug add in the kernel
Nathan Fontenot [Tue, 10 Feb 2015 19:48:25 +0000 (13:48 -0600)]
powerpc/pseries: Implement memory hotplug add in the kernel

This patch adds the ability to do memory hotplug add in the kernel.

Currently the operation to hotplug add memory is handled by the drmgr
command which performs the operation by performing some work in user-space
and making requests to the kernel to handle other pieces. By moving all
of the work to the kernel we can do the add faster, and provide a common
code path to do memory hotplug for both the PowerVM and PowerKVM environments.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pseries: Create new device hotplug entry point
Nathan Fontenot [Tue, 10 Feb 2015 19:47:02 +0000 (13:47 -0600)]
powerpc/pseries: Create new device hotplug entry point

The current hotplug (or dlpar) of devices (the process is generally the
same for memory, cpu, and pci) on PowerVM systems is initiated
from the HMC, which communicates the request to the partitions through
the RSCT framework. The RSCT framework then invokes the drmgr command.
The drmgr command performs the hotplug operation by doing some pieces,
such as most of the rtas calls and device tree parsing, in userspace
and make requests to the kernel to online/offline the device, update the
device tree and add/remove the device.

For PowerKVM the approach for device hotplug is to follow what is currently
being done for pci hotplug. A hotplug request is initiated from the host.
QEMU then generates an EPOW interrupt to the guest which causes the guest
to make the rtas,check-exception call. In QEMU, the rtas,check-exception call
returns a rtas hotplug event to the guest.

Please note that the current pci hotplug path for PowerKVM involves the
kernel receiving the rtas hotplug event, passing it to rtas_errd in
userspace, and having rtas_errd invoke drmgr. The drmgr command then
handles the request as described above for PowerVM systems.

There is no need for this circuitous route, we should just handle the entire
hotplug of devices in the kernel. What I am planning is to enable this
by moving the code to handle hotplug from drmgr into the kernel to
provide a single path for handling device hotplug for both PowerVM and
PowerKVM systems. This patch provides the common iframework and entry point.
For PowerKVM a future update to the kernel rtas code will recognize rtas
hotplug events returned from rtas,check-exception calls and use the common
entry point to handle hotplug of the device.

For PowerVM systems, This patch creates /sys/kernel/dlpar that can be
used by the drmgr command to initiate hotplug requests. In order to do
this a string of the format "<resource> <action> <id_type> <id>" is
written to this file. The string consists of a resource (cpu, memory, pci,
phb), an action (add or remove), an id_type (count, drc index, drc name),
and the corresponding id. The kernel will parse the string and create a
rtas hotplug section that can be passed to the common entry point for
handling hotplug requests.

It should be noted that there is no chance of updating how we receive
hotplug (dlpar) requests from the HMC on PowerVM systems.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pseries: Declare the acquire/release drc index routines
Nathan Fontenot [Tue, 10 Feb 2015 19:45:01 +0000 (13:45 -0600)]
powerpc/pseries: Declare the acquire/release drc index routines

Add declarations for dlpar_{acquire,release}_drc(...)

They are already marked non-static but were missing a prototype/

[BenH: Added extern to be consistent with the rest of the file]

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pseries: Define rtas hotplug event sections
Nathan Fontenot [Tue, 10 Feb 2015 19:43:24 +0000 (13:43 -0600)]
powerpc/pseries: Define rtas hotplug event sections

In order to handle device hotplug in the kernel on pseries the hotplug
request will be communicated in the kernel in the form of a
rtas hotplug event. This patch adds the definition of rtas hotplug event
sections.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Remove unused file
Gavin Shan [Mon, 16 Feb 2015 03:45:48 +0000 (14:45 +1100)]
powerpc/powernv: Remove unused file

The patch removes unused file eeh-ioda.c and updates makefile
accordingly. Besides, the definition of "struct pnv_eeh_ops" and
the instances are all removed. Until now, the chip layer of EEH
implementation for PowerNV platform is removed completely.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation reset()
Gavin Shan [Mon, 16 Feb 2015 03:45:47 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation reset()

The patch drops PHB EEH operation reset() and merges its logic to
eeh_ops::reset().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation next_error()
Gavin Shan [Mon, 16 Feb 2015 03:45:46 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation next_error()

The patch drops PHB EEH operation next_error() and merges its
logic to eeh_ops::next_error().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation get_state()
Gavin Shan [Mon, 16 Feb 2015 03:45:45 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation get_state()

The patch drops PHB EEH operation get_state() and merges its logic
to eeh_ops::get_state().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation set_option()
Gavin Shan [Mon, 16 Feb 2015 03:45:44 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation set_option()

The patch drops PHB EEH operation set_option() and merges its
logic to eeh_ops::set_option().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation configure_bridge()
Gavin Shan [Mon, 16 Feb 2015 03:45:43 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation configure_bridge()

The patch drops PHB EEH operation configure_bridge() and merges
its logic to eeh_ops::configure_bridge().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation get_log()
Gavin Shan [Mon, 16 Feb 2015 03:45:42 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation get_log()

The patch drops PHB operation get_log() and merges its logic to
eeh_ops::get_log().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation post_init()
Gavin Shan [Mon, 16 Feb 2015 03:45:41 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation post_init()

The patch drops PHB EEH operation post_init() and merge its logic
to eeh_ops::post_init().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Drop PHB operation err_inject()
Gavin Shan [Mon, 16 Feb 2015 03:45:40 +0000 (14:45 +1100)]
powerpc/powernv: Drop PHB operation err_inject()

The patch drops PHB EEH operation err_inject() and merge its logic
to eeh_ops::err_inject().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/powernv: Shorten EEH function names
Gavin Shan [Mon, 16 Feb 2015 03:45:39 +0000 (14:45 +1100)]
powerpc/powernv: Shorten EEH function names

The patch shortens names of EEH functions in powernv-eeh.c and no
logic change introduced by this patch.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/pci: Fix comments about ppc_md.pcibios_fixup
Gavin Shan [Fri, 13 Feb 2015 04:16:32 +0000 (15:16 +1100)]
powerpc/pci: Fix comments about ppc_md.pcibios_fixup

The patch fixes the comments about ppc_md.pcibios_fixup(), which
should be called after allocating resources.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/eeh: Enhance pcibios_set_pcie_reset_state()
Gavin Shan [Tue, 10 Feb 2015 23:20:49 +0000 (10:20 +1100)]
powerpc/eeh: Enhance pcibios_set_pcie_reset_state()

Function pcibios_set_pcie_reset_state() is possibly called by
pci_reset_function(), on which VFIO infrastructure depends to
issue reset. pcibios_set_pcie_reset_state() is issuing reset
on the parent PE of the indicated PCI device. The reset causes
state lost on all PCI devices except the indicated one as the
argument to pcibios_set_pcie_reset_state(). Also, sideband
MMIO access from guest when issuing reset would cause unexpected
EEH error.

For above two issues, the patch applies following enhancements
to pcibios_set_pcie_reset_state():

   * For all PCI devices except the indicated one, save their
     state prior to reset and restore state after that.
   * Explicitly freeze PE prior to reset and unfreeze it after
     that, in order to avoid unexpected EEH error.

Tested-by: Priya M. A <priyama2@in.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9 years agopowerpc/book3s: Fix flush_tlb cpu_spec hook to take a generic argument.
Mahesh Salgaonkar [Fri, 19 Dec 2014 03:11:05 +0000 (08:41 +0530)]
powerpc/book3s: Fix flush_tlb cpu_spec hook to take a generic argument.

The flush_tlb hook in cpu_spec was introduced as a generic function hook
to invalidate TLBs. But the current implementation of flush_tlb hook
takes IS (invalidation selector) as an argument which is architecture
dependent. Hence, It is not right to have a generic routine where caller
has to pass non-generic argument.

This patch fixes this and makes flush_tlb hook as high level API.

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot: don't clobber r6 and r7 in epapr boot
Jeremy Kerr [Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)]
powerpc/boot: don't clobber r6 and r7 in epapr boot

We use r6 and r7 for epapr boot, but the current pre-C init will clobber
both of these.

This change does a simple replacement, of r6 -> r12 and r7 -> r13, so
that we hit platform init with these registers intact.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot: Fix stack corruption in epapr entry point
Jeremy Kerr [Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)]
powerpc/boot: Fix stack corruption in epapr entry point

Currently, a 64-bit little-endian zImage.epapr won't boot in epapr mode,
as we never return from platform_init.

Before entering C, we initialise our stack by setting r1 16 bytes below
the end of the _bss_stack:

  stwu r0,-16(r1) /* establish a stack frame */

However, the called function will save the caller's lr in the caller's
frame's lr save area, at -16(r1) to -32(r1).

This means that writes to the fdt variable will corrupt the saved link
register:

 0000000020c06018 l     O .bss   0000000000001000 _bss_stack
 0000000020c07018 l     O .bss   0000000000000008 fdt

We'll need at least 32 bytes in the initial stack frame, to handle the
LR save area. We bump this to 112 bytes, as that'll be the max required
by ABIv1.

Thanks to Alistair Popple for debugging help.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot/wrapper: use the pseries wrapper for zImage.epapr
Jeremy Kerr [Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)]
powerpc/boot/wrapper: use the pseries wrapper for zImage.epapr

We'll likely be entering the zImage.epapr as BE, so include the pseries
implementation of _zimage_start, which adds the endian fixup magic.

Although the endian fixup won't work on Book III-E machines starting LE,
the current entry point doesn't support LE anyway, so we shouldn't be
breaking anything.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot/fdt: Add little-endian support to libfdt wrappers
Jeremy Kerr [Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)]
powerpc/boot/fdt: Add little-endian support to libfdt wrappers

For epapr-style boot, we may be little-endian. This change implements
the proper conversion for fdt*_to_cpu and cpu_to_fdt*. We also need the
full cpu_to_* and *_to_cpu macros for this.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot/fdt: Use unsigned long for pointer casts
Jeremy Kerr [Wed, 11 Feb 2015 04:55:44 +0000 (12:55 +0800)]
powerpc/boot/fdt: Use unsigned long for pointer casts

Now that the wrapper supports 64-bit builds, we see warnings when
attempting to cast pointers to int. Use unsigned long instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/mpic: remove unused functions
Arseny Solokha [Tue, 24 Feb 2015 09:05:06 +0000 (16:05 +0700)]
powerpc/mpic: remove unused functions

Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
mpic_set_serial_int().

  + fsl_mpic_primary_get_version() is just a safe wrapper around
fsl_mpic_get_version() for SMP configurations. While the latter is
called explicitly for handling PIC initialization and setting up error
interrupt vector depending on PIC hardware version, the former isn't
used for anything.

  + As for mpic_set_clk_ratio() and mpic_set_serial_int(), they both are
almost nine years old[1] but still have no chance to be called even from
out-of-tree modules because they both are __init and of course aren't
exported.

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: hongtao.jia@freescale.com
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/qe: drop unused ucc_slow_poll_transmitter_now
Arseny Solokha [Tue, 24 Feb 2015 09:05:05 +0000 (16:05 +0700)]
powerpc/qe: drop unused ucc_slow_poll_transmitter_now

Drop ucc_slow_poll_transmitter_now() which has no users since its
inception in 2007 in commit 986585385131 ("[POWERPC] Add QUICC
Engine (QE) infrastructure").

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/boot: drop planetcore_set_serial_speed
Arseny Solokha [Tue, 24 Feb 2015 09:05:03 +0000 (16:05 +0700)]
powerpc/boot: drop planetcore_set_serial_speed

Drop planetcore_set_serial_speed() which had no users since its
inception in commit fec6047047fd ("[POWERPC] bootwrapper: Add PlanetCore
firmware support") in 2007.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: Remove unused definitions in opal-api.h
Michael Ellerman [Tue, 17 Feb 2015 09:01:55 +0000 (20:01 +1100)]
powerpc/powernv: Remove unused definitions in opal-api.h

This removes definitions in opal-api.h that are completely unused in
Linux.

For each of these I see three possibilities, 1) we *should* be using
them in Linux and patches will arrive to do that, 2) they are not used
but should stay in the header to document the API for some important
reason, 3) they are not used and needn't be part of the API.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
9 years agopowerpc/powernv: Move opal-api.h closer to the Skiboot version
Michael Ellerman [Tue, 17 Feb 2015 09:01:54 +0000 (20:01 +1100)]
powerpc/powernv: Move opal-api.h closer to the Skiboot version

This commit gets opal-api.h to mostly match the version in Skiboot as of
commit ea7d806ab0ba.

The exceptions are things which are not (currently) used in Linux.

Most of this is just whitespace and a few things moving around. I think
the diff is readable.

Also OpalMessageType became opal_msg_type, requiring a change in the
Linux code.

Finally Skiboot and Linux disagree on CAPI vs CXL, because CAPI means
something else in Linux. To handle that we just point the Linux wrapper,
which is named "cxl" to the OPAL token OPAL_PCI_SET_PHB_CAPI_MODE.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
9 years agopowerpc/powernv: Move OPAL API definitions to opal-api.h
Michael Ellerman [Tue, 17 Feb 2015 09:01:53 +0000 (20:01 +1100)]
powerpc/powernv: Move OPAL API definitions to opal-api.h

We'd like to get to the stage where the OPAL API is defined in a header
that is identical between Linux and Skiboot.

As step one, split the bits that actually define the API into
opal-api.h. The Linux specific parts stay in opal.h.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
9 years agopowerpc/boot: Makefile cleanup
Michal Marek [Thu, 2 Oct 2014 13:49:15 +0000 (15:49 +0200)]
powerpc/boot: Makefile cleanup

The $(image-n) variable will never exist, because unset Kconfig options
are '' and not 'n'.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Delete unnecessary checks before kfree()
Markus Elfring [Tue, 3 Feb 2015 12:55:53 +0000 (13:55 +0100)]
powerpc: Delete unnecessary checks before kfree()

The kfree() function tests whether its argument is NULL and then returns
immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports it
Stewart Smith [Thu, 12 Feb 2015 05:25:29 +0000 (16:25 +1100)]
powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports it

Not all OPAL platforms support resending system dumps, so check
that current firmware supports it first. Otherwise we get firmware
complaining:
"OPAL: Called with bad token 91 !"

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it
Stewart Smith [Thu, 12 Feb 2015 05:25:28 +0000 (16:25 +1100)]
powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it

Otherwise firmware complains: "OPAL: Called with bad token 74 !"
as not all OPAL systems have the ability to resend error logs.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc/powernv: only register log if OPAL supports doing so
Stewart Smith [Thu, 12 Feb 2015 05:25:27 +0000 (16:25 +1100)]
powerpc/powernv: only register log if OPAL supports doing so

Correct use of REGISTER/UNREGISTER is to check if the token exists
before calling. If we don't we get a "OPAL: Called with bad token 101 !"
error, which is harmless but may be alarming to some.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Change vsrX register defines to vsX to match gcc and glibc
Anton Blanchard [Mon, 9 Feb 2015 22:51:23 +0000 (09:51 +1100)]
powerpc: Change vsrX register defines to vsX to match gcc and glibc

As our various loops (copy, string, crypto etc) get more complicated,
we want to share implementations between userspace (eg glibc) and
the kernel. We also want to write userspace test harnesses to put
in tools/testing/selftest.

One gratuitous difference between userspace and the kernel is the
VSX register definitions - the kernel uses vsrX whereas gcc uses
vsX.

Change the kernel to match userspace.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agopowerpc: Change vrX register defines to vX to match gcc and glibc
Anton Blanchard [Mon, 9 Feb 2015 22:51:22 +0000 (09:51 +1100)]
powerpc: Change vrX register defines to vX to match gcc and glibc

As our various loops (copy, string, crypto etc) get more complicated,
we want to share implementations between userspace (eg glibc) and
the kernel. We also want to write userspace test harnesses to put
in tools/testing/selftest.

One gratuitous difference between userspace and the kernel is the
VMX register definitions - the kernel uses vrX whereas both gcc and
glibc use vX.

Change the kernel to match userspace.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
9 years agoLinux 4.0-rc4
Linus Torvalds [Mon, 16 Mar 2015 00:38:20 +0000 (17:38 -0700)]
Linux 4.0-rc4

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sun, 15 Mar 2015 22:20:09 +0000 (15:20 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fix from Dave Airlie:
 "An oops snuck in in an -rc3 patch, this fixes it"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  [PATCH] drm/mm: Fix support 4 GiB and larger ranges

9 years agoMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 15 Mar 2015 22:07:08 +0000 (15:07 -0700)]
Merge tag 'clk-fixes-for-linus' of git://git./linux/kernel/git/clk/linux

Pull clock framework fixes from Michael Turquette:
 "The clk fixes for 4.0-rc4 comprise three themes.

  First are the usual driver fixes for new regressions since v3.19.

  Second are fixes to the common clock divider type caused by recent
  changes to how we round clock rates.  This affects many clock drivers
  that use this common code.

  Finally there are fixes for drivers that improperly compared struct
  clk pointers (drivers must not deref these pointers).  While some of
  these drivers have done this for a long time, this did not cause a
  problem until we started generating unique struct clk pointers for
  every consumer.  A new function, clk_is_match was introduced to get
  these drivers working again and they are fixed up to no longer deref
  the pointers themselves"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  ASoC: kirkwood: fix struct clk pointer comparing
  ASoC: fsl_spdif: fix struct clk pointer comparing
  ARM: imx: fix struct clk pointer comparing
  clk: introduce clk_is_match
  clk: don't export static symbol
  clk: divider: fix calculation of initial best divider when rounding to closest
  clk: divider: fix selection of divider when rounding to closest
  clk: divider: fix calculation of maximal parent rate for a given divider
  clk: divider: return real rate instead of divider value
  clk: qcom: fix platform_no_drv_owner.cocci warnings
  clk: qcom: fix platform_no_drv_owner.cocci warnings
  clk: qcom: Add PLL4 vote clock
  clk: qcom: lcc-msm8960: Fix PLL rate detection
  clk: qcom: Fix slimbus n and m val offsets
  clk: ti: Fix FAPLL parent enable bit handling

9 years ago[PATCH] drm/mm: Fix support 4 GiB and larger ranges
Krzysztof Kolasa [Sun, 15 Mar 2015 19:22:36 +0000 (20:22 +0100)]
[PATCH] drm/mm: Fix support 4 GiB and larger ranges

bad argument if(tmp)... in check_free_hole

fix oops: kernel BUG at drivers/gpu/drm/drm_mm.c:305!

[airlied: excellent, this was my task for today].

Signed-off-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Reviewed-by: Chris wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sun, 15 Mar 2015 17:49:38 +0000 (10:49 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "This is a rather unpleasantly large set of bug fixes for arm-soc, Most
  of them because of cross-tree dependencies for Exynos where we should
  have figured out the right path to merge things before the merge
  window, and then the maintainer being unable to sort things out in
  time during a business trip.

  The other changes contained here are the usual collection:

  MAINTAINERS file updates
   - Gregory Clement is now a co-maintainer for the legacy Marvell EBU
     platforms
   - A MAINTAINERS entry for the Freescale Vybrid platform that was
     added last year
   - Matt Porter no longer works as a maintainer on Broadcom SoCs

  Build-time issues
   - A compile-time error for at91
   - Several minor DT fixes on at91, imx, exynos, socfpga, and omap
   - The new digicolor platform was not correctly enabled at all

  Configuration issues
   - Two defconfig fix for regressions using USB on versatile express
     and on OMAP3
   - Enabling all 8 CPUs on Allwinner/SUNxi
   - Enabling the new STiH410 platform to be usable

  Bug fixes in platform code
   - A missing barrier for socfpga
   - Fixing LPDDR1 self-refresh mode on at91
   - Fixing RTC interrupt numbers on Exynos3250
   - Fixing a cache-coherency issues in CPU power-down on Exynos5
   - Multiple small OMAP power management fixes"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (69 commits)
  MAINTAINERS: Add myself as co-maintainer to the legacy support of the mvebu SoCs
  ARM: at91: pm_slowclock: fix the compilation error
  ARM: at91/dt: fix USB high-speed clock to select UTMI
  ARM: at91/dt: fix at91 udc compatible strings
  ARM: at91/dt: declare matrix node as a syscon device
  ARM: vexpress: update CONFIG_USB_ISP1760 option
  ARM: digicolor: add the machine directory to Makefile
  ARM: STi: Add STiH410 SoC support
  MAINTAINERS: add Freescale Vybrid SoC
  MAINTAINERS: Remove self as ARM mach-bcm co-maintainer
  ARM: imx6sl-evk: set swbst_reg as vbus's parent reg
  ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg
  ARM: at91/dt: at91sam9261: fix clocks and clock-names in udc definition
  ARM: OMAP2+: Fix wl12xx on dm3730-evm with mainline u-boot
  ARM: OMAP: enable TWL4030_USB in omap2plus_defconfig
  ARM: dts: dra7x-evm: avoid possible contention while muxing on CAN lines
  ARM: dts: dra7x-evm: Don't use dcan1_rx.gpio1_15 in DCAN pinctrl
  ARM: dts: am43xx: fix SLEWCTRL_FAST pinctrl binding
  ARM: dts: am33xx: fix SLEWCTRL_FAST pinctrl binding
  ARM: dts: OMAP5: fix polling intervals for thermal zones
  ...

9 years agoMerge tag 'irqchip-fixes-4.0' of git://git.infradead.org/users/jcooper/linux
Linus Torvalds [Sun, 15 Mar 2015 17:41:30 +0000 (10:41 -0700)]
Merge tag 'irqchip-fixes-4.0' of git://git.infradead.org/users/jcooper/linux

Pull irqchip fixes from Jason Cooper:
 "armada-370-xp:
   - Chained per-cpu interrupts

  gic{,-v3,v3-its}"
   - Various fixes for safer operation"

* tag 'irqchip-fixes-4.0' of git://git.infradead.org/users/jcooper/linux:
  irqchip: gicv3-its: Support safe initialization
  irqchip: gicv3-its: Define macros for GITS_CTLR fields
  irqchip: gicv3-its: Add limitation to page order
  irqchip: gicv3-its: Use 64KB page as default granule
  irqchip: gicv3-its: Zero itt before handling to hardware
  irqchip: gic-v3: Fix out of bounds access to cpu_logical_map
  irqchip: gic: Fix unsafe locking reported by lockdep
  irqchip: gicv3-its: Fix unsafe locking reported by lockdep
  irqchip: gicv3-its: Iterate over PCI aliases to generate ITS configuration
  irqchip: gicv3-its: Allocate enough memory for the full range of DeviceID
  irqchip: gicv3-its: Fix ITS CPU init
  irqchip: armada-370-xp: Fix chained per-cpu interrupts

9 years agoMerge branch 'irqchip/urgent-gic' into irqchip/urgent
Jason Cooper [Sun, 15 Mar 2015 01:41:26 +0000 (01:41 +0000)]
Merge branch 'irqchip/urgent-gic' into irqchip/urgent

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sat, 14 Mar 2015 21:54:25 +0000 (14:54 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Misc i915, vmwgfx and radeon fixes along with a fix for one of those
  recursive sleep mutex debug cases in the mst code"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/vmwgfx: Fix an issue with the device losing its irq line on module unload
  drm/vmwgfx: Correctly NULLify dma buffer pointer on failure
  drm/vmwgfx: Reorder device takedown somewhat
  drm/vmwgfx: Fix a couple of lock dependency violations
  drm/radeon: drop setting UPLL to sleep mode
  drm/radeon: fix wait to actually occur after the signaling callback
  drm/i915: Prevent TLB error on first execution on SNB
  drm/i915: Do both mt and gen6 style forcewake reset on ivb probe
  drm/i915: Make WAIT_IOCTL negative timeouts be indefinite again
  drm/i915: use in_interrupt() not in_irq() to check context
  drm/mst: fix recursive sleep warning on qlock
  drm: Don't assign fbs for universal cursor support to files

9 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sat, 14 Mar 2015 21:23:50 +0000 (14:23 -0700)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fix from James Bottomley:
 "This is a simple fix for a domain revalidation crash which has
  recently turned up in the libsas code (applies to mvsas, isc and
  aic94xx)"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  libsas: Fix Kernel Crash in smp_execute_task

9 years agoMerge tag 'locks-v4.0-4' of git://git.samba.org/jlayton/linux
Linus Torvalds [Sat, 14 Mar 2015 17:02:21 +0000 (10:02 -0700)]
Merge tag 'locks-v4.0-4' of git://git.samba.org/jlayton/linux

Pull file locking bugfix from Jeff Layton:
 "Just a small fix for a potential problem in one of the lease
  tracepoints"

* tag 'locks-v4.0-4' of git://git.samba.org/jlayton/linux:
  locks: fix generic_delete_lease tracepoint to use victim pointer

9 years agoMerge tag 'vfio-v4.0-rc4' of git://github.com/awilliam/linux-vfio
Linus Torvalds [Sat, 14 Mar 2015 16:36:10 +0000 (09:36 -0700)]
Merge tag 'vfio-v4.0-rc4' of git://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:
 "Add missing break to avoid clobbering ioctl (Alexey Kardashevskiy)"

* tag 'vfio-v4.0-rc4' of git://github.com/awilliam/linux-vfio:
  vfio-pci: Add missing break to enable VFIO_PCI_ERR_IRQ_INDEX

9 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Linus Torvalds [Sat, 14 Mar 2015 16:32:00 +0000 (09:32 -0700)]
Merge tag 'arm64-fixes' of git://git./linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:

 - add TLB invalidation for page table tear-down which was missed when
   support for CONFIG_HAVE_RCU_TABLE_FREE was added (assuming page table
   freeing was always deferred)

 - use UEFI for system and reset poweroff if available

 - fix asm label placement in relation to the alignment statement

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: put __boot_cpu_mode label after alignment instead of before
  efi/arm64: use UEFI for system reset and poweroff
  arm64: Invalidate the TLB corresponding to intermediate page table levels

9 years agoMerge tag 'linux-kselftest-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 14 Mar 2015 16:26:23 +0000 (09:26 -0700)]
Merge tag 'linux-kselftest-4.0-rc4' of git://git./linux/kernel/git/shuah/linux-kselftest

Pull Kselftest fix from Shuah Khan:
 "selftests/exec: Check if the syscall exists and bail if not"

* tag 'linux-kselftest-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/exec: Check if the syscall exists and bail if not

9 years agolocks: fix generic_delete_lease tracepoint to use victim pointer
Jeff Layton [Sat, 14 Mar 2015 13:45:35 +0000 (09:45 -0400)]
locks: fix generic_delete_lease tracepoint to use victim pointer

It's possible that "fl" won't point at a valid lock at this point, so
use "victim" instead which is either a valid lock or NULL.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
9 years agoarm64: put __boot_cpu_mode label after alignment instead of before
Ard Biesheuvel [Fri, 13 Mar 2015 15:21:18 +0000 (16:21 +0100)]
arm64: put __boot_cpu_mode label after alignment instead of before

Another one for the big head.S spring cleaning: the label should
be after the .align or it may point to the padding.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
9 years agoefi/arm64: use UEFI for system reset and poweroff
Ard Biesheuvel [Fri, 6 Mar 2015 14:49:24 +0000 (15:49 +0100)]
efi/arm64: use UEFI for system reset and poweroff

If UEFI Runtime Services are available, they are preferred over direct
PSCI calls or other methods to reset the system.

For the reset case, we need to hook into machine_restart(), as the
arm_pm_restart function pointer may be overwritten by modules.

Tested-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
9 years agoarm64: Invalidate the TLB corresponding to intermediate page table levels
Catalin Marinas [Wed, 11 Mar 2015 12:20:39 +0000 (12:20 +0000)]
arm64: Invalidate the TLB corresponding to intermediate page table levels

The ARM architecture allows the caching of intermediate page table
levels and page table freeing requires a sequence like:

pmd_clear()
TLB invalidation
pte page freeing

With commit 5e5f6dc10546 (arm64: mm: enable HAVE_RCU_TABLE_FREE logic),
the page table freeing batching was moved from tlb_remove_page() to
tlb_remove_table(). The former takes care of TLB invalidation as this is
also shared with pte clearing and page cache page freeing. The latter,
however, does not invalidate the TLBs for intermediate page table levels
as it probably relies on the architecture code to do it if required.
When the mm->mm_users < 2, tlb_remove_table() does not do any batching
and page table pages are freed before tlb_finish_mmu() which performs
the actual TLB invalidation.

This patch introduces __tlb_flush_pgtable() for arm64 and calls it from
the {pte,pmd,pud}_free_tlb() directly without relying on deferred page
table freeing.

Fixes: 5e5f6dc10546 arm64: mm: enable HAVE_RCU_TABLE_FREE logic
Reported-by: Jon Masters <jcm@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
Tested-by: Steve Capper <steve.capper@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
9 years agoMerge tag 'pm+acpi-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 13 Mar 2015 21:30:38 +0000 (14:30 -0700)]
Merge tag 'pm+acpi-4.0-rc4' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
 "Just two fixes, one for an ACPI LPSS driver issue introduced during
  the 3.17 cycle and one revert of a recent commit that sort of broke
  the cpupower tool.

  Specifics:

   - Fix an ACPI LPSS (Low-Power Subsystem) driver issue causing the
     8250_dw driver to confuse an LPSS clock with another one it is
     supposed to handle due to the lack of identification allowing it to
     tell those clocks apart (Heikki Krogerus).

   - Revert a recent commit that was supposed to improve the usability
     of the cpupower tool, but clearly did the opposite (Josh Boyer)"

* tag 'pm+acpi-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "cpupower Makefile change to help run the tool without 'make install'"
  ACPI / LPSS: provide con_id for the clkdev

9 years agoMAINTAINERS: Add myself as co-maintainer to the legacy support of the mvebu SoCs
Gregory CLEMENT [Fri, 13 Mar 2015 13:41:45 +0000 (14:41 +0100)]
MAINTAINERS: Add myself as co-maintainer to the legacy support of the mvebu SoCs

I will also take care of the legacy support(not fully converted to DT)
of the mvebu SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
9 years agoMerge branch 'pm-tools'
Rafael J. Wysocki [Fri, 13 Mar 2015 20:43:08 +0000 (21:43 +0100)]
Merge branch 'pm-tools'

* pm-tools:
  Revert "cpupower Makefile change to help run the tool without 'make install'"

9 years agoMerge tag 'stable/for-linus-4.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 13 Mar 2015 20:34:38 +0000 (13:34 -0700)]
Merge tag 'stable/for-linus-4.0-rc3-tag' of git://git./linux/kernel/git/xen/tip

Pull xen bug fixes from David Vrabel:

 - fix a PV regression in 3.19.

 - fix a dom0 crash on hosts with large numbers of PIRQs.

 - prevent pcifront from disabling memory or I/O port access, which may
   trigger host crashes.

* tag 'stable/for-linus-4.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen-pciback: limit guest control of command register
  xen/events: avoid NULL pointer dereference in dom0 on large machines
  xen: Remove trailing semicolon from xenbus_register_frontend() definition
  x86/xen: correct bug in p2m list initialization

9 years agoMerge tag 'sound-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Linus Torvalds [Fri, 13 Mar 2015 20:30:00 +0000 (13:30 -0700)]
Merge tag 'sound-4.0-rc4' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This is a round of HD-audio fixes: there are a long-standing
  regression fix and a few more device/codec-specific quirks.

  In addition, a couple of FireWire regression fixes, a USB-audio quirk
  for Roland UA-22 and a sanity check in API for user-defined control
  elements"

* tag 'sound-4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Don't access stereo amps for mono channel widgets
  ALSA: hda - Add workaround for MacBook Air 5,2 built-in mic
  ALSA: hda - Set single_adc_amp flag for CS420x codecs
  ALSA: snd-usb: add quirks for Roland UA-22
  ALSA: control: Add sanity checks for user ctl id name string
  ALSA: hda - Fix built-in mic on Compaq Presario CQ60
  ALSA: firewire-lib: leave unit reference counting completely
  Revert "ALSA: dice: fix wrong offsets for Dice interface"
  ALSA: hda - Fix regression of HD-audio controller fallback modes

9 years agoMerge tag 'devicetree-fixes-for-4.0' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 13 Mar 2015 18:10:10 +0000 (11:10 -0700)]
Merge tag 'devicetree-fixes-for-4.0' of git://git./linux/kernel/git/robh/linux

Pull DeviceTree fixes from Rob Herring:

 - fix for stdout-path option parsing with added unittest

 - fix for stdout-path interaction with earlycon

 - several DT unittest fixes

 - fix Sparc allmodconfig build error on of_platform_register_reconfig_notifier

 - several DT overlay kconfig and build warning fixes

 - several DT binding documentation updates

* tag 'devicetree-fixes-for-4.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of/platform: Fix sparc:allmodconfig build
  of: unittest: Add options string testcase variants
  of: fix handling of '/' in options for of_find_node_by_path()
  of/unittest: Fix the wrong expected value in of_selftest_property_string
  of/unittest: remove the duplicate of_changeset_init
  dt: submitting-patches: clarify that DT maintainers are to be cced on bindings
  of: unittest: fix I2C dependency
  of/overlay: Remove unused variable
  Documentation: DT: Renamed of-serial.txt to 8250.txt
  of: Fix premature bootconsole disable with 'stdout-path'
  serial: add device tree binding documentation for ETRAX FS UART
  of/overlay: Directly include idr.h
  of: Drop superfluous dependance for OF_OVERLAY
  of: Add vendor prefix for Arasan
  of: Add prompt for OF_OVERLAY config

9 years agoMerge branch 'gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Fri, 13 Mar 2015 17:55:32 +0000 (10:55 -0700)]
Merge branch 'gadget' of git://git./linux/kernel/git/viro/vfs

Pull gadgetfs fixes from Al Viro:
 "Assorted fixes around AIO on gadgetfs: leaks, use-after-free, troubles
  caused by ->f_op flipping"

* 'gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  gadgetfs: really get rid of switching ->f_op
  gadgetfs: get rid of flipping ->f_op in ep_config()
  gadget: switch ep_io_operations to ->read_iter/->write_iter
  gadgetfs: use-after-free in ->aio_read()
  gadget/function/f_fs.c: switch to ->{read,write}_iter()
  gadget/function/f_fs.c: use put iov_iter into io_data
  gadget/function/f_fs.c: close leaks
  move iov_iter.c from mm/ to lib/
  new helper: dup_iter()

9 years agoof/platform: Fix sparc:allmodconfig build
Guenter Roeck [Wed, 11 Mar 2015 03:31:04 +0000 (20:31 -0700)]
of/platform: Fix sparc:allmodconfig build

sparc:allmodconfig fails to build with:

drivers/built-in.o: In function `platform_bus_init':
(.init.text+0x3684): undefined reference to `of_platform_register_reconfig_notifier'

of_platform_register_reconfig_notifier is only declared if both OF_ADDRESS
and OF_DYNAMIC are configured. Yet, the include file only declares a dummy
function if OF_DYNAMIC is not configured. The sparc architecture does not
configure OF_ADDRESS, but does configure OF_DYNAMIC, causing above error.

Fixes: 801d728c10db ("of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type")
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rob Herring <robh@kernel.org>
9 years agoALSA: hda - Don't access stereo amps for mono channel widgets
Takashi Iwai [Thu, 12 Mar 2015 07:30:11 +0000 (08:30 +0100)]
ALSA: hda - Don't access stereo amps for mono channel widgets

The current HDA generic parser initializes / modifies the amp values
always in stereo, but this seems causing the problem on ALC3229 codec
that has a few mono channel widgets: namely, these mono widgets react
to actions for both channels equally.

In the driver code, we do care the mono channel and create a control
only for the left channel (as defined in HD-audio spec) for such a
node.  When the control is updated, only the left channel value is
changed.  However, in the resume, the right channel value is also
restored from the initial value we took as stereo, and this overwrites
the left channel value.  This ends up being the silent output as the
right channel has been never touched and remains muted.

This patch covers the places where unconditional stereo amp accesses
are done and converts to the conditional accesses.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94581
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>