From: Mark Brown <broonie@kernel.org>
To: Haibo Chen <haibo.chen@nxp.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Bjorn Andersson <bjorn@kryo.se>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Javier Martinez Canillas <javier@osg.samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 2/2] regulator: core: Ensure we are at least in bounds for our constraints
Date: Wed, 30 Mar 2016 08:25:00 -0700 [thread overview]
Message-ID: <20160330152500.GU2350@sirena.org.uk> (raw)
In-Reply-To: <HE1PR0401MB180138D15E4D2101330543DC90980@HE1PR0401MB1801.eurprd04.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 3283 bytes --]
On Wed, Mar 30, 2016 at 09:07:21AM +0000, Haibo Chen wrote:
Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns. Doing this makes your messages much
easier to read and reply to.
> In our sdhci.c, we call the function
> regulator_set_voltage ---> regulator_set_voltage_unlocked(struct regulator *regulator, int min_uV, int max_uV)
> here, the parameter min_uV is 3300000, and the max_uV is 3400000
>
> currently with your patch (the upper operator is &&), when insert a SD3.0 card,
> it will do the sanity check, and return -EINVAL
> but when I change the upper operator from && to !=,
> before the sanity check, it will first get the current_uV, and then go to out.
>
> I'm not familiar with regulator common code. Hope the upper describe can help you debug this issue.
No, that's not helping clarify anything. To repeat what I said to Geert
this patch changes code that is only called when the regulator is
probed. This means that the changed code is not running when the SDHCI
code is running. You need to investigate what exactly is causing the
error.
Just randomly thrashing around with a separate bit of code with no
coharent explanation for what you think is happening is not helping
here, we need some analysis of what is going on. The change you are
both proposing is guaranteed to break other boards since it means that
the case we supported originally where we set a specific voltage that is
specified by setting equal minimum and maximum constraints is no longer
going have the voltage applied.
Having taken another look I *suspect* that the SDHCI code is broken in
the way it enumerates the set of voltages that can be set and that this
will probably trigger in other situations where the set of voltages that
can be set is limited but I can't put my finger on it, someone with the
ability to run the code will need to investigate.
The following patch *might* help the SDHCI but I'm just guessing and
like I say it looks like this is flagging up a problem in the SDHCI
code.
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index f45106a44635..cd828dbf9d52 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -43,10 +43,12 @@ static void of_get_regulation_constraints(struct device_node *np,
constraints->max_uV = pval;
/* Voltage change possible? */
- if (constraints->min_uV && constraints->max_uV) {
+ if (constraints->min_uV != constraints->max_uV)
constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
+
+ /* Do we have a voltage range, if so try to apply it? */
+ if (constraints->min_uV && constraints->max_uV)
constraints->apply_uV = true;
- }
if (!of_property_read_u32(np, "regulator-microvolt-offset", &pval))
constraints->uV_offset = pval;
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Mark Brown
Please don't top post, reply in line with needed context. This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-03-30 15:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1458587912-32665-1-git-send-email-broonie@kernel.org>
[not found] ` <1458587912-32665-2-git-send-email-broonie@kernel.org>
[not found] ` <56F0624C.8010004@gmail.com>
2016-03-24 6:11 ` [PATCH 2/2] regulator: core: Ensure we are at least in bounds for our constraints Krzysztof Kozlowski
2016-03-24 7:18 ` Krzysztof Kozlowski
2016-03-26 23:50 ` Bjorn Andersson
2016-03-27 9:08 ` Mark Brown
2016-03-28 16:16 ` Bjorn Andersson
2016-03-29 12:00 ` Geert Uytterhoeven
2016-03-29 14:58 ` Mark Brown
2016-03-29 18:05 ` Geert Uytterhoeven
2016-03-29 18:27 ` Mark Brown
2016-03-30 9:07 ` Haibo Chen
2016-03-30 15:25 ` Mark Brown [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=20160330152500.GU2350@sirena.org.uk \
--to=broonie@kernel.org \
--cc=bjorn@kryo.se \
--cc=geert@linux-m68k.org \
--cc=haibo.chen@nxp.com \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=javier@osg.samsung.com \
--cc=k.kozlowski@samsung.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox