Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3257274rwb; Wed, 30 Nov 2022 18:09:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fXfC6jXUqZiIDiiAxDNaVSbITonbA+vHHwas9WuCwpHgeR02YfAEMBgslD2ZATZcGThp5 X-Received: by 2002:a63:580a:0:b0:477:12e3:6e1c with SMTP id m10-20020a63580a000000b0047712e36e1cmr41059996pgb.126.1669860555064; Wed, 30 Nov 2022 18:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669860555; cv=none; d=google.com; s=arc-20160816; b=GGo7E0UJ6AqJr3jloK/Xv7BjzqAIu/RiBTjthQEQZgpOpA6sjYbn96F2meMopFc8XO w56d/5uJJNco8WnHvZK0m0ivA8bOgrj3VwnngvgNZmUbW5t+lz+EkoAXVnkvSkwCG7mC uyQMzeaKgWhZ9Hnlw0Gf/tbH29R+yzaEV2Rc/DPbQDdOqfqVxDG2yfHOOsk3gLS0Eko5 JMrSCtqrB3KlOxhn8H4ZopQ+onDFY5WryRzsQ3B8yn9D5Cu68V562kN74Dow4LZ9kBQl OlXOBqFaMjfgDXHfKk25CRPG/4MSgKrJyjOiuCNkseJRfyYn2TA7Qq9agtICbOwnzGyd S0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=Ax9OatnF/hFFfjaNqjbEKYgUJx4n0pd2fPAJBc7/Z3A=; b=1HTLJKAphdM5Or98cx+K8ApEYBGdmvtU9C6Hr8Y3MyJLI5a35+qHdGTyjyQmjq1/9K 8d9K5LNjltp6th6DvT5nnp0IwxdImbj4XdBCzGCiFDHvGaYo/eusxqGDeytRlZQqZv5E Pm6yN7FmU0GSCBxhHHYRFY6MBAIESm4HI41ZRE6gCqLP9funIuZ8JL+Hm7zSZ2mh2he6 5ysBDiHYeczBqzpHtFP9iwRs9M2pxavN6FIsQ67vN/Ns7f7Y6pVo7tIF6k1ZZfvST2wf /lRzmYoFiTivSHV812q69SRLD5gu+J7LxknQ1WujzONdZQUcWa5XjA7NAdVsM00DxCzk 7w2Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a656785000000b0047866258f1fsi2179052pgr.321.2022.11.30.18.09.04; Wed, 30 Nov 2022 18:09:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbiLABES (ORCPT + 82 others); Wed, 30 Nov 2022 20:04:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiLABEP (ORCPT ); Wed, 30 Nov 2022 20:04:15 -0500 Received: from out30-7.freemail.mail.aliyun.com (out30-7.freemail.mail.aliyun.com [115.124.30.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD7A8EE6B; Wed, 30 Nov 2022 17:04:13 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VW50kJS_1669856649; Received: from 30.97.48.64(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VW50kJS_1669856649) by smtp.aliyun-inc.com; Thu, 01 Dec 2022 09:04:10 +0800 Message-ID: <43ced087-850d-8449-dd78-6628c887f8e6@linux.alibaba.com> Date: Thu, 1 Dec 2022 09:04:14 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch To: Wenchao Chen , adrian.hunter@intel.com, ulf.hansson@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, zhenxiong.lai@unisoc.com, yuelin.tang@unisoc.com, gengcixi@gmail.com References: <20221130121328.25553-1-wenchao.chen@unisoc.com> From: Baolin Wang In-Reply-To: <20221130121328.25553-1-wenchao.chen@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On 11/30/2022 8:13 PM, Wenchao Chen wrote: > 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 LGTM. Thanks. Reviewed-by: Baolin Wang > --- > 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;