All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Ludovic Barre <ludovic.barre@st.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Patrice Chotard <patrice.chotard@st.com>,
	Patrick Delaunay <patrick.delaunay@st.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH] mmc: mmci: Only call .post_sig_volt_switch if voltage switch happened
Date: Tue, 31 Mar 2020 23:01:44 +0200	[thread overview]
Message-ID: <7a7c0180-0a11-17b2-7815-b18b1ca11120@denx.de> (raw)
In-Reply-To: <CAPDyKFrypbDEuDaGWySjC6j_qKbXpVHoubhh8e9jS24JSzBg3Q@mail.gmail.com>

On 3/31/20 8:53 PM, Ulf Hansson wrote:
> On Tue, 31 Mar 2020 at 17:53, Marek Vasut <marex@denx.de> wrote:
>>
>> Call the post voltage switch handler only if the voltage switch actually
>> happened. It is well possible that the regulator is already set correctly
>> and no voltage switch happened, so there is no need to take any further
>> action.
>>
>> This fixes a real issue on STM32MP1 where, if the eMMC is supplied with
>> VccQ=1.8 V, the post voltage switch code will spin indefinitelly waiting
>> for the voltage switch to complete, even though no voltage switch really
>> happened.
> 
> Whether this is a common problem or not, I think in a first step we
> should manage this in the common mmc_regulator_set_vqmmc().

I can pass in a variable which would be set if a voltage switch actually
happened in mmc_regulator_set_vqmmc() OR I can return a code > 0 from
there. Which one do you prefer?

Then I guess we can add something like

if (regulator_get_voltage(...vqmmc) is already in voltage range)
 return 1;

...

and the MMCI driver would do something like

if (mmc_regulator_set_vqmmc(...) > 0)
 host->ops->post_sig_volt_switch(...);

That looks OK I guess ?

> Then on top of that, convert mmci into using the mmc_regulator_set_vqmmc() API.
> 
> Can please try this approach instead?
Sure. Does the above look sane ?

[...]

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2020-03-31 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 15:52 [PATCH] mmc: mmci: Only call .post_sig_volt_switch if voltage switch happened Marek Vasut
2020-03-31 18:53 ` Ulf Hansson
2020-03-31 21:01   ` Marek Vasut [this message]
2020-04-01  8:16     ` Ulf Hansson
2020-04-01 19:59       ` Marek Vasut

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=7a7c0180-0a11-17b2-7815-b18b1ca11120@denx.de \
    --to=marex@denx.de \
    --cc=alexandre.torgue@st.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.barre@st.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=patrice.chotard@st.com \
    --cc=patrick.delaunay@st.com \
    --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.