Page MenuHomeFreeBSD

LinuxKPI: implement dma_set_coherent_mask()
ClosedPublic

Authored by bz on Sep 27 2021, 10:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 22 2024, 1:21 PM
Unknown Object (File)
Jan 10 2024, 9:34 PM
Unknown Object (File)
Dec 20 2023, 6:39 AM
Unknown Object (File)
Dec 14 2023, 9:45 PM
Unknown Object (File)
Dec 1 2023, 12:44 AM
Unknown Object (File)
Nov 23 2023, 5:06 AM
Unknown Object (File)
Nov 23 2023, 4:30 AM
Unknown Object (File)
Nov 14 2023, 3:02 AM

Details

Summary

Coherent is lower 32bit only by default in Linux and our only default
dma mask is 64bit currently which violates expectations unless
dma_set_coherent_mask() was called explicitly with a different mask.

Implement coherent by creating a second tag, and storing the tag in the
objects and use the tag from the object wherever possible.
This currently does not update the scatterlist or pool (both could be
converted but S/G cannot be MFCed as easily).

There is a 2nd change embedded in the updated logic of
linux_dma_alloc_coherent() to always zero the allocation as
otherwise some drivers get cranky on uninialised garbage.

Sponsored by: The FreeBSD Foundation
MFC after: 7 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable