Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2259699rwb; Wed, 30 Nov 2022 04:37:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4kGjvoCVmNQJpPtS+oc1yddoRrQoLS7ldRth2mSzfcA/WLiEdUg41Cgfqx3ajcGWQH/rWg X-Received: by 2002:a17:90a:6308:b0:218:ce1c:4c76 with SMTP id e8-20020a17090a630800b00218ce1c4c76mr42471703pjj.97.1669811871903; Wed, 30 Nov 2022 04:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669811871; cv=none; d=google.com; s=arc-20160816; b=u7mUtWl0mPh0uos+ge7IuPFu3oQ3sNp8E2Y4k4RGyfK2GHuOgOtZX4XG25LM0dID30 GKztv4xR7TIzlaGnGkCmrx8Kkhd7bLfMMOFWvxIZcmN3gJg1Xa/qtDL75NiFvFIScd5F 4n5q234DjUCk75m2QXFRrzGco0XerelRPwMgzoPDm4gRvCWxUw1SzVtnrEPD9t3oeJaw 3/UKs0kyrEXuRbMUowP2LkG8qXirSXmrQEfS5v6efxfvCSvdE/mvXnnnwOX66NPOSDBG Dl/e3EBLuLtKW3yU8d7rndg9I49xQrNisG4z9QOss96/TJ/pIp5gvGCj8lVAI4NyzOXJ OtFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=gnPLduE3PkRBzP3S/aAwYOgWiAQZOS5BINzJrJD0Bv0=; b=GO9c6kxD1iblbu5mtEYwD3c/3mvwgWQWVq2e0ISygb56Pe6TxNEA1rcb1T/AmXidh3 0fN7Xd6LyGwc2zsK3K8beXPP1QcI9GBkxT1aYSFIF+tpHFxysNjzFmlI0s5raxhFMvIr eBK1ipCgiSoCTcWlN42MdLCw9q2yAGlyb1ydFIOV51FeJkfNVVBjAiL8Tzf9ZigC5TMn DS7RHJJlqfNRWok+y5VkoR+pRmMw9qvT39fxGBYTiuLyaIHEH52HfdtjgMqq8YnHDlZI NjqW6y82azXuVjsZRKzVZETrco+dkDrPIPXqltOOzvtxRbQd8EazNlx81VARvlF32JjB 6f8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x64-20020a638643000000b00477ba9ec461si1112811pgd.879.2022.11.30.04.37.41; Wed, 30 Nov 2022 04:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234391AbiK3MPb (ORCPT + 84 others); Wed, 30 Nov 2022 07:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiK3MPa (ORCPT ); Wed, 30 Nov 2022 07:15:30 -0500 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35752B600; Wed, 30 Nov 2022 04:15:27 -0800 (PST) Received: from SHSend.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by SHSQR01.spreadtrum.com with ESMTPS id 2AUCDen7047066 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 30 Nov 2022 20:13:40 +0800 (CST) (envelope-from Wenchao.Chen@unisoc.com) Received: from xm13705pcu.spreadtrum.com (10.13.3.189) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 30 Nov 2022 20:13:38 +0800 From: Wenchao Chen To: , , , , CC: , , , , Subject: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Date: Wed, 30 Nov 2022 20:13:28 +0800 Message-ID: <20221130121328.25553-1-wenchao.chen@unisoc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.13.3.189] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 2AUCDen7047066 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After switching the voltage, no reset data and command will cause CMD2 timeout. Fixes: 29ca763fc26f ("mmc: sdhci-sprd: Add pin control support for voltage switch") Signed-off-by: Wenchao Chen --- Changelog: v1 -> v2: There is no need to wait for the state of the pin to stabilize. --- drivers/mmc/host/sdhci-sprd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index b92a408f138d..bec3f9e3cd3f 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) } if (IS_ERR(sprd_host->pinctrl)) - return 0; + goto reset; switch (ios->signal_voltage) { case MMC_SIGNAL_VOLTAGE_180: @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) /* Wait for 300 ~ 500 us for pin state stable */ usleep_range(300, 500); + +reset: sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); return 0; -- 2.17.1