Pull request: scottwood/linux.git next

2018-01-21 Thread Scott Wood
Contains fixes for CPM GPIO and an FSL PCI erratum workaround, plus a minor cleanup patch. The following changes since commit f2ac428e0edabbca41b9dfe9473a90147962e4e9: powerpc/pseries/cpuidle: add polling idle for shared processor guests (2018-01-18 15:43:44 +1100) are available in the git re

Re: [PATCH v10 01/27] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled

2018-01-21 Thread Aneesh Kumar K.V
Ram Pai writes: > VM_PKEY_BITx are defined only if CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS > is enabled. Powerpc also needs these bits. Hence lets define the > VM_PKEY_BITx bits for any architecture that enables > CONFIG_ARCH_HAS_PKEYS. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Ram Pai

[RFC PATCH v2 0/1] of: easier debugging for node life cycle issues

2018-01-21 Thread Wolfram Sang
I got a bug report for a DT node refcounting problem in the I2C subsystem. This patch was a huge help in validating the bug report and the proposed solution. So, I thought I bring it to attention again. Thanks Tyrel, for the initial work! Note that I did not test the dynamic updates, only of_node_

[RFC PATCH v2 1/1] of: introduce event tracepoints for dynamic device_node lifecyle

2018-01-21 Thread Wolfram Sang
From: Tyrel Datwyler This patch introduces event tracepoints for tracking a device_nodes reference cycle as well as reconfig notifications generated in response to node/property manipulations. With the recent upstreaming of the refcount API several device_node underflows and leaks have come to m

Re: [RFC PATCH v2 1/1] of: introduce event tracepoints for dynamic device_node lifecyle

2018-01-21 Thread Steven Rostedt
On Sun, 21 Jan 2018 15:31:17 +0100 Wolfram Sang wrote: > From: Tyrel Datwyler > > This patch introduces event tracepoints for tracking a device_nodes > reference cycle as well as reconfig notifications generated in response > to node/property manipulations. > > With the recent upstreaming of t

Re: powerpc: Use octal numbers for file permissions

2018-01-21 Thread Michael Ellerman
On Thu, 2017-01-12 at 03:54:13 UTC, Russell Currey wrote: > Symbolic macros are unintuitive and hard to read, whereas octal constants > are much easier to interpret. Replace macros for the basic permission > flags (user/group/other read/write/execute) with numeric constants > instead, across the w

Re: powerpc/pseries: Don't give a warning when HPT resizing isn't available

2018-01-21 Thread Michael Ellerman
On Fri, 2017-03-17 at 01:11:19 UTC, David Gibson wrote: > As of 438cc81a41 "powerpc/pseries: Automatically resize HPT for memory hot > add/remove" when running on the pseries platform, we always attempt to > use the PAPR extension to resize the hashed page table (HPT) when we add > or remove memory

Re: [v3, 3/6] dt: booting-without-of: DT fix s/#interrupt-cell/#interrupt-cells/

2018-01-21 Thread Michael Ellerman
On Fri, 2017-06-02 at 12:38:46 UTC, Geert Uytterhoeven wrote: > Signed-off-by: Geert Uytterhoeven > Acked-by: Rob Herring Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/4be4119d1fbd93c44d5c639735c312 cheers

Re: powerpc: Expose TSCR via sysfs

2018-01-21 Thread Michael Ellerman
On Thu, 2017-09-07 at 17:11:12 UTC, Anton Blanchard wrote: > From: Anton Blanchard > > The thread switch control register (TSCR) is a per core register > that configures how the CPU shares resources between SMT threads. > > Exposing it via sysfs allows us to tune it at run time. > > Signed-off-

Re: selftests/powerpc: Add alignment handler selftest

2018-01-21 Thread Michael Ellerman
On Mon, 2017-10-16 at 05:04:02 UTC, Andrew Donnellan wrote: > Add a selftest to exercise the powerpc alignment fault handler. > > Signed-off-by: Michael Neuling > Signed-off-by: Andrew Donnellan Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/8d1915873d492b8e1f03bbcab527db c

Re: powerpc/perf: Change the data type for the variable 'ncpu' in IMC code

2018-01-21 Thread Michael Ellerman
On Tue, 2017-10-31 at 09:52:00 UTC, Anju T Sudhakar wrote: > Change the data type for the variable 'ncpu' in ppc_core_imc_cpu_offline(), > since cpumask_any_but() returns an 'int' value. > > Signed-off-by: Anju T Sudhakar > Reported-by: David Binderman Applied to powerpc next, thanks. https://

Re: powerpc/watchdog: improve watchdog comments

2018-01-21 Thread Michael Ellerman
On Wed, 2017-11-01 at 00:27:33 UTC, Nicholas Piggin wrote: > The overview comments in the powerpc watchdog are out of date after > several iterations and changes of the code. Bring them up to date. > > Signed-off-by: Nicholas Piggin Applied to powerpc next, thanks. https://git.kernel.org/powerp

Re: powerpc/mm: Remove unused flag arg in global_invalidates

2018-01-21 Thread Michael Ellerman
On Mon, 2017-11-06 at 12:27:44 UTC, "Aneesh Kumar K.V" wrote: > Signed-off-by: Aneesh Kumar K.V Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/76b03dc07eebe9c8829bc4c40ae357 cheers

Re: [1/4] powerpc: define __ARCH_IRQ_EXIT_IRQS_DISABLED

2018-01-21 Thread Michael Ellerman
On Thu, 2017-11-16 at 16:00:49 UTC, Nicholas Piggin wrote: > powerpc calls irq_exit() with local irqs disabled, therefore it > can define __ARCH_IRQ_EXIT_IRQS_DISABLED. > > Signed-off-by: Nicholas Piggin Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/c16bee4bded5449ec3b3ec735

Re: [3/4] cpuidle/powernv: avoid double irq enable coming out of idle

2018-01-21 Thread Michael Ellerman
On Thu, 2017-11-16 at 16:00:51 UTC, Nicholas Piggin wrote: > Since e1689795a7 ("cpuidle: Add common time keeping and irq enabling"), > cpuidle drivers are expected to return from ->enter with irqs disabled. > > Update the cpuidle-powernv snooze loop to disable irqs before returning. > > Signed-of

Re: [4/4] cpuidle/powernv: avoid double irq enable coming out of idle

2018-01-21 Thread Michael Ellerman
On Thu, 2017-11-16 at 16:00:52 UTC, Nicholas Piggin wrote: > Since e1689795a7 ("cpuidle: Add common time keeping and irq enabling"), > cpuidle drivers are expected to return from ->enter with irqs disabled. > > Update the cpuidle-powernv snooze and cede loops to disable irqs before > returning. >

Re: [v3] powerpc/powernv: Add ppc_pci_reset_phbs parameter to issue a PHB reset

2018-01-21 Thread Michael Ellerman
On Fri, 2017-11-17 at 18:58:59 UTC, "Guilherme G. Piccoli" wrote: > During a kdump kernel boot in PowerPC, we request a reset of the PHBs > to the FW. It makes sense, since if we are booting a kdump kernel it > means we had some trouble before and we cannot rely in the adapters' > health; they coul

Re: [1/2] powerpc/lib/code-patching: refactor patch_instruction()

2018-01-21 Thread Michael Ellerman
On Fri, 2017-11-24 at 07:31:07 UTC, Christophe Leroy wrote: > patch_instruction() uses almost the same sequence as > __patch_instruction() > > This patch refactor it so that patch_instruction() uses > __patch_instruction() instead of duplicating code. > > Signed-off-by: Christophe Leroy > Acked-

Re: powerpc/hash: Skip non initialized page size in init_hpte_page_sizes

2018-01-21 Thread Michael Ellerman
On Tue, 2017-11-28 at 08:34:40 UTC, "Aneesh Kumar K.V" wrote: > One of the easiest way to test config with 4K HPTE is to disable 64K hardware > page size like below. > > int __init htab_dt_scan_page_sizes(unsigned long node, > > size -= 3; prop += 3; > base_idx = get_i

Re: selftest/powerpc: Add additional option to mmap_bench test

2018-01-21 Thread Michael Ellerman
On Tue, 2017-11-28 at 08:36:39 UTC, "Aneesh Kumar K.V" wrote: > This patch adds --pgfault and --iterations options to mmap_bench test. With > --pgfault we touch every page mapped. This helps in measuring impact in the > page fault path with a patch series. > > Signed-off-by: Aneesh Kumar K.V App

Re: powerpc/radix: Remove trace_tlbie call from radix__flush_tlb_all

2018-01-21 Thread Michael Ellerman
On Thu, 2017-11-30 at 09:05:54 UTC, Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > radix__flush_tlb_all() is called only in kexec path in real mode and any > tracepoints at this stage will make kexec to fail if enabled. > > To verify enable tlbie trace before kexec. > > $ echo 1 > /sy

Re: [V6, 1/4] powerpc/firmware: Add definitions for new drc-info firmware feature

2018-01-21 Thread Michael Ellerman
On Fri, 2017-12-01 at 23:19:40 UTC, Michael Bringmann wrote: > Firmware Features: Define new bit flag representing the presence of > new device tree property "ibm,drc-info". The flag is used to tell > the front end processor whether the Linux kernel supports the new > property, and by the front en

Re: [V2] powerpc/mm: Invalidate subpage_prot() system call on radix platforms

2018-01-21 Thread Michael Ellerman
On Mon, 2017-12-04 at 05:49:22 UTC, Anshuman Khandual wrote: > Radix enabled platforms don't support subpage_prot() system calls. But > at present the system call goes through without an error and fails > later on while validating expected subpage accesses. Lets not allow > the system call on power

Re: [1/3] powerpc/perf: Remove thread_imc_pmu global variable from

2018-01-21 Thread Michael Ellerman
On Mon, 2017-12-11 at 05:58:35 UTC, Anju T Sudhakar wrote: > Remove the global variable 'thread_imc_pmu', since it is not used in the code. > > Signed-off-by: Anju T Sudhakar > Reviewed-by: madhavan Srinivasan Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/e7673818d95

Re: [v2] platform/powernv: Add debugfs interface for imc-mode and imc-command

2018-01-21 Thread Michael Ellerman
On Wed, 2017-12-13 at 06:09:54 UTC, Anju T Sudhakar wrote: > In memory Collection (IMC) counter pmu driver controls the ucode's execution > state. At the system boot, IMC perf driver pause the ucode. Ucode state is > changed to "running" only when any of the nest units are monitored or profiled > u

Re: powerpc: dts: Remove leading 0x and 0s from bindings notation

2018-01-21 Thread Michael Ellerman
On Thu, 2017-12-14 at 16:54:00 UTC, Mathieu Malaterre wrote: > Improve the DTS files by removing all the leading "0x" and zeros to fix the > following dtc warnings: > > Warning (unit_address_format): Node /XXX unit name should not have leading > "0x" > > and > > Warning (unit_address_format): N

Re: powerpc/pseries/cpuidle: add polling idle for shared processor guests

2018-01-21 Thread Michael Ellerman
On Tue, 2017-10-10 at 07:11:09 UTC, Nicholas Piggin wrote: > For shared processor guests (e.g., KVM), add an idle polling mode rather > than immediately returning to the hypervisor when the guest CPU goes > idle. > > Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs > equal to

Re: [1/9] powerpc/powernv: Remove real mode access limit for early allocations

2018-01-21 Thread Michael Ellerman
On Fri, 2017-12-22 at 11:17:08 UTC, Nicholas Piggin wrote: > This removes the RMA limit on powernv platform, which constrains > early allocations such as PACAs and stacks. There are still other > restrictions that must be followed, such as bolted SLB limits, but > real mode addressing has no constr

Re: [v10, 02/17] powerpc/64: Add #defines for paca->soft_enabled flags

2018-01-21 Thread Michael Ellerman
On Wed, 2017-12-20 at 03:55:42 UTC, Madhavan Srinivasan wrote: > Two #defines, IRQ_ENABLED and IRQ_DISABLED, are added to be used when > updating paca->soft_enabled. Replace the hardcoded values used when > updating paca->soft_enabled with IRQ_[EN/DIS]ABLED. No logic change. > > Signed-off-by: Mad

Re: [v3] powerpc/64s: Improve local TLB flush for boot and MCE on POWER9

2018-01-21 Thread Michael Ellerman
On Sat, 2017-12-23 at 15:15:50 UTC, Nicholas Piggin wrote: > There are several cases outside the normal address space management > where a CPU's entire local TLB is to be flushed: > > 1. Booting the kernel, in case something has left stale entries in > the TLB (e.g., kexec). > > 2. Machi

Re: [1/2] powerpc: System reset avoid interleaving oops using die synchronisation

2018-01-21 Thread Michael Ellerman
On Sat, 2017-12-23 at 16:49:22 UTC, Nicholas Piggin wrote: > The die() oops path contains a serializing lock to prevent oops > messages from being interleaved. In the case of a system reset > initiated oops (e.g., qemu nmi command), __die was being called > which lacks that synchronisation and oops

Re: powerpc/xive: Properly use static keyword for inline function

2018-01-21 Thread Michael Ellerman
On Tue, 2017-12-26 at 13:00:17 UTC, Mathieu Malaterre wrote: > Fix fatal warning during compilation: > > In file included from arch/powerpc/xmon/xmon.c:54:0: > ./arch/powerpc/include/asm/xive.h:157:20: error: no previous prototype for > ‘xive_smp_prepare_cpu’ [-Werror=missing-prototypes] > e

Re: powerpc/xmon: Do not compute/store the major opcode

2018-01-21 Thread Michael Ellerman
On Tue, 2017-12-26 at 13:25:47 UTC, Mathieu Malaterre wrote: > In commit 5b102782c7f4 ("powerpc/xmon: Enable disassembly files (compilation > changes)") usage of variable `op` has been removed. Completely remove opcode > computation since not used anymore. > > Fix fatal warning: > > arch/powerpc/

Re: [1/2] powerpc: Fix old-style function definition

2018-01-21 Thread Michael Ellerman
On Tue, 2017-12-26 at 14:12:33 UTC, Mathieu Malaterre wrote: > Fix warnings such as: > > arch/powerpc/platforms/powermac/backlight.c: In function > ‘pmac_backlight_get_legacy_brightness’: > arch/powerpc/platforms/powermac/backlight.c:189:5: error: old-style function > definition [-Werror=old

Re: [1/2] powerpc/tm: Fix endianness flip on trap

2018-01-21 Thread Michael Ellerman
On Sun, 2017-12-31 at 23:20:45 UTC, Gustavo Romero wrote: > Currently it's possible that a thread on PPC64 LE has its endianness > flipped inadvertently to Big-Endian resulting in a crash once the process > is back from the signal handler. > > If giveup_all() is called when regs->msr has the bits

Re: [V7] cxl: Add support for ASB_Notify on POWER9

2018-01-21 Thread Michael Ellerman
On Thu, 2018-01-11 at 08:55:25 UTC, Christophe Lombard wrote: > The POWER9 core supports a new feature: ASB_Notify which requires the > support of the Special Purpose Register: TIDR. > > The ASB_Notify command, generated by the AFU, will attempt to > wake-up the host thread identified by the parti

Re: powerpc: restore alphabetic order in Kconfig

2018-01-21 Thread Michael Ellerman
On Thu, 2018-01-04 at 15:35:25 UTC, Christophe Leroy wrote: > This patch restores the alphabetic order which was broken by > commit 1e0fc9d1eb2b0 ("powerpc/Kconfig: Enable STRICT_KERNEL_RWX > for some configs") > > Fixes: 1e0fc9d1eb2b0 ("powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some > config

Re: [1/2] powerpc/xive: Move definition of ESB bits

2018-01-21 Thread Michael Ellerman
On Fri, 2018-01-12 at 02:39:27 UTC, Benjamin Herrenschmidt wrote: > >From xive.h to xive-regs.h since it's a HW register definition > and it can be used from assembly > > Signed-off-by: Benjamin Herrenschmidt Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/12c1f339cd491

Re: [4/6] KVM: PPC: Book3S HV: Improve handling of debug-trigger HMIs on POWER9

2018-01-21 Thread Michael Ellerman
On Wed, 2018-01-17 at 09:51:13 UTC, Paul Mackerras wrote: > Hypervisor maintenance interrupts (HMIs) are generated by various > causes, signalled by bits in the hypervisor maintenance exception > register (HMER). In most cases calling OPAL to handle the interrupt > is the correct thing to do, but

Re: [RESEND] powerpc: mpic_timer: avoid struct timeval

2018-01-21 Thread Michael Ellerman
On Tue, 2018-01-16 at 17:01:50 UTC, Arnd Bergmann wrote: > In an effort to remove all instances of 'struct timeval' > from the kernel, I'm changing the powerpc mpic_timer interface > to use plain seconds instead. There is only one user of this > interface, and that doesn't use the microseconds port

Re: [RESEND] spufs: use timespec64 for timestamps

2018-01-21 Thread Michael Ellerman
On Tue, 2018-01-16 at 17:00:35 UTC, Arnd Bergmann wrote: > The switch log prints the tv_sec portion of timespec as a 32-bit > number, while overflows in 2106. It also uses the timespec type, > which is safe on 64-bit architectures, but deprecated because > it causes overflows in 2038 elsewhere. >

Re: [kernel] powerpc/powernv/ioda: Finish removing explicit max window size check

2018-01-21 Thread Michael Ellerman
On Thu, 2018-01-18 at 02:51:03 UTC, Alexey Kardashevskiy wrote: > 9003a2498 removed checn from the DMA window pages allocator, however > the VFIO driver tests limits before doing so by calling > the get_table_size hook which was left behind; this fixes it. > > Fixes: 9003a2498 "powerpc/powernv/iod

Re: powerpc/watchdog: remove arch_trigger_cpumask_backtrace

2018-01-21 Thread Michael Ellerman
On Wed, 2018-01-17 at 12:47:22 UTC, Nicholas Piggin wrote: > The powerpc NMI IPIs may not be recoverable if they are taken in > some sections of code, and also there have been and still are issues > with taking NMIs (in KVM guest code, in firmware, etc) which makes them > a bit dangerous to use. >

Re: [v10,03/27] powerpc: initial pkey plumbing

2018-01-21 Thread Michael Ellerman
On Fri, 2018-01-19 at 01:50:24 UTC, Ram Pai wrote: > Basic plumbing to initialize the pkey system. > Nothing is enabled yet. A later patch will enable it > once all the infrastructure is in place. > > Signed-off-by: Ram Pai Patches 3-27 applied to powerpc next, thanks. https://git.kerne

Re: powerpc/64s: Fix ps3 build error due to tlbiel_all()

2018-01-21 Thread Michael Ellerman
On Fri, 2018-01-19 at 08:55:31 UTC, Michael Ellerman wrote: > The recent changes to TLB handling broke the PS3 build: > > arch/powerpc/include/asm/book3s/64/tlbflush.h:30: undefined reference to > `.hash__tlbiel_all' > > Fix it by adding an fallback version of tlbiel_all() for non-native > bui

Re: [PATCH 02/13] powerpc/powernv: Set correct configuration space size for opencapi devices

2018-01-21 Thread Andrew Donnellan
On 20/01/18 20:52, Michael Ellerman wrote:> On my Power8 PowerVM LPAR: Will fix... -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Australia Limited

[PATCH v2 0/6] Nintendo Wii GPIO driver

2018-01-21 Thread Jonathan Neuschäfer
This series adds a driver for the GPIO controller used in the Nintendo Wii game console. The driver itself, and the related devicetree work should be pretty uncontroversial, but due to the system architecture of the Wii, I also had to extend an old resource allocation hack to kernel/resource.c: On

[PATCH v2 3/6] gpio: Add GPIO driver for Nintendo Wii

2018-01-21 Thread Jonathan Neuschäfer
The Nintendo Wii's chipset (called "Hollywood") has a GPIO controller that supports a configurable number of pins (up to 32), interrupts, and some special mechanisms to share the controller between the system's security processor (an ARM926) and the PowerPC CPU. Pin multiplexing is not supported.

[PATCH v2 6/6] powerpc: wii.dts: Add GPIO line names

2018-01-21 Thread Jonathan Neuschäfer
These are the GPIO line names on a Nintendo Wii, as documented in: https://wiibrew.org/wiki/Hardware/Hollywood_GPIOs Signed-off-by: Jonathan Neuschäfer --- v2: - no change --- arch/powerpc/boot/dts/wii.dts | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts

[PATCH v2 1/6] resource: Extend the PPC32 reserved memory hack

2018-01-21 Thread Jonathan Neuschäfer
On the Nintendo Wii, there are two ranges of physical memory, and MMIO in between, but Linux on ppc32 doesn't support discontiguous memory. Therefore a hack was introduced in commit c5df7f775148 ("powerpc: allow ioremap within reserved memory regions") and commit de32400dd26e ("wii: use both mem1 a

[PATCH v2 2/6] powerpc: wii: Explicitly configure GPIO owner for poweroff pin

2018-01-21 Thread Jonathan Neuschäfer
The Hollywood chipset's GPIO controller has two sets of registers: One for access by the PowerPC CPU, and one for access by the ARM coprocessor (but both are accessible from the PPC because the memory firewall (AHBPROT) is usually disabled when booting Linux, today). The wii_power_off function cur

[PATCH v2 4/6] dt-bindings: gpio: Add binding for Wii GPIO controller

2018-01-21 Thread Jonathan Neuschäfer
The Nintendo Wii game console has a GPIO controller, which is used for the optical disk slot LED, buttons, poweroff, etc. This patch adds a binding for this GPIO controller. Signed-off-by: Jonathan Neuschäfer Reviewed-by: Rob Herring --- v2: - Drop the leading zero in the example, as suggested

[PATCH v2 5/6] powerpc: wii.dts: Add ngpios property

2018-01-21 Thread Jonathan Neuschäfer
The Hollywood GPIO controller supports 32 GPIOs, but on the Wii, only 24 are used. Signed-off-by: Jonathan Neuschäfer --- v2: - no change --- arch/powerpc/boot/dts/wii.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index 40b

Re: [PATCH v2 1/5] powerpc/mm: Enhance 'slice' for supporting PPC32

2018-01-21 Thread Christophe LEROY
Le 20/01/2018 à 18:56, Segher Boessenkool a écrit : Hi! On Sat, Jan 20, 2018 at 09:22:50AM +0100, christophe leroy wrote: On PPC32, the address space is limited to 4Gbytes, hence only the low slices will be used. As of today, the code uses SLICE_LOW_TOP (0x1ul) and compares it with ad