From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Arnd Bergmann' <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org,
linux-arch@vger.kernel.org, iommu@lists.linux-foundation.org,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Joerg Roedel' <joro@8bytes.org>,
'Russell King - ARM Linux' <linux@arm.linux.org.uk>,
'Chunsang Jeong' <chunsang.jeong@linaro.org>,
'Krishna Reddy' <vdumpa@nvidia.com>,
'KyongHo Cho' <pullip.cho@samsung.com>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
'Benjamin Herrenschmidt' <benh@kernel.crashing.org>,
'Konrad Rzeszutek Wilk' <konrad.wilk@oracle.com>,
'Hiroshi Doyu' <hdoyu@nvidia.com>,
'Subash Patel' <subashrp@gmail.com>
Subject: RE: [PATCHv8 04/10] ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops
Date: Wed, 11 Apr 2012 15:05:58 +0200 [thread overview]
Message-ID: <014901cd17e3$d67d18b0$83774a10$%szyprowski@samsung.com> (raw)
In-Reply-To: <201204111218.39800.arnd@arndb.de>
Hi Arnd,
On Wednesday, April 11, 2012 2:19 PM Arnd Bergmann wrote:
> On Wednesday 11 April 2012, Marek Szyprowski wrote:
> > Well, range sync functions are available from the early days of the dma
> > mapping api (at least that's what I've found reading the change log and
> > old patches). They are the correct way of doing a partial syncs on the
> > buffer (usually used by the network device drivers). This patch changes
> > only the internal implementation of the dma bounce functions to let
> > them tunnel through dma_map_ops structure. The driver api stays
> > unchanged, so driver are obliged to call dma_*_range_* functions to
> > keep code clean and easy to understand.
> >
> > The only drawback I can see from this patch is reduced detection of
> > the dma api abuse. Let us consider the following code:
> >
> > dma_addr = dma_map_single(dev, ptr, 64, DMA_TO_DEVICE);
> > dma_sync_single_range_for_cpu(dev, dma_addr+16, 0, 32, DMA_TO_DEVICE);
> >
> > Without the patch such code fails, because dma bounce code is unable
> > to find the bounce buffer for the given dma_address. After the patch
> > the sync call will be equivalent to:
> >
> > dma_sync_single_range_for_cpu(dev, dma_addr, 16, 32, DMA_TO_DEVICE);
> >
> > which succeeds.
> >
> > I don't consider this as a real problem. DMA API abuse should be caught
> > by debug_dma_* function family, so we can simplify the internal low-level
> > implementation without losing anything.
> >
>
> Ok, fair enough. Can you put the above text into the changelog?
Yes, I will update it in the next release.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Arnd Bergmann' <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org,
linux-arch@vger.kernel.org, iommu@lists.linux-foundation.org,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Joerg Roedel' <joro@8bytes.org>,
'Russell King - ARM Linux' <linux@arm.linux.org.uk>,
'Chunsang Jeong' <chunsang.jeong@linaro.org>,
'Krishna Reddy' <vdumpa@nvidia.com>,
'KyongHo Cho' <pullip.cho@samsung.com>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
'Benjamin Herrenschmidt' <benh@kernel.crashing.org>,
'Konrad Rzeszutek Wilk' <konrad.wilk@oracle.com>,
'Hiroshi Doyu' <hdoyu@nvidia.com>,
'Subash Patel' <subashrp@gmail.com>
Subject: RE: [PATCHv8 04/10] ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops
Date: Wed, 11 Apr 2012 15:05:58 +0200 [thread overview]
Message-ID: <014901cd17e3$d67d18b0$83774a10$%szyprowski@samsung.com> (raw)
Message-ID: <20120411130558.N2IOLC00jiY_hnBftMhGIPSk7AG-qL4MZGvYrmB0OY8@z> (raw)
In-Reply-To: <201204111218.39800.arnd@arndb.de>
Hi Arnd,
On Wednesday, April 11, 2012 2:19 PM Arnd Bergmann wrote:
> On Wednesday 11 April 2012, Marek Szyprowski wrote:
> > Well, range sync functions are available from the early days of the dma
> > mapping api (at least that's what I've found reading the change log and
> > old patches). They are the correct way of doing a partial syncs on the
> > buffer (usually used by the network device drivers). This patch changes
> > only the internal implementation of the dma bounce functions to let
> > them tunnel through dma_map_ops structure. The driver api stays
> > unchanged, so driver are obliged to call dma_*_range_* functions to
> > keep code clean and easy to understand.
> >
> > The only drawback I can see from this patch is reduced detection of
> > the dma api abuse. Let us consider the following code:
> >
> > dma_addr = dma_map_single(dev, ptr, 64, DMA_TO_DEVICE);
> > dma_sync_single_range_for_cpu(dev, dma_addr+16, 0, 32, DMA_TO_DEVICE);
> >
> > Without the patch such code fails, because dma bounce code is unable
> > to find the bounce buffer for the given dma_address. After the patch
> > the sync call will be equivalent to:
> >
> > dma_sync_single_range_for_cpu(dev, dma_addr, 16, 32, DMA_TO_DEVICE);
> >
> > which succeeds.
> >
> > I don't consider this as a real problem. DMA API abuse should be caught
> > by debug_dma_* function family, so we can simplify the internal low-level
> > implementation without losing anything.
> >
>
> Ok, fair enough. Can you put the above text into the changelog?
Yes, I will update it in the next release.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
next prev parent reply other threads:[~2012-04-11 13:05 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 11:04 [PATCHv8 00/10] ARM: DMA-mapping framework redesign Marek Szyprowski
2012-04-10 11:04 ` Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 01/10] common: add dma_mmap_from_coherent() function Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 02/10] ARM: dma-mapping: use pr_* instread of printk Marek Szyprowski
2012-04-10 11:04 ` Marek Szyprowski
2012-04-10 11:41 ` Arnd Bergmann
2012-04-10 11:04 ` [PATCHv8 03/10] ARM: dma-mapping: introduce ARM_DMA_ERROR constant Marek Szyprowski
2012-04-10 11:31 ` Arnd Bergmann
2012-04-10 11:31 ` Arnd Bergmann
2012-04-10 12:53 ` Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 04/10] ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops Marek Szyprowski
2012-04-10 11:04 ` Marek Szyprowski
2012-04-10 11:43 ` Arnd Bergmann
2012-04-10 11:43 ` Arnd Bergmann
2012-04-11 12:05 ` Marek Szyprowski
2012-04-11 12:18 ` Arnd Bergmann
2012-04-11 13:05 ` Marek Szyprowski [this message]
2012-04-11 13:05 ` Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 05/10] ARM: dma-mapping: use asm-generic/dma-mapping-common.h Marek Szyprowski
2012-04-10 11:47 ` Arnd Bergmann
2012-04-10 11:47 ` Arnd Bergmann
2012-04-11 12:07 ` Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 06/10] ARM: dma-mapping: implement dma sg methods on top of any generic dma ops Marek Szyprowski
2012-04-10 11:04 ` [PATCHv8 07/10] ARM: dma-mapping: move all dma bounce code to separate dma ops structure Marek Szyprowski
[not found] ` <1334055852-19500-8-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-04-10 12:24 ` Arnd Bergmann
2012-04-10 12:24 ` Arnd Bergmann
[not found] ` <201204101224.24959.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-10 12:51 ` Marek Szyprowski
2012-04-10 12:51 ` Marek Szyprowski
2012-04-10 13:17 ` Arnd Bergmann
[not found] ` <1334055852-19500-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-04-10 11:04 ` [PATCHv8 08/10] ARM: dma-mapping: remove redundant code and cleanup Marek Szyprowski
2012-04-10 11:04 ` Marek Szyprowski
2012-04-10 12:22 ` Arnd Bergmann
2012-04-10 12:22 ` Arnd Bergmann
2012-04-18 7:14 ` [PATCHv8 00/10] ARM: DMA-mapping framework redesign Subash Patel
2012-04-18 7:14 ` Subash Patel
2012-04-10 11:04 ` [PATCHv8 09/10] ARM: dma-mapping: use alloc, mmap, free from dma_ops Marek Szyprowski
[not found] ` <1334055852-19500-10-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-04-10 12:21 ` Arnd Bergmann
2012-04-10 12:21 ` Arnd Bergmann
2012-04-10 11:04 ` [PATCHv8 10/10] ARM: dma-mapping: add support for IOMMU mapper Marek Szyprowski
2012-04-10 11:58 ` Arnd Bergmann
2012-04-10 11:58 ` Arnd Bergmann
[not found] ` <201204101158.29590.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-10 12:57 ` Marek Szyprowski
2012-04-10 12:57 ` Marek Szyprowski
2012-04-12 9:49 ` Marek Szyprowski
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='014901cd17e3$d67d18b0$83774a10$%szyprowski@samsung.com' \
--to=m.szyprowski@samsung.com \
--cc=andrzej.p@samsung.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=chunsang.jeong@linaro.org \
--cc=hdoyu@nvidia.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=konrad.wilk@oracle.com \
--cc=kyungmin.park@samsung.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
--cc=pullip.cho@samsung.com \
--cc=subashrp@gmail.com \
--cc=vdumpa@nvidia.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).