diff options
Diffstat (limited to 'drivers/of/of_reserved_mem.c')
-rw-r--r-- | drivers/of/of_reserved_mem.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index ed01c0172e4a..216648233874 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c | |||
@@ -127,8 +127,15 @@ static int __init __reserved_mem_alloc_size(unsigned long node, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /* Need adjust the alignment to satisfy the CMA requirement */ | 129 | /* Need adjust the alignment to satisfy the CMA requirement */ |
130 | if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool")) | 130 | if (IS_ENABLED(CONFIG_CMA) |
131 | align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); | 131 | && of_flat_dt_is_compatible(node, "shared-dma-pool") |
132 | && of_get_flat_dt_prop(node, "reusable", NULL) | ||
133 | && !of_get_flat_dt_prop(node, "no-map", NULL)) { | ||
134 | unsigned long order = | ||
135 | max_t(unsigned long, MAX_ORDER - 1, pageblock_order); | ||
136 | |||
137 | align = max(align, (phys_addr_t)PAGE_SIZE << order); | ||
138 | } | ||
132 | 139 | ||
133 | prop = of_get_flat_dt_prop(node, "alloc-ranges", &len); | 140 | prop = of_get_flat_dt_prop(node, "alloc-ranges", &len); |
134 | if (prop) { | 141 | if (prop) { |