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)
Fri, Mar 8, 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
Unknown Object (File)
Sep 13 2023, 11:22 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33671
Build 30910: arc lint + arc unit

Event Timeline

mmel added inline comments.
sys/arm64/arm64/busdma_bounce.c
183

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
229

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.