Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: "Mengqi Zhang (张梦琦)" <Mengqi.Zhang@mediatek.com>
To: "ulf.hansson@linaro.org" <ulf.hansson@linaro.org>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"Wenbin Mei (梅文彬)" <Wenbin.Mei@mediatek.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"vincent.whitchurch@axis.com" <vincent.whitchurch@axis.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"yangyingliang@huawei.com" <yangyingliang@huawei.com>
Subject: Re: [v1,1/1] mmc: core: Add HS400es support in retune and initialization flow
Date: Thu, 21 Dec 2023 09:00:51 +0000	[thread overview]
Message-ID: <62ea1a73aab2d58fb0ca610cc92db9e18920f022.camel@mediatek.com> (raw)
In-Reply-To: <CAPDyKFqhGULWp3P2EpxUMLvdiijqu7qxPrY40GU2m3FM7XVCVQ@mail.gmail.com>

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
> >

      reply	other threads:[~2023-12-21  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  3:05 [v1,1/1] mmc: core: Add HS400es support in retune and initialization flow Mengqi Zhang
2023-12-07 13:37 ` Ulf Hansson
2023-12-21  9:00   ` Mengqi Zhang (张梦琦) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62ea1a73aab2d58fb0ca610cc92db9e18920f022.camel@mediatek.com \
    --to=mengqi.zhang@mediatek.com \
    --cc=Chaotian.Jing@mediatek.com \
    --cc=Wenbin.Mei@mediatek.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.whitchurch@axis.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox