[RFC PATCH v2 4/7] powerpc/ppc-opcode: consolidate powerpc instructions from bpf_jit.h

2020-04-24 Thread Balamuruhan S
move macro definitions of powerpc instructions from bpf_jit.h to ppc-opcode.h and adopt the users of the macros accordingly. `PPC_MR()` is defined twice in bpf_jit.h, remove the duplicate one. Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 139 +

[RFC PATCH v2 5/7] powerpc/ppc-opcode: reuse raw instruction macros to stringify

2020-04-24 Thread Balamuruhan S
Wrap existing stringify macros to reuse raw instruction encoding macros that are newly added. Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 220 +- 1 file changed, 71 insertions(+), 149 deletions(-) diff --git

[PATCH v4, 3/5] powerpc: sysdev: fix compile warning for fsl_85xx_cache_sram

2020-04-24 Thread Wang Wenhu
Function instantiate_cache_sram should not be linked into the init section for its caller mpc85xx_l2ctlr_of_probe is none-__init. Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Christophe Leroy Cc: Scott Wood Cc: Michael Ellerman Cc: Randy Dunlap Cc: linuxppc-dev@lists.ozlabs.org Fixes:

Re: [PATCH] ASoC: fsl_esai: Remove the tasklet

2020-04-24 Thread Nicolin Chen
On Fri, Apr 24, 2020 at 02:54:06PM +0800, Shengjiu Wang wrote: > Remove tasklet for it may cause the reset operation > can't be handled immediately, then there will be > endless xrun interrupt. The reset routine is really long and expensive, so not sure if it'd be good to do it completely inside

Re: [PATCH v3,5/5] powerpc: sysdev: support userspace access of fsl_85xx_sram

2020-04-24 Thread 王文虎
create mode 100644 arch/powerpc/sysdev/fsl_85xx_sram_uapi.c >>> >>> We shouldn't add more stuff in arch/powerpc/sysdev/ >>> >>> Either it is dedicated to 85xx, and it should go into >>> arch/powerpc/platform/85xx/ , or it is common to several >>> platforms/architectures and should be moved

[RFC PATCH v2 3/7] powerpc/bpf_jit: reuse instruction macros from ppc-opcode.h

2020-04-24 Thread Balamuruhan S
remove duplicate macro definitions from bpf_jit.h and reuse the macros from ppc-opcode.h Signed-off-by: Balamuruhan S --- arch/powerpc/net/bpf_jit.h| 18 +- arch/powerpc/net/bpf_jit32.h | 10 +- arch/powerpc/net/bpf_jit64.h | 4 ++--

Re: [PATCH 15/21] mm: memmap_init: iterate over memblock regions rather that check each PFN

2020-04-24 Thread David Hildenbrand
On 12.04.20 21:48, Mike Rapoport wrote: > From: Baoquan He > > When called during boot the memmap_init_zone() function checks if each PFN > is valid and actually belongs to the node being initialized using > early_pfn_valid() and early_pfn_in_nid(). > > Each such check may cost up to O(log(n))

[PATCH v4, 1/5] powerpc: sysdev: fix compile error for fsl_85xx_l2ctlr

2020-04-24 Thread Wang Wenhu
Include "linux/of_address.h" to fix the compile error for mpc85xx_l2ctlr_of_probe() when compiling fsl_85xx_cache_sram.c. CC arch/powerpc/sysdev/fsl_85xx_l2ctlr.o arch/powerpc/sysdev/fsl_85xx_l2ctlr.c: In function ‘mpc85xx_l2ctlr_of_probe’: arch/powerpc/sysdev/fsl_85xx_l2ctlr.c:90:11:

Re: [PATCH v3,4/5] misc: sram_dynamic for user level SRAM access

2020-04-24 Thread 王文虎
>> diff --git a/include/linux/sram_dynamic.h b/include/linux/sram_dynamic.h >> new file mode 100644 >> index ..c77e9e7b1151 >> --- /dev/null >> +++ b/include/linux/sram_dynamic.h >> @@ -0,0 +1,23 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef __SRAM_DYNAMIC_H >> +#define

[RFC PATCH v2 0/7] consolidate PowerPC instruction encoding macros

2020-04-24 Thread Balamuruhan S
ppc-opcode.h have base instruction encoding wrapped with stringify_in_c() for raw encoding to have compatibility. But there are redundant macros for base instruction encodings in bpf, instruction emulation test infrastructure and powerpc selftests. Currently PPC_INST_* macros are used for

[RFC PATCH v2 6/7] powerpc/ppc-opcode: fold PPC_INST_* macros into PPC_RAW_* macros

2020-04-24 Thread Balamuruhan S
Lot of PPC_INST_* macros are used only ever in PPC_* macros, fold those PPC_INST_* into PPC_RAW_* to avoid using PPC_INST_* accidentally. Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 381 +- 1 file changed, 125 insertions(+), 256 deletions(-)

[Bug 199471] [Bisected][Regression] windfarm_pm* no longer gets automatically loaded when CONFIG_I2C_POWERMAC=y is set

2020-04-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199471 --- Comment #24 from Wolfram Sang (w...@the-dreams.de) --- @Michael: commit bcf3588d8ed has the following tags: Reported-by: Erhard Furtner Tested-by: Erhard Furtner And Erhard is also the one who created this bug entry. -- You are

[RFC PATCH v2 1/7] powerpc/ppc-opcode: introduce PPC_RAW_* macros for base instruction encoding

2020-04-24 Thread Balamuruhan S
Introduce PPC_RAW_* macros to have all the bare encoding of ppc instructions. Move `VSX_XX*()` and `TMRN()` macros up to reuse it. Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 183 -- 1 file changed, 175 insertions(+), 8 deletions(-) diff

Re: [PATCH v3,5/5] powerpc: sysdev: support userspace access of fsl_85xx_sram

2020-04-24 Thread Christophe Leroy
Le 24/04/2020 à 09:05, 王文虎 a écrit : Le 24/04/2020 à 04:45, Wang Wenhu a écrit : New module which registers its memory allocation and free APIs to the sram_dynamic module, which would create a device of struct sram_device type to act as an interface for user level applications to access the

[PATCH v4, 5/5] powerpc: sysdev: support userspace access of fsl_85xx_sram

2020-04-24 Thread Wang Wenhu
New module which registers its memory allocation and free APIs to the sram_dynamic module, which would create a device of struct sram_device type to act as an interface for user level applications to access the backend hardware device, fsl_85xx_cache_sram, which is drived by the

[RFC PATCH v2 7/7] powerpc/selftest: reuse ppc-opcode macros to avoid redundancy

2020-04-24 Thread Balamuruhan S
Avoid redefining macros to encode ppc instructions instead reuse it from ppc-opcode.h, Makefile changes are necessary to compile memcmp_64.S with __ASSEMBLY__ defined from selftests. Signed-off-by: Balamuruhan S --- .../selftests/powerpc/stringloops/Makefile| 34 ++

[PATCH v4,4/5] misc: sram_dynamic for user level SRAM access

2020-04-24 Thread Wang Wenhu
A generic User-Kernel interface module that allows a misc device created when a backend SRAM hardware device driver registers its APIs to support file operations of ioctl and mmap for user space applications to allocate SRAM memory, mmap it to process address space and free it then after. It is

Re: [PATCH] lib/mpi: Fix building for powerpc with clang

2020-04-24 Thread Nathan Chancellor
On Fri, Apr 24, 2020 at 01:23:37PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote: > >> On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote: > >> > 0day reports over and over on an powerpc randconfig with

[PATCH v4, 2/5] powerpc: sysdev: fix compile error for fsl_85xx_cache_sram

2020-04-24 Thread Wang Wenhu
Include linux/io.h into fsl_85xx_cache_sram.c to fix the implicit-declaration compile error when building Cache-Sram. arch/powerpc/sysdev/fsl_85xx_cache_sram.c: In function ‘instantiate_cache_sram’: arch/powerpc/sysdev/fsl_85xx_cache_sram.c:97:26: error: implicit declaration of function

Re: [PATCH v3,5/5] powerpc: sysdev: support userspace access of fsl_85xx_sram

2020-04-24 Thread 王文虎
>Le 24/04/2020 à 04:45, Wang Wenhu a écrit : >> New module which registers its memory allocation and free APIs to the >> sram_dynamic module, which would create a device of struct sram_device >> type to act as an interface for user level applications to access the >> backend hardware device,

[PATCH] ASoC: fsl_esai: Remove the tasklet

2020-04-24 Thread Shengjiu Wang
Remove tasklet for it may cause the reset operation can't be handled immediately, then there will be endless xrun interrupt. Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_esai.c | 15 --- 1 file

[RFC PATCH v2 2/7] powerpc/ppc-opcode: move ppc instruction encoding from test_emulate_step

2020-04-24 Thread Balamuruhan S
Few ppc instructions are encoded in test_emulate_step.c, consolidate them and use it from ppc-opcode.h Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 35 ++ arch/powerpc/lib/test_emulate_step.c | 155 ++ 2 files changed, 91 insertions(+),

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Steven Rostedt
On Thu, 23 Apr 2020 18:21:14 +0200 Christophe Leroy wrote: > Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > > With STRICT_KERNEL_RWX, we are currently ignoring return value from > > __patch_instruction() in do_patch_instruction(), resulting in the error > > not being propagated back. Fix the

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Steven Rostedt
On Thu, 23 Apr 2020 17:41:52 +0200 Christophe Leroy wrote: > > diff --git a/arch/powerpc/kernel/optprobes.c > > b/arch/powerpc/kernel/optprobes.c > > index 024f7aad1952..046485bb0a52 100644 > > --- a/arch/powerpc/kernel/optprobes.c > > +++ b/arch/powerpc/kernel/optprobes.c > > @@ -139,52

[PATCH] ASoC: fsl_easrc: Check NULL pinter before dereference

2020-04-24 Thread Shengjiu Wang
The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers" from Apr 16, 2020, leads to the following Smatch complaint: sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() warn: variable dereferenced before check 'ctx' (see line 1527) sound/soc/fsl/fsl_easrc.c 1526 struct

Re: [RFC PATCH 2/3] powerpc/lib: Initialize a temporary mm for code patching

2020-04-24 Thread Steven Rostedt
On Fri, 17 Apr 2020 10:57:10 +1000 Michael Ellerman wrote: > >>> Does it needs to be a BUG_ON() ? Can't we fail gracefully with just a > >>> WARN_ON ? > >>> > >> > >> I'm not sure what failing gracefully means here? The main reason this could > >> fail is if there is not enough memory to

Re: [PATCH] ASoC: fsl_easrc: Check for null pointer before dereferencing “ctx” in fsl_easrc_hw_free()

2020-04-24 Thread Markus Elfring
> The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI > drivers" from Apr 16, 2020, leads to the following Smatch complaint: > > sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() > warn: variable dereferenced before check 'ctx' (see line 1527) Please avoid a typo in the final commit

Re: [PATCH v3 1/3] powerpc/rtas: Export rtas_error_rc

2020-04-24 Thread Nathan Lynch
Sam Bobroff writes: > Export rtas_error_rc() so that it can be used by other users of > rtas_call() (which is already exported). This will do the right thing for your ibm,configure-pe use case in patch 2, but the -900x => errno translations in rtas_error_rc() appear tailored for the indicator-

Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-04-24 Thread Daniel Axtens
Hi Jason, Apologies for the delay in testing. I'm seeing this problem when I try to boot on a t4240rdb: random: get_random_u64 called from .start_kernel+0x734/0x964 with crng_init=0 [8/973] clocksource: timebase: mask: 0x max_cycles: 0xa9210e89c,

Re: [PATCH v3 2/3] powerpc/eeh: fix pseries_eeh_configure_bridge()

2020-04-24 Thread Nathan Lynch
Sam Bobroff writes: > If a device is hot unplgged during EEH recovery, it's possible for the > RTAS call to ibm,configure-pe in pseries_eeh_configure() to return > parameter error (-3), however negative return values are not checked > for and this leads to an infinite loop. > > Fix this by

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : With STRICT_KERNEL_RWX, we are currently ignoring return value from __patch_instruction() in do_patch_instruction(), resulting in the error not being propagated back. Fix the same. Good patch. Be aware that there is

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Steven Rostedt
On Fri, 24 Apr 2020 23:56:25 +0530 "Naveen N. Rao" wrote: > > #define PATCH_INSN(addr, instr) \ > > ({ > > int rc = patch_instruction((unsigned int *)(addr), instr); \ > > if (rc) \ > > pr_err("%s:%d Error

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Christopher M. Riedl
On Fri Apr 24, 2020 at 9:15 AM, Steven Rostedt wrote: > On Thu, 23 Apr 2020 18:21:14 +0200 > Christophe Leroy wrote: > > > > Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > > > With STRICT_KERNEL_RWX, we are currently ignoring return value from > > > __patch_instruction() in

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Naveen N. Rao
Steven Rostedt wrote: On Fri, 24 Apr 2020 23:56:25 +0530 "Naveen N. Rao" wrote: > #define PATCH_INSN(addr, instr) \ > ({ >int rc = patch_instruction((unsigned int *)(addr), instr); \ >if (rc) \ >

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Steven Rostedt
On Fri, 24 Apr 2020 23:37:06 +0530 "Naveen N. Rao" wrote: > >> Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > >> > With STRICT_KERNEL_RWX, we are currently ignoring return value from > >> > __patch_instruction() in do_patch_instruction(), resulting in the error > >> > not being propagated

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Naveen N. Rao
Hi Steve, Steven Rostedt wrote: On Thu, 23 Apr 2020 18:21:14 +0200 Christophe Leroy wrote: Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > With STRICT_KERNEL_RWX, we are currently ignoring return value from > __patch_instruction() in do_patch_instruction(), resulting in the error > not

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 23 Apr 2020 17:41:52 +0200 Christophe Leroy wrote: > diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c > index 024f7aad1952..046485bb0a52 100644 > --- a/arch/powerpc/kernel/optprobes.c > +++ b/arch/powerpc/kernel/optprobes.c > @@

[Bug 199471] [Bisected][Regression] windfarm_pm* no longer gets automatically loaded when CONFIG_I2C_POWERMAC=y is set

2020-04-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199471 --- Comment #25 from Erhard F. (erhar...@mailbox.org) --- (In reply to Michael Ellerman from comment #23) > The memory leak is a separate issue, see bug #206695. > > Can anyone verify that bcf3588d8ed fixes the original issue? Yes, thanks to

Re: [RFC PATCH dpss_eth] Don't initialise ports with no PHY

2020-04-24 Thread Florian Fainelli
On 4/24/2020 3:29 PM, Darren Stevens wrote: > Since cbb961ca271e ("Use random MAC address when none is given") > Varisys Cyrus P5020 boards have been listing 5 ethernet ports instead of > the 2 the board has.This is because we were preventing the adding of the > unused ports by not suppling

Re: [PATCH] PCI: Use of_node_name_eq for node name comparisons

2020-04-24 Thread Bjorn Helgaas
On Thu, Apr 16, 2020 at 04:51:14PM -0500, Rob Herring wrote: > Convert string compares of DT node names to use of_node_name_eq helper > instead. This removes direct access to the node name pointer. > > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Bjorn Helgaas

[RFC PATCH dpss_eth] Don't initialise ports with no PHY

2020-04-24 Thread Darren Stevens
Since cbb961ca271e ("Use random MAC address when none is given") Varisys Cyrus P5020 boards have been listing 5 ethernet ports instead of the 2 the board has.This is because we were preventing the adding of the unused ports by not suppling them a MAC address, which this patch now supplies.

Re: [PATCH v2 1/2] PCI/AER: Allow Native AER Host Bridges to use AER

2020-04-24 Thread Bjorn Helgaas
Hi Jon, I'm glad you raised this because I think the way we handle FIRMWARE_FIRST is really screwed up. On Mon, Apr 20, 2020 at 03:37:09PM -0600, Jon Derrick wrote: > Some platforms have a mix of ports whose capabilities can be negotiated > by _OSC, and some ports which are not described by ACPI

Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2

2020-04-24 Thread Nicholas Piggin
Excerpts from Rich Felker's message of April 23, 2020 12:36 pm: > On Wed, Apr 22, 2020 at 04:18:36PM +1000, Nicholas Piggin wrote: >> Yeah I had a bit of a play around with musl (which is very nice code I >> must say). The powerpc64 syscall asm is missing ctr clobber by the way. >> Fortunately

Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2

2020-04-24 Thread Nicholas Piggin
Excerpts from Rich Felker's message of April 24, 2020 3:42 am: > On Thu, Apr 23, 2020 at 02:15:58PM -0300, Adhemerval Zanella wrote: >> >> >> On 23/04/2020 13:43, Rich Felker wrote: >> > On Thu, Apr 23, 2020 at 01:35:01PM -0300, Adhemerval Zanella wrote: >> >> >> >> >> >> On 23/04/2020 13:18,

Re: [RFC PATCH dpss_eth] Don't initialise ports with no PHY

2020-04-24 Thread Andrew Lunn
On Fri, Apr 24, 2020 at 11:29:38PM +0100, Darren Stevens wrote: > Since cbb961ca271e ("Use random MAC address when none is given") > Varisys Cyrus P5020 boards have been listing 5 ethernet ports instead of > the 2 the board has.This is because we were preventing the adding of the > unused ports by

Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2

2020-04-24 Thread Rich Felker
On Sat, Apr 25, 2020 at 01:40:24PM +1000, Nicholas Piggin wrote: > Excerpts from Rich Felker's message of April 24, 2020 3:42 am: > > On Thu, Apr 23, 2020 at 02:15:58PM -0300, Adhemerval Zanella wrote: > >> > >> > >> On 23/04/2020 13:43, Rich Felker wrote: > >> > On Thu, Apr 23, 2020 at

Re: [musl] New powerpc vdso calling convention

2020-04-24 Thread Rich Felker
On Sat, Apr 25, 2020 at 03:22:27PM +1000, Nicholas Piggin wrote: > As noted in the 'scv' thread, powerpc's vdso calling convention does not > match the C ELF ABI calling convention (or the proposed scv convention). > I think we could implement a new ABI by basically duplicating function > entry

New powerpc vdso calling convention

2020-04-24 Thread Nicholas Piggin
As noted in the 'scv' thread, powerpc's vdso calling convention does not match the C ELF ABI calling convention (or the proposed scv convention). I think we could implement a new ABI by basically duplicating function entry points with different names. The ELF v2 ABI convention would suit it