Message ID | 20231201030547.11553-1-mengqi.zhang@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp847788vqy; Thu, 30 Nov 2023 19:06:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjO5pH9bWoEQmPY7z83dKhGIkB5lQaa2nkbFuXV4KekVA6RHg9eq5ArMq93LOejkVnGoKG X-Received: by 2002:a05:6a20:3d84:b0:18c:41cd:c74d with SMTP id s4-20020a056a203d8400b0018c41cdc74dmr19894845pzi.5.1701399965148; Thu, 30 Nov 2023 19:06:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701399965; cv=none; d=google.com; s=arc-20160816; b=x7IT6mujHpsKfEf5hrlYEEApJokBCkvugwwqlm0x2Q+d/jPeDKcdwj0WrzQmG2yppD jVSt9NSFoW48Mc93HkmLysDeVSYc5ezQjY59qF8/YT29ImhCse1BoyHg34WThPNtFJzx SE0xi1xYpNbGgYYPC1D8ejAXFBye6k1Q/SNQSrrq/nfXLtWUee8BKCxWnQSDU/ExG2cp U2mSb2dIzvmoMqUjvu3lhlK17eCTXXBlE0r00InGOcki/YVRswOgXPhHHeYkSYbhPGzP d9d/oB9n9yLSZSiCSfvx4ZWrLEmpnTDRzPdVQJwjCg1oR7znYyJWcsPV36dzsMDzdihK ajbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V6tB0+EPwP58rkLDk+28AFubYUauyeii7M29/hehUYs=; fh=HZjn//rz9SXI9E5CRrEWSuh7Qu3P+mr0GJfzJ1Ctbsg=; b=Cm7ha/ROukulVpYyUrVOa4RR5LYh1sLdgKJnyixTakvCgQrfdKaAJrsFtpXU5pK+0P +Bz/i9ijd5dkZnzN5W8PYhpMoiljr7xJYZ9JcifPQEOHOadhLlEPhi62ncaq7calsT/V F048oyUe51OggL408RLm/RTI8tQmAeGvGM1RzPCzIjriOXMx9OACQcTaP06WzGLJqPCa wt5KyDuoK1+bGzSxNXrPa0vglbCxu/oz8Sb2RFi38m6pYHkpOlbQIXeDcZiDltwn26EJ wjnpiPFdzhVIJwEB2045AGqWepd3jbi703tHZL9+XTc8sKJ0OhEID6RgPwuotA9SCdo+ 0yDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=EUXqhj3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a2-20020a63e842000000b005c62393c133si2534899pgk.795.2023.11.30.19.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 19:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=EUXqhj3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1F9D880DF249; Thu, 30 Nov 2023 19:06:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376882AbjLADFz (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Thu, 30 Nov 2023 22:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjLADFy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Nov 2023 22:05:54 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12FCA1715; Thu, 30 Nov 2023 19:05:59 -0800 (PST) X-UUID: 8a19255c8ff611eea33bb35ae8d461a2-20231201 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=V6tB0+EPwP58rkLDk+28AFubYUauyeii7M29/hehUYs=; b=EUXqhj3uGctZF3i91gdn8mOboWsOnN6J6tyIByRU+WKNYkL4ecVR+03r4CFLodOSgzyoBY1aSL3fCI4NQvAtxJbi+sZ/+qj47FRlmGkSKno1ZpdaHHSy4iNnRBLuo7br753QWL9t2aUqLwTaxmfE7fndrBHEftMlxM/sBeGuHBU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.34,REQID:f00c2943-cb6d-4268-8306-ef309c913e9e,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:abefa75,CLOUDID:72b228fd-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 8a19255c8ff611eea33bb35ae8d461a2-20231201 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from <mengqi.zhang@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 110085834; Fri, 01 Dec 2023 11:05:53 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 1 Dec 2023 11:05:51 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 1 Dec 2023 11:05:51 +0800 From: Mengqi Zhang <mengqi.zhang@mediatek.com> To: <ulf.hansson@linaro.org>, <chaotian.jing@mediatek.com>, <matthias.bgg@gmail.com>, <mengqi.zhang@mediatek.com>, <wenbin.mei@mediatek.com> CC: <yangyingliang@huawei.com>, <adrian.hunter@intel.com>, <avri.altman@wdc.com>, <vincent.whitchurch@axis.com>, <linux-mmc@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [v1,1/1] mmc: core: Add HS400es support in retune and initialization flow Date: Fri, 1 Dec 2023 11:05:47 +0800 Message-ID: <20231201030547.11553-1-mengqi.zhang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--1.374400-8.000000 X-TMASE-MatchedRID: u+tUW9pLem+E9zgVMk3pXlz+axQLnAVBesw8RnBRGwos/uUAk6xP7COq qvcT7F2IzPzCmwZdi63lN7ZYHc5mSoHcC7KYYAdE4pdq9sdj8LW6hgVvSdGKo9+SMh5eC/5eX9O /HRQux9fi8zVgXoAltsIJ+4gwXrEtwrbXMGDYqV+i5u/VvsFaHVKff8AdaJ4QWCFsQ87yaDPHOM 6xNrBNq9wOJnkbFuha6cT8eWH2891TL0wCs6Mukdps4qxiIeUJBloh3ZuLeBtvBeUWxunLtaMnT JRI0XInfXwUEm1ouDzLDYxFC1/7rn6GdNk4NWmA X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.374400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 55110CD927814B2C0F23ADD29D1383873685FB918AEEA5574DE1D7E2BCFF1A092000:8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 19:06:04 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784047169446945945 X-GMAIL-MSGID: 1784047169446945945 |
Series |
[v1,1/1] mmc: core: Add HS400es support in retune and initialization flow
|
|
Commit Message
Mengqi Zhang
Dec. 1, 2023, 3:05 a.m. UTC
In HS400es mode, when we enter mmc_retune(), we will be forced to
the HS400 mode instead of HS400es mode. So we decided to add support
for HS400es in the mmc_retune() process.
Additionally, during the initialization to the HS400es stage, add
hs400 tuning as an optional process.
Signed-off-by: Mengqi Zhang <mengqi.zhang@mediatek.com>
---
drivers/mmc/core/host.c | 11 ++++++++++-
drivers/mmc/core/mmc.c | 10 +++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
Comments
On Fri, 1 Dec 2023 at 04:06, Mengqi Zhang <mengqi.zhang@mediatek.com> wrote: > > In HS400es mode, when we enter mmc_retune(), we will be forced to > the HS400 mode instead of HS400es mode. So we decided to add support > for HS400es in the mmc_retune() process. Hmm, I was under the impression that we really don't need to do re-tuning at all, when using HS400es mode. Are we calling mmc_retune_enable() from a place that we shouldn't? > > Additionally, during the initialization to the HS400es stage, add > hs400 tuning as an optional process. > > Signed-off-by: Mengqi Zhang <mengqi.zhang@mediatek.com> Kind regards Uffe > --- > drivers/mmc/core/host.c | 11 ++++++++++- > drivers/mmc/core/mmc.c | 10 +++++++++- > 2 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index 096093f7be00..4bddbbb3d539 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -179,7 +179,7 @@ EXPORT_SYMBOL(mmc_retune_release); > int mmc_retune(struct mmc_host *host) > { > bool return_to_hs400 = false; > - int err; > + int err = 0; > > if (host->retune_now) > host->retune_now = 0; > @@ -194,6 +194,15 @@ int mmc_retune(struct mmc_host *host) > host->doing_retune = 1; > > if (host->ios.timing == MMC_TIMING_MMC_HS400) { > + if (host->ios.enhanced_strobe) { > + if (host->ops->execute_hs400_tuning) { > + mmc_retune_disable(host); > + err = host->ops->execute_hs400_tuning(host, host->card); > + mmc_retune_enable(host); > + } > + goto out; > + } > + > err = mmc_hs400_to_hs200(host->card); > if (err) > goto out; > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 705942edacc6..9760eea2c104 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -1823,7 +1823,15 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, > if (err) > goto free_card; > > - } else if (!mmc_card_hs400es(card)) { > + } else if (mmc_card_hs400es(card)) { > + if (host->ops->execute_hs400_tuning) { > + mmc_retune_disable(host); > + err = host->ops->execute_hs400_tuning(host, card); > + mmc_retune_enable(host); > + if (err) > + goto free_card; > + } > + } else { > /* Select the desired bus width optionally */ > err = mmc_select_bus_width(card); > if (err > 0 && mmc_card_hs(card)) { > -- > 2.25.1 >
On Thu, 2023-12-07 at 14:37 +0100, Ulf Hansson wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > On Fri, 1 Dec 2023 at 04:06, Mengqi Zhang <mengqi.zhang@mediatek.com > > wrote: > > > > In HS400es mode, when we enter mmc_retune(), we will be forced to > > the HS400 mode instead of HS400es mode. So we decided to add > support > > for HS400es in the mmc_retune() process. > > Hmm, I was under the impression that we really don't need to do > re-tuning at all, when using HS400es mode. > > Are we calling mmc_retune_enable() from a place that we shouldn't? > > > > > Additionally, during the initialization to the HS400es stage, add > > hs400 tuning as an optional process. > > > > Signed-off-by: Mengqi Zhang <mengqi.zhang@mediatek.com> > > Kind regards > Uffe > Thanks for your review. I will follow your comment in next change. > > --- > > drivers/mmc/core/host.c | 11 ++++++++++- > > drivers/mmc/core/mmc.c | 10 +++++++++- > > 2 files changed, 19 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > > index 096093f7be00..4bddbbb3d539 100644 > > --- a/drivers/mmc/core/host.c > > +++ b/drivers/mmc/core/host.c > > @@ -179,7 +179,7 @@ EXPORT_SYMBOL(mmc_retune_release); > > int mmc_retune(struct mmc_host *host) > > { > > bool return_to_hs400 = false; > > - int err; > > + int err = 0; > > > > if (host->retune_now) > > host->retune_now = 0; > > @@ -194,6 +194,15 @@ int mmc_retune(struct mmc_host *host) > > host->doing_retune = 1; > > > > if (host->ios.timing == MMC_TIMING_MMC_HS400) { > > + if (host->ios.enhanced_strobe) { > > + if (host->ops->execute_hs400_tuning) { > > + mmc_retune_disable(host); > > + err = host->ops- > >execute_hs400_tuning(host, host->card); > > + mmc_retune_enable(host); > > + } > > + goto out; > > + } > > + > > err = mmc_hs400_to_hs200(host->card); > > if (err) > > goto out; > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > > index 705942edacc6..9760eea2c104 100644 > > --- a/drivers/mmc/core/mmc.c > > +++ b/drivers/mmc/core/mmc.c > > @@ -1823,7 +1823,15 @@ static int mmc_init_card(struct mmc_host > *host, u32 ocr, > > if (err) > > goto free_card; > > > > - } else if (!mmc_card_hs400es(card)) { > > + } else if (mmc_card_hs400es(card)) { > > + if (host->ops->execute_hs400_tuning) { > > + mmc_retune_disable(host); > > + err = host->ops->execute_hs400_tuning(host, > card); > > + mmc_retune_enable(host); > > + if (err) > > + goto free_card; > > + } > > + } else { > > /* Select the desired bus width optionally */ > > err = mmc_select_bus_width(card); > > if (err > 0 && mmc_card_hs(card)) { > > -- > > 2.25.1 > >
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 096093f7be00..4bddbbb3d539 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -179,7 +179,7 @@ EXPORT_SYMBOL(mmc_retune_release); int mmc_retune(struct mmc_host *host) { bool return_to_hs400 = false; - int err; + int err = 0; if (host->retune_now) host->retune_now = 0; @@ -194,6 +194,15 @@ int mmc_retune(struct mmc_host *host) host->doing_retune = 1; if (host->ios.timing == MMC_TIMING_MMC_HS400) { + if (host->ios.enhanced_strobe) { + if (host->ops->execute_hs400_tuning) { + mmc_retune_disable(host); + err = host->ops->execute_hs400_tuning(host, host->card); + mmc_retune_enable(host); + } + goto out; + } + err = mmc_hs400_to_hs200(host->card); if (err) goto out; diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 705942edacc6..9760eea2c104 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1823,7 +1823,15 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card; - } else if (!mmc_card_hs400es(card)) { + } else if (mmc_card_hs400es(card)) { + if (host->ops->execute_hs400_tuning) { + mmc_retune_disable(host); + err = host->ops->execute_hs400_tuning(host, card); + mmc_retune_enable(host); + if (err) + goto free_card; + } + } else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {