[v3 PATCH 1/3] powernv-cpufreq: Add helper to extract pstate from PMSR

2017-12-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On POWERNV platform, the fields for pstates in the Power Management Status Register (PMSR) and the Power Management Control Register (PMCR) are 8-bits wide. On POWER8 the pstates are negatively numbered while on POWER9 they are positively

[v3 PATCH 2/3] powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous pstates

2017-12-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The code in powernv-cpufreq, makes the following two assumptions which are not guaranteed by the device-tree bindings: 1) Pstate ids are continguous: This is used in pstate_to_idx() to obtain the reverse map from a pstate to it's

[v3 PATCH 0/3] powernv-cpufreq: Multiple pstate related fixes.

2017-12-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" This is a third version of the patch to fix pstate related issues in the powernv-cpufreq driver. The previous versions can be found here: [v2]: https://lkml.org/lkml/2017/12/7/1562 [v1]: https://lkml.org/lkml/2017/11/29/1338 On POWERNV

[v3 PATCH 3/3] powernv-cpufreq: Treat pstates as opaque 8-bit values

2017-12-12 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On POWER8 and POWER9, the PMSR and the PMCR registers define pstates to be 8-bit wide values. The device-tree exports pstates as 32-bit wide values of which the lower byte is the actual pstate. The current implementation in the kernel treats

Re: [PATCH 2/3] powerpc/perf: IMC code cleanup with some code refactoring

2017-12-12 Thread Madhavan Srinivasan
On Monday 11 December 2017 11:28 AM, Anju T Sudhakar wrote: Factor out memory freeing part for attribute elements from imc_common_cpuhp_mem_free(). Looks good to me. Reviewed-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar ---

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

2017-12-12 Thread Madhavan Srinivasan
On Monday 11 December 2017 11:28 AM, Anju T Sudhakar wrote: Remove the global variable 'thread_imc_pmu', since it is not used in the code. Reviewed-by: madhavan Srinivasan Maddy Signed-off-by: Anju T Sudhakar ---

Re: [PATCH] powerpc/perf: Fix kfree memory allocated for nest pmus

2017-12-12 Thread Madhavan Srinivasan
On Thursday 07 December 2017 10:53 PM, Anju T Sudhakar wrote: imc_common_cpuhp_mem_free() is the common function for all IMC (In-memory Collection counters) domains to unregister cpuhotplug callback and free memory. Since kfree of memory allocated for nest-imc (per_nest_pmu_arr) is in the

[PATCH v2 11/11] ASoC: fsl_ssi: Define ternary macros to simplify code

2017-12-12 Thread Nicolin Chen
Some regmap code looks redudant. So simplify it. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 27 +++ sound/soc/fsl/fsl_ssi.h | 4 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH v2 10/11] ASoC: fsl_ssi: Rename i2smode to i2s_net

2017-12-12 Thread Nicolin Chen
Since this i2smode also includes the setting of Network mode, it should have it in the name. This patch also adds its MASK define. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 24 sound/soc/fsl/fsl_ssi.h | 1 + 2 files changed, 13

[PATCH v2 09/11] ASoC: fsl_ssi: Replace fsl_ssi_rxtx_reg_val with fsl_ssi_regvals

2017-12-12 Thread Nicolin Chen
The name fsl_ssi_rxtx_reg_val is too long to read comfortably. So this patch shortens it by using an array (fsl_ssi_regvals, renamed from fsl_ssi_reg_val). To do that, it also introduces two macros (TX and RX) to replace the wrapper structure. This will also help further cleanups. Meanwhile, it

[PATCH v2 08/11] ASoC: fsl_ssi: Rename scr_val to scr

2017-12-12 Thread Nicolin Chen
Simplify the variable name. This reduces one over-80-character line. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index

[PATCH v2 07/11] ASoC: fsl_ssi: Rename cpu_dai parameter to dai

2017-12-12 Thread Nicolin Chen
Shortens the variable name to save space, useful for dev_err outputs. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH v2 06/11] ASoC: fsl_ssi: Refine printk outputs

2017-12-12 Thread Nicolin Chen
This patches unifies the error message in the "failed to " format. It also reduces the length of one line and adds spaces to an operator. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 16 1 file changed, 8 insertions(+), 8 deletions(-)

[PATCH v2 05/11] ASoC: fsl_ssi: Refine indentations and wrappings

2017-12-12 Thread Nicolin Chen
This patch just simply unifies the coding style. Signed-off-by: Nicolin Chen --- Changelog v1->v2 * Added two missing indentation changes * Removed two extra blank lines. sound/soc/fsl/fsl_ssi.c | 239 +---

[PATCH v2 04/11] ASoC: fsl_ssi: Rename registers and fields macros

2017-12-12 Thread Nicolin Chen
This patch renames CCSR_SSI_xxx to REG_SSI_xxx and SSI_xxx_yyy style. It also slightly reduces the length of them to save some space. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 374 +-- sound/soc/fsl/fsl_ssi.h

[PATCH v2 03/11] ASoC: fsl_ssi: Refine all comments

2017-12-12 Thread Nicolin Chen
This patch refines the comments by: 1) Removing all out-of-date comments 2) Removing all not-so-useful comments 3) Unifying the styles of all comments 4) Simplifying over-descriptive comments 5) Adding comments to improve code readablity 6) Moving all register related comments to fsl_ssi.h 7)

[PATCH v2 02/11] ASoC: fsl_ssi: Cache pdev->dev pointer

2017-12-12 Thread Nicolin Chen
There should be no trouble to understand dev = pdev->dev. This can save some space to have more print info or save some wrapped lines. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 64 - 1 file changed, 31

[PATCH v2 01/11] ASoC: fsl_ssi: Rename fsl_ssi_private to fsl_ssi

2017-12-12 Thread Nicolin Chen
Shorten the private data structure to save some wrapped lines. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_ssi.c | 456 +++- 1 file changed, 220 insertions(+), 236 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c

[PATCH v2 00/11] ASoC: fsl_ssi: Clean up - coding style level

2017-12-12 Thread Nicolin Chen
==Changelog== v1->v2 * Dropped one patch to remove "struct device" * Revised PATCH-03 "Refine all comments" * Revised PATCH-05 "Refine indentations and wrappings" * Rebased all other patches * Added PATCH-10 "Rename i2smode to i2s_net" * Added PATCH-11 "Define ternary macros to simplify

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

2017-12-12 Thread Anju T Sudhakar
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 using perf tool.

Re: [PATCH 00/10] ASoC: fsl_ssi: Clean up - coding style level

2017-12-12 Thread Nicolin Chen
On Mon, Dec 04, 2017 at 12:46:33PM -0800, Nicolin Chen wrote: > Nicolin Chen (10): > ASoC: fsl_ssi: Remove unused struct device > ASoC: fsl_ssi: Rename fsl_ssi_private to fsl_ssi > ASoC: fsl_ssi: Cache pdev->dev pointer > ASoC: fsl_ssi: Refine all comments > ASoC: fsl_ssi: Rename

Re: Getting kernel 4.14 to run on PS3

2017-12-12 Thread Geoff Levand
Hi Nathan, On 12/08/2017 01:25 PM, Nathan Whitehorn wrote: > I submitted patches to libfdt that resolve this particular ABI breakage > yesterday. If the patch gets merged, newer kernels should become bootable > again. Here's the link: https://github.com/dgibson/dtc/pull/12 (Add limited

Re: [PATCH] KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp()

2017-12-12 Thread Benjamin Herrenschmidt
On Tue, 2017-12-12 at 18:23 +0100, Laurent Vivier wrote: > When we migrate a VM from a POWER8 host (XICS) to a POWER9 host > (XICS-on-XIVE), we have an error: > > qemu-kvm: Unable to restore KVM interrupt controller state \ > (0xff00) for CPU 0: Invalid argument > > This is because

[PATCH] KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp()

2017-12-12 Thread Laurent Vivier
When we migrate a VM from a POWER8 host (XICS) to a POWER9 host (XICS-on-XIVE), we have an error: qemu-kvm: Unable to restore KVM interrupt controller state \ (0xff00) for CPU 0: Invalid argument This is because kvmppc_xics_set_icp() checks the new state is internaly consistent,

Re: [PATCH V2] cxl: Add support for ASB_Notify on POWER9

2017-12-12 Thread Philippe Bergheaud
On 01/12/2017 16:53, 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 particular LPID:PID:TID.

Re: [PATCH] powerpc/perf: Dereference bhrb entries safely

2017-12-12 Thread Naveen N. Rao
Ravi Bangoria wrote: It may very well happen that branch instructions recorded by bhrb entries already get unmapped before they get processed by the kernel. Hence, trying to dereference such memory location will endup in a crash. Ex, Unable to handle kernel paging request for data at

Re: [PATCH] On ppc64le we HAVE_RELIABLE_STACKTRACE

2017-12-12 Thread Josh Poimboeuf
On Tue, Dec 12, 2017 at 12:39:12PM +0100, Torsten Duwe wrote: > Hi all, > > The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3: > > [...] There are several rules that must be adhered to in order to ensure > reliable and consistent call chain backtracing: > > * Before a function

Re: [PATCH] KVM: PPC: Book3S: fix XIVE migration of pending interrupts

2017-12-12 Thread Laurent Vivier
On 12/12/2017 13:02, Cédric Le Goater wrote: > When restoring a pending interrupt, we are setting the Q bit to force > a retrigger in xive_finish_unmask(). But we also need to force an EOI > in this case to reach the same initial state : P=1, Q=0. > > This can be done by not setting 'old_p' for

Re: [PATCH] On ppc64le we HAVE_RELIABLE_STACKTRACE

2017-12-12 Thread Torsten Duwe
On Tue, Dec 12, 2017 at 01:12:37PM +0100, Miroslav Benes wrote: > > I think that this is not enough. You need to also implement > save_stack_trace_tsk_reliable() for powerpc defined as __weak in > kernel/stacktrace.c. See arch/x86/kernel/stacktrace.c for reference, but I > think it would be

[PATCH] powerpc/perf: Dereference bhrb entries safely

2017-12-12 Thread Ravi Bangoria
It may very well happen that branch instructions recorded by bhrb entries already get unmapped before they get processed by the kernel. Hence, trying to dereference such memory location will endup in a crash. Ex, Unable to handle kernel paging request for data at address 0xc00819c41764

[PATCH] KVM: PPC: Book3S: fix XIVE migration of pending interrupts

2017-12-12 Thread Cédric Le Goater
When restoring a pending interrupt, we are setting the Q bit to force a retrigger in xive_finish_unmask(). But we also need to force an EOI in this case to reach the same initial state : P=1, Q=0. This can be done by not setting 'old_p' for pending interrupts which will inform

Re: [PATCH] On ppc64le we HAVE_RELIABLE_STACKTRACE

2017-12-12 Thread Miroslav Benes
On Tue, 12 Dec 2017, Torsten Duwe wrote: > Hi all, > > The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3: > > [...] There are several rules that must be adhered to in order to ensure > reliable and consistent call chain backtracing: > > * Before a function calls any other

Re: powerpc: Use pr_warn instead of pr_warning

2017-12-12 Thread Joe Perches
On Tue, 2017-12-12 at 22:39 +1100, Michael Ellerman wrote: > On Tue, 2016-10-25 at 04:00:08 UTC, Joe Perches wrote: > > At some point, pr_warning will be removed so all logging messages use > > a consistent _warn style. > > > > Update arch/powerpc/ > > > > Miscellanea: > > > > o Coalesce

Re: [powerpc-next] Fix powerpc64 alignment of .toc section in kernel modules

2017-12-12 Thread Michael Ellerman
On Wed, 2017-12-06 at 19:12:28 UTC, Desnes Augusto Nunes do Rosario wrote: > powerpc64 gcc can generate code that offsets an address, to access part of > an object in memory. If the address is a -mcmodel=medium toc pointer > relative address then code like the following is possible. > > addis

Re: [v2,1/4] 44x/fsp2: add fsp2 headers

2017-12-12 Thread Michael Ellerman
On Fri, 2017-12-01 at 15:58:24 UTC, Ivan Mikhaylov wrote: > add cmu, plbX, l2, ddr3/4, crcs register definitions. > add mfcmu, mtcmu functions for indirect access to cmu. > add mtl2, mfl2 same for l2 cache core reg set. > > Signed-off-by: Ivan Mikhaylov Series applied to

Re: [2/2] powerpc: Reduce log level of "OPAL detected !" message

2017-12-12 Thread Michael Ellerman
On Wed, 2017-11-22 at 06:01:06 UTC, Benjamin Herrenschmidt wrote: > This message isn't terribly useful. > > Signed-off-by: Benjamin Herrenschmidt Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/5138b31422efec897461951f7ce72e cheers

Re: [1/2] powerpc: Remove DEBUG define in 64-bit early setup code

2017-12-12 Thread Michael Ellerman
On Wed, 2017-11-22 at 06:01:05 UTC, Benjamin Herrenschmidt wrote: > This statement causes some not very useful messages to always > be printed on the serial port at boot, even on quiet boots. > > Signed-off-by: Benjamin Herrenschmidt Applied to powerpc next, thanks.

Re: [1/2] selftests/powerpc: Check for pthread errors in tm-unavailable

2017-12-12 Thread Michael Ellerman
On Tue, 2017-11-21 at 07:17:19 UTC, Cyril Bur wrote: > Signed-off-by: Cyril Bur > Signed-off-by: Gustavo Romero Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/5783ee6ec3d3323a04cc69764d57ca cheers

Re: [v4,3/3] powerpc/modules: Improve restore_r2() error message

2017-12-12 Thread Michael Ellerman
On Tue, 2017-11-14 at 09:29:10 UTC, Kamalesh Babulal wrote: > From: Josh Poimboeuf > > Print the function address associated with the restore_r2() error to > make it easier to debug the problem. > > Also clarify the wording a bit. > > Before: > > module_64: patch_foo:

Re: [2/4] powerpc/64: do not trace irqs-off at interrupt return to soft-disabled context

2017-12-12 Thread Michael Ellerman
On Thu, 2017-11-16 at 16:00:50 UTC, Nicholas Piggin wrote: > When an interrupt is returning to a soft-disabled context (which can > happen for non-maskable interrupts or synchronous interrupts), it goes > through the motions of soft-disabling again, including calling > TRACE_DISABLE_INTS (i.e.,

Re: [v4, 1/3] kernel/modules: Add REL24 relocation support of livepatch symbols

2017-12-12 Thread Michael Ellerman
On Tue, 2017-11-14 at 09:29:08 UTC, Kamalesh Babulal wrote: > Livepatch re-uses module loader function apply_relocate_add() to write > relocations, instead of managing them by arch-dependent > klp_write_module_reloc() function. > > apply_relocate_add() doesn't understand livepatch symbols (marked

Re: [v4.2] powerpc/modules: Don't try to restore r2 after a sibling call

2017-12-12 Thread Michael Ellerman
On Thu, 2017-11-16 at 17:45:37 UTC, Josh Poimboeuf wrote: > > From: Josh Poimboeuf > Subject: [PATCH v4.2] powerpc/modules: Don't try to restore r2 after a > sibling call > > When attempting to load a livepatch module, I got the following error: > > module_64:

Re: powerpc/32: Add .data.rel* sections explicitly

2017-12-12 Thread Michael Ellerman
On Mon, 2017-11-13 at 12:06:55 UTC, Nicholas Piggin wrote: > Match powerpc/64 and include .data.rel* input sections in the .data output > section explicitly. > > This solves the warning: > > powerpc-linux-gnu-ld: warning: orphan section `.data.rel.ro' from > `arch/powerpc/kernel/head_44x.o'

Re: [v5,1/3] powerpc/kernel: Separate SR-IOV Calls

2017-12-12 Thread Michael Ellerman
On Thu, 2017-11-09 at 14:00:33 UTC, "Bryant G. Ly" wrote: > SR-IOV can now be enabled in PowerNV platforms and Pseries > platforms. Therefore, the appropriate calls were moved to > machine dependent code instead of definition at compile time. > > Signed-off-by: Bryant G. Ly

Re: [1/3] powerpc/boot: Only build uartlite if XILINX_VIRTEX=y

2017-12-12 Thread Michael Ellerman
On Wed, 2017-11-08 at 11:05:27 UTC, Michael Ellerman wrote: > The serial code in uartlite.c only matches if we find one of two > Xilinx (xlnx) nodes in the device tree, there's no need to build or > link the code on other platforms. > > As far as I can tell CONFIG_XILINX_VIRTEX is the appropriate

Re: [v6] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-12-12 Thread Michael Ellerman
On Mon, 2017-10-16 at 05:49:14 UTC, Santosh Sivaraj wrote: > Current vDSO64 implementation does not have support for coarse clocks > (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls back > to system call, increasing the response time, vDSO implementation reduces > the cycle

Re: selftests/powerpc: fix build error in powerpc ptrace selftests.

2017-12-12 Thread Michael Ellerman
On Fri, 2017-09-01 at 02:17:14 UTC, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > GCC 7 will take "r2" in clobber list as an error will it will get following > build errors for powerpc ptrace selftests even with -fno-pic option: > ptrace-tm-vsx.c: In function

Re: [1/2] powerpc: make use of for_each_node_by_name() instead of open-coding it

2017-12-12 Thread Michael Ellerman
On Wed, 2017-02-01 at 01:54:37 UTC, Dmitry Torokhov wrote: > Instead of manually coding the loop with of_find_node_by_name(), let's > switch to the standard macro for iterating over nodes with given name. > > Signed-off-by: Dmitry Torokhov Applied to powerpc next,

Re: powerpc/powermac: drop useless call to of_find_node_by_name

2017-12-12 Thread Michael Ellerman
On Tue, 2017-01-31 at 18:01:44 UTC, Dmitry Torokhov wrote: > We are not using result, so this simply results in a leaked refcount. > > Signed-off-by: Dmitry Torokhov Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/df26200299eb05fa7d059cd235847e

Re: powerpc/powermac: fix OF node refcount leak

2017-12-12 Thread Michael Ellerman
On Tue, 2017-01-31 at 17:43:55 UTC, Dmitry Torokhov wrote: > We need to call of_node_put() for device nodes obtained with > of_find_node_by_name(). > > Signed-off-by: Dmitry Torokhov Applied to powerpc next, thanks.

Re: powerpc: Use pr_warn instead of pr_warning

2017-12-12 Thread Michael Ellerman
On Tue, 2016-10-25 at 04:00:08 UTC, Joe Perches wrote: > At some point, pr_warning will be removed so all logging messages use > a consistent _warn style. > > Update arch/powerpc/ > > Miscellanea: > > o Coalesce formats > o Realign arguments > o Use %s, __func__ instead of embedded function

[PATCH] On ppc64le we HAVE_RELIABLE_STACKTRACE

2017-12-12 Thread Torsten Duwe
Hi all, The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3: [...] There are several rules that must be adhered to in order to ensure reliable and consistent call chain backtracing: * Before a function calls any other function, it shall establish its own stack frame, whose size

Re: ps3: Remove deprecated create_singlethread_workqueue

2017-12-12 Thread Michael Ellerman
On Tue, 2016-08-30 at 17:14:51 UTC, Bhaktipriya Shridhar wrote: > The workqueue "ps3av->wq" queues a single work item >work and hence > doesn't require ordering. It is involved in waking up ps3avd to do the > video mode setting and hence it's not being used on a memory reclaim > path. Hence, it

[mainline] rcu stalls on CPU when unbinding mpt3sas driver

2017-12-12 Thread Abdul Haleem
Hi, Off late we are seeing cpu stalls messages while mpt3sas driver unbind on powerpc machine for both mainline and linux-next kernels Machine Type: Power 8 Bare-metal Kernel version: 4.15.0-rc2 config: attached. test: driver unbind $ echo -n 0001:03:00.0 > /sys/bus/pci/drivers/mpt3sas/unbind