summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRitesh Harjani <riteshh@codeaurora.org>2015-05-29 11:26:34 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:26:24 -0700
commit5e2fbf9a0da8d4feddfda97701f6804cecf55d69 (patch)
treeaf4463f7a89e6715acb3497f4a69faac3f6808a8
parenta968943d3557b2b3ef444fe1059c948ddb26b8cd (diff)
mmc: core: Fix crash in mmc clk-scaling
kernel crashes with below signature on trying to acquire uninitialized clk-scaling spinlock. Fix it by checking that clk scaling is initialized before acquiring this lock. BUG: spinlock bad magic on CPU#0, kworker/0:1/39 Backtrace: __delay+0x1c __const_udelay+0x24 msm_trigger_wdog_bite+0xbc spin_bug+0x8c do_raw_spin_lock+0x34 _raw_spin_lock_irqsave+0x28 mmc_reset_clk_scale_stats+0x40 mmc_host_clk_hold+0x5c mmc_start_request+0x1ec mmc_wait_for_req+0x98 mmc_wait_for_cmd+0x70 __mmc_switch+0xd0 mmc_switch+0x18 mmc_flush_cache+0x4c _mmc_suspend.isra.8+0x6c mmc_runtime_suspend+0x38 mmc_runtime_suspend+0x18 __rpm_callback+0x40 rpm_callback+0x44 rpm_suspend+0x2a4 pm_runtime_work+0x78 process_one_work+0x264 worker_thread+0x1f8 kthread+0xdc ret_from_fork+0x10 Change-Id: I8347e2d5ad1816f549ef8ab2607546203aa4a21d Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
-rw-r--r--drivers/mmc/core/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5f2145cbb7ad..10063df35db1 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -666,7 +666,8 @@ void mmc_reset_clk_scale_stats(struct mmc_host *host)
WARN_ON(1);
return;
}
-
+ if (!host->clk_scaling.enable)
+ return;
spin_lock_irqsave(&host->clk_scaling.lock, flags);
host->clk_scaling.total_busy_time_us = 0;
spin_unlock_irqrestore(&host->clk_scaling.lock, flags);