Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: mmc: Hold re-tuning in mmc_sleep()

The sleep command is issued after deselecting the
card, but re-tuning won't work on a deselected card
so re-tuning must be held.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Adrian Hunter and committed by
Ulf Hansson
436f8daa 66073d86

+8 -2
+8 -2
drivers/mmc/core/mmc.c
··· 21 21 #include <linux/mmc/mmc.h> 22 22 23 23 #include "core.h" 24 + #include "host.h" 24 25 #include "bus.h" 25 26 #include "mmc_ops.h" 26 27 #include "sd_ops.h" ··· 1512 1511 unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); 1513 1512 int err; 1514 1513 1514 + /* Re-tuning can't be done once the card is deselected */ 1515 + mmc_retune_hold(host); 1516 + 1515 1517 err = mmc_deselect_cards(host); 1516 1518 if (err) 1517 - return err; 1519 + goto out_release; 1518 1520 1519 1521 cmd.opcode = MMC_SLEEP_AWAKE; 1520 1522 cmd.arg = card->rca << 16; ··· 1538 1534 1539 1535 err = mmc_wait_for_cmd(host, &cmd, 0); 1540 1536 if (err) 1541 - return err; 1537 + goto out_release; 1542 1538 1543 1539 /* 1544 1540 * If the host does not wait while the card signals busy, then we will ··· 1549 1545 if (!cmd.busy_timeout || !(host->caps & MMC_CAP_WAIT_WHILE_BUSY)) 1550 1546 mmc_delay(timeout_ms); 1551 1547 1548 + out_release: 1549 + mmc_retune_release(host); 1552 1550 return err; 1553 1551 } 1554 1552