Re: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-25 Thread Michael S. Tsirkin
On Tue, Nov 25, 2014 at 12:43:24PM +0100, David Hildenbrand wrote: > I recently discovered that commit 662bbcb2747c2422cf98d3d97619509379eee466 > removed/skipped all might_sleep checks for might_fault() calls when in atomic. Yes. You can add e.g. might_sleep in your code if, for some reason, it i

Re: [PATCH v2 0/4] powernv: cpuidle: Redesign idle states management

2014-11-25 Thread Preeti U Murthy
Hi, I ran hackbench to evaluate this patchset and found good improvements in the results. I modified hackbench to take in a 'loops' parameter along with num_groups which ensures that the test runs long enough to observe and debug issues. The idea was to find out how latency sensitive workloads ca

Re: [V5 7/7] selftests, powerpc: Add test case for TM related ptrace interface

2014-11-25 Thread Anshuman Khandual
On 11/25/2014 10:36 PM, Shuah Khan wrote: > On 11/25/2014 01:05 AM, Anshuman Khandual wrote: >> > This patch adds one more test case called 'tm-ptrace' targeting TM >> > related ptrace interface. This test creates one child process to >> > run some basic TM transactions and the parent process attac

[PATCH] powerpc/powernv: Add debugfs file to grab opalv3 trace data

2014-11-25 Thread Benjamin Herrenschmidt
This adds files in debugfs that can be used to retrieve the OPALv3 firmware "live binary traces" which can then be parsed using a userspace tool. Mostly from Rusty with some updates by myself (BenH) Signed-off-by: Rusty Russell Signed-off-by: Benjamin Herrenschmidt --- Reworked from whatever a

Re: [3/3] powerpc/eeh: Fix missed PE#0 on P7IOC

2014-11-25 Thread Michael Ellerman
On Mon, 2014-24-11 at 22:27:00 UTC, Gavin Shan wrote: > PE#0 should be regarded as valid for P7IOC, while it's invalid for > PHB3. The patch adds flag EEH_VALID_PE_ZERO to differentiate those > two cases. Without the patch, we possibly see frozen PE#0 state is > cleared without EEH recovery taken o

Re: [2/3] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE

2014-11-25 Thread Michael Ellerman
On Mon, 2014-24-11 at 22:26:59 UTC, Gavin Shan wrote: > The flag passed to ioda_eeh_phb_reset() should be EEH_RESET_DEACTIVATE, > which is translated to OPAL_DEASSERT_RESET or something else by the > EEH backend accordingly. > > The patch replaces OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE for

Re: powerpc/powernv: Fix the hmi event version check.

2014-11-25 Thread Michael Ellerman
On Thu, 2014-20-11 at 04:14:36 UTC, Mahesh Salgaonkar wrote: > From: Mahesh Salgaonkar > > The current HMI event structure is an ABI and carries a version field to > accommodate future changes without affecting/rearranging current structure > members that are valid for previous versions. The curr

Re: pseries/le: Fix endiannes issue in RTAS call from xmon

2014-11-25 Thread Michael Ellerman
On Mon, 2014-24-11 at 14:07:53 UTC, Laurent Dufour wrote: > On pseries system (LPAR) xmon failed to enter when running in LE mode, system > is hunging. Inititating xmon will lead to such an output on the console: OK. You say "LPAR", by which you mean "under phyp" I think. I haven't seen this under

Re: [PATCH v2 07/14] of/reconfig: Always use the same structure for notifiers

2014-11-25 Thread Nathan Fontenot
On 11/25/2014 05:07 PM, Benjamin Herrenschmidt wrote: > On Mon, 2014-11-24 at 22:33 +, Grant Likely wrote: >> The OF_RECONFIG notifier callback uses a different structure depending >> on whether it is a node change or a property change. This is silly, and >> not very safe. Rework the code to us

RE: [PATCH] [v2] power/fsl: add MDIO dt binding for FMan

2014-11-25 Thread Shaohui Xie
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, November 26, 2014 9:50 AM > To: shh@gmail.com > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; Medve > Emilian-EMMEDVE1; Liberman Igal-B31950; Xie Shaohui-B21989 > Subject: Re: [PATCH] [v2] power/fsl: add

Re: [v4,17/21] powerpc/8xx: set PTE bit 22 off TLBmiss

2014-11-25 Thread Scott Wood
On Tue, 2014-11-18 at 21:07 +0100, christophe leroy wrote: > Le 08/11/2014 01:08, Scott Wood a écrit : > > > > OK, so the _PAGE_KERNEL_RO(X) stuff is because initially setting the PTE > > doesn't go through pte_update(). > > > > I'll apply this, though it'd be cleaner to just have 8xx versions of t

Re: [PATCH] [v2] power/fsl: add MDIO dt binding for FMan

2014-11-25 Thread Scott Wood
On Fri, 2014-11-14 at 17:53 +0800, shh@gmail.com wrote: > From: Shaohui Xie > > This binding is for FMan MDIO, it covers FMan v2 & FMan v3. > > Signed-off-by: Shaohui Xie > --- > changes in V2: > addressed comments from Scott in V1. > > .../devicetree/bindings/powerpc/fsl/fman.txt |

Re: [PATCH] i2c-qoriq: modified compatibility for correct prescaler

2014-11-25 Thread Scott Wood
On Tue, 2014-11-25 at 19:13 +0100, Wolfram Sang wrote: > On Mon, Nov 17, 2014 at 07:28:03PM -0600, Scott Wood wrote: > > On Fri, 2014-11-14 at 09:28 +0100, Wolfram Sang wrote: > > > > > > > > > > If we're going to change the device tree I'd rather just add a > > > > > property > > > > > to say wh

Re: [PATCH 1/8] powerpc/pci: Move pcibios_find_pci_bus() around

2014-11-25 Thread Benjamin Herrenschmidt
On Wed, 2014-11-26 at 11:08 +1100, Gavin Shan wrote: > On Wed, Nov 26, 2014 at 09:58:30AM +1100, Benjamin Herrenschmidt wrote: > >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > >> The patch moves pcibios_find_pci_bus() to PPC kerenl directory so > >> that it can be reused by hotplug code fo

Re: [PATCH 1/8] powerpc/pci: Move pcibios_find_pci_bus() around

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 09:58:30AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: >> The patch moves pcibios_find_pci_bus() to PPC kerenl directory so >> that it can be reused by hotplug code for pSeries and PowerNV >> platform at the same time. >> >> Si

Re: [PATCH v1 0/5] powerpc/pci: PCI slot unified reset

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 09:54:53AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:38 +1100, Gavin Shan wrote: >> The patchset corresponds to skiboot changes, which manages PCI slots >> in a unified way: OPAL APIs used to do slot reset, power management, >> presence status retrival.

Re: [PATCH 6/8] PCI/hotplug/rpa: Abstract slot operations

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 10:04:36AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: >> The patch splits the code into 2 parts: RPA PCI hotplug slot >> management and RTAS backend. It enables us to support PowerNV, >> which is built on top of OPAL firmware i

Re: [PATCH 4/8] PCI/hotplug/rpa: Code cleanup

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 10:02:31AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: >> The patch applies code cleanup to RPA modules to address following >> issues and it shouldn't affect the logic: >> >>* Coding style issue: removed unnecessary "break

Re: [PATCH 3/8] powerpc/powernv: Export functions to retrieve slot status

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 10:00:33AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: >> The patch exports two functions, which base on corresponding OPAL >> APIs to retrieve PCI slot status: >> >>pnv_pci_get_power_status() opal_pci_get_power_status(

Re: [PATCH 2/8] powerpc/pci: Don't scan empty slot

2014-11-25 Thread Gavin Shan
On Wed, Nov 26, 2014 at 09:58:02AM +1100, Benjamin Herrenschmidt wrote: >On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: >> In hotplug case, function pcibios_add_pci_devices() is called to >> rescan the specified PCI bus, which possibly doesn't have any child >> devices. Access to the PCI bus'

Re: [PATCH v2 07/14] of/reconfig: Always use the same structure for notifiers

2014-11-25 Thread Benjamin Herrenschmidt
On Mon, 2014-11-24 at 22:33 +, Grant Likely wrote: > The OF_RECONFIG notifier callback uses a different structure depending > on whether it is a node change or a property change. This is silly, and > not very safe. Rework the code to use the same data structure regardless > of the type of notif

Re: [PATCH 5/8] PCI/hotplug/rpa: Create PCI slot properly

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > When loading rpaphp.ko on a P7 box, I didn't see any PCI slots > created under /sys/bus/pci/slots as expected. It seems that the > RPA PCI slot stuff has been broken for long time. The driver > doesn't use the properties of PCI device-tree node

Re: [PATCH 6/8] PCI/hotplug/rpa: Abstract slot operations

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > The patch splits the code into 2 parts: RPA PCI hotplug slot > management and RTAS backend. It enables us to support PowerNV, > which is built on top of OPAL firmware in future. > > The patch also refactors the code for a bit: > > * Renam

Re: [PATCH 4/8] PCI/hotplug/rpa: Code cleanup

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > The patch applies code cleanup to RPA modules to address following > issues and it shouldn't affect the logic: > >* Coding style issue: removed unnecessary "break" for default case > in switch statement and added default case; removed

Re: [PATCH 3/8] powerpc/powernv: Export functions to retrieve slot status

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > The patch exports two functions, which base on corresponding OPAL > APIs to retrieve PCI slot status: > >pnv_pci_get_power_status() opal_pci_get_power_status() >pnv_pci_get_presence_status() opal_pci_get_presence_status() > > Sig

Re: [PATCH 1/8] powerpc/pci: Move pcibios_find_pci_bus() around

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > The patch moves pcibios_find_pci_bus() to PPC kerenl directory so > that it can be reused by hotplug code for pSeries and PowerNV > platform at the same time. > > Signed-off-by: Gavin Shan Acked-by: Benjamin Herrenschmidt > --- > arch/pow

Re: [PATCH 2/8] powerpc/pci: Don't scan empty slot

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:49 +1100, Gavin Shan wrote: > In hotplug case, function pcibios_add_pci_devices() is called to > rescan the specified PCI bus, which possibly doesn't have any child > devices. Access to the PCI bus's child device node will cause kernel > crash without exception. The patch a

Re: [PATCH v1 0/5] powerpc/pci: PCI slot unified reset

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 09:38 +1100, Gavin Shan wrote: > The patchset corresponds to skiboot changes, which manages PCI slots > in a unified way: OPAL APIs used to do slot reset, power management, > presence status retrival. The patchset shouldn't be merged before > the OPAL firmware counterpart is m

Re: [PATCH] powerpc: drop useless warning in eeh_init()

2014-11-25 Thread Gavin Shan
On Tue, Nov 25, 2014 at 05:10:06PM +0100, Greg Kurz wrote: >This is what we get in dmesg when booting a pseries guest and >the hypervisor doesn't provide EEH support. > >[0.166655] EEH functionality not supported >[0.166778] eeh_init: Failed to call platform init function (-22) > >Since bot

Re: [V5 7/7] selftests, powerpc: Add test case for TM related ptrace interface

2014-11-25 Thread Shuah Khan
On 11/25/2014 01:05 AM, Anshuman Khandual wrote: > This patch adds one more test case called 'tm-ptrace' targeting TM > related ptrace interface. This test creates one child process to > run some basic TM transactions and the parent process attaches the > child to do some ptrace probing using the r

Re: [PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-25 Thread Benjamin Herrenschmidt
On Tue, 2014-11-25 at 18:53 +0100, Wolfram Sang wrote: > On Sun, Nov 16, 2014 at 10:47:46PM +0530, Neelesh Gupta wrote: > > The patch exposes the available i2c busses on the PowerNV platform > > to the kernel and implements the bus driver to support i2c and > > smbus commands. > > The driver uses t

Re: [PATCH] i2c-qoriq: modified compatibility for correct prescaler

2014-11-25 Thread Wolfram Sang
On Mon, Nov 17, 2014 at 07:28:03PM -0600, Scott Wood wrote: > On Fri, 2014-11-14 at 09:28 +0100, Wolfram Sang wrote: > > > > > > > > If we're going to change the device tree I'd rather just add a property > > > > to say what the prescaler is. > > > > > > We would however, leave the boards' devic

Re: [PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-25 Thread Wolfram Sang
On Sun, Nov 16, 2014 at 10:47:46PM +0530, Neelesh Gupta wrote: > The patch exposes the available i2c busses on the PowerNV platform > to the kernel and implements the bus driver to support i2c and > smbus commands. > The driver uses the platform device infrastructure to probe the busses > on the pl

Re: [PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-25 Thread Wolfram Sang
On Tue, Nov 25, 2014 at 03:32:17PM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2014-11-24 at 13:18 +0100, Wolfram Sang wrote: > > > > I think there are now 3 drivers in my queue which are not fully I2C > > compatible but more supporting the very minimum to, say, read an > > eeprom. > > I am not

[PATCH] powerpc: drop useless warning in eeh_init()

2014-11-25 Thread Greg Kurz
This is what we get in dmesg when booting a pseries guest and the hypervisor doesn't provide EEH support. [0.166655] EEH functionality not supported [0.166778] eeh_init: Failed to call platform init function (-22) Since both powernv_eeh_init() and pseries_eeh_init() already complain when

[PATCH V3] powerpc, powernv: Add OPAL platform event driver

2014-11-25 Thread Anshuman Khandual
This patch creates a new OPAL platform event character driver which will give userspace clients the access to these events and process them effectively. Following platforms events are currently supported with this platform driver. (1) Environmental and Power Warning (EPOW) (2) Dela

Re: [PATCH 0/2] ASoC: fsl: Use dynamic slot width for ESAI.

2014-11-25 Thread Mark Brown
On Fri, Oct 24, 2014 at 04:48:10PM -0700, Nicolin Chen wrote: > This series of patches add the support of dynamic slot width for > ESAI driver. To do this, the PATCH-1 removes the fixed width. In > order not to break those platforms that use fixed width, there > comes the PATCH-2 to apply an overri

[RFC 2/2] mm, sched: trigger might_sleep() in might_fault() when atomic

2014-11-25 Thread David Hildenbrand
Commit 662bbcb2747c2422cf98d3d97619509379eee466 disabled in atomic checks for all user access code (that uses might_fault()). That change basically disabled CONFIG_DEBUG_ATOMIC_SLEEP for all user access functions. However, this is a mighty debugging aid that we want. If user memory is to be acces

[RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-25 Thread David Hildenbrand
I recently discovered that commit 662bbcb2747c2422cf98d3d97619509379eee466 removed/skipped all might_sleep checks for might_fault() calls when in atomic. Reason was to allow calling copy_(to|from)_user while in pagefault_disabled(), because otherwise, CONFIG_DEBUG_ATOMIC_SLEEP would find false pos

[RFC 1/2] powerpc/fsl-pci: atomic get_user when pagefault_disabled

2014-11-25 Thread David Hildenbrand
Whenever we have pagefaults disabled, we have to use the atomic variants of (set|get)_user and copy_(from|to)_user. Signed-off-by: David Hildenbrand --- arch/powerpc/sysdev/fsl_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/

[PATCH v2 3/4] powernv: cpuidle: Redesign idle states management

2014-11-25 Thread Shreyas B. Prabhu
Deep idle states like sleep and winkle are per core idle states. A core enters these states only when all the threads enter either the particular idle state or a deeper one. There are tasks like fastsleep hardware bug workaround and hypervisor core state save which have to be done only by the last

[PATCH v2 4/4] powernv: powerpc: Add winkle support for offline cpus

2014-11-25 Thread Shreyas B. Prabhu
Winkle is a deep idle state supported in power8 chips. A core enters winkle when all the threads of the core enter winkle. In this state power supply to the entire chiplet i.e core, private L2 and private L3 is turned off. As a result it gives higher powersavings compared to sleep. But entering wi

[PATCH v2 2/4] powerpc/powernv: Enable Offline CPUs to enter deep idle states

2014-11-25 Thread Shreyas B. Prabhu
From: "Preeti U. Murthy" The secondary threads should enter deep idle states so as to gain maximum powersavings when the entire core is offline. To do so the offline path must be made aware of the available deepest idle state. Hence probe the device tree for the possible idle states in powernv co

[PATCH v2 1/4] powerpc: powernv: Switch off MMU before entering nap/sleep/rvwinkle mode

2014-11-25 Thread Shreyas B. Prabhu
From: Paul Mackerras Currently, when going idle, we set the flag indicating that we are in nap mode (paca->kvm_hstate.hwthread_state) and then execute the nap (or sleep or rvwinkle) instruction, all with the MMU on. This is bad for two reasons: (a) the architecture specifies that those instructi

[PATCH v2 0/4] powernv: cpuidle: Redesign idle states management

2014-11-25 Thread Shreyas B. Prabhu
Deep idle states like sleep and winkle are per core idle states. A core enters these states only when all the threads enter either the particular idle state or a deeper one. There are tasks like fastsleep hardware bug workaround and hypervisor core state save which have to be done only by the last

[RESEND PATCH V3] powerpc, xmon: Enable HW instruction breakpoint on POWER8

2014-11-25 Thread Anshuman Khandual
This patch enables support for hardware instruction breakpoints on POWER8 with the help of a new register CIABR (Completed Instruction Address Breakpoint Register). With this patch, single hardware instruction breakpoint can be added and cleared during any active xmon debug session. This hardware b

Re: [PATCH V9 08/18] powrepc/pci: Refactor pci_dn

2014-11-25 Thread Wei Yang
On Fri, Nov 21, 2014 at 11:04:11AM +1100, Gavin Shan wrote: >>> 2.4 The potential problem for [Patch 08/18] >>> === >>> According to the SPEC, the offset/stride will change after each >>> sriov_enable(). This means the bus/

[V5 3/7] powerpc, ptrace: Enable fpr_(get/set) for transactional memory

2014-11-25 Thread Anshuman Khandual
This patch enables the fpr_get which gets the running value of all the FPR registers and the fpr_set which sets the running value of of all the FPR registers to accommodate in transaction ptrace interface based requests. Signed-off-by: Anshuman Khandual --- arch/powerpc/kernel/ptrace.c | 103 +++

[V5 7/7] selftests, powerpc: Add test case for TM related ptrace interface

2014-11-25 Thread Anshuman Khandual
This patch adds one more test case called 'tm-ptrace' targeting TM related ptrace interface. This test creates one child process to run some basic TM transactions and the parent process attaches the child to do some ptrace probing using the recently added regset interfaces. The parent process then

[V5 6/7] powerpc, ptrace: Enable support for miscellaneous debug registers

2014-11-25 Thread Anshuman Khandual
This patch enables get and set of miscellaneous debug registers through ptrace PTRACE_GETREGSET-PTRACE_SETREGSET interface by implementing new powerpc specific register set REGSET_MISC support corresponding to the new ELF core note NT_PPC_MISC added previously in this regard. Signed-off-by: Anshum

[V5 5/7] powerpc, ptrace: Enable support for transactional memory register sets

2014-11-25 Thread Anshuman Khandual
This patch enables get and set of transactional memory related register sets through PTRACE_GETREGSET-PTRACE_SETREGSET interface by implementing four new powerpc specific register sets i.e REGSET_TM_SPR, REGSET_TM_CGPR, REGSET_TM_CFPR, REGSET_CVMX support corresponding to these following new ELF co

[V5 4/7] powerpc, ptrace: Enable vr_(get/set) for transactional memory

2014-11-25 Thread Anshuman Khandual
This patch enables the vr_get which gets the running value of all the VMX registers and the vr_set which sets the running value of of all the VMX registers to accommodate in transaction ptrace interface based requests. Signed-off-by: Anshuman Khandual --- arch/powerpc/kernel/ptrace.c | 94 ++

[V5 2/7] powerpc, process: Add the function flush_tmregs_to_thread

2014-11-25 Thread Anshuman Khandual
This patch creates a function flush_tmregs_to_thread which will then be used by subsequent patches in this series. The function checks for self tracing ptrace interface attempts while in the TM context and logs appropriate warning message. Signed-off-by: Anshuman Khandual --- arch/powerpc/includ

[V5 1/7] elf: Add new powerpc specifc core note sections

2014-11-25 Thread Anshuman Khandual
This patch adds four new ELF core note sections for powerpc transactional memory and one new ELF core note section for powerpc general miscellaneous debug registers. These addition of new ELF core note sections extends the existing ELF ABI without affecting it in any manner. Acked-by: Andrew Morto

[V5 0/7] Add new powerpc specific ELF core notes

2014-11-25 Thread Anshuman Khandual
This patch series adds five new ELF core note sections which can be used with existing ptrace request PTRACE_GETREGSET-SETREGSET for accessing various transactional memory and miscellaneous debug register sets on powerpc platform. Previous versions: == RFC: https://lkml.org