All of lore.kernel.org
 help / color / mirror / Atom feed
* [OpenRISC] [PATCH] openrisc: Reserve memblock for initrd
@ 2020-08-31 21:21 ` Stafford Horne
  0 siblings, 0 replies; 10+ messages in thread
From: Stafford Horne @ 2020-08-31 21:21 UTC (permalink / raw)
  To: openrisc

Recently OpenRISC added support for external initrd images, but I found
some instability when using larger buildroot initrd images. It turned
out that I forgot to reserve the memblock space for the initrd image.

This patch fixes the instability issue by reserving memblock space.

Fixes: ff6c923dbec3 ("openrisc: Add support for external initrd images")
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/kernel/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index b18e775f8be3..2c8aa53cc7ba 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -80,6 +80,15 @@ static void __init setup_memory(void)
 	 */
 	memblock_reserve(__pa(_stext), _end - _stext);
 
+#ifdef CONFIG_BLK_DEV_INITRD
+	/* Then reserve the initrd, if any */
+	if (initrd_start && (initrd_end > initrd_start)) {
+		memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
+			ALIGN(initrd_end, PAGE_SIZE) -
+			ALIGN_DOWN(initrd_start, PAGE_SIZE));
+	}
+#endif /* CONFIG_BLK_DEV_INITRD */
+
 	early_init_fdt_reserve_self();
 	early_init_fdt_scan_reserved_mem();
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-03 14:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 21:21 [OpenRISC] [PATCH] openrisc: Reserve memblock for initrd Stafford Horne
2020-08-31 21:21 ` Stafford Horne
2020-09-01  5:59 ` [OpenRISC] " Mike Rapoport
2020-09-01  5:59   ` Mike Rapoport
2020-09-01 10:20   ` [OpenRISC] " Stafford Horne
2020-09-01 10:20     ` Stafford Horne
2020-09-01 12:11     ` [OpenRISC] " Mike Rapoport
2020-09-01 12:11       ` Mike Rapoport
2020-09-03 14:31       ` [OpenRISC] " Stafford Horne
2020-09-03 14:31         ` Stafford Horne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.