iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device
Date: Sat, 18 Apr 2020 14:42:05 +0200	[thread overview]
Message-ID: <20200418124205.GD6113@8bytes.org> (raw)
In-Reply-To: <20200414122506.438134-4-hch@lst.de>

Hi Christoph,

On Tue, Apr 14, 2020 at 02:25:05PM +0200, Christoph Hellwig wrote:
> +static inline bool dma_map_direct(struct device *dev,
> +		const struct dma_map_ops *ops)
> +{
> +	if (likely(!ops))
> +		return true;
> +	if (!dev->dma_ops_bypass)
> +		return false;
> +
> +	return min_not_zero(*dev->dma_mask, dev->bus_dma_limit) >=
> +			    dma_direct_get_required_mask(dev);

Why is the dma-mask check done here? The dma-direct code handles memory
outside of the devices dma-mask with swiotlb, no?

I also don't quite get what the difference between setting the
dma_ops_bypass flag non-zero and setting ops to NULL is.


	Joerg


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2020-04-18 12:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 12:25 generic DMA bypass flag v3 Christoph Hellwig
2020-04-14 12:25 ` [PATCH 1/4] dma-mapping: move the remaining DMA API calls out of line Christoph Hellwig
2020-04-15  2:26   ` Alexey Kardashevskiy
2020-04-15  6:18     ` Christoph Hellwig
2020-04-15 11:21       ` Alexey Kardashevskiy
2020-04-17  7:58         ` Christoph Hellwig
2020-05-05  4:18           ` Alexey Kardashevskiy
2020-05-09  8:19             ` Christoph Hellwig
2020-05-09 14:07               ` Alexey Kardashevskiy
2020-06-03  4:13               ` Alexey Kardashevskiy
2020-07-07  0:43                 ` Alexey Kardashevskiy
2020-07-07 14:51                   ` Christoph Hellwig
2020-04-14 12:25 ` [PATCH 2/4] dma-mapping: inline the fast path dma-direct calls Christoph Hellwig
2020-04-14 12:25 ` [PATCH 3/4] dma-mapping: add a dma_ops_bypass flag to struct device Christoph Hellwig
2020-04-14 12:47   ` Greg Kroah-Hartman
2020-04-18 12:42   ` Joerg Roedel [this message]
2020-04-19  8:00     ` Christoph Hellwig
2020-04-19 12:25       ` Joerg Roedel
2020-04-19 14:46         ` Alexey Kardashevskiy
2020-04-14 12:25 ` [PATCH 4/4] powerpc: use the generic dma_ops_bypass mode Christoph Hellwig

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=20200418124205.GD6113@8bytes.org \
    --to=joro@8bytes.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=robin.murphy@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).