Page MenuHomeFreeBSD

LinuxKPI: add missing bus_dmamap_sync() calls or exclude them
Needs ReviewPublic

Authored by bz on May 22 2024, 3:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 26 2025, 9:24 PM
Unknown Object (File)
Feb 26 2025, 5:22 PM
Unknown Object (File)
Feb 26 2025, 12:13 PM
Unknown Object (File)
Feb 21 2025, 9:33 PM
Unknown Object (File)
Jan 29 2025, 9:18 AM
Unknown Object (File)
Jan 28 2025, 7:54 AM
Unknown Object (File)
Jan 20 2025, 9:37 AM
Unknown Object (File)
Jan 12 2025, 7:00 PM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

Rename linux_dma_unmap() to lkpi_dma_unmap(), and linux_dma_map_phys()
to lkpi_dma_map_phys() so that we get the full set of function
arguments (direction and attributes were missing).
Leave the old functions as wrappers as they are called from drm-kmod
linuxkpi/bsd still, and leaving them also allows us to MFC this
change.

Add missing bus_dmamap_sync() calls. Rather than inlining them
in each inline function push them down to the actual implementation.
From there do not inline them either but call the appropriate
function dealing with the sync so that we do not have the same
code splattered in many places.

Adhere to the DMA_ATTR_SKIP_CPU_SYNC attribute and skip synching
when requested.

A previous, less complete version of this change already allowed
me to laod firmware on arm64 for iwlwifi (again).

There are four more places which are not currently done as the
functions which came with an OFED sync a long time ago seem to be
unused these days. Leaving a pr_debug("TODO") call there.

Also dma_[un]map_resource() when brought in from drm-kmod/linuxkpi/bsd
(D30933) should be adjusted to pass the full arguments as the amdgpu
callers are requesting to skip synching.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63201
Build 60085: arc lint + arc unit

Event Timeline

bz requested review of this revision.May 22 2024, 3:22 AM
bz planned changes to this revision.May 22 2024, 3:22 AM

I'll try to deal with the "pr_debug" marked instances the next days.

finish what's currently needed

bz retitled this revision from [WIP] LinuxKPI: add missing bus_dmamap_sync() calls to LinuxKPI: add missing bus_dmamap_sync() calls or exclude them.Sat, Mar 29, 9:23 PM
bz edited the summary of this revision. (Show Details)
bz added a reviewer: linuxkpi.
bz removed a subscriber: linuxkpi.