mmc: core/card: maintain clock gating reference count integrity
Clock gating logic maintains the reference count which gets incremented
with *hold* API call and get decremented with *release* API call.
If we want to make sure that clocks are enabled during some operation,
we should call *hold* API before the operation and then call *release*
API after the operation is finished. So *hold* and *release* should be
in pair and called exactly once per operation, any violation of these
rules may put the reference count out of sync and can cause issues
(like unclocked register access). This change fixes the places where
this can go out of sync.
Change-Id: I2d784cc31027a551a466beec63ee8cd0a1f67af7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 2893f6e..5a3fbd7 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -3280,7 +3280,7 @@
err = mmc_cmdq_halt(host, true);
if (err) {
pr_err("%s: halt: failed: %d\n", __func__, err);
- return;
+ goto out;
}
/* disable CQ mode in card */