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
prev parent reply other threads:[~2016-06-10 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1465553521-27303-1-git-send-email-k.kozlowski@samsung.com>
2016-06-10 10:11 ` [PATCH v4 04/44] ARM: dma-mapping: Use unsigned long for dma_attrs Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 19/44] xen: " Krzysztof Kozlowski
2016-06-10 10:11 ` [PATCH v4 23/44] x86: " Krzysztof Kozlowski
2016-06-10 10:12 ` [PATCH v4 43/44] dma-mapping: Remove dma_get_attr Krzysztof Kozlowski
[not found] ` <1465553521-27303-44-git-send-email-k.kozlowski@samsung.com>
2016-06-10 10:55 ` Vineet Gupta
2016-06-10 10:58 ` Robin Murphy [this message]
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 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).