From patchwork Tue Sep 1 22:49:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7107541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E0B6BEEC1 for ; Tue, 1 Sep 2015 22:54:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50D20205C4 for ; Tue, 1 Sep 2015 22:54:10 +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 4261C205B1 for ; Tue, 1 Sep 2015 22:54:09 +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 1ZWuOb-00036x-7x; Tue, 01 Sep 2015 22:51:17 +0000 Received: from mail-bl2on0122.outbound.protection.outlook.com ([65.55.169.122] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWuOX-00034p-Nq for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2015 22:51:14 +0000 Received: from BN3PR0301CA0024.namprd03.prod.outlook.com (10.160.180.162) by BY1PR0301MB1222.namprd03.prod.outlook.com (10.161.203.18) with Microsoft SMTP Server (TLS) id 15.1.262.15; Tue, 1 Sep 2015 22:50:50 +0000 Received: from BN1BFFO11FD049.protection.gbl (2a01:111:f400:7c10::1:122) by BN3PR0301CA0024.outlook.office365.com (2a01:111:e400:4000::34) with Microsoft SMTP Server (TLS) id 15.1.256.15 via Frontend Transport; Tue, 1 Sep 2015 22:50:49 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: Fail (protection.outlook.com: domain of freescale.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 BN1BFFO11FD049.mail.protection.outlook.com (10.58.145.4) with Microsoft SMTP Server (TLS) id 15.1.256.10 via Frontend Transport; Tue, 1 Sep 2015 22:50:49 +0000 Received: from bluefly.am.freescale.net (bluefly.am.freescale.net [10.81.17.130]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t81MolND028361; Tue, 1 Sep 2015 15:50:48 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v2 1/8] pinctrl: freescale: imx: fix system crash if enable two pinctl instances Date: Tue, 1 Sep 2015 17:49:06 -0500 Message-ID: <1441147753-13239-1-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD049; 1:RYOKq8zfmOp1CEf770858JQ7kYCXH9BwUWdncyYB3PokWIarx1TdXkL9mB8zOQsjWmDs+n7azeBht0+17v2ZuNVMVcjgYg51YkuSp5FBGGEZ0LPGUn4GHLruY6CNMok8HhP/sJrzvqFxXuC3djHOUE4XNazDr00WSs6jLJkIKscOP3dhuffj+nBKu1mZdUEKjTEaywopNVfOPEG+pOs8PmehvH80fcSli4JrSeujRnQVKcnX84edjTuQmFqrhDXjKhkeB60JWhZ1Gjr28kwvFjdortxY7xhALvgPoS7f9fSSrmrad1t3domyBOYkMItMez33obTSjpK2a/BuoEmiusDT1Z1NTYe6RCoIUsCGzjgkhX85vE8VaEHE5FeLolkeagNjX2SSLHZinxrW+Oo+oRFRWmW6XPTJbMZAAqJn7uaxX7oFFQ3aRsky90gtsg+r X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(3050300001)(189002)(199003)(6806004)(19580395003)(189998001)(19580405001)(107886002)(50466002)(2201001)(48376002)(87936001)(50986999)(50226001)(86362001)(5001960100002)(5003940100001)(85426001)(33646002)(5001860100001)(92566002)(5890100001)(77156002)(77096005)(62966003)(47776003)(68736005)(4001540100001)(97736004)(5001770100001)(64706001)(5007970100001)(106466001)(81156007)(46102003)(229853001)(104016003)(5001830100001)(36756003)(105606002)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB1222; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1222; 2:veyXIZOs/qbfd00lCPMQLItOYZx8iYhpYXu7IZoY+QS59Tmr3Uyfx5OHeMZcp+GDhMTyCF2rMhUlgKpxjTMyTLhOH8+PlyWyM3FSZnd2BmPni4XGJNR2CS8HNGt2EIcVa/4nPiGQUJbmlxuRx4BtGMvJ4FqmIASCG9MJe3ZwS7I=; 3:doWu2IUNI7V6GX37hzVc1qMRObYc/BwMSYxkiqy6Zmk2nF9LkXtqMK/VrGnk7kP3L0lD95Wq8Ji4ralABLscYjYUSEvV4DhlEKKJyWPEHqvDovSLfEDxbLheWDa2laJ6QkzXPk8wbvvupEirI2FHlp26xAOFNpADoN6MRV+hNP9+LxjdustoCfQFWWok7aD3q/PIm41fU2sy3yeLTliOIXfB1fiPisGGBCmmny11wxo=; 25:QpoO397JakM2E5EnomXkRJkG6LLT76GlnppVkdaofzcSs6cp1KpR/3Lzm6aqmV35pJnYtdQl8ke6i92vA/51DPzTck7xzrJ4uEO3OPn1e9GqPK3bBIHr5f08sjhWmWW8DP6NxawVSm1XVvxJlCm6sBQcQV6JYCxIDOi43Fe7nquFCY1pIHnZJRLGwCnMw8xmE2l4ZzAGdgc+1KXKIWNZL6gHZjkLBAe4dR0GkS1W9vHKhun+CmFjjB1sKx808k8Ix/oMz+lY+B1M7R4TlK+3XQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1222; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1222; 20:lQapJkp3PKiYhOO44ZP9HyjAihXiZ7jwpQKC16/NRAG5DG/dMffK9L6uJJhnAkLGtA8/+XkCwBlQ1az7D0Q+lqTe6FnA8/UsQwfzdWqA6WEMtbL6X0iuzsTALouGNpJ3FWKxy9DEEtvtGveGfdDVN0WvWs+ckSHGR/9FxzPnnSJWAmFtBXsjB4fugAaA528q1QZ+mlDucJurZc0rGV+KW8QySNcjo9ysKl2o2U3FA2cdKnjeoL25Bckbxl0cCbuK/IaZEVZVJxjIFB/l61P1aIC9Dgo/o+l38ofRNtbJmaVJtVwLwigmHyjZPPJAa8eBvKrb5+N7jz8IuvJAg7DvhhPAWVoj0XZ+ePQsj0OuBc8=; 4:LZP3jlxUND02JKqKHSy/OlEniCpWBbk7v7jbx5Blmc2T8UZjhBgC8AMyS5OSPQ6c9kKg2doFNLptfpTEKRF1dOa7baWEpW7FdVHqqHEYkHOUR7l19xWDSbp5KuZW6u0h+AEkDLJW4KyGggy94joXKH70SisuDRvIvCjpk35fVbycZuChFIuxxYUygUxekp9PRPbp8tu2dfceRN/1I+zjj4YA8RfYHNYn27C9rv8jiPB+l/sFDLIbO5RB/X1+QID9IW9OFpVoMylMSpT5DmMXA9PwvdKLByVLzhUeh82ORgIuEGQSMD8audlkxCboH/GqV0mp/xexCHgBPnoLXDDrBw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(8121501046)(3002001); SRVR:BY1PR0301MB1222; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB1222; X-Forefront-PRVS: 06860EDC7B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB1222; 23:37rlVPwTNCiubYJYadVNY/HPcAE49fv+XKVx53T?= =?us-ascii?Q?0Is1YBhZngED8Jp9pXRN7kb9X8TQpXp+KnJg2G5JBD/UnyqRL5DPUTjtXJGh?= =?us-ascii?Q?WhejTP83LfGvYb3IjOcch6Ycgq0ZT4cuKUh8G+st7YUQ1BL/U6Ekg/ajLYkh?= =?us-ascii?Q?z4EzT+jtKeRHoEalxLxaaxxMRIG9N6lyZ/6HDH2AnHuQO1ECgRySMCaGV8FG?= =?us-ascii?Q?C4uvYxmZUxa7mOxAMtsXjXn2TqIpaez3mzHkmkxV7L+jeo2mvHLuWqYNtMFi?= =?us-ascii?Q?HJ5CzhYd3VTyAsIq7usTljobGXAWFSC4vLzZ4QoCMA6il2aAn9Wa7ITuID/G?= =?us-ascii?Q?IFUisbvko/Hw7VX2aHx3BqFDd1/oeOYFZp0VNOQerwiIctAW5I+MLxcTPoGH?= =?us-ascii?Q?yA7Bxk+8gnU0VqRP0OC96c/9cBixLpdqAEqFA3ZHZpcgSsQdPA2fOrtfUSZn?= =?us-ascii?Q?kShqc7cDPPEz/P7yoB43XV3HacuL/F3wDSo/pbFrVxeXx3ZWntTMAvS7RhKa?= =?us-ascii?Q?57XqQquXqlNmr5YfBKfvH4BSpfY0aUSZTik9owL5f2lQs334sCCPHFyZdRVx?= =?us-ascii?Q?cLVPy+92bUVnIYGWMSTvjFvetRA9Se6Dx8VQgxiKiSjr6sQAMgcupDQMMxTi?= =?us-ascii?Q?7PYDD7cF9ON8XIpZ3b4J4Epuewlhb0adKjVYIDMggvzQ/eixLcQ7TgbU0R2y?= =?us-ascii?Q?Lgt7ueNqqgxn1RaPx5jnvu/xdEYdiAN8fyjV+hlxuUNsFlPCfmbu7o/lUimG?= =?us-ascii?Q?UiY/KCCQeXAwStBhfnqRLsezlfJe0NW7RVnvMpbqmocI6X7paYhRE4C/4Olk?= =?us-ascii?Q?AsRPEnPX/sjyxPQOot+tSF62zux5734WW3kCRdIpbOsBSq+nuCXm66+rkYfF?= =?us-ascii?Q?fzkn4JWfiMb7IHBCECGT3V/VoYqC4aalsz1PLtmXMmsKMDBpWT/JBgSkznd3?= =?us-ascii?Q?lzLiaAs086cJkOIrxlEdKNm620t9ZG1lFXStTgrgwx5roW/K+2yRINh5TbBE?= =?us-ascii?Q?aLY/9XfAC8+cU3asskSovV4GV3EatSwjEwUxpVG482a/YbB8XPgvcd7hUTZ3?= =?us-ascii?Q?ejW2P36g5iENonU4Zc5EMtLOoztc1L3lz9dchbDf8T4MKfsgYXYLD+LIzCVX?= =?us-ascii?Q?lF0Y2GYI7QtVd56Ca96obaX5sg0/aiKvvVDr7pLNfA8eqZzsS4OKQB7cYL6r?= =?us-ascii?Q?AeTq0/XquIQ4do0a6xWUrvGR+1mHxP2+UpJ/atJOENiBMM7yK3iofX06JxQ?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1222; 5:TzyHeEh+KQK93xI3RTEG70UgvBPEbA9cowbdOcha2pxo8QN2LneaWSQyrgnYHnuNwVuzhCUdhLpH1C81sNP3Tet1llQ1HKVelVh0EgFW3BhltoqzXiQGeXyjaYSyzlp1Cs5HX0VB/JtAqcLo37inTA==; 24:PCFrliDj81Pk1shrQbvkOzfDJxD48EAfqMPp4GnTqjYQLQXY56Mu37tYueI0woKSTIkyhkusWEA834dPtfigpwpXywVOCp7EPFX2KhIQ5ds=; 20:R4pPlIqdQja4DbfaaekQutSKFtJIPd98+V1DQEiJR6LzjI5/C8Q2CG579xPVKQl2DS6ElWRmheiWF3ixnZ8Zwg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2015 22:50:49.1023 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB1222 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150901_155114_228102_9D46D003 X-CRM114-Status: GOOD ( 19.07 ) 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.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_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 Fix system chrash caused by groups whose number is smaller than the number of groups of the last pinctl instance which is not initialized. iMX7D supports two iomux controllers (iomuxc-lpsr and iomuxc) on probing the second instance (iomuxc) the chrash below occurs. Uncompressing Linux... done, booting the kernel. [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.2.0-next-20150901-00006-gebfa43c (aalonso@bluefly) [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7) [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasin instruction cache [ 0.000000] Machine model: Freescale i.MX7 SabreSD Board [ 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 --- Chages for V2: - Reorder patch series - Add platform boot up information on kernel error - Move gpr_index to imx_pinctrl_soc_info drivers/pinctrl/freescale/pinctrl-imx.c | 3 +-- drivers/pinctrl/freescale/pinctrl-imx.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index d7b98ba..95db9e8 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -580,7 +580,6 @@ 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 i = 0; dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name); @@ -599,7 +598,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np, for_each_child_of_node(np, child) { func->groups[i] = child->name; - grp = &info->groups[grp_index++]; + grp = &info->groups[info->grp_index++]; imx_pinctrl_parse_groups(child, grp, info, i++); } diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 49e55d3..26f8f1c 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -81,6 +81,7 @@ struct imx_pinctrl_soc_info { struct imx_pmx_func *functions; unsigned int nfunctions; unsigned int flags; + u32 grp_index; }; #define SHARE_MUX_CONF_REG 0x1