All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ben Chuang <benchuanggli@gmail.com>,
	ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw,
	greg.tu@genesyslogic.com.tw
Subject: Re: [RFC PATCH V3 13/21] mmc: sdhci: UHS-II support, skip signal_voltage_switch()
Date: Wed, 16 Sep 2020 15:24:12 +0900	[thread overview]
Message-ID: <20200916062412.GA2972302@laputa> (raw)
In-Reply-To: <bd394015-abb7-f134-c883-ec28b42f1fc5@intel.com>

On Wed, Sep 16, 2020 at 09:01:20AM +0300, Adrian Hunter wrote:
> On 15/09/20 9:03 am, AKASHI Takahiro wrote:
> > Ben, Adrian,
> > 
> > On Mon, Sep 14, 2020 at 11:08:14AM +0300, Adrian Hunter wrote:
> >> On 14/09/20 9:40 am, AKASHI Takahiro wrote:
> >>> Adrian,
> >>>
> >>> On Fri, Aug 21, 2020 at 05:09:01PM +0300, Adrian Hunter wrote:
> >>>> On 10/07/20 2:11 pm, Ben Chuang wrote:
> >>>>> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >>>>>
> >>>>> sdhci_start_signal_voltage_switch() should be called only in UHS-I mode,
> >>>>> and not for UHS-II mode.
> >>>>>
> >>>>> Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
> >>>>> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >>>>> ---
> >>>>>  drivers/mmc/host/sdhci.c | 7 ++++++-
> >>>>>  1 file changed, 6 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> >>>>> index 5511649946b9..7f2537648a08 100644
> >>>>> --- a/drivers/mmc/host/sdhci.c
> >>>>> +++ b/drivers/mmc/host/sdhci.c
> >>>>> @@ -2623,8 +2623,13 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
> >>>>>  	/*
> >>>>>  	 * Signal Voltage Switching is only applicable for Host Controllers
> >>>>>  	 * v3.00 and above.
> >>>>> +	 * But for UHS2, the signal voltage is supplied by vdd2 which is
> >>>>> +	 * already 1.8v so no voltage switch required.
> >>>>>  	 */
> >>>>> -	if (host->version < SDHCI_SPEC_300)
> >>>>> +	if (host->version < SDHCI_SPEC_300 ||
> >>>>> +	    (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&
> >>>>> +	     host->version >= SDHCI_SPEC_400 &&
> >>>>> +	     host->mmc->flags & MMC_UHS2_SUPPORT))
> >>>> Please look at hooking ->start_signal_voltage_switch() instead
> >>>
> >>> Do you mean that you want every platform driver who wants to support UHS-II
> >>> to set NULL to start_signal_voltage_switch hook even if this hack is
> >>> platform agnostic?
> >>
> >> No, I see UHS-II as a separate layer i.e.
> >>
> >>  UHS-II host controller driver
> >>   |   |
> >>   |   v
> >>   |   sdhci-uhs2 e.g. sdhci_uhs2_start_signal_voltage_switch
> >>   |   |
> >>   v   v
> >>   sdhci e.g. sdhci_start_signal_voltage_switch
> >>
> >> Most things should go through sdhci-uhs2 but not nessarily everything.
> > 
> > What I meant by my previous comment is that we don't have to
> > call any function, sdhci_uhs2_start_signal_voltage_switch in above example,
> > for UHS-II cards in any case since it is always simply empty.
> 
> Please treat the sdhci_uhs2_... host ops as functions for a UHS-II host
> controller in either UHS-II or legacy mode. i.e. it is up to sdhci-uhs2.c to
> call through to sdhci.c not the other way around.  e.g.
>
> int sdhci_uhs2_start_signal_voltage_switch(blah)
> {
> 	if (sdhci_uhs2_mode(host))
> 		return 0;
> 	return sdhci_start_signal_valtage_switch(blah);
> }

Okay, the remaining issue is to clarify the meaning of MMC_UHS2_SUPPORT.

-Takhiro Akashi

      parent reply	other threads:[~2020-09-16  6:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 11:11 [RFC PATCH V3 13/21] mmc: sdhci: UHS-II support, skip signal_voltage_switch() Ben Chuang
2020-08-21 14:09 ` Adrian Hunter
2020-09-14  6:40   ` AKASHI Takahiro
2020-09-14  8:08     ` Adrian Hunter
2020-09-15  6:03       ` AKASHI Takahiro
2020-09-15 11:36         ` Ben Chuang
2020-09-16  0:52           ` AKASHI Takahiro
2020-09-16  9:42             ` Ben Chuang
2020-09-17  0:56               ` AKASHI Takahiro
2020-09-17 10:52                 ` Ben Chuang
     [not found]         ` <bd394015-abb7-f134-c883-ec28b42f1fc5@intel.com>
2020-09-16  6:24           ` AKASHI Takahiro [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=20200916062412.GA2972302@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=ben.chuang@genesyslogic.com.tw \
    --cc=benchuanggli@gmail.com \
    --cc=greg.tu@genesyslogic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.