提交 0b8da654 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

[S390] Fix memory detection.

Yet another patch in the countless series of memory detection fixes:
if the last area of the reported storage size is a hole the detection
loop will loop forever.
Just break chunk detection loop if its end is going to be larger than
reported storage size.
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 0d2be088
...@@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize) ...@@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize)
cc = __tprot(addr); cc = __tprot(addr);
while (cc == old_cc) { while (cc == old_cc) {
addr += CHUNK_INCR; addr += CHUNK_INCR;
cc = __tprot(addr); if (addr >= memsize)
break;
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
if (addr == ADDR2G) if (addr == ADDR2G)
break; break;
#endif #endif
cc = __tprot(addr);
} }
if (old_addr != addr && if (old_addr != addr &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册