rsi: fix for sdio reset card issue
authorGanapathi Kondraju <ganapathirajukondraju@gmail.com>
Thu, 25 Jul 2019 10:51:50 +0000 (16:21 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Aug 2019 12:36:26 +0000 (15:36 +0300)
Issue: While removing and inserting the driver module, observed driver
loading is not successful.

Root cause: Card is not resetted completely without issuing cmd5.

Fix: Issued cmd5 properly.

Signed-off-by: Ganapathi Kondraju <ganapathirajukondraju@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_sdio.c

index 693be867a84a33dadd6c8ae0a52fab3ccb329e30..1bebba4e85273f8f7d944419b6ff683e08773861 100644 (file)
@@ -230,19 +230,16 @@ static void rsi_reset_card(struct sdio_func *pfunction)
                rsi_dbg(ERR_ZONE, "%s: CMD0 failed : %d\n", __func__, err);
 
        /* Issue CMD5, arg = 0 */
-       if (!host->ocr_avail) {
-               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;
-       }
+       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,
+                                           card->ocr,
                                            (MMC_RSP_R4 | MMC_CMD_BCR), &resp);
                if (err) {
                        rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",