Page MenuHomeFreeBSD

Bounce in more cases in the arm64 busdma

Authored by andrew on Sep 20 2020, 3:37 PM.



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 OK
No Unit Test Coverage
Build Status
Buildable 33671
Build 30910: arc lint + arc unit

Event Timeline

mmel added inline comments.

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

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.