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

Commit 711be5ab authored by Laura Abbott's avatar Laura Abbott
Browse files

msm: Remove DONT_MAP_HOLE_AFTER_MEMBANK0



The DONT_MAP_HOLE_AFTER_MEMBANK0 feature is now deprecated. Remove
the code associated with it.

Change-Id: I729b9574a7655e97c8e7abc68797b874e90dcac2
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 08a9c39e
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1797,14 +1797,6 @@ choice
	help
	  Select the method of reclaiming virtual memory

config DONT_MAP_HOLE_AFTER_MEMBANK0
	bool "Map around the largest hole"
	help
	  Do not map the memory belonging to the largest hole
	  into the virtual space. This results in more lowmem.
	  If multiple holes are present, only the largest hole
	  in the first 256MB of memory is not mapped.

config ENABLE_VMALLOC_SAVING
	bool "Reclaim memory for each subsystem"
	help
+0 −1
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ config ARCH_MPQ8092
	select MSM_QDSP6_APRV2 if SND_SOC
	select MSM_NOPM
	select MEMORY_HOLE_CARVEOUT
	select DONT_MAP_HOLE_AFTER_MEMBANK0
	select QMI_ENCDEC
	select MIGHT_HAVE_PCI
	select ARCH_SUPPORTS_MSI
+0 −26
Original line number Diff line number Diff line
@@ -32,32 +32,6 @@ extern void l2x0_cache_sync(void);
#endif

#define MAX_HOLE_ADDRESS    (PHYS_OFFSET + 0x10000000)
extern phys_addr_t memory_hole_offset;
extern phys_addr_t memory_hole_start;
extern phys_addr_t memory_hole_end;
extern unsigned long memory_hole_align;
extern unsigned long virtual_hole_start;
extern unsigned long virtual_hole_end;
#ifdef CONFIG_DONT_MAP_HOLE_AFTER_MEMBANK0
void find_memory_hole(void);

#define MEM_HOLE_END_PHYS_OFFSET (memory_hole_end)
#define MEM_HOLE_PAGE_OFFSET (PAGE_OFFSET + memory_hole_offset + \
				memory_hole_align)

#define __phys_to_virt(phys)				\
	(unsigned long)\
	((MEM_HOLE_END_PHYS_OFFSET && ((phys) >= MEM_HOLE_END_PHYS_OFFSET)) ? \
	(phys) - MEM_HOLE_END_PHYS_OFFSET + MEM_HOLE_PAGE_OFFSET :	\
	(phys) - PHYS_OFFSET + PAGE_OFFSET)

#define __virt_to_phys(virt)				\
	(unsigned long)\
	((MEM_HOLE_END_PHYS_OFFSET && ((virt) >= MEM_HOLE_PAGE_OFFSET)) ? \
	(virt) - MEM_HOLE_PAGE_OFFSET + MEM_HOLE_END_PHYS_OFFSET :	\
	(virt) - PAGE_OFFSET + PHYS_OFFSET)
#endif

/*
 * Need a temporary unique variable that no one will ever see to
 * hold the compat string. Line number gives this easily.
+0 −78
Original line number Diff line number Diff line
@@ -378,84 +378,6 @@ static int __init meminfo_cmp(const void *_a, const void *_b)
	return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
}

phys_addr_t memory_hole_offset;
EXPORT_SYMBOL(memory_hole_offset);
phys_addr_t memory_hole_start;
EXPORT_SYMBOL(memory_hole_start);
phys_addr_t memory_hole_end;
EXPORT_SYMBOL(memory_hole_end);
unsigned long memory_hole_align;
EXPORT_SYMBOL(memory_hole_align);
unsigned long virtual_hole_start;
unsigned long virtual_hole_end;

#ifdef CONFIG_DONT_MAP_HOLE_AFTER_MEMBANK0
void find_memory_hole(void)
{
	int i;
	phys_addr_t hole_start;
	phys_addr_t hole_size;
	unsigned long hole_end_virt;

	/*
	 * Find the start and end of the hole, using meminfo.
	 */
	for (i = 0; i < (meminfo.nr_banks - 1); i++) {
		if ((meminfo.bank[i].start + meminfo.bank[i].size) !=
						meminfo.bank[i+1].start) {
			if (meminfo.bank[i].start + meminfo.bank[i].size
							<= MAX_HOLE_ADDRESS) {

				hole_start = meminfo.bank[i].start +
							meminfo.bank[i].size;
				hole_size = meminfo.bank[i+1].start -
								hole_start;

				if (memory_hole_start == 0 &&
							memory_hole_end == 0) {
					memory_hole_start = hole_start;
					memory_hole_end = hole_start +
								hole_size;
				} else if ((memory_hole_end -
					memory_hole_start) <= hole_size) {
					memory_hole_start = hole_start;
					memory_hole_end = hole_start +
								hole_size;
				}
			}
		}
	}

	memory_hole_offset = memory_hole_start - PHYS_OFFSET;
	if (!IS_ALIGNED(memory_hole_start, SECTION_SIZE)) {
		pr_err("memory_hole_start %pa is not aligned to %lx\n",
			&memory_hole_start, SECTION_SIZE);
		BUG();
	}
	if (!IS_ALIGNED(memory_hole_end, SECTION_SIZE)) {
		pr_err("memory_hole_end %pa is not aligned to %lx\n",
			&memory_hole_end, SECTION_SIZE);
		BUG();
	}

	hole_end_virt = __phys_to_virt(memory_hole_end);

	if ((!IS_ALIGNED(hole_end_virt, PMD_SIZE) &&
	     IS_ALIGNED(memory_hole_end, PMD_SIZE)) ||
	     (IS_ALIGNED(hole_end_virt, PMD_SIZE) &&
	      !IS_ALIGNED(memory_hole_end, PMD_SIZE))) {
		memory_hole_align = !IS_ALIGNED(hole_end_virt, PMD_SIZE) ?
					hole_end_virt & ~PMD_MASK :
					memory_hole_end & ~PMD_MASK;
		virtual_hole_start = hole_end_virt;
		virtual_hole_end = hole_end_virt + memory_hole_align;
		pr_info("Physical memory hole is not aligned. There will be a virtual memory hole from %lx to %lx\n",
			virtual_hole_start, virtual_hole_end);
	}
}

#endif

void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
{
	int i;
+0 −3
Original line number Diff line number Diff line
@@ -1094,9 +1094,6 @@ void __init sanity_check_meminfo(void)
		}
	}
#endif
#ifdef CONFIG_DONT_MAP_HOLE_AFTER_MEMBANK0
	find_memory_hole();
#endif

	for (i = 0, j = 0; i < meminfo.nr_banks; i++) {
		struct membank *bank = &meminfo.bank[j];