[PORT FROM R2]mmc: core: increase SD card data write timeout value
authorChuanxiao Dong <chuanxiao.dong@intel.com>
Thu, 2 Feb 2012 06:37:12 +0000 (14:37 +0800)
committerbuildbot <buildbot@intel.com>
Wed, 15 Feb 2012 09:30:39 +0000 (01:30 -0800)
BZ: 23202

original commit:
BZ: 16069

Some SD cards don't have a good storage management, which make
themselves cannot finish data receiving in 300ms during a write
request. SD card spec defines 300ms is enough, but for some SD,
it is not.

This patch will increase 300ms to be 3s, which can let host controller
to wait longer for SD card to finish data receiving.

This increase won't impact SD performance. Host controller only use
this value to decide how long to wait before generate a data timeout
interrupt.

Orig-Change-Id: I704c31b5811977342003091fd6eba35670c5c93c

Change-Id: I2ccd0abe50e07ea37e37eb220be05f5d060205f8
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Reviewed-on: http://android.intel.com:8080/35374
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/mmc/core/core.c

index 4018905..f96f03a 100644 (file)
@@ -585,8 +585,19 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
                        /*
                         * The limit is really 250 ms, but that is
                         * insufficient for some crappy cards.
+                        *
+                        * use 3s for SD card write to make sure
+                        * as many as SD cards (include some bad quality cards)
+                        * can be supported well
+                        *
+                        * Increase this value should not impact performance
+                        * since this value only indicate how long should host
+                        * wait for a proper interrupt before report a timeout
+                        * interrupt.
+                        *
+                        * Increase this value to be 3s.
                         */
-                       limit_us = 300000;
+                       limit_us = 3000000;
                else
                        limit_us = 100000;