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

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

Merge "arm64: Fix compilation errors while enabling memory hotplug"

parents 59e2e86f 025a7467
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -785,7 +785,8 @@ static int __init register_mem_limit_dumper(void)
__initcall(register_mem_limit_dumper);

#ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
		bool want_memblock)
{
	pg_data_t *pgdat;
	unsigned long start_pfn = start >> PAGE_SHIFT;
@@ -833,7 +834,7 @@ int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)

	pgdat = NODE_DATA(nid);

	ret = __add_pages(nid, start_pfn, nr_pages, want_memblock);
	ret = __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock);

	/*
	 * Make the pages usable after they have been added.
@@ -874,7 +875,7 @@ static void kernel_physical_mapping_remove(unsigned long start,

}

int arch_remove_memory(u64 start, u64 size)
int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
{
	unsigned long start_pfn = start >> PAGE_SHIFT;
	unsigned long nr_pages = size >> PAGE_SHIFT;
@@ -883,7 +884,7 @@ int arch_remove_memory(u64 start, u64 size)
	int ret = 0;

	zone = page_zone(page);
	ret = __remove_pages(zone, start_pfn, nr_pages);
	ret = __remove_pages(zone, start_pfn, nr_pages, altmap);
	WARN_ON_ONCE(ret);

	kernel_physical_mapping_remove(start, start + size);
+1 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
			p = vmemmap_alloc_block_buf(PMD_SIZE, node);
			if (!p) {
#ifdef CONFIG_MEMORY_HOTPLUG
				vmemmap_free(start, end);
				vmemmap_free(start, end, altmap);
#endif
				ret = -ENOMEM;
				break;
+2 −2
Original line number Diff line number Diff line
@@ -498,12 +498,12 @@ static ssize_t allocated_bytes_show(struct device *dev,
}
#endif

static DEVICE_ATTR_RO(phys_index, 0444, phys_index_show, NULL);
static DEVICE_ATTR(phys_index, 0444, phys_index_show, NULL);
static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state);
static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL);
static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL);
#ifdef CONFIG_MEMORY_HOTPLUG
static DEVICE_ATTR_RO(allocated_bytes, 0444, allocated_bytes_show, NULL);
static DEVICE_ATTR(allocated_bytes, 0444, allocated_bytes_show, NULL);
#endif

/*