Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1680955 > unrolled thread
| Started by | Vladimir Kondratiev <vladimir.kondratiev@gmail.com> |
|---|---|
| First post | 2017-07-04 15:00 +0200 |
| Last post | 2017-07-05 21:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] rmem: support for dma_addr different from phys_addr Vladimir Kondratiev <vladimir.kondratiev@gmail.com> - 2017-07-04 15:00 +0200
Re: [PATCH] rmem: support for dma_addr different from phys_addr Christoph Hellwig <hch@infradead.org> - 2017-07-05 21:30 +0200
| From | Vladimir Kondratiev <vladimir.kondratiev@gmail.com> |
|---|---|
| Date | 2017-07-04 15:00 +0200 |
| Subject | [PATCH] rmem: support for dma_addr different from phys_addr |
| Message-ID | <tZvAV-8l6-63@gated-at.bofh.it> |
On some systems, dma address differs from physical one due to
various reasons.
dma_init_coherent_memory is aware of it, it takes both
phys_addr_t and dma_addt_t arguments for memory block.
However, rmem_dma_device_init passes physical address for DMA one.
Fix this, using phys_to_dma(). This assumes the whole buffer has
same offset between physical and dma addresses.
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
---
drivers/base/dma-coherent.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/dma-coherent.c b/drivers/base/dma-coherent.c
index 640a7e63c453..5371cb19c918 100644
--- a/drivers/base/dma-coherent.c
+++ b/drivers/base/dma-coherent.c
@@ -292,7 +292,8 @@ static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev)
struct dma_coherent_mem *mem = rmem->priv;
if (!mem &&
- !dma_init_coherent_memory(rmem->base, rmem->base, rmem->size,
+ !dma_init_coherent_memory(rmem->base, phys_to_dma(dev, rmem->base),
+ 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",
--
2.11.0
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2017-07-05 21:30 +0200 |
| Message-ID | <tZY9Q-273-5@gated-at.bofh.it> |
| In reply to | #1680955 |
We've already got a different fix for this in the dma-mapping tree for this merge window: http://git.infradead.org/users/hch/dma-mapping.git/commitdiff/c41f9ea998f3ba61f38fa350eef28ec6caf0a07d Also I think the subject line is rather confusing, I only read this mail by accident..
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web