From patchwork Mon Jan 15 16:48:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10164803 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 6FE55601C0 for ; Mon, 15 Jan 2018 16:49:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B49B20182 for ; Mon, 15 Jan 2018 16:49:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA18201A4; Mon, 15 Jan 2018 16:49:01 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 C3EE9201B1 for ; Mon, 15 Jan 2018 16:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbeAOQtA (ORCPT ); Mon, 15 Jan 2018 11:49:00 -0500 Received: from mail-oi0-f48.google.com ([209.85.218.48]:42829 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbeAOQs7 (ORCPT ); Mon, 15 Jan 2018 11:48:59 -0500 Received: by mail-oi0-f48.google.com with SMTP id o64so8683446oia.9 for ; Mon, 15 Jan 2018 08:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=67WnL5ve0RKsWgYihMs4BoORfgI6R5YXrSozS26hhnk=; b=rDt58f4lkbdnWeHaGAe4burCAGtLM8FvvdRaGXcakf4SNAtuY02txkq6/pubJ4VUiT FQVvUxFrLS1M6JM8ODLZH2Y9adgU8CGxNW8PD8O/B/TIoC+fl2u78oU1X0HgdSM4fqYV Ww/WYrIyJO8I7ML/1RFGmd+TAKntRJK8ibR8s+Odxah/K8ULvAQuITq6fvaE1Zd14sig 4c8sM231Gh+fhYnZd1tllMNZlkfPGjeuakzYnk7lnbYviEtKI+tX54g8d2do8S+z7tAa 8tLsafpaRusZpwRZ2zJ18sZPgVjx48R3gU60+U5K19qamVPRRcqIVDZpIxEc9oNYkVnG w1UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=67WnL5ve0RKsWgYihMs4BoORfgI6R5YXrSozS26hhnk=; b=n61STj70R4i/PmYSDzofdjJ+oFy/XD57Q07SfxG9JvUvgw//n++afm8vDzDbd3WlUh E/XsE78Kb/GD1FzhSUvyndiAQ4HQVepg2ait1hXrkwqUF/BeeCaedJh5JJHdQmzbIuiu a6R/Agwo6zI8yN/3YYq/oFO6w64J5XcBVWzb/RBgEufndZ/LCMNvSXp6YrfEKLF5d3mf qkX4qeSZMZce2lyAVppEvo1sF+pTuPBdMA+Iea9fy1LItssq1I0rgRw7NEpTZCndRmwE E3PwyfPDfGMAnu+YpAlmLloTN+i0edQsbiGGCj5R+M7Hz1c97QzT1C/5h7+8ag6ld9qU FoRw== X-Gm-Message-State: AKwxytc1CW7CEUewxwEArQZ0vAx7xwImikyiInDtOV3r+bZHQx8n8dLN VLBDMfDS1pPU6QRuIaycIvwPAvvLoCkDTdK3WAM= X-Google-Smtp-Source: ACJfBosII+6EDQa3Bi7J7shlBZGApr0B2lRvmWRim/CntfCVONhTbdVt4+jeP8TfhQn+9Yh2wD2C2oIQAnaWiSYQVtw= X-Received: by 10.202.53.84 with SMTP id c81mr13524086oia.63.1516034938937; Mon, 15 Jan 2018 08:48:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.73.146 with HTTP; Mon, 15 Jan 2018 08:48:58 -0800 (PST) In-Reply-To: <20180111211948.GL28313@codeaurora.org> References: <20180111211948.GL28313@codeaurora.org> From: Fabio Estevam Date: Mon, 15 Jan 2018 14:48:58 -0200 Message-ID: Subject: Re: Warnings from drivers/clk/clk.c To: Stephen Boyd Cc: Sascha Hauer , Dong Aisheng , linux-clk@vger.kernel.org, Michael Turquette 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 Hi Stephen, On Thu, Jan 11, 2018 at 7:19 PM, Stephen Boyd wrote: > We have two WARN_ON in this function. Do you know which one hit > (makes me think we should put a printk in here now and also > include the clk name). Yes, having the clk name that causes the warning really helps debugging. Do you mean like this? the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0f686a9..6fed292 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -681,8 +681,12 @@ static void clk_core_unprepare(struct clk_core *core) if (!core) return; - if (WARN_ON(core->prepare_count == 0)) + if (core->prepare_count == 0) { + pr_err("%s: %s called with enable_count not zero\n", + __func__, core->name); + WARN_ON(1); return; + } if (WARN_ON(core->prepare_count == 1 && core->flags & CLK_IS_CRITICAL)) return; @@ -808,9 +812,14 @@ static void clk_core_disable(struct clk_core *core) if (!core) return; - if (WARN_ON(core->enable_count == 0)) + if (core->enable_count == 0) { + pr_err("%s: %s called with enable_count not zero\n", + __func__, core->name); + WARN_ON(1); return; + } + if (WARN_ON(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL)) return; -- To unsubscribe from this list: send the line "unsubscribe linux-clk" in