Skip to content

Commit 4d8e3e9

Browse files
mszyprowkrzk
authored andcommitted
ARM: exynos: Fix undefined instruction during Exynos5422 resume
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: 4451006a 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 <m.szyprowski@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent 3a1f2f3 commit 4d8e3e9

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
@@ -450,8 +450,27 @@ static void exynos3250_pm_resume(void)
450450

451451
static void exynos5420_prepare_pm_resume(void)
452452
{
453+
unsigned int mpidr, cluster;
454+
455+
mpidr = read_cpuid_mpidr();
456+
cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
457+
453458
if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
454459
WARN_ON(mcpm_cpu_powered_up());
460+
461+
if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) {
462+
/*
463+
* When system is resumed on the LITTLE/KFC core (cluster 1),
464+
* the DSCR is not properly updated until the power is turned
465+
* on also for the cluster 0. Enable it for a while to
466+
* propagate the SPNIDEN and SPIDEN signals from Secure JTAG
467+
* block and avoid undefined instruction issue on CP14 reset.
468+
*/
469+
pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN,
470+
EXYNOS_COMMON_CONFIGURATION(0));
471+
pmu_raw_writel(0,
472+
EXYNOS_COMMON_CONFIGURATION(0));
473+
}
455474
}
456475

457476
static void exynos5420_pm_resume(void)

0 commit comments

Comments
 (0)