From patchwork Tue Oct 11 17:53:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9371489 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 A35A86048F for ; Tue, 11 Oct 2016 17:55:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99FE028C3A for ; Tue, 11 Oct 2016 17:55:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E10629036; Tue, 11 Oct 2016 17:55:59 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2DB2028C3A for ; Tue, 11 Oct 2016 17:55:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bu1Fm-0001OV-Bg; Tue, 11 Oct 2016 17:54:14 +0000 Received: from mail-by2nam01on0071.outbound.protection.outlook.com ([104.47.34.71] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bu1Fh-0000zD-Dd for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2016 17:54:10 +0000 Received: from BN6PR03CA0002.namprd03.prod.outlook.com (10.168.230.140) by BLUPR03MB1409.namprd03.prod.outlook.com (10.163.81.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Tue, 11 Oct 2016 17:53:47 +0000 Received: from BN1AFFO11FD012.protection.gbl (2a01:111:f400:7c10::169) by BN6PR03CA0002.outlook.office365.com (2603:10b6:404:23::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via Frontend Transport; Tue, 11 Oct 2016 17:53:47 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD012.mail.protection.outlook.com (10.58.52.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 11 Oct 2016 17:53:47 +0000 Received: from r49496.am.freescale.net (r49496.am.freescale.net [10.29.244.74]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u9BHrjgX018282; Tue, 11 Oct 2016 10:53:45 -0700 From: Fabio Estevam To: Subject: [PATCH] ARM: imx: gpc: Initialize all power domains Date: Tue, 11 Oct 2016 14:53:33 -0300 Message-ID: <1476208413-11286-1-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131206820276821612; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(51234002)(189002)(199003)(69596002)(7846002)(77096005)(86362001)(575784001)(2906002)(4326007)(8666005)(305945005)(5660300001)(356003)(110136003)(8676002)(81156014)(81166006)(586003)(5003940100001)(6666003)(50986999)(47776003)(11100500001)(105606002)(2351001)(8936002)(229853001)(50226002)(106466001)(189998001)(33646002)(97736004)(36756003)(85426001)(104016004)(19580395003)(19580405001)(6916009)(92566002)(626004)(87936001)(50466002)(48376002)(68736007)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB1409; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD012; 1:6jHMMm2KjUz9labBjc3Dhi/HsjUeHaX0p4IauQEgqJMobnxJSFkZ0MF/3OUgInQ1dZ/JXGqxP415xk/tN8FwL5c+/dN3qjjJqJsy76hc3VlJMsuPZbhgBANBqWFNd/fnsaKmSmAIa5EVfokIC+oG1X+j3sReRIFsQ1eok7sF70GZe89rwnV6tDv3xfpJP5kbRsWdgCaZzTheG4NIQMA++4sFLZn1PSw06Dm8EcZgGu9LaS9LMGd9fvZwPm4kHMb2IADuZAxRfrs9+hktckKzbXZh4Bu94owSSoIydCDn0qCnAON+KG2Jsju+d2HQSoNlAqx58yB6CTopRqROm6M+xkLnDKy1MbmT0+8CciAwxNZiw73YLtuwek3bmxbkXgHS3/hdGJoCrKRpPu26Mztz0R7S6VF348nX05sUSAsDYeqfVdayhVdu7My0hLZcKSX4HX8BX9FrsFa9K7yI2ZAfgETLBwsvhRSJcHEk3L0lVTEU+vwrp5XhQTjudTZ607k/p5RDJGbCHfoeCWa/6zGeKx+dxmq6y17xsHCoHjjK6gAnmA0dgVBYbpvbAbrnX0il53EKWeO+JNtr2AHVfbhP4eXUcQAu9X30w1ehLsLML7ezaGXqm4NSJ0QxxiasRdW4qLht/ZiRBwuJAHzU9xQJ+BJhItrei39Mfg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7q64CecO9LJRO/M2yDHzijdceungR/SYHM23hj X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1409; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1409; 31:g2MZfUj/JzuDXsBGWMoFWG+LMAUiNq0aF5cGz3QHKa/MpSUZgKFrBhjGGmOSIE6px8yz4xb9aX4Lo+yX0a9TPtFhBoXqdVB0rgplF92/Vyr4/R8Y0QWVAwqrHk9fvIrkOzDbamgRFz8V69yJp12XB/N+8F5i5TwaRceEx1YRjHy1tabOcq5eDlizOoRnrFuq485PIIi03BikXtZ0LA7DO1UYGPpt6AuaRGLmiwd+p6AqXn/ED4LYsysLjlDEM9KBgWHgVkLqx8NECE2RPHrdvQ==; 4:oYZEK5olztpzXYTUVr+g6m5Oryw9HFZoucaFVeUR7SkFjygoEFq4Z4EFUHswXgxufUrloLF8NdkfI1OCVaRCuh9NWo8zzTQ+ZSiX780egCQJZebih+HicR6iDQWHcem1SQXZBYuxyNnak27hp3S/ONbecawD7hYpPUCclGNSq7HizKD18tXv93rCu4jrB1Jl99hReozwICHxHjs2tRlp2xZhA3IMT5WTchg+o97AL1003+oqpQrKY3PfoEmBal6xwE74dY1m0Tj7+oUkK+yEvLtjkUZ6pLo8hRfg+yNozHCT16EJnZPnYoHd3vbkCMVUJ6VPdDvC+BEKTHV8qtfohgUu7D9RNK20yNDfqgLfSbILjMcSE9iB1rtd2neJ/v77KzPxMLdGXWGA8Lsd1rw6L8u4ztTKbqv9A2CRdGrO56IK8pjJPueU4i9ef0PzRz0JdiDvXF3K//FOubY0rOH+d7N/PWOsOQJstGSnm+omcQcSCEzKIsoFW6VmCD1hjVd6JuX0cKfcOADTrkSk44s6iARexsD+05XVKmrkMP8WOZBul1PUwH6Sjo4Ontd9/QNB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13017025)(13018025)(13024025)(13023025)(8121501046)(13015025)(5005006)(3002001)(10201501046)(6055026); SRVR:BLUPR03MB1409; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB1409; X-Forefront-PRVS: 00922518D8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB1409; 23:YATZsHvHV++2W7qOW8/rsNfv5EpOUp1AorHZ75cCC?= =?us-ascii?Q?97GmfYtMShTW5MaGnpjNB2JCyV0Io/I78x8HONBhH+fAEzjGiPIyy4bqKoa2?= =?us-ascii?Q?AWTy2IPDXHSt11cOv4KN0iroAoWC+0oe4WHJyifoI6vUR3YECh253c+FxAMI?= =?us-ascii?Q?MxQgUczulS6XsPb0q/jmjsAPqoqvK29x4q6uzmG/IVbOWLhiKzVQ7b0dH4uH?= =?us-ascii?Q?YkThLmXuuFc9x3ACr8hA72vWpCmVo5XNgsu/nOMN+2ROxlvnN0D2XwBH2KdS?= =?us-ascii?Q?m/gw2AcXNjabX7E1oQRtUH4xT0mpd1tqWc2RHrVYKbHVOrH3lzeStQ7ySv3L?= =?us-ascii?Q?pT45H9fkd2IGegh4OTb307QSHo0mxbt+3nWqajjjvfdnvuXsdqJ0IYH9wBd1?= =?us-ascii?Q?ZukTEoaokfV5rsuWlMnSeFD/8P3iWjQ5bD3ezvUUDV7q09KIJ5p/uX0Fmhdy?= =?us-ascii?Q?EFSWCbQO5PBqNGw95gBSSNWsX0Ntstx3zadApsOnFzI1gS8n11T5y3Nz5bXg?= =?us-ascii?Q?uuvtl/NWUx+LpBGzbancRrI+oImjYQEmSSETjoqroxjx5JRm1K7jpHCxEaFx?= =?us-ascii?Q?mHIlBhFI6o4d2huhZf3Zia6srCmnjV8jAz8IsxfrZCWXmGojnGKhgwVo6sNA?= =?us-ascii?Q?7kBCyvXl6aiiG2C4vA1E6QTbv4xMxavyZbncu3mqvoL071FpYmrFr+pk95RA?= =?us-ascii?Q?kDd0JV7LNxOUHTjXsccSpwbuA34LQ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V/TE0RqmtnZ0LIawdvxwgaqTkrnlQxaJfFAuwKl8hzDg3jeQI33/XwqaiblcnPcU5+MbEEr+pbJ4uLrulvAAVQPWGLByNxOKPQvpSPEV2rv2twZjv8hBeB5mCBbUzCWsgBN236ZpnEx+Kl6I; 24:pho1J3v5+BB1BwMEzVMnP1GY1MEqIS4U0rXFHwesP1sB0kGDU6ElMB0oCx/i/t6F97pBhYqkwQqtExGDjHPxBym+SLGUbaKWebr3Ikz6Qpo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1409; 7:phQHxlqrXB67fVqwcgJTGZhONvmHccanNQVIiPQ6uLmYU1L53KpmjYmmSNqihVvVq3JLV26Xz4YFt3xBReUyUTDodES0M1MXofb4i0anYFxJwigdaPG2v/Embux7Od1xRQyp7QWivBykmMyKuILMStImK4fKZPEJGIKwq8DtSsJq4qXdpwcjA3j/dRBe9hFnnDBDPPO0AD3pM1xBeUF4/H4oHLahoGuvHkQAilpp4p5TQZCE+4mxpZkwZU1Yc7HLgOUbTCJ+5IEDOjD9nmXjUnyzb/7utCUJJI174JKacThDNXR27pXtWktf+B8VR8Ggk8RgyeuooYFS+PpCDhN/jgfYP90ol1jzr/rX8W25nfU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2016 17:53:47.4325 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1409 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161011_105409_613365_0C45A326 X-CRM114-Status: GOOD ( 14.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabio Estevam , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de 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 When booting a kernel built with multi_v7_defconfig the following probe error is seen: imx-gpc: probe of 20dc000.gpc failed with error -22 Later on the kernel crashes like this: [ 1.723358] Unable to handle kernel NULL pointer dereference at virtual address 00000040 [ 1.731500] pgd = c0204000 [ 1.731863] hctosys: unable to open rtc device (rtc0) [ 1.739301] [00000040] *pgd=00000000 [ 1.739310] Internal error: Oops: 5 [#1] SMP ARM [ 1.739319] Modules linked in: [ 1.739328] CPU: 1 PID: 95 Comm: kworker/1:4 Not tainted 4.8.0-11897-g6b5e09a #1 [ 1.739331] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 1.739352] Workqueue: pm genpd_power_off_work_fn [ 1.739356] task: ee63d400 task.stack: ee70a000 [ 1.739365] PC is at mutex_lock+0xc/0x4c [ 1.739374] LR is at regulator_disable+0x2c/0x60 [ 1.739379] pc : [] lr : [] psr: 60000013 [ 1.739379] sp : ee70beb0 ip : 10624dd3 fp : ee6e6280 [ 1.739382] r10: eefb0900 r9 : 00000000 r8 : c1309918 [ 1.739385] r7 : 00000000 r6 : 00000040 r5 : 00000000 r4 : 00000040 [ 1.739390] r3 : 0000004c r2 : 7fffd540 r1 : 000001e4 r0 : 00000040 The gpc probe fails because of_genpd_add_provider_onecell() checks if all the domains are initialized via pm_genpd_present() function and it returns an error on the multi_v7_defconfig case. In order to fix this error, initialize all the imx_gpc_domains, not only the imx6q_pu_domain.base one. Reported-by: Olof's autobooter Signed-off-by: Fabio Estevam Reviewed-by: Lucas Stach --- arch/arm/mach-imx/gpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index 0df062d..d0463e9 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -430,7 +430,8 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg) if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) return 0; - pm_genpd_init(&imx6q_pu_domain.base, NULL, false); + for (i = 0; i < ARRAY_SIZE(imx_gpc_domains); i++) + pm_genpd_init(imx_gpc_domains[i], NULL, false); return of_genpd_add_provider_onecell(dev->of_node, &imx_gpc_onecell_data);