* [PATCH] MIPS: init: Prevent adding memory before PHYS_OFFSET
@ 2019-09-24 15:20 Thomas Bogendoerfer
2019-10-02 22:54 ` Paul Burton
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 2019-09-24 15:20 UTC (permalink / raw)
To: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel
On some SGI machines (IP28 and IP30) a small region of memory is mirrored
to pyhsical address 0 for exception vectors while rest of the memory
is reachable at a higher physical address. ARC PROM marks this
region as reserved, but with commit a94e4f24ec83 ("MIPS: init: Drop
boot_mem_map") this chunk is used, when searching for start of ram,
which breaks at least IP28 and IP30 machines. To fix this
add_region_memory() checks for start address < PHYS_OFFSET and ignores
these chunks.
Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
arch/mips/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f5c6b4c6de24..5eec13b8d222 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -108,6 +108,9 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
return;
}
+ if (start < PHYS_OFFSET)
+ return;
+
memblock_add(start, size);
/* Reserve any memory except the ordinary RAM ranges. */
switch (type) {
--
2.13.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: init: Prevent adding memory before PHYS_OFFSET
2019-09-24 15:20 [PATCH] MIPS: init: Prevent adding memory before PHYS_OFFSET Thomas Bogendoerfer
@ 2019-10-02 22:54 ` Paul Burton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-10-02 22:54 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel,
linux-mips
Hello,
Thomas Bogendoerfer wrote:
> On some SGI machines (IP28 and IP30) a small region of memory is mirrored
> to pyhsical address 0 for exception vectors while rest of the memory
> is reachable at a higher physical address. ARC PROM marks this
> region as reserved, but with commit a94e4f24ec83 ("MIPS: init: Drop
> boot_mem_map") this chunk is used, when searching for start of ram,
> which breaks at least IP28 and IP30 machines. To fix this
> add_region_memory() checks for start address < PHYS_OFFSET and ignores
> these chunks.
Applied to mips-fixes.
> commit bd848d1b9235
> https://git.kernel.org/mips/c/bd848d1b9235
>
> Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map")
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> Signed-off-by: Paul Burton <paul.burton@mips.com>
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-02 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 15:20 [PATCH] MIPS: init: Prevent adding memory before PHYS_OFFSET Thomas Bogendoerfer
2019-10-02 22:54 ` Paul Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).