From patchwork Wed Mar 22 16:53:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 9639409 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 097A66020B for ; Wed, 22 Mar 2017 16:54:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA970277D9 for ; Wed, 22 Mar 2017 16:54:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DECC328456; Wed, 22 Mar 2017 16:54:24 +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=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 619CF277D9 for ; Wed, 22 Mar 2017 16:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LnGbEnCO5FZpvf9FEXT0zvUhr7VpmDbbM/Ybmmfx5NM=; b=Deo/fQezZfn6lg TKbcNUrlyyzkwEDLplR30XFnBg1InEaLUSezFVmaC6CyNtHmP3AX3m1QjE6PVdFnmn11o7NEgQyCc VavZeTp2N7jAdB5ExIsC58U49+bqwV25obfN6Fm/75wX1MMh+qWUZMHZqNvrp0KWp2SgoVUOfedaF kqlnlnaNYbfjF+fmvgvDVwg4fEbLAcsFmZZZalCtyCiMZo5xoW6Xlgh8ZgnXdRuUjoQ0sm1G49ej9 BEQBL/gScw9DeX8JdE/jTJ+iMg7ATuzW/c0/OCywGprGldpEnrSAbWBun0n9wbfX96yJKgjou5Cy9 o50rsalL2jFXX/tFOocA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqjWi-0003Jn-37; Wed, 22 Mar 2017 16:54:24 +0000 Received: from mail-by2nam01on0630.outbound.protection.outlook.com ([2a01:111:f400:fe42::630] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqjWG-0002si-Tq for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2017 16:53:58 +0000 Received: from CY4PR03CA0005.namprd03.prod.outlook.com (10.168.162.15) by BY2PR03MB553.namprd03.prod.outlook.com (10.141.141.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11; Wed, 22 Mar 2017 16:53:35 +0000 Received: from BN1AFFO11FD035.protection.gbl (2a01:111:f400:7c10::183) by CY4PR03CA0005.outlook.office365.com (2603:10b6:903:33::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Wed, 22 Mar 2017 16:53:35 +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 BN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Wed, 22 Mar 2017 16:53:34 +0000 Received: from fsr-ub1664-115.ea.freescale.net (fsr-ub1664-115.ea.freescale.net [10.171.73.212]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2MGrKXa024800; Wed, 22 Mar 2017 09:53:31 -0700 From: Leonard Crestez To: Mark Brown , Liam Girdwood , Viresh Kumar , "Rafael J. Wysocki" , Shawn Guo , Sascha Hauer Subject: [RFC 2/8] cpufreq: imx6q: Fix handling EPROBE_DEFER from regulator Date: Wed, 22 Mar 2017 18:53:04 +0200 Message-ID: <7f2618363d43b30db29f5f8ae822df413392f99d.1490199005.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Matching-Connectors: 131346752150825864; (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)(39400400002)(39410400002)(39380400002)(39850400002)(39450400003)(39860400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(104016004)(48376002)(4326008)(36756003)(38730400002)(7416002)(8656002)(118296001)(50226002)(39060400002)(2950100002)(5003940100001)(86362001)(305945005)(6666003)(356003)(5660300001)(53936002)(8936002)(50466002)(85426001)(54906002)(33646002)(105606002)(189998001)(2906002)(106466001)(8676002)(81166006)(50986999)(76176999)(77096006)(47776003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB553; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD035; 1:C3vMj0cMBZJqJHy/aPnwyb95QjBjWY3FeU7ZP+CfyACSmygS1xxg5grm04HCsvBu0mQZ/gqPgWwZnWf2mkjBsKndEPJ0+3KMouVdi75yWM9ZTi6peX0ZrABwPxD8GQdtrjfwVZzgjdqK7eLtMq7FaGggHKS9GY7RQvzzhECxLqrAtOHKmAN4u6zRu9cgYGiP9HW7GUI1OyGI2DxJfcLGqnuJXslOVqiN8yd1nWQdsSF7QaQydG81iocg0/GmeFPScYSuoSRaihHIWt3FNvG11TDi8xNPx3OS6CvYDJVbqO8q71XfBkCZ86V8aI865NZFaFLfpp6UHxSxf1m1Tkcm/cb4ejmXwp7OevpExKJrNHunCS3YkHS9+J/1EMvYF5RMRGpzZbcMCdlTkQIuF3O2QfouBEGBWMIzlq5B5EmHF5/cL3dwj7MxRA/aHsi3nM5Kybxuzerk53hV86uu3EO6CKtQbddgkQq9cTbJEd214CyAerdd+Xb7FT2GAe63JMJgOBPXyFq28Lde3gsxrzepM37CLRmfKVPUenEOtFdwc5x/NDt4qCmBw4V6YGVDYOO3LDHER9iIlWse8t1l3TUtNiIwGpKXfeHuHDtZepz2xk2TaUajbGDz54fBVZfY27SC MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c5c02e80-da64-4b7f-8a27-08d47143face X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR03MB553; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB553; 3:MMes8jyC4ud6cZWttT7XPxf1bIuyY4f9A+AZ4NAmiOW3wQQMxKKz/UiVzlWLGnRjGIPj5c/O0iR1FmYuD6gBez5VbubEaqRQaCdX8d+JyQJmk8VQEAFnO4i1O9OgKkT08qZ/aFtC2iqIDD3mbFx6bePY6jKtYe/3zbg0R/zIwytmimhoBoPk8ZLIGBWNQx+cZSi95oMe4c3cbXA3+9O5UNz9yfJLSHKOEReHPV0yyISdD560smHWECgEM1dwfX1R4mxWjmc/MrkXWikwxAs8BugHMPXFts8ODFHRv8iUBFbZLYnr2PaC3D0BsFSqyXxLXbD1BONKqsplEmfRUF1U1rxmDwQwCLLTMfGGhJ11ikFwzXrwpMoAIMjV+2RoAPid; 25:oRgU9tDPgmIxNVX2eDkhSb4lFGetOIr0i8yE0+zKg60tMHcV/AsC7tNDbTnwHM6kIR2vbX7N/WLKUvR7WS6KB4Hm9T2VEJlVc7Eldlw5WT83l3w8b7Ay90jUNcsiqyH0R3JN5IvPq817E2L3ZsEs0SKVenqe2ENAlxULiPbNsQpkND0n+pXRCKl3yTAaf1lFB2JS747YgfTDwvAZLEfDOY4IxVez00eGORvNIItlEv0AYAN5n9yozVQ8SOdKPGUWwcGFR6ZFtIvZacH7n0TwHRHkaPYJ44mkKxDVvqkwiRX1Qh9gms0pov8Ot0+7S2Yc4IRliHZV6tO7FOWCih7bxCC8dmgJRDRY74S6Jr0h9Wjipr1kkyx3t5E+Pm9S6TN2Ak2MCfLIY3E5rXPpmyX2dvxa30pMC3WdCKHliJzsighHrzsyQc7UUV9B5Xmm72EKG1zFgo+8yBQoToaahmYnOw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB553; 31:MfpgFORQmZA7LBN/X1GIGcw7c1RAmSHo9qxuwOw74g/Af4o69XPXy9s0R/hB0Yc2N2Cu4cZcSIsdm6lP0tf1TPNx+c8RnCnVH9VU/lvTY+596UMTW3SeV6Db/uS+61QsjS57Va7XOWP1Aea2o9Rkoggf97GLABUuHuh1k7j7UeAmiVmC4AqbIU0+dzqm9hpFBAB4xfW89i+Frni7JBDX0AuSIti6yTj28yqU8xLcwWWiTOE8+xOK2766Lpf9BDCg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13018025)(13024025)(13023025)(8121501046)(5005006)(13015025)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123563025)(20161123565025)(20161123556025)(20161123559025); SRVR:BY2PR03MB553; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB553; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB553; 4:6wWWTr/A7WV4UTAjbKkGGs6DVFcTxKAt2yxSzIGFl3z/AEst4PTM2joaQuXg6P0smaaXWsFqz7M3EbtOkSU6BUuvbdHhG/sk6FUtgXFGntBJW0jW3INO5jJikuT6H2tgkp+OzC68emQablBJNFO0nCa54rEZVk6/WJ9dNjyLT2mR9Zp2zoJHp4K4wKWC2ITPbOC6y+i4ieudheCBho/AdQJF1VjLLCzntgX6MHz9gbw8CD8vL6CfETURuZ6nQn1oeJ/Kv7x7ekMuifz6hvqyfFmttVtua7duHZPrZi8Ml6oBeGxP6cltwWNbQPr5/B77LEYgCXz7v6SRgWkx3wwQtbFeyIyAXYJzr7cM2ylgxKo7PxTteu/bqvs367HxPqh2hj2GrgMMVqTmQFVd226fp/E4DlOERqBXerqknIdPjSub1Jt5Of589S7M1PgAB8OwpGhwTBfm9V/X9/Zxc2yw+4WROH5FQuCasl98xTYmIuhxalAmRuIxmZ0gckfqWLXHMJ5DcX4muWfXb05p4vNxJmGh9pZ7qMbTR7LtwjWpHXcnLIKjq7x1i2pHuspkPZYuLBdAHpyPtMSKGvIPpYqUXaUpcmemTM3xCYOpwGRDeCRIg2cDSlJ+Ugr+6N9KoN1p4NSDy0uxmDGidWW0w4769Y5cnyuE0dNIvoYqVRdYKMyLVgnUrcrd/Bd+CZE8iViz+hb/bBzACSC0KEOPe16s4pXCWZ+rhsF28ByBhZ1VjvU= X-Forefront-PRVS: 02543CD7CD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB553; 23:YsYbVpX82+ZtQ0TiX+K2btuLTX4AfZZifeFsnm6y2e?= =?us-ascii?Q?Hz3rYmL8L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L; 24:BNGPfBRHv0ZvT6qwy/JL0op9k6TDYZ8cObFyQLFEO73nubFrD8OKFDFxiLQtmgYYxPyhIbYNCeBH13guB9UE2f0DaiYp8yOuIinPzgfAzp0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB553; 7:45ocuhrlOSvxpsHObPoiuNfZ1muWoCGIHD19hKZULFUXuOcg0TQI1STItXwz/Iy1QlH85z+ceNQl67rTQWHH/JrjUu7iXr4VzgRTDPPgxCWqQt2EnG/xDvjWxd+dAetxbw+o42e2wDbZZi2X9rJwGaVeyLSO0vUodA9oxC4SwAm/SNxI9bzmxBjYf1CK/U1rxK9Fo7D+iwSe7Bh0aBI8iJ19Ef0N1Hzxr167tI4QhI6k8RfnDtpzEBZwSS8W1WDj8qYZBNZFLFuhFLA87A43qYW1QaBOBiUbnhZnwUWGcG5vUx8sAX7jSXqpWl9jWBnLUdjINvlTUN3DWl9e5EhIFA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2017 16:53:34.8485 (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: BY2PR03MB553 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_095356_992781_482A629F X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Leonard Crestez , Anson Huang , Irina Tirdea , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Octavian Purdila , Fabio Estevam , Robin Gong , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 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;