linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Allow restricted-dma-pool to customize IO_TLB_SEGSIZE
@ 2021-11-23 11:21 Hsin-Yi Wang
  2021-11-23 11:21 ` [PATCH 1/3] dma: swiotlb: " Hsin-Yi Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Hsin-Yi Wang @ 2021-11-23 11:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Marek Szyprowski, Robin Murphy, iommu, linux-kernel, Rob Herring,
	Maxime Ripard, -,
	devicetree, Matthias Brugger, linux-arm-kernel, linux-mediatek,
	senozhatsky, tfiga

Default IO_TLB_SEGSIZE (128) slabs may be not enough for some use cases.
This series adds support to customize io_tlb_segsize for each
restricted-dma-pool.

Example use case:

mtk-isp drivers[1] are controlled by mtk-scp[2] and allocate memory through
mtk-scp. In order to use the noncontiguous DMA API[3], we need to use
the swiotlb pool. mtk-scp needs to allocate memory with 2560 slabs.
mtk-isp drivers also needs to allocate memory with 200+ slabs. Both are
larger than the default IO_TLB_SEGSIZE (128) slabs.

[1] (not in upstream) https://patchwork.kernel.org/project/linux-media/cover/20190611035344.29814-1-jungo.lin@mediatek.com/
[2] https://elixir.bootlin.com/linux/latest/source/drivers/remoteproc/mtk_scp.c
[3] https://patchwork.kernel.org/project/linux-media/cover/20210909112430.61243-1-senozhatsky@chromium.org/

Hsin-Yi Wang (3):
  dma: swiotlb: Allow restricted-dma-pool to customize IO_TLB_SEGSIZE
  dt-bindings: Add io-tlb-segsize property for restricted-dma-pool
  arm64: dts: mt8183: use restricted swiotlb for scp mem

 .../reserved-memory/shared-dma-pool.yaml      |  8 +++++
 .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi |  4 +--
 include/linux/swiotlb.h                       |  1 +
 kernel/dma/swiotlb.c                          | 34 ++++++++++++++-----
 4 files changed, 37 insertions(+), 10 deletions(-)

-- 
2.34.0.rc2.393.gf8c9666880-goog


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

end of thread, other threads:[~2021-12-03 13:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 11:21 [PATCH 0/3] Allow restricted-dma-pool to customize IO_TLB_SEGSIZE Hsin-Yi Wang
2021-11-23 11:21 ` [PATCH 1/3] dma: swiotlb: " Hsin-Yi Wang
2021-11-23 11:21 ` [PATCH 2/3] dt-bindings: Add io-tlb-segsize property for restricted-dma-pool Hsin-Yi Wang
2021-11-23 16:34   ` Rob Herring
2021-11-23 11:21 ` [PATCH 3/3] arm64: dts: mt8183: use restricted swiotlb for scp mem Hsin-Yi Wang
2021-11-23 11:58 ` [PATCH 0/3] Allow restricted-dma-pool to customize IO_TLB_SEGSIZE Robin Murphy
2021-11-24  3:55   ` Hsin-Yi Wang
2021-11-24 12:34     ` Robin Murphy
2021-11-25  7:35   ` Tomasz Figa
2021-12-03 13:07     ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).