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 9889AC48BF8 for ; Thu, 22 Feb 2024 05:44:33 +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=OJ60W+iiyC6TgqJxa3/uwRPON2zE5/z4neC5NwnI9Bo=; b=sWXMYeFBO7bgBl z5XvKzfU83vAWvGxTw9h+xfzTtClAErXXJddU6AJIYbTqVqAaimZuHO1ag27K0v1GvdhxPT19HO9D F9n7QgSjlowdOqIgj4iHwc4D6b8I9qfWT5LmieKSGjq78MRvCCw9xPwBN+ZoonMwINh7YZlDEwN2i bWgZcbsVyoJxmYa8Ed8BQdKtbh7UDs6Ne7ED9KsTdOGSELOuGoBJULyjGX6jvKoHlizgxOAEzQvHY sxmAfJH0QWE+fpmbDWnjYokqdrV2F5dnXyKRQ/RG0RmiV4tElmDPJnX7KfUarE3kykHCiQWWjIzwd 90C3Xs3J5JzRJ/C5y88A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rd1sa-00000003ctU-2XSB; Thu, 22 Feb 2024 05:44:20 +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 1rd1sX-00000003csb-3RlM for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2024 05:44:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2C6F461709; Thu, 22 Feb 2024 05:44:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAA1DC433B1; Thu, 22 Feb 2024 05:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708580657; bh=EoK1x3aOU4KJEXAJZ+xJQ2/KF+ApDpnlxBCrJBs7IDA=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=SHliQxYtc3GAHDCZrE6/bnd/TwGUUVslEgbgQID/TSKeNsFWQ/cDA3VlhWj8r2cF4 ckru0rEbjgYXo8sv7c9YfAX1wdfMUdbKVQIcvmxO9C551bX6KsCxvd1falGRYAXTNN EoYR/uOHKe4t+A4LsvJv259Hq8JZZpIF8eEvWSqXR39vqMr4jUJvP+YFAjC3cOJ+Nc AWe7mXTZJfdtPAe+lrTGCBy+6Tp7SjBOcFmPS/SGjrr0G0kzDUrKSap/GX0tNzTSMZ LoF3PVg+tj7haBr2C5ux08x3ItGcPgSWhK8QwBG64J6EC+B31vkDvxtfAQau85I+Ww 5LWslA7+hqnBg== Message-ID: <500e265eb7c6a03a40e0067c8806e059.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <20240214183006.3403207-7-cristian.marussi@arm.com> References: <20240214183006.3403207-1-cristian.marussi@arm.com> <20240214183006.3403207-7-cristian.marussi@arm.com> Subject: Re: [PATCH 6/7] clk: scmi: Allocate CLK operations dynamically 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, Cristian Marussi , Michael Turquette , linux-clk@vger.kernel.org To: Cristian Marussi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 21 Feb 2024 21:44:14 -0800 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_214417_933883_4B559A5F X-CRM114-Status: GOOD ( 16.43 ) 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-02-14 10:30:05) > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > index 5747b6d651f0..b91a0dbd2fe0 100644 > --- a/drivers/clk/clk-scmi.c > +++ b/drivers/clk/clk-scmi.c > @@ -158,51 +158,6 @@ static int scmi_clk_atomic_is_enabled(struct clk_hw *hw) > return !!enabled; > } > > -/* > - * We can provide enable/disable/is_enabled atomic callbacks only if the > - * underlying SCMI transport for an SCMI instance is configured to handle > - * SCMI commands in an atomic manner. > - * > - * When no SCMI atomic transport support is available we instead provide only > - * the prepare/unprepare API, as allowed by the clock framework when atomic > - * calls are not available. > - * > - * Two distinct sets of clk_ops are provided since we could have multiple SCMI > - * instances with different underlying transport quality, so they cannot be > - * shared. > - */ > -static const struct clk_ops scmi_clk_ops = { > - .recalc_rate = scmi_clk_recalc_rate, > - .round_rate = scmi_clk_round_rate, > - .set_rate = scmi_clk_set_rate, > - .prepare = scmi_clk_enable, > - .unprepare = scmi_clk_disable, > - .set_parent = scmi_clk_set_parent, > - .get_parent = scmi_clk_get_parent, > - .determine_rate = scmi_clk_determine_rate, > -}; > - > -static const struct clk_ops scmi_atomic_clk_ops = { It's not great to move these function pointer structs out of RO memory to RW. I'm also not convinced that it's any better to construct them at runtime. Isn't there a constant set of possible clk configurations? Or why can't we simply add some failures to the clk_ops functions instead? > - .recalc_rate = scmi_clk_recalc_rate, > - .round_rate = scmi_clk_round_rate, > - .set_rate = scmi_clk_set_rate, > - .enable = scmi_clk_atomic_enable, > - .disable = scmi_clk_atomic_disable, > - .is_enabled = scmi_clk_atomic_is_enabled, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel