From d1c682fe55bb35e54b304a3909f7641637779843 Mon Sep 17 00:00:00 2001 From: Jian Hu Date: Thu, 25 Jul 2019 11:54:02 +0800 Subject: [PATCH] clk: g12a/b: add aclk_lock init [1/1] PD#SWPL-11765 Problem: open CONFIG_LOCK_STAT BUG: spinlock bad magic on CPU#2, swapper/0/1 lock: aclk_lock+0x0/0x28, .magic: 00000000, .owner: swapper/0/1, .owner_cpu: 2 CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.113 #1 Hardware name: Generic DT based system [bc001a5c+ 16][] show_stack+0x20/0x24 [bc001a84+ 40][] dump_stack+0xb8/0xf4 [bc001aac+ 40][] spin_dump+0xa0/0xf0 [bc001acc+ 32][] do_raw_spin_unlock+0xb8/0x138 [bc001ae4+ 24][] _raw_spin_unlock_irqrestore+0x34/0x9c [bc001b2c+ 72][] clk_mux_set_parent+0xc0/0x148 [bc001b3c+ 16][] clk_composite_set_parent+0x3c/0x40 [bc001b6c+ 48][] clk_core_set_parent+0x18c/0x42c [bc001b7c+ 16][] clk_set_parent+0x2c/0x30 [bc001bb4+ 56][] aml_tdm_platform_probe+0x27c/0x748 [bc001bd4+ 32][] platform_drv_probe+0x60/0xc0 [bc001bfc+ 40][] driver_probe_device+0x214/0x2c0 Solution: add aclk_lock init Verify: test passed on g12b Change-Id: I1214d044c279865065de237bfb1ecc7f9ea71699 Signed-off-by: Jian Hu --- sound/soc/amlogic/auge/audio_clks.c | 2 ++ sound/soc/amlogic/auge/audio_clks.h | 1 + sound/soc/amlogic/auge/axg,clocks.c | 2 -- sound/soc/amlogic/auge/g12a,clocks.c | 2 -- sound/soc/amlogic/auge/sm1,clocks.c | 2 -- sound/soc/amlogic/auge/tl1,clocks.c | 2 -- sound/soc/amlogic/auge/tm2,clocks.c | 2 -- 7 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sound/soc/amlogic/auge/audio_clks.c b/sound/soc/amlogic/auge/audio_clks.c index 4aa82c3..045706be 100644 --- a/sound/soc/amlogic/auge/audio_clks.c +++ b/sound/soc/amlogic/auge/audio_clks.c @@ -23,6 +23,8 @@ #define DRV_NAME "audio-clocks" +DEFINE_SPINLOCK(aclk_lock); + static const struct of_device_id audio_clocks_of_match[] = { { .compatible = "amlogic, axg-audio-clocks", diff --git a/sound/soc/amlogic/auge/audio_clks.h b/sound/soc/amlogic/auge/audio_clks.h index ede4ec9..e0dbefd 100644 --- a/sound/soc/amlogic/auge/audio_clks.h +++ b/sound/soc/amlogic/auge/audio_clks.h @@ -95,6 +95,7 @@ extern struct audio_clk_init g12a_audio_clks_init; extern struct audio_clk_init tl1_audio_clks_init; extern struct audio_clk_init sm1_audio_clks_init; extern struct audio_clk_init tm2_audio_clks_init; +extern spinlock_t aclk_lock; struct clk_chipinfo { /* force clock source as oscin(24M) */ diff --git a/sound/soc/amlogic/auge/axg,clocks.c b/sound/soc/amlogic/auge/axg,clocks.c index e337ac3..9b60ca9 100644 --- a/sound/soc/amlogic/auge/axg,clocks.c +++ b/sound/soc/amlogic/auge/axg,clocks.c @@ -22,8 +22,6 @@ #include "audio_clks.h" #include "regs.h" -static spinlock_t aclk_lock; - static const char *const mclk_parent_names[] = {"mpll0", "mpll1", "mpll2", "mpll3", "hifi_pll", "fclk_div3", "fclk_div4", "gp0_pll"}; diff --git a/sound/soc/amlogic/auge/g12a,clocks.c b/sound/soc/amlogic/auge/g12a,clocks.c index 66131cf..808abc7 100644 --- a/sound/soc/amlogic/auge/g12a,clocks.c +++ b/sound/soc/amlogic/auge/g12a,clocks.c @@ -22,8 +22,6 @@ #include "audio_clks.h" #include "regs.h" -static spinlock_t aclk_lock; - static const char *const mclk_parent_names[] = {"mpll0", "mpll1", "mpll2", "mpll3", "hifi_pll", "fclk_div3", "fclk_div4", "gp0_pll"}; diff --git a/sound/soc/amlogic/auge/sm1,clocks.c b/sound/soc/amlogic/auge/sm1,clocks.c index 0d40d68..27b192b 100644 --- a/sound/soc/amlogic/auge/sm1,clocks.c +++ b/sound/soc/amlogic/auge/sm1,clocks.c @@ -22,8 +22,6 @@ #include "audio_clks.h" #include "regs.h" -static spinlock_t aclk_lock; - static const char *const mclk_parent_names[] = { "mpll0", "mpll1", "mpll2", "mpll3", "hifi_pll", "fclk_div3", "fclk_div4", "fclk_div5"}; diff --git a/sound/soc/amlogic/auge/tl1,clocks.c b/sound/soc/amlogic/auge/tl1,clocks.c index 7f18e89..db2a110 100644 --- a/sound/soc/amlogic/auge/tl1,clocks.c +++ b/sound/soc/amlogic/auge/tl1,clocks.c @@ -22,8 +22,6 @@ #include "audio_clks.h" #include "regs.h" -static spinlock_t aclk_lock; - static const char *const mclk_parent_names[] = { "mpll0", "mpll1", "mpll2", "mpll3", "hifi_pll", "fclk_div3", "fclk_div4", "fclk_div5"}; diff --git a/sound/soc/amlogic/auge/tm2,clocks.c b/sound/soc/amlogic/auge/tm2,clocks.c index 5dce5ba..ca7beb7 100644 --- a/sound/soc/amlogic/auge/tm2,clocks.c +++ b/sound/soc/amlogic/auge/tm2,clocks.c @@ -22,8 +22,6 @@ #include "audio_clks.h" #include "regs.h" -static spinlock_t aclk_lock; - static const char *const mclk_parent_names[] = { "mpll0", "mpll1", "mpll2", "mpll3", "hifi_pll", "fclk_div3", "fclk_div4", "fclk_div5"}; -- 2.7.4