Skip to content

Commit 4257087

Browse files
committed
Merge tag 'arc-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC fixes from Vineet Gupta: - Unbork HSDKv1 platform (won't boot) due to memory map issue - Prevent stack unwinder from infinite looping * tag 'arc-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline ARC: stack unwinding: avoid indefinite looping
2 parents ee51814 + 3b57533 commit 4257087

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

arch/arc/kernel/head.S

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,22 @@
6767
sr r5, [ARC_REG_LPB_CTRL]
6868
1:
6969
#endif /* CONFIG_ARC_LPB_DISABLE */
70-
#endif
70+
71+
/* On HSDK, CCMs need to remapped super early */
72+
#ifdef CONFIG_ARC_SOC_HSDK
73+
mov r6, 0x60000000
74+
lr r5, [ARC_REG_ICCM_BUILD]
75+
breq r5, 0, 1f
76+
sr r6, [ARC_REG_AUX_ICCM]
77+
1:
78+
lr r5, [ARC_REG_DCCM_BUILD]
79+
breq r5, 0, 2f
80+
sr r6, [ARC_REG_AUX_DCCM]
81+
2:
82+
#endif /* CONFIG_ARC_SOC_HSDK */
83+
84+
#endif /* CONFIG_ISA_ARCV2 */
85+
7186
; Config DSP_CTRL properly, so kernel may use integer multiply,
7287
; multiply-accumulate, and divide operations
7388
DSP_EARLY_INIT

arch/arc/kernel/stacktrace.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
112112
int (*consumer_fn) (unsigned int, void *), void *arg)
113113
{
114114
#ifdef CONFIG_ARC_DW2_UNWIND
115-
int ret = 0;
115+
int ret = 0, cnt = 0;
116116
unsigned int address;
117117
struct unwind_frame_info frame_info;
118118

@@ -132,6 +132,11 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
132132
break;
133133

134134
frame_info.regs.r63 = frame_info.regs.r31;
135+
136+
if (cnt++ > 128) {
137+
printk("unwinder looping too long, aborting !\n");
138+
return 0;
139+
}
135140
}
136141

137142
return address; /* return the last address it saw */

arch/arc/plat-hsdk/platform.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ int arc_hsdk_axi_dmac_coherent __section(".data") = 0;
1717

1818
#define ARC_CCM_UNUSED_ADDR 0x60000000
1919

20-
static void __init hsdk_init_per_cpu(unsigned int cpu)
21-
{
22-
/*
23-
* By default ICCM is mapped to 0x7z while this area is used for
24-
* kernel virtual mappings, so move it to currently unused area.
25-
*/
26-
if (cpuinfo_arc700[cpu].iccm.sz)
27-
write_aux_reg(ARC_REG_AUX_ICCM, ARC_CCM_UNUSED_ADDR);
28-
29-
/*
30-
* By default DCCM is mapped to 0x8z while this area is used by kernel,
31-
* so move it to currently unused area.
32-
*/
33-
if (cpuinfo_arc700[cpu].dccm.sz)
34-
write_aux_reg(ARC_REG_AUX_DCCM, ARC_CCM_UNUSED_ADDR);
35-
}
3620

3721
#define ARC_PERIPHERAL_BASE 0xf0000000
3822
#define CREG_BASE (ARC_PERIPHERAL_BASE + 0x1000)
@@ -339,5 +323,4 @@ static const char *hsdk_compat[] __initconst = {
339323
MACHINE_START(SIMULATION, "hsdk")
340324
.dt_compat = hsdk_compat,
341325
.init_early = hsdk_init_early,
342-
.init_per_cpu = hsdk_init_per_cpu,
343326
MACHINE_END

0 commit comments

Comments
 (0)