From patchwork Mon Mar 20 06:15:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9632575 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 437F76020B for ; Sun, 19 Mar 2017 14:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 346E726224 for ; Sun, 19 Mar 2017 14:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 292BC284D3; Sun, 19 Mar 2017 14:19:50 +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.3 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_12_24, DKIM_SIGNED, DKIM_VALID autolearn=no 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 8E27B26224 for ; Sun, 19 Mar 2017 14:19:49 +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=Ot3cUdv9616omrkESxFZe0l838n0sy4Ao0gzenLDdjk=; b=dVO5kWV6g1jKqx uEpU5a8pIyyBxyk4Ia4xHEChdLVHc/zdm+CNucOxsSBkR9/seojX3KxTDCZ9GTQnzGSzxVlVbmJOZ /p87vjDfweoOy+pSKrjtgIwZzOlBvcInKiGFqyEj+PVnXp7Flw0PdC5Q+UQLhIgdnJHkXR9+VYZQQ TRZzYE1b815EO8xbaAad7eqYh9Yv2r957U/zSUR7RyjSPobYcWhoduCijz80QgfXza56u3ZhTLpno Zzm5uZCYzVCzHPKTjtNKwatEffWxgk0y4j3XJkFhvFv4yVkyEGCcLz6d+Oarj9j1xOuZdAFF+HJ0T JZ4wE13dNX4Tl3EMiUlQ==; 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 1cpbgQ-0004BR-DI; Sun, 19 Mar 2017 14:19:46 +0000 Received: from mail-by2nam03on0085.outbound.protection.outlook.com ([104.47.42.85] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cpbgA-0003va-Ng for linux-arm-kernel@lists.infradead.org; Sun, 19 Mar 2017 14:19:32 +0000 Received: from CY4PR03CA0007.namprd03.prod.outlook.com (10.168.162.17) by MWHPR03MB2799.namprd03.prod.outlook.com (10.168.208.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11; Sun, 19 Mar 2017 14:19:08 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::121) by CY4PR03CA0007.outlook.office365.com (2603:10b6:903:33::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Sun, 19 Mar 2017 14:19:09 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; 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 BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Sun, 19 Mar 2017 14:19:08 +0000 Received: from b29396-OptiPlex-7040.ap.freescale.net (b29396-OptiPlex-7040.ap.freescale.net [10.192.242.182]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v2JEJ18f024445; Sun, 19 Mar 2017 07:19:05 -0700 From: Dong Aisheng To: Subject: [PATCH 1/8] soc: imx: gpc: fix gpc clk get error handling Date: Mon, 20 Mar 2017 14:15:40 +0800 Message-ID: <1489990547-1510-2-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489990547-1510-1-git-send-email-aisheng.dong@nxp.com> References: <1489990547-1510-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131344067486579512; (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)(336005)(39410400002)(39380400002)(39450400003)(39840400002)(39850400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(575784001)(6666003)(86362001)(5003940100001)(189998001)(2351001)(47776003)(33646002)(105606002)(2906002)(76176999)(106466001)(50986999)(5660300001)(77096006)(53936002)(54906002)(8656002)(5890100001)(8936002)(50226002)(85426001)(2950100002)(6916009)(4326008)(104016004)(110136004)(39060400002)(356003)(38730400002)(36756003)(50466002)(48376002)(305945005)(81166006)(81156014)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2799; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD008; 1:kb7qbdLKtsqajP9SQpc1nQX10sLoVLNMt9dNakHJAg5QEPLIwENp4/KcxaQcWzmOVJY4tooQ+i/H5y7Q0oIB5H6WsBJZ5fQA4ootCHPXTe4LVX4qavp4bg4q1bzPtDJVEp+BbOlDTrEqf9GhX1fTX1/r+gpDhrrQYAPZU3OD8QRmEPqCYl6kg4U9ese4JkLe0UZpG+vWOaLT8V1Wlz/PrBjUqloJO1M60mW5EihfuGtSL49t2w4gSqos8PgSNP2jOYHkeNlzGYv6JVMf4wSQHCisAN8HzweUuAdkxEYYh+0RDS98i7acJxr5R/nCj4ROT9lgezT4wPNt+8HEg5fu9a0pQGgymIp1Ky8gvj9bTcv5paBtZ69jSRl9BdXxsA+JhjF1DoEp4r5V29nfVBtU+o+oO7QbYszjhnmK1ZXoEzxW4GGDQoFK6kwsboz+HDyJ70wslvufIMAa4MgnIrYoPyqc8ZrUffaxsVGYJIcCfM0oPmJHDagYc/gaDJLaOtdR6hfuYvozb4u4qRJShzaEFrNxjl+4ev6gjLgch9K736kjIcWpjdJ1qgi0IyaNoz3mPzTyc7uzXgNYA1x2d4uFFfAh5bQP84fPiQD4XsvpHcE= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2bb2e14f-d4bf-43f3-19d8-08d46ed2e859 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR03MB2799; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 3:67tSg/d4P8M/mwecPpsk9lIM1gsN+mFS6JudKyjp0l52mNs+ugLPPv5svXG1jOwK8oizYtbMmiWFHhfKr15MUEmNcXsFUnuLeIohgYWtrw5q57lvV83C+/OHh+8HMiCc+KiQ8V2CdJbVwG6N3fytACc+K8utM1n5rZECotx5nyCotfsfiNqHT88/watgCNRuR+fRknD6HRa69e4rEBYOksEm1m6Scr0+MQH6QMI1qrQv8E9nz9APDDryHHA17V0U40z0OVqk+u2q2OjB/laNqGi7WM9uj01HbZIQyWKfdY2xoeXbRe6djeHQ9OeMOzs7IReKgUGzG3GzMerKwhAtfdNed3dqOhoLO701tN0+CtIhVsExMlr9CN116JiC7j5J; 25:mlpgD5Ch+C1Lxe7rSUnHfbYxm9u0k2yM0XmW7RVgd2SwFzPMtvavDZdU3yfgPNR0ok17c5alK89bZOVLMLCh+Q5eARhkp1QWMFtBoJU6E91y72WQ0qR/QIKG9xH8OJy9P+hkyyq+6t6uLKP0APzC9FdrcD4DzDYV6gL8avJ5iFxxWM5WhptzD8EJdLVvMvkCPrRDi2aD6G9qv6GA2f7mSeDGi01Vpcddv5o/4yLnfzkWZjYZm4HmVV31+aJDyXX54wSdsTr/fhNj/e/pN0nGlR9CKr2pLSBnQdV5Otq4qUBtD3Q08aDIBrDvkSId3VnMjdazmrJOAd8H/3yoNpXQpCp7//n86we9yL8IaeCGTt7skJCjjAqj+XBzPzBK3QcRVQZpF8qBcJ4YVCyX5sv07NmqlGP2hgu3GwGP+pHRdzMo8BS7aOAIi8onDqeYLEqS9ePPxxrkP/RtSkV17V+4FQ== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 31:zfDLTE6fWxLzJcsvEz7Rs5WZOL45GuBvDptbwX4a1IBkEDU7R68MYvpKD9Bmq3c1nqkzbR7nKeMJ+4AfWtCEGGaW4cMBl4Z/gVLyp5uxKvxq5uGgzH8HS9XyXDmZZ8IaL9FliY0Yg7e1tlmZSTy744jd+ckSOpeQc8BfeybmRncDhzNVW2VtDILFhGdnQuuFqyxtaFeUQTHTaUeYBCU4VLqnB2zTl7dq1fkgCSjOdDl04GhP/HJczEuU6YZUZn7o 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)(13015025)(13024025)(13017025)(5005006)(8121501046)(13018025)(13023025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(20161123565025)(20161123559025)(20161123556025); SRVR:MWHPR03MB2799; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2799; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 4:vIODIc8W/yCykaClO5piLfNgimh83JH7YxjSmFRn5dYBSKbU8XxtARn3qoRHJ2Vk2a8t+BP5fkgy4R8mAR+lm5MHLB978OhwC7JW49isgQCQao1plxzHGqWQ8GVlaqCHwrcjAb7a9nKJ39nTWcZfXv6AFC8NVdTLb7TVH3i6bSfluWjQR4d/YUPs8f3ckWlviLSsP4zZKbVafQwW2vCCrhO9/zszqgCLZPyUOeC7v+ZNcefZY1WPtY9/naotW9sXU1e9xzLh6veaC4vc+slFkmeAdgnKWxWWVe6lvROeyVa3jy+xRo/vMovxTxNy+yD3oQj1gDi5ZoNOl/N5kuqUZ8PVvbLdJVdwZs3uXuQUbjEdbn/Z8+kceWBAaK24rrOv8ULyXeaF7cW3MydNR5EJsxv2YtJTOtroQ88VP98qTyLMQ+U4Vpcrn1DQGQ1KXxyAvif4xJ3Kj0qElfR1ys77dsg4Uxfw0CW8evQsGI392ZtyKZ8xa0qkg0BIVx3NhXBxr7MaIIKeEGhj7cUjY9/x08c9TSPIUrzmoEFSCzsVlfODIai5PeIt44aqPVPZ3zsM8Iufu87OX/Mk33IDLccw1uM4/4JSWYx80HIPUpqNeA95WutiLhkZLT/P8ZnqaI1AHW2e6nKoiXZkNUFxLa40jpbCBRtk+H14I8ydyDEIS9uxQwl4/Q7G2aLdryeLR3D54R7xi4ZRZ/or/6QIA7xCoFh+NVR0xaNqBskWRis4qzALalJzyjvuGU2SMMu1Nwvb X-Forefront-PRVS: 025100C802 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2799; 23:cQAR5c9xN8uK0vXDnNZjLkcwN/NDfzW+sTBqQh0uR?= =?us-ascii?Q?f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+V0cdwQscsDeJssJHlpbXnEQxvtcHT4NGE3E3ApqVvzLUJH5em5nN6yl4xpeBEzvM/9asH/jBbzsquVWGp295ClD3G; 24:nAJT9nkBPUjEoRan9vev9gL/jU1K710Coy0s7ZQBme2JBHDHI1mVDSljo5O9kqaLnR2Wqz8OS9e10p4hOweBTcq8bCEJ4YWd1AofmSjmPBo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 7:wUnh84y1TF7idrkLPxHmoqdN3UpCNxJisAnHqx52Qxlda+P6R45YXJ60bX/WyCDQFv/hMkL2nVAq7+UbOoPs/qdaTkeyDz7fxrZkItYciqaFoKhx/+AjTpR/R90xpvp+yX9VwDF4CwMzF/yj8msZe5MCQg9gduQN2nH8gzuchzyGTDdwtYmfZZ0Wtd7YYHQybq1poo3cCUVXS4ZMO4EsXVA37nXoMgI1z4DNVJfvGMRd9hLo4puxWRhEVSm4H4RdR/2S1kNupfXFxDJd8K1s9UOzR80XhtD1m/auAYZu4AP4kGlu3GgAYtY1+4zEc0vs8Kg4/PpaFaduTNjdINWsdQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2017 14:19:08.4239 (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: MWHPR03MB2799 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170319_071930_805466_932F00C8 X-CRM114-Status: GOOD ( 14.77 ) 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: aisheng.dong@nxp.com, dongas86@gmail.com, andrew.smirnov@gmail.com, fabio.estevam@nxp.com, shawnguo@kernel.org, l.stach@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 We got a following kernel crash once supplying one more IPG clock in GPC node in devicetree. The original error handling of clocks get is a bit wrong that when reaching the maximum clock get error, the index 'i' is already GPC_CLK_MAX which can't be used as the array index for clk_put operations. [ 3.000110] imx-gpc 20dc000.gpc: more than 6 clocks [ 3.005141] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 3.013487] pgd = c0004000 [ 3.016300] [00000000] *pgd=00000000 [ 3.020060] Internal error: Oops: 805 [#1] SMP ARM [ 3.024957] Modules linked in: [ 3.028122] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.11.0-rc1-00056-g813791b-dirty #1140 [ 3.037801] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 3.044435] task: ef298000 task.stack: ef294000 [ 3.049080] PC is at __clk_put+0x38/0xec [ 3.053103] LR is at 0x7f54ce9a [ 3.056345] pc : [] lr : [<7f54ce9a>] psr: 60000013 [ 3.056345] sp : ef295d48 ip : c8a582b2 fp : ef295d64 [ 3.068026] r10: ee9fc400 r9 : 00000000 r8 : ef398c10 [ 3.073354] r7 : ef398c10 r6 : c1071264 r5 : c10710f0 r4 : eea5be80 [ 3.079986] r3 : 00000000 r2 : 00000000 r1 : 00000100 r0 : 00000001 [ 3.086621] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 3.093863] Control: 10c5387d Table: 1000404a DAC: 00000051 [ 3.099712] Process swapper/0 (pid: 1, stack limit = 0xef294210) [ 3.105823] Stack: (0xef295d48 to 0xef296000) ... [ 3.292660] Backtrace: [ 3.295222] [] (__clk_put) from [] (clk_put+0x18/0x1c) [ 3.302206] r6:c1071264 r5:c10710f0 r4:c107124c r3:00000001 [ 3.307977] [] (clk_put) from [] (imx_pgc_get_clocks+0x64/0x78) [ 3.315747] [] (imx_pgc_get_clocks) from [] (imx_gpc_probe+0x204/0x31c) [ 3.324209] r7:00000000 r6:c1070eb0 r5:00000001 r4:ef398c00 [ 3.329980] [] (imx_gpc_probe) from [] (platform_drv_probe+0x5c/0xc0) [ 3.338270] r10:c0f00608 r9:00000000 r8:00000000 r7:fffffdfb r6:c1070f20 r5:ef398c10 [ 3.346207] r4:ef398c10 [ 3.348849] [] (platform_drv_probe) from [] (driver_probe_device+0x214/0x2ec) [ 3.357835] r7:c1070f20 r6:00000000 r5:c18cea74 r4:ef398c10 [ 3.363607] [] (driver_probe_device) from [] (__driver_attach+0xc4/0xc8) [ 3.372159] r9:c0f8b858 r8:c0f8b850 r7:00000000 r6:ef398c44 r5:c1070f20 r4:ef398c10 [ 3.380017] [] (__driver_attach) from [] (bus_for_each_dev+0x7c/0xb0) [ 3.388304] r6:c05e4328 r5:c1070f20 r4:00000000 r3:00000000 [ 3.394074] [] (bus_for_each_dev) from [] (driver_attach+0x28/0x30) [ 3.402188] r6:c107f3e8 r5:eea5be00 r4:c1070f20 [ 3.406913] [] (driver_attach) from [] (bus_add_driver+0x19c/0x224) [ 3.415034] [] (bus_add_driver) from [] (driver_register+0x88/0x108) [ 3.423235] r7:c10e1000 r6:00000000 r5:c0f57d2c r4:c1070f20 [ 3.429004] [] (driver_register) from [] (__platform_driver_register+0x40/0x54) [ 3.438160] r5:c0f57d2c r4:00000006 [ 3.441846] [] (__platform_driver_register) from [] (imx_gpc_driver_init+0x18/0x20) [ 3.451360] [] (imx_gpc_driver_init) from [] (do_one_initcall+0x4c/0x180) [ 3.460008] [] (do_one_initcall) from [] (kernel_init_freeable+0x130/0x1f8) [ 3.468820] r9:c0f8b858 r8:c0f8b850 r6:c0fc2414 r5:c10e1000 r4:00000006 [ 3.475637] [] (kernel_init_freeable) from [] (kernel_init+0x18/0x124) [ 3.484014] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0ae6ad4 [ 3.491951] r4:00000000 [ 3.494590] [] (kernel_init) from [] (ret_from_fork+0x14/0x24) [ 3.502267] r4:00000000 r3:ef294000 [ 3.505947] Code: e5943014 e5942018 e3530000 e3a01c01 (e5823000) [ 3.512215] ---[ end trace 375f9f2a5ddeff3c ]--- [ 3.517036] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Cc: Lucas Stach Cc: Shawn Guo Fixes: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver") Signed-off-by: Dong Aisheng --- drivers/soc/imx/gpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index 1e9b3b8..c9bfdfd 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c @@ -143,7 +143,7 @@ static int imx_pgc_get_clocks(struct device *dev, struct imx_pm_domain *domain) return 0; clk_err: - for (; i >= 0; i--) + while (i--) clk_put(domain->clk[i]); return ret;