All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, brouer@redhat.com,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	davem@davemloft.net
Subject: Re: [net-next PATCH RFC 05/26] arch/avr32: Add option to skip sync on DMA map
Date: Mon, 24 Oct 2016 20:27:40 +0200	[thread overview]
Message-ID: <20161024182739.GA19445@samfundet.no> (raw)
In-Reply-To: <20161024120452.16276.9594.stgit@ahduyck-blue-test.jf.intel.com>

Around Mon 24 Oct 2016 08:04:53 -0400 or thereabout, Alexander Duyck wrote:
> The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA
> APIs in the arch/arm folder.  This change is meant to correct that so that
> we get consistent behavior.

Looks good (-:

> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>

> ---
>  arch/avr32/mm/dma-coherent.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c
> index 58610d0..54534e5 100644
> --- a/arch/avr32/mm/dma-coherent.c
> +++ b/arch/avr32/mm/dma-coherent.c
> @@ -146,7 +146,8 @@ static dma_addr_t avr32_dma_map_page(struct device *dev, struct page *page,
>  {
>  	void *cpu_addr = page_address(page) + offset;
>  
> -	dma_cache_sync(dev, cpu_addr, size, direction);
> +	if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
> +		dma_cache_sync(dev, cpu_addr, size, direction);
>  	return virt_to_bus(cpu_addr);
>  }
>  
> @@ -162,6 +163,10 @@ static int avr32_dma_map_sg(struct device *dev, struct scatterlist *sglist,
>  
>  		sg->dma_address = page_to_bus(sg_page(sg)) + sg->offset;
>  		virt = sg_virt(sg);
> +
> +		if (attrs & DMA_ATTR_SKIP_CPU_SYNC)
> +			continue;
> +
>  		dma_cache_sync(dev, virt, sg->length, direction);
>  	}
>  
-- 
mvh
Hans-Christian Noren Egtvedt

WARNING: multiple messages have this Message-ID (diff)
From: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, brouer@redhat.com,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	davem@davemloft.net
Subject: Re: [net-next PATCH RFC 05/26] arch/avr32: Add option to skip sync on DMA map
Date: Mon, 24 Oct 2016 20:27:40 +0200	[thread overview]
Message-ID: <20161024182739.GA19445@samfundet.no> (raw)
In-Reply-To: <20161024120452.16276.9594.stgit@ahduyck-blue-test.jf.intel.com>

Around Mon 24 Oct 2016 08:04:53 -0400 or thereabout, Alexander Duyck wrote:
> The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA
> APIs in the arch/arm folder.  This change is meant to correct that so that
> we get consistent behavior.

Looks good (-:

> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>

> ---
>  arch/avr32/mm/dma-coherent.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c
> index 58610d0..54534e5 100644
> --- a/arch/avr32/mm/dma-coherent.c
> +++ b/arch/avr32/mm/dma-coherent.c
> @@ -146,7 +146,8 @@ static dma_addr_t avr32_dma_map_page(struct device *dev, struct page *page,
>  {
>  	void *cpu_addr = page_address(page) + offset;
>  
> -	dma_cache_sync(dev, cpu_addr, size, direction);
> +	if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
> +		dma_cache_sync(dev, cpu_addr, size, direction);
>  	return virt_to_bus(cpu_addr);
>  }
>  
> @@ -162,6 +163,10 @@ static int avr32_dma_map_sg(struct device *dev, struct scatterlist *sglist,
>  
>  		sg->dma_address = page_to_bus(sg_page(sg)) + sg->offset;
>  		virt = sg_virt(sg);
> +
> +		if (attrs & DMA_ATTR_SKIP_CPU_SYNC)
> +			continue;
> +
>  		dma_cache_sync(dev, virt, sg->length, direction);
>  	}
>  
-- 
mvh
Hans-Christian Noren Egtvedt

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-10-24 18:27 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 12:04 [net-next PATCH RFC 00/26] Add support for DMA writable pages being writable by the network stack Alexander Duyck
2016-10-24 12:04 ` Alexander Duyck
2016-10-24 12:04 ` [net-next PATCH RFC 01/26] swiotlb: Drop unused function swiotlb_map_sg Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 18:10   ` Konrad Rzeszutek Wilk
2016-10-24 18:10     ` Konrad Rzeszutek Wilk
2016-10-24 12:04 ` [net-next PATCH RFC 02/26] swiotlb: Add support for DMA_ATTR_SKIP_CPU_SYNC Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 18:09   ` Konrad Rzeszutek Wilk
2016-10-24 18:09     ` Konrad Rzeszutek Wilk
2016-10-24 19:16     ` Alexander Duyck
2016-10-24 19:16       ` Alexander Duyck
2016-10-25  1:22       ` Konrad Rzeszutek Wilk
2016-10-24 12:04 ` [net-next PATCH RFC 03/26] arch/arc: Add option to skip sync on DMA mapping Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 12:04 ` [net-next PATCH RFC 04/26] arch/arm: Add option to skip sync on DMA map and unmap Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-31 10:20   ` Russell King - ARM Linux
2016-10-31 10:20     ` Russell King - ARM Linux
2016-10-31 15:26     ` Alexander Duyck
2016-10-31 15:26       ` Alexander Duyck
2016-10-24 12:04 ` [net-next PATCH RFC 05/26] arch/avr32: Add option to skip sync on DMA map Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 18:27   ` Hans-Christian Noren Egtvedt [this message]
2016-10-24 18:27     ` Hans-Christian Noren Egtvedt
2016-10-24 12:04 ` [net-next PATCH RFC 06/26] arch/blackfin: " Alexander Duyck
2016-10-24 12:04   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 07/26] arch/c6x: Add option to skip sync on DMA map and unmap Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-28 14:59   ` Mark Salter
2016-10-28 14:59     ` Mark Salter
2016-10-24 12:05 ` [net-next PATCH RFC 08/26] arch/frv: Add option to skip sync on DMA map Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 09/26] arch/hexagon: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 10/26] arch/m68k: " Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 11/26] arch/metag: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 12/26] arch/microblaze: " Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 13/26] arch/mips: " Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 14/26] arch/nios2: " Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 15/26] arch/openrisc: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 16/26] arch/parisc: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:05 ` [net-next PATCH RFC 17/26] arch/powerpc: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-10-24 12:05   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 18/26] arch/sh: " Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 19/26] arch/sparc: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 18:27   ` David Miller
2016-10-24 18:27     ` David Miller
2016-10-24 18:27     ` David Miller
2016-10-24 19:24     ` Alexander Duyck
2016-10-24 19:24       ` Alexander Duyck
2016-10-24 19:24       ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 20/26] arch/tile: " Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 21/26] arch/xtensa: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 22/26] dma: Add calls for dma_map_page_attrs and dma_unmap_page_attrs Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 23/26] mm: Add support for releasing multiple instances of a page Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 24/26] igb: Update driver to make use of DMA_ATTR_SKIP_CPU_SYNC Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 25/26] igb: Update code to better handle incrementing page count Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck
2016-10-24 12:06 ` [net-next PATCH RFC 26/26] igb: Revert "igb: Revert support for build_skb in igb" Alexander Duyck
2016-10-24 12:06   ` Alexander Duyck

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=20161024182739.GA19445@samfundet.no \
    --to=egtvedt@samfundet.no \
    --cc=alexander.h.duyck@intel.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hskinnemoen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.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 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.