The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=106294d5801f6c617812534f773ea101bfbc7655
commit 106294d5801f6c617812534f773ea101bfbc7655 Author: Bjoern A. Zeeb <b...@freebsd.org> AuthorDate: 2025-04-01 14:51:03 +0000 Commit: Bjoern A. Zeeb <b...@freebsd.org> CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions dma_map_resource() and dma_unmap_resource() functions are used to map and unmap of memory-mapped IO resources so they can be accessed by the device. Required by drm-kmod v5.5 to be built. While for drm-kmod 6.6-lts only amdgpu uses these in one place and the code apparently has not been exercised a lot it has been around like this for years. With changing the underlying implementations bring it into the tree; should we find errors with it they can also be fixed here. Bump __FreeBSD version to be able to detect this change. Obtained from: D30933 (by wulf) Sponsored by: The FreeBSD Foundation Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49625 (cherry picked from commit a02180cf60a6a0102669b678e9c81ad9f1aa4d91) --- UPDATING | 4 ++++ sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/UPDATING b/UPDATING index c1778cc50d83..4d06a05650bf 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,10 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250713: + LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. + Bump _FreeBSD_version to 1403503 to be able to detect this change. + 20250707: Commit f5195b1a63df removed in6_maxmtu and its setter in6_setmaxmtu(). in6_maxmtu is used to store the max IPv6 MTU of all interfaces, diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 09d5e4b6bc22..2d8e1196d3d3 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -214,6 +214,20 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, lkpi_dma_unmap(dev, dma_address, size, direction, 0); } +static inline dma_addr_t +dma_map_resource(struct device *dev, phys_addr_t paddr, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + return (lkpi_dma_map_phys(dev, paddr, size, direction, attrs)); +} + +static inline void +dma_unmap_resource(struct device *dev, dma_addr_t dma, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + lkpi_dma_unmap(dev, dma, size, direction, attrs); +} + static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma, size_t size, enum dma_data_direction direction)