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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 730BBC001DE for ; Sun, 23 Jul 2023 07:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbjGWH0f (ORCPT ); Sun, 23 Jul 2023 03:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjGWH0e (ORCPT ); Sun, 23 Jul 2023 03:26:34 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9466010CB; Sun, 23 Jul 2023 00:26:33 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4R7vx22wBPz9sZH; Sun, 23 Jul 2023 09:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1690097190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7npQ603oc29KQO3VKWFKZYl16ThZTZ9aYNERq2NUH/A=; b=vA+mmzj76oIcKC4z1Qe23xkhbKpQn4zqgyyKRQeVNqOSagdLdYgJviCH1xTIv+yD36QcuG sfMVhYdzjFqMm2aDrMqrD0cMpg722q0+7HXASJYK5syvwQAaOj5gxOmhzWdU8CXUV+AM4p M2L+fgZ+SDo8zWwq3T/SKHapVlCxfhj4TrkzbmBJ7+L8IWBvqtqzT3O+IImqvg2O3pbFaJ 939f4P0ERs3CEDpQU99An2DTxiq5zjvjGc7jVx2APMBmDLA/MhOYJj0BdqfnvFI2PpwZC+ 8ObfkN9QPw1GBYUYRp2zVlCSk9bMI97jq+7hLNqR2Ug8opE4aWlocEgj32xn3A== References: <20230717-pll-mipi_set_rate_parent-v4-0-04acf1d39765@oltmanns.dev> <20230717-pll-mipi_set_rate_parent-v4-7-04acf1d39765@oltmanns.dev> From: Frank Oltmanns To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andre Przywara , Roman Beranek , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 07/11] clk: sunxi-ng: nm: Support finding closest rate In-reply-to: Date: Sun, 23 Jul 2023 09:26:27 +0200 Message-ID: <87edkzqeak.fsf@oltmanns.dev> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4R7vx22wBPz9sZH Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org On 2023-07-17 at 16:12:30 +0200, Maxime Ripard wrote: > [[PGP Signed Part:Undecided]] > On Mon, Jul 17, 2023 at 03:34:31PM +0200, Frank Oltmanns wrote: >> Use the helper function ccu_is_better_rate() to determine the rate that >> is closest to the requested rate, thereby supporting rates that are >> higher than the requested rate if the clock uses the >> CCU_FEATURE_CLOSEST_RATE. >> >> Add the macro SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST which >> sets CCU_FEATURE_CLOSEST_RATE. >> >> To avoid code duplication, add the macros >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_FEAT that allows selecting >> arbitrary features and use it in the original >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX as well as the newly introduced >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST macros. >> >> Signed-off-by: Frank Oltmanns >> --- >> drivers/clk/sunxi-ng/ccu_nm.c | 11 ++++------ >> drivers/clk/sunxi-ng/ccu_nm.h | 48 ++++++++++++++++++++++++++++++++++++++++--- >> 2 files changed, 49 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/clk/sunxi-ng/ccu_nm.c b/drivers/clk/sunxi-ng/ccu_nm.c >> index c1fd11542c45..35d00783d748 100644 >> --- a/drivers/clk/sunxi-ng/ccu_nm.c >> +++ b/drivers/clk/sunxi-ng/ccu_nm.c >> @@ -28,7 +28,7 @@ static unsigned long ccu_nm_calc_rate(unsigned long parent, >> } >> >> static unsigned long ccu_nm_find_best(unsigned long parent, unsigned long rate, >> - struct _ccu_nm *nm) >> + struct _ccu_nm *nm, struct ccu_common *common) > > The common pointer must be the first argument. > Same question as for patch 08: Should I also pull *nm to the beginning? If so, do you have a preference on the order of *nm and *common? Thanks, Frank > > Once fixed, > Acked-by: Maxime Ripard > > Maxime > > [[End of PGP Signed Part]] 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 4B1B8C001B0 for ; Sun, 23 Jul 2023 07:55:37 +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:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=WIVesY83R/Kb6wJB4NPexV3XWbD93AJVYN1HwV17OiU=; b=3LWs1spw3pRzZTiaS2jqb2IuUX c5a8du+LBY/8p4nlBqbS7+TUiW0OCyy4+Wfr1UjQcVUvnnR/VyncmI8q8omF38eq7YCSoCm9wj0qH ZVOTgxkekzBNmYS9EmObT5kWjmMA8QYNQEtx2oxXHiwZ5DMUhDQcdK1l/UIHP6IleVxUQh42oeVEM nuZqHZkmOeYimjapbV5VnpwLC64ForMhsxJf5DkB5/wErtrH6FebJhrVY4vVaVvzZckE6gFlyU+TW LWCsyqGV1TKQFcR8GxQXUh3ojyvkgINqTxEgHtz0f+heOY0JqFLTeYIJw4lWMvljqq8i2CEAasNNM fyPj5XzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qNTw0-000Y6I-0t; Sun, 23 Jul 2023 07:55:20 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qNTvz-000Xwe-1E for linux-arm-kernel@bombadil.infradead.org; Sun, 23 Jul 2023 07:55:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:Message-ID: Date:In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7npQ603oc29KQO3VKWFKZYl16ThZTZ9aYNERq2NUH/A=; b=kqGp1qnGNA6+7KkswH6NLMWwos d9CUmY4HQx1iQTev5VJZE8Im8d8JP/fQ7pXmk7vxAQWtrb5FSzXjXt1st4QcZ9rOiBXn7Lwksc5Eo VWWFIF9xY2n1ILz0olhO/4gDZyoetYKFfAtfqYnnVLoWzHlOkaYJX3mQnmxcsuq1OqBOaRjJx9iJ9 Q4TPlen95OaEXgKCU8GzNsSr00bLuPQd+aUb+jNegcnR2Qc2Muuysaj3BghLZvlCHJaWgr5taKRDC JLLPuu1DztxZ5oMxsjmB1HJcKvRKY+xrbuYzhKSXA52etCcpGbg/XCf+ycMv576By2uzFb8WFAwiq 1xn7TeJQ==; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qNTUB-001lvg-1z for linux-arm-kernel@lists.infradead.org; Sun, 23 Jul 2023 07:26:37 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4R7vx22wBPz9sZH; Sun, 23 Jul 2023 09:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1690097190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7npQ603oc29KQO3VKWFKZYl16ThZTZ9aYNERq2NUH/A=; b=vA+mmzj76oIcKC4z1Qe23xkhbKpQn4zqgyyKRQeVNqOSagdLdYgJviCH1xTIv+yD36QcuG sfMVhYdzjFqMm2aDrMqrD0cMpg722q0+7HXASJYK5syvwQAaOj5gxOmhzWdU8CXUV+AM4p M2L+fgZ+SDo8zWwq3T/SKHapVlCxfhj4TrkzbmBJ7+L8IWBvqtqzT3O+IImqvg2O3pbFaJ 939f4P0ERs3CEDpQU99An2DTxiq5zjvjGc7jVx2APMBmDLA/MhOYJj0BdqfnvFI2PpwZC+ 8ObfkN9QPw1GBYUYRp2zVlCSk9bMI97jq+7hLNqR2Ug8opE4aWlocEgj32xn3A== References: <20230717-pll-mipi_set_rate_parent-v4-0-04acf1d39765@oltmanns.dev> <20230717-pll-mipi_set_rate_parent-v4-7-04acf1d39765@oltmanns.dev> From: Frank Oltmanns To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andre Przywara , Roman Beranek , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 07/11] clk: sunxi-ng: nm: Support finding closest rate In-reply-to: Date: Sun, 23 Jul 2023 09:26:27 +0200 Message-ID: <87edkzqeak.fsf@oltmanns.dev> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4R7vx22wBPz9sZH X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230723_082635_813495_2572A481 X-CRM114-Status: GOOD ( 16.08 ) 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 2023-07-17 at 16:12:30 +0200, Maxime Ripard wrote: > [[PGP Signed Part:Undecided]] > On Mon, Jul 17, 2023 at 03:34:31PM +0200, Frank Oltmanns wrote: >> Use the helper function ccu_is_better_rate() to determine the rate that >> is closest to the requested rate, thereby supporting rates that are >> higher than the requested rate if the clock uses the >> CCU_FEATURE_CLOSEST_RATE. >> >> Add the macro SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST which >> sets CCU_FEATURE_CLOSEST_RATE. >> >> To avoid code duplication, add the macros >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_FEAT that allows selecting >> arbitrary features and use it in the original >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX as well as the newly introduced >> SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST macros. >> >> Signed-off-by: Frank Oltmanns >> --- >> drivers/clk/sunxi-ng/ccu_nm.c | 11 ++++------ >> drivers/clk/sunxi-ng/ccu_nm.h | 48 ++++++++++++++++++++++++++++++++++++++++--- >> 2 files changed, 49 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/clk/sunxi-ng/ccu_nm.c b/drivers/clk/sunxi-ng/ccu_nm.c >> index c1fd11542c45..35d00783d748 100644 >> --- a/drivers/clk/sunxi-ng/ccu_nm.c >> +++ b/drivers/clk/sunxi-ng/ccu_nm.c >> @@ -28,7 +28,7 @@ static unsigned long ccu_nm_calc_rate(unsigned long parent, >> } >> >> static unsigned long ccu_nm_find_best(unsigned long parent, unsigned long rate, >> - struct _ccu_nm *nm) >> + struct _ccu_nm *nm, struct ccu_common *common) > > The common pointer must be the first argument. > Same question as for patch 08: Should I also pull *nm to the beginning? If so, do you have a preference on the order of *nm and *common? Thanks, Frank > > Once fixed, > Acked-by: Maxime Ripard > > Maxime > > [[End of PGP Signed Part]] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel