From: Adrian Hunter <adrian.hunter@intel.com>
To: Ziji Hu <huziji@marvell.com>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org
Cc: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
linux-arm-kernel@lists.infradead.org,
"Jack(SH) Zhu" <jmzhu@marvell.com>, Jimmy Xu <zmxu@marvell.com>,
Jisheng Zhang <jszhang@marvell.com>,
Nadav Haklai <nadavh@marvell.com>, Ryan Gao <ygao@marvell.com>,
Doug Jones <dougj@marvell.com>,
Shiwu Zhang <zhangshw@marvell.com>, Victor Gu <xigu@marvell.com>,
"Wei(SOCP) Liu" <liuw@marvell.com>,
Wilson Ding <dingwei@marvell.com>,
Xueping Liu <xpliu@marvell.com>,
Hilbert Zhang <zzhang@marvell.com>,
Liuliu Zhao <zhaoliul@marvell.com>,
Peng Zhu <zhupeng@marvell.com>, Yu Cao <yucao@marvell.com>,
Romain Perier <romain.perier@free-electrons.com>,
Yehuda Yitschak <yehuday@marvell.com>,
Marcin Wojtas <mw@semihalf.com>, Hanna Hawa <hannah@marvell.com>,
Kostya Porotchkin <kostap@marvell.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC
Date: Tue, 18 Oct 2016 16:09:14 +0300 [thread overview]
Message-ID: <d63c5272-9085-d54f-e827-ca6b9b324aab@intel.com> (raw)
In-Reply-To: <d6e1c702-1dfe-3993-da28-01cf01f24b4a@marvell.com>
On 18/10/16 15:04, Ziji Hu wrote:
> Hi Adrian,
>
> On 2016/10/17 15:55, Adrian Hunter wrote:
>> On 12/10/16 15:17, Ziji Hu wrote:
>>> Hi Adrian,
>>>
>>> On 2016/10/11 20:39, Adrian Hunter wrote:
> <snip>
>>>>> +static int __xenon_emmc_delay_adj_test(struct mmc_card *card)
>>>>> +{
>>>>> + int err;
>>>>> + u8 *ext_csd = NULL;
>>>>> +
>>>>> + err = mmc_get_ext_csd(card, &ext_csd);
>>>>> + kfree(ext_csd);
>>>>> +
>>>>> + return err;
>>>>> +}
>>>>> +
>>>>> +static int __xenon_sdio_delay_adj_test(struct mmc_card *card)
>>>>> +{
>>>>> + struct mmc_command cmd = {0};
>>>>> + int err;
>>>>> +
>>>>> + cmd.opcode = SD_IO_RW_DIRECT;
>>>>> + cmd.flags = MMC_RSP_R5 | MMC_CMD_AC;
>>>>> +
>>>>> + err = mmc_wait_for_cmd(card->host, &cmd, 0);
>>>>> + if (err)
>>>>> + return err;
>>>>> +
>>>>> + if (cmd.resp[0] & R5_ERROR)
>>>>> + return -EIO;
>>>>> + if (cmd.resp[0] & R5_FUNCTION_NUMBER)
>>>>> + return -EINVAL;
>>>>> + if (cmd.resp[0] & R5_OUT_OF_RANGE)
>>>>> + return -ERANGE;
>>>>> + return 0;
>>>>> +}
>>>>> +
>>>>> +static int __xenon_sd_delay_adj_test(struct mmc_card *card)
>>>>> +{
>>>>> + struct mmc_command cmd = {0};
>>>>> + int err;
>>>>> +
>>>>> + cmd.opcode = MMC_SEND_STATUS;
>>>>> + cmd.arg = card->rca << 16;
>>>>> + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
>>>>> +
>>>>> + err = mmc_wait_for_cmd(card->host, &cmd, 0);
>>>>> + return err;
>>>>> +}
>>>>> +
>>>>> +static int xenon_delay_adj_test(struct mmc_card *card)
>>>>> +{
>>>>> + WARN_ON(!card);
>>>>> + WARN_ON(!card->host);
>>>>> +
>>>>> + if (mmc_card_mmc(card))
>>>>> + return __xenon_emmc_delay_adj_test(card);
>>>>> + else if (mmc_card_sd(card))
>>>>> + return __xenon_sd_delay_adj_test(card);
>>>>> + else if (mmc_card_sdio(card))
>>>>> + return __xenon_sdio_delay_adj_test(card);
>>>>> + else
>>>>> + return -EINVAL;
>>>>> +}
>>>>
>>>> So you are issuing commands from the ->set_ios() callback. I would want to
>>>> get Ulf's OK for that before going further.
>>>>
>>> Yes, you are correct.
>>> In some speed mode, Xenon SDHC has to send a series of transfers to search for a perfect sampling point in PHY delay line.
>>> It is like tuning process.
>>>
>>>> One thing: you will need to ensure you don't trigger get HS400 re-tuning
>>>> because it will call back into ->set_ios().
>>>>
>>> Could you please make the term "HS400 re-tuning" more detailed?
>>> In current MMC driver, "HS400 re-tuning" will go back to HS200, execute HS200 tuning and come back to HS400.
>>> I'm sure our Xenon SDHC will not execute it.
>>
>> Currently, re-tuning is automatically enabled whenever tuning is executed,
>> and then re-tuning will be done periodically or after CRC errors. The
>> function to disable re-tuning mmc_retune_disable() is not exported, however
>> if you have you are determining the sampling point your own way, you could
>> simply not implement ->execute_tuning() and then there would be no tuning
>> and no re-tuning.
>>
>
> It is a little complex in our Xenon SDHC.
> For the speed mode which requests tuning, such as SDR104 and HS200, our driver will execute standard tuning as spec requires.
> However, for those speed mode in which tuning is not requested in spec, our driver has to issues commands to search for the best sampling point.
>
> It seems that HS400 re-tuning/tuning is disabled by default. Is it correct?
No, it is enabled by default - there is currently no periodic re-tuning for
HS400 but CRC errors or runtime suspend / resume will cause re-tuning.
>
>>>
>>> However, in coming eMMC 5.2, there is a real HS400 re-tuning, in which tuning can be directly executed in HS400 mode.
>>> Our Xenon SDHC will neither trigger this HS400 re-tuning.
>>> But since so far there is no such feature in MMC driver, I cannot give you a 100% guarantee now.
>>>
>>>> And you have the problem that you need to get a reference to the card before
>>>> the card device has been added. As I wrote in response to the previous
>>>> patch, you should get Ulf's help with that too.
>>>>
>>> Sure.
>>> I will get card_candidate solved at first.
>>> Thank you again for your review and help.
>>>
>>> Thank you.
>>>
>>> Best regards,
>>> Hu Ziji
>>>>
>>>
>>
>
next prev parent reply other threads:[~2016-10-18 13:14 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 15:22 [PATCH 0/10] mmc: Add support to Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 1/10] mmc: sdhci: Export sdhci_set_ios() from sdhci.c Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 2/10] mmc: sdhci: Export sdhci_start_signal_voltage_switch() in sdhci.c Gregory CLEMENT
2016-10-08 2:40 ` Shawn Lin
2016-10-08 6:26 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 3/10] mmc: sdhci: Export sdhci_execute_tuning() " Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 4/10] MAINTAINERS: add entry for Marvell Xenon MMC Host Controller drivers Gregory CLEMENT
2016-10-07 20:44 ` Joe Perches
2016-10-08 0:59 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 5/10] dt: bindings: Add bindings for Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-10 21:34 ` Rob Herring
2016-10-11 10:03 ` Ziji Hu
2016-10-18 13:29 ` Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 6/10] mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality Gregory CLEMENT
2016-10-11 12:37 ` Adrian Hunter
2016-10-12 11:58 ` Ziji Hu
2016-10-12 13:07 ` Adrian Hunter
2016-10-13 5:38 ` Ziji Hu
2016-10-17 8:14 ` Adrian Hunter
2016-10-18 12:09 ` Ziji Hu
2016-10-07 15:22 ` [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC Gregory CLEMENT
2016-10-08 2:44 ` Shawn Lin
2016-10-08 9:28 ` Ziji Hu
2016-10-09 13:34 ` Shawn Lin
2016-10-11 12:39 ` Adrian Hunter
2016-10-12 12:17 ` Ziji Hu
2016-10-17 7:55 ` Adrian Hunter
2016-10-18 12:04 ` Ziji Hu
2016-10-18 13:09 ` Adrian Hunter [this message]
2016-10-07 15:22 ` [PATCH 8/10] arm64: dts: marvell: add eMMC support for Armada 37xx Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 9/10] arm64: dts: marvell: add sdhci support for Armada 7K/8K Gregory CLEMENT
2016-10-07 15:22 ` [PATCH 10/10] arm64: configs: enable SDHCI driver for Xenon Gregory CLEMENT
2016-10-31 11:09 [PATCH 0/10] mmc: Add support to Marvell Xenon SD Host Controller Gregory CLEMENT
2016-10-31 11:09 ` [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC Gregory CLEMENT
2016-11-24 9:56 ` Arnd Bergmann
2016-11-24 10:57 ` Ziji Hu
2016-11-24 11:09 ` Arnd Bergmann
2016-11-24 11:37 ` Ulf Hansson
2016-11-24 13:34 ` Ziji Hu
2016-11-24 14:33 ` Ulf Hansson
2016-11-24 15:37 ` Ziji Hu
2016-11-28 10:10 ` Ziji Hu
2016-11-28 11:13 ` Ulf Hansson
2016-11-28 11:38 ` Ziji Hu
2016-11-28 15:16 ` Ulf Hansson
2016-11-29 2:53 ` Ziji Hu
2016-11-29 7:49 ` Ulf Hansson
2016-11-29 10:33 ` Ziji Hu
2016-11-29 11:11 ` Ulf Hansson
2016-11-29 12:00 ` Ziji Hu
2016-11-28 11:09 ` Ulf Hansson
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=d63c5272-9085-d54f-e827-ca6b9b324aab@intel.com \
--to=adrian.hunter@intel.com \
--cc=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=dingwei@marvell.com \
--cc=dougj@marvell.com \
--cc=gregory.clement@free-electrons.com \
--cc=hannah@marvell.com \
--cc=huziji@marvell.com \
--cc=jason@lakedaemon.net \
--cc=jmzhu@marvell.com \
--cc=jszhang@marvell.com \
--cc=kostap@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=liuw@marvell.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=robh+dt@kernel.org \
--cc=romain.perier@free-electrons.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
--cc=xigu@marvell.com \
--cc=xpliu@marvell.com \
--cc=yehuday@marvell.com \
--cc=ygao@marvell.com \
--cc=yucao@marvell.com \
--cc=zhangshw@marvell.com \
--cc=zhaoliul@marvell.com \
--cc=zhupeng@marvell.com \
--cc=zmxu@marvell.com \
--cc=zzhang@marvell.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;
as well as URLs for NNTP newsgroup(s).