rsi: fix sdio card reset problem
authorKarun Eagalapati <karun256@gmail.com>
Thu, 6 Jul 2017 14:37:06 +0000 (20:07 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:22:33 +0000 (17:22 +0300)
card reset is not working with recent kernels. Using
host->card->ocr instead of host->ocr_avail solved the problem.

Signed-off-by: Karun Eagalapati <karun256@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_sdio.c

index e5ea99bb2dd8294f211503a00137d9a70df270d7..b5ac50394e2b1af746aed0ed40656b7cb47a24c9 100644 (file)
@@ -219,26 +219,18 @@ static void rsi_reset_card(struct sdio_func *pfunction)
        if (err)
                rsi_dbg(ERR_ZONE, "%s: CMD0 failed : %d\n", __func__, err);
 
-       if (!host->ocr_avail) {
-               /* Issue CMD5, arg = 0 */
-               err = rsi_issue_sdiocommand(pfunction,
-                                           SD_IO_SEND_OP_COND,
-                                           0,
-                                           (MMC_RSP_R4 | MMC_CMD_BCR),
-                                           &resp);
-               if (err)
-                       rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",
-                               __func__, err);
-               host->ocr_avail = resp;
-       }
+       /* Issue CMD5, arg = 0 */
+       err = rsi_issue_sdiocommand(pfunction,  SD_IO_SEND_OP_COND, 0,
+                                   (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
+       if (err)
+               rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n", __func__, err);
+       card->ocr = resp;
 
        /* Issue CMD5, arg = ocr. Wait till card is ready  */
        for (i = 0; i < 100; i++) {
-               err = rsi_issue_sdiocommand(pfunction,
-                                           SD_IO_SEND_OP_COND,
-                                           host->ocr_avail,
-                                           (MMC_RSP_R4 | MMC_CMD_BCR),
-                                           &resp);
+               err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND,
+                                           card->ocr,
+                                           (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
                if (err) {
                        rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",
                                __func__, err);