Skip to content

Commit 2224ea6

Browse files
mszyprowkrzk
authored andcommitted
soc: samsung: exynos-pmu: Fix structure initialization
Commit 78b7289 ("soc: samsung: exynos-pmu: Enable CPU Idle for gs101") added system wide suspend/resume callbacks to Exynos PMU driver, but some items used by these callbacks are initialized only on GS101-compatible boards. Move that initialization to exynos_pmu_probe() to avoid potential lockdep warnings like below observed during system suspend/resume cycle: INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. CPU: 0 UID: 0 PID: 2134 Comm: rtcwake Not tainted 6.18.0-rc7-next-20251126-00039-g1d656a1af243 #11794 PREEMPT Hardware name: Samsung Exynos (Flattened Device Tree) Call trace: unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x68/0x88 dump_stack_lvl from register_lock_class+0x970/0x988 register_lock_class from __lock_acquire+0xc8/0x29ec __lock_acquire from lock_acquire+0x134/0x39c lock_acquire from _raw_spin_lock+0x38/0x48 _raw_spin_lock from exynos_cpupm_suspend_noirq+0x18/0x34 exynos_cpupm_suspend_noirq from dpm_run_callback+0x98/0x2b8 dpm_run_callback from device_suspend_noirq+0x8c/0x310 Fixes: 78b7289 ("soc: samsung: exynos-pmu: Enable CPU Idle for gs101") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://patch.msgid.link/20251126110038.3326768-1-m.szyprowski@samsung.com [krzk: include calltrace into commit msg] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent 3a86608 commit 2224ea6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/soc/samsung/exynos-pmu.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,6 @@ static int setup_cpuhp_and_cpuidle(struct device *dev)
585585
if (!pmu_context->in_cpuhp)
586586
return -ENOMEM;
587587

588-
raw_spin_lock_init(&pmu_context->cpupm_lock);
589-
pmu_context->sys_inreboot = false;
590-
pmu_context->sys_insuspend = false;
591-
592588
/* set PMU to power on */
593589
for_each_online_cpu(cpu)
594590
gs101_cpuhp_pmu_online(cpu);
@@ -657,6 +653,9 @@ static int exynos_pmu_probe(struct platform_device *pdev)
657653

658654
pmu_context->pmureg = regmap;
659655
pmu_context->dev = dev;
656+
raw_spin_lock_init(&pmu_context->cpupm_lock);
657+
pmu_context->sys_inreboot = false;
658+
pmu_context->sys_insuspend = false;
660659

661660
if (pmu_context->pmu_data && pmu_context->pmu_data->pmu_cpuhp) {
662661
ret = setup_cpuhp_and_cpuidle(dev);

0 commit comments

Comments
 (0)