linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@codeaurora.org>
To: Shawn Lin <shawn.lin@rock-chips.com>,
	ulf.hansson@linaro.org, adrian.hunter@intel.com
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	stummala@codeaurora.org, georgi.djakov@linaro.org,
	linux-arm-msm@vger.kernel.org, pramod.gurav@linaro.org,
	jeremymc@redhat.com, venkatg@codeaurora.org,
	asutoshd@codeaurora.org
Subject: Re: [PATCH 2/4] mmc: mmc: Add change to set controller to HS400 frequency in enhanced strobe
Date: Tue, 20 Dec 2016 17:38:29 +0530	[thread overview]
Message-ID: <0db75984-bd05-5d63-91f0-e303e56d83d3@codeaurora.org> (raw)
In-Reply-To: <1419cbfe-5f37-f300-ca6e-7ee39c1d1e29@rock-chips.com>

Hi Shawn,

On 12/20/2016 4:33 PM, Shawn Lin wrote:
> On 2016/12/20 18:33, Ritesh Harjani wrote:
>> Hi Shawn,
>>
>> On 12/20/2016 12:59 PM, Shawn Lin wrote:
>>> On 2016/12/20 13:53, Ritesh Harjani wrote:
>>>> Currently mmc_select_hs400es is not setting the desired frequency
>>>> before sending switch command. This makes CMD13 to timeout on
>>>> some controllers.
>>>> Thus add a change to set the desired HS400 frequency
>>>> in mmc_select_hs400es when the timing is switched to HS400.
>>>
>>> What is the desired HS400 freq? I guess it is 200MHz, right?
>>>
>>> Well, per the spec, it just say "host *may* changes frequency to
>>> <= 200Mhz". So before setting timing to MMC_TIMING_MMC_HS400, we
>>> already reach ext_csd.hs_max_dtr. So it should meet the spec. If
>>> the fact that some controllers would see CMD13 timeout here, I guess
>>> you wouldn't let folks add max-frequency to the DT as if the max freq
>>> is set to just lower than your *desired HS400 freq* , it the same
>>> failure result even you add this patch, right?
>>>
>>> the root cause the controllers see failure for CMD13 is it didn't
>>> configure the right delay phase or something similar to fit the timing
>>> under the freq of hs_max_dtr, I guess.
>> Actually this may be limitation of sdhc msm controller that it cannot
>> work at lower frequency while in HS400 mode. I would have to see more on
>> this to confirm on why this limitation is there (mostly it was with some
>> DLL limitation).
>> In that case maybe I should not generalize this for other controllers.
>>
>>
>> But still the below code change to set the bus_speed after setting the
>> timing should be fine right ? Since host controller may as well change
>> the frequency to 200MHz.
>
> maybe not, I was guessing what would happend when folks add
> max-frequency = <100000000> as well as mmc-hs400-enhanced-strobe in
> the DT? It won't work for your case. So the question is how you would
> make that case work?
>
>>
>> Do you think the below change is fine in this sense? I can change the
>> commit message to just -
>> "set both timing mode and frequency before sending CMD13 in
>> mmc_select_hs400es."
>>
>> Or do you see any other approach to this ?
>>
>
> I haven't had clear thought about how to deal with it but
> I guess you are not alone for this case maybe. Now there
> will be more and more mmc controllers using PHY or DLL and
> some more special limitions is ineluctable, so we need to
> discuss a more general/legit way to make it work.
>
> Your patch is a good begin to open this topic. :)
> I would like to hear some input from Ulf and Adian.
I see there is a miss from my side here. Although there is still some 
limitation on msm host controller which I cannot recollect. But for this 
case we can get it done by configuring the DLL properly.

I missed that particular check of clock >= 100MHz in 
sdhci_msm_set_uhs_signaling which configures the DLL.


I guess if I could use the host->mmc_host_ops.hs400_enhanced_strobe ops 
and provide a callback to configure the DLL without any restriction on 
clock frequency, then this can be worked out.

I will check more on this and get back. Thanks for your inputs.

Regards
Ritesh




>
>>
>> Regards
>> Ritesh
>>
>>>
>>>>
>>>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>>>> ---
>>>>  drivers/mmc/core/mmc.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>> index b61b52f9..eb69497 100644
>>>> --- a/drivers/mmc/core/mmc.c
>>>> +++ b/drivers/mmc/core/mmc.c
>>>> @@ -1329,6 +1329,7 @@ static int mmc_select_hs400es(struct mmc_card
>>>> *card)
>>>>
>>>>      /* Set host controller to HS400 timing and frequency */
>>>>      mmc_set_timing(host, MMC_TIMING_MMC_HS400);
>>>> +    mmc_set_bus_speed(card);
>>>>
>>>>      /* Controller enable enhanced strobe function */
>>>>      host->ios.enhanced_strobe = true;
>>>>
>>>
>>>
>>
>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-12-20 12:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20  5:53 [PATCH 0/4] mmc: Provide enhanced strobe support for sdhci-msm Ritesh Harjani
2016-12-20  5:53 ` [PATCH 1/4] mmc: core: Return from mmc_set_clock if hz is already set to ios.clock Ritesh Harjani
2016-12-20  5:53 ` [PATCH 2/4] mmc: mmc: Add change to set controller to HS400 frequency in enhanced strobe Ritesh Harjani
2016-12-20  7:29   ` Shawn Lin
2016-12-20 10:33     ` Ritesh Harjani
2016-12-20 11:03       ` Shawn Lin
2016-12-20 12:08         ` Ritesh Harjani [this message]
2016-12-20  5:53 ` [PATCH 3/4] mmc: mmc: enable ios.enhanced_strobe before mmc_set_timing Ritesh Harjani
2016-12-23  9:18   ` Ritesh Harjani
2016-12-26  7:12     ` Shawn Lin
2016-12-20  5:53 ` [PATCH 4/4] mmc: sdhci-msm: provide enhanced_strobe mode feature support Ritesh Harjani

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=0db75984-bd05-5d63-91f0-e303e56d83d3@codeaurora.org \
    --to=riteshh@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=asutoshd@codeaurora.org \
    --cc=georgi.djakov@linaro.org \
    --cc=jeremymc@redhat.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=pramod.gurav@linaro.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=stummala@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    --cc=venkatg@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).