From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753872AbdDLPdV (ORCPT ); Wed, 12 Apr 2017 11:33:21 -0400 Received: from mail-ve1eur01on0042.outbound.protection.outlook.com ([104.47.1.42]:28042 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752286AbdDLPdT (ORCPT ); Wed, 12 Apr 2017 11:33:19 -0400 From: "A.S. Dong" To: Mark Brown CC: Liam Girdwood , "linux-kernel@vger.kernel.org" , "shawnguo@kernel.org" , Robin Gong , "dongas86@gmail.com" Subject: RE: [PATCH] regulator: core: Allow dummy regulators for supplies Thread-Topic: [PATCH] regulator: core: Allow dummy regulators for supplies Thread-Index: AQHSswMRisT2E7Rh50SB8qjoCHi2taHAoJoAgAE41HA= Date: Wed, 12 Apr 2017 15:33:14 +0000 Message-ID: References: <20170411203437.28572-1-broonie@kernel.org> <20170411203636.qyxm4e2pwd4cwl2i@sirena.org.uk> In-Reply-To: <20170411203636.qyxm4e2pwd4cwl2i@sirena.org.uk> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [199.59.231.64] x-microsoft-exchange-diagnostics: 1;AM5PR0401MB2436;7:D23v8ml1rHgVRxEzMhiYKm8zCJ7v6w1VS1TbtixosKeJ0t1tmWbzYTAwnEUbnpr1jQwaqhzGLcKfVe5yYUzteGrCzAdytWFIpJQAq6y9w0gjz44PJj5lKMXEVcxb4RoWl0wKkB34T5lv7F5bsQbRIAwI9gmgUSpZRpYLaXymRkFdpqVr8ymkolvDkiNO7S4HxbacFutOLcIkt8n4Se6LC2Y5jtMv4THaaQBW4UJmTSeK1m2W+YHRXF30n2ljF52fSF9K+lLsMF3Xlqv9FYi9Jos730BotOIPMJKrBhbDGmAMG1RP9TOK0mFbyz2P9ZULaFWvQL4Oil23EvXq02NDeg== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39840400002)(39410400002)(39860400002)(39400400002)(39850400002)(13464003)(377454003)(24454002)(7696004)(86362001)(575784001)(53546009)(25786009)(6246003)(2900100001)(6916009)(6506006)(6436002)(102836003)(9686003)(54906002)(3846002)(55016002)(99286003)(229853002)(6116002)(8936002)(2950100002)(50986999)(305945005)(74316002)(81166006)(4326008)(7736002)(54356999)(3660700001)(8676002)(66066001)(76176999)(110136004)(38730400002)(39060400002)(2906002)(5250100002)(5660300001)(53936002)(3280700002)(189998001)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0401MB2436;H:DB5PR04MB1431.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; x-ms-office365-filtering-correlation-id: 7f469c56-902f-42ac-d637-08d481b93c61 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:AM5PR0401MB2436; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:AM5PR0401MB2436;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0401MB2436; x-forefront-prvs: 027578BB13 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2017 15:33:14.5267 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2436 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3CFXVPF026536 Hi Mark, > -----Original Message----- > From: Mark Brown [mailto:broonie@kernel.org] > Sent: Wednesday, April 12, 2017 4:37 AM > To: A.S. Dong > Cc: Liam Girdwood; linux-kernel@vger.kernel.org; shawnguo@kernel.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