Skip to content

Commit 697ed8d

Browse files
committed
Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: "A few more ARM fixes: - the assembly backtrace code suffers problems with the new printk() implementation which assumes that kernel messages without KERN_CONT should have newlines inserted between them. Fix this. - fix a section naming error - ".init.text" rather than ".text.init" - preallocate DMA debug memory at core_initcall() time rather than fs_initcall(), as we have some core drivers that need to use DMA mapping - and that triggers a kernel warning from the DMA debug code. - fix XIP kernels after the ro_after_init changes made this data permanently read-only" * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: Fix XIP kernels ARM: 8628/1: dma-mapping: preallocate DMA-debug hash tables in core_initcall ARM: 8624/1: proc-v7m.S: fix init section name ARM: fix backtrace
2 parents 77079b1 + 2a38110 commit 697ed8d

File tree

5 files changed

+30
-36
lines changed

5 files changed

+30
-36
lines changed

arch/arm/kernel/traps.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long
7474
dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
7575
}
7676

77+
void dump_backtrace_stm(u32 *stack, u32 instruction)
78+
{
79+
char str[80], *p;
80+
unsigned int x;
81+
int reg;
82+
83+
for (reg = 10, x = 0, p = str; reg >= 0; reg--) {
84+
if (instruction & BIT(reg)) {
85+
p += sprintf(p, " r%d:%08x", reg, *stack--);
86+
if (++x == 6) {
87+
x = 0;
88+
p = str;
89+
printk("%s\n", str);
90+
}
91+
}
92+
}
93+
if (p != str)
94+
printk("%s\n", str);
95+
}
96+
7797
#ifndef CONFIG_ARM_UNWIND
7898
/*
7999
* Stack pointers should always be within the kernels view of

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Written by Martin Mares <[email protected]>
44
*/
55

6+
/* No __ro_after_init data in the .rodata section - which will always be ro */
7+
#define RO_AFTER_INIT_DATA
8+
69
#include <asm-generic/vmlinux.lds.h>
710
#include <asm/cache.h>
811
#include <asm/thread_info.h>
@@ -223,6 +226,8 @@ SECTIONS
223226
. = ALIGN(PAGE_SIZE);
224227
__init_end = .;
225228

229+
*(.data..ro_after_init)
230+
226231
NOSAVE_DATA
227232
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
228233
READ_MOSTLY_DATA(L1_CACHE_BYTES)

arch/arm/lib/backtrace.S

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* 27/03/03 Ian Molton Clean up CONFIG_CPU
1111
*
1212
*/
13+
#include <linux/kern_levels.h>
1314
#include <linux/linkage.h>
1415
#include <asm/assembler.h>
1516
.text
@@ -83,13 +84,13 @@ for_each_frame: tst frame, mask @ Check for address exceptions
8384
teq r3, r1, lsr #11
8485
ldreq r0, [frame, #-8] @ get sp
8586
subeq r0, r0, #4 @ point at the last arg
86-
bleq .Ldumpstm @ dump saved registers
87+
bleq dump_backtrace_stm @ dump saved registers
8788

8889
1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
8990
ldr r3, .Ldsi @ instruction exists,
9091
teq r3, r1, lsr #11
9192
subeq r0, frame, #16
92-
bleq .Ldumpstm @ dump saved registers
93+
bleq dump_backtrace_stm @ dump saved registers
9394

9495
teq sv_fp, #0 @ zero saved fp means
9596
beq no_frame @ no further frames
@@ -112,38 +113,6 @@ ENDPROC(c_backtrace)
112113
.long 1004b, 1006b
113114
.popsection
114115

115-
#define instr r4
116-
#define reg r5
117-
#define stack r6
118-
119-
.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr}
120-
mov stack, r0
121-
mov instr, r1
122-
mov reg, #10
123-
mov r7, #0
124-
1: mov r3, #1
125-
ARM( tst instr, r3, lsl reg )
126-
THUMB( lsl r3, reg )
127-
THUMB( tst instr, r3 )
128-
beq 2f
129-
add r7, r7, #1
130-
teq r7, #6
131-
moveq r7, #0
132-
adr r3, .Lcr
133-
addne r3, r3, #1 @ skip newline
134-
ldr r2, [stack], #-4
135-
mov r1, reg
136-
adr r0, .Lfp
137-
bl printk
138-
2: subs reg, reg, #1
139-
bpl 1b
140-
teq r7, #0
141-
adrne r0, .Lcr
142-
blne printk
143-
ldmfd sp!, {instr, reg, stack, r7, pc}
144-
145-
.Lfp: .asciz " r%d:%08x%s"
146-
.Lcr: .asciz "\n"
147116
.Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
148117
.align
149118
.Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc}

arch/arm/mm/dma-mapping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ static int __init dma_debug_do_init(void)
11671167
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
11681168
return 0;
11691169
}
1170-
fs_initcall(dma_debug_do_init);
1170+
core_initcall(dma_debug_do_init);
11711171

11721172
#ifdef CONFIG_ARM_DMA_USE_IOMMU
11731173

arch/arm/mm/proc-v7m.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ENTRY(cpu_cm7_proc_fin)
9696
ret lr
9797
ENDPROC(cpu_cm7_proc_fin)
9898

99-
.section ".text.init", #alloc, #execinstr
99+
.section ".init.text", #alloc, #execinstr
100100

101101
__v7m_cm7_setup:
102102
mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP)

0 commit comments

Comments
 (0)