[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWAgVt599agpNqZQ@redhat.com>
Date: Thu, 8 Jan 2026 16:23:34 -0500
From: Brian Masney <bmasney@...hat.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Heiko Stuebner <heiko@...ech.de>,
Neil Armstrong <neil.armstrong@...aro.org>,
Stephen Boyd <sboyd@...nel.org>, Maxime Ripard <mripard@...nel.org>,
linux-clk@...r.kernel.org, linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v3 9/9] phy: ti: phy-j721e-wiz: convert from round_rate()
to determine_rate()
Hi Geert,
On Mon, Jan 05, 2026 at 07:14:43AM -0500, Brian Masney wrote:
> On Mon, Dec 29, 2025 at 11:18:52AM +0100, Geert Uytterhoeven wrote:
> > Hi Brian,
> >
> > On Fri, 12 Dec 2025 at 00:21, Brian Masney <bmasney@...hat.com> wrote:
> > > The round_rate() clk ops is deprecated, so migrate this driver from
> > > round_rate() to determine_rate() using the Coccinelle semantic patch
> > > on the cover letter of this series.
> > >
> > > Signed-off-by: Brian Masney <bmasney@...hat.com>
> >
> > Thanks for your patch, which is now commit 27287e3b52b5954b ("phy:
> > ti: phy-j721e-wiz: convert from round_rate() to determine_rate()")
> > in phy/next
> >
> > > --- a/drivers/phy/ti/phy-j721e-wiz.c
> > > +++ b/drivers/phy/ti/phy-j721e-wiz.c
> > > @@ -934,12 +934,15 @@ static unsigned long wiz_clk_div_recalc_rate(struct clk_hw *hw,
> > > return divider_recalc_rate(hw, parent_rate, val, div->table, 0x0, 2);
> > > }
> > >
> > > -static long wiz_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
> > > - unsigned long *prate)
> > > +static int wiz_clk_div_determine_rate(struct clk_hw *hw,
> > > + struct clk_rate_request *req)
> > > {
> > > struct wiz_clk_divider *div = to_wiz_clk_div(hw);
> > >
> > > - return divider_round_rate(hw, rate, prate, div->table, 2, 0x0);
> > > + req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
> > > + div->table, 2, 0x0);
> >
> > Is this correct? divider_round_rate() can return a negative error code
> > (from divider_ro_determine_rate()), which is not handled here?
> >
> > Looks like several other users of divider_round_rate() use this
> > same logic, and thus are affected, too.
>
> Thanks for the review! You are correct that this is a bug.
>
> I had planned once round_rate is removed from the clk core to post a
> series to remove divider_round_rate() and divider_ro_round_rate() (plus
> the _parent functions) since they call the corresponding determine_rate
> functions. I'll bump that up on my todo list this week.
I posted a series that fixes the issue you identified, plus removes
those deprecated APIs all in one go.
https://lore.kernel.org/linux-clk/20260108-clk-divider-round-rate-v1-0-535a3ed73bf3@redhat.com/T/#t
Brian
Powered by blists - more mailing lists