aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-05-16 08:35:24 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-05-17 10:54:26 -0400
commit7ff2760999a86e4d2b1af93dcf0f0d336c309571 (patch)
tree2b59e9efc78c91c74f7530b4b8060dfdfea657af /drivers/mmc
parent16490980e396fac079248b23b1dd81e7d48bebf3 (diff)
mmc: core: Add a facility to "pause" re-tuning
Re-tuning is not possible when switched to the RPMB partition. However re-tuning should not be needed if re-tuning is done immediately before switching, a small set of operations is done, and then we immediately switch back to the main partition. To ensure that re-tuning can't be done for a short while, add a facility to "pause" re-tuning. The existing facility to hold / release re-tuning is used but it also flags re-tuning as needed to cause re-tuning before the next command (which will be the switch to RPMB). We also need to "unpause" in the recovery path, which is catered for by adding it to mmc_retune_disable(). Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/host.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index e0a3ee16c0d3..1be42fab1a30 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -68,8 +68,32 @@ void mmc_retune_enable(struct mmc_host *host)
68 jiffies + host->retune_period * HZ); 68 jiffies + host->retune_period * HZ);
69} 69}
70 70
71/*
72 * Pause re-tuning for a small set of operations. The pause begins after the
73 * next command and after first doing re-tuning.
74 */
75void mmc_retune_pause(struct mmc_host *host)
76{
77 if (!host->retune_paused) {
78 host->retune_paused = 1;
79 mmc_retune_needed(host);
80 mmc_retune_hold(host);
81 }
82}
83EXPORT_SYMBOL(mmc_retune_pause);
84
85void mmc_retune_unpause(struct mmc_host *host)
86{
87 if (host->retune_paused) {
88 host->retune_paused = 0;
89 mmc_retune_release(host);
90 }
91}
92EXPORT_SYMBOL(mmc_retune_unpause);
93
71void mmc_retune_disable(struct mmc_host *host) 94void mmc_retune_disable(struct mmc_host *host)
72{ 95{
96 mmc_retune_unpause(host);
73 host->can_retune = 0; 97 host->can_retune = 0;
74 del_timer_sync(&host->retune_timer); 98 del_timer_sync(&host->retune_timer);
75 host->retune_now = 0; 99 host->retune_now = 0;