Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: Allow mem_reserve of memory with a base address of zero

__reserved_mem_reserve_reg() won't reserve memory if the base address
is zero. This change removes the check for a base address of zero and
allows it to be reserved.

Allowing the first 4K of memory to be reserved will help solve a
problem on some ARM systems where the the first 16K of memory is
unused and becomes allocable memory. This will prevent this memory
from being used for DMA by drivers like the USB OHCI driver which
consider a physical address of zero to be illegal.

Cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>

authored by

Al Cooper and committed by
Grant Likely
b5f2a8c0 c9d26423

+1 -1
+1 -1
drivers/of/fdt.c
··· 453 453 base = dt_mem_next_cell(dt_root_addr_cells, &prop); 454 454 size = dt_mem_next_cell(dt_root_size_cells, &prop); 455 455 456 - if (base && size && 456 + if (size && 457 457 early_init_dt_reserve_memory_arch(base, size, nomap) == 0) 458 458 pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %ld MiB\n", 459 459 uname, &base, (unsigned long)size / SZ_1M);