mmc: cmdq_hci: Avoid releasing clock twice during DCMD error

When erase DCMD commands fail, a completion notification may get raised
by host controller for the task in addition to error interrupt. This
can result in the done function of mmc request getting called twice
and release the clock twice and mess up the clock request counter. The
done function should be called only once for DCMD commands except flush
commands.

Change-Id: Ie3a96e48ca98872cf686049eb5caa060f143f9cb
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
This commit is contained in:
Vijay Viswanath 2017-04-27 15:09:45 +05:30 committed by Gerrit - the friendly Code Review server
parent d212c508bd
commit 00229f96af

View file

@ -1102,6 +1102,10 @@ skip_cqterri:
* before setting doorbell, hence one is not needed here. * before setting doorbell, hence one is not needed here.
*/ */
for_each_set_bit(tag, &comp_status, cq_host->num_slots) { for_each_set_bit(tag, &comp_status, cq_host->num_slots) {
mrq = get_req_by_tag(cq_host, tag);
if (!((mrq->cmd && mrq->cmd->error) ||
mrq->cmdq_req->resp_err ||
(mrq->data && mrq->data->error))) {
/* complete the corresponding mrq */ /* complete the corresponding mrq */
pr_debug("%s: completing tag -> %lu\n", pr_debug("%s: completing tag -> %lu\n",
mmc_hostname(mmc), tag); mmc_hostname(mmc), tag);
@ -1110,6 +1114,7 @@ skip_cqterri:
cmdq_finish_data(mmc, tag); cmdq_finish_data(mmc, tag);
} }
} }
}
if (status & CQIS_HAC) { if (status & CQIS_HAC) {
if (cq_host->ops->post_cqe_halt) if (cq_host->ops->post_cqe_halt)