diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-15 22:57:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-15 22:57:57 -0400 |
commit | ebb1951d3624c2f961abe676645c13e5a1145569 (patch) | |
tree | 5c63654338f2caf0b9dc41281b7b6a7b39ea5577 /lib | |
parent | f2b6079464fc73cf12f08248180a618f05033a70 (diff) |
lmb: Fix reserved region handling in lmb_enforce_memory_limit().
The idea of the implementation of this fix is from Michael Ellerman.
This function has two loops, but they each interpret the memory_limit
value differently. The first loop interprets it as a "size limit"
whereas the second loop interprets it as an "address limit".
Before the second loop runs, reset memory_limit to lmb_end_of_DRAM()
so that it all works out.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lmb.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -462,6 +462,8 @@ void __init lmb_enforce_memory_limit(u64 memory_limit) | |||
462 | if (lmb.memory.region[0].size < lmb.rmo_size) | 462 | if (lmb.memory.region[0].size < lmb.rmo_size) |
463 | lmb.rmo_size = lmb.memory.region[0].size; | 463 | lmb.rmo_size = lmb.memory.region[0].size; |
464 | 464 | ||
465 | memory_limit = lmb_end_of_DRAM(); | ||
466 | |||
465 | /* And truncate any reserves above the limit also. */ | 467 | /* And truncate any reserves above the limit also. */ |
466 | for (i = 0; i < lmb.reserved.cnt; i++) { | 468 | for (i = 0; i < lmb.reserved.cnt; i++) { |
467 | p = &lmb.reserved.region[i]; | 469 | p = &lmb.reserved.region[i]; |