Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754180AbdFNByh (ORCPT ); Tue, 13 Jun 2017 21:54:37 -0400 Received: from mail-dm3nam03on0089.outbound.protection.outlook.com ([104.47.41.89]:50345 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754147AbdFNByc (ORCPT ); Tue, 13 Jun 2017 21:54:32 -0400 Authentication-Results: spf=softfail (sender IP is 192.88.168.50) smtp.mailfrom=gmail.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=gmail.com; Date: Wed, 14 Jun 2017 09:53:39 +0800 From: Peter Chen To: Ulf Hansson CC: Peter Chen , Mark Rutland , Heiko Stuebner , Stephen Boyd , , "linux-kernel@vger.kernel.org" , Gary Bisson , Fabio Estevam , Joshua Clayton , Arnd Bergmann , Dmitry Eremin-Solenikov , Vaibhav Hiremath , Krzysztof Kozlowski , , Alan Stern , "devicetree@vger.kernel.org" , "Maciej S. Szmigiero" , Pawel Moll , "linux-pm@vger.kernel.org" , Sascha Hauer , , Rob Herring , "linux-arm-kernel@lists.infradead.org" , , , Greg Kroah-Hartman , Linux USB List , "Rafael J. Wysocki" , Sebastian Reichel , Mark Brown , Philipp Zabel , Shawn Guo , Subject: Re: [PATCH v15 2/7] power: add power sequence library Message-ID: <20170614015338.GA4635@b29397-desktop> References: <1497319166-17287-1-git-send-email-peter.chen@nxp.com> <1497319166-17287-3-git-send-email-peter.chen@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-EOPAttributedMessage: 0 X-Matching-Connectors: 131418788644044314;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39450400003)(39840400002)(39410400002)(39380400002)(39850400002)(39860400002)(39400400002)(2980300002)(24454002)(199003)(52314003)(189002)(33716001)(68736007)(23726003)(50986999)(356003)(4326008)(76176999)(498600001)(39060400002)(76482006)(54356999)(73972006)(81442002)(86362001)(110136004)(7416002)(7406005)(5660300001)(46406003)(8656002)(87572001)(33656002)(6246003)(53936002)(54906002)(305945005)(1076002)(104016004)(38730400002)(9686003)(50466002)(55016002)(83322999)(82202002)(189998001)(6916009)(2906002)(2950100002)(6666003)(97736004)(6260500002)(77096006)(106466001)(105596002)(81156014)(81166006)(73392002)(47776003)(97756001)(229853002)(4001350100001)(8936002)(8676002)(83506001)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0608;H:tx30smr01.am.freescale.net;FPR:;SPF:SoftFail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD014;1:fqgu+nagKzL5MtrRWWbE8WVrOiz26E6YyLcwkOqfuOu/wOv5VvaRmAUtSmQEJ1uNksVU5Db5FH3dEjYNkJTgsdG42y/vMKbFfIBB9XTX2RxJ2TVT5KGWzbv9tqKL//HMBxUQtxGZ3MWse/CoQkyTnV9Tf0Aoi9+RUTYdBAiCYurvdGmI5avWa8vXIH5eWgrbm4qHh9tTMD/ptLJ/wG6v/ou6xxSCV7i5n1Fv3hNUfiSNrH8f+mlpEmUrNHRJ69CYM9KLPwReIuzYxwU3NHDDQpPoKbNaB/DzapkjceZOHSFmzGx8OOuDDVHahRw55X1Jtm4QP9zEdPTQnQ9yg3tTb/0KjdiLUp/2ckCfBkb2pnZncVCoBkwuvhR6Xo10VgL6H7UIkA9dtxEztMirVzH31N8p+uRDdGT4vpbmzc8eaLLmtZUOM4m1Y3/T7MP2bKpH/OrxNc4hprvh+aaFhw0WLvqLN1A5zUsYNr5j6OYDw5LVLd63XfjwmsPkchiMozewMsGVPRWc8HTad0YVtGw6sHI9yr/4Gw2BBNGL285EmHU+0lrwhJlfUDMQ3HhW93p/LjIOPTKv3sBS/EMmJf8s+v9NUKHCeB30BFm8aGEYB30= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0301MB0608: X-MS-Office365-Filtering-Correlation-Id: 351af633-245f-4153-5cb9-08d4b2c84865 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:DM2PR0301MB0608; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0608;3:AXRbNY0azB/X/g+xNKvhjgl46aOgcZAxpRfPyfFKHV8veOqzl8s9o5LvwRZhSz+Vit2bMyF1XXaMXM/Gbe8/7JhpCy4XZMUy/lpMfPIgj0jKycWWZUhvDWgjDn85pI8E31KANUeKlzvCn7IskZ1fSjZXO71mPfUNOvaNaVoK9beD8lsUZADDhChy4MiKeNg2fdIpCb3UMCiwXqF/nHR9jwLHS2pfCL/VoeUpDZuIacU2bOZHEuNxwGg1A2mcbtUIYrv1qof7JuDEwo5bX91+B07x/TwF1r20u+QnRPo/aM5d0crljHPdCNlerwIduy9dBMdh/HsTF4aYYOQt0KjGj+IaPy3AifRazk2PIlceI/xVXHaiQsYStD/a7yllMH0rQFwk1CQBrQnRKLFcP2jwm0B7YUmKZonEsMiWgRB0jQnY9nh9Kg5fV16geleQC1Ah;25:GnT6L3GN9jMO0DB+haZkAnrhdeuFwsLkTd3grUhjDLdedZMf9/eM4TGbjqFelGP/twSWBYOLpmjTgQ7N5XyiLSskdZqer51k2+wr2z+yFGmHJP+EWBXFqFSvmuXmAQg/FWVDHX2ARF5oFCV6rx0prxLp65dhf0aOHhUzWnMOxuDBCQWFldJEJwbu070DhRtbGoNBShsPm2lN1ix+wRVL+91Qq3rAWurZX4zs4km/mcJ5xHrio5Rxr22ZvMMwWfwj8jbluGsBNgPL/Oyb8rwrPMNoNHDHSAEGokpilzlSKuO5gULbFvc/VW+cB+hGrboBxwZx9eqMjW21ZjsKVp9B3IWD28lI1E+gjrZqC2+kc+enYY+7Fx86ivT1XHB9cEKfHSm/ruNJ8ixKFT5nTfXawR3XvVz8eh/v+aXlWzDT777Um8/CoioMH37aYspzxIz2bw0LZX3L+vF4JhQRlpfFzwbmpE9nhH0kbrAxPORXSu0= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0608;31:bBl/WvhZxyZc7o/do+hie7HqN1H8M2Gu8WbkwFSmNSdmv+lhuNDaB7vG+H/pUyY04tt1TtH1U9DGAgO5Y/iV6pDjjBZ2f253KFGEFoiRaKl06xObBy1ZjWs1cPWCZRdQ1bd4MwSEK0eqUNTU4Zo9Ky/LIAh5xb/IYfSXDWK4lPGzC1RCZ1rp4gzQAOa3YjR+bSRD5pZazJ+iUZ6IWU1jvZBItlHzMjt3zifnrNhVZH5aDZdskx1aRgAO4oQsZ4hW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM2PR0301MB0608;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM2PR0301MB0608; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0608;4:EUy4acjNQElm/Rxn47e4NoB+HUAfmG1rRd13FUZQ?= =?us-ascii?Q?wkfjkHzeXe6CNCj5kkfvorKI7tmYd38MA8l2smIz/VRVuYzLtIFuJYw3UCAa?= =?us-ascii?Q?8OWGgtxtnNfXCA3ZN4sj+A3gni55DSGOMF1/uMGklcgBdOus5VjS3BakgQhg?= =?us-ascii?Q?rxwbBdADTBN+Z5m6mPEWaNCnk30xR/ju5CQyum3X6+E6+nY5BOS6+FenIq55?= =?us-ascii?Q?cx8t/zEl5CU4cQSa3h/F4SVucBk8jvUUzMzF3VJ7FEAHw48OKxdoQLUlOs/z?= =?us-ascii?Q?eLTlbYd1bySu9u+NwolwabERNRhRo14qrWiBRi1q2DPY/N1FL0+6iH1qcDpG?= =?us-ascii?Q?fntn0lxgPAXz1aQDs0iXX5Lz6TkNvNhKxP+CJ8cltYh5ozIofb769AGzFUMo?= =?us-ascii?Q?SHGL9p2enjBGgU67NitDlYkZ0TtwFlyBJXUF3KSxYHJM5ZjudTPEjucgbWUu?= =?us-ascii?Q?4syiMLMlOuQ5ItzEzrtk9XYS98yvC9xbTUXe5yDDf6lB9yJU2rJPvrc799g0?= =?us-ascii?Q?+75W40/ovmsKMcHEdvDPuY1exmfJulRthtDr9MswQ1KrZ2NoyTtbgFIF1uA/?= =?us-ascii?Q?eEbczcWVSOc5ntEFI81Wv6jASWD5sbUG1LQWc+n/XVPMfzqt573zmoc3hzbk?= =?us-ascii?Q?zpZctIWyYOurmSKdXcr2QJX8pTVsIYduNsg+C3iX16afGakFXoL+dvC6LdwM?= =?us-ascii?Q?t7nZieIe51PzKIqZ5TnHZW9ox1+E4KOBQBVU/A0J77l6SWtOK4ki18e3iXPu?= =?us-ascii?Q?TVAXiadUahnclBjinM+agtprzo08uvptm0xK6utkvcWoG4wbqFSStsFQkHH3?= =?us-ascii?Q?WU9hoq90eyN+CgkH3U5+yk1d+UVRugAKdEC5amxS2Oi8heTHfDlwfvKnS5TA?= =?us-ascii?Q?imuhQSp1AoYJpL3L4xM/F790DeUMqhNKvVCrXLO/iDWy9PDkiVB+M85hVKS0?= =?us-ascii?Q?7dY9to+nP/1ynEl+w0jN1Md9+gtR6T97q0awTWn1QraN069X6KyWRfKk+fSA?= =?us-ascii?Q?iaasaAGzmZ08s15cSoYVCM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hjCep94gwfMwQ7eNjc8oCDWnP0tpsqv095N+xaru6ILkvXJ+HVp9P4v1Q8s2QB0LEZeW78ZOhErByplOi8kYGh9v2H0dIwQNBigfoabX6QG+lu/NKCGoR1ThY1otgW1gP7idYhMysaNuZmtt9yaXo8PloPSn8hMWwi1a5m55XzKu1R+r5IUwZCLG5bjcArKFoyPwWKaoExVq7ky7FxsgPB8KF0XOOppSmQCI6btHiJ87BZOz5iOGnubgbTdFe4ODij/GiXRwc55w9wHLqbQ==;24:iKOpZfQfQOO66wdTLn234iM0OZ2wsyk7IgcKhENAvyXAv7q/yv1/hn30RMZu1K2wJa/omgmo4/c7KvXWAq+s+qRQ5wTpw09wQD6s+T9iSXc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0608;7:6W1yW2BgiBTwfg7ldeAOuLDh2Cxyn1oega3zJcC4Sz1IfsrYtYo+oySOD9PKEUHDkCw2t0RlGh3P9xiroSyf7HUSMNqbzquVNVerLQHPOmDhfPnOvMlgRWV3lXhOYQjrYFMzs7EUIoDvvOwUV1F1QVFe3ljJF7QHIHIHrNfFyrDL7//0DlR7XqWn2/JEC3Wzilw3lQbWM6Uc3ZNJwYJFcO/xo/7LLajGiRHYUJpOp0VdJU3Vm7AnWQr/4R5K99Y+3xYQ4Ajl0wSnKBJUMqNeO+f5SjirbccynbcoGhPLRB1Sliz3RLIipw6dauSPGZwnNYXlacUaUuqT/cOAGrq1+A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2017 01:54:12.0179 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0608 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1522 Lines: 51 On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote: > [...] > > > + > > +/** > > + * of_pwrseq_on - Carry out power sequence on for device node > > + * > > + * @np: the device node would like to power on > > + * > > + * Carry out a single device power on. If multiple devices > > + * need to be handled, use of_pwrseq_on_list() instead. > > + * > > + * Return a pointer to the power sequence instance on success, > > + * or an error code otherwise. > > + */ > > +struct pwrseq *of_pwrseq_on(struct device_node *np) > > +{ > > + struct pwrseq *pwrseq; > > + int ret; > > + > > + pwrseq = pwrseq_find_available_instance(np); > > + if (!pwrseq) > > + return ERR_PTR(-ENOENT); > > In case the pwrseq instance hasn't been registered yet, then there is > no way to deal with -EPROBE_DEFER properly here. > > I haven't been following the discussions in-depth during all > iterations, so perhaps you have already discussed why doing it like > this. Yes, it has been discussed. In order to compare with compatible string at dts, we need to have one registered pwrseq instance for each pwrseq library, this pre-registered one is allocated using postcore_initcall, and the new (eg, second) instance is registered after pwrseq_get has succeeded. Peter > > Anyway, that means all pwrseq instances needs to be registered an > early boot level, to be safe. To me, that seems like poor design > choice. > > Otherwise I think this looks okay to me. > -- Best Regards, Peter Chen