Page MenuHomeFreeBSD

LinuxKPI: add missing bus_dmamap_sync() calls or exclude them
ClosedPublic

Authored by bz on May 22 2024, 3:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 7:12 PM
Unknown Object (File)
Mon, Oct 6, 5:29 AM
Unknown Object (File)
Thu, Sep 18, 8:25 PM
Unknown Object (File)
Thu, Sep 18, 8:24 PM
Unknown Object (File)
Thu, Sep 18, 4:44 PM
Unknown Object (File)
Tue, Sep 16, 2:39 AM
Unknown Object (File)
Sun, Sep 14, 5:35 PM
Unknown Object (File)
Sep 11 2025, 8:30 PM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable

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.Mar 29 2025, 9:23 PM
bz edited the summary of this revision. (Show Details)
bz added a reviewer: linuxkpi.
bz removed a subscriber: linuxkpi.

Anyone who can review this? Would also allow me to get D49625 in for drm-kmod.

Anyone? Otherwise I'll commit this before the end of this week (24/26. April).

Ok, it's been sitting here for another month. Is there anyone who knows this stuff (maybe natively) and could review it? I am open to suggestions. Otherwise if anyone says "commit" I'll go ahead.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 3 2025, 6:38 PM
This revision was automatically updated to reflect the committed changes.