Skip to content

Commit f3057ad

Browse files
rppttorvalds
authored andcommitted
mm: memblock: do not enforce current limit for memblock_phys* family
Until commit 92d12f9 ("memblock: refactor internal allocation functions") the maximal address for memblock allocations was forced to memblock.current_limit only for the allocation functions returning virtual address. The changes introduced by that commit moved the limit enforcement into the allocation core and as a result the allocation functions returning physical address also started to limit allocations to memblock.current_limit. This caused breakage of etnaviv GPU driver: etnaviv etnaviv: bound 130000.gpu (ops gpu_ops) etnaviv etnaviv: bound 134000.gpu (ops gpu_ops) etnaviv etnaviv: bound 2204000.gpu (ops gpu_ops) etnaviv-gpu 130000.gpu: model: GC2000, revision: 5108 etnaviv-gpu 130000.gpu: command buffer outside valid memory window etnaviv-gpu 134000.gpu: model: GC320, revision: 5007 etnaviv-gpu 134000.gpu: command buffer outside valid memory window etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215 etnaviv-gpu 2204000.gpu: Ignoring GPU with VG and FE2.0 Restore the behaviour of memblock_phys* family so that these functions will not enforce memblock.current_limit. Link: http://lkml.kernel.org/r/[email protected] Fixes: 92d12f9 ("memblock: refactor internal allocation functions") Signed-off-by: Mike Rapoport <[email protected]> Reported-by: Adam Ford <[email protected]> Tested-by: Adam Ford <[email protected]> [imx6q-logicpd] Cc: Catalin Marinas <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Lucas Stach <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b11edeb commit f3057ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/memblock.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,9 +1356,6 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
13561356
align = SMP_CACHE_BYTES;
13571357
}
13581358

1359-
if (end > memblock.current_limit)
1360-
end = memblock.current_limit;
1361-
13621359
again:
13631360
found = memblock_find_in_range_node(size, align, start, end, nid,
13641361
flags);
@@ -1469,6 +1466,9 @@ static void * __init memblock_alloc_internal(
14691466
if (WARN_ON_ONCE(slab_is_available()))
14701467
return kzalloc_node(size, GFP_NOWAIT, nid);
14711468

1469+
if (max_addr > memblock.current_limit)
1470+
max_addr = memblock.current_limit;
1471+
14721472
alloc = memblock_alloc_range_nid(size, align, min_addr, max_addr, nid);
14731473

14741474
/* retry allocation without lower limit */

0 commit comments

Comments
 (0)