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 D73E5C67861 for ; Mon, 8 Apr 2024 18:26:30 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XjEiZQG/jyV0GPdJUKkKh1f2loOqqSp6n8rtzMOQX9U=; b=lvsy6pmhW8VLd+ fAeH/yKYihHmlOApD7VaqB2XK/tXWNu9wOhAGvC+7y4EzcEJsjhcNW2bmIxZZdlofU8eYHyHIhl84 mxrGgh1ZBy657rhSo299/HuKzeBd+6oOOyQpMTODCZbcmuwRD1IL7ij7k4ujEPmphk31HyUMn+Y6V pCfEwyNZGrCHRw9xri8ouWqXfzYAuWeXfJjZptT5ZecBx2+H1GdjYCnnivHSmK0fRtBY1TyOJFdby HzGTCK5atWxD9VcZONBCNmTaIJOKDcBmLAVi9U5tPZH6KuwjH1IqbRgZQosNCoCDXk+Qwbr5o0+JK TVlTKl4BSi8kHt36cGIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtthC-0000000GUCE-0zm6; Mon, 08 Apr 2024 18:26:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtth9-0000000GUBU-2du2 for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 18:26:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B44EDDA7; Mon, 8 Apr 2024 11:26:44 -0700 (PDT) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 55CA43F766; Mon, 8 Apr 2024 11:26:12 -0700 (PDT) Date: Mon, 8 Apr 2024 19:26:09 +0100 From: Cristian Marussi To: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Subject: Re: [PATCH v2 2/5] clk: scmi: Add support for state control restricted clocks Message-ID: References: <20240325210025.1448717-1-cristian.marussi@arm.com> <20240325210025.1448717-3-cristian.marussi@arm.com> <90ac6d2dce33e8078db7cb5681fb94d7.sboyd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <90ac6d2dce33e8078db7cb5681fb94d7.sboyd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_112615_780634_CE596FB1 X-CRM114-Status: GOOD ( 21.02 ) 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 On Sun, Apr 07, 2024 at 09:48:59PM -0700, Stephen Boyd wrote: > 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? Yes of course. > > > 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. > I will rework accordingly Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel