summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2015-10-15 12:16:43 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:42 -0700
commit24c09c2fdf65cc4a4d16c3c72e27c90d31f2fe21 (patch)
treefa8059b5e2b6d6c7391dc3c0ecc81a5a44b43f9c
parent919917a73cdf911f26371bbc5b42aafc9af29b4d (diff)
mmc: sdhci-msm: don't bug on PM QoS request counter going negative
Currently we are crashing the system if PM QoS request counter goes negative but this doesn't seem to be right way to handle. We should instead skip decrementing this counter once it reaches 0 and just print a dump stack to know the callstack. This change fixes this as mentioned above. Change-Id: I36fb03b1ddf8e04ecc9fe449496b656db84e77d2 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci-msm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index cf390ff7a73c..246a31ad539a 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -3217,11 +3217,13 @@ void sdhci_msm_pm_qos_irq_unvote(struct sdhci_host *host, bool async)
if (!msm_host->pm_qos_irq.enabled)
return;
- counter = atomic_dec_return(&msm_host->pm_qos_irq.counter);
- if (counter < 0) {
- pr_err("%s: counter=%d\n", __func__, counter);
- BUG();
+ if (atomic_read(&msm_host->pm_qos_irq.counter)) {
+ counter = atomic_dec_return(&msm_host->pm_qos_irq.counter);
+ } else {
+ WARN(1, "attempt to decrement pm_qos_irq.counter when it's 0");
+ return;
}
+
if (counter)
return;