Commit dfc7a8f7 authored by Ganapathi Kondraju's avatar Ganapathi Kondraju Committed by Kalle Valo
Browse files

rsi: fix for sdio reset card issue



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: default avatarGanapathi Kondraju <ganapathirajukondraju@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 3915a252
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -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;
	}
	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",