From patchwork Thu Mar 2 17:38:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9601513 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 8249D60429 for ; Thu, 2 Mar 2017 20:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 748D226E94 for ; Thu, 2 Mar 2017 20:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 674DD285E1; Thu, 2 Mar 2017 20:37:41 +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_SIGNED, 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 9E81126E94 for ; Thu, 2 Mar 2017 20:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbdCBUh2 (ORCPT ); Thu, 2 Mar 2017 15:37:28 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36906 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbdCBUh1 (ORCPT ); Thu, 2 Mar 2017 15:37:27 -0500 Received: by mail-wm0-f52.google.com with SMTP id n11so933728wma.0 for ; Thu, 02 Mar 2017 12:36:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9P0Nbr4EGM9uw18aeeUzjA902Pr7RDPNmORDSNtPL3k=; b=r13hY3cFqJOkAxo3LjEFbxRo6/LnyrYu89hzR79+6Bj5tjz+Lr+4SL/zVkYr3FlnG6 9zuHQgvRKzW6M3BqiCwMdnuI7wc3zhHI604zqjnOyph+yW3Xf5X7KNn/2CWnzJlRWa7N cY+nFzXxR9m3xmN/esLMGCsRf0caHsMiX7wHEW/VJij6DuJNiVcMM9cGpbdzQj4enUDo FfyCplYwYxUR5+Qy/ZieW8aD1ltbj8+mO0AR0QbG1VlW5jMZ2CoQ+5Df7jtFqvAAGUHH SRWF5AjJNOg+V7DwZZ+tTYsR1uHp+rlV/2AJk3NBGhP8SMtRgbk7dCweizRt+bf78RuT 1mEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9P0Nbr4EGM9uw18aeeUzjA902Pr7RDPNmORDSNtPL3k=; b=umt7tH3JYTpV+Wk9krUfmtkI4bo0yS+z3jUd7F4Pj8vUnTlAs09A3vWyLwzIZ4/YaW bZp1v4SzxG1Ksz7qYD4kXAPVjacwC55h2/NlkKYLb+kVIR7xf6X6CzDKkH86KeVjeu9x zcFfrP/dLH2yQ/tqM00vHCdGa1whvn8G4AvKmuoBH7cfNs+cBULMc4ayKhG9xH+JBvKS /mdntgBDhrJQItdLClVcOCVmLg1oTgxDVQluvL/bbSrs5LcVlVrZfVflVBGe5mLQYVsJ 98U5E+FWSVM6wk62QdnvAk6Ur25aRiisLm63ciaOVHiYWBGAbniyGuVPnZkYoZe9TCT6 z2bg== X-Gm-Message-State: AMke39nXE3eTwryQoJbZo+NnK7qIN20ILnG2zbANjxSYpTlHgoEK3UvjQ7xwptAXdMrZq+zZ X-Received: by 10.28.66.207 with SMTP id k76mr9317719wmi.121.1488476326149; Thu, 02 Mar 2017 09:38:46 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id u11sm239093wrb.45.2017.03.02.09.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 09:38:45 -0800 (PST) From: Jerome Brunet To: Michael Turquette , Stephen Boyd Cc: Jerome Brunet , linux-clk@vger.kernel.org, Kevin Hilman , Neil Armstrong Subject: [RFC 2/2] clk: use enable_count to check if clk is busy Date: Thu, 2 Mar 2017 18:38:35 +0100 Message-Id: <20170302173835.18313-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170302173835.18313-1-jbrunet@baylibre.com> References: <20170302173835.18313-1-jbrunet@baylibre.com> 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 CLK_SET_RATE_GATE is set, we use the prepare_count to determine if a clock is busy. A consumer could have just prepared his clock and not be able to set it, eventhough the clock is still disabled (gated). Might be the expected behavior, but the wording seems a bit misleading Signed-off-by: Jerome Brunet --- drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 6fe2ea81a9af..602f369bd1eb 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -174,7 +174,7 @@ static bool clk_core_is_enabled(struct clk_core *core) static bool clk_core_rate_can_change(struct clk_core *core) { - if ((core->flags & CLK_SET_RATE_GATE) && core->prepare_count) + if ((core->flags & CLK_SET_RATE_GATE) && core->enable_count) return false; return true;