OSDN Git Service

ARM: 8826/1: mm: initialize pfn limits with find_limits()
authorDoug Berger <opendmb@gmail.com>
Tue, 22 Jan 2019 20:05:10 +0000 (21:05 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 1 Feb 2019 21:44:12 +0000 (21:44 +0000)
commit071d184a19f673bbb69a593c2ff4bd7acc0d1fe6
treeb4fa6e8677a195c348b69de6dc1556f607e5a258
parent58ca33824ff850bee93c850830a7b180486f3371
ARM: 8826/1: mm: initialize pfn limits with find_limits()

The max_low_pfn value must be set before sparse_init() is called to
keep the early memblock allocations and frees balanced for kmemleak
initialization when sparsemem is enabled.

This commit accomplishes that by replacing the local variables min,
max_low, and max_high with the global limit variables min_low_pfn,
max_low_pfn, and max_pfn respectively in bootmem_init(). The global
variables are initialized directly by find_limits() and used in the
remainder of the function.

Fixes: 9099daed9c69 ("mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping")
Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mm/init.c