Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8946e7a5 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "defconfig: sm8150: Enable memory region offlining support"

parents c666d0d1 16fb3ac3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -250,7 +250,6 @@ config HOTPLUG_SIZE_BITS
	int "Memory hotplug block size(29 => 512MB 30 => 1GB)"
	depends on SPARSEMEM
	depends on MEMORY_HOTPLUG
	depends on QCOM_MEM_OFFLINE
	default 30
	help
	 Selects granularity of hotplug memory. Block
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ CONFIG_SCHED_MC=y
CONFIG_NR_CPUS=8
CONFIG_PREEMPT=y
CONFIG_HZ_100=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_CMA=y
CONFIG_ZSMALLOC=y
CONFIG_HAVE_LOW_MEMORY_KILLER=y
@@ -507,6 +509,7 @@ CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_QCOM_GLINK_SMEM=y
CONFIG_RPMSG_QCOM_GLINK_SPSS=y
CONFIG_RPMSG_QCOM_GLINK_SPI=y
CONFIG_QCOM_MEM_OFFLINE=y
CONFIG_QCOM_CPUSS_DUMP=y
CONFIG_QCOM_RUN_QUEUE_STATS=y
CONFIG_QCOM_LLCC=y
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ CONFIG_SCHED_MC=y
CONFIG_NR_CPUS=8
CONFIG_PREEMPT=y
CONFIG_HZ_100=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_CLEANCACHE=y
CONFIG_CMA=y
CONFIG_CMA_DEBUGFS=y
@@ -529,6 +531,7 @@ CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_QCOM_GLINK_SMEM=y
CONFIG_RPMSG_QCOM_GLINK_SPSS=y
CONFIG_RPMSG_QCOM_GLINK_SPI=y
CONFIG_QCOM_MEM_OFFLINE=y
CONFIG_QCOM_CPUSS_DUMP=y
CONFIG_QCOM_RUN_QUEUE_STATS=y
CONFIG_QCOM_LLCC=y
+14 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@
#include <linux/crash_dump.h>
#include <linux/memory.h>
#include <linux/libfdt.h>
#include <linux/memblock.h>

#include <asm/boot.h>
#include <asm/fixmap.h>
@@ -324,9 +325,10 @@ static void __init update_memory_limit(void)
	unsigned long node, mp;
	const char *p;
	unsigned long long ram_sz, sz;
	phys_addr_t end_addr, addr_aligned, offset;
	int ret;

	ram_sz = memblock_end_of_DRAM() - memblock_start_of_DRAM();
	ram_sz = memblock_phys_mem_size();
	node = of_get_flat_dt_subnode_by_name(dt_root, "mem-offline");
	if (node == -FDT_ERR_NOTFOUND) {
		pr_err("mem-offine node not found in FDT\n");
@@ -350,7 +352,17 @@ static void __init update_memory_limit(void)
	}
	sz = ram_sz - ((ram_sz * mp) / 100);
	memory_limit = (phys_addr_t)sz;
	memory_limit = ALIGN(memory_limit, MIN_MEMORY_BLOCK_SIZE);
	end_addr = memblock_max_addr(memory_limit);
	addr_aligned = ALIGN(end_addr, MIN_MEMORY_BLOCK_SIZE);
	offset = addr_aligned - end_addr;

	if (offset > MIN_MEMORY_BLOCK_SIZE / 2) {
		addr_aligned = ALIGN_DOWN(end_addr, MIN_MEMORY_BLOCK_SIZE);
		offset = end_addr - addr_aligned;
		memory_limit -= offset;
	} else {
		memory_limit += offset;
	}

	pr_notice("Memory limit set/overridden to %lldMB\n",
							memory_limit >> 20);
+1 −0
Original line number Diff line number Diff line
@@ -311,6 +311,7 @@ phys_addr_t memblock_reserved_size(void);
phys_addr_t memblock_mem_size(unsigned long limit_pfn);
phys_addr_t memblock_start_of_DRAM(void);
phys_addr_t memblock_end_of_DRAM(void);
phys_addr_t memblock_max_addr(phys_addr_t limit);
void memblock_enforce_memory_limit(phys_addr_t memory_limit);
void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size);
void memblock_mem_limit_remove_map(phys_addr_t limit);
Loading