From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: Paul Mackerras From: Michael Ellerman Date: Tue, 04 Jul 2006 17:13:23 +1000 Subject: [PATCH] Fix mem= handling when the memory limit is > RMO size Message-Id: <20060704071326.D785B67D31@ozlabs.org> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , There's a bug in my cleaned up mem= handling, if the memory limit is larger than the RMO size we'll erroneously enlarge the RMO size. Fix is to only change the RMO size if the memory limit is less than the current RMO value. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/lmb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: to-merge/arch/powerpc/mm/lmb.c =================================================================== --- to-merge.orig/arch/powerpc/mm/lmb.c +++ to-merge/arch/powerpc/mm/lmb.c @@ -320,7 +320,8 @@ void __init lmb_enforce_memory_limit(uns break; } - lmb.rmo_size = lmb.memory.region[0].size; + if (lmb.memory.region[0].size < lmb.rmo_size) + lmb.rmo_size = lmb.memory.region[0].size; /* And truncate any reserves above the limit also. */ for (i = 0; i < lmb.reserved.cnt; i++) {