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 A3EB7CD6914 for ; Tue, 10 Oct 2023 09:35:45 +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=7zv4yHHZrYwKi7mUSPnw3v4DWxwCNlwxUX/p5Wf2B20=; b=SrJvhJaWMjOtOY MVgQ5OQrHyr5ED5fzSapjz6NXlf2nSfrGlLwCc+zM9JVjIcHLuCSvMP4A1D3oufsKzEM7VGnY/B8j oIGvGyGnQwoi5iLcf/Zq07Qj7jpMuERdsN0aczpNS6R6gYN67nKEK30mfoea2+N/geWoiOY8C48p8 /001jlUX7jYUX/WhqTGVmvYekHfRYD5i+9exay7CGkMjm88qJ3pUYuQXB1LytgT7Y+HOlWG/Yx/aD oNv8Fwz2C2Rwe9L+F5mJ84AUmPc018DkXR2TCz4mmvDZsKabL+j67rSzZWTqKZ3mof9taA3cUepyQ frYT3G1Vqb/nyccYZw2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq993-00Cwyr-1Z; Tue, 10 Oct 2023 09:35:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq990-00CwyV-1L for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 09:35:15 +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 E96391FB; Tue, 10 Oct 2023 02:35:53 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0B4C43F762; Tue, 10 Oct 2023 02:35:11 -0700 (PDT) Date: Tue, 10 Oct 2023 10:35:09 +0100 From: Sudeep Holla To: Cristian Marussi Cc: "Peng Fan (OSS)" , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, ranjani.vaidyanathan@nxp.com, souvik.chakravarty@arm.com, glen.wienecke@nxp.com, Peng Fan Subject: Re: [RFC] firmware: arm_scmi: clock: add fixed clock attribute support Message-ID: <20231010093509.ddy75og4jd72n6cq@bogus> References: <20231010022911.4106863-1-peng.fan@oss.nxp.com> <20231010091223.rvcyrgbjcrmjzmvp@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231010_023514_571090_A54BF903 X-CRM114-Status: GOOD ( 29.21 ) 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 Tue, Oct 10, 2023 at 10:22:03AM +0100, Cristian Marussi wrote: > On Tue, Oct 10, 2023 at 10:12:23AM +0100, Sudeep Holla wrote: > > On Tue, Oct 10, 2023 at 10:29:11AM +0800, Peng Fan (OSS) wrote: > > > From: Peng Fan > > > > > > There are clocks: > > > system critical, not allow linux to disable, change rate > > > allow linux to get rate, because some periphals will use the frequency > > > to configure periphals. > > > > > > So introduce an attribute to indicated FIXED clock > > > > > > Signed-off-by: Peng Fan > > > --- > > > drivers/clk/clk-scmi.c | 6 ++++++ > > > drivers/firmware/arm_scmi/clock.c | 5 ++++- > > > include/linux/scmi_protocol.h | 1 + > > > 3 files changed, 11 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > > > index 8cbe24789c24..a539a35bd45a 100644 > > > --- a/drivers/clk/clk-scmi.c > > > +++ b/drivers/clk/clk-scmi.c > > > @@ -182,6 +182,10 @@ static const struct clk_ops scmi_clk_ops = { > > > .determine_rate = scmi_clk_determine_rate, > > > }; > > > > > > +static const struct clk_ops scmi_fixed_rate_clk_ops = { > > > + .recalc_rate = scmi_clk_recalc_rate, > > > +}; > > > + > > > static const struct clk_ops scmi_atomic_clk_ops = { > > > .recalc_rate = scmi_clk_recalc_rate, > > > .round_rate = scmi_clk_round_rate, > > > @@ -293,6 +297,8 @@ static int scmi_clocks_probe(struct scmi_device *sdev) > > > if (is_atomic && > > > sclk->info->enable_latency <= atomic_threshold) > > > scmi_ops = &scmi_atomic_clk_ops; > > > + else if (sclk->info->rate_fixed) > > > + scmi_ops = &scmi_fixed_rate_clk_ops; > > > else > > > scmi_ops = &scmi_clk_ops; > > > > > > diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c > > > index ddaef34cd88b..8c52db539e54 100644 > > > --- a/drivers/firmware/arm_scmi/clock.c > > > +++ b/drivers/firmware/arm_scmi/clock.c > > > @@ -46,6 +46,7 @@ struct scmi_msg_resp_clock_attributes { > > > #define SUPPORTS_RATE_CHANGE_REQUESTED_NOTIF(x) ((x) & BIT(30)) > > > #define SUPPORTS_EXTENDED_NAMES(x) ((x) & BIT(29)) > > > #define SUPPORTS_PARENT_CLOCK(x) ((x) & BIT(28)) > > > +#define SUPPORTS_FIXED_RATE_CLOCK(x) ((x) & BIT(27)) > > > > I don't see this in the specification, am I missing something ? > > > > And why do we need it. Can't this be discrete clock with only one clock > > rate ? Or step clock with both lowest and highest the same and step being 0. > > At-least I don't see the need to change the spec for this and hence no need > > to assign any attribute bit-field to represent the same. > > > > No this is not in the spec, it would require a spec change. > > My understanding is that they have clocks that CAN have more than one rate BUT > such clock cannot be changed by Linux, only other agents can > enable/disable/set_rate BUT they still want to be able to query the > current rate for configuration purposes. > Fair enough. As I mentioned to Peng on the other thread, it is *not a fixed* clock. It is read only for this agent. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel