Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1689256
| From | James Bottomley <James.Bottomley@HansenPartnership.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: semantics of dma_map_single() |
| Date | 2017-07-17 18:50 +0200 |
| Message-ID | <u4hnA-7uP-19@gated-at.bofh.it> (permalink) |
| References | <u3GxH-tD-1@gated-at.bofh.it> <u480V-1v7-7@gated-at.bofh.it> <u4gKT-7hy-43@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 2017-07-17 at 09:06 -0700, Vineet Gupta wrote: > Hi Christoph, > > On 07/16/2017 11:42 PM, Christoph Hellwig wrote: > > > > I would expect that it would support any contiguous range in > > the kernel mapping (e.g. no vmalloc and friends). But it's not > > documented anywhere, and if no in kernel users makes use of that > > fact at the moment it might be better to document a page size > > limitation and add asserts to enforce it. > > My first thought was indeed to add a BUG_ON for @size > PAGE_SIZE > (also accounting for offset etc), but I have a feeling this will > cause too many breakages. So perhaps it would be better to add the > fact to Documentation that it can handle any physically contiguous > range. Actually, that's not historically right. dma_map_single() was originally designed to be called on any region that was kmalloc'd meaning it was capable of mapping physically contiguous > PAGE_SIZE regions. For years (decades?) we've been eliminating the specialised dma_map_single() calls in favour of dma_map_sg, so it's possible there may not be any large region consumers anymore, so it *may* be safe to enforce a PAGE_SIZE limit, but not without auditing the remaining callers. James
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll 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