All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Christoph Hellwig <hch@lst.de>,
	linuxppc-dev@lists.ozlabs.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation
Date: Wed, 28 Oct 2020 18:21:06 +0100	[thread overview]
Message-ID: <20201028172106.GA10015@lst.de> (raw)
In-Reply-To: <28147035-500d-f3cd-f283-257066343697@ozlabs.ru>

On Wed, Oct 28, 2020 at 05:55:23PM +1100, Alexey Kardashevskiy wrote:
>
> It is passing an address of the end of the mapped area so passing a page 
> struct means passing page and offset which is an extra parameter and we do 
> not want to do anything with the page in those hooks anyway so I'd keep it 
> as is.
>
>
>> and
>>     maybe even hide the dma_map_direct inside it.
>
> Call dma_map_direct() from arch_dma_map_page_direct() if 
> arch_dma_map_page_direct() is defined? Seems suboptimal as it is going to 
> be bypass=true in most cases and we save one call by avoiding calling 
> arch_dma_map_page_direct(). Unless I missed something?

C does not even evaluate the right hand side of a || expression if the
left hand evaluates to true.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
	Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation
Date: Wed, 28 Oct 2020 18:21:06 +0100	[thread overview]
Message-ID: <20201028172106.GA10015@lst.de> (raw)
In-Reply-To: <28147035-500d-f3cd-f283-257066343697@ozlabs.ru>

On Wed, Oct 28, 2020 at 05:55:23PM +1100, Alexey Kardashevskiy wrote:
>
> It is passing an address of the end of the mapped area so passing a page 
> struct means passing page and offset which is an extra parameter and we do 
> not want to do anything with the page in those hooks anyway so I'd keep it 
> as is.
>
>
>> and
>>     maybe even hide the dma_map_direct inside it.
>
> Call dma_map_direct() from arch_dma_map_page_direct() if 
> arch_dma_map_page_direct() is defined? Seems suboptimal as it is going to 
> be bypass=true in most cases and we save one call by avoiding calling 
> arch_dma_map_page_direct(). Unless I missed something?

C does not even evaluate the right hand side of a || expression if the
left hand evaluates to true.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
	Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation
Date: Wed, 28 Oct 2020 18:21:06 +0100	[thread overview]
Message-ID: <20201028172106.GA10015@lst.de> (raw)
In-Reply-To: <28147035-500d-f3cd-f283-257066343697@ozlabs.ru>

On Wed, Oct 28, 2020 at 05:55:23PM +1100, Alexey Kardashevskiy wrote:
>
> It is passing an address of the end of the mapped area so passing a page 
> struct means passing page and offset which is an extra parameter and we do 
> not want to do anything with the page in those hooks anyway so I'd keep it 
> as is.
>
>
>> and
>>     maybe even hide the dma_map_direct inside it.
>
> Call dma_map_direct() from arch_dma_map_page_direct() if 
> arch_dma_map_page_direct() is defined? Seems suboptimal as it is going to 
> be bypass=true in most cases and we save one call by avoiding calling 
> arch_dma_map_page_direct(). Unless I missed something?

C does not even evaluate the right hand side of a || expression if the
left hand evaluates to true.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-10-28 22:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 10:18 [PATCH kernel v2 0/2] DMA, powerpc/dma: Fallback to dma_ops when persistent memory present Alexey Kardashevskiy
2020-10-27 10:18 ` Alexey Kardashevskiy
2020-10-27 10:18 ` Alexey Kardashevskiy
2020-10-27 10:18 ` [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation Alexey Kardashevskiy
2020-10-27 10:18   ` Alexey Kardashevskiy
2020-10-27 10:18   ` Alexey Kardashevskiy
2020-10-27 16:48   ` Christoph Hellwig
2020-10-27 16:48     ` Christoph Hellwig
2020-10-27 16:48     ` Christoph Hellwig
2020-10-28  6:55     ` Alexey Kardashevskiy
2020-10-28  6:55       ` Alexey Kardashevskiy
2020-10-28  6:55       ` Alexey Kardashevskiy
2020-10-28 17:21       ` Christoph Hellwig [this message]
2020-10-28 17:21         ` Christoph Hellwig
2020-10-28 17:21         ` Christoph Hellwig
2020-10-28 23:11         ` Alexey Kardashevskiy
2020-10-28 23:11           ` Alexey Kardashevskiy
2020-10-28 23:11           ` Alexey Kardashevskiy
2020-10-27 10:18 ` [PATCH kernel v2 2/2] powerpc/dma: Fallback to dma_ops when persistent memory present Alexey Kardashevskiy
2020-10-27 10:18   ` Alexey Kardashevskiy
2020-10-27 10:18   ` Alexey Kardashevskiy

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=20201028172106.GA10015@lst.de \
    --to=hch@lst.de \
    --cc=aik@ozlabs.ru \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.