From patchwork Tue Jan 16 12:42:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10166749 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 F2AAD600CA for ; Tue, 16 Jan 2018 12:42:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E425828449 for ; Tue, 16 Jan 2018 12:42:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D92A928520; Tue, 16 Jan 2018 12:42:26 +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 36A0E28449 for ; Tue, 16 Jan 2018 12:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbeAPMmZ (ORCPT ); Tue, 16 Jan 2018 07:42:25 -0500 Received: from mail-co1nam03on0054.outbound.protection.outlook.com ([104.47.40.54]:34512 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750862AbeAPMmZ (ORCPT ); Tue, 16 Jan 2018 07:42:25 -0500 Received: from BN3PR03CA0114.namprd03.prod.outlook.com (10.174.66.32) by CO2PR03MB2360.namprd03.prod.outlook.com (10.166.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 12:42:21 +0000 Received: from BL2FFO11FD029.protection.gbl (2a01:111:f400:7c09::117) by BN3PR03CA0114.outlook.office365.com (2603:10b6:400:4::32) 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 12:42:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; 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 BL2FFO11FD029.mail.protection.outlook.com (10.173.160.69) 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 12:42:20 +0000 Received: from fabio-Latitude-E5450.am.freescale.net (fabio-Latitude-E5450.am.freescale.net [10.29.244.89]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0GCgHRR001376; Tue, 16 Jan 2018 05:42:18 -0700 From: Fabio Estevam To: CC: , , , , Fabio Estevam Subject: [PATCH] clk: Print the clock name in the warnings Date: Tue, 16 Jan 2018 10:42:09 -0200 Message-ID: <1516106529-19703-1-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605801411645364; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39380400002)(396003)(39860400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(39060400002)(4326008)(316002)(54906003)(16586007)(81166006)(47776003)(8676002)(81156014)(36756003)(498600001)(8656006)(8936002)(85426001)(97736004)(356003)(26005)(53936002)(104016004)(305945005)(68736007)(86362001)(2906002)(48376002)(50466002)(77096006)(50226002)(5660300001)(51416003)(2351001)(6916009)(105606002)(106466001)(6666003)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2360; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD029; 1:pjuilhoxXa6ttDlYkJQcaDFOk8B/yIUpnPTY6POkiP64iTFepbJs7o1S9w9lLkvT2rnM/JH1pMLqQkNEYdDO39BFQCM5FH6s6QYOaNfrP7zMr0SL6/FB8KVuKLr4bLna MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 709b9ce5-947b-4f04-2e51-08d55cde95fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2360; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 3:UrgagK23PaK2K9gDfIcXsHVWuvYOkHHAwtYwLdSalKahH/R9mcNV95DpJVh/XvCn9EA/Wr9cA11IU8UFW6zlaGXaPHipkxRwNJ/EGg7S4qcHjnI5cqLiEem8gaSZf3n9uBmc1xdEK61R97ZAF+ePJuMpIb2ChTj5Wb+2kloDLVa3YJSch/uGUSVE7/LgS6/ZqYYWk2uyhV0UYNIVTlvEgLfChdvd6z6zYSmymSH+nlXDhFvQlWp40ekQXFXUDQT6Gn3U1Pl3DBaOErKAjfDGbfm1F0HbOjBYjEGPuaq8oIYptCyk3DEErN2JAroJHAoKQ4PyZv0DXU8BtupsRFlvPY1z/pzTtI2FovR1h+19/Dg=; 25:vxdLyxZI0P+PxTo/jznQ0c91K5/pfg46MstQY723AOoAwxfBH66yrJgpaXv7qz9ZqsomLugfyNQ/VaXPa9LODr0aXVMcU04yK7i0ZQwD0AaoAFrsG9sXqONRRRQNThJybnZf11wptRKNsA2jqBJq62qzvcuw7IRTo2rxxE6k1EBbUMKoOxvPOgEn7UjQ8X86pMw7mCbEipPERW8tXfpWsjSC/bXfS4HAdFg4afP9Xfn1knDeWzAN/QT2OHU/Qte7W5oDh7fBGDz2KuD470/9of1lgkE7bdjvIkqdjvTmPTos99ytbf90/dlcsnR/Bm5kA4Gkz3Ry3c2kNaFF8Ts1FQ== X-MS-TrafficTypeDiagnostic: CO2PR03MB2360: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 31:U7hlp5I1pzTdFV9T7iNkhy9hbPB5yC/4WfAEoBuoOJRaB9gkyvcqM2bKbZ/h12hR9XEhq5ZlmnX4X+INNVa/K0BFQJtfRm5DkyvezVFCSLQkYb88xNxrN5wvNJkvq6aVvHsL42wMrWGGTERtz7Z+sJ3MQt3YCz820v9fClE9JM4kKAYdShczMxR73yv9r0DH13YI62QeX7kor2/uvmMrcrk4+hJhYs1Lv+sNbArz68c=; 4:2fEcvjH1rUgJ6eg+kKyQHBBoRrZ+GabC0Of6CIpEgN6/ZbfOT38D217Je0P8XiJvmOUTvUolzLL+5ZVVluWHbm0VClucSRIqrFzGEdPgqm/hdpCUsAU/obPjnsIRypeo3jsjf8r6zDBvo9twJ1Ud9i/yLcxc+qb13RSCvoZuCbYCaZqanFWw062LmYoXxZqrR/9BSzL5YJy9sW77z5g8Yep7lyvMmAbs+/TjFypIz3dAIfO54ix3DJaQ0807cBPeCK1hHdtxp3Cpfdbqd76qA5VrHrVZ3+5AfmIoFWW6GA5rh+NGbb1gNJxMbYlVMPCB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501161)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(20161123565025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123559100)(201708071742011); SRVR:CO2PR03MB2360; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2360; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2360; 23:zcrRd9qyFuzBQyJukkCYtZyBaSCA4t6iMbUZh+1bs?= =?us-ascii?Q?dB9wTH3WSRXcyGtK21+RacfeuYYuUlXzqFA0OdaL1L8G6eRDdqNzFJ2ONr5+?= =?us-ascii?Q?GMKLOd88csKmG/qV2PFVA4Lc8Uzq6CrAIAFQ68tZYyXRsTyRbnHJyUl2y5OT?= =?us-ascii?Q?MMESxDYGt65pEdthv2+V1nGRUsJi4ZRkUoP4xrnHLLjE5ID5fieYa6fmybt+?= =?us-ascii?Q?fSkc/Gw1n0pWf52QBXox/sJtF5O7nvz/t8hRmqFg1EcaT38p5Tsp0nVnQQGq?= =?us-ascii?Q?pQC0iYkl7oV+HxOt8MsIJ8AxotXOLiefMtXzakbZgcXACF4RYVWYEgtdpjez?= =?us-ascii?Q?6mUmt2R5lejmRKebsKr7XOEJpUp8dFFOWaa/c6mgG9CTtDRkXveXvsd9k5GG?= =?us-ascii?Q?f3EWt7UCgmEkeeQIEdmEEEPK5GZW21TAKFpl2PEgOlZqqEUeZ6NRctOg9Khz?= =?us-ascii?Q?JlKndm6S93HJt3U249v5zjrVgBzF0dq6MVoNpr7ShjPM0QCZtUlKxGRyjTnP?= =?us-ascii?Q?ocO8MUt5ItUEijbH5hR39/+sUzVpljacBppa/yjFol9yAZziEc+wlble0Yn1?= =?us-ascii?Q?cpc+6rxmkT2M5wV5rAlw2104F/LSjfWcBe3Qfl0/jTe89d6mA+OuJWLEWWHC?= =?us-ascii?Q?97Ro7NMWHVTkdm6gSIc0ze4V/crZHK4ycTiQcobBph8MfY6+I7FSVPVdyUO4?= =?us-ascii?Q?SGHCCX2jewNLoL0xcUCL3+5lf7eyZJ/ENDn7xplzne4qzzULI5geyILVzqyc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ijrdDLAepR9jeK73TUOYd0lmgKE4DKkFhxFvZbyWL3pY/b6rgqOs5w=; 7:0zK3Z1gaaYOH3t4QKP1mBK/TO3GifOGbWgGoBgC494R9CTOK2daJ53xXsLTrzWD2aW9e3LEUZuIZSFflrTnc1XqPveKHkDtulZZ2UOClhE122YmdewGuSElMKVP4SLqrc9DzCizWTvcw/YlgSAVmV6oVDODzBTVFeTGQ6Gc8tJuQW4p4BSWN8Y3xv18ncMdpDCkrPbEyjQrYXBc76JTQ0Vs22LA9JAzrRK7TZdwdT1VNZ6PJqzx/BKrPkaT7D0KY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 12:42:20.9929 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 709b9ce5-947b-4f04-2e51-08d55cde95fa 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: CO2PR03MB2360 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. Add it to the warning message, so that the output becomes clearer like this: [ 2.388129] ------------[ cut here ]------------ [ 2.392883] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:812 clk_core_disable+0xd4/0xec [ 2.400822] clock name: uart4_ipg_gate ... Signed-off-by: Fabio Estevam --- drivers/clk/clk.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0f686a9..42dbb1f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -548,7 +548,7 @@ 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, "clock name: %s\n", core->name)) return; if (--core->protect_count > 0) @@ -681,16 +681,17 @@ 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, "clock name: %s\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, + "clock name: %s\n", core->name)) return; if (--core->prepare_count > 0) return; - WARN_ON(core->enable_count > 0); + WARN(core->enable_count > 0, "clock name: %s\n", core->name); trace_clk_unprepare(core); @@ -808,10 +809,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, "clock name: %s\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, + "clock name: %s\n", core->name)) return; if (--core->enable_count > 0) @@ -866,7 +868,7 @@ 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, "clock name: %s\n", core->name)) return -ESHUTDOWN; if (core->enable_count == 0) {