The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Kevin Tian <kevin.tian@intel.com>, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>, Nicolin Chen <nicolinc@nvidia.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Robin Murphy <robin.murphy@arm.com>,
	Lu Baolu <baolu.lu@linux.intel.com>, Alex Mastro <amastro@fb.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommufd: fix building without dmabuf
Date: Fri, 5 Dec 2025 15:50:09 -0400	[thread overview]
Message-ID: <20251205195009.GN812105@ziepe.ca> (raw)
In-Reply-To: <20251204100333.1034767-1-arnd@kernel.org>

On Thu, Dec 04, 2025 at 11:03:29AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When DMABUF is disabled, trying to use it causes a link failure:
> 
> x86_64-linux-ld: drivers/iommu/iommufd/io_pagetable.o: in function `iopt_map_file_pages':
> io_pagetable.c:(.text+0x1735): undefined reference to `dma_buf_get'
> x86_64-linux-ld: io_pagetable.c:(.text+0x1775): undefined reference to `dma_buf_put'
> 
> Fixes: 44ebaa1744fd ("iommufd: Accept a DMABUF through IOMMU_IOAS_MAP_FILE")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/iommu/iommufd/io_pagetable.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

I picked this up anyhow since it looked like adding #ifdef stubs to
dma_buf.h was going to be a bigger thing

> +	if (IS_ENABLED(CONFIG_DMABUF_HEAPS))
> +		dmabuf = dma_buf_get(fd);

But this needs to be:

	if (IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
		dmabuf = dma_buf_get(fd);

I fixed it

Thanks,
Jason

  parent reply	other threads:[~2025-12-05 19:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 10:03 [PATCH] iommufd: fix building without dmabuf Arnd Bergmann
2025-12-04 13:12 ` Jason Gunthorpe
2025-12-05 19:50 ` Jason Gunthorpe [this message]
2025-12-05 20:08   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251205195009.GN812105@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=amastro@fb.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox