BZ: 23202
original commit:
BZ: 22383
Medfiled boards has observed MMC card -110 errors, but card status
is still in 0xc00. So seems some MMC card cannot meet its CSD
guaranteed write response timeout value. Increase this timeout value
from host driver side. If the increasing cannot workaround the timeout
error totally, the increasing can be tuned.
This increase won't impact performance. Host controller only use
this value to decide how long to wait before generate a data timeout
interrupt.
Change-Id: Ib1ddbb98c52649778d0a071acdeef91d2b3f63d9
Change-Id: Iddae9353fd7708cfbac0cb599433757036adc71f
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Reviewed-on: http://android.intel.com:8080/35375
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
data->timeout_clks = card->csd.tacc_clks * mult;
/*
+ * Some MMC card also cannot meet their CSD guaranteed write response
+ * time. Some Medfield boards has been observed -110 timeout issue and
+ * MMC card status is 0xc00 when timeout error happens. This error is
+ * only observed with write command.
+ * Increase MMC card timeout value to workaround this.
+ * This change should not impact performance.
+ */
+ if ((data->flags & MMC_DATA_WRITE) && mmc_card_mmc(card)) {
+ /*
+ * This is a expirence value, and can be tuninged if this
+ * timeout value is still not encough
+ */
+ data->timeout_ns *= 4;
+ data->timeout_clks *= 4;
+ }
+
+ /*
* SD cards also have an upper limit on the timeout.
*/
if (mmc_card_sd(card)) {