From: Brian Masney <bmasney@redhat.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Heiko Stuebner <heiko@sntech.de>,
Neil Armstrong <neil.armstrong@linaro.org>,
Stephen Boyd <sboyd@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
linux-clk@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v3 9/9] phy: ti: phy-j721e-wiz: convert from round_rate() to determine_rate()
Date: Thu, 8 Jan 2026 16:23:34 -0500 [thread overview]
Message-ID: <aWAgVt599agpNqZQ@redhat.com> (raw)
In-Reply-To: <aVurM1XRqiYlzi1B@redhat.com>
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@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@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
next prev parent reply other threads:[~2026-01-08 21:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 23:16 [PATCH v3 0/9] phy: convert from clk round_rate() to determine_rate() Brian Masney
2025-12-11 23:16 ` [PATCH v3 1/9] phy: freescale: phy-fsl-samsung-hdmi: convert from " Brian Masney
2025-12-11 23:16 ` [PATCH v3 2/9] phy: mediatek: phy-mtk-hdmi-mt2701: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 3/9] phy: mediatek: phy-mtk-hdmi-mt8173: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 4/9] phy: mediatek: phy-mtk-hdmi-mt8195: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 5/9] phy: mediatek: phy-mtk-mipi-dsi-mt8173: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 6/9] phy: mediatek: phy-mtk-mipi-dsi-mt8183: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 7/9] phy: rockchip: phy-rockchip-inno-hdmi: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 8/9] phy: rockchip: phy-rockchip-samsung-hdptx: " Brian Masney
2025-12-11 23:16 ` [PATCH v3 9/9] phy: ti: phy-j721e-wiz: " Brian Masney
2025-12-29 10:18 ` Geert Uytterhoeven
2026-01-05 12:14 ` Brian Masney
2026-01-08 21:23 ` Brian Masney [this message]
2025-12-24 7:32 ` [PATCH v3 0/9] phy: convert from clk " Vinod Koul
2025-12-24 21:53 ` Stephen Boyd
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=aWAgVt599agpNqZQ@redhat.com \
--to=bmasney@redhat.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunfeng.yun@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=heiko@sntech.de \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=vkoul@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox