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

Commit b2077ebc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ARM fixes from Russell King:
 "This resolves some further issues with the dma mask changes on ARM
  which have been found by TI and others, and also some corner cases
  with the updates to the virtual to physical address translations.

  Konstantin also found some problems with the unwinder, which now
  performs tighter verification that the stack is valid while unwinding"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: fix asm/memory.h build error
  ARM: 7917/1: cacheflush: correctly limit range of memory region being flushed
  ARM: 7913/1: fix framepointer check in unwind_frame
  ARM: 7912/1: check stack pointer in get_wchan
  ARM: 7909/1: mm: Call setup_dma_zone() post early_paging_init()
  ARM: 7908/1: mm: Fix the arm_dma_limit calculation
  ARM: another fix for the DMA mapping checks
parents 2430cdd0 b713aa0b
Loading
Loading
Loading
Loading
+14 −17
Original line number Diff line number Diff line
@@ -100,23 +100,19 @@
#define TASK_UNMAPPED_BASE	UL(0x00000000)
#endif

#ifndef PHYS_OFFSET
#define PHYS_OFFSET 		UL(CONFIG_DRAM_BASE)
#endif

#ifndef END_MEM
#define END_MEM     		(UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
#endif

#ifndef PAGE_OFFSET
#define PAGE_OFFSET		(PHYS_OFFSET)
#define PAGE_OFFSET		PLAT_PHYS_OFFSET
#endif

/*
 * The module can be at any place in ram in nommu mode.
 */
#define MODULES_END		(END_MEM)
#define MODULES_VADDR		(PHYS_OFFSET)
#define MODULES_VADDR		PAGE_OFFSET

#define XIP_VIRT_ADDR(physaddr)  (physaddr)

@@ -157,6 +153,16 @@
#endif
#define ARCH_PGD_MASK		((1 << ARCH_PGD_SHIFT) - 1)

/*
 * PLAT_PHYS_OFFSET is the offset (from zero) of the start of physical
 * memory.  This is used for XIP and NoMMU kernels, or by kernels which
 * have their own mach/memory.h.  Assembly code must always use
 * PLAT_PHYS_OFFSET and not PHYS_OFFSET.
 */
#ifndef PLAT_PHYS_OFFSET
#define PLAT_PHYS_OFFSET	UL(CONFIG_PHYS_OFFSET)
#endif

#ifndef __ASSEMBLY__

/*
@@ -239,6 +245,8 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)

#else

#define PHYS_OFFSET	PLAT_PHYS_OFFSET

static inline phys_addr_t __virt_to_phys(unsigned long x)
{
	return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
@@ -251,17 +259,6 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)

#endif
#endif
#endif /* __ASSEMBLY__ */

#ifndef PHYS_OFFSET
#ifdef PLAT_PHYS_OFFSET
#define PHYS_OFFSET	PLAT_PHYS_OFFSET
#else
#define PHYS_OFFSET	UL(CONFIG_PHYS_OFFSET)
#endif
#endif

#ifndef __ASSEMBLY__

/*
 * PFNs are used to describe any physical page; this means
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ ENTRY(stext)

#ifdef CONFIG_ARM_MPU
	/* Calculate the size of a region covering just the kernel */
	ldr	r5, =PHYS_OFFSET		@ Region start: PHYS_OFFSET
	ldr	r5, =PLAT_PHYS_OFFSET		@ Region start: PHYS_OFFSET
	ldr     r6, =(_end)			@ Cover whole kernel
	sub	r6, r6, r5			@ Minimum size of region to map
	clz	r6, r6				@ Region size must be 2^N...
@@ -213,7 +213,7 @@ ENTRY(__setup_mpu)
	set_region_nr r0, #MPU_RAM_REGION
	isb
	/* Full access from PL0, PL1, shared for CONFIG_SMP, cacheable */
	ldr	r0, =PHYS_OFFSET		@ RAM starts at PHYS_OFFSET
	ldr	r0, =PLAT_PHYS_OFFSET		@ RAM starts at PHYS_OFFSET
	ldr	r5,=(MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL)

	setup_region r0, r5, r6, MPU_DATA_SIDE	@ PHYS_OFFSET, shared, enabled
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ ENTRY(stext)
	sub	r4, r3, r4			@ (PHYS_OFFSET - PAGE_OFFSET)
	add	r8, r8, r4			@ PHYS_OFFSET
#else
	ldr	r8, =PHYS_OFFSET		@ always constant in this case
	ldr	r8, =PLAT_PHYS_OFFSET		@ always constant in this case
#endif

	/*
+5 −2
Original line number Diff line number Diff line
@@ -404,6 +404,7 @@ EXPORT_SYMBOL(dump_fpu);
unsigned long get_wchan(struct task_struct *p)
{
	struct stackframe frame;
	unsigned long stack_page;
	int count = 0;
	if (!p || p == current || p->state == TASK_RUNNING)
		return 0;
@@ -412,9 +413,11 @@ unsigned long get_wchan(struct task_struct *p)
	frame.sp = thread_saved_sp(p);
	frame.lr = 0;			/* recovered from the stack */
	frame.pc = thread_saved_pc(p);
	stack_page = (unsigned long)task_stack_page(p);
	do {
		int ret = unwind_frame(&frame);
		if (ret < 0)
		if (frame.sp < stack_page ||
		    frame.sp >= stack_page + THREAD_SIZE ||
		    unwind_frame(&frame) < 0)
			return 0;
		if (!in_sched_functions(frame.pc))
			return frame.pc;
+1 −2
Original line number Diff line number Diff line
@@ -873,8 +873,6 @@ void __init setup_arch(char **cmdline_p)
	machine_desc = mdesc;
	machine_name = mdesc->name;

	setup_dma_zone(mdesc);

	if (mdesc->reboot_mode != REBOOT_HARD)
		reboot_mode = mdesc->reboot_mode;

@@ -892,6 +890,7 @@ void __init setup_arch(char **cmdline_p)
	sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);

	early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
	setup_dma_zone(mdesc);
	sanity_check_meminfo();
	arm_memblock_init(&meminfo, mdesc);

Loading