From patchwork Tue Jan 16 12:50:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10167287 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 0F442600CA for ; Tue, 16 Jan 2018 14:51:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED53C285FF for ; Tue, 16 Jan 2018 14:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC02228680; Tue, 16 Jan 2018 14:51:18 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F77628738 for ; Tue, 16 Jan 2018 14:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750831AbeAPOup (ORCPT ); Tue, 16 Jan 2018 09:50:45 -0500 Received: from mail-sn1nam02on0049.outbound.protection.outlook.com ([104.47.36.49]:51616 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750823AbeAPOuo (ORCPT ); Tue, 16 Jan 2018 09:50:44 -0500 Received: from MWHPR03CA0018.namprd03.prod.outlook.com (2603:10b6:300:117::28) by DM2PR0301MB0735.namprd03.prod.outlook.com (2a01:111:e400:3c0d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 16 Jan 2018 14:50:43 +0000 Received: from BY2FFO11OLC008.protection.gbl (2a01:111:f400:7c0c::132) by MWHPR03CA0018.outlook.office365.com (2603:10b6:300:117::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 16 Jan 2018 14:50:43 +0000 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 BY2FFO11OLC008.mail.protection.outlook.com (10.1.14.255) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 16 Jan 2018 14:50:43 +0000 Received: from fabio-Latitude-E5450.am.freescale.net (fabio-Latitude-E5450.am.freescale.net [10.29.244.158]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0GEoduu018438; Tue, 16 Jan 2018 07:50:40 -0700 From: Fabio Estevam To: CC: , , , , Fabio Estevam Subject: [PATCH v2] clk: Print the clock name and warning cause Date: Tue, 16 Jan 2018 10:50:34 -0200 Message-ID: <1516107034-6600-1-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605878435244006; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(346002)(39380400002)(396003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(51416003)(36756003)(59450400001)(50226002)(86362001)(48376002)(8676002)(68736007)(105606002)(4326008)(53936002)(106466001)(6916009)(39060400002)(50466002)(6666003)(104016004)(5660300001)(2351001)(54906003)(16586007)(498600001)(77096006)(8936002)(2906002)(8656006)(97736004)(6346003)(47776003)(305945005)(81156014)(356003)(81166006)(26005)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0735; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC008; 1:Oyln8LumC1jxcOxuMQ95gv716dRYqs+K4HtTuYShu7QPg/HYjDnxztTWg8l1bQ8QmcozJ/NgR7mi8SWbRWhrpRrrP5uJw1gasO/ZwfiWJxkgWUhe3Nlyakjh0f9uhOxW MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2baf413b-d4d3-40f0-068a-08d55cf084f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:DM2PR0301MB0735; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 3:K6D6DAhaZKkJTdUQjTUm24voEoBRRgL8Sgp4xg6obV0W1Rg51f4q6o7D7MkfwaG09oz/oJiAVEu52niIgaom4DmxNNgYwgQgs6t95J1UGBX+YeyTo/RAlcTlCitZYOTtfA7VyViO7ekFOLRM8FdSgx9v4TLOhVOhjp0DC9zVYQqe1e2wjS/kmnDzd0zXrR4FcKpKvqI6icPHaUHrDvwWhgARH0/UDscWNy16smbGlZS7qF8PGLKnrtKE+tEJXi7/7jJc0ZDnKUNrXt1pz7wtL0AsAqiteJmZSKy+ulDwO+bX9N2ukgAYdYVY8p47p90gKG4LmQGpybL1LQoo7Z6qIYRRGTaFbFAWSSEa0EYd2pA=; 25:s6YC7yFdD9sXbWwCc6cww1DYWNYrnJU2tA8G9EP0Dq3Brf26hSxLJNoJvs/1NDdnUjSjl0QMhjsO2RuJINLsGeuGyeDJFnavV9GZbIBSOCF00aPhv1sFgoq8WZqKTlQNahP+2a4AS8HgSwh+z36zyBj/s4uzfnSeeLZgVIl8DfJddpefvIe1AaOjnyMrl2hGKr5pfGn6MeJey7YQilPqivI6icEPHWwt+jAQV15133jVFY5OR/ExcuS4xTuuLYlcgYmeM9Jt+Ng7LY6SrmIlheutYL7BgnD1/O7Dt44+cZ+fuSLJNlcaJUFsB2eOaZC91jtAF2tCIz6ZItiWbiPIRA== X-MS-TrafficTypeDiagnostic: DM2PR0301MB0735: X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 31:VfqHzPeCwKAjjYBntFphFqUZkxYz4K72rL8T9hkNGOjYfUvZXuvw1AggDGvO42G15s7Tth0JlYb577aY5PD/ePgYgG0bZVOMhk4Tq9F+Pszt7GNq2cwtNfEcW0husQ8BjnptScxXz4EZpO1luz3Mzu/n2bcsXbfWxstofkU1H2eAEGnyInHCEm22+jRz32wABrozbAGZjxbBaEvSz6Q0HNEu/YJeSG7R8/NdfnGOfvk=; 4:xJkIxxvVqu+0ZmE725Sy3ZgR0z7iyK7JThSfyYNQUIL1uA2q/CiJiAO58CEney1MiNZ6Gx0Eg3GrzDGIlW6As6fywhpWAWOiao8kRuh9C9HqFtHgBXI4f2F5FzYoQ7VC4fK98O/huTu7DfIIzo3b8A47WO91mhBKtRnqND2F1kW6XtgrBnZ9Mcof3B1Hy85A4xAv7f3xu4d/MyMi7A/I9frRyeCph39PFfsWxNCO1XSY88cmj6b8RRSPHMSzDcsyO2jJAZv2KYbnqgsJWV5PAWf6NLEg9oSl1l9XJid7otGjXgAHaV8P2NkI56aJAqn/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(2400036)(944501161)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201708071742011); SRVR:DM2PR0301MB0735; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM2PR0301MB0735; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0735; 23:l5xBEvinF0WkBvHdElEHBoC6zZwGS5BVVnE+Y/V?= =?us-ascii?Q?sHHwZeGXLukpMJJOLeDUD5lg4rTeXyIgKpyNh3scwuvS1kt2RWg3rynLf04y?= =?us-ascii?Q?zFNuabDUzpeoEkfQy9bl/0DrNJQFSBmBeliG9uM908iRrW1JiDTwC6Svyj45?= =?us-ascii?Q?w7ZF6+DfOwLGW6nbwTmEvcD5CBeXwe+NS5fTYjqA1J8KKPyTCFL4nTzI5uMv?= =?us-ascii?Q?dBRJmmpgFIM2io4dtn1BXO/fsNZzzI48LaxENCFC52Ysst0vU2HzJdXSEYDM?= =?us-ascii?Q?gBOZAI9mhr5cptdoGc/4gWyzBZYJlbOCzWSgQXiKZj+AexwJlOS2ARlBxKcq?= =?us-ascii?Q?ZVfLTNdk9CU1hSpFJI6vNKR7pwn9DmSFqSLT3+g/AhUT4f9v8uZvpTUZqjPD?= =?us-ascii?Q?5FBL/ZFxcDThltyG/nRnujXNm+rysg1sjotCO5vQT2fklKP2vhsltveI6BLW?= =?us-ascii?Q?1MRP/vwK/m3AP7pDYf+ZIBzu+qijgQLi0681fhieCHC9e7SB5SiMfLxD5/AA?= =?us-ascii?Q?dVsYDJhbJPXc6ekEJ4aNWExmQeDo7wg3h6aHl0B8roVkJLqoETSJY+TYp8NK?= =?us-ascii?Q?6cLlzX4OuOHcgv1Tx6DjkmXTP9voexkISfq4ZEeoxTEcf3oYsHITdWINsRTV?= =?us-ascii?Q?fpppEVqbc5LuwV+Fik19cMiVdqDchcQnYabVL96LCz5IuUIYmlJo5yjRBU5z?= =?us-ascii?Q?K1PFANUKhh8V1tfXJxF6QzvljXC9YmAcNZI0wYveDTT228agDQ20AUHGu6o+?= =?us-ascii?Q?y08nleD3Uu+3JJ2HDQEC2PFkZFbKEn5QRuc1yUjX4CUXcp/SPiN+NpEnJ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varh4Zz/2Pz8knZU+4hQZkdp/03rE8IJTzHgnt4BHrwRnHShN97y2/4+ELv00zDvgn5c6j5vqDt9XVrMuFzd5b2WAXbTfj3f/LbYIdIMlVTeSlFew/9K5KiaPTR8h1/LyBWwXb3AWhD2jLA3k3+vQVg5dxVJT3Q3yLDJDm1VeTpcN80/LZPNkpy/dtwLfPEmvlYizv2K9liuvPpR7WeXkdZLpIOc0uzigVO5UxN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 14:50:43.3216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2baf413b-d4d3-40f0-068a-08d55cf084f1 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: DM2PR0301MB0735 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When getting the clock related warnings, it is useful to know what is the clock name that is causing the problem and the cause of the problem. Add the clock name and the the warning cause to the log, so that the output becomes clearer like this: [ 2.383969] ------------[ cut here ]------------ [ 2.388720] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:814 clk_core_disable+0xd4/0xf8 [ 2.396658] uart4_ipg_gate already disabled Signed-off-by: Fabio Estevam Reviewed-by: Geert Uytterhoeven --- Changes since v1: - Also add the warning cause (Geert) drivers/clk/clk.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0f686a9..c95dc09 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -548,7 +548,8 @@ static void clk_core_rate_unprotect(struct clk_core *core) if (!core) return; - if (WARN_ON(core->protect_count == 0)) + if (WARN(core->protect_count == 0, + "%s already unprotected\n", core->name)) return; if (--core->protect_count > 0) @@ -681,16 +682,18 @@ static void clk_core_unprepare(struct clk_core *core) if (!core) return; - if (WARN_ON(core->prepare_count == 0)) + if (WARN(core->prepare_count == 0, + "%s already unprepared\n", core->name)) return; - if (WARN_ON(core->prepare_count == 1 && core->flags & CLK_IS_CRITICAL)) + if (WARN(core->prepare_count == 1 && core->flags & CLK_IS_CRITICAL, + "Unpreparing critical %s\n", core->name)) return; if (--core->prepare_count > 0) return; - WARN_ON(core->enable_count > 0); + WARN(core->enable_count > 0, "Unpreparing enabled %s\n", core->name); trace_clk_unprepare(core); @@ -808,10 +811,11 @@ static void clk_core_disable(struct clk_core *core) if (!core) return; - if (WARN_ON(core->enable_count == 0)) + if (WARN(core->enable_count == 0, "%s already disabled\n", core->name)) return; - if (WARN_ON(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL)) + if (WARN(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL, + "Disabling critical %s\n", core->name)) return; if (--core->enable_count > 0) @@ -866,7 +870,8 @@ static int clk_core_enable(struct clk_core *core) if (!core) return 0; - if (WARN_ON(core->prepare_count == 0)) + if (WARN(core->prepare_count == 0, + "Enabling unprepared %s\n", core->name)) return -ESHUTDOWN; if (core->enable_count == 0) {