From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 354BEC67861 for ; Mon, 8 Apr 2024 04:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I0XnHEI4+rfywxhiLyoxUnU+IrFUcJxxhmlUW8ZiCwY=; b=iRS30aYPcMimZZ 00F+MWEfwZ+EfMBZnh9htNeteCLNI9WsLIpxh+5/pMx10sDDYUOPEUaXo7lATVFQVdBabDEVpN5RX jafoGakA+ka/1v/99/i1AHF4S2DmbWfEKuw6sHZE/RWUX1YNYkilOwAZHmc1KrRACAM80VfOX8Xjn p3YrlsqfEjOoaY+8ZFEHZxuZO9j0sW4I7Ex31MGD4h2AOdaRuC63CNdc2Pmg2utCl9DD1sGnUrFg5 XCJ9W3ReODBugEIPIng1kkbfxPf5+AvnXW5Y9zsnJEWNlfZiH8xP3K2rcNncWFzge9da51WSqgzPB AathBN+OLVvmpPMFqWIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtgwM-0000000ELGS-2PYx; Mon, 08 Apr 2024 04:49:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtgwK-0000000ELFu-09Ka for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 04:49:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3106C60C3B; Mon, 8 Apr 2024 04:49:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6D48C433C7; Mon, 8 Apr 2024 04:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712551741; bh=y0uQm0GWht2PsG/ONzt4jj/tppBT8a3wXPqhnjmD6TA=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=QDLEQU8bkkwb7veH38llOXWkW5TsvpjXoGgd8rBgH0kHOwSMJkorCHfKXArPuAyaE OMv/0+Am4jpwcJQFHVyL5QYncHJ5D1IG9FIi4AiTwsJgR2+6L2O90R3kiSjszNcN+b 70+O0DL7gEHuhF+2m3zczw4LcLqhL94SOhl2vexmp5Sv+zKkW0qErI17ALnTx37vkv 9lXuXGobwjg2WGN79k5jWqiGQJkZxLmPDytpqcQ9IRiWhhijwguF+QCvRg6ggiA8jw cb7U28wZrGYlJ2SDyinKknVEwkyqFjUhTjp84PYBH2t53PZmoqf30Bv+1XcKjb73Ya BdOGwr3tm7HJQ== Message-ID: <90ac6d2dce33e8078db7cb5681fb94d7.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <20240325210025.1448717-3-cristian.marussi@arm.com> References: <20240325210025.1448717-1-cristian.marussi@arm.com> <20240325210025.1448717-3-cristian.marussi@arm.com> Subject: Re: [PATCH v2 2/5] clk: scmi: Add support for state control restricted clocks From: Stephen Boyd Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, souvik.chakravarty@arm.com, mturquette@baylibre.com, Cristian Marussi To: Cristian Marussi , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 07 Apr 2024 21:48:59 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240407_214904_373284_50D2CB40 X-CRM114-Status: GOOD ( 17.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Cristian Marussi (2024-03-25 14:00:22) > Some exposed SCMI Clocks could be marked as non-supporting state changes. > Configure a clk_ops descriptor which does not provide the state change > callbacks for such clocks when registering with CLK framework. > > CC: Michael Turquette > CC: Stephen Boyd > CC: linux-clk@vger.kernel.org > Signed-off-by: Cristian Marussi > --- > drivers/clk/clk-scmi.c | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > index d5d369b052bd..fc9603988d91 100644 > --- a/drivers/clk/clk-scmi.c > +++ b/drivers/clk/clk-scmi.c > @@ -18,6 +18,7 @@ > > enum scmi_clk_feats { > SCMI_CLK_ATOMIC_SUPPORTED, > + SCMI_CLK_STATE_CTRL_FORBIDDEN, Can it be positive, i.e. SCMI_CLK_STATE_CTRL_SUPPORTED? > SCMI_CLK_MAX_FEATS > }; > > @@ -230,15 +231,19 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key) > * only the prepare/unprepare API, as allowed by the clock framework > * when atomic calls are not available. > */ > - if (feats_key & BIT(SCMI_CLK_ATOMIC_SUPPORTED)) { > - ops->enable = scmi_clk_atomic_enable; > - ops->disable = scmi_clk_atomic_disable; > - ops->is_enabled = scmi_clk_atomic_is_enabled; > - } else { > - ops->prepare = scmi_clk_enable; > - ops->unprepare = scmi_clk_disable; > + if (!(feats_key & BIT(SCMI_CLK_STATE_CTRL_FORBIDDEN))) { > + if (feats_key & BIT(SCMI_CLK_ATOMIC_SUPPORTED)) { > + ops->enable = scmi_clk_atomic_enable; > + ops->disable = scmi_clk_atomic_disable; > + } else { > + ops->prepare = scmi_clk_enable; > + ops->unprepare = scmi_clk_disable; > + } > } > > + if (feats_key & BIT(SCMI_CLK_ATOMIC_SUPPORTED)) > + ops->is_enabled = scmi_clk_atomic_is_enabled; > + > /* Rate ops */ > ops->recalc_rate = scmi_clk_recalc_rate; > ops->round_rate = scmi_clk_round_rate; > @@ -288,6 +293,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable, > if (atomic_capable && ci->enable_latency <= atomic_threshold) > feats_key |= BIT(SCMI_CLK_ATOMIC_SUPPORTED); > > + if (ci->state_ctrl_forbidden) Then this is negated. > + feats_key |= BIT(SCMI_CLK_STATE_CTRL_FORBIDDEN); > + > /* Lookup previously allocated ops */ > ops = clk_ops_db[feats_key]; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel