From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Christoph Hellwig <hch@lst.de>,
bart.vanassche@sandisk.com,
Alexander Duyck <alexander.h.duyck@intel.com>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Andrew Morton
<akpm@linux-foundation.org>"linux-arch@vger.kernel.org"
<linux-arch@vger.kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
arcml <linux-snps-arc@lists.infradead.org>
Subject: semantics of dma_map_single()
Date: Sat, 15 Jul 2017 18:24:03 -0700 [thread overview]
Message-ID: <dc128260-6641-828a-3bb6-c2f0b4f09f78@synopsys.com> (raw)
P.S. Apologies in advance for the explicit TO list, it seemed adding people who've
touched the dma mapping code (for ARC atleast), would respond sooner ;-)
The question is does dma_map_single() imply a single region (possibly > PAGE_SIZE)
or does it imply PAGE_SIZE. Documentation/DMA-API* is not explicit about one or
the other and the code below seems to point to "a" struct page, although it could
also mean multiple pages, specially if the pages are contiguous, say as those
returned by alloc_pages(with order > 0)
static inline dma_addr_t dma_map_single_attrs(dev, size, dir, attrs)
{
addr = ops->map_page(dev,
virt_to_page(ptr), <--- this is one struct page
offset_in_page(ptr), size, dir, attrs);
}
ARC dma_map_single() currently only handles cache coherency for only one struct
page or PAGE_SIZE worth of memory, and we have a customer who seem to assume that
it handles a region.
Looking at other arches dma mapping backend, it is not clear either what the
semantics are.
Thx,
-Vineet
--
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>
next reply other threads:[~2017-07-16 1:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-16 1:24 Vineet Gupta [this message]
2017-07-17 6:42 ` semantics of dma_map_single() Christoph Hellwig
2017-07-17 16:06 ` Vineet Gupta
2017-07-17 16:46 ` James Bottomley
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=dc128260-6641-828a-3bb6-c2f0b4f09f78@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@intel.com \
--cc=bart.vanassche@sandisk.com \
--cc=hch@lst.de \
--cc=k.kozlowski@samsung.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-snps-arc@lists.infradead.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 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).