mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
memory-hotplug: create /sys/firmware/memmap entry for new memory
A memmap is a directory in sysfs which includes 3 text files: start, end and type. For example: start: 0x100000 end: 0x7e7b1cff type: System RAM Interface firmware_map_add was not called explicitly. Remove it and add function firmware_map_add_hotplug as hotplug interface of memmap. Each memory entry has a memmap in sysfs, When we hot-add new memory, sysfs does not export memmap entry for it. We add a call in function add_memory to function firmware_map_add_hotplug. Add a new function add_sysfs_fw_map_entry() to create memmap entry, it will be called when initialize memmap and hot-add memory. [[email protected]: un-kernedoc a no longer kerneldoc comment] Signed-off-by: Shaohui Zheng <[email protected]> Acked-by: Andi Kleen <[email protected]> Acked-by: Yasunori Goto <[email protected]> Reviewed-by: Wu Fengguang <[email protected]> Cc: Dave Hansen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
9d8cebd4bc
commit
d96ae53091
3 changed files with 43 additions and 24 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <linux/pfn.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/mm_inline.h>
|
||||
#include <linux/firmware-map.h>
|
||||
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
|
|
@ -523,6 +524,9 @@ int __ref add_memory(int nid, u64 start, u64 size)
|
|||
BUG_ON(ret);
|
||||
}
|
||||
|
||||
/* create new memmap entry */
|
||||
firmware_map_add_hotplug(start, start + size, "System RAM");
|
||||
|
||||
goto out;
|
||||
|
||||
error:
|
||||
|
|
|
|||
Loading…
Reference in a new issue