OSDN Git Service

mmc: cmdq_hci: Enable legacy interrupts immediately after halt
authorVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Mon, 20 Feb 2017 08:38:29 +0000 (14:08 +0530)
committerVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Tue, 21 Feb 2017 11:50:14 +0000 (17:20 +0530)
Enable the legacy interrupts immediately after halt interrupt is
handled, from cmdq_irq() itself.

When cmdq halt is initiated, as per existing logic driver waits either
for halt interrupt to fire or for certain period of time.  In case if
cmdq is halted but halt interrupt got delayed than wait-timeout period,
driver disables cmdq interrupts since cmdq is in halt state.
The delayed halt interrupt gets fired only when cmdq is unhalted next
time and cmdq interrupts are enabled. And this delayed interrupt is
treated as an unexpected interrupt.

By enabling legacy interrupts (i.e., disabling cmdq interrupts) from
cmdq_irq(), we can ensure that we don't disable cmdq interrupts until
halt interrupt get fired. So we can avoid above mentioned scenario.

Change-Id: Ic052d41fac789b6390a5d80dfaee91767bdb783f
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
drivers/mmc/host/cmdq_hci.c

index 113bca7..10cef45 100644 (file)
@@ -995,6 +995,9 @@ skip_cqterri:
        if (status & CQIS_HAC) {
                if (cq_host->ops->post_cqe_halt)
                        cq_host->ops->post_cqe_halt(mmc);
+               /* halt done: re-enable legacy interrupts */
+               if (cq_host->ops->clear_set_irqs)
+                       cq_host->ops->clear_set_irqs(mmc, false);
                /* halt is completed, wakeup waiting thread */
                complete(&cq_host->halt_comp);
        }
@@ -1087,10 +1090,6 @@ static int cmdq_halt(struct mmc_host *mmc, bool halt)
                        } else {
                                MMC_TRACE(mmc, "%s: halt done , retries: %d\n",
                                        __func__, retries);
-                               /* halt done: re-enable legacy interrupts */
-                               if (cq_host->ops->clear_set_irqs)
-                                       cq_host->ops->clear_set_irqs(mmc,
-                                                               false);
                                break;
                        }
                }