mirror of https://gitee.com/openkylin/linux.git
rsi: fix sdio card reset problem
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>
This commit is contained in:
parent
09cfb41f35
commit
f95bbd979d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue