]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: CMA: Do not reserve memory if not required
authorZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Tue, 28 Oct 2014 11:28:34 +0000 (11:28 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 29 Oct 2014 01:59:25 +0000 (02:59 +0100)
commit5cd2a49d9d10ac6dac339fc10f5048f6c765ec6f
treef9a397597f80ba6cb0cea8fe79830d42a2056f00
parentb4b19210c0b330bb6e7103b2cbe832075f08af46
MIPS: CMA: Do not reserve memory if not required

Even if CMA is disabled, the for_each_memblock macro expands
to run reserve_bootmem once. Hence, reserve_bootmem attempts to
reserve location 0 of size 0.

Add a check to avoid that.

Issue was highlighted during testing with EVA enabled.
resrve_bootmem used to exit gracefully when passed arguments to
reserve 0 size location at 0 without EVA.

But with EVA enabled, macros would point to different addresses
and the code would trigger a BUG.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Tested-by: Markos Chandras <markos.chandras@imgtec.com>
Tested-by: Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8231/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/setup.c