From patchwork Tue Apr 14 03:40:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Mao X-Patchwork-Id: 11486643 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7651E912 for ; Tue, 14 Apr 2020 03:41:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F13C2075E for ; Tue, 14 Apr 2020 03:41:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="WOKQGFXH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404878AbgDNDk7 (ORCPT ); Mon, 13 Apr 2020 23:40:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:19563 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2404874AbgDNDk6 (ORCPT ); Mon, 13 Apr 2020 23:40:58 -0400 X-UUID: 130231d2b9d145989eaf1c2be2eb8a40-20200414 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=pXbuHYf29wq9I5dB9+bPlMg2JqoQVfcEPpb8kdg9al4=; b=WOKQGFXHfVI/VIGaXPZyHMPLRnupYoN2y/YqVZyftVjEx5/1eO3QiaNVZ+qhCrR1RzQUfwVGQ1GkE36pkUftFDezbcphpkGR5yCmmSvCUaK4YdK4URSmesoEiFBg6udCBwd3Wo+TXG3cAsRD+/favOs723Knrt/6oO2Oky6Rm5Y=; X-UUID: 130231d2b9d145989eaf1c2be2eb8a40-20200414 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1549726525; Tue, 14 Apr 2020 11:40:55 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Apr 2020 11:40:54 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Apr 2020 11:40:49 +0800 From: Yong Mao To: Ulf Hansson CC: Chaotian Jing , Matthias Brugger , , , , , , yong mao Subject: [PATCH 1/3] mmc: core: need do mmc_power_cycle in mmc_sdio_resend_if_cond Date: Tue, 14 Apr 2020 11:40:09 +0800 Message-ID: <1586835611-13857-2-git-send-email-yong.mao@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1586835611-13857-1-git-send-email-yong.mao@mediatek.com> References: <1586835611-13857-1-git-send-email-yong.mao@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: yong mao When mmc_sdio_resned_if_cond is invoked, it indicates the SDIO device is not in the right state. In this condition, the previous implementation of mmc_sdio_resend_if_cond can't make sure SDIO device be back to idle state. mmc_power_cycle can reset the SDIO device by HW and also make sure SDIO device enter to idle state correctly. Signed-off-by: Yong Mao --- drivers/mmc/core/sdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index ebb387a..ada0a80 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -546,6 +546,7 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card) static void mmc_sdio_resend_if_cond(struct mmc_host *host, struct mmc_card *card) { + mmc_power_cycle(host, host->card->ocr); sdio_reset(host); mmc_go_idle(host); mmc_send_if_cond(host, host->ocr_avail);