mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] dma: give dma_alloc_coherent a device parameter
@ 2024-10-14 12:58 Ahmad Fatoum
  2024-10-14 12:58 ` [PATCH 1/6] dma: make DMA_ADDRESS_BROKEN type-safe Ahmad Fatoum
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-10-14 12:58 UTC (permalink / raw)
  To: barebox; +Cc: Denis Orlov

Devices can be inherently DMA coherent and thus dma_alloc_coherent could
be implemented as a normal allocation.

While using uncached memory in this case isn't wrong, it can lead
to a a very stark performance degradation as identified in this patch[1]
when barebox ran under KVM.

Additionally, devices may have addressing limitations
(dma_set_coherent_mask) or a non-1:1 mapping in the coherent DMA case.

Therefore, let's do what we already do for streaming DMA and give the
coherent/writecombine DMA functions an extra device parameter.

This parameter is currently unused, but in future we can use it to
handle devices that are already DMA coherent specially.

[1]: https://lore.barebox.org/barebox/20241009060511.4121157-6-a.fatoum@pengutronix.de/

Ahmad Fatoum (6):
  dma: make DMA_ADDRESS_BROKEN type-safe
  video: stm: use DMA_ADDRESS_BROKEN instead of NULL
  crypto: caam - pbl-init: use DMA_ADDRESS_BROKEN instead of NULL
  net: designware: don't use dma_mapping_error for non-streaming DMA
  net: macb: fix DMA_ADDRESS_BROKEN in the coherent ring allocations
  dma: give dma_alloc_coherent a device parameter

 arch/arm/cpu/mmu-common.c                  | 11 +++++---
 arch/arm/cpu/mmu-common.h                  |  4 ++-
 arch/arm/cpu/mmu_32.c                      |  4 +--
 arch/arm/cpu/mmu_64.c                      |  4 +--
 arch/arm/include/asm/dma.h                 | 13 +++++++---
 arch/kvx/include/asm/dma.h                 |  8 ++++--
 arch/mips/include/asm/dma.h                |  8 ++++--
 arch/riscv/cpu/dma.c                       | 16 +++++++-----
 arch/riscv/include/asm/dma.h               |  6 +++--
 arch/sandbox/include/asm/dma.h             | 13 +++++++---
 arch/x86/include/asm/dma.h                 |  8 ++++--
 commands/smc.c                             |  2 +-
 drivers/ata/ahci.c                         |  6 +++--
 drivers/crypto/caam/caamrng.c              |  3 ++-
 drivers/crypto/caam/jr.c                   |  9 ++++---
 drivers/crypto/caam/pbl-init.c             |  3 ++-
 drivers/firmware/qemu_fw_cfg.c             |  3 ++-
 drivers/mci/dw_mmc.c                       |  3 ++-
 drivers/mtd/nand/raw/nand_mxs.c            |  8 +++---
 drivers/net/ag71xx.c                       |  6 +++--
 drivers/net/arc_emac.c                     |  6 +++--
 drivers/net/at91_ether.c                   |  6 +++--
 drivers/net/designware.c                   | 10 +++++---
 drivers/net/designware_eqos.c              |  9 ++++---
 drivers/net/e1000/main.c                   |  6 +++--
 drivers/net/fec_imx.c                      |  6 +++--
 drivers/net/fsl-fman.c                     | 10 +++++---
 drivers/net/fsl_enetc.c                    |  6 +++--
 drivers/net/macb.c                         | 25 +++++++++++--------
 drivers/net/mvneta.c                       |  6 +++--
 drivers/net/orion-gbe.c                    |  6 +++--
 drivers/net/r8169_main.c                   | 16 +++++++-----
 drivers/net/rtl8139.c                      | 12 ++++++---
 drivers/nvme/host/pci.c                    | 15 +++++++----
 drivers/soc/starfive/jh7100_dma.c          |  6 +++--
 drivers/usb/dwc3/core.c                    |  6 +++--
 drivers/usb/dwc3/gadget.c                  | 24 ++++++++++++------
 drivers/usb/gadget/udc/fsl_udc.c           | 10 +++++---
 drivers/usb/host/ehci-hcd.c                | 29 ++++++++++++++--------
 drivers/usb/host/ohci-hcd.c                |  6 ++---
 drivers/usb/host/xhci-mem.c                |  2 +-
 drivers/video/atmel_lcdfb_core.c           |  6 +++--
 drivers/video/imx-ipu-fb.c                 |  3 ++-
 drivers/video/imx-ipu-v3/ipufb.c           |  3 ++-
 drivers/video/omap.c                       |  9 ++++---
 drivers/video/pxa.c                        |  6 +++--
 drivers/video/ramfb.c                      |  6 +++--
 drivers/video/rockchip/rockchip_drm_vop2.c |  5 ++--
 drivers/video/stm.c                        |  3 ++-
 drivers/video/stm32_ltdc.c                 |  3 ++-
 drivers/virtio/virtio_ring.c               |  4 +--
 include/dma.h                              |  9 ++++---
 52 files changed, 270 insertions(+), 147 deletions(-)

-- 
2.39.5




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

end of thread, other threads:[~2024-10-18  8:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 12:58 [PATCH 0/6] dma: give dma_alloc_coherent a device parameter Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 1/6] dma: make DMA_ADDRESS_BROKEN type-safe Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 2/6] video: stm: use DMA_ADDRESS_BROKEN instead of NULL Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 3/6] crypto: caam - pbl-init: " Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 4/6] net: designware: don't use dma_mapping_error for non-streaming DMA Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 5/6] net: macb: fix DMA_ADDRESS_BROKEN in the coherent ring allocations Ahmad Fatoum
2024-10-14 12:58 ` [PATCH 6/6] dma: give dma_alloc_coherent a device parameter Ahmad Fatoum
2024-10-15  7:41 ` [PATCH 0/6] " Sascha Hauer
2024-10-18  8:39 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox