All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org, Michal Hocko <mhocko@suse.com>,
	linux-ia64@vger.kernel.org, Heiko Stuebner <heiko@sntech.de>,
	linux-doc@vger.kernel.org, David Airlie <airlied@linux.ie>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Will Deacon <will.deacon@arm.com>,
	dri-devel@lists.freedesktop.org,
	"James E.J. Bottomley" <jejb@parisc-linux.org>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Jisheng Zhang <jszhang@marvell.com>,
	Andrea Gelmini <andrea.gelmini@gelma.net>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Jonas Bonn <jonas@southpole.se>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Pawel Osciak <pawel@osciak.com>,
	linux-snps-arc@lists.infradead.org,
	Jonathan Corbet <corbet@lwn.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Helge Deller <deller@gmx.de>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Alexey Brodkin <abrodkin@synopsys.com>
Subject: Re: [PATCH v4 43/44] dma-mapping: Remove dma_get_attr
Date: Fri, 10 Jun 2016 11:58:53 +0100	[thread overview]
Message-ID: <575A9D6D.9040808__31853.3523510725$1465556513$gmane$org@arm.com> (raw)
In-Reply-To: <1465553521-27303-44-git-send-email-k.kozlowski@samsung.com>

On 10/06/16 11:12, Krzysztof Kozlowski wrote:
> After switching DMA attributes to unsigned long it is easier to just
> compare the bits.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> [for avr32]
> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
> ---
[...]
>   arch/arm64/mm/dma-mapping.c                    | 10 +++----
[...]
>   drivers/iommu/dma-iommu.c                      |  2 +-
[...]
> diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
> index a7686028dfeb..06c068ca3541 100644
> --- a/arch/arm64/mm/dma-mapping.c
> +++ b/arch/arm64/mm/dma-mapping.c
> @@ -32,7 +32,7 @@
>   static pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot,
>   				 bool coherent)
>   {
> -	if (!coherent || dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs))
> +	if (!coherent || (attrs & DMA_ATTR_WRITE_COMBINE))
>   		return pgprot_writecombine(prot);
>   	return prot;
>   }
> @@ -702,7 +702,7 @@ static dma_addr_t __iommu_map_page(struct device *dev, struct page *page,
>   	dma_addr_t dev_addr = iommu_dma_map_page(dev, page, offset, size, prot);
>
>   	if (!iommu_dma_mapping_error(dev, dev_addr) &&
> -	    !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
> +	    (attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
>   		__iommu_sync_single_for_device(dev, dev_addr, size, dir);
>
>   	return dev_addr;
> @@ -712,7 +712,7 @@ static void __iommu_unmap_page(struct device *dev, dma_addr_t dev_addr,
>   			       size_t size, enum dma_data_direction dir,
>   			       unsigned long attrs)
>   {
> -	if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
> +	if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
>   		__iommu_sync_single_for_cpu(dev, dev_addr, size, dir);
>
>   	iommu_dma_unmap_page(dev, dev_addr, size, dir, attrs);
> @@ -752,7 +752,7 @@ static int __iommu_map_sg_attrs(struct device *dev, struct scatterlist *sgl,
>   {
>   	bool coherent = is_device_dma_coherent(dev);
>
> -	if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
> +	if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
>   		__iommu_sync_sg_for_device(dev, sgl, nelems, dir);
>
>   	return iommu_dma_map_sg(dev, sgl, nelems,
> @@ -764,7 +764,7 @@ static void __iommu_unmap_sg_attrs(struct device *dev,
>   				   enum dma_data_direction dir,
>   				   unsigned long attrs)
>   {
> -	if (!dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
> +	if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
>   		__iommu_sync_sg_for_cpu(dev, sgl, nelems, dir);
>
>   	iommu_dma_unmap_sg(dev, sgl, nelems, dir, attrs);
[...]
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
> index 6c1bda504fb1..08a1e2f3690f 100644
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -306,7 +306,7 @@ struct page **iommu_dma_alloc(struct device *dev, size_t size, gfp_t gfp,
>   	} else {
>   		size = ALIGN(size, min_size);
>   	}
> -	if (dma_get_attr(DMA_ATTR_ALLOC_SINGLE_PAGES, attrs))
> +	if (attrs & DMA_ATTR_ALLOC_SINGLE_PAGES)
>   		alloc_sizes = min_size;
>
>   	count = PAGE_ALIGN(size) >> PAGE_SHIFT;
[...]

These all look appropriate to me; thanks!

For arm64 and dma-iommu:

Acked-by: Robin Murphy <robin.murphy@arm.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-06-10 10:59 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 10:11 [PATCH v4 00/44] dma-mapping: Use unsigned long for dma_attrs Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 01/44] " Krzysztof Kozlowski
2016-06-10 14:49   ` Luis R. Rodriguez
2016-06-10 20:16     ` Krzysztof Kozlowski
2016-06-10 20:23       ` Luis R. Rodriguez
2016-06-10 20:44         ` Krzysztof Kozlowski
2016-06-10 21:08           ` Luis R. Rodriguez
2016-06-13 16:00     ` Christoph Hellwig
2016-06-13 17:41       ` Luis R. Rodriguez
2016-06-10 10:11 ` [PATCH v4 02/44] alpha: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 03/44] arc: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:54   ` Vineet Gupta
2016-06-10 10:54     ` Vineet Gupta
2016-06-10 10:11 ` [PATCH v4 04/44] ARM: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 05/44] arm64: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:51   ` Robin Murphy
2016-06-10 10:51     ` Robin Murphy
2016-06-10 10:55     ` Krzysztof Kozlowski
2016-06-10 10:55       ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 06/44] avr32: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 07/44] blackfin: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 08/44] c6x: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 09/44] cris: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 10/44] frv: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 11/44] drm/exynos: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 12/44] drm/mediatek: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 14/44] drm/nouveau: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 15/44] drm/rockship: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 16/44] infiniband: " Krzysztof Kozlowski
     [not found]   ` <1465553521-27303-17-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-10 18:18     ` Bart Van Assche
2016-06-10 18:18       ` Bart Van Assche
     [not found]       ` <b4d3a64b-afa6-fb2d-1516-831b5ea45129-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-06-13 15:08         ` Krzysztof Kozlowski
2016-06-13 15:08           ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 17/44] iommu: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 18/44] [media] " Krzysztof Kozlowski
     [not found]   ` <575AB26E.4020401@st.com>
2016-06-10 12:37     ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 19/44] xen: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 20/44] swiotlb: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 21/44] powerpc: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 22/44] video: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 23/44] x86: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 24/44] iommu: intel: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 25/44] h8300: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 26/44] hexagon: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 27/44] ia64: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 28/44] m68k: " Krzysztof Kozlowski
2016-06-10 10:11 ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 29/44] metag: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 30/44] microblaze: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 31/44] mips: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 32/44] mn10300: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 33/44] nios2: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 34/44] openrisc: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 35/44] parisc: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 36/44] misc: mic: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 37/44] s390: " Krzysztof Kozlowski
2016-06-10 16:30   ` Gerald Schaefer
2016-06-10 10:11 ` [PATCH v4 38/44] sh: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 39/44] sparc: " Krzysztof Kozlowski
2016-06-10 10:11   ` Krzysztof Kozlowski
2016-06-10 17:43   ` David Miller
2016-06-10 17:43     ` David Miller
2016-06-10 20:03     ` Krzysztof Kozlowski
2016-06-10 20:03       ` Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 40/44] tile: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 41/44] unicore32: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 42/44] xtensa: " Krzysztof Kozlowski
2016-06-10 10:12 ` [PATCH v4 43/44] dma-mapping: Remove dma_get_attr Krzysztof Kozlowski
     [not found] ` <1465553521-27303-1-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-10 10:11   ` [PATCH v4 13/44] drm/msm: dma-mapping: Use unsigned long for dma_attrs Krzysztof Kozlowski
2016-06-10 10:11     ` Krzysztof Kozlowski
2016-06-10 10:12   ` [PATCH v4 43/44] dma-mapping: Remove dma_get_attr Krzysztof Kozlowski
2016-06-10 10:12     ` Krzysztof Kozlowski
2016-06-10 10:12     ` Krzysztof Kozlowski
2016-06-10 10:12     ` Krzysztof Kozlowski
2016-06-10 10:55     ` Vineet Gupta
2016-06-10 10:55       ` Vineet Gupta
2016-06-10 10:55       ` Vineet Gupta
2016-06-10 10:55       ` Vineet Gupta
2016-06-10 10:55       ` Vineet Gupta
2016-06-10 10:55       ` Vineet Gupta
2016-06-10 10:55     ` Vineet Gupta
2016-06-10 10:58     ` Robin Murphy [this message]
     [not found]     ` <1465553521-27303-44-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-06-10 10:58       ` Robin Murphy
2016-06-10 10:58         ` Robin Murphy
2016-06-10 10:58         ` Robin Murphy
2016-06-10 10:58         ` Robin Murphy
2016-06-10 10:12 ` [PATCH v4 44/44] dma-mapping: Document the DMA attributes next to the declaration Krzysztof Kozlowski

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='575A9D6D.9040808__31853.3523510725$1465556513$gmane$org@arm.com' \
    --to=robin.murphy@arm.com \
    --cc=abrodkin@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=andrea.gelmini@gelma.net \
    --cc=benh@kernel.crashing.org \
    --cc=corbet@lwn.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=egtvedt@samfundet.no \
    --cc=heiko@sntech.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=jejb@parisc-linux.org \
    --cc=jonas@southpole.se \
    --cc=jszhang@marvell.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=mchehab@osg.samsung.com \
    --cc=mhocko@suse.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=pawel@osciak.com \
    --cc=sstabellini@kernel.org \
    --cc=will.deacon@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 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.