All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: Chen Wang <unicorn_wang@outlook.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	Inochi Amaoto <inochiama@gmail.com>,
	sophgo@lists.linux.dev
Subject: Re: [PATCH 17/27] clk: sophgo: sg2042-clkgen: convert from divider_round_rate() to divider_determine_rate()
Date: Mon, 12 Jan 2026 12:27:16 -0500	[thread overview]
Message-ID: <aWUu9JmPDgrJ5VxA@redhat.com> (raw)
In-Reply-To: <MA5PR01MB1250095A65211598BF17058E5FE81A@MA5PR01MB12500.INDPRD01.PROD.OUTLOOK.COM>

Hi Chen,

On Mon, Jan 12, 2026 at 10:57:17AM +0800, Chen Wang wrote:
> 
> On 1/9/2026 5:16 AM, Brian Masney wrote:
> > The divider_round_rate() function is now deprecated, so let's migrate
> > to divider_determine_rate() instead so that this deprecated API can be
> > removed.
> > 
> > Note that when the main function itself was migrated to use
> > determine_rate, this was mistakenly converted to:
> > 
> >      req->rate = divider_round_rate(...)
> > 
> > This is invalid in the case when an error occurs since it can set the
> > rate to a negative value.
> > 
> > Note that this commit also removes a debugging message that's not really
> > needed.
> > 
> > Fixes: 9a3b6993613d ("clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()")
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > 
> > ---
> > To: Chen Wang <unicorn_wang@outlook.com>
> > To: Inochi Amaoto <inochiama@gmail.com>
> > Cc: sophgo@lists.linux.dev
> > ---
> >   drivers/clk/sophgo/clk-sg2042-clkgen.c | 15 +++++----------
> >   1 file changed, 5 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/clk/sophgo/clk-sg2042-clkgen.c b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> > index 683661b71787c9e5428b168502f6fbb30ea9f7da..9725ac4e050a4e6afd3fd50241fbd2fc105a31ca 100644
> > --- a/drivers/clk/sophgo/clk-sg2042-clkgen.c
> > +++ b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> > @@ -180,7 +180,6 @@ static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
> >   					     struct clk_rate_request *req)
> >   {
> >   	struct sg2042_divider_clock *divider = to_sg2042_clk_divider(hw);
> > -	unsigned long ret_rate;
> >   	u32 bestdiv;
> >   	/* if read only, just return current value */
> > @@ -191,17 +190,13 @@ static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
> >   			bestdiv = readl(divider->reg) >> divider->shift;
> >   			bestdiv &= clk_div_mask(divider->width);
> >   		}
> > -		ret_rate = DIV_ROUND_UP_ULL((u64)req->best_parent_rate, bestdiv);
> > -	} else {
> > -		ret_rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, NULL,
> > -					      divider->width, divider->div_flags);
> > -	}
> > +		req->rate = DIV_ROUND_UP_ULL((u64)req->best_parent_rate, bestdiv);
> > -	pr_debug("--> %s: divider_round_rate: val = %ld\n",
> > -		 clk_hw_get_name(hw), ret_rate);
> > -	req->rate = ret_rate;
> > +		return 0;
> > +	}
> > -	return 0;
> > +	return divider_determine_rate(hw, req, NULL, divider->width,
> > +				      divider->div_flags);
> >   }
> >   static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
> Tested-by: Chen Wang <unicorn_wang@outlook.com>
> 
> Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
> 
> BTW: I have a question about the base-commit on which your patch series is
> based. Could you please tell me where I can find this base-commit? I'm
> asking this because I found that for the changes in [25/27] phy-j721e-wiz,
> if I'm based on the latest upstream master, I can't successfully apply this
> patch.
> 
> So, in my testing, I'm based on 6.19-rc1 and haven't picked [25/27].

My branch is based on linux-next-20260105. I verified that this series
also applies to linux-next-20260109. The TI patch depends on patch 9
from this series that's in linux-next:

https://lore.kernel.org/linux-phy/176656156358.817806.16966474957670370356.b4-ty@kernel.org/

Brian


  reply	other threads:[~2026-01-12 17:27 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08 21:16 [PATCH 00/27] clk: remove deprecated API divider_round_rate() and friends Brian Masney
2026-01-08 21:16 ` Brian Masney
2026-01-08 21:16 ` [PATCH 01/27] clk: sophgo: cv18xx-ip: convert from divider_round_rate() to divider_determine_rate() Brian Masney
2026-01-08 21:16 ` [PATCH 02/27] clk: sunxi-ng: convert from divider_round_rate_parent() " Brian Masney
2026-01-11  5:48   ` Chen-Yu Tsai
2026-01-08 21:16 ` [PATCH 03/27] rtc: ac100: convert from divider_round_rate() " Brian Masney
2026-01-22  0:26   ` Alexandre Belloni
2026-01-22  0:48     ` Brian Masney
2026-01-22  2:02       ` Alexandre Belloni
2026-01-08 21:16 ` [PATCH 04/27] clk: actions: owl-composite: convert from owl_divider_helper_round_rate() " Brian Masney
2026-01-16  5:27   ` Manivannan Sadhasivam
2026-01-08 21:16 ` [PATCH 05/27] clk: actions: owl-divider: convert from divider_round_rate() " Brian Masney
2026-01-16  5:26   ` Manivannan Sadhasivam
2026-01-08 21:16 ` [PATCH 06/27] clk: bm1880: convert from divider_ro_round_rate() to divider_ro_determine_rate() Brian Masney
2026-01-16  5:23   ` Manivannan Sadhasivam
2026-01-08 21:16 ` [PATCH 07/27] clk: bm1880: convert from divider_round_rate() to divider_determine_rate() Brian Masney
2026-01-16  5:24   ` Manivannan Sadhasivam
2026-01-08 21:16 ` [PATCH 08/27] clk: hisilicon: clkdivider-hi6220: " Brian Masney
2026-01-08 21:16 ` [PATCH 09/27] clk: loongson1: " Brian Masney
2026-01-13  6:28   ` Keguang Zhang
2026-01-08 21:16 ` [PATCH 10/27] clk: milbeaut: convert from divider_ro_round_rate() to divider_ro_determine_rate() Brian Masney
2026-01-08 21:16 ` [PATCH 11/27] clk: milbeaut: convert from divider_round_rate() to divider_determine_rate() Brian Masney
2026-01-08 21:16 ` [PATCH 12/27] clk: nuvoton: ma35d1-divider: " Brian Masney
2026-01-08 21:16 ` [PATCH 13/27] clk: nxp: lpc32xx: " Brian Masney
2026-01-09  8:10   ` Vladimir Zapolskiy
2026-01-08 21:16 ` [PATCH 14/27] clk: qcom: alpha-pll: " Brian Masney
2026-01-09  9:12   ` Konrad Dybcio
2026-01-09  9:28   ` Abel Vesa
2026-01-08 21:16 ` [PATCH 15/27] clk: qcom: regmap-divider: convert from divider_ro_round_rate() to divider_ro_determine_rate() Brian Masney
2026-01-09  9:12   ` Konrad Dybcio
2026-01-09  9:28   ` Abel Vesa
2026-01-08 21:16 ` [PATCH 16/27] clk: qcom: regmap-divider: convert from divider_round_rate() to divider_determine_rate() Brian Masney
2026-01-09  9:12   ` Konrad Dybcio
2026-01-09  9:29   ` Abel Vesa
2026-01-08 21:16 ` [PATCH 17/27] clk: sophgo: sg2042-clkgen: " Brian Masney
2026-01-12  2:57   ` Chen Wang
2026-01-12 17:27     ` Brian Masney [this message]
2026-01-08 21:16 ` [PATCH 18/27] clk: sprd: div: " Brian Masney
2026-01-08 21:16 ` [PATCH 19/27] clk: stm32: stm32-core: convert from divider_ro_round_rate() to divider_ro_determine_rate() Brian Masney
2026-01-08 21:16 ` [PATCH 20/27] clk: stm32: stm32-core: convert from divider_round_rate_parent() to divider_determine_rate() Brian Masney
2026-01-08 21:16 ` [PATCH 21/27] clk: versaclock3: convert from divider_round_rate() " Brian Masney
2026-01-08 21:16 ` [PATCH 22/27] clk: x86: cgu: " Brian Masney
2026-01-08 21:16 ` [PATCH 23/27] clk: zynqmp: divider: " Brian Masney
2026-01-08 21:16 ` [PATCH 24/27] drm/msm/dsi_phy_14nm: " Brian Masney
2026-01-09  9:12   ` Konrad Dybcio
2026-01-09  9:29   ` Abel Vesa
2026-01-08 21:16 ` [PATCH 25/27] phy: ti: phy-j721e-wiz: " Brian Masney
2026-01-08 21:16   ` Brian Masney
2026-01-14 14:17   ` Vinod Koul
2026-01-14 14:17     ` Vinod Koul
2026-01-15 14:18     ` Brian Masney
2026-01-15 14:18       ` Brian Masney
2026-01-21  7:56       ` Vinod Koul
2026-01-21  7:56         ` Vinod Koul
2026-01-21 12:13         ` Brian Masney
2026-01-21 12:13           ` Brian Masney
2026-01-08 21:16 ` [PATCH 26/27] clk: divider: remove divider_ro_round_rate_parent() Brian Masney
2026-01-08 21:16 ` [PATCH 27/27] clk: divider: remove divider_round_rate() and divider_round_rate_parent() Brian Masney
2026-01-10 19:11 ` (subset) [PATCH 00/27] clk: remove deprecated API divider_round_rate() and friends Bjorn Andersson
2026-01-10 19:11   ` Bjorn Andersson
2026-01-15 21:05 ` Dmitry Baryshkov
2026-01-15 21:05   ` Dmitry Baryshkov
2026-01-21 22:53 ` Brian Masney
2026-01-21 22:53   ` Brian Masney
2026-02-04 15:44 ` (subset) " Vinod Koul
2026-02-04 15:44   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aWUu9JmPDgrJ5VxA@redhat.com \
    --to=bmasney@redhat.com \
    --cc=inochiama@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=sophgo@lists.linux.dev \
    --cc=unicorn_wang@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.