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 1EF1BC5475B for ; Thu, 29 Feb 2024 02:20:53 +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=pl7JVmD0lwWVDzNHEEh19/SMPyrFu6LypKwNYVOQNiI=; b=kZI8E+fO66ENKs JcJ7liXOvWYDjSqB4ImKjrSKkLpf1XKW57Hck+GUqLMVqaEOx03Zt4NJALpCvTwIiitwoDDT0/7lg llm9lCj6EQOY6dpuGno/xilHbi+4R3jHfasp/VT27I0Jn95aNahh0nh3pWpmLJB8PYQOYPKZMUVW7 /mKhlgeALTq2FjZyBxsptg+I/lZO45rgZG7wS9RvKS5qFrR2eFn55lBMQlm8QAN9NBpne5QaTK8hJ uW2zS0s64cUF6tK7NvVF4wXLD7B/KYes+JxT+2nIvV9JTnCSfvjDQS5XbeJVCaf5DVjXj8dGDyjPg 09Huhsq7c7gb6zcOcptg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfW2L-0000000BjDt-0g52; Thu, 29 Feb 2024 02:20:41 +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 1rfW2I-0000000BjDL-0Ze0 for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 02:20:39 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1A511615F0; Thu, 29 Feb 2024 02:20:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABA4CC433F1; Thu, 29 Feb 2024 02:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709173236; bh=ndHU4Gl3W3V+sGQ4tm5lbUz87+Cesf9e9pD+O9WP5iE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=SMlLiRWCRXf9UeJ6EIl+4DGlqM+J1wHQwlRmSRroWC4rI18MdpO6BkwgVtEfeOvna uDTBbtJNi9BMgFzrHZRKPnPOSko+gCLz8ZJIV4gzqW7uC6+BfbLjj0EyH5RIRx0lgt oPv23BBBaS9QnG/FQgO/walRsP+KSKy8HSjy4RlVwSCy6l2srhc3M4uLYMAp22OWrU pdFmUCDGRiCNV6AdTI8u51/NYVb3bgdD1PK9k/dZF8gq6UflzQNysr6+dDwa8Fn7wt m4VBBZm0js7S/RZhwabX3uFqqdmMse9BS0Ule8yJvbALIgnWVzmJExI1fec7z4Wz5E bq7bmxQUUivVw== Message-ID: <1d0baf6dbaa1c2ca6594f9a2bcade2c4.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: References: <20240214183006.3403207-1-cristian.marussi@arm.com> <20240214183006.3403207-7-cristian.marussi@arm.com> <500e265eb7c6a03a40e0067c8806e059.sboyd@kernel.org> Subject: Re: [PATCH 6/7] clk: scmi: Allocate CLK operations dynamically 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, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, souvik.chakravarty@arm.com, Michael Turquette , linux-clk@vger.kernel.org To: Cristian Marussi Date: Wed, 28 Feb 2024 18:20:34 -0800 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_182038_308271_D97780E3 X-CRM114-Status: GOOD ( 23.20 ) 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-22 00:28:41) > On Wed, Feb 21, 2024 at 09:44:14PM -0800, Stephen Boyd wrote: > > > > 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? > > Well, the real clock devices managed by the SCMI server can be a of SCMI is a server!? :) > varying nature and so the minimum set of possible clk configurations > to cover will amount to all the possible combinations of supported ops > regarding the specific clock properties (i.e. .set_parent / .set_rate / > .enable / .get/set_duty_cycle / atomic_capability ... for now)...we > simply cannot know in advance what the backend SCMI server is handling. > > These seemed to me too much in number (and growing) to be pre-allocated > in all possible combinations. (and mostly wasted since you dont really > probably use all combinations all the time) > > Moreover, SCMI latest spec now exposes some clock properties (or not) to > be able avoid even sending an actual SCMI message that we know will be > denied all the time; one option is that we return an error,, as you said, > but what is the point (I thought) to provide at all a clk-callback that > we know upfront will fail to be executed every time ? (and some consumer > drivers have been reported by partners not to be happy with these errors) > > What I think could be optimized here instead, and I will try in the next > respin, it is that now I am allocating one set of custom ops for each clock > at the end, even if exactly the same ops are provided since the clock > capabilities are the same; I could instead allocate dynamically and fill only > one single set of ops for each distinct set of combinations, so as to avoid > useless duplication and use only the miminum strict amount of RW memory > needed. > Yes please don't allocate a clk_op per clk. And, please add these answers to the commit text so that we know why it's not possible to know all combinations or fail clk_ops calls. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel