Re: [PATCH-next] powerpc/fsl_pci: Use PTR_ERR_OR_ZERO

2018-01-23 Thread Tyrel Datwyler
On 01/23/2018 12:37 PM, Christopher Díaz Riveros wrote: > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Christopher Díaz Riveros > --- Reviewed-by: Tyrel Datwyler

[PATCH] ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info

2018-01-23 Thread Tyrel Datwyler
The fcp_rsp_info structure as defined in the FC spec has an initial 3 bytes reserved field. The ibmvfc driver mistakenly defined this field as 4 bytes resulting in the rsp_code field being defined in what should be the start of the second reserved field and thus always being reported as zero by

[PATCH] macintosh/ams-input: Use true and false for boolean values

2018-01-23 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle Signed-off-by: Gustavo A. R. Silva --- drivers/macintosh/ams/ams-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] macintosh: change some data types from int to bool

2018-01-23 Thread Gustavo A. R. Silva
Change the data type of the following variables from int to bool across all macintosh drivers: started slots_started pm121_started wf_smu_started Some of these issues were detected with the help of Coccinelle. Suggested-by: Michael Ellerman Signed-off-by: Gustavo A. R.

Re: [PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" : Quoting Michael Ellerman : "Gustavo A. R. Silva" writes: Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle.

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

2018-01-23 Thread Michael Ellerman
Jonathan Neuschäfer writes: > On Tue, Jan 23, 2018 at 11:58:06PM +1100, Michael Ellerman wrote: >> Jonathan Neuschäfer writes: >> >> > On the Nintendo Wii, there are two ranges of physical memory, and MMIO >> > in between, but Linux on ppc32

Re: [PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Gustavo A. R. Silva
Quoting Michael Ellerman : "Gustavo A. R. Silva" writes: Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva ---

Re: [PATCH v4 0/7] SR-IOV Enablement on PowerVM

2018-01-23 Thread Russell Currey
On Fri, 2018-01-05 at 10:45 -0600, Bryant G. Ly wrote: > This patch series will enable SR-IOV on PowerVM. A specific set of > lids for PFW/PHYP is required. They are planned to release with > 920 at the moment. > > For IBM internal testers let me know of a system you want to test on > and we can

Re: [PATCH v4 3/7] platforms/pseries: Set eeh_pe of EEH_PE_VF type

2018-01-23 Thread Michael Ellerman
"Bryant G. Ly" writes: > To correctly use EEH code one has to make > sure that the EEH_PE_VF is set for dynamic created > VFs. Therefore this patch allocates an eeh_pe of > eeh type EEH_PE_VF and associates PE with parent. > > Signed-off-by: Bryant G. Ly

Re: [PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Michael Ellerman
"Gustavo A. R. Silva" writes: > Assign true or false to boolean variables instead of an integer value. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/macintosh/windfarm_pm72.c | 2

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

2018-01-23 Thread Segher Boessenkool
On Mon, Jan 22, 2018 at 08:52:53AM +0100, Christophe LEROY wrote: > >Just make sure to declare all functions, or define it to some empty > >thing, or #ifdeffery if you have to. There are many options, it is > >not hard, and if it means you have to pull code further apart that is > >not so bad:

[PATCH-next] powerpc/fsl_pci: Use PTR_ERR_OR_ZERO

2018-01-23 Thread Christopher Díaz Riveros
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR This issue was detected by using the Coccinelle software. Signed-off-by: Christopher Díaz Riveros --- arch/powerpc/sysdev/fsl_pci.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/macintosh/windfarm_pm72.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 1/2] powerpc/powernv: Fix trailing semicolon

2018-01-23 Thread Luis de Bethencourt
The trailing semicolon is an empty statement that does no operation. Removing it since it doesn't do anything. Signed-off-by: Luis de Bethencourt --- Hi, After fixing the same thing in drivers/staging/rtl8723bs/, Joe Perches suggested I fix it treewide [0]. Best regards

[PATCH 2/2] KVM: PPC: Book3S HV: Fix trailing semicolon

2018-01-23 Thread Luis de Bethencourt
The trailing semicolon is an empty statement that does no operation. Removing it since it doesn't do anything. Signed-off-by: Luis de Bethencourt --- arch/powerpc/kvm/book3s_xive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2018-01-23 Thread Frank Rowand
On 01/23/18 04:11, Michael Ellerman wrote: > Wolfram Sang writes: > >> Hi Frank, >> >>> Please go back and read the thread for version 1. Simply resubmitting a >>> forward port is ignoring that whole conversation. >>> >>> There is a lot of good info in that thread. I

Re: [PATCH] powerpc/ps3: remove an unneeded NULL check

2018-01-23 Thread Geoff Levand
Hi Dan, On 01/23/2018 12:33 AM, Dan Carpenter wrote: > @@ -43,7 +43,7 @@ void ps3_sys_manager_register_ops(const struct > ps3_sys_manager_ops *ops) > { > BUG_ON(!ops); > BUG_ON(!ops->dev); > - ps3_sys_manager_ops = ops ? *ops : ps3_sys_manager_ops; > + ps3_sys_manager_ops =

[PATCH] powerpc/ps3: remove an unneeded NULL check

2018-01-23 Thread Dan Carpenter
Static checkers don't like the inconsistent NULL checking on "ops". This function is only called once and "ops" isn't NULL so the check can be removed. Signed-off-by: Dan Carpenter diff --git a/drivers/ps3/sys-manager-core.c b/drivers/ps3/sys-manager-core.c index

Re: [PATCH 07/13] ocxl: Add AFU interrupt support

2018-01-23 Thread Cédric Le Goater
On 12/19/2017 04:05 AM, Benjamin Herrenschmidt wrote: > On Mon, 2017-12-18 at 16:21 +0100, Frederic Barrat wrote: >> Add user APIs through ioctl to allocate, free, and be notified of an >> AFU interrupt. >> >> For opencapi, an AFU can trigger an interrupt on the host by sending a >> specific

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

2018-01-23 Thread Jonathan Neuschäfer
On Tue, Jan 23, 2018 at 11:58:06PM +1100, Michael Ellerman wrote: > Jonathan Neuschäfer writes: > > > 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

[PATCH 02/11] powerpc: membarrier: Skip memory barrier in switch_mm() (v7)

2018-01-23 Thread Mathieu Desnoyers
Allow PowerPC to skip the full memory barrier in switch_mm(), and only issue the barrier when scheduling into a task belonging to a process that has registered to use expedited private. Threads targeting the same VM but which belong to different thread groups is a tricky case. It has a few

Re: [PATCH] powerpc: pseries: use irq_of_parse_and_map helper

2018-01-23 Thread Rob Herring
On Tue, Jan 23, 2018 at 12:53 AM, Michael Ellerman wrote: > Rob Herring writes: > >> Instead of calling both of_irq_parse_one and irq_create_of_mapping, call >> of_irq_parse_and_map instead which does the same thing. This gets us closer >> to making the

[PATCH] powerpc/mm/nohash: do not flush the entire mm when range is a single page

2018-01-23 Thread Christophe Leroy
Most of the time, flush_tlb_range() is called on single pages. At the time being, flush_tlb_range() inconditionnaly calls flush_tlb_mm() which flushes at least the entire PID pages and on older CPUs like 4xx or 8xx it flushes the entire TLB table. This patch calls flush_tlb_page() instead of

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

2018-01-23 Thread Michael Ellerman
Jonathan Neuschäfer writes: > 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

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

2018-01-23 Thread Michael Ellerman
Wolfram Sang writes: > Hi Frank, > >> Please go back and read the thread for version 1. Simply resubmitting a >> forward port is ignoring that whole conversation. >> >> There is a lot of good info in that thread. I certainly learned stuff in it. > > Yes, I did that and

Re: [PATCH v8 2/2] cxl: read PHB indications from the device tree

2018-01-23 Thread Frederic Barrat
Le 22/01/2018 à 14:33, Philippe Bergheaud a écrit : Configure the P9 XSL_DSNCTL register with PHB indications found in the device tree, or else use legacy hard-coded values. Signed-off-by: Philippe Bergheaud --- simpler, safer Acked-by: Frederic Barrat

Re: [PATCH v8 1/2] powerpc/powernv: Enable tunneled operations

2018-01-23 Thread Frederic Barrat
Le 22/01/2018 à 14:33, Philippe Bergheaud a écrit : P9 supports PCI tunneled operations (atomics and as_notify). This patch adds support for tunneled operations on powernv, with a new API, to be called by device drivers: pnv_pci_get_tunnel_ind() Tell driver the 16-bit ASN indication used

[PATCH v2 01/13] powerpc/powernv: Introduce new PHB type for opencapi links

2018-01-23 Thread Frederic Barrat
The NPU was already abstracted by opal as a virtual PHB for nvlink, but it helps to be able to differentiate between a nvlink or opencapi PHB, as it's not completely transparent to linux. In particular, PE assignment differs and we'll also need the information in later patches. So rename existing

[PATCH v2 13/13] ocxl: add MAINTAINERS entry

2018-01-23 Thread Frederic Barrat
Signed-off-by: Frederic Barrat Signed-off-by: Andrew Donnellan --- MAINTAINERS | 12 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a6e86e20761e..8a0357f3b7bc 100644 --- a/MAINTAINERS +++

[PATCH v2 12/13] ocxl: Documentation

2018-01-23 Thread Frederic Barrat
ocxl.rst gives a quick, high-level view of opencapi. Update ioctl-number.txt to reflect ioctl numbers being used by the ocxl driver Signed-off-by: Frederic Barrat --- Documentation/ABI/testing/sysfs-class-ocxl | 35 +++ Documentation/accelerators/ocxl.rst

[PATCH v2 11/13] cxl: Remove support for "Processing accelerators" class

2018-01-23 Thread Frederic Barrat
The cxl driver currently declares in its table of supported PCI devices the class "Processing accelerators". Therefore it may be called to probe for opencapi devices, which generates errors, as the config space of a cxl device is not compatible with opencapi. So remove support for the generic

[PATCH v2 10/13] ocxl: Add Makefile and Kconfig

2018-01-23 Thread Frederic Barrat
OCXL_BASE triggers the platform support needed by the driver. Signed-off-by: Frederic Barrat Signed-off-by: Andrew Donnellan --- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/ocxl/Kconfig | 31

[PATCH v2 09/13] ocxl: Add trace points

2018-01-23 Thread Frederic Barrat
Define a few trace points so that we can use the standard tracing mechanism for debug and/or monitoring. Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/afu_irq.c | 5 ++ drivers/misc/ocxl/context.c | 2 + drivers/misc/ocxl/link.c| 11 ++-

[PATCH v2 08/13] ocxl: Add a kernel API for other opencapi drivers

2018-01-23 Thread Frederic Barrat
Some of the functions done by the generic driver should also be needed by other opencapi drivers: attaching a context to an adapter, translation fault handling, AFU interrupt allocation... So to avoid code duplication, the driver provides a kernel API that other drivers can use, similar to

[PATCH v2 07/13] ocxl: Add AFU interrupt support

2018-01-23 Thread Frederic Barrat
Add user APIs through ioctl to allocate, free, and be notified of an AFU interrupt. For opencapi, an AFU can trigger an interrupt on the host by sending a specific command targeting a 64-bit object handle. On POWER9, this is implemented by mapping a special page in the address space of a process

[PATCH v2 06/13] ocxl: Driver code for 'generic' opencapi devices

2018-01-23 Thread Frederic Barrat
Add an ocxl driver to handle generic opencapi devices. Of course, it's not meant to be the only opencapi driver, any device is free to implement its own. But if a host application only needs basic services like attaching to an opencapi adapter, have translation faults handled or allocate AFU

[PATCH v2 05/13] powerpc/powernv: Capture actag information for the device

2018-01-23 Thread Frederic Barrat
In the opencapi protocol, host memory contexts are referenced by a 'actag'. During setup, a driver must tell the device how many actags it can used, and what values are acceptable. On POWER9, the NPU can handle 64 actags per link, so they must be shared between all the PCI functions of the link.

[PATCH v2 04/13] powerpc/powernv: Add platform-specific services for opencapi

2018-01-23 Thread Frederic Barrat
Implement a few platform-specific calls which can be used by drivers: - provide the Transaction Layer capabilities of the host, so that the driver can find some common ground and configure the device and host appropriately. - provide the hw interrupt to be used for translation faults raised

[PATCH v2 03/13] powerpc/powernv: Add opal calls for opencapi

2018-01-23 Thread Frederic Barrat
Add opal calls to interact with the NPU: OPAL_NPU_SPA_SETUP: set the Shared Process Area (SPA) The SPA is a table containing one entry (Process Element) per memory context which can be accessed by the opencapi device. OPAL_NPU_SPA_CLEAR_CACHE: clear the context cache The NPU keeps a cache of

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

2018-01-23 Thread Frederic Barrat
From: Andrew Donnellan The configuration space for opencapi devices doesn't have a PCI Express capability, therefore confusing linux in thinking it's of an old PCI type with a 256-byte configuration space size, instead of the desired 4k. So add a PCI fixup to

[PATCH v2 00/13] New driver to support OpenCAPI devices on POWER9

2018-01-23 Thread Frederic Barrat
This series adds support for Open Coherent Accelerator (ocxl) devices on POWER9 processor. OpenCAPI is a consortium developing the specifications for an interface between processors and accelerators, allowing sharing the host memory with the accelerators, using virtual addresses. The OpenCAPI

Re: [PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:36PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > Currently privilege guest will be run with TM disabled. > > Although the privilege guest cannot initiate a new transaction, > it can use tabort to terminate its problem

Re: [PATCH 22/26] KVM: PPC: Book3S PR: add emulation for trechkpt in PR KVM.

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:35PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > This patch adds host emulation when guest PR KVM executes "trechkpt.", > which is a privileged instruction and will trap into host. > > We firstly copy vcpu ongoing content

Re: [PATCH 21/26] KVM: PPC: Book3S PR: adds emulation for treclaim.

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:34PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > This patch adds support for "treclaim." emulation when PR KVM guest > executes treclaim. and traps to host. > > We will firstly doing treclaim. and save TM checkpoint and

Re: [PATCH 20/26] KVM: PPC: Book3S PR: enable NV reg restore for reading TM SPR at guest privilege state

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:33PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > Currently kvmppc_handle_fac() will not update NV GPRs and thus it can > return with GUEST_RESUME. > > However PR KVM guest always disables MSR_TM bit at privilege state. If PR

Re: [PATCH 19/26] KVM: PPC: Book3S PR: always fail transaction in guest privilege state

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:32PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > Currently kernel doesn't use transaction memory. > And there is an issue for privilege guest that: > tbegin/tsuspend/tresume/tabort TM instructions can impact MSR TM bits >

Re: [PATCH 18/26] KVM: PPC: Book3S PR: make mtspr/mfspr emulation behavior based on active TM SPRs

2018-01-23 Thread Paul Mackerras
On Thu, Jan 11, 2018 at 06:11:31PM +0800, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > The mfspr/mtspr on TM SPRs(TEXASR/TFIAR/TFHAR) are non-privileged > instructions and can be executed at PR KVM guest without trapping > into host in problem state. We only