Skip to contentSkip to conversation

Fix mem= handling when the memory limit is > RMO size

PATCH New Michael Ellerman 1 participant 1 message Jul 4, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix mem= handling when the memory limit is > RMO size

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.

---

 arch/powerpc/mm/lmb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/mm/lmb.c +2 -1
Index: 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++) {