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 459A9C3DA6F for ; Wed, 23 Aug 2023 18:02:02 +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=RVqs2kIJT/Q7gbwVMBEfs+UdFefJylGua7JLhhPjjYs=; b=g6Zf/Ttn0CopHC /V5wkASX0u1iAvBE2PZ26EodnCd5azmMEHFu6secSWQIJdG83/KRS2okkoo+YxaBd9k6SXoRHdCGf 862heYGNPA0Huef3VBVzRxe/xw25t87F7ILk4EulMVWVqGCgyZ4cKE9rlQ5uDeIzbCjsHf4NPaDsS qlU9txkq8FeTKH0e6NQSX2A1wJQJGweJi8wu661bZ4eSD+dzDgc9naNN7wKv+hP8dcJadpuvK0e0x s3ZOwJkN10A29q5BYAuo9LgTvtt9HZMzgVz/VV4tLHM65vKpcDzklKdq11aeK+bfSDCfoHOLLMiJj 4lg0IlFREa0o6KgjWPnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYsAd-001GkC-2H; Wed, 23 Aug 2023 18:01:31 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYsAT-001Ggh-29 for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2023 18:01:24 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C8E9962F71; Wed, 23 Aug 2023 18:01:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 171C7C433CB; Wed, 23 Aug 2023 18:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692813680; bh=e6v4G4jDId6hSaMFJ0Kx8OgZafHgAdprexUAH84vTj4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=dFsqugUGl0tq8Gl4euWZzkD93IAHJBfTd6WBCPx6rBdtKFjNK6oU+7ieeF09hHwh6 NiJtkPHDdoObFrFepffIOZOsHVHGuNgFXnnCFspcKmtCwklnMlJsxtR5/TXdQUnLMk cJcbHeXlucaD9eXCQb+aBC38vu5xQcrjDDQ2jpEkwgUGrDIRQSrJkP0Gy5gL6uFZZB tYuPa2l/kZzaH9PrL12pHbMbTq70I4qfYguOyB6GGNSAXFAeggM5UgzmOrqiHOqEnS YlHQhCn+VHHFOqE6/Sb/S1wYzxefYWtN4ni2vu9cx7KfYxqzyhQzsgecmrkMTWPoiB oG4Af56/cKiow== Message-ID: MIME-Version: 1.0 In-Reply-To: References: <20230811161446.636253-1-cristian.marussi@arm.com> <20230811161446.636253-2-cristian.marussi@arm.com> <17bd83d833b59fd4f64eec433589fa55.sboyd@kernel.org> Subject: Re: [PATCH 1/6] firmware: arm_scmi: Simplify enable/disable Clock operations From: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, etienne.carriere@linaro.org, peng.fan@oss.nxp.com, chuck.cannon@nxp.com, souvik.chakravarty@arm.com, nicola.mazzucato@arm.com, Michael Turquette , linux-clk@vger.kernel.org To: Cristian Marussi Date: Wed, 23 Aug 2023 11:01:17 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230823_110121_807613_81D29EF2 X-CRM114-Status: GOOD ( 29.32 ) 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 (2023-08-23 02:02:46) > On Tue, Aug 22, 2023 at 01:17:15PM -0700, Stephen Boyd wrote: > > Quoting Cristian Marussi (2023-08-11 09:14:41) > > > Add a param to Clock enable/disable operation to ask for atomic operation > > > and remove _atomic version of such operations. > > > > Hi, Yo > > > Why? > > > > :D, given that the 2 flavours of SCMI enable/disable ops (and the upcoming > state_get) just differ in their operating mode (atomic or not) and the > Clock framework in turn wrap such calls into 4 related and explicitly > named clk_ops (scmi_clock_enable/scmi_clock_atomic_enable etc) that hint > at what is being done, seemed to me reasonable to reduce the churn and > remove a bit of code wrappers in favour of a param. Please add these extra details to the commit text about why we're making the change. > > > > > > > No functional change. > > > > > > CC: Michael Turquette > > > CC: Stephen Boyd > > > CC: linux-clk@vger.kernel.org > > > Signed-off-by: Cristian Marussi > > > --- > > > drivers/clk/clk-scmi.c | 8 ++++---- > > > drivers/firmware/arm_scmi/clock.c | 24 ++++++------------------ > > > include/linux/scmi_protocol.h | 9 ++++----- > > > 3 files changed, 14 insertions(+), 27 deletions(-) > > > > > > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > > > index 2c7a830ce308..ff003083e592 100644 > > > --- a/drivers/clk/clk-scmi.c > > > +++ b/drivers/clk/clk-scmi.c > > > @@ -78,28 +78,28 @@ static int scmi_clk_enable(struct clk_hw *hw) > > > { > > > struct scmi_clk *clk = to_scmi_clk(hw); > > > > > > - return scmi_proto_clk_ops->enable(clk->ph, clk->id); > > > + return scmi_proto_clk_ops->enable(clk->ph, clk->id, false); > > > } > > > > > > static void scmi_clk_disable(struct clk_hw *hw) > > > { > > > struct scmi_clk *clk = to_scmi_clk(hw); > > > > > > - scmi_proto_clk_ops->disable(clk->ph, clk->id); > > > + scmi_proto_clk_ops->disable(clk->ph, clk->id, false); > > > > I enjoyed how it was before because I don't know what 'false' means > > without looking at the ops now. > > > > Yes indeed, I can drop this and rework if you prefer to maintain the old > API calls, but this would mean that whenever we'll add new atomic > flavour to some new SCMI clk operations we'll have to add 2 ops instead > of a parametrized one...this is what would happen also in this series > with state_get (and what really triggered this refactor) > > (and please consider that on the SCMI side, for testing purposes, I would > prefer to expose always both atomic and non-atomic flavours even if NOT > both actively used by the Clock framework...like state_get() that can only > be atomic for Clock frmwk...) > Perhaps we need a local variable to make it more readable. static int scmi_clk_enable(struct clk_hw *hw) { bool can_sleep = false; struct scmi_clk *clk = to_scmi_clk(hw); return scmi_proto_clk_ops->enable(clk->ph, clk->id, can_sleep); } This let's the reader quickly understand what the parameter means. I'm OK with adding the function parameter, but a plain 'true' or 'false' doesn't help with clarity. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel