Page MenuHomeFreeBSD

Bounce in more cases in the arm64 busdma
ClosedPublic

Authored by andrew on Sep 20 2020, 3:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 1:39 AM
Unknown Object (File)
Mar 8 2024, 12:04 AM
Unknown Object (File)
Feb 24 2024, 10:47 AM
Unknown Object (File)
Feb 18 2024, 5:35 AM
Unknown Object (File)
Jan 31 2024, 1:41 PM
Unknown Object (File)
Nov 15 2023, 1:36 AM
Unknown Object (File)
Nov 13 2023, 5:42 AM
Unknown Object (File)
Sep 24 2023, 8:40 PM
Subscribers

Details

Summary

WE need to use a bounce buffer when the memory we are operating on is not
aligned to a cacheline, and not aligned to the maps alignment.

The former is to stop other threads from dirtying the cacheline while we
are performing DMA operations with it. The latter is to check memory
passed in by a driver is correctly aligned for the device.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mmel added inline comments.
sys/arm64/arm64/busdma_bounce.c
183 ↗(On Diff #77257)

this should be

	if ((map->flags & (DMAMAP_FROM_DMAMEM | DMAMAP_MBUF)) != 0 ||
	    (dmat ->bounce_flags & BF_COHERENT) != 0)

(and dmat must be passed as argument to this function)

but RockPro64 still have problem...

  • Use might_bounce/must_bounce in bounce_bus_dma_id_mapped
  • Always create the bounce zone in bounce_bus_dmamap_create
This revision is now accepted and ready to land.Sep 23 2020, 5:08 PM
sys/arm64/arm64/busdma_bounce.c
233 ↗(On Diff #77408)

Hmm, I forgot. The bus_dma_run_filter() is very probably wrong, or at least inconsistent. I thing that we should remove alignment condition from it.

This revision was automatically updated to reflect the committed changes.