[PATCH v2 02/16] cxl: Move bare-metal specific code to specialized files

2016-01-30 Thread Frederic Barrat
Move a few functions around to better separate code specific to bare-metal environment from code which will be commonly used between guest and bare-metal. Code specific to bare-metal is meant to be in native.c or pci.c only. It's basically anything which touches the capi p1 registers, some p2

[PATCH v2 00/16] cxl: Add support for powerVM guest

2016-01-30 Thread Frederic Barrat
This series adds support for a CAPI card in a powerVM guest. It requires firmware FW840 and an activation code for CAPI. Note that pHyp only claims support for cxlflash, and not generic support for FPGA CAPI accelerators. cxlflash uses the (slightly modified) Nallatech card, so the memcopy AFU is

Re: Build failure: -Wno-unused-const-variable DNE on old GCC

2016-01-30 Thread Maciej W. Rozycki
On Thu, 7 Jan 2016, Brian Norris wrote: > > Perhaps most uses of -Werror without some CONFIG_ guard > > should be removed or replaced by some other mechanism. > > +1000. I'd personally like to see all one-off uses of -Werror removed. > > > $ git grep -E "=\s*\-Werror" | grep -v CONFIG > > [...]

Re: Build failure: -Wno-unused-const-variable DNE on old GCC

2016-01-30 Thread Joe Perches
On Sat, 2016-01-30 at 14:20 +, Maciej W. Rozycki wrote: > On Thu, 7 Jan 2016, Brian Norris wrote: > > > > Perhaps most uses of -Werror without some CONFIG_ guard > > > should be removed or replaced by some other mechanism. > > > > +1000. I'd personally like to see all one-off uses of -Werror

[PATCH v2 12/16] cxl: sysfs support for guests

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard Filter out a few adapter parameters which don't make sense in a guest. Document the changes. Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe

[PATCH v2 08/16] cxl: New possible return value from hcall

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard The hcalls introduced for CAPI use a possible new value: H_STATE (invalid state). Co-authored-by: Frederic Barrat Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard

[PATCH v2 06/16] cxl: Update cxl_irq() prototype

2016-01-30 Thread Frederic Barrat
The context parameter when calling cxl_irq() should be strongly typed. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard --- drivers/misc/cxl/cxl.h | 2 +-

[PATCH v2 16/16] cxl: Adapter failure handling

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard Check the AFU state whenever an API is called. The hypervisor may issue a reset of the adapter when it detects a fault. When it happens, it launches an error recovery which will either move the AFU to a permanent failure state, or in the

[PATCH v2 04/16] cxl: Rename some bare-metal specific functions

2016-01-30 Thread Frederic Barrat
Rename a few functions, mostly prefixed by 'cxl_', to make clear that the implementation is 'bare-metal' specific. Those functions will have an equivalent implementation for a guest in a later patch. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat

[PATCH v2 07/16] cxl: IRQ allocation for guests

2016-01-30 Thread Frederic Barrat
The PSL interrupt is not going to be multiplexed in a guest, so an interrupt will be allocated for it for each context. It will still be the first interrupt found in the first interrupt range, but is treated almost like any other AFU interrupt when creating/deleting the context. Only the handler

[PATCH v2 15/16] cxl: Support the cxl kernel API from a guest

2016-01-30 Thread Frederic Barrat
Like on bare-metal, the cxl driver in a guest creates a virtual PHB and a pci device for the AFU. The configuration space of the device is mapped to the configuration record of the AFU. Reuse the code defined in afu_cr_read8|16|32() when reading the configuration space of the AFU device. Even

[PATCH v2 14/16] cxl: Parse device tree and create CAPI device(s) at boot

2016-01-30 Thread Frederic Barrat
Add new entry point to scan the device tree at boot in a guest, looking for CAPI devices. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat Signed-off-by: Christophe Lombard ---

[PATCH v2 01/16] cxl: Move common code away from bare-metal-specific files

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard Move around some functions which will be accessed from the bare-metal and guest environments. Code in native.c and pci.c is meant to be bare-metal specific. Other files contain code which may be shared with guests. Co-authored-by: Frederic

[PATCH v2 10/16] cxl: Separate bare-metal fields in adapter and AFU data structures

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard Introduce sub-structures containing the bare-metal specific fields in the structures describing the adapter (struct cxl) and AFU (struct cxl_afu). Update all their references. Co-authored-by: Frederic Barrat

[PATCH v2 09/16] cxl: New hcalls to support CAPI adapters

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard The hypervisor calls provide an interface with a coherent plaform facility and function. It matches version 0.16 of the 'PAPR changes' document. The following hcalls are supported: H_ATTACH_CA_PROCESSAttach a process element to a coherent

[PATCH v2 03/16] cxl: Introduce implementation-specific API

2016-01-30 Thread Frederic Barrat
The backend API lists some low-level functions whose implementation is different on bare-metal and in a guest. Each environment implements its own functions, and the common code uses them through function pointers, defined in cxl_backend_ops Co-authored-by: Christophe Lombard

[PATCH v2 05/16] cxl: Isolate a few bare-metal-specific calls

2016-01-30 Thread Frederic Barrat
A few functions are mostly common between bare-metal and guest and just need minor tuning. To avoid crowding the backend API, introduce a few 'if' based on the CPU being in HV mode. Co-authored-by: Christophe Lombard Signed-off-by: Frederic Barrat

[PATCH v2 11/16] cxl: Add guest-specific code

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard The new of.c file contains code to parse the device tree to find out about CAPI adapters and AFUs. guest.c implements the guest-specific callbacks for the backend API. The process element ID is not known until the context is attached, so we

[PATCH v2 13/16] cxl: Support to flash a new image on the adapter from a guest

2016-01-30 Thread Frederic Barrat
From: Christophe Lombard The new flash.c file contains the logic to flash a new image on the adapter, through a hcall. It is an iterative process, with chunks of data of 1M at a time. There are also 2 phases: write and verify. The flash operation itself is driven

[PATCH] ASoC: fsl-asoc-card: Don't add DAPM routes for ASRC if it doesn't exist

2016-01-30 Thread Nicolin Chen
From: Nicolin Chen There are a pair of warnings when ASRC is absent in the DTB: fsl-asoc-card sound: ASoC: no source widget found for ASRC-Playback fsl-asoc-card sound: ASoC: Failed to add route ASRC-Playback -> direct -> CPU-Playback fsl-asoc-card sound: ASoC: no