Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1688028

semantics of dma_map_single()

From Vineet Gupta <Vineet.Gupta1@synopsys.com>
Newsgroups linux.kernel
Subject semantics of dma_map_single()
Date 2017-07-16 03:30 +0200
Message-ID <u3GxH-tD-1@gated-at.bofh.it> (permalink)
Organization Synopsys

Show all headers | View 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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

semantics of dma_map_single() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2017-07-16 03:30 +0200
  Re: semantics of dma_map_single() Christoph Hellwig <hch@lst.de> - 2017-07-17 08:50 +0200
    Re: semantics of dma_map_single() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2017-07-17 18:10 +0200
      Re: semantics of dma_map_single() James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-07-17 18:50 +0200

csiph-web