From nobody Tue Jun 3 18:37:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bBfb70w4Vz5y12w; Tue, 03 Jun 2025 18:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bBfb62y2Yz3Zsx; Tue, 03 Jun 2025 18:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSs1LVVc9/Y96GD6clgpsm7VJZ1IxvU8F1OQJ+D3W2g=; b=OXgQrxanCdmaVOYzR+cvTVt7k49AqvISXZgbljEUtSA2SePt3dJyn6bPR03GAQQtTWWJRT YLGs/PKR7UpTgi8EUcJOQicz0rAYzPvk1yO0DY6GipVWeOL5E4/aYd+5RehwlM7U4FepPV JuxOI9ggypFl1zEAgZZjWpcjSzX8me6pDuEmmuj0sDHCsJ4RgDpzlf3mSHkqF41sPpyjcj CgmYLmuMGvxWRwiRE8B0MRy668v2ruVuG4nXLUJSJ1X5LogqkaPqT1Y1WAegjXU0QgPvJ8 YF+3d5FZ1uKTDKyB/+KHSKRtOHPVDI4AmlAanKe0dAoar1R9yumUs48ondy8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748975858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSs1LVVc9/Y96GD6clgpsm7VJZ1IxvU8F1OQJ+D3W2g=; b=FH79Tduv7IiBBARQt15HQRDX7sSPxeW3hvfoqkmc1e7VU7uOvM2GTa08mEVUl0/0Uepqvs 0akpeRUQPWSYh/bBGINmYBnXJBkZLLkGJ0beBKT1XvD4eZ/Mbw65mU5VRXOqzcmaUuV5km 3z9JNo4D0HTQj3BholtzOWDFZqSdZ+qoZbHKlEYttpow0iljILS9tzSzrOySLRbylEMR8o o0xykcMn43hYrfWrKrWdnOEWCuXqy8S8FhhSVllPqfcI2pf6JjBZWffjpfWkawoCAUQ5JO DjSmLe8HZr7oCh/TnUF8zbg2WaWuKNzhRxxb4IyW8/l76roMJiEhG6zhjMvrDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748975858; a=rsa-sha256; cv=none; b=V4DDzrmQTkqyetzz7I4bhHfgQ1vM0+3cK6RcvcGECCbuYwae/I5jBnmIOcHJaxYh5D//HK zByGx9MCMaV45dLr32wVxPybA9ujmyoIe9lPkPy4Odt7ZcXPbtfMTzoJPIObiCI7Bh1oL3 r37zsMvupDVFCm/le3E0wW08hyJoA2bsUpQj7HiIwR/1Yz3ng4YAmKNvfqn8qUcIZHcSiM vHvKlBU665BLoz/Lemty8aTb8z8HDUmlr6NQ+Mu50bxTRRBrgyCZh6270DUO5plVjYkNNW PB9ViPkOZX3vFRyF6zdcS/XRbNkpL+T5MbnXKX2/UtvmL3rCcKxs7Stm4oCnHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bBfb62W5Yzqqc; Tue, 03 Jun 2025 18:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 553IbchJ000374; Tue, 3 Jun 2025 18:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 553Ibcj2000371; Tue, 3 Jun 2025 18:37:38 GMT (envelope-from git) Date: Tue, 3 Jun 2025 18:37:38 GMT Message-Id: <202506031837.553Ibcj2000371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a02180cf60a6 - main - LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a02180cf60a6a0102669b678e9c81ad9f1aa4d91 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a02180cf60a6a0102669b678e9c81ad9f1aa4d91 commit a02180cf60a6a0102669b678e9c81ad9f1aa4d91 Author: Bjoern A. Zeeb AuthorDate: 2025-04-01 14:51:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-03 18:35:09 +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 MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49625 --- UPDATING | 4 ++++ sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 ++++++++++++++ sys/sys/param.h | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 53ce5a4b3095..bee8b348f113 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250603: + LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. + Bump _FreeBSD_version to 1500045 to be able to detect this change. + 20250527: The CAM target layer userland, i.e. ctld(8), ctladm(8) and ctlstat(8), has moved to the new FreeBSD-ctl package. If you use pkgbase and you 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) diff --git a/sys/sys/param.h b/sys/sys/param.h index 0a08d4740593..98fb0aeacef0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500044 +#define __FreeBSD_version 1500045 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,