Skip to content

Commit 1beeb04

Browse files
mszyprowgregkh
authored andcommitted
ARM: exynos: Fix undefined instruction during Exynos5422 resume
[ Upstream commit 4d8e3e9 ] During early system resume on Exynos5422 with performance counters enabled the following kernel oops happens: Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 1433 Comm: bash Tainted: G W 5.0.0-rc5-next-20190208-00023-gd5fb5a8a13e6-dirty #5480 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) ... Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 4451006 DAC: 00000051 Process bash (pid: 1433, stack limit = 0xb7e0e22f) ... (reset_ctrl_regs) from [<c0112ad0>] (dbg_cpu_pm_notify+0x1c/0x24) (dbg_cpu_pm_notify) from [<c014c840>] (notifier_call_chain+0x44/0x84) (notifier_call_chain) from [<c014cbc0>] (__atomic_notifier_call_chain+0x7c/0x128) (__atomic_notifier_call_chain) from [<c01ffaac>] (cpu_pm_notify+0x30/0x54) (cpu_pm_notify) from [<c055116c>] (syscore_resume+0x98/0x3f4) (syscore_resume) from [<c0189350>] (suspend_devices_and_enter+0x97c/0xe74) (suspend_devices_and_enter) from [<c0189fb8>] (pm_suspend+0x770/0xc04) (pm_suspend) from [<c0187740>] (state_store+0x6c/0xcc) (state_store) from [<c09fa698>] (kobj_attr_store+0x14/0x20) (kobj_attr_store) from [<c030159c>] (sysfs_kf_write+0x4c/0x50) (sysfs_kf_write) from [<c0300620>] (kernfs_fop_write+0xfc/0x1e0) (kernfs_fop_write) from [<c0282be8>] (__vfs_write+0x2c/0x160) (__vfs_write) from [<c0282ea4>] (vfs_write+0xa4/0x16c) (vfs_write) from [<c0283080>] (ksys_write+0x40/0x8c) (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28) Undefined instruction is triggered during CP14 reset, because bits: #16 (Secure privileged invasive debug disabled) and #17 (Secure privileged noninvasive debug disable) are set in DSCR. Those bits depend on SPNIDEN and SPIDEN lines, which are provided by Secure JTAG hardware block. That block in turn is powered from cluster 0 (big/Eagle), but the Exynos5422 boots on cluster 1 (LITTLE/KFC). To fix this issue it is enough to turn on the power on the cluster 0 for a while. This lets the Secure JTAG block to propagate the needed signals to LITTLE/KFC cores and change their DSCR. Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d7650c7 commit 1beeb04

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

arch/arm/mach-exynos/suspend.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,27 @@ static void exynos3250_pm_resume(void)
500500

501501
static void exynos5420_prepare_pm_resume(void)
502502
{
503+
unsigned int mpidr, cluster;
504+
505+
mpidr = read_cpuid_mpidr();
506+
cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
507+
503508
if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
504509
WARN_ON(mcpm_cpu_powered_up());
510+
511+
if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) {
512+
/*
513+
* When system is resumed on the LITTLE/KFC core (cluster 1),
514+
* the DSCR is not properly updated until the power is turned
515+
* on also for the cluster 0. Enable it for a while to
516+
* propagate the SPNIDEN and SPIDEN signals from Secure JTAG
517+
* block and avoid undefined instruction issue on CP14 reset.
518+
*/
519+
pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN,
520+
EXYNOS_COMMON_CONFIGURATION(0));
521+
pmu_raw_writel(0,
522+
EXYNOS_COMMON_CONFIGURATION(0));
523+
}
505524
}
506525

507526
static void exynos5420_pm_resume(void)

0 commit comments

Comments
 (0)