mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Denis Orlov <denorl2009@gmail.com>
Subject: [PATCH 0/6] dma: give dma_alloc_coherent a device parameter
Date: Mon, 14 Oct 2024 14:58:37 +0200	[thread overview]
Message-ID: <20241014125843.2064532-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-10-14 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 12:58 Ahmad Fatoum [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241014125843.2064532-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=denorl2009@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox