Skip to contentSkip to conversation

drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent

PATCH RESEND Jaewon Kim 1 participant 1 message Jun 7, 2016 Memory management

lore
Share & tools
lore

Jaewon Kim

author
#0 lore raw
Quoted 30 lines
Quoted 19 lines

From: Jaewon <[email protected]>

There was an alignment mismatch issue for CMA and it was fixed by
commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup"). However the way of the commit considers not only dma-contiguous(CMA) but also dma-coherent which has no that requirement.

This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent.

---
 drivers/of/of_reserved_mem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/of/of_reserved_mem.c +0 -0
index ed01c01..45b873e 100644

drivers/of/of_reserved_mem.c static int __init __reserved_mem_alloc_size(unsigned long node, · line 133

Quoted 8 lines
drivers/of/of_reserved_mem.c +4 -1
@@ -127,7 +127,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
        }
 
        /* Need adjust the alignment to satisfy the CMA requirement */
-       if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool"))
+       if (IS_ENABLED(CONFIG_CMA)
+           && of_flat_dt_is_compatible(node, "shared-dma-pool")
+           && of_get_flat_dt_prop(node, "reusable", NULL)
+           && !of_get_flat_dt_prop(node, "no-map", NULL)) {

This won't actually compile as you add a bracket here, but no closing bracket...

Quoted 1 line

I've fixed up and applied.

Thank you very much for your correction.
I might add debug code with the bracket.
Please let me know if any issue in submitting this patch

Quoted 7 lines
Quoted 7 lines
drivers/of/of_reserved_mem.c +0 -1
                align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
 
        prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
--

1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>