[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB5PR04MB1431F575508A7AD0EE0E2B9980030@DB5PR04MB1431.eurprd04.prod.outlook.com>
Date: Wed, 12 Apr 2017 15:33:14 +0000
From: "A.S. Dong" <aisheng.dong@....com>
To: Mark Brown <broonie@...nel.org>
CC: Liam Girdwood <lgirdwood@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
Robin Gong <yibin.gong@....com>,
"dongas86@...il.com" <dongas86@...il.com>
Subject: RE: [PATCH] regulator: core: Allow dummy regulators for supplies
Hi Mark,
> -----Original Message-----
> From: Mark Brown [mailto:broonie@...nel.org]
> Sent: Wednesday, April 12, 2017 4:37 AM
> To: A.S. Dong
> Cc: Liam Girdwood; linux-kernel@...r.kernel.org; shawnguo@...nel.org;
> Robin Gong
> Subject: Re: [PATCH] regulator: core: Allow dummy regulators for supplies
>
> On Tue, Apr 11, 2017 at 09:34:37PM +0100, Mark Brown wrote:
> > Rather than just not resolving the supply when there is explicitly no
> > supply mapping fall through and allow a dummy supply to be substituted.
>
> I should mention that this is completely untested, sorry.
It did break the MX6Q cpufreq as follows:
[ 3.950097] coda 2040000.vpu: Direct firmware load for vpu/vpu_fw_imx6q.bin failed with error -2
[ 3.950111] coda 2040000.vpu: firmware request failed
[ 4.074044] cpu cpu0: failed to scale vddarm down: -22
[ 4.079262] cpu cpu0: failed to scale vddsoc down: -22
[ 4.084809] cpu cpu0: failed to scale vddpu down: -22
It seems the regulator supply behavior is changed a bit after apply this patch.
Before this patch, the regulator core will not report an error if can't resolve
A non exist supply. (It's exactly what this patch removes)
Now we allow a supply to be a dummy regulator. But due to
fc42112c0eaa ("regulator: core: Propagate voltage changes to supply regulators")
which supports propagate voltage change to supply regulator,
then it will certainly fail if we want to configure a dummy supply.
I tried a quick fix as follows and test seemed ok.
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 43dafac..a1c952db 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2935,7 +2935,8 @@ static int regulator_set_voltage_unlocked(struct regulator *regulator,
if (ret < 0)
goto out2;
- if (rdev->supply && (rdev->desc->min_dropout_uV ||
+ if (rdev->supply && rdev->supply->rdev != dummy_regulator_rdev &&
+ (rdev->desc->min_dropout_uV ||
Not sure if it's a sufficient fix.
Please help check it.
Regards
Dong Aisheng
Powered by blists - more mailing lists