MIPS: fix incorrect mem=X@Y handling
[email protected] Tue, 15 May 2018 14:47:42 +0200
| Newsgroups | gmane.linux.ports.mips.cvs |
|---|---|
| Message-ID | <S23992773AbeEOMrpVfu80/[email protected]> |
Author: Marcin Nowakowski <[email protected]> Thu Feb 1 12:37:21 2018 +0100 Comitter: Ralf Baechle <[email protected]> Fri Feb 2 15:14:17 2018 +0100 Commit: 131efd5943ba14aa02b9242548d9e486cd099278 Gitweb: https://git.linux-mips.org/g/ralf/linux/131efd5943ba Branch: master Commit 73fbc1eba7ff ("MIPS: fix mem=X@Y commandline processing") added a fix to ensure that the memory range between PHYS_OFFSET and low memory address specified by mem= cmdline argument is not later processed by free_all_bootmem. This change was incorrect for systems where the commandline specifies more than 1 mem argument, as it will cause all memory between PHYS_OFFSET and each of the memory offsets to be marked as reserved, which results in parts of the RAM marked as reserved (Creator CI20's u-boot has a default commandline argument 'mem=256M@0x0 mem=768M@0x30000000'). Change the behaviour to ensure that only the range between PHYS_OFFSET and the lowest start address of the memories is marked as protected. This change also ensures that the range is marked protected even if it's only defined through the devicetree and not only via commandline arguments. Reported-by: Mathieu Malaterre <[email protected]> Signed-off-by: Marcin Nowakowski <[email protected]> Fixes: 73fbc1eba7ff ("MIPS: fix mem=X@Y commandline processing") Cc: James Hogan <[email protected]> Cc: [email protected] # v4.11+ Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/18562/ Tested-by: Mathieu Malaterre <[email protected]> Signed-off-by: Ralf Baechle <[email protected]> --- arch/mips/kernel/setup.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)