linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND][PATCH] ARM: mm: Free memblock from free_initrd_mem()
       [not found] <CGME20210127041512epcas1p1306df0339fd2ffffec43cca6b0475a88@epcas1p1.samsung.com>
@ 2021-01-27  4:17 ` Seung-Woo Kim
  0 siblings, 0 replies; only message in thread
From: Seung-Woo Kim @ 2021-01-27  4:17 UTC (permalink / raw)
  To: linux, linux-arm-kernel
  Cc: linux-kernel, rppt, akpm, ardb, jcmvbkbc, olof, sw0312.kim, jh80.chung

Even after free_initrd_mem(), memblock for initrd remains. Free
memblock for initrd from free_initrd_mem() line generic function.

Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
 arch/arm/mm/init.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 828a256..f7db023 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -530,6 +530,13 @@ void free_initmem(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
+#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
+	unsigned long aligned_start = ALIGN_DOWN(start, PAGE_SIZE);
+	unsigned long aligned_end = ALIGN(end, PAGE_SIZE);
+
+	memblock_free(__pa(aligned_start), aligned_end - aligned_start);
+#endif
+
 	if (start == initrd_start)
 		start = round_down(start, PAGE_SIZE);
 	if (end == initrd_end)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-27  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210127041512epcas1p1306df0339fd2ffffec43cca6b0475a88@epcas1p1.samsung.com>
2021-01-27  4:17 ` [RESEND][PATCH] ARM: mm: Free memblock from free_initrd_mem() Seung-Woo Kim

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).