From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Zhoujie Wu <zjwu@marvell.com>,
ulf.hansson@linaro.org, adrian.hunter@intel.com
Cc: linux-mmc@vger.kernel.org, zmxu@marvell.com, jszhang@marvell.com,
nadavh@marvell.com, xigu@marvell.com, dingwei@marvell.com,
kostap@marvell.com, hannah@marvell.com, hongd@marvell.com,
dougj@marvell.com, ygao@marvell.com, liuw@marvell.com,
thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH] mmc: sdhci: ignore 3.3v voltage switch if ios.vdd is 0
Date: Wed, 02 Aug 2017 09:36:56 +0200 [thread overview]
Message-ID: <877eymbeuf.fsf@free-electrons.com> (raw)
In-Reply-To: <1501631901-1304-1-git-send-email-zjwu@marvell.com> (Zhoujie Wu's message of "Tue, 1 Aug 2017 16:58:21 -0700")
Hi Zhoujie, Adrian and Ulf,
On mar., août 01 2017, Zhoujie Wu <zjwu@marvell.com> wrote:
> One issue was found on a removable high speed sd card with
> runtime pm enabled.
> When SD card is unplugged, it keep printing "Switching to 3.3V
> signalling voltage failed".
> And found below sequence triggers the error.
>
> mmc_rescan
> -> mmc_sd_detect
> -> mmc_power_off -- mmc->ios.vdd is update to 0.
> -> mmc_claim_host
> -> sdhci_runtime_resume_host
> -> sdhci_start_signal_voltage_switch
> -> mmc_regulator_set_vqmmc
> -> mmc_ocrbitnum_to_vdd
>
> When mmc_ocrbitnum_to_vdd is called, the mmc->ios.vdd is 0, so it
> always return -EINVAL. The signal switch will always fail and
> print out warning.
>
> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> ---
> Hi Ulf,
> Not sure if this is the best way to fix it. Please help to
> suggest. Thanks.
I don't know if there is a link, but I observed that when the kernel
boot with an UHS SD Card plugged (and after a warm reset) then the bus
speed is only "High Speed". Whereas if I plugged it while the kernel is
running the "Ultra " speed is detected.
I observed that with the sdhci-xenon driver, but I don't have any other
UHS capable controller available to compare it and to know if it is
something at sdhci level or at xenon level.
Thanks,
Gregory
>
> drivers/mmc/host/sdhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index ecd0d43..011ebbe 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1878,7 +1878,7 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
> ctrl &= ~SDHCI_CTRL_VDD_180;
> sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
>
> - if (!IS_ERR(mmc->supply.vqmmc)) {
> + if ((!IS_ERR(mmc->supply.vqmmc)) && mmc->ios.vdd) {
> ret = mmc_regulator_set_vqmmc(mmc, ios);
> if (ret) {
> pr_warn("%s: Switching to 3.3V signalling voltage failed\n",
> --
> 1.9.1
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2017-08-02 7:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 23:58 [PATCH] mmc: sdhci: ignore 3.3v voltage switch if ios.vdd is 0 Zhoujie Wu
2017-08-02 7:28 ` Adrian Hunter
2017-08-02 23:12 ` Zhoujie Wu
2017-08-02 7:36 ` Gregory CLEMENT [this message]
2017-08-02 22:33 ` Zhoujie Wu
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=877eymbeuf.fsf@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=adrian.hunter@intel.com \
--cc=dingwei@marvell.com \
--cc=dougj@marvell.com \
--cc=hannah@marvell.com \
--cc=hongd@marvell.com \
--cc=jszhang@marvell.com \
--cc=kostap@marvell.com \
--cc=linux-mmc@vger.kernel.org \
--cc=liuw@marvell.com \
--cc=nadavh@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
--cc=xigu@marvell.com \
--cc=ygao@marvell.com \
--cc=zjwu@marvell.com \
--cc=zmxu@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 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.