diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-04-22 04:29:26 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-06-06 07:37:48 -0400 |
commit | b22ffdcd25d67a07f2b5a75a7805826bfe8597f1 (patch) | |
tree | b313cd5576eb22399b3f672315ba208d7dceea19 /drivers/mmc | |
parent | 0e748234293f5f2caa8dbd152caba5efb754c707 (diff) |
mmc: tmio: postpone controller reset during resume
When resuming, the tmio_mmc_host_resume() function is run when the
controller might still be powered down. Issuing a reset command to it at
that time has no effect. This patch postpones resetting the controller
until the first powering-up .set_ios() call.
Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.h | 1 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_pio.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index d857f5c6e7d9..759d8f4f130c 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h | |||
@@ -85,6 +85,7 @@ struct tmio_mmc_host { | |||
85 | unsigned long last_req_ts; | 85 | unsigned long last_req_ts; |
86 | struct mutex ios_lock; /* protect set_ios() context */ | 86 | struct mutex ios_lock; /* protect set_ios() context */ |
87 | bool native_hotplug; | 87 | bool native_hotplug; |
88 | bool resuming; | ||
88 | }; | 89 | }; |
89 | 90 | ||
90 | int tmio_mmc_host_probe(struct tmio_mmc_host **host, | 91 | int tmio_mmc_host_probe(struct tmio_mmc_host **host, |
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index f508ecb5b8a7..435cc4d2520f 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c | |||
@@ -862,6 +862,10 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
862 | if (!host->power) { | 862 | if (!host->power) { |
863 | tmio_mmc_clk_update(mmc); | 863 | tmio_mmc_clk_update(mmc); |
864 | pm_runtime_get_sync(dev); | 864 | pm_runtime_get_sync(dev); |
865 | if (host->resuming) { | ||
866 | tmio_mmc_reset(host); | ||
867 | host->resuming = false; | ||
868 | } | ||
865 | } | 869 | } |
866 | tmio_mmc_set_clock(host, ios->clock); | 870 | tmio_mmc_set_clock(host, ios->clock); |
867 | if (!host->power) { | 871 | if (!host->power) { |
@@ -1154,10 +1158,10 @@ int tmio_mmc_host_resume(struct device *dev) | |||
1154 | struct mmc_host *mmc = dev_get_drvdata(dev); | 1158 | struct mmc_host *mmc = dev_get_drvdata(dev); |
1155 | struct tmio_mmc_host *host = mmc_priv(mmc); | 1159 | struct tmio_mmc_host *host = mmc_priv(mmc); |
1156 | 1160 | ||
1157 | tmio_mmc_reset(host); | ||
1158 | tmio_mmc_enable_dma(host, true); | 1161 | tmio_mmc_enable_dma(host, true); |
1159 | 1162 | ||
1160 | /* The MMC core will perform the complete set up */ | 1163 | /* The MMC core will perform the complete set up */ |
1164 | host->resuming = true; | ||
1161 | return mmc_resume_host(mmc); | 1165 | return mmc_resume_host(mmc); |
1162 | } | 1166 | } |
1163 | EXPORT_SYMBOL(tmio_mmc_host_resume); | 1167 | EXPORT_SYMBOL(tmio_mmc_host_resume); |