From: sashiko-bot@kernel.org
To: "Geert Uytterhoeven" <geert+renesas@glider.be>
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org,
linux-clk@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: mdio: mux-meson-g12a: Make sure clk_init_data is fully initialized
Date: Sat, 22 Aug 2026 10:08:04 +0000 [thread overview]
Message-ID: <20260822100804.F26681F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <ae6cfac64d3983801b9baa2abb30bf09c3d7ce3b.1787240118.git.geert+renesas@glider.be>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Busy-wait loop of up to 1 second with interrupts disabled in atomic clock enable callback
--
--- Patch [2]: [PATCH net-next 2/3] net: mdio: mux-meson-g12a: Make sure clk_init_data is fully initialized ---
commit 061a72e517f35ad4bc41a274d2b768db77d84ad1
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Subject: net: mdio: mux-meson-g12a: Make sure clk_init_data is fully initialized
This commit ensures the clk_init_data structure is fully initialized by
adding an empty initializer. This prevents subtle bugs related to mutually
exclusive members when different stack initialization patterns are enabled.
> diff --git a/drivers/net/mdio/mdio-mux-meson-g12a.c b/drivers/net/mdio/mdio-mux-meson-g12a.c
> --- a/drivers/net/mdio/mdio-mux-meson-g12a.c
> +++ b/drivers/net/mdio/mdio-mux-meson-g12a.c
> @@ -223,7 +223,7 @@ static int g12a_ephy_glue_clk_register(struct device *dev)
> {
> struct g12a_mdio_mux *priv = dev_get_drvdata(dev);
> const char *parent_names[PLL_MUX_NUM_PARENT];
> - struct clk_init_data init;
> + struct clk_init_data init = {};
[Severity: High]
This is a pre-existing issue, but while reviewing this clock initialization,
I noticed a potential lockup in the related PLL operations.
Does g12a_ephy_pll_enable() risk triggering the hard lockup detector?
The g12a_ephy_pll_ops struct is used later in this function to initialize
the pll clock, and its .enable callback maps to g12a_ephy_pll_enable():
drivers/net/mdio/mdio-mux-meson-g12a.c:g12a_ephy_pll_enable() {
...
return readl_poll_timeout(pll->base + ETH_PLL_CTL0, val,
val & PLL_CTL0_LOCK_DIG, 0, PLL_LOCK_TIMEOUT);
}
The clock framework calls the .enable callback with the enable_lock spinlock
held and local interrupts disabled. Since the delay parameter is 0 and
PLL_LOCK_TIMEOUT is 1,000,000, readl_poll_timeout() evaluates to a tight
busy-wait loop.
If the PLL hardware fails to lock or takes a long time, could this stall
the CPU for up to 1 second in an interrupt-disabled context?
Would it be possible to move this hardware initialization sequence to the
.prepare callback instead, which executes in a preemptible context where
sleeping delays are permitted?
> struct g12a_ephy_pll *pll;
> struct clk_mux *mux;
> struct clk *clk;
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787240118.git.geert+renesas@glider.be?part=2
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-08-22 10:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 10:07 [PATCH net-next 0/3] net: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:07 ` [PATCH net-next 1/3] net: macb: " Geert Uytterhoeven
2026-08-22 10:08 ` sashiko-bot
2026-08-21 10:07 ` [PATCH net-next 2/3] net: mdio: mux-meson-g12a: " Geert Uytterhoeven
2026-08-22 10:08 ` sashiko-bot [this message]
2026-08-21 10:07 ` [PATCH net-next 3/3] net: phy: air_en8811h: " Geert Uytterhoeven
2026-08-22 10:08 ` sashiko-bot
2026-08-22 19:44 ` [PATCH net-next 0/3] net: " Jakub Kicinski
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=20260822100804.F26681F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=geert+renesas@glider.be \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
/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