diff options
author | Konstantin Dorfman <kdorfman@codeaurora.org> | 2013-07-04 14:06:18 +0300 |
---|---|---|
committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:20:49 -0700 |
commit | 392f2d1389b878d5b43e7ae5965f2b96be753357 (patch) | |
tree | 2bb5f7c025841d5e3af744681d8ba47c27138661 | |
parent | aaa56f8a9319fde381a94e08d329f936ab1dfe42 (diff) |
mmc: core: hpi in TRAN state error handling
There could be a race condition in the stop transmission request.
1. Urgent read request comes in.
2. Stop the ongoing write request by calling stop_request MMC host op.
3. Send the stop command (CMD12) to move the card from the receive state
to programming state.
4. Send the status command (CMD13) to know if the card is in programming
state or not. If yes, then go to step.5 or else go to step.6.
5. Send the HPI command to bring the card out of programming state.
6. Now send the urgent read request.
In above sequence in step.4, we check if the card is in programming or
not and if it is then we go ahead and send the HPI in step.5 but what if
after step.4 is completed and before the step.5, card moves out of the
programming state so in that case HPI command would timeout as we are
sending it in the wrong state. In that case no command response (by eMMC
protocol) causes mmc_send_hpi_cmd to fail (with -ETIMEOUT error). In
case the card indeed in TRAN state, no error is reported.
Change-Id: Ia6f81f6cc4ec933f2e8423029f7236401aea04df
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
-rw-r--r-- | drivers/mmc/core/core.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 863df7a85220..dd69ebd2780b 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -718,8 +718,6 @@ int mmc_interrupt_hpi(struct mmc_card *card) } err = mmc_send_hpi_cmd(card, &status); - if (err) - goto out; prg_wait = jiffies + msecs_to_jiffies(card->ext_csd.out_of_int_time); do { diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 1f444269ebbe..a01fcf27f171 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -779,7 +779,7 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) err = mmc_wait_for_cmd(card->host, &cmd, 0); if (err) { - pr_warn("%s: error %d interrupting operation. " + pr_debug("%s: error %d interrupting operation. " "HPI command response %#x\n", mmc_hostname(card->host), err, cmd.resp[0]); return err; |