HomeFreeBSD

LinuxKPI: implement dma_set_coherent_mask()

Description

LinuxKPI: implement dma_set_coherent_mask()

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 tags 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

(cherry picked from commit c39eefe715b3c835ce3d91a1c1932197c23c1f3c)
(cherry picked from commit 1269873159c7fa0db3b9dbf8dadc54eec5dc0d58)

Details

Provenance
bzAuthored on Sep 27 2021, 10:50 PM
Parents
rGd005c4c6de6b: LinuxKPI: dma-mapping.h unify "mask" and "dma_mask"
Branches
Unknown
Tags
Unknown