From patchwork Tue Apr 4 17:04:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 9662107 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F38D560353 for ; Tue, 4 Apr 2017 17:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DED3926BE9 for ; Tue, 4 Apr 2017 17:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D37CD2841C; Tue, 4 Apr 2017 17:04:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3510626BE9 for ; Tue, 4 Apr 2017 17:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754917AbdDDREo (ORCPT ); Tue, 4 Apr 2017 13:04:44 -0400 Received: from mail-sn1nam02on0078.outbound.protection.outlook.com ([104.47.36.78]:3136 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754278AbdDDREk (ORCPT ); Tue, 4 Apr 2017 13:04:40 -0400 Received: from DM5PR03CA0037.namprd03.prod.outlook.com (10.174.189.154) by BL2PR03MB274.namprd03.prod.outlook.com (10.255.231.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Tue, 4 Apr 2017 17:04:33 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::144) by DM5PR03CA0037.outlook.office365.com (2603:10b6:4:3b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Tue, 4 Apr 2017 17:04:34 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1005.5 via Frontend Transport; Tue, 4 Apr 2017 17:04:33 +0000 Received: from fsr-ub1664-115.ea.freescale.net (fsr-ub1664-115.ea.freescale.net [10.171.73.166]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v34H4Nb4018701; Tue, 4 Apr 2017 10:04:29 -0700 From: Leonard Crestez To: Lucas Stach , Viresh Kumar , "Rafael J. Wysocki" , Sascha Hauer , Shawn Guo CC: Leonard Crestez , Mark Brown , Robin Gong , Anson Huang , Irina Tirdea , Fabio Estevam , Octavian Purdila , Liam Girdwood , , , Subject: [PATCH v2 1/4] cpufreq: imx6q: Fix handling EPROBE_DEFER from regulator Date: Tue, 4 Apr 2017 20:04:11 +0300 Message-ID: <118bbfc3747dcbcd1c34da2f94732fac0a5d4793.1491324640.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Matching-Connectors: 131357990741300206; (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)(39380400002)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(47776003)(2950100002)(38730400002)(356003)(7416002)(6666003)(39060400002)(118296001)(105606002)(76176999)(4326008)(50986999)(5660300001)(305945005)(104016004)(77096006)(8656002)(85426001)(50466002)(53936002)(36756003)(2906002)(50226002)(5003940100001)(106466001)(48376002)(54906002)(8936002)(86362001)(8676002)(33646002)(81166006)(189998001)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB274; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD045; 1:ianDp+3lvEeHWHhL+q4acQ4Xf33qfBfIeeV7v1l22jrjPe2EAftI4gR5fyh+qX75IocRaNYXJwIm7Vs+QaqTtaWTi6fq/q+O7v7Bt+63ic70v+HkcBeIQzel2jiauk17K8hLlp3m606hoBk2zcsmI2GM4TtLmeD42ZVMxRDZTTVSdFipvl3Otx0QCQ0FT2+ZbrDtF1Vtc3L/s7O2S7CeUhS0roMHfV3LVC2cK6IRse1jsIQdmNvcR6zQBtYyHMJc7BMC7A2ZYeiHB1jYao8chq4YgOe9gLiOkznMR0gRH3JEqG8yAHkAP6h8Tz1t9Q14Am+y+9R6oDrACm1awwSkLz12jeLFatVWGYekvCHfhqASMnwBlN1n0w6zU9Me97tG0ptuHDJyyTXnLm1A3dfUqEzU3CNBHaQ6DNpVLzAK9GOTwGVaqugtdqajTAYbYQcoD7vkiXeJXQ4BHck4m99FknPVrk71CapNCSkYz4Reqcg65RXH5DWx0b0hPwAbj9BruVgoR4wY4ISIMFabx5ZHh9B4sPDwr2poR4vdHhUYag0IlVYuDBcEDFZ2iCRv5DdgdZsz9xAVzQ4XYy5XYTQfHe64Rj7UmAg2pz+VAVLxjNd2VuiLY0v6ienXDBCIS1cy MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: da8bc400-cd40-497b-48f6-08d47b7caaef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BL2PR03MB274; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB274; 3:DpRui6nMdausWH5HKLsaD1gukdca6vCD6i+Qjkfj0VxT1ZYbBlswoKWMttnpkO4sxTbXIf80fWBirdzedZKPAUSXU2PgVRWHmvOh7KtG2TIVmRJky4xov5RjM8QNXOVkc9UpACSa7+KYPsaJNiIl3rjfPgC/L+Wbb2IH9N3373neyMB3VQxoTdkWpURLzty1T+c3FfoKnsVyTWJ3GU46iFF2bM107LF+gzOanIJW/NSCCVtJw531qArAW5+Zll1thfE/N/dJmKpKEQBadwcvSomcHvIn764V3oEVhXCE+5O0axcLx8v6Gq3dfywxXP2xn0YPXJxmjgCmpJSeTnJca9OXLGyyWQpcRd4xwNZAmzIxJnbsug3jUJbR1UqBp2LjL3nVUntyS72eAK+duYIUl8wD3PxsP/xWH+q0mg6pF0k96107tDVT99e+BU+4IazC; 25:qoS9vkbCnt0K+/FIpcdwY/3kDRlCQt4Ik/iUuEqc0MnO0VQf9IWiYoT+/9k8x4aYIIbDlOiFeuHNmZXcDjigY+/d9FVIMRYkr0WlqkHNXy5d1NAx69HsT+/fS/i34053rq3CoJnsD8r5GWEDNTPu8JD/mEqa2zch50MB4OdYZBxP9JgIjpdjUxsGZXptAUe5vJYPg3A3upvUvMwWmMBjRVdSGNE7Kpam6PmxKpnwbne21GMTxG6bFofVxaD5M0aTdGlRhc9lWxQ194OjrvWJ40eFS4wKBDmclJy+2KKUDljy/0Duu1rvPFBvngx6qMFhK3zaRNjR2g3v45rhp9+ggyg7/8vSvH4eoPMTtucng0KqXgr/Y5pViOIvkhV20UkPJjOaI3YFGf5tnbdoyfjORl7LGno5uYpAD5ACWIoPOMLbL7vZsh3R79d0pxzeDY6GPxu0ItDmB5lKzahrw4cFlw== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB274; 31:YaNw1c1Qr4uMB74u8ad1ODoel/kh3bNM2UkvF2l4wDL9J4GGnt3XceCzZmVk7f6+bXDNvj/tLhqYiINdcBYK6dwHTA7WCWuQ5xjWYMHSoyhGuRfWKp5dhF6ebRDsrQGimAWAKiEDhgdtmoJGoiEcXRcv8UykSdEwrt+VXP6jFXV3mxWXt19wAienhtAN72wG6r/YG79ZE4jBpp5MHbYhUnwO2HF9z8XylMmsJUm2KSbz9R81g9Dgdt3nvS9fueti5mrbZGSgbtP9Y9LOrUKJWA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13015025)(13024025)(13023025)(13018025)(13017025)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259075); SRVR:BL2PR03MB274; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB274; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB274; 4:+su+jDdr1Ky3AWmM7SndI3JDEd1Eo5KAwHkD0TIFwUPxCT30XvrSge2Jy8/vOXlzNjBJ3Xx13mjn1fmvDLArycwS9C8m9AECrL6ZmgPQaSpqnY8v2S9uQxqo2ws2ulObyFmoCNpBg22+zZiooKYyfQqQG9mVr8sn7FL9K+lgwYi5d/IzliAlaJlEJG1cfU+J+2uRKEs8WnCXWsLg+slnsZQo+UdzdhM7Qz80F+f5s+mB9AZVb6V/JgM1LyYqdcGDModoFLwLdGw1jcHwWg83JT42MMyxXzL9n9/33kmBGh7XyIzai13tvpA8CRJw4yASAHpwPyD+wPfBfVaYgu8xcOge9hTNGa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us-ascii?Q?e9U98DoMDsYmYLgac=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB274; 6:ZE0OqmEpRCMP3SwCaQ0vO7tUJfN6rpXE5GZSe9oUgRhFr/h5AcsNaDWUQu7xGS0EfvoiLBi9rbIRKPj94jQqkOm7yr0GfdwaZXKkDV5gN/r/sTwLork/WPkAjSpc5rmUOZmzuHwGa/jipDSelTmbU1IYErDBZwysUXYf3Ijg38o6ZSwOPGJtklUvNtD4E2XQp/Wneb64bublRr1Nipebiyzzo/iGIUvh2BiaCV1pvOal3sHhWzY4vdAHaJLAuWIGCmSMuoaU3QtsXHPq/bLkxAnosr5RR6eSrubJYQfu6xjmuByuW/iarqZHXxzKVzVtBG0BHx2sRGmYAM+gyNP2IWosRRn1aUM3gslz7RsThg19YJ+XENQdOcd9fmhuHKR/zA2XeRBwj6hj0lW46CVlwQ==; 5:qkDsC3NCawLMoGxjw73Bzxm4a8OsirKssWCt6CREcCJc0u6yFmsoPB0br4PI2Rb+CHLCwedcydu5kYHwP76pCgLxt7IU2LlAPlQBwaO03TbKx5MrF9v/wiuq+FMM7wKgvR0Spsq5uf+lzPc4px1nJDORqqXwe5R+dEt0KklepCiqeNfoVxOIfImAIRXrFvxq; 24:2lOaFXHiPO95TcUP1tL8cCF01DX6J+O9DnQEdOkowvz82Uh6cmgrixD7PjYgNETeopOWyQgX7WfNjmhm2DQQamnG0icuuoigS26nHQvfmic= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB274; 7:ZqeHU3QE4EChpji6sEH0QlCu6Edxs580tWASUeXdlrAnxXiz7g2CNAcEh4Nat63HdmtTDUZaAoPZINsEoIh4SKYjzMe0IGA6fvg9OQOHnb/7AGln4nJ4kokrflO8seq86pUAJgAPR0fTpGIRDDSOwSf8u0Nztf3l/FfV0gaj8rSxxxFftOeZSEZfrcARPdbgNCD5JGYIbMSx297sgI9meKkiBvXoLmgydhXYclY6wPtPPveQ+P1vgE6mCqJZ8O0996eumvzArVaygEOtCTth6FRY56FiEL2PtC53r+vrK8k33iPojTUa3r4kumgNgjFm3zM5Qlt/t9bDqUeg4wYNQw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2017 17:04:33.7712 (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: BL2PR03MB274 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Irina Tirdea If there are any errors in getting the cpu0 regulators, the driver returns -ENOENT. In case the regulators are not yet available, the devm_regulator_get calls will return -EPROBE_DEFER, so that the driver can be probed later. If we return -ENOENT, the driver will fail its initialization and will not try to probe again (when the regulators become available). Return the actual error received from regulator_get in probe. Print a differentiated message in case we need to probe the device later and in case we actually failed. Also add a message to inform when the driver has been successfully registered. Signed-off-by: Irina Tirdea Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Acked-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 7719b02..be90ee3 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -222,6 +222,13 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) arm_reg = regulator_get(cpu_dev, "arm"); pu_reg = regulator_get_optional(cpu_dev, "pu"); soc_reg = regulator_get(cpu_dev, "soc"); + if (PTR_ERR(arm_reg) == -EPROBE_DEFER || + PTR_ERR(soc_reg) == -EPROBE_DEFER || + PTR_ERR(pu_reg) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + dev_dbg(cpu_dev, "regulators not ready, defer\n"); + goto put_reg; + } if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) { dev_err(cpu_dev, "failed to get regulators\n"); ret = -ENOENT;