Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1670787
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree |
| Date | 2017-06-20 15:50 +0200 |
| Message-ID | <tUrHB-Q2-47@gated-at.bofh.it> (permalink) |
| References | <tKBIe-15d-7@gated-at.bofh.it> <tKCkW-1Ap-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Wouldn't the smal patch below solve the same issue in a simple way?
diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
index 640a7e63c453..e8f8447d705b 100644
--- a/drivers/base/dma-coherent.c
+++ b/drivers/base/dma-coherent.c
@@ -290,9 +290,11 @@ EXPORT_SYMBOL(dma_mmap_from_coherent);
static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev)
{
struct dma_coherent_mem *mem = rmem->priv;
+ dma_addr_t dev_addr = ((rmem->base >> PAGE_SHIFT) -
+ dev->dma_pfn_offset) << PAGE_SHIFT;
if (!mem &&
- !dma_init_coherent_memory(rmem->base, rmem->base, rmem->size,
+ !dma_init_coherent_memory(rmem->base, dev_addr, rmem->size,
DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE,
&mem)) {
pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n",
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v5 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Christoph Hellwig <hch@infradead.org> - 2017-06-20 15:50 +0200
Re: [PATCH v5 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Robin Murphy <robin.murphy@arm.com> - 2017-06-20 16:00 +0200
Re: [PATCH v5 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Christoph Hellwig <hch@infradead.org> - 2017-06-26 11:40 +0200
Re: [PATCH v5 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Vladimir Murzin <vladimir.murzin@arm.com> - 2017-06-22 15:00 +0200
csiph-web