@@ -127,7 +127,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
cmd.arg = ocr;
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
- for (i = 100; i; i--) {
+ for (i = SD_APP_OP_COND_RETRIES; i; i--) {
err = mmc_wait_for_app_cmd(host, NULL, &cmd);
if (err)
break;
@@ -147,7 +147,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
err = -ETIMEDOUT;
- mmc_delay(10);
+ mmc_delay(SD_APP_OP_COND_INTERVAL);
}
if (!i)
@@ -10,6 +10,14 @@
#include <linux/types.h>
+/*
+ * Extensive testing has shown that a few specific SD cards require
+ * an increase in the number of command retries to successfully
+ * initialize.
+ */
+#define SD_APP_OP_COND_RETRIES 200
+#define SD_APP_OP_COND_INTERVAL 10 /* millisecond */
+
struct mmc_card;
struct mmc_host;
Extensive testing has shown that a few specific SD cards require an increase in the number of command retries to successfully initialize. Signed-off-by: Felix Qin <xiaokeqinhealth@126.com> --- drivers/mmc/core/sd_ops.c | 4 ++-- drivers/mmc/core/sd_ops.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)