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][<c020e5f4>] show_stack+0x20/0x24
[bc001a84+ 40][<c06161e8>] dump_stack+0xb8/0xf4
[bc001aac+ 40][<c02a1428>] spin_dump+0xa0/0xf0
[bc001acc+ 32][<c02a1744>] do_raw_spin_unlock+0xb8/0x138
[bc001ae4+ 24][<c0fa35f4>] _raw_spin_unlock_irqrestore+0x34/0x9c
[bc001b2c+ 72][<c0690ce4>] clk_mux_set_parent+0xc0/0x148
[bc001b3c+ 16][<c06911d8>] clk_composite_set_parent+0x3c/0x40
[bc001b6c+ 48][<c068cccc>] clk_core_set_parent+0x18c/0x42c
[bc001b7c+ 16][<c068cf98>] clk_set_parent+0x2c/0x30
[bc001bb4+ 56][<c0ca7ad8>] aml_tdm_platform_probe+0x27c/0x748
[bc001bd4+ 32][<c06d69e0>] platform_drv_probe+0x60/0xc0
[bc001bfc+ 40][<c06d4734>] driver_probe_device+0x214/0x2c0

Solution:
add aclk_lock init

Verify:
test passed on g12b

Change-Id: I1214d044c279865065de237bfb1ecc7f9ea71699
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
This commit is contained in:
Jian Hu
2019-07-25 11:54:02 +08:00
committed by Luke Go
parent 7e981c8141
commit da964f5541
7 changed files with 3 additions and 10 deletions

View File

@@ -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",

View File

@@ -104,6 +104,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) */

View File

@@ -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"};

View File

@@ -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"};

View File

@@ -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"};

View File

@@ -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"};

View File

@@ -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"};