diff mbox series

[v2] memblock: export memblock_free() to free reserved memory.

Message ID CAPRrSS-Qf_hT2_ZDiyMLG-Jj9ymKcpvvBvzrK-4DgtdS8QAikw@mail.gmail.com (mailing list archive)
State New
Headers show
Series [v2] memblock: export memblock_free() to free reserved memory. | expand

Commit Message

liangxi Liu June 25, 2024, 12:08 p.m. UTC
---------- Forwarded message ---------
From: Guanshun Liu <lgs156412@gmail.com>
Date: Tue, Jun 25, 2024 at 7:58 PM
Subject: [PATCH v2] memblock: export memblock_free() to free reserved
memory.
To: <rppt@kernel.org>
Cc: <akpm@linux-foundation.org>, Guanshun Liu <lgs156412@gmail.com>


On architectures that support the preservation of memblock metadata
after __init, allow drivers to call memblock_free() to free a
reservation configured in dts. This is a hack to support the
freeing of bootsplash reservations passed to Linux by the bootloader.

Signed-off-by: Guanshun Liu <lgs156412@gmail.com>
---
 mm/memblock.c | 3 +++
 1 file changed, 3 insertions(+)

  * memblock_phys_free - free boot memory block
diff mbox series

Patch

diff --git a/mm/memblock.c b/mm/memblock.c
index 6d18485571b4..20e7f81fc076 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -848,6 +848,9 @@  void __init_memblock memblock_free(void *ptr, size_t
size)
        if (ptr)
                memblock_phys_free(__pa(ptr), size);
 }
+#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
+EXPORT_SYMBOL_GPL(memblock_free);
+#endif

 /**