[{"id":1773612,"web_url":"http://patchwork.ozlabs.org/comment/1773612/","msgid":"<c596cbd2-8faf-efbe-5d82-079d623f4901@samsung.com>","list_archive_url":null,"date":"2017-09-22T13:54:38","subject":"Re: [U-Boot] [PATCH v2 23/26] mmc: Retry some MMC cmds on failure","submitter":{"id":8006,"url":"http://patchwork.ozlabs.org/api/people/8006/","name":"Jaehoon Chung","email":"jh80.chung@samsung.com"},"content":"On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:\n> From: Kishon Vijay Abraham I <kishon@ti.com>\n> \n> With certain SD cards like Kingston 8GB/16GB UHS card, it is seen that\n> MMC_CMD_ALL_SEND_CID cmd fails on first attempt, but succeeds\n> subsequently. Therefore, retry MMC_CMD_ALL_SEND_CID cmd a few time\n> as done in Linux kernel.\n> Similarly, it is seen that MMC_CMD_SET_BLOCKLEN may fail on first\n> attempt, therefore retry this cmd a few times as done in kernel.\n> \n> To make it clear that those are optionnal workarounds, a new Kconfig\n> option 'MMC_QUIRKS' is added (enabled by default).\n> \n> Signed-off-by: Vignesh R <vigneshr@ti.com>\n> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>\n> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>\n> ---\n>  drivers/mmc/Kconfig |  9 +++++++++\n>  drivers/mmc/mmc.c   | 41 +++++++++++++++++++++++++++++++++++++++--\n>  include/mmc.h       |  4 ++++\n>  3 files changed, 52 insertions(+), 2 deletions(-)\n> \n> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig\n> index 3d577e0..78e58d4 100644\n> --- a/drivers/mmc/Kconfig\n> +++ b/drivers/mmc/Kconfig\n> @@ -33,6 +33,15 @@ config SPL_DM_MMC\n>  \n>  if MMC\n>  \n> +config MMC_QUIRKS\n> +\tbool \"Enable quirks\"\n> +\tdefault y\n> +\thelp\n> +\t  Some cards and hosts may sometimes behave unexpectedly (quirks).\n> +\t  This option enable workarounds to handle those quirks. Some of them\n> +\t  are enabled by default, other may require additionnal flags or are\n> +\t  enabled by the host driver.\n> +\n>  config MMC_VERBOSE\n>  \tbool \"Output more information about the MMC\"\n>  \tdefault y\n> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c\n> index c5eaeaf..6d1bf94 100644\n> --- a/drivers/mmc/mmc.c\n> +++ b/drivers/mmc/mmc.c\n> @@ -279,6 +279,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)\n>  int mmc_set_blocklen(struct mmc *mmc, int len)\n>  {\n>  \tstruct mmc_cmd cmd;\n> +\tint err;\n>  \n>  \tif (mmc->ddr_mode)\n>  \t\treturn 0;\n> @@ -287,7 +288,24 @@ int mmc_set_blocklen(struct mmc *mmc, int len)\n>  \tcmd.resp_type = MMC_RSP_R1;\n>  \tcmd.cmdarg = len;\n>  \n> -\treturn mmc_send_cmd(mmc, &cmd, NULL);\n> +\terr = mmc_send_cmd(mmc, &cmd, NULL);\n> +\n> +#ifdef CONFIG_MMC_QUIRKS\n> +\tif (err && (mmc->quirks & MMC_QUIRK_RETRY_SET_BLOCKLEN)) {\n> +\t\tint retries = 4;\n> +\t\t/*\n> +\t\t * It has been seen that SET_BLOCKLEN may fail on the first\n> +\t\t * attempt, let's try a few more time\n> +\t\t */\n> +\t\tdo {\n> +\t\t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n> +\t\t\tif (!err)\n> +\t\t\t\tbreak;\n> +\t\t} while (retries--);\n> +\t}\n> +#endif\n> +\n> +\treturn err;\n>  }\n>  \n>  static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,\n> @@ -1881,7 +1899,6 @@ static int mmc_startup(struct mmc *mmc)\n>  \t\tcmd.resp_type = MMC_RSP_R1;\n>  \t\tcmd.cmdarg = 1;\n>  \t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n> -\n>  \t\tif (err)\n>  \t\t\treturn err;\n>  \t}\n> @@ -1895,6 +1912,21 @@ static int mmc_startup(struct mmc *mmc)\n>  \n>  \terr = mmc_send_cmd(mmc, &cmd, NULL);\n>  \n> +#ifdef CONFIG_MMC_QUIRKS\n> +\tif (err && (mmc->quirks & MMC_QUIRK_RETRY_SEND_CID)) {\n> +\t\tint retries = 4;\n> +\t\t/*\n> +\t\t * It has been seen that SEND_CID may fail on the first\n> +\t\t * attempt, let's try a few more time\n> +\t\t */\n> +\t\tdo {\n> +\t\t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n> +\t\t\tif (!err)\n> +\t\t\t\tbreak;\n> +\t\t} while (retries--);\n> +\t}\n> +#endif\n> +\n>  \tif (err)\n>  \t\treturn err;\n>  \n> @@ -2239,6 +2271,11 @@ int mmc_start_init(struct mmc *mmc)\n>  \tif (err)\n>  \t\treturn err;\n>  \n> +#ifdef CONFIG_MMC_QUIRKS\n> +\tmmc->quirks = MMC_QUIRK_RETRY_SET_BLOCKLEN |\n> +\t\t      MMC_QUIRK_RETRY_SEND_CID;\n> +#endif\n> +\n>  \terr = mmc_power_cycle(mmc);\n>  \tif (err) {\n>  \t\t/*\n> diff --git a/include/mmc.h b/include/mmc.h\n> index a8901bf..a9ebc88 100644\n> --- a/include/mmc.h\n> +++ b/include/mmc.h\n> @@ -306,6 +306,9 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)\n>  #define ENHNCD_SUPPORT\t\t(0x2)\n>  #define PART_ENH_ATTRIB\t\t(0x1f)\n>  \n> +#define MMC_QUIRK_RETRY_SEND_CID\tBIT(0)\n> +#define MMC_QUIRK_RETRY_SET_BLOCKLEN\tBIT(1)\n> +\n>  enum mmc_voltage {\n>  \tMMC_SIGNAL_VOLTAGE_000 = 0,\n>  \tMMC_SIGNAL_VOLTAGE_120,\n> @@ -591,6 +594,7 @@ struct mmc {\n>  \t\t\t\t  * operating mode due to limitations when\n>  \t\t\t\t  * accessing the boot partitions\n>  \t\t\t\t  */\n> +\tu32 quirks;\n\nUse the #ifdef MMC_QUIRK for quirks?\n\n>  };\n>  \n>  struct mmc_hwpart_conf {\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzFR11xGcz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 23:57:17 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid E6D8CC22045; Fri, 22 Sep 2017 13:55:45 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 827FFC22051;\n\tFri, 22 Sep 2017 13:54:55 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 35544C2204B; Fri, 22 Sep 2017 13:54:51 +0000 (UTC)","from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25])\n\tby lists.denx.de (Postfix) with ESMTPS id 6BC37C2203C\n\tfor <u-boot@lists.denx.de>; Fri, 22 Sep 2017 13:54:44 +0000 (UTC)","from epcas1p2.samsung.com (unknown [182.195.41.46])\n\tby mailout2.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135439epoutp024c00d77c78156f69dbdaa94dba8643b8~ms339Bf-21099810998epoutp02P;\n\tFri, 22 Sep 2017 13:54:39 +0000 (GMT)","from epsmges1p5.samsung.com (unknown [182.195.40.68]) by\n\tepcas1p2.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135438epcas1p245bc7d2546b9fc306e9c468e6299042b~ms33rjWwd2997229972epcas1p20;\n\tFri, 22 Sep 2017 13:54:38 +0000 (GMT)","from epcas1p3.samsung.com ( [182.195.41.47]) by\n\tepsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id\n\t5C.C7.18934.E1615C95; Fri, 22 Sep 2017 22:54:38 +0900 (KST)","from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by\n\tepcas1p3.samsung.com (KnoxPortal) with ESMTP id\n\t20170922135438epcas1p34e6357c2aa9e145c55cd0377c270b4db~ms33gKiHu2719727197epcas1p36;\n\tFri, 22 Sep 2017 13:54:38 +0000 (GMT)","from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com\n\t(Symantec Messaging Gateway) with SMTP id CD.32.11757.E1615C95;\n\tFri, 22 Sep 2017 22:54:38 +0900 (KST)","from [10.113.62.216] by mmp2.samsung.com (Oracle Communications\n\tMessaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id\n\t<0OWO000ENPB2R980@mmp2.samsung.com>;\n\tFri, 22 Sep 2017 22:54:38 +0900 (KST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,\n\tSPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0","X-AuditID":"b6c32a39-f794a6d0000049f6-92-59c5161e8633","To":"Jean-Jacques Hiblot <jjhiblot@ti.com>, trini@konsulko.com,\n\tkishon@ti.com, sjg@chromium.org","From":"Jaehoon Chung <jh80.chung@samsung.com>","Message-id":"<c596cbd2-8faf-efbe-5d82-079d623f4901@samsung.com>","Date":"Fri, 22 Sep 2017 22:54:38 +0900","User-Agent":"Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-version":"1.0","In-reply-to":"<1506004213-22620-24-git-send-email-jjhiblot@ti.com>","Content-language":"en-US","X-Brightmail-Tracker":["H4sIAAAAAAAAA+NgFprMJsWRmVeSWpSXmKPExsWy7bCmvq6c2NFIg7WL9S1aTk5isrjwtIfN\n\t4uiee8wW37ZsY7SYOmkzu8XbvZ3sFv/PfmB3YPeY3XCRxWPnrLvsHq8OrGL3OHtnB6PH8Rvb\n\tmQJYo1JtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4Du\n\tUFIoS8wpBQoFJBYXK+nb2RTll5akKmTkF5fYKkUbGhrpGRqY6xkZGemZGMdaGZkClSSkZny7\n\tMYOlYJtSRd+r3+wNjOukuhg5OSQETCTub3/ACGGLSVy4t56ti5GLQ0hgB6PE5fYV7BDOd0aJ\n\tV9efs8F0rG3+ywRiCwlsYJRoatGAsO8xSnzdyQ1iCws4ShyY0MLSxcjBISKQINHbWgoSZhbw\n\tkfh3vhlsDJuAjsT2b8fBxvAK2EmsnLcfzGYRUJXYsANkLyeHqECYxMpfrxghagQlfky+xwJi\n\tcwKNv9n0ix1ipqbEiy+TWCBscYnm1ptQtrzE5jVvmUHulxC4zCbx+vdVVpB7JARcJNb+MIR4\n\tRVji1fEt7BBhaYlLR20hytsZJW792McG4XQwShz8uZcVosFY4lRXIxPEAj6Jd197oGbySnS0\n\tCUGUeEi0vfrJDGE7SjxcupwZEoanGCXOnulkm8AoPwvJP7OQ/DALyQ+zkPywgJFlFaNYakFx\n\tbnpqsWGBqV5xYm5xaV66XnJ+7iZGcILUstzBeOyczyFGAQ5GJR5eg4OHI4VYE8uKK3MPMUpw\n\tMCuJ8B79dyRSiDclsbIqtSg/vqg0J7X4EKMpMLwnMkuJJucDk3deSbyhiaWBiZkRMNVZGhoq\n\tifOKrr8WISSQnliSmp2aWpBaBNPHxMEp1cAYqqqwSvBg2cuPJqHRLzYvP+kQkbpM8nvelytB\n\tz56zM5y+1780xE3M2kgjpHBrYfEFj33r1q3snHTf4KpG1nox/3jH8N2FrifSVZyeloc2LZw8\n\t6WFGYLOnRudDCamapwkOt00/9JoKTKy+Intu5eYFl86G3n3GFDa9ySZSeB4fU8T35fI3VZOV\n\tWIozEg21mIuKEwGe/KUkpgMAAA==","H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsVy+t9jQV05saORBtM/KVm0nJzEZHHhaQ+b\n\txdE995gtvm3ZxmgxddJmdou3ezvZLf6f/cDuwO4xu+Eii8fOWXfZPV4dWMXucfbODkaP4ze2\n\tMwWwRnHZpKTmZJalFunbJXBlfLsxg6Vgm1JF36vf7A2M66S6GDk5JARMJNY2/2XqYuTiEBJY\n\txygxY9VsKOcBo8TDl2dZQaqEBRwlDkxoYQGxRQQSJP5vucIGYjML+Ej8O9/MBtFwilHix8qZ\n\tzCAJNgEdie3fjjOB2LwCdhIr5+0Hs1kEVCU27FjBDmKLCoRJ9Df/ZYaoEZT4Mfke2AJOoGU3\n\tm34B1XAALVCXmDIlF2KXuERz600WCFteYvOat8wTGAVmIemehdAxC0nHLCQdCxhZVjFKphYU\n\t56bnFhsVGOallusVJ+YWl+al6yXn525iBMbBtsNafTsY7y+JP8QowMGoxMN7Y9/hSCHWxLLi\n\tytxDjBIczEoivEf/HYkU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzpvZNyNSSCA9sSQ1OzW1ILUI\n\tJsvEwSnVwJjEefjIsbicpVvSPj823da2reqjcmhqgAaLocWWXXJFtccaet7OqZaxPZslwZJw\n\tda9TkHSvmdzhlbU9trlJu31mST3LdZ4azsC/2fjhjorSqwtNr9VqxB3SeqbQ6TrF7Wmo9lzH\n\td77ZW0/9k36ruZXr0SqTyVffRCxa2XI4/aiI34Z3K8Q+PlViKc5INNRiLipOBADS06hKfwIA\n\tAA=="],"X-CMS-MailID":"20170922135438epcas1p34e6357c2aa9e145c55cd0377c270b4db","X-Msg-Generator":"CA","X-Sender-IP":"182.195.42.142","X-Local-Sender":"=?utf-8?b?7KCV7J6s7ZuIG1RpemVuIFBsYXRmb3JtIExhYihTL1c=?=\n\t=?utf-8?b?7IS87YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?=","X-Global-Sender":"=?utf-8?q?Jaehoon_Chung=1BTizen_Platform_Lab=2E=1BSamsun?=\n\t=?utf-8?q?g_Electronics=1BSenior_Engineer?=","X-Sender-Code":"=?utf-8?q?C10=1BTELE=1BC10V8111?=","CMS-TYPE":"101P","DLP-Filter":"Pass","X-CFilter-Loop":"Reflected","X-CMS-RootMailID":"20170921143115epcas2p2304b1dc07202676c0c1215068b3e627e","X-RootMTR":"20170921143115epcas2p2304b1dc07202676c0c1215068b3e627e","References":"<1506004213-22620-1-git-send-email-jjhiblot@ti.com>\n\t<CGME20170921143115epcas2p2304b1dc07202676c0c1215068b3e627e@epcas2p2.samsung.com>\n\t<1506004213-22620-24-git-send-email-jjhiblot@ti.com>","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH v2 23/26] mmc: Retry some MMC cmds on failure","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1778210,"web_url":"http://patchwork.ozlabs.org/comment/1778210/","msgid":"<7caa370b-8bb6-14c5-019a-6f585178fd73@ti.com>","list_archive_url":null,"date":"2017-10-02T09:05:13","subject":"Re: [U-Boot] [PATCH v2 23/26] mmc: Retry some MMC cmds on failure","submitter":{"id":70508,"url":"http://patchwork.ozlabs.org/api/people/70508/","name":"Jean-Jacques Hiblot","email":"jjhiblot@ti.com"},"content":"On 22/09/2017 15:54, Jaehoon Chung wrote:\n> On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:\n>> From: Kishon Vijay Abraham I <kishon@ti.com>\n>>\n>> With certain SD cards like Kingston 8GB/16GB UHS card, it is seen that\n>> MMC_CMD_ALL_SEND_CID cmd fails on first attempt, but succeeds\n>> subsequently. Therefore, retry MMC_CMD_ALL_SEND_CID cmd a few time\n>> as done in Linux kernel.\n>> Similarly, it is seen that MMC_CMD_SET_BLOCKLEN may fail on first\n>> attempt, therefore retry this cmd a few times as done in kernel.\n>>\n>> To make it clear that those are optionnal workarounds, a new Kconfig\n>> option 'MMC_QUIRKS' is added (enabled by default).\n>>\n>> Signed-off-by: Vignesh R <vigneshr@ti.com>\n>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>\n>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>\n>> ---\n>>   drivers/mmc/Kconfig |  9 +++++++++\n>>   drivers/mmc/mmc.c   | 41 +++++++++++++++++++++++++++++++++++++++--\n>>   include/mmc.h       |  4 ++++\n>>   3 files changed, 52 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig\n>> index 3d577e0..78e58d4 100644\n>> --- a/drivers/mmc/Kconfig\n>> +++ b/drivers/mmc/Kconfig\n>> @@ -33,6 +33,15 @@ config SPL_DM_MMC\n>>   \n>>   if MMC\n>>   \n>> +config MMC_QUIRKS\n>> +\tbool \"Enable quirks\"\n>> +\tdefault y\n>> +\thelp\n>> +\t  Some cards and hosts may sometimes behave unexpectedly (quirks).\n>> +\t  This option enable workarounds to handle those quirks. Some of them\n>> +\t  are enabled by default, other may require additionnal flags or are\n>> +\t  enabled by the host driver.\n>> +\n>>   config MMC_VERBOSE\n>>   \tbool \"Output more information about the MMC\"\n>>   \tdefault y\n>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c\n>> index c5eaeaf..6d1bf94 100644\n>> --- a/drivers/mmc/mmc.c\n>> +++ b/drivers/mmc/mmc.c\n>> @@ -279,6 +279,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)\n>>   int mmc_set_blocklen(struct mmc *mmc, int len)\n>>   {\n>>   \tstruct mmc_cmd cmd;\n>> +\tint err;\n>>   \n>>   \tif (mmc->ddr_mode)\n>>   \t\treturn 0;\n>> @@ -287,7 +288,24 @@ int mmc_set_blocklen(struct mmc *mmc, int len)\n>>   \tcmd.resp_type = MMC_RSP_R1;\n>>   \tcmd.cmdarg = len;\n>>   \n>> -\treturn mmc_send_cmd(mmc, &cmd, NULL);\n>> +\terr = mmc_send_cmd(mmc, &cmd, NULL);\n>> +\n>> +#ifdef CONFIG_MMC_QUIRKS\n>> +\tif (err && (mmc->quirks & MMC_QUIRK_RETRY_SET_BLOCKLEN)) {\n>> +\t\tint retries = 4;\n>> +\t\t/*\n>> +\t\t * It has been seen that SET_BLOCKLEN may fail on the first\n>> +\t\t * attempt, let's try a few more time\n>> +\t\t */\n>> +\t\tdo {\n>> +\t\t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n>> +\t\t\tif (!err)\n>> +\t\t\t\tbreak;\n>> +\t\t} while (retries--);\n>> +\t}\n>> +#endif\n>> +\n>> +\treturn err;\n>>   }\n>>   \n>>   static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,\n>> @@ -1881,7 +1899,6 @@ static int mmc_startup(struct mmc *mmc)\n>>   \t\tcmd.resp_type = MMC_RSP_R1;\n>>   \t\tcmd.cmdarg = 1;\n>>   \t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n>> -\n>>   \t\tif (err)\n>>   \t\t\treturn err;\n>>   \t}\n>> @@ -1895,6 +1912,21 @@ static int mmc_startup(struct mmc *mmc)\n>>   \n>>   \terr = mmc_send_cmd(mmc, &cmd, NULL);\n>>   \n>> +#ifdef CONFIG_MMC_QUIRKS\n>> +\tif (err && (mmc->quirks & MMC_QUIRK_RETRY_SEND_CID)) {\n>> +\t\tint retries = 4;\n>> +\t\t/*\n>> +\t\t * It has been seen that SEND_CID may fail on the first\n>> +\t\t * attempt, let's try a few more time\n>> +\t\t */\n>> +\t\tdo {\n>> +\t\t\terr = mmc_send_cmd(mmc, &cmd, NULL);\n>> +\t\t\tif (!err)\n>> +\t\t\t\tbreak;\n>> +\t\t} while (retries--);\n>> +\t}\n>> +#endif\n>> +\n>>   \tif (err)\n>>   \t\treturn err;\n>>   \n>> @@ -2239,6 +2271,11 @@ int mmc_start_init(struct mmc *mmc)\n>>   \tif (err)\n>>   \t\treturn err;\n>>   \n>> +#ifdef CONFIG_MMC_QUIRKS\n>> +\tmmc->quirks = MMC_QUIRK_RETRY_SET_BLOCKLEN |\n>> +\t\t      MMC_QUIRK_RETRY_SEND_CID;\n>> +#endif\n>> +\n>>   \terr = mmc_power_cycle(mmc);\n>>   \tif (err) {\n>>   \t\t/*\n>> diff --git a/include/mmc.h b/include/mmc.h\n>> index a8901bf..a9ebc88 100644\n>> --- a/include/mmc.h\n>> +++ b/include/mmc.h\n>> @@ -306,6 +306,9 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)\n>>   #define ENHNCD_SUPPORT\t\t(0x2)\n>>   #define PART_ENH_ATTRIB\t\t(0x1f)\n>>   \n>> +#define MMC_QUIRK_RETRY_SEND_CID\tBIT(0)\n>> +#define MMC_QUIRK_RETRY_SET_BLOCKLEN\tBIT(1)\n>> +\n>>   enum mmc_voltage {\n>>   \tMMC_SIGNAL_VOLTAGE_000 = 0,\n>>   \tMMC_SIGNAL_VOLTAGE_120,\n>> @@ -591,6 +594,7 @@ struct mmc {\n>>   \t\t\t\t  * operating mode due to limitations when\n>>   \t\t\t\t  * accessing the boot partitions\n>>   \t\t\t\t  */\n>> +\tu32 quirks;\n> Use the #ifdef MMC_QUIRK for quirks?\nOK. I'll fix it in the next round\nThanks,\nJean-Jacques\n>\n>>   };\n>>   \n>>   struct mmc_hwpart_conf {\n>>\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ti.com header.i=@ti.com header.b=\"nO9Fv87x\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y5GTl21Qhz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  2 Oct 2017 20:05:31 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid E89B8C21E16; Mon,  2 Oct 2017 09:05:23 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 1220CC21DE8;\n\tMon,  2 Oct 2017 09:05:20 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 0CCF3C21DE8; Mon,  2 Oct 2017 09:05:18 +0000 (UTC)","from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17])\n\tby lists.denx.de (Postfix) with ESMTPS id 61C70C21C41\n\tfor <u-boot@lists.denx.de>; Mon,  2 Oct 2017 09:05:18 +0000 (UTC)","from dflxv15.itg.ti.com ([128.247.5.124])\n\tby fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9295FR0008057; \n\tMon, 2 Oct 2017 04:05:15 -0500","from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26])\n\tby dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9295FAJ024216;\n\tMon, 2 Oct 2017 04:05:15 -0500","from DLEE115.ent.ti.com (157.170.170.26) by DLEE115.ent.ti.com\n\t(157.170.170.26) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34;\n\tMon, 2 Oct 2017 04:05:15 -0500","from dflp33.itg.ti.com (10.64.6.16) by DLEE115.ent.ti.com\n\t(157.170.170.26) with Microsoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend\n\tTransport; Mon, 2 Oct 2017 04:05:14 -0500","from [172.22.129.181] (ileax41-snat.itg.ti.com [10.172.224.153])\n\tby dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9295DTZ024518;\n\tMon, 2 Oct 2017 04:05:13 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com;\n\ts=ti-com-17Q1; t=1506935115;\n\tbh=I/VcYEGSr6JOG2mbwZnpgpCn27FagEHJqG2MCUpcKzA=;\n\th=Subject:To:CC:References:From:Date:In-Reply-To;\n\tb=nO9Fv87xn3qtnsYXo/GV+UpRydb43di6UnX0bw09CvXPED5orEUPcJyDfqlzHzyme\n\te2MZT6Kbj48JOxurEugQJGZw7plN4nY/dc3UFQVwV867LemADZyrXXHS8dZMfzzzvr\n\tpBhPx157tZY+DpucrDBROmmCu29Pr744xoaOxwH8=","To":"Jaehoon Chung <jh80.chung@samsung.com>, <trini@konsulko.com>,\n\t<kishon@ti.com>, <sjg@chromium.org>","References":"<1506004213-22620-1-git-send-email-jjhiblot@ti.com>\n\t<CGME20170921143115epcas2p2304b1dc07202676c0c1215068b3e627e@epcas2p2.samsung.com>\n\t<1506004213-22620-24-git-send-email-jjhiblot@ti.com>\n\t<c596cbd2-8faf-efbe-5d82-079d623f4901@samsung.com>","From":"Jean-Jacques Hiblot <jjhiblot@ti.com>","Message-ID":"<7caa370b-8bb6-14c5-019a-6f585178fd73@ti.com>","Date":"Mon, 2 Oct 2017 11:05:13 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<c596cbd2-8faf-efbe-5d82-079d623f4901@samsung.com>","Content-Language":"en-US","X-EXCLAIMER-MD-CONFIG":"e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [PATCH v2 23/26] mmc: Retry some MMC cmds on failure","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]