All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Remove default DMA window before creating DDW
@ 2020-06-19  5:06 Leonardo Bras
  2020-06-19  5:06   ` [PATCH 1/4] powerpc/pseries/iommu: Update call to ibm, query-pe-dma-windows Leonardo Bras
                   ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Leonardo Bras @ 2020-06-19  5:06 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Alexey Kardashevskiy, Leonardo Bras, Thiago Jung Bauermann,
	Ram Pai
  Cc: linuxppc-dev, linux-kernel

There are some devices that only allow 1 DMA window to exist at a time,
and in those cases, a DDW is never created to them, since the default DMA
window keeps using this resource.

LoPAR recommends this procedure:
1. Remove the default DMA window,
2. Query for which configs the DDW can be created,
3. Create a DDW.

Patch #1:
- After LoPAR level 2.8, there is an extension that can make
  ibm,query-pe-dma-windows to have 6 outputs instead of 5. This changes the
  order of the outputs, and that can cause some trouble. 
- query_ddw() was updated to check how many outputs the 
  ibm,query-pe-dma-windows is supposed to have, update the rtas_call() and
  deal correctly with the outputs in both cases.
- This patch looks somehow unrelated to the series, but it can avoid future
  problems on DDW creation.

Patch #2 implements a new rtas call to recover the default DMA window,
in case anything fails after it was removed, and a DDW couldn't be created.

Patch #3 moves the window-removing code from remove_ddw() to
remove_dma_window(), creating a way to delete any DMA window, so it can be
used to delete the default DMA window.

Patch #4 makes use of the remove_dma_window() from patch #3 to remove the
default DMA window before query_ddw() and the rtas call from patch #2
to recover it if something goes wrong.

All patches were tested into an LPAR with an Ethernet VF:
4005:01:00.0 Ethernet controller: Mellanox Technologies MT27700 Family
[ConnectX-4 Virtual Function]

Leonardo Bras (4):
  powerpc/pseries/iommu: Update call to ibm,query-pe-dma-windows
  powerpc/pseries/iommu: Implement ibm,reset-pe-dma-windows rtas call
  powerpc/pseries/iommu: Move window-removing part of remove_ddw into
    remove_dma_window
  powerpc/pseries/iommu: Remove default DMA window before creating DDW

 arch/powerpc/platforms/pseries/iommu.c | 163 +++++++++++++++++++------
 1 file changed, 127 insertions(+), 36 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2020-06-23  3:52 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19  5:06 [PATCH 0/4] Remove default DMA window before creating DDW Leonardo Bras
2020-06-19  5:06 ` [PATCH 1/4] powerpc/pseries/iommu: Update call to ibm,query-pe-dma-windows Leonardo Bras
2020-06-19  5:06   ` [PATCH 1/4] powerpc/pseries/iommu: Update call to ibm, query-pe-dma-windows Leonardo Bras
2020-06-22 10:02   ` [PATCH 1/4] powerpc/pseries/iommu: Update call to ibm,query-pe-dma-windows Alexey Kardashevskiy
2020-06-22 10:02     ` Alexey Kardashevskiy
2020-06-22 18:58     ` Leonardo Bras
2020-06-22 18:58       ` Leonardo Bras
2020-06-23  1:12       ` Alexey Kardashevskiy
2020-06-23  1:12         ` Alexey Kardashevskiy
2020-06-23  2:14         ` Leonardo Bras
2020-06-23  2:14           ` Leonardo Bras
2020-06-23  2:29           ` Alexey Kardashevskiy
2020-06-23  2:29             ` Alexey Kardashevskiy
2020-06-19  5:06 ` [PATCH 2/4] powerpc/pseries/iommu: Implement ibm,reset-pe-dma-windows rtas call Leonardo Bras
2020-06-19  5:06   ` [PATCH 2/4] powerpc/pseries/iommu: Implement ibm, reset-pe-dma-windows " Leonardo Bras
2020-06-22 10:02   ` [PATCH 2/4] powerpc/pseries/iommu: Implement ibm,reset-pe-dma-windows " Alexey Kardashevskiy
2020-06-22 18:58     ` Leonardo Bras
2020-06-22 18:58       ` Leonardo Bras
2020-06-23  1:11       ` Alexey Kardashevskiy
2020-06-23  2:20         ` Leonardo Bras
2020-06-23  2:20           ` Leonardo Bras
2020-06-19  5:06 ` [PATCH 3/4] powerpc/pseries/iommu: Move window-removing part of remove_ddw into remove_dma_window Leonardo Bras
2020-06-22 10:02   ` Alexey Kardashevskiy
2020-06-22 18:59     ` Leonardo Bras
2020-06-22 18:59       ` Leonardo Bras
2020-06-23  1:12       ` Alexey Kardashevskiy
2020-06-23  1:12         ` Alexey Kardashevskiy
2020-06-23  1:33         ` Oliver O'Halloran
2020-06-23  1:33           ` Oliver O'Halloran
2020-06-23  2:26           ` Leonardo Bras
2020-06-23  2:26             ` Leonardo Bras
2020-06-23  2:22         ` Leonardo Bras
2020-06-23  2:22           ` Leonardo Bras
2020-06-19  5:06 ` [PATCH 4/4] powerpc/pseries/iommu: Remove default DMA window before creating DDW Leonardo Bras
2020-06-20  6:13   ` kernel test robot
2020-06-20  6:13     ` kernel test robot
2020-06-20  6:13     ` kernel test robot
2020-06-22 10:02   ` Alexey Kardashevskiy
2020-06-22 18:59     ` Leonardo Bras
2020-06-22 18:59       ` Leonardo Bras
2020-06-23  1:11       ` Alexey Kardashevskiy
2020-06-23  2:31         ` Leonardo Bras
2020-06-23  2:31           ` Leonardo Bras
2020-06-23  2:35           ` Alexey Kardashevskiy
2020-06-23  2:43             ` Leonardo Bras
2020-06-23  2:43               ` Leonardo Bras
2020-06-23  3:52               ` Alexey Kardashevskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.