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)
Sun, Apr 21, 2:34 AM
Unknown Object (File)
Sat, Apr 20, 10:14 PM
Unknown Object (File)
Sat, Apr 20, 12:49 AM
Unknown Object (File)
Wed, Apr 17, 4:24 AM
Unknown Object (File)
Tue, Apr 16, 9:39 PM
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
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.