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>
This commit is contained in:
Subhash Jadavani 2015-10-15 12:16:43 -07:00
parent 919917a73c
commit 24c09c2fdf

View file

@ -3217,11 +3217,13 @@ void sdhci_msm_pm_qos_irq_unvote(struct sdhci_host *host, bool async)
if (!msm_host->pm_qos_irq.enabled) if (!msm_host->pm_qos_irq.enabled)
return; return;
if (atomic_read(&msm_host->pm_qos_irq.counter)) {
counter = atomic_dec_return(&msm_host->pm_qos_irq.counter); counter = atomic_dec_return(&msm_host->pm_qos_irq.counter);
if (counter < 0) { } else {
pr_err("%s: counter=%d\n", __func__, counter); WARN(1, "attempt to decrement pm_qos_irq.counter when it's 0");
BUG(); return;
} }
if (counter) if (counter)
return; return;