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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB2A6C433B4 for ; Tue, 18 May 2021 07:52:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 782EB6108D for ; Tue, 18 May 2021 07:52:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 782EB6108D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID: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=5dPjaZ0npae5L7gdmkBfoxifY/P24KxNvcyvsZNyerk=; b=l2vSnqFXd+uP5HCKcxMSDQu6V 0xNc9KuTsCCh3rqlY0fdpMLb1zQ1yAnXjVLSzvwgmyehRN7txvakLLOGg1qwDId82HAWbZ4UyVZ0R zPfVOWiI0hRJ5+hX88RDAh/dwzTYq6wfrisylDc85kts+cXh+jJnxltAsu8AqizJNMCigtgBW3Wia EFC3DUQge1tt7x2vjK1k3Ts7vjoTqMOwVQv1HJA8QDkzlGYUQrnhAqiq8BhS5iIkSej7RlG3bX181 H87I1kHd66B1+qbRfd7KnGANJ1ODWxvFQiLE+zfCqcXBIZ4V2k1wcI+LT6wzsqzGL3uS6kAKnTc2N 8FRkksTWQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liuV4-00HS8J-IL; Tue, 18 May 2021 07:50:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liuV0-00HS7G-5U for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 07:50:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:Date: Message-ID:In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mA1mK0+fQE9/tWWJ52jiHZ2px5uCbZhPu9foxVoORVE=; b=j5eoT5BGdnbWsmo1W6PG7xlVPu aynn0kB07wVgaI7g0+OrwNk2wXg7JpTn6+kPaWgt3E8XlrZyA2EHWv5mL+7QcRL/2FtRqzalN8mwM OLXKTfnF+dLSCimQ0Vc25Ud2q0mPWnjv92KzacJR8ft9NOH9Oc/FGEfpOUzIm+FVTfUCJTTqBCe8V wPmGKfN0Qtgup6PrSAVxXfUmvf8y0lChHM+jo7J/IWy7a/j/etbiHZzjjVaMsUmb8opleC9R49w6n 5SK3YsmNmcFdYzVSam1MUDZyCb2LLrKGGQjtmInIQ6yGxoz42GJJrlkduJhGVMbxk4Pk4wSUCy4TY ySC/k3Eg==; Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liuUx-00EQjQ-7a for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 07:50:40 +0000 Received: by mail-wm1-x32b.google.com with SMTP id h3-20020a05600c3503b0290176f13c7715so908837wmq.5 for ; Tue, 18 May 2021 00:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=mA1mK0+fQE9/tWWJ52jiHZ2px5uCbZhPu9foxVoORVE=; b=BMRVYMGPoqUoIM1+3P/qV2PqvGuHGfAWEFkAdkHQadEkf0+TYNk16srPsG6IlYh7lK BSKcVVTiGPpzP3frfC/ujxdSsTc4065WO8mxdZqkhVM2NF7U55g/CZeVj+wgn42mWr/1 aZY3oMqLUvhBQlqST3R2cjF/FfSk6Hr8sXjmBZt/75K3eB49XCLb2OhaPueya+h6rCvL laoCmhisKRAQngbhCFq+l8kV7zoP8FAR0mxtDQGW0P61kH1waPNAZdJav4RqOKI61NG/ QxlG3ADKmavBlvYzwgznXTu/PAh1NY+yM/wQllfkdlD8OZV0eHNF+38Y1MLsbHwoNIpn KCvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=mA1mK0+fQE9/tWWJ52jiHZ2px5uCbZhPu9foxVoORVE=; b=gUAgG8wrcHZntL2lxppBWx94zCeyFSfdn4RKtv4MFZImJ8uiSoRWjAcZgGhOT/ZVR5 Vl64oTuW64J8EpGHumA9PSojELuLGa+T3OlsMohOCgd861e1vuwcLXya75Lvd76J7ygN NkQpLyyHatLuUou8np4otu5veOybWx/wRsXagPA4ud3wTYyNjudboGRgXsA99vL9w6EJ sSJioQCYrmo8ap7av5OVV3BGRDaB3GEfiudemcNg1Euklx7GYlKHTYwWU5UMhXq5zUvh jQGe19dLcsfn5fOEMNexMoLwiYslfJ0CA1F2QZmuXOJaU1TO61hvtmuLxeQE2v/7FT/c xXzg== X-Gm-Message-State: AOAM533riIcIVbC/nwTNXrfKEuOUzjC7UocY8aIPz9vjRWtnKl8hW6I1 Sz8jY6QGNBFuYPBbskDQw/Lfgg== X-Google-Smtp-Source: ABdhPJzVVjWOzZjstMGH6oqwvQ9v8NQT386nZ8AwtHPb0QX7ljoBUK7xowqnIVc15vkLz9dBpk+gkw== X-Received: by 2002:a05:600c:2301:: with SMTP id 1mr3477659wmo.180.1621324237237; Tue, 18 May 2021 00:50:37 -0700 (PDT) Received: from localhost (82-65-169-74.subs.proxad.net. [82.65.169.74]) by smtp.gmail.com with ESMTPSA id h9sm16657780wmb.35.2021.05.18.00.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 00:50:36 -0700 (PDT) References: <20210517203724.1006254-1-martin.blumenstingl@googlemail.com> <20210517203724.1006254-4-martin.blumenstingl@googlemail.com> User-agent: mu4e 1.4.15; emacs 27.1 From: Jerome Brunet To: Martin Blumenstingl , mturquette@baylibre.com, sboyd@kernel.org, narmstrong@baylibre.com, linux-clk@vger.kernel.org Cc: khilman@baylibre.com, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC v1 3/3] clk: meson: pll: switch to determine_rate for the PLL ops In-reply-to: <20210517203724.1006254-4-martin.blumenstingl@googlemail.com> Message-ID: <1jo8d81nw3.fsf@starbuckisacylon.baylibre.com> Date: Tue, 18 May 2021 09:50:36 +0200 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_005039_295300_C7D8F5CE X-CRM114-Status: GOOD ( 23.01 ) 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 Mon 17 May 2021 at 22:37, Martin Blumenstingl wrote: > This increases the maxmium supported frequency on 32-bit systems from > 2^31 (signed long as used by clk_ops.round_rate, maximum value: > approx. 2.14GHz) to 2^32 (unsigned long as used by > clk_ops.determine_rate, maximum value: approx. 4.29GHz). > On Meson8/8b/8m2 the HDMI PLL and it's OD (post-dividers) are > capable of running at up to 2.97GHz. So switch the divider > implementation in clk-regmap to clk_ops.determine_rate to support these > higher frequencies on 32-bit systems. > > Signed-off-by: Martin Blumenstingl Looks good. I see no reason to keep this one as RFC. I can take it directly if this is OK with you ? > --- > drivers/clk/meson/clk-pll.c | 26 +++++++++++++++----------- > 1 file changed, 15 insertions(+), 11 deletions(-) > > diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c > index 49f27fe53213..9e55617bc3b4 100644 > --- a/drivers/clk/meson/clk-pll.c > +++ b/drivers/clk/meson/clk-pll.c > @@ -242,8 +242,8 @@ static int meson_clk_get_pll_settings(unsigned long rate, > return best ? 0 : -EINVAL; > } > > -static long meson_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, > - unsigned long *parent_rate) > +static int meson_clk_pll_determine_rate(struct clk_hw *hw, > + struct clk_rate_request *req) > { > struct clk_regmap *clk = to_clk_regmap(hw); > struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); > @@ -251,22 +251,26 @@ static long meson_clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, > unsigned long round; > int ret; > > - ret = meson_clk_get_pll_settings(rate, *parent_rate, &m, &n, pll); > + ret = meson_clk_get_pll_settings(req->rate, req->best_parent_rate, > + &m, &n, pll); > if (ret) > - return meson_clk_pll_recalc_rate(hw, *parent_rate); > + return ret; > > - round = __pll_params_to_rate(*parent_rate, m, n, 0, pll); > + round = __pll_params_to_rate(req->best_parent_rate, m, n, 0, pll); > > - if (!MESON_PARM_APPLICABLE(&pll->frac) || rate == round) > - return round; > + if (!MESON_PARM_APPLICABLE(&pll->frac) || req->rate == round) { > + req->rate = round; > + return 0; > + } > > /* > * The rate provided by the setting is not an exact match, let's > * try to improve the result using the fractional parameter > */ > - frac = __pll_params_with_frac(rate, *parent_rate, m, n, pll); > + frac = __pll_params_with_frac(req->rate, req->best_parent_rate, m, n, pll); > + req->rate = __pll_params_to_rate(req->best_parent_rate, m, n, frac, pll); > > - return __pll_params_to_rate(*parent_rate, m, n, frac, pll); > + return 0; > } > > static int meson_clk_pll_wait_lock(struct clk_hw *hw) > @@ -419,7 +423,7 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, > */ > const struct clk_ops meson_clk_pcie_pll_ops = { > .recalc_rate = meson_clk_pll_recalc_rate, > - .round_rate = meson_clk_pll_round_rate, > + .determine_rate = meson_clk_pll_determine_rate, > .is_enabled = meson_clk_pll_is_enabled, > .enable = meson_clk_pcie_pll_enable, > .disable = meson_clk_pll_disable > @@ -429,7 +433,7 @@ EXPORT_SYMBOL_GPL(meson_clk_pcie_pll_ops); > const struct clk_ops meson_clk_pll_ops = { > .init = meson_clk_pll_init, > .recalc_rate = meson_clk_pll_recalc_rate, > - .round_rate = meson_clk_pll_round_rate, > + .determine_rate = meson_clk_pll_determine_rate, > .set_rate = meson_clk_pll_set_rate, > .is_enabled = meson_clk_pll_is_enabled, > .enable = meson_clk_pll_enable, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel