This fixes two reported problems:
1. after a system resume the controller isn't functioning until a command
   runs on a timeout and a controller reset is performed.
2. if a card is ejected during a running write operation, its re-insertion
   isn't detected.

Reported-by: Nguyen Viet Dung <[email protected]>
Reported-by: Nguyen Hong Ky <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
---

v2: this patch supersedes the earlier "mmc: tmio: postpone controller 
reset during resume" in that it extends the number of cases, in which the 
reset is applied. It turned out, it is needed not only after a resume, but 
also for recovery after an interrupted write. It also now applies on top 
of "[PATCH v2] MMC: tmio: fix unbalanced power-on calls with clock-gating 
enabled" http://article.gmane.org/gmane.linux.kernel.mmc/20233. Reporters 
are cordially invited to add their "Tested-by" tags ;-)

Chris, both these patches are fixes. Not sure whether it's still a good 
idea to push them for 3.9, maybe better get them into 3.10 and then to 
stable?

 drivers/mmc/host/tmio_mmc_pio.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1d5ef64..fcb9503 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -863,6 +863,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct 
mmc_ios *ios)
                        tmio_mmc_clk_update(mmc);
                        pm_runtime_get_sync(dev);
                }
+               if (host->power == TMIO_MMC_OFF_STOP)
+                       tmio_mmc_reset(host);
                tmio_mmc_set_clock(host, ios->clock);
                if (host->power == TMIO_MMC_OFF_STOP)
                        /* power up SD card and the bus */
@@ -1161,7 +1163,6 @@ int tmio_mmc_host_resume(struct device *dev)
        struct mmc_host *mmc = dev_get_drvdata(dev);
        struct tmio_mmc_host *host = mmc_priv(mmc);
 
-       tmio_mmc_reset(host);
        tmio_mmc_enable_dma(host, true);
 
        /* The MMC core will perform the complete set up */
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to