Commit b9ec2744 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Chris Ball

mmc: tmio: reset the controller after power-up

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: default avatarNguyen Viet Dung <nv-dung@jinso.co.jp>
Reported-by: default avatarNguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Tested-by: default avatarNguyen Viet Dung <nv-dung@jinso.co.jp>
Tested-by: default avatarNguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent e83b7a8a
...@@ -867,6 +867,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -867,6 +867,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->resuming = false; host->resuming = false;
} }
} }
if (host->power == TMIO_MMC_OFF_STOP)
tmio_mmc_reset(host);
tmio_mmc_set_clock(host, ios->clock); tmio_mmc_set_clock(host, ios->clock);
if (host->power == TMIO_MMC_OFF_STOP) if (host->power == TMIO_MMC_OFF_STOP)
/* power up SD card and the bus */ /* power up SD card and the bus */
...@@ -1186,7 +1188,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev) ...@@ -1186,7 +1188,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
struct mmc_host *mmc = dev_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_host *host = mmc_priv(mmc);
tmio_mmc_reset(host);
tmio_mmc_enable_dma(host, true); tmio_mmc_enable_dma(host, true);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment