From patchwork Tue May 17 02:03:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 9108151 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: X-Original-To: patchwork-linux-clk@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CCB389F1C1 for ; Tue, 17 May 2016 02:04:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05C3120172 for ; Tue, 17 May 2016 02:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2167720165 for ; Tue, 17 May 2016 02:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756647AbcEQCEE (ORCPT ); Mon, 16 May 2016 22:04:04 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33392 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756644AbcEQCEC (ORCPT ); Mon, 16 May 2016 22:04:02 -0400 Received: by mail-pf0-f180.google.com with SMTP id 206so1098914pfu.0 for ; Mon, 16 May 2016 19:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=37VlOLVgI4ZbyijlX+rjwd9pNbMZVSAH5Bwznk+LFi0=; b=fMROp5Ymewn/c9u9JrG0SCb1bnXd5PxSihHZhdMLswm7QHNCFhRjaFTtiuSCCxyaeA qgzcLm5z9mmUvuRdzXOq+nxxr0Da929Iy/sts4Iq5HJvpFAc+Pi+qzXdoPRoL96bv6mG E+sipYPYtIs/wXzm62azRGk1oTm0pUHL9mCkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=37VlOLVgI4ZbyijlX+rjwd9pNbMZVSAH5Bwznk+LFi0=; b=SQpK/7+T6r0KSNRHPN+TC1lz6ANK3dNbZrNYpy6fgHZyQRd6I+RhmZUVnP33Qe3Z0s 3dl0sXTAdWhESAVOnqXgU6Dbp8KMMFjM7/LjOKvnT+mSiIXXWwdB7t+7zOCIGw9yMBl1 H441YCsyK2ZhJahUB0cBaynrdLOEPhgKzLHoqSqV6ReVRWsZDaRf5xGa9aH9WcK4tBk2 1dIE90b8HA/TO+hJyGg0IZdRH8LYsJHVXN8XOQ7w2npRYtmmPW9wisM+CxtT//Dmp5WL EvVqldhIvZPZzW7+Eh6ojC9RCimL6enYptQIoabLu8QGBfq69mGZsPNJoSBeOZ+JF879 vPlg== X-Gm-Message-State: AOPr4FWCE+J7Onij1/f5eVtsVNlGu4OvFzYUZvCSyBM8DJ4VEzHTip2dYV1Em2z5T4g0URp+ X-Received: by 10.98.82.208 with SMTP id g199mr50488092pfb.113.1463450641676; Mon, 16 May 2016 19:04:01 -0700 (PDT) Received: from localhost.localdomain ([188.42.252.245]) by smtp.gmail.com with ESMTPSA id m86sm269645pfj.77.2016.05.16.19.03.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 May 2016 19:04:00 -0700 (PDT) From: Jun Nie To: sboyd@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org Cc: Jun Nie Subject: [PATCH v2] clk: Add is_enabled sanity check Date: Tue, 17 May 2016 10:03:42 +0800 Message-Id: <1463450622-13960-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 If .enable and .disable is implemented, we must implement .is_enabled per document. Otherwise, clk_disable_unused_subtree will not disable the unused clock if the .is_enabled is not implemented, unecessary power consumption happens on the clock as a result. Signed-off-by: Jun Nie --- drivers/clk/clk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index fb74dc1..55f5c44 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2305,6 +2305,10 @@ static int __clk_core_init(struct clk_core *core) goto out; } + if (core->ops->enable && !core->ops->is_enabled) + pr_warn("Warning: %s %s must implement .is_enabled\n", + __func__, core->name); + /* throw a WARN if any entries in parent_names are NULL */ for (i = 0; i < core->num_parents; i++) WARN(!core->parent_names[i],