[PATCH v3 9/9] phy: ti: phy-j721e-wiz: convert from round_rate() to determine_rate()
Brian Masney
bmasney at redhat.com
Thu Jan 8 13:23:34 PST 2026
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 at redhat.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 at redhat.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
More information about the linux-phy
mailing list