From: Robin Murphy <robin.murphy@arm.com>
To: Leon Romanovsky <leon@kernel.org>, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>, Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>
Cc: "Leon Romanovsky" <leonro@nvidia.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Subject: Re: [PATCH] dma-mapping: reliably inform about DMA support for IOMMU
Date: Wed, 11 Sep 2024 13:54:11 +0100 [thread overview]
Message-ID: <794814bf-76d3-433c-8dd7-de17c54464c0@arm.com> (raw)
In-Reply-To: <7bbedc085ce87b121b9d0cb33eca8fba2fbdddbc.1726049194.git.leonro@nvidia.com>
On 2024-09-11 11:15 am, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> If the DMA IOMMU path is going to be used, the appropriate check should
> return that DMA is supported.
Oof, indeed the significance of what iommu_dma_ops *didn't* implement is
a subtle one...
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Fixes: b5c58b2fdc42 ("dma-mapping: direct calls for dma-iommu")
> Closes: https://lore.kernel.org/all/181e06ff-35a3-434f-b505-672f430bd1cb@notapiano
> Reported-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> #KernelCI
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> kernel/dma/mapping.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
> index 1a7de37bd643..38d7b3239dbb 100644
> --- a/kernel/dma/mapping.c
> +++ b/kernel/dma/mapping.c
> @@ -824,6 +824,9 @@ static int dma_supported(struct device *dev, u64 mask)
>
> if (WARN_ON(ops && use_dma_iommu(dev)))
> return false;
> +
> + if (use_dma_iommu(dev))
> + return true;
> /*
> * ->dma_supported sets the bypass flag, so we must always call
> * into the method here unless the device is truly direct mapped.
next prev parent reply other threads:[~2024-09-11 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 10:15 [PATCH] dma-mapping: reliably inform about DMA support for IOMMU Leon Romanovsky
2024-09-11 12:54 ` Robin Murphy [this message]
2024-09-11 12:54 ` Nícolas F. R. A. Prado
2024-09-12 7:29 ` Christoph Hellwig
2024-09-12 10:50 ` Leon Romanovsky
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=794814bf-76d3-433c-8dd7-de17c54464c0@arm.com \
--to=robin.murphy@arm.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=leon@kernel.org \
--cc=leonro@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=nfraprado@collabora.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