Re: [PATCH 1/3] drivers/base: introduce some help routines for reordering a group of dev

2018-06-25 Thread Pingfan Liu
On Mon, Jun 25, 2018 at 2:41 PM Greg Kroah-Hartman wrote: > > On Mon, Jun 25, 2018 at 01:23:05PM +0800, Pingfan Liu wrote: > > This patch introduce some help routines used by next patch. It aims to > > ease reviewing, while the next patch will concentrate on algorithm. > > > > Cc: Greg Kroah-Hartm

[PATCHv2 0/2] drivers/base: bugfix for supplier<-consumer ordering in device_kset

2018-06-25 Thread Pingfan Liu
commit 52cdbdd49853 ("driver core: correct device's shutdown order") places an assumption of supplier<-consumer order on the process of probe. But it turns out to break down the parent <- child order in some scene. E.g in pci, a bridge is enabled by pci core, and behind it, the devices have been pr

[PATCHv2 1/2] drivers/base: only reordering consumer device when probing

2018-06-25 Thread Pingfan Liu
commit 52cdbdd49853 ("driver core: correct device's shutdown order") places an assumption of supplier<-consumer order on the process of probe. But it turns out to break down the parent <- child order in some scene. E.g in pci, a bridge is enabled by pci core, and behind it, the devices have been pr

[PATCHv2 2/2] drivers/base: reorder consumer and its children behind suppliers

2018-06-25 Thread Pingfan Liu
commit 52cdbdd49853 ("driver core: correct device's shutdown order") introduces supplier<-consumer order in devices_kset. The commit tries to cleverly maintain both parent<-child and supplier<-consumer order by reordering a device when probing. This method makes things simple and clean, but unfortu

[PATCH] powerpc/mm/32: Fix pgtable_page_dtor call

2018-06-25 Thread Aneesh Kumar K.V
Commit 667416f38554 ("powerpc/mm: Fix kernel crash on page table free") added a call for pgtable_page_dtor in the rcu page table free routine. We missed the fact that for 32 bit platforms we did call the 'dtor' early. Drop the extra call for pgtable_page_dtor. We remove the call from __pte_free_tlb

Re: [PATCH v8 3/6] module: use relative references for __ksymtab entries

2018-06-25 Thread Ard Biesheuvel
On 25 June 2018 at 10:56, Martijn Coenen wrote: > Hi Ard, > >> --- a/arch/x86/include/asm/export.h >> +++ /dev/null >> @@ -1,5 +0,0 @@ >> -/* SPDX-License-Identifier: GPL-2.0 */ >> -#ifdef CONFIG_64BIT >> -#define KSYM_ALIGN 16 >> -#endif > > Why remove the 16-byte alignment here? Because struct

Re: [PATCH] QE GPIO: Add qe_gpio_set_multiple

2018-06-25 Thread Joakim Tjernlund
On Thu, 2018-06-21 at 02:38 +, Qiang Zhao wrote: > > On 06/19/2018 09:22 AM, Joakim Tjernlund wrote: > -Original Message- > From: Linuxppc-dev > [mailto:linuxppc-dev-bounces+qiang.zhao=nxp@lists.ozlabs.org] On Behalf > Of Joakim Tjernlund > Sent: 2018年6月20日 0:22 > To: York Sun ;

Re: [PATCHv2 2/2] drivers/base: reorder consumer and its children behind suppliers

2018-06-25 Thread Greg Kroah-Hartman
On Mon, Jun 25, 2018 at 03:47:39PM +0800, Pingfan Liu wrote: > commit 52cdbdd49853 ("driver core: correct device's shutdown order") > introduces supplier<-consumer order in devices_kset. The commit tries > to cleverly maintain both parent<-child and supplier<-consumer order by > reordering a device

Re: [PATCH v8 3/6] module: use relative references for __ksymtab entries

2018-06-25 Thread Ard Biesheuvel
On 25 June 2018 at 12:15, Martijn Coenen wrote: > On Mon, Jun 25, 2018 at 11:14 AM, Ard Biesheuvel > wrote: >> Because struct kernel_symbol is only 8 bytes in size after this >> change, and aligning a 8 byte quantity to 16 bytes wastes 8 bytes. > > I get that, but then that means the 16-byte alig

[v4, 00/10] Support DPAA PTP clock and timestamping

2018-06-25 Thread Yangbo Lu
This patchset is to support DPAA FMAN PTP clock and HW timestamping. It had been verified on both ARM platform and PPC platform. - The patch #1 to patch #5 are to support DPAA FMAN 1588 timer in ptp_qoriq driver. - The patch #6 to patch #10 are to add HW timestamping support in DPAA ethernet dr

[v4, 01/10] fsl/fman: share the event interrupt

2018-06-25 Thread Yangbo Lu
This patch is to share fman event interrupt because the 1588 timer driver will also use this interrupt. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes for v3: - None. Changes for v4: - Added ACKs. --- drive

[v4, 02/10] ptp: support DPAA FMan 1588 timer in ptp_qoriq

2018-06-25 Thread Yangbo Lu
This patch is to support DPAA (Data Path Acceleration Architecture) 1588 timer by adding "fsl,fman-ptp-timer" compatible, sharing interrupt with FMan, adding FSL_DPAA_ETH dependency, and fixing up register offset. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Ch

[v4, 03/10] dt-binding: ptp_qoriq: add DPAA FMan support

2018-06-25 Thread Yangbo Lu
This patch is to add bindings description for DPAA FMan 1588 timer, and also remove its description in fsl-fman dt-bindings document. Signed-off-by: Yangbo Lu Reviewed-by: Rob Herring Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes for v3:

[v4, 04/10] powerpc/mpc85xx: move ptp timer out of fman in dts

2018-06-25 Thread Yangbo Lu
This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes f

[v4, 05/10] arm64: dts: fsl: move ptp timer out of fman

2018-06-25 Thread Yangbo Lu
This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - Fixed address-c

[v4, 06/10] fsl/fman: add set_tstamp interface

2018-06-25 Thread Yangbo Lu
This patch is to add set_tstamp interface for memac, dtsec, and 10GEC controllers to configure HW timestamping. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes for v3: - None. Changes for v4: - Added ACKs. --

[v4, 07/10] fsl/fman_port: support getting timestamp

2018-06-25 Thread Yangbo Lu
This patch is to add fman_port_get_tstamp() interface to get timestamp. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes for v3: - Moved endianness conversion from dpaa to fman API. Changes for v4: - Fixed kbu

[v4, 08/10] fsl/fman: define frame description command UPD

2018-06-25 Thread Yangbo Lu
Defined frame description command FM_FD_CMD_UPD for prepended data updating. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - None. Changes for v3: - None. Changes for v4: - Added ACKs. --- drivers/net/ethernet/freescale/f

[v4, 09/10] dpaa_eth: add support for hardware timestamping

2018-06-25 Thread Yangbo Lu
This patch is to add hardware timestamping support for dpaa_eth. On Rx, timestamping is enabled for all frames. On Tx, we only instruct the hardware to timestamp the frames marked accordingly by the stack. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes fo

[v4, 10/10] dpaa_eth: add the get_ts_info interface for ethtool

2018-06-25 Thread Yangbo Lu
Added the get_ts_info interface for ethtool to check the timestamping capability. Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Acked-by: Madalin Bucur --- Changes for v2: - Removed ifdef for hw timestamp. Changes for v3: - None. Changes for v4: - Added ACKs. --- d

[PATCH 00/10] cxl: Remove abandonned capi support for the Mellanox CX4

2018-06-25 Thread Frederic Barrat
An attempt was made to add capi support for the Mellanox CX4 card, so that it could operate in "traditional" PCI mode or capi mode. The project ended up being canceled and a different approach was taken for CX5. Mellanox never upstreamed any capi support in their CX4 driver. CX4 was not following

[PATCH 01/10] Revert "cxl: Add kernel API to allow a context to operate with relocate disabled"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. The symbol 'cxl_set_translation_mode' is never called, so ctx->real_mode is always false. This reverts commit 7a0d85d313c2066712e530e668bc02bb741a685c. --- drivers/misc/cxl/api.c| 19 --- drivers/mis

[PATCH 02/10] Revert "cxl: Add support for interrupts on the Mellanox CX4"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit a2f67d5ee8d950caaa7a6144cf0bfb256500b73e. --- arch/powerpc/platforms/powernv/pci-cxl.c | 84 --- arch/powerpc/platforms/powernv/pci-ioda.c | 4 -- arch/powerpc/platforms/powernv

[PATCH 03/10] Revert "cxl: Add preliminary workaround for CX4 interrupt limitation"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit cbce0917e2e47d4bf5aa3b5fd6b1247f33e1a126. --- drivers/misc/cxl/api.c | 15 --- drivers/misc/cxl/base.c| 17 - drivers/misc/cxl/context.c | 1 - drivers/misc/cxl/c

[PATCH 04/10] Revert "cxl: Add kernel APIs to get & set the max irqs per context"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 79384e4b71240abf50c375eea56060b0d79c242a. --- drivers/misc/cxl/api.c | 27 --- 1 file changed, 27 deletions(-) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c in

[PATCH 05/10] Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit b0b5e5918ad1babfd1d43d98c7281926a7b57b9f. --- drivers/misc/cxl/Kconfig | 8 -- drivers/misc/cxl/pci.c | 236 +++ include/misc/cxl.h | 25 - 3 files

[PATCH 06/10] Revert "cxl: Add support for using the kernel API with a real PHB"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 317f5ef1b363417b6f1e93b90dfd2ffd6be6e867. --- drivers/misc/cxl/pci.c | 3 --- drivers/misc/cxl/vphb.c | 16 ++-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/

[PATCH 07/10] Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"

2018-06-25 Thread Frederic Barrat
From: Alastair D'Silva Remove abandonned capi support for the Mellanox CX4. This reverts commit 4361b03430d685610e5feea3ec7846e8b9ae795f. --- arch/powerpc/include/asm/pnv-pci.h| 7 -- arch/powerpc/platforms/powernv/pci-cxl.c | 115 -- arch/powerpc/platforms/powern

[PATCH 08/10] Revert "cxl: Add cxl_slot_is_supported API"

2018-06-25 Thread Frederic Barrat
Remove abandonned capi support for the Mellanox CX4. This reverts commit 4e56f858bdde5cbfb70f61baddfaa56a8ed851bf. --- drivers/misc/cxl/pci.c | 37 - include/misc/cxl.h | 15 --- 2 files changed, 52 deletions(-) diff --git a/drivers/misc/cxl/pc

[PATCH 09/10] Revert "cxl: Allow a default context to be associated with an external pci_dev"

2018-06-25 Thread Frederic Barrat
Remove abandonned capi support for the Mellanox CX4. This reverts commit a19bd79e31769626d288cc016e21a31b6f47bf6f. --- drivers/misc/cxl/Makefile | 2 +- drivers/misc/cxl/base.c | 35 --- drivers/misc/cxl/cxl.h| 6 -- drivers/misc/cxl/main.c | 2 -- drive

[PATCH 10/10] cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup

2018-06-25 Thread Frederic Barrat
Remove a few XSL/CX4 oddities which are no longer needed. A simple revert of the initial commits was not possible (or not worth it) due to the history of the code. Signed-off-by: Frederic Barrat --- drivers/misc/cxl/context.c | 2 +- drivers/misc/cxl/cxl.h | 12 -- drivers/misc/cxl/debu

[PATCH] kbuild: move bin2c back to scripts/ from scripts/basic/

2018-06-25 Thread Masahiro Yamada
Commit 8370edea81e3 ("bin2c: move bin2c in scripts/basic") moved bin2c to the scripts/basic/ directory, incorrectly stating "Kexec wants to use bin2c and it wants to use it really early in the build process. See arch/x86/purgatory/ code in later patches." Commit bdab125c9301 ("Revert "kexec/purgat

Re: [PATCH v2 0/6] powerpc/pkeys: fixes to pkeys

2018-06-25 Thread Ram Pai
On Sun, Jun 24, 2018 at 01:02:50AM +1000, Michael Ellerman wrote: > Ram Pai writes: > > On Thu, Jun 21, 2018 at 08:28:47PM +1000, Michael Ellerman wrote: > >> Florian Weimer writes: > >> > On 06/19/2018 02:40 PM, Michael Ellerman wrote: > >> >>> I tested the whole series with the new selftests, w

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-25 Thread Breno Leitao
hi Segher, On 06/22/2018 10:10 PM, Segher Boessenkool wrote: >> - strncpy(prog, argv[0], strlen(argv[0])); >> + if (strlen(argv[0]) >= LEN_MAX){ >> + fprintf(stderr, "Very big executable name: %s\n", argv[0]); >> + return 1; >> + } >> + >> + strn

[PATCH v2] selftests/powerpc: Fix strncpy usage

2018-06-25 Thread Breno Leitao
There is a buffer overflow in dscr_inherit_test.c test. In main(), strncpy()'s third argument is the length of the source, not the size of the destination buffer, which makes strncpy() behaves like strcpy(), causing a buffer overflow if argv[0] is bigger than LEN_MAX (100). This patch allocates 'p

Re: [PATCH v8 3/6] module: use relative references for __ksymtab entries

2018-06-25 Thread Martijn Coenen
Hi Ard, > --- a/arch/x86/include/asm/export.h > +++ /dev/null > @@ -1,5 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0 */ > -#ifdef CONFIG_64BIT > -#define KSYM_ALIGN 16 > -#endif Why remove the 16-byte alignment here? I was working on some other code and ran into this 16-byte alignment, but I'm

Re: [PATCH v8 3/6] module: use relative references for __ksymtab entries

2018-06-25 Thread Martijn Coenen
On Mon, Jun 25, 2018 at 11:14 AM, Ard Biesheuvel wrote: > Because struct kernel_symbol is only 8 bytes in size after this > change, and aligning a 8 byte quantity to 16 bytes wastes 8 bytes. I get that, but then that means the 16-byte alignment wasn't actually necessary in the first place. > The

[PATCH 1/2] powerpc/pkeys: preallocate execute_only key only if the key is available.

2018-06-25 Thread Ram Pai
Key 2 is preallocated and reserved for execute-only key. In rare cases if key-2 is unavailable, mprotect(PROT_EXEC) will behave incorrectly. NOTE: mprotect(PROT_EXEC) uses execute-only key. Ensure key 2 is available for preallocation before reserving it for execute_only purpose. Problem noticed b

[PATCH 2/2] powerpc/pkeys: key allocation/deallocation must not change pkey registers

2018-06-25 Thread Ram Pai
Key allocation and deallocation has the side effect of programming the UAMOR/AMR/IAMR registers. This is wrong, since its the responsibility of the application and not that of the kernel, to modify the permission on the key. Do not modify the pkey registers at key allocation/deallocation. This pa

[PATCH 1/2] powerpc/core-pkeys: execute-permission on keys are disabled by default

2018-06-25 Thread Ram Pai
Only when the key is allocated, its permission are enabled. Signed-off-by: Ram Pai --- tools/testing/selftests/powerpc/ptrace/core-pkey.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powe

[PATCH 2/2] powerpc/ptrace-pkeys: execute-permission on keys are disabled by default

2018-06-25 Thread Ram Pai
The test case assumes execute-permissions of unallocated keys are enabled by default. Signed-off-by: Ram Pai --- .../testing/selftests/powerpc/ptrace/ptrace-pkey.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b

Re: [PATCH 00/10] cxl: Remove abandonned capi support for the Mellanox CX4

2018-06-25 Thread Andrew Donnellan
On 26/06/18 02:23, Frederic Barrat wrote: An attempt was made to add capi support for the Mellanox CX4 card, so that it could operate in "traditional" PCI mode or capi mode. The project ended up being canceled and a different approach was taken for CX5. Mellanox never upstreamed any capi support

Re: [PATCH 00/10] cxl: Remove abandonned capi support for the Mellanox CX4

2018-06-25 Thread Andrew Donnellan
On 26/06/18 12:31, Andrew Donnellan wrote: 9 of these commits are missing Signed-off-bys. git revert -s is a thing :) After mentally preparing myself for the flashbacks from when we had to implement some of these hacks in the first place, I've read through the rest of the series and it all l

Re: [PATCHv2 2/2] drivers/base: reorder consumer and its children behind suppliers

2018-06-25 Thread Pingfan Liu
On Mon, Jun 25, 2018 at 6:45 PM Greg Kroah-Hartman wrote: > > On Mon, Jun 25, 2018 at 03:47:39PM +0800, Pingfan Liu wrote: > > commit 52cdbdd49853 ("driver core: correct device's shutdown order") > > introduces supplier<-consumer order in devices_kset. The commit tries > > to cleverly maintain bot

Re: [PATCH kernel] powerpc/powernv/ioda2: Reduce upper limit for DMA window size

2018-06-25 Thread Alexey Kardashevskiy
On Fri, 1 Jun 2018 18:06:16 +1000 Alexey Kardashevskiy wrote: > We use PHB in mode1 which uses bit 59 to select a correct DMA window. > However there is mode2 which uses bits 59:55 and allows up to 32 DMA > windows per a PE. > > Even though documentation does not clearly specify that, it seems

Re: [PATCH v2] selftests/powerpc: Fix strncpy usage

2018-06-25 Thread Michael Ellerman
Breno Leitao writes: > There is a buffer overflow in dscr_inherit_test.c test. In main(), strncpy()'s > third argument is the length of the source, not the size of the destination > buffer, which makes strncpy() behaves like strcpy(), causing a buffer overflow > if argv[0] is bigger than LEN_MAX

[PATCH kernel v2 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-25 Thread Alexey Kardashevskiy
This is to improve page boundaries checking and should probably be cc:stable. I came accross this while debugging nvlink2 passthrough but the lack of checking might be exploited by the existing userspace. Changes: v2: * 2/2: explicitly check for compound pages before calling compound_order()

[PATCH kernel v2 1/2] vfio/spapr: Use IOMMU pageshift rather than pagesize

2018-06-25 Thread Alexey Kardashevskiy
The size is always equal to 1 page so let's use this. Later on this will be used for other checks which use page shifts to check the granularity of access. This should cause no behavioral change. Reviewed-by: David Gibson Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/vfio_iommu_spapr_tc

[PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-06-25 Thread Alexey Kardashevskiy
We already have a check in drivers/vfio/vfio_iommu_spapr_tce.c that an IOMMU page is contained in the physical page so the PCI hardware won't get access to unassigned host memory. However we do not have this check in KVM fastpath (H_PUT_TCE accelerated code) so the user space can pin memory backed

Re: [PATCH] powerpc/mm: remove warning about ‘type’ being set

2018-06-25 Thread Mathieu Malaterre
On Sat, Jun 23, 2018 at 7:12 PM christophe leroy wrote: > > > > Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : > > ‘type’ is only used when CONFIG_DEBUG_HIGHMEM is set. So add a possibly > > unused tag to variable. Remove warning treated as error with W=1: > > > >arch/powerpc/mm/highmem.c:

Re: [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’

2018-06-25 Thread Mathieu Malaterre
On Sat, Jun 23, 2018 at 9:47 PM Segher Boessenkool wrote: > > On Sat, Jun 23, 2018 at 06:59:27PM +0200, christophe leroy wrote: > > > > > > Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : > > >Move initialization of variables after data definitions. This silence > > >warnings treated as error w