Re: [PATCH v2 07/27] ocxl: Add functions to map/unmap LPC memory

2020-01-09 Thread Frederic Barrat
Le 03/12/2019 à 04:46, Alastair D'Silva a écrit : From: Alastair D'Silva Add functions to map/unmap LPC memory Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/config.c| 4 +++ drivers/misc/ocxl/core.c | 50 +++ drivers/misc/ocxl/ocxl_

Re: [PATCH v2 09/27] ocxl: Free detached contexts in ocxl_context_detach_all()

2020-01-09 Thread Frederic Barrat
Le 03/12/2019 à 04:46, Alastair D'Silva a écrit : From: Alastair D'Silva ocxl_context_detach_all() is called from ocxl_function_close(), so there is no reason to leave the contexts allocated, as the caller can do nothing useful with them at that point. This also has the side-effect of freei

Re: [PATCH 1/1] powerpc/eeh: fix deadlock handling dead PHB

2020-02-07 Thread Frederic Barrat
unrelated to the loop. This causes the pe to be, incorrectly, processed more than once. Untangling this section can move the pe processing out of the loop and also outside the locked section, correcting both problems. Signed-off-by: Sam Bobroff --- Reviewed-by: Frederic Barrat Tested-by: Frederic

Re: [PATCH v2 05/27] powerpc: Map & release OpenCAPI LPC memory

2020-02-14 Thread Frederic Barrat
Le 03/12/2019 à 04:46, Alastair D'Silva a écrit : From: Alastair D'Silva This patch adds platform support to map & release LPC memory. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-ocxl.h | 2 ++ arch/powerpc/platforms/powernv/ocxl.c | 42 ++

Re: [PATCH AUTOSEL 5.5 096/542] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-02-17 Thread Frederic Barrat
Le 14/02/2020 à 16:41, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] Hi, Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 doesn't really need to go to stable (any of 4.19, 5.4 and 5.5). While it's probably

Re: [PATCH v3 03/27] powerpc: Map & release OpenCAPI LPC memory

2020-02-25 Thread Frederic Barrat
Le 21/02/2020 à 04:26, Alastair D'Silva a écrit : From: Alastair D'Silva This patch adds platform support to map & release LPC memory. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-ocxl.h | 4 +++ arch/powerpc/platforms/powernv/ocxl.c | 43 +

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-25 Thread Frederic Barrat
Le 21/02/2020 à 04:26, Alastair D'Silva a écrit : From: Alastair D'Silva Function declarations don't need externs, remove the existing ones so they are consistent with newer code Signed-off-by: Alastair D'Silva --- Thanks for the cleanup! Acked-by: Frederic Barrat

Re: [PATCH v3 06/27] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2020-02-25 Thread Frederic Barrat
Le 21/02/2020 à 04:26, Alastair D'Silva a écrit : From: Alastair D'Silva Tally up the LPC memory on an OpenCAPI link & allow it to be mapped Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/core.c | 10 ++ drivers/misc/ocxl/link.c | 53

Re: [PATCH v3 07/27] ocxl: Add functions to map/unmap LPC memory

2020-02-25 Thread Frederic Barrat
Le 21/02/2020 à 04:27, Alastair D'Silva a écrit : From: Alastair D'Silva Add functions to map/unmap LPC memory Signed-off-by: Alastair D'Silva --- It looks ok to me. Acked-by: Frederic Barrat drivers/misc/ocxl/core.c | 51 +++

Re: [PATCH v3 08/27] ocxl: Emit a log message showing how much LPC memory was detected

2020-02-25 Thread Frederic Barrat
Le 21/02/2020 à 04:27, Alastair D'Silva a écrit : From: Alastair D'Silva This patch emits a message showing how much LPC memory & special purpose memory was detected on an OCXL device. Signed-off-by: Alastair D'Silva --- Acked-by: Frederic Barrat drivers/mis

Re: [PATCH] ocxl: Fix misleading comment

2020-02-25 Thread Frederic Barrat
was intended. Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices") Cc: Frederic Barrat Signed-off-by: Andrew Donnellan --- ocxl_context_init() used to exist. It was renamed to ocxl_context_alloc() for good reasons as part of later work. So it should real

[PATCH 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2019-09-09 Thread Frederic Barrat
PE, otherwise the pci_dev will never be released. Which is not really a surprise as the comment (removed here as no longer needed) was stating as much. Fixes: 902bdc57451c ("powerpc/powernv/idoa: Remove unnecessary pcidev from pci_dn") Signed-off-by: Frederic Barrat --- arch/powerp

[PATCH 03/11] powerpc/powernv/ioda: set up PE on opencapi device when enabling

2019-09-09 Thread Frederic Barrat
f the reconfiguration of the bridge, but for opencapi PHBs, we don't have an intermediate bridge. So let's define the PE when the device is enabled. PEs are meaningless for opencapi, the NPU doesn't define them and opal is not doing anything with them. Signed-off-by: Frederic Barrat --- ar

[PATCH 04/11] powerpc/powernv/ioda: Release opencapi device

2019-09-09 Thread Frederic Barrat
minor tuning. Also separate the undo of the PELT-V code in a separate function, it is not needed for NPU devices and it improves a bit the readability of the code. Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 59 +++ 1 file changed, 39 inser

[PATCH 02/11] powerpc/powernv/ioda: Protect PE list

2019-09-09 Thread Frederic Barrat
Protect the PHB's list of PE. Probably not needed as long as it was populated during PHB creation, but it feels right and will become required once we can add/remove opencapi devices on hotplug. Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +- 1

[PATCH 00/11] opencapi: enable card reset and link retraining

2019-09-09 Thread Frederic Barrat
d part is modifications to the PCI hotplug driver on powernv, so that a virtual slot is created for the opencapi adapters found in the device tree. Frederic Barrat (11): powerpc/powernv/ioda: Fix ref count for devices with their own PE powerpc/powernv/ioda: Protect PE list powerpc/powernv/ioda:

[PATCH 05/11] powerpc/powernv/ioda: Find opencapi slot for a device node

2019-09-09 Thread Frederic Barrat
27;s build it from the PHB ID, like skiboot. Signed-off-by: Frederic Barrat --- arch/powerpc/include/asm/pnv-pci.h | 1 + arch/powerpc/platforms/powernv/pci.c | 10 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/i

[PATCH 11/11] ocxl: Add PCI hotplug dependency to Kconfig

2019-09-09 Thread Frederic Barrat
The PCI hotplug framework is used to update the devices when a new image is written to the FPGA. Signed-off-by: Frederic Barrat --- drivers/misc/ocxl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/ocxl/Kconfig b/drivers/misc/ocxl/Kconfig index 1916fa65f2f2

[PATCH 07/11] pci/hotplug/pnv-php: Improve error msg on power state change failure

2019-09-09 Thread Frederic Barrat
ly. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 5b5cbf1e636d..304bdbcdb77c 100644 --- a/drivers/pci/hotplug/pnv_php.c ++

[PATCH 09/11] pci/hotplug/pnv-php: Relax check when disabling slot

2019-09-09 Thread Frederic Barrat
state. Removing the devices will do nothing since it's not populated, and we'll set the power state of the slot back to off. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_

[PATCH 08/11] pci/hotplug/pnv-php: Register opencapi slots

2019-09-09 Thread Frederic Barrat
Add the opencapi PHBs to the list of PHBs being scanned to look for slots. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 304bdbcdb77c

[PATCH 10/11] pci/hotplug/pnv-php: Wrap warnings in macro

2019-09-09 Thread Frederic Barrat
n opencapi slot. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 51 +++ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 5ca51d67db4b..d01a8595bc5c 100644 --- a/driv

[PATCH 06/11] pci/hotplug/pnv-php: Remove erroneous warning

2019-09-09 Thread Frederic Barrat
ial to assert the correct value, let's remove the warning. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 6758fd7c382e..5b5cbf1e636d 100644 ---

Re: [PATCH 3/5] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Tally up the LPC memory on an OpenCAPI link & allow it to be mapped Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/core.c | 9 + drivers/misc/ocxl/link.c | 61 +

Re: [PATCH 2/5] powerpc: Map & release OpenCAPI LPC memory

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Map & release OpenCAPI LPC memory. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-ocxl.h | 2 ++ arch/powerpc/platforms/powernv/ocxl.c | 42 +++ 2 files changed, 44 ins

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:43, Alastair D'Silva a écrit : From: Alastair D'Silva Add functions to map/unmap LPC memory Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/config.c| 4 +++ drivers/misc/ocxl/core.c | 50 +++ drivers/misc/ocxl/link.

Re: [PATCH 2/5] powerpc: Map & release OpenCAPI LPC memory

2019-09-19 Thread Frederic Barrat
Le 19/09/2019 à 02:58, Alastair D'Silva a écrit : On Wed, 2019-09-18 at 16:03 +0200, Frederic Barrat wrote: Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Map & release OpenCAPI LPC memory. Signed-off-by: Alastair D'Silva --- arch

Re: [PATCH 3/5] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2019-09-19 Thread Frederic Barrat
Le 19/09/2019 à 06:55, Alastair D'Silva a écrit : On Wed, 2019-09-18 at 16:02 +0200, Frederic Barrat wrote: Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Tally up the LPC memory on an OpenCAPI link & allow it to be mapped Signed-off-b

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-23 Thread Frederic Barrat
diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c index 2874811a4398..9e303a5f4d85 100644 --- a/drivers/misc/ocxl/link.c +++ b/drivers/misc/ocxl/link.c @@ -738,7 +738,7 @@ int ocxl_link_add_lpc_mem(void *link_handle, u64 size) } EXPORT_SYMBOL_GPL(ocxl_link_add_lpc_mem);

Re: [PATCH 00/11] opencapi: enable card reset and link retraining

2019-09-23 Thread Frederic Barrat
ned up. The second part is modifications to the PCI hotplug driver on powernv, so that a virtual slot is created for the opencapi adapters found in the device tree. Frederic Barrat (11): powerpc/powernv/ioda: Fix ref count for devices with their own PE powerpc/powernv/ioda: Protect PE list

Re: [PATCH 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2019-09-26 Thread Frederic Barrat
Le 26/09/2019 à 18:44, Andrew Donnellan a écrit : On 9/9/19 5:45 pm, Frederic Barrat wrote: Taking a reference on the pci_dev structure was required with initial commit 184cd4a3b962 ("powerpc/powernv: PCI support for p7IOC under OPAL v2"), where we were storing the pci_dev in

[RFC PATCH] powernv/eeh: Fix oops when probing cxl devices

2019-09-27 Thread Frederic Barrat
structure. Fixes: b905f8cdca77 ("powerpc/eeh: EEH for pSeries hot plug") Signed-off-by: Frederic Barrat --- Sending as an RFC, as I'm afraid of hiding potential issues and would be interested in comments. The powernv eeh code expects a struct pci_dn, so the fix seems safe. I'

Re: [PATCH 1/2] powerpc/powernv: ocxl move SPA definition

2019-10-14 Thread Frederic Barrat
diff --git a/arch/powerpc/platforms/powernv/ocxl.c b/arch/powerpc/platforms/powernv/ocxl.c index 8c65aacda9c8..4d26cba12b63 100644 --- a/arch/powerpc/platforms/powernv/ocxl.c +++ b/arch/powerpc/platforms/powernv/ocxl.c @@ -12,11 +12,54 @@ #define PNV_OCXL_PASID_BITS 15 #define PN

Re: [PATCH 2/2] powerpc/powernv: ocxl move TL definition

2019-10-14 Thread Frederic Barrat
Le 09/10/2019 à 17:11, christophe lombard a écrit : Specifies the templates in the Transaction Layer that the OpenCAPI device/host support when transmitting/receiving DL/DLX frames to or from the OpenCAPI device/host. Update, rename and create new few platform-specific calls which can be used

Re: [EXTERNAL] [RFC PATCH] powernv/eeh: Fix oops when probing cxl devices

2019-10-15 Thread Frederic Barrat
Le 15/10/2019 à 07:42, Sam Bobroff a écrit : On Fri, Sep 27, 2019 at 02:45:10PM +0200, Frederic Barrat wrote: Recent cleanup in the way EEH support is added to a device causes a kernel oops when the cxl driver probes a device and creates virtual devices discovered on the FPGA: BUG

Re: [EXTERNAL] [RFC PATCH] powernv/eeh: Fix oops when probing cxl devices

2019-10-16 Thread Frederic Barrat
Le 15/10/2019 à 21:41, Frederic Barrat a écrit : Le 15/10/2019 à 07:42, Sam Bobroff a écrit : On Fri, Sep 27, 2019 at 02:45:10PM +0200, Frederic Barrat wrote: Recent cleanup in the way EEH support is added to a device causes a kernel oops when the cxl driver probes a device and creates

[PATCH] powernv/eeh: Fix oops when probing cxl devices

2019-10-16 Thread Frederic Barrat
structure. The cxl driver doesn't create virtual devices on pseries so this patch doesn't fix it there intentionally. Fixes: b905f8cdca77 ("powerpc/eeh: EEH for pSeries hot plug") Signed-off-by: Frederic Barrat --- Sam: I'm resubmitting indentically as the RFC after

Re: [PATCH] cxl: make cxl_class constant

2023-10-25 Thread Frederic Barrat
: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/cxl/file.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/dr

Re: [PATCH] ocxl: make ocxl_class constant

2023-10-25 Thread Frederic Barrat
: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) di

Re: [PATCH] misc: ocxl: context: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:15, Li zeming wrote: The ctx pointer does not need to cast the type. Signed-off-by: Li zeming --- Indeed, it's useless. Acked-by: Frederic Barrat drivers/misc/ocxl/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc

Re: [PATCH] misc: ocxl: afu_irq: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:22, Li zeming wrote: The irq pointer does not need to cast the type. Signed-off-by: Li zeming --- Acked-by: Frederic Barrat Fred drivers/misc/ocxl/afu_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ocxl/afu_irq.c b

Re: [PATCH] misc: ocxl: link: Remove unnecessary (void*) conversions

2023-11-14 Thread Frederic Barrat
On 13/11/2023 02:45, Li zeming wrote: The link pointer does not need to cast the type. Signed-off-by: Li zeming --- Acked-by: Frederic Barrat Fred drivers/misc/ocxl/link.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/misc/ocxl

Re: [PATCH] powerpc/powernv/pci: use pci_dev_id() to simplify the code

2023-08-04 Thread Frederic Barrat
On 04/08/2023 10:04, Xiongfeng Wang wrote: PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Xiongfeng Wang --- LGTM Reviewed-by: Frederic Barrat

Re: [PATCH] ocxl: Use pci_dev_id() to simplify the code

2023-08-11 Thread Frederic Barrat
On 11/08/2023 12:20, Zheng Zengkai wrote: PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Zheng Zengkai --- LGTM Acked-by: Frederic Barrat

Re: [PATCH] cxl/ocxl: Possible repeated word

2023-06-20 Thread Frederic Barrat
Hello, While the correction in the comment is of course ok, the patch was sent as html. You may want to check/fix how it was submitted. Fred On 18/06/2023 17:08, zhumao...@208suo.com wrote: Delete repeated word in comment. Signed-off-by: Zhu Mao  208suo. com> --- drivers/misc/cxl/native.

Re: [PATCH] misc: ocxl: fix possible refcount leak in afu_ioctl()

2022-08-24 Thread Frederic Barrat
GTM Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 6777c419a8da..d46dba2df5a1 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -257,6 +257,8 @@ s

Re: [PATCH v3] powerpc/pseries/vas: Add VAS IRQ primary handler

2022-10-11 Thread Frederic Barrat
bottom half if this flag is set. Signed-off-by: Haren Myneni --- That version looks good to me. Reviewed-by: Frederic Barrat Fred v3: Update pending_faults usage in changelog v2: Use the pending_faults counter for the second interrupt and process it with the previous interrupt handling

Re: [PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-04 Thread Frederic Barrat
On 04/12/2023 03:07, Kunwu Chan wrote: kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file changed

Re: [PATCH v2] cxl: Fix null pointer dereference in cxl_get_fd

2024-01-15 Thread Frederic Barrat
edump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan Cc: Kunwu Chan Suggested-by: Frederic Barrat --- Thanks! Acked-by: Frederic Barrat Fred v2: Deal with error path --- drivers/misc/cxl/api.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-)

[PATCH] powerpc/powernv/ioda: Skip unallocated resources when mapping to PE

2023-01-20 Thread Frederic Barrat
64-bit mem resources, as the address of the resource is checked to be within the range of the 64-bit mmio window. See pnv_ioda_reserve_dev_m64_pe() and pnv_pci_is_m64(). Reported-by: Andrew Jeffery Fixes: 23e79425fe7c ("powerpc/powernv: Simplify pnv_ioda_setup_pe_seg()") Signed-off

Re: [PATCH AUTOSEL 5.4 101/330] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-09-17 Thread Frederic Barrat
Le 18/09/2020 à 03:57, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This patch is not desirable for stable, for 5.4 and 4.19 (it was already flagged by autosel back in April. Not sure why it's showing again now) Fred

Re: [PATCH] ocxl: fix kconfig dependency warning for OCXL

2020-09-18 Thread Frederic Barrat
zil Yildiran --- OK, that makes sense, thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/ocxl/Kconfig b/drivers/misc/ocxl/Kconfig index 6551007a066c..947294f6d7f4 100644 --- a/drivers/misc

Re: [PATCH AUTOSEL 5.4 101/330] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-09-21 Thread Frederic Barrat
Le 19/09/2020 à 20:10, Sasha Levin a écrit : On Fri, Sep 18, 2020 at 08:35:06AM +0200, Frederic Barrat wrote: Le 18/09/2020 à 03:57, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] This patch is not desirable for stable, for

Re: [PATCH -next] ocxl: simplify the return expression of free_function_dev()

2020-09-21 Thread Frederic Barrat
Le 21/09/2020 à 15:10, Qinglang Miao a écrit : Simplify the return expression. Signed-off-by: Qinglang Miao --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/core.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/misc/ocxl/core.c b/drivers

Re: [PATCH v2 20/39] docs: ABI: testing: make the files compatible with ReST output

2020-10-30 Thread Frederic Barrat
sting/sysfs-class-ocxl| 3 + Patches 20, 28 and 31 look good for cxl and ocxl. Acked-by: Frederic Barrat Fred

Re: [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description

2020-11-02 Thread Frederic Barrat
on parameter 'device' description in 'get_function_0' Cc: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/config.c | 2 +- 1

Re: [PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-14 Thread Frederic Barrat
On 11/11/2022 15:59, Yang Yingliang wrote: If device_register() returns error in ocxl_file_register_afu(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put

Re: [PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-14 Thread Frederic Barrat
On 14/11/2022 12:46, Yang Yingliang wrote: Hi, On 2022/11/14 19:23, Frederic Barrat wrote: On 11/11/2022 15:59, Yang Yingliang wrote: If device_register() returns error in ocxl_file_register_afu(), the name allocated by dev_set_name() need be freed. As comment of device_register() says

Re: [PATCH 1/2] cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
egister() to see how frequently it changed. I can now rest easy :-) Acked-by: Frederic Barrat Fred drivers/misc/cxl/guest.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index 375f69

Re: [PATCH 2/2] cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
f-by: Yang Yingliang --- Acked-by: Frederic Barrat Fred drivers/misc/cxl/pci.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 3de0aea62ade..6d495d641c95 100644 --- a/drivers/misc/cxl/pci.c +++

Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-24 Thread Frederic Barrat
Yingliang --- Thanks for fixing it! Acked-by: Frederic Barrat Fred v1 -> v2: Add comment above get_dvsec_vendor0(). Get reference where dev is function 0, and call pci_dev_put() unconditionally in callers. --- drivers/misc/ocxl/config.c | 20 +++- 1 fil

Re: [PATCH] cxl: Remove unnecessary cxl_pci_window_alignment()

2022-12-05 Thread Frederic Barrat
returning 1 if the function pointer is NULL, which is the same was what cxl_pci_window_alignment() does. cxl_pci_window_alignment() is unnecessary, so remove it. No functional change intended. Signed-off-by: Bjorn Helgaas --- Thanks! Acked-by: Frederic Barrat Fred drivers/misc/cxl/vphb.c

Re: [PATCH kernel] powerpc/iommu: Annotate nested lock for lockdep

2021-02-18 Thread Frederic Barrat
On 16/02/2021 04:20, Alexey Kardashevskiy wrote: The IOMMU table is divided into pools for concurrent mappings and each pool has a separate spinlock. When taking the ownership of an IOMMU group to pass through a device to a VM, we lock these spinlocks which triggers a false negative warning in

Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly

2021-03-10 Thread Frederic Barrat
On 10/03/2021 18:44, Laurent Dufour wrote: It is better to rely on the API provided by the MM layer instead of directly manipulating the mm_users field. Signed-off-by: Laurent Dufour --- Thanks! Acked-by: Frederic Barrat drivers/misc/cxl/fault.c | 2 +- 1 file changed, 1

Re: [PATCH] cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h

2022-04-06 Thread Frederic Barrat
On 02/04/2022 11:52, Christophe Leroy wrote: powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy --- LGTM Acked-by: Frederic Barrat drivers/misc

Re: [PATCH kernel] KVM: PPC: Fix TCE handling for VFIO

2022-04-06 Thread Frederic Barrat
ith smaller physical pages") Signed-off-by: Alexey Kardashevskiy --- FWIW: Reviewed-by: Frederic Barrat arch/powerpc/kvm/book3s_64_vio.c| 45 +++-- arch/powerpc/kvm/book3s_64_vio_hv.c | 44 ++-- 2 files changed, 45 insertions(+), 4

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-19 Thread Frederic Barrat
tch. In any case: Acked-by: Frederic Barrat Fred drivers/misc/ocxl/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index d881f5e40ad9..6777c419a8da 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/fil

Re: [PATCH] misc: ocxl: fix possible double free in ocxl_file_register_afu

2022-04-21 Thread Frederic Barrat
On 21/04/2022 00:54, Michael Ellerman wrote: Hangyu Hua writes: info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Double frees are often exploitable. But it looks to me like this error p

[PATCH] Revert "powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs"

2021-05-26 Thread Frederic Barrat
02:01:00.0: mlx5_frag_buf_alloc_node:146:(pid 13402): unexpected map alignment: 0x08c61000, page_shift=16 [ 1515.763635] mlx5_core c002:01:00.0: mlx5_cqwq_create:181:(pid 13402): mlx5_frag_buf_alloc_node() failed, -12 Signed-off-by: Frederic Barrat --- arch/powerpc/kernel/iommu.c

Re: [PATCH] Revert "powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs"

2021-05-26 Thread Frederic Barrat
On 27/05/2021 04:13, Alexey Kardashevskiy wrote: On 27/05/2021 00:45, Frederic Barrat wrote: This reverts commit 3c0468d4451eb6b4f6604370639f163f9637a479. That commit was breaking alignment guarantees for the DMA address when allocating coherent mappings, as described in Documentation/core

Re: [PATCH 2/2 v2] powerpc/powernv: Enable and setup PCI P2P

2020-08-11 Thread Frederic Barrat
Le 03/08/2020 à 09:35, Oliver O'Halloran a écrit : On Thu, Apr 30, 2020 at 11:15 PM Max Gurtovoy wrote: diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 57d3a6a..9ecc576 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch

[PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-19 Thread Frederic Barrat
state") Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index c9c25fb0783c..023a4f987bb2 100644 --- a/arch/powerpc

Re: [PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-19 Thread Frederic Barrat
Le 19/08/2020 à 15:15, Oliver O'Halloran a écrit : On Wed, Aug 19, 2020 at 11:07 PM Frederic Barrat wrote: Fix typo introduced during recent code cleanup, which could lead to silently not freeing resources or oops message (on PCI hotplug or CAPI reset). oof Did you actually hit

Re: [PATCH] powerpc/powernv/pci: Fix typo when releasing DMA resources

2020-08-20 Thread Frederic Barrat
Le 20/08/2020 à 06:18, Michael Ellerman a écrit : I changed the subject to: powerpc/powernv/pci: Fix possible crash when releasing DMA resources Much better, thanks! Fred

Re: [PATCH v6 02/11] powerpc/kernel/iommu: Add new iommu_table_in_use() helper

2021-08-27 Thread Frederic Barrat
ck it in the new helper. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Looks ok to me now, thanks! Reviewed-by: Frederic Barrat arch/powerpc/include/asm/iommu.h | 1 + arch/powerpc/kernel/iommu.c | 61 2 files changed, 32 inser

Re: [PATCH v6 06/11] powerpc/pseries/iommu: Add ddw_property_create() and refactor enable_ddw()

2021-08-27 Thread Frederic Barrat
lper clean_dma_window() was needed to clean anything that could left if walk_system_ram_range() fails. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Thanks for fixing the error paths Reviewed-by: Frederic Barrat arch/powerpc/platforms/pseries/iommu.c |

Re: [PATCH v6 08/11] powerpc/pseries/iommu: Update remove_dma_window() to accept property name

2021-08-27 Thread Frederic Barrat
check if the property was found while removing the active DDW. This allows skipping the remaining property names while reducing the impact of multiple property names. Signed-off-by: Leonardo Bras Reviewed-by: Alexey Kardashevskiy --- Reviewed-by: Frederic Barrat arch/powerpc/platforms

Re: [PATCH v6 10/11] powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-08-27 Thread Frederic Barrat
havior. So a new property name DMA64_PROPNAME "linux,dma64-ddr-window-info" was created to represent a DDW that does not allow direct mapping. Signed-off-by: Leonardo Bras --- I think it looks ok now as it was mostly me who was misunderstanding one part of the previous iteration. Revi

Re: [PATCH 5/7] PCI: Add pci_find_dvsec_capability to find designated VSEC

2021-09-22 Thread Frederic Barrat
c-dev@lists.ozlabs.org Cc: Frederic Barrat Cc: Andrew Donnellan Signed-off-by: Ben Widawsky --- LGTM Reviewed-by: Frederic Barrat drivers/pci/pci.c | 32 include/linux/pci.h | 1 + 2 files changed, 33 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/

Re: [PATCH 7/7] ocxl: Use pci core's DVSEC functionality

2021-09-22 Thread Frederic Barrat
On 22/09/2021 02:44, Dan Williams wrote: On Tue, Sep 21, 2021 at 3:05 PM Ben Widawsky wrote: Reduce maintenance burden of DVSEC query implementation by using the centralized PCI core implementation. Cc: linuxppc-dev@lists.ozlabs.org Cc: Frederic Barrat Cc: Andrew Donnellan Signed-off-by

Re: [PATCH kernel] powerps/pseries/dma: Add support for 2M IOMMU page size

2021-09-29 Thread Frederic Barrat
oop to not assume that shift[] is sorted. Signed-off-by: Alexey Kardashevskiy --- Looks ok to me Reviewed-by: Frederic Barrat This might not work if PHYP keeps rejecting new window requests for less than 32768 TCEs. This is needed: https://github.com/aik/li

Re: [PATCH v5 10/11] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver

2021-09-30 Thread Frederic Barrat
On 29/09/2021 17:44, Andrew Donnellan wrote: On 29/9/21 11:43 pm, Uwe Kleine-König wrote:> I'm not a huge fan either, I used it to keep the control flow as is and without introducing several calls to to_pci_driver. The whole code looks as follows: list_for_each_entry(afu_dev, &afu->phb-

Re: [PATCH kernel 0/4] Fixes for powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-11-17 Thread Frederic Barrat
On 02/11/2021 03:43, Michael Ellerman wrote: On Thu, 21 Oct 2021 00:23:11 +1100, Alexey Kardashevskiy wrote: Found some issues on SRIOV enabled PHYP. It probably should be one patch, or not? Please comment. Thanks. [...] Patches 2-4 applied to powerpc/fixes. Any reason why patch 1 wa

Re: [PATCH kernel 0/4] Fixes for powerpc/pseries/iommu: Make use of DDW for indirect mapping

2021-11-17 Thread Frederic Barrat
On 17/11/2021 11:19, Frederic Barrat wrote: On 02/11/2021 03:43, Michael Ellerman wrote: On Thu, 21 Oct 2021 00:23:11 +1100, Alexey Kardashevskiy wrote: Found some issues on SRIOV enabled PHYP. It probably should be one patch, or not? Please comment. Thanks. [...] Patches 2-4

Re: [PATCH] ocxl: Mmio invalidation support

2020-11-16 Thread Frederic Barrat
On 13/11/2020 16:33, Christophe Lombard wrote: OpenCAPI 4.0/5.0 with TLBI/SLBI Snooping, is not used due to performance problems caused by the PAU having to process all incoming TLBI/SLBI commands which will cause them to back up on the PowerBus. When the Address Translation Mode requires TLB

Re: [PATCH V2 1/5] ocxl: Assign a register set to a Logical Partition

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: Platform specific function to assign a register set to a Logical Partition. The "ibm,mmio-atsd" property, provided by the firmware, contains the 16 base ATSD physical addresses (ATSD0 through ATSD15) of the set of MMIO registers (XTS MMIO ATSDx LP

Re: [PATCH V2 2/5] ocxl: Initiate a TLB invalidate command

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: When a TLB Invalidate is required for the Logical Partition, the following sequence has to be performed: 1. Load MMIO ATSD AVA register with the necessary value, if required. 2. Write the MMIO ATSD launch register to initiate the TLB Invalidate

Re: [PATCH V2 3/5] ocxl: Update the Process Element Entry

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: To complete the MMIO based mechanism, the fields: PASID, bus, device and function of the Process Element Entry have to be filled. (See OpenCAPI Power Platform Architecture document) Hypervisor Process Element Entry Word 0

Re: [PATCH V2 4/5] ocxl: Add mmu notifier

2020-11-23 Thread Frederic Barrat
On 20/11/2020 18:32, Christophe Lombard wrote: Add invalidate_range mmu notifier, when required (ATSD access of MMIO registers is available), to initiate TLB invalidation commands. For the time being, the ATSD0 set of registers is used by default. The pasid and bdf values have to be configure

Re: [PATCH 3/3] selftests/powerpc: Add VF recovery tests

2020-11-24 Thread Frederic Barrat
On 03/11/2020 05:45, Oliver O'Halloran wrote: --- a/tools/testing/selftests/powerpc/eeh/eeh-functions.sh +++ b/tools/testing/selftests/powerpc/eeh/eeh-functions.sh @@ -135,3 +135,111 @@ eeh_one_dev() { return 0; } +eeh_has_driver() { + test -e /sys/bus/pci/devices/$1/drive

Re: [PATCH V3 1/5] ocxl: Assign a register set to a Logical Partition

2020-11-25 Thread Frederic Barrat
MMIO ATSDx LPARID/AVA/launch/status register). For the time being, the ATSD0 set of registers is used by default. Signed-off-by: Christophe Lombard --- Looks good, thanks for the updates! Acked-by: Frederic Barrat arch/powerpc/include/asm/pnv-ocxl.h | 3 ++ arch/powerpc/platforms/powe

Re: [PATCH V3 2/5] ocxl: Initiate a TLB invalidate command

2020-11-25 Thread Frederic Barrat
On 24/11/2020 10:58, Christophe Lombard wrote: When a TLB Invalidate is required for the Logical Partition, the following sequence has to be performed: 1. Load MMIO ATSD AVA register with the necessary value, if required. 2. Write the MMIO ATSD launch register to initiate the TLB Invalidate c

Re: [PATCH V3 3/5] ocxl: Update the Process Element Entry

2020-11-25 Thread Frederic Barrat
Reserved 5 Reserved 6 Signed-off-by: Christophe Lombard --- LGTM Acked-by: Frederic Barrat drivers/misc/ocxl/context.c | 4 +++- drivers/misc/ocxl/link.c | 4 +++- drivers/misc/ocxl/ocxl_internal.h | 9

Re: [PATCH V3 4/5] ocxl: Add mmu notifier

2020-11-25 Thread Frederic Barrat
configured in the Process Element Entry. The PEE must be set up to match the BDF/PASID of the AFU. Signed-off-by: Christophe Lombard --- That looks ok too. Acked-by: Frederic Barrat drivers/misc/ocxl/link.c | 62 +++- 1 file changed, 61 insertions(+), 1

Re: [PATCH V3 5/5] ocxl: Add new kernel traces

2020-11-25 Thread Frederic Barrat
On 24/11/2020 10:58, Christophe Lombard wrote: Add specific kernel traces which provide information on mmu notifier and on pages range. Signed-off-by: Christophe Lombard --- Acked-by: Frederic Barrat drivers/misc/ocxl/link.c | 4 +++ drivers/misc/ocxl/trace.h | 64

Re: [PATCH V4 2/5] ocxl: Initiate a TLB invalidate command

2020-11-26 Thread Frederic Barrat
command. 3. Poll the MMIO ATSD status register to determine when the TLB Invalidate has been completed. Signed-off-by: Christophe Lombard --- Thanks! Acked-by: Frederic Barrat arch/powerpc/include/asm/pnv-ocxl.h | 51 arch/powerpc/platforms/powernv/ocxl.c | 69

[PATCH] powerpc/pseries: Define PCI bus speed for Gen4 and Gen5

2020-11-30 Thread Frederic Barrat
Update bus speed definition for PCI Gen4 and 5. Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/pseries/pci.c | 51 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c

Re: [PATCH kernel v2] powerpc/pci: Remove LSI mappings on device teardown

2020-12-01 Thread Frederic Barrat
On 01/12/2020 08:39, Alexey Kardashevskiy wrote: From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table entries related to the adapter. If some are s

Re: [PATCH kernel v3] powerpc/pci: Remove LSI mappings on device teardown

2020-12-02 Thread Frederic Barrat
, this adds tracking of virq to unmap them only when the last user is gone. Signed-off-by: Oliver O'Halloran [aik: added refcounter] Signed-off-by: Alexey Kardashevskiy --- Looks ok to me. Reviewed-by: Frederic Barrat Changes: v3: * free @vi on error path v2: * added refcounter ---

Re: [PATCH v2 -next] misc: ocxl: use DEFINE_MUTEX() for mutex lock

2021-01-04 Thread Frederic Barrat
On 24/12/2020 14:24, Zheng Yongjun wrote: mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun --- Thanks! Acked-by: Frederic Barrat drivers/misc/ocxl/file.c | 3 +-- 1 file changed, 1 insertion

<    1   2   3   4   5   6   7   8   >