From patchwork Tue Aug 18 15:48:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7031991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2935F9F344 for ; Tue, 18 Aug 2015 15:53:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AFF220452 for ; Tue, 18 Aug 2015 15:53:19 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 4D1C820421 for ; Tue, 18 Aug 2015 15:53:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZRjAj-0003S6-Rw; Tue, 18 Aug 2015 15:51:33 +0000 Received: from mail-by2on0109.outbound.protection.outlook.com ([207.46.100.109] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZRjAQ-00039b-Mf for linux-arm-kernel@lists.infradead.org; Tue, 18 Aug 2015 15:51:15 +0000 Received: from CH1PR03CA009.namprd03.prod.outlook.com (10.255.156.154) by SN1PR0301MB1645.namprd03.prod.outlook.com (10.162.130.139) with Microsoft SMTP Server (TLS) id 15.1.231.21; Tue, 18 Aug 2015 15:50:53 +0000 Received: from BL2FFO11FD039.protection.gbl (10.255.156.132) by CH1PR03CA009.outlook.office365.com (10.255.156.154) with Microsoft SMTP Server (TLS) id 15.1.231.21 via Frontend Transport; Tue, 18 Aug 2015 15:50:52 +0000 Authentication-Results: spf=temperror (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of freescale.com: DNS Timeout) Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Tue, 18 Aug 2015 15:50:50 +0000 Received: from bluefly.am.freescale.net (bluefly.am.freescale.net [10.81.17.130]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t7IFoNEN021180; Tue, 18 Aug 2015 08:50:49 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH 8/8] pinctrl: freescale: imx: fix system crash if enable two pinctl instances Date: Tue, 18 Aug 2015 10:48:59 -0500 Message-ID: <1439912939-17535-8-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439912939-17535-1-git-send-email-aalonso@freescale.com> References: <1439912939-17535-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD039; 1:HDCJrYc7ZQJF7+0GIefZp7boD0vaxhN8px9J/CdjWI2nUACQcu8k+NpH6FwF1oPfwcSUmMvVxxSP8Y/jtEiH7BLmgNimFinrGUZssrAEE6Rxk+mBsYvFfDF/gp9S86CJ1uN82oUCOqvMkyWt8kvdBV/NwmDc6G/BmjOOayrt4nGL3R7FRdSbMFGGLVxKBtCJlrhXia0VPZDkwJkRc3bnK/Da31Xo4qtbuTEccQRumsdH3fOWMbOSJbijSXFK+g1Kc4A1vJBCvwOMcxPVzN80cgYDoVcCLPrv6Djsr+1aLdfOodGl7kYK5UikJFBY606ocLuU3w1kk4gWQ+QX2eG3S5b+rO/tPKgbA6QJbiE5VRWkbVddckKpEv2gp6K8ZtbDwAS04lC98Pm4nLBN2oj3+A== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2970300002)(3050300001)(199003)(189002)(105606002)(76176999)(64706001)(46102003)(86362001)(33646002)(2201001)(104016003)(106466001)(50226001)(36756003)(87936001)(47776003)(69596002)(48376002)(50466002)(50986999)(5003940100001)(189998001)(97736004)(5001830100001)(5001770100001)(4001540100001)(68736005)(2950100001)(19580405001)(92566002)(107886002)(6806004)(5001860100001)(229853001)(81156007)(77096005)(62966003)(77156002)(5001920100001)(19580395003)(5001960100002)(5890100001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR0301MB1645; H:az84smr01.freescale.net; FPR:; SPF:TempError; PTR:ErrorRetry; A:3; MX:3; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1645; 2:dz/1gOVQbfNXaLn365dV+cEImAjAXX4VL4SUdqOtXKhb+4pIZxm3XeowDGohVvAi1HByhVyCJneb7SbjKQez7nEmHZcD9HilWTdE+WDnQnqjTkgQ7GD/7n1iaICeJOwef+bbV7wdmstDc5cRXwgED6shaXL2TfFa3156Xc9JoTI=; 3:of2mErm2nKNPcMNilNdeRVuTjLkKkNP+RWw68GVz2wDka4tUVVRiqGGFxuxtcJeNP+A+3inFlxLpt3wzT1UpAXlZTtFwY96sUlZYmQ0gdPaiYzwDERy2/f+MfW6z/1iWmH2dMjTmWGtzfRdrOoNgbSqSQHuGtngFILo5gLi0uxD4rIJ1vhs9HURp1qKEZaujXM6l/FVaysHftNYXYduYHmyXHEo1kHABWtZVIFvShuk=; 25:XdZglD0YoDkx9tNR2HkYsPNsoqRz3OUaC8Om7B+0WLpsdWO6VAIP2m8AB6h7xV2kIpw/rlI7z/Oifwj8cbEzB0oTr66ib99a9ELjXUqj1dJD9uszQfsGs5cTv5TgPpuBgncfFw0mvLcCM4uautpAJYAfBXRn7aRsBW16yMvdo3PkeX+2jfd5ngs5ImsQoeZzxSJZWjYYphdd1FAdCnu3QG61xwo/aJA6nMwnKUlPjEubfOcYGTaud6HS/mHSAr47 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1645; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1645; 20:/hg3WKSk1gLlT+vCnA3VaMSt8D0J1VvdVlsgRaPZe04jo6yjbgu9N6wzDvtwLRGVW0aAdW6Gz0HLNWCCZec00MG8Blv0yIZougSamCs3URTVBLFhgQiaGs8HuQdes4pHeDPPW4bh36afWEE6VAXV7ecQNqva+SVr2STLM6FtOXGCoW+uC8RyDWdyTUBtwKq9Fwn208n6y2URECtQ4bp7JZURDMRZOKQdJTq+BdnHLU1svlEWn4aqNX0Lmc7817ucSIMW/NIhesa9YcK1RYIjjlmDs5Ni61967jQWE/uaLAGGiJ6g1yQSn+45gMkxrwuRsM6/K78g9wuZRcZ7izMb/7TOQe58VwH134ZqK04mPpg=; 4:nAWm5D4kWnakPI6udOhjyG+tnEVMU4lO3harZe+xZ9dVbrE7uJD4VwlRZQjtwxIfybbpZT0J+I84FTN1me1nM6dINI0uKvsbSD8F9rvUZcvVihx3UDK7H3rlx1l6HVnOspiyNROd+P7XhUeoz+dFn89+lXQVKhYlrBMcqx6a646IJWoPB3gWZJ0mw2oQXm7x0jK6fUEuizeNK2u1+hvGEy1q+Odo7CBAO5acWCR8E3uGmNFIn+dVT9Z5E3x0HESNO2mjXz/CbYoo7tmbhMk6jdY5LY3ju5qBGSNbVEN46COGDrMsbQ7U1Kodto2Fs/zz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(3002001); SRVR:SN1PR0301MB1645; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1645; X-Forefront-PRVS: 067270ECAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1645; 23:P7zZHAw1GjNW5LNj+2mdozfPW9Q7oxn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tbjKE+vN9z8ww3gOjSmF269jAD9dC644emtNqmp+7hFS?= =?us-ascii?Q?OBcs2MHL5jV/22zBim7nME0hoDDpYdhy6p7oPju4+HpgqoF2ZQeUOqmGAzpF?= =?us-ascii?Q?3M1UVB1bU9SKVHFl/v4uU1jI6JFVmmXOpRnP7AeY8dzTEtdZgH/a4sdKK4G/?= =?us-ascii?Q?mPpYkQ33N2+OfUji4qYuNJTfFPzEc9YOVrVT9PveBh6dWSQ/phe4cGu0NiBP?= =?us-ascii?Q?1i3h5TpGtOXwAjHnC1e1Ux/hXSL6A0lXRHRol/YxSAWBAXqkmm9GG8DoLPA9?= =?us-ascii?Q?0jeIJJIEzJg9DtV8/TwYB7wG/XhnjIkvWdkYna4c5p2PyrT1zyYlxeTqPNFH?= =?us-ascii?Q?hmdNXjv4TFdA4pcFB3Wg=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1645; 5:/WRTEc3DjbdF41+Zubw8OInovfVYwaFRGu/t0CI3rP9+JsMXI7l66FM4T6XOBSmTMWlyiakp7krT1Xcxq/42Ja5uf2T4WL+1ooIna781y+rlIPCikFPBUx1gj/haEAohktRUYO1aPr2fMxFTErgqcA==; 24:9qp45qnleICyQPZZmvjY2EckUm/C9BfEuoU4Ous1GEcokYl4oQNqeRGN3ms2War7Xwu58kyLpePt/7fr9DhkPjheHr5W80eNnncZZSgI6sw=; 20:vYnqbQrB7+YMlET1ha/fcnzOXGHw04Td+F06skyIHBbrS1cwWagLOVPPXguUIIhkhp6wWD2TCQJZIZa6HUzMBw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2015 15:50:50.7944 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1645 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150818_085114_807203_15C7FD51 X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -1.9 (-) 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: devicetree@vger.kernel.org, Frank.Li@freescale.com, nitin.garg@freescale.com, Anson.Huang@freescale.com, linux-gpio@vger.kernel.org, robh+dt@kernel.org, yibin.gong@freescale.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robin Gong Remove 'static' for 'grp_index', otherwise, it cause the groups whose number is smaller than the number of groups of the last pinctl instance never to be intialized, thus cause system crash as below [ 0.661012] [<802a6cb0>] (strcmp) from [<802cc80c>] (imx_dt_node_to_map+0x58/0x208) [ 0.668879] [<802cc80c>] (imx_dt_node_to_map) from [<802cbe24>] (pinctrl_dt_to_map+0x174/0x2b0) [ 0.677654] [<802cbe24>] (pinctrl_dt_to_map) from [<802c8f18>] (pinctrl_get+0x100/0x424) [ 0.685878] [<802c8f18>] (pinctrl_get) from [<802c9510>] (pinctrl_register+0x26c/0x480) [ 0.694104] [<802c9510>] (pinctrl_register) from [<802ccf3c>] (imx_pinctrl_probe+0x580/0x6e8) [ 0.702706] [<802ccf3c>] (imx_pinctrl_probe) from [<80351b58>] (platform_drv_probe+0x44/0xa4) [ 0.711455] [<80351b58>] (platform_drv_probe) from [<803503ec>] (driver_probe_device+0x174/0x2b4) [ 0.720405] [<803503ec>] (driver_probe_device) from [<803505fc>] (__driver_attach+0x8c/0x90) [ 0.728982] [<803505fc>] (__driver_attach) from [<8034e930>] (bus_for_each_dev+0x6c/0xa0) [ 0.737381] [<8034e930>] (bus_for_each_dev) from [<8034fb88>] (bus_add_driver+0x148/0x1f0) [ 0.745804] [<8034fb88>] (bus_add_driver) from [<80350c00>] (driver_register+0x78/0xf8) [ 0.753880] [<80350c00>] (driver_register) from [<800097d0>] (do_one_initcall+0x8c/0x1d4) [ 0.762282] [<800097d0>] (do_one_initcall) from [<80987dac>] (kernel_init_freeable+0x144/0x1e4) [ 0.771061] [<80987dac>] (kernel_init_freeable) from [<806d9c7c>] (kernel_init+0x8/0xe8) [ 0.779285] [<806d9c7c>] (kernel_init) from [<8000f628>] (ret_from_fork+0x14/0x2c) [ 0.786981] Code: e3520000 e5e32001 1afffffb e12fff1e (e4d03001) Signed-off-by: Robin Gong Signed-off-by: Adrian Alonso --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 3e02887..cdb5463 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -595,7 +595,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np, struct device_node *child; struct imx_pmx_func *func; struct imx_pin_group *grp; - static u32 grp_index; + u32 grp_index = 0; u32 i = 0; dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);