From: sashiko-bot@kernel.org
To: "Geert Uytterhoeven" <geert+renesas@glider.be>
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
neil.armstrong@linaro.org
Subject: Re: [PATCH net-next 3/3] net: phy: air_en8811h: Make sure clk_init_data is fully initialized
Date: Sat, 22 Aug 2026 10:08:05 +0000 [thread overview]
Message-ID: <20260822100805.BB3BC1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <ebafac1803ee032ebd544a6ec5a1608c5630d81a.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] The PHY driver calls the global `clk_save_context()` and `clk_restore_context()` APIs in its suspend and resume paths, forcefully saving and restoring all clocks in the entire system.
--
--- Patch [3]: [PATCH net-next 3/3] net: phy: air_en8811h: Make sure clk_init_data is fully initialized ---
commit 681a33786ef724d10dc7ce4f726e8ec894967ea4
Author: Geert Uytterhoeven <geert+renesas@glider.be>
net: phy: air_en8811h: Make sure clk_init_data is fully initialized
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues. This commit makes
sure all members are fully initialized.
> diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
> index edd49c193e476..d1ab8744288bb 100644
> --- a/drivers/net/phy/air_en8811h.c
> +++ b/drivers/net/phy/air_en8811h.c
[ ... ]
> @@ -1031,7 +1031,7 @@ static const struct clk_ops en8811h_clk_ops = {
>
> static int en8811h_clk_provider_setup(struct device *dev, struct clk_hw *hw)
> {
> - struct clk_init_data init;
> + struct clk_init_data init = {};
> int ret;
>
> if (!IS_ENABLED(CONFIG_COMMON_CLK))
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing this driver's
clock handling I noticed a potential power management issue further down in
the file.
In drivers/net/phy/air_en8811h.c:
static int en8811h_resume(struct phy_device *phydev)
{
clk_restore_context();
return genphy_resume(phydev);
}
static int en8811h_suspend(struct phy_device *phydev)
{
clk_save_context();
return genphy_suspend(phydev);
}
Is it safe for the PHY driver to call the global clk_save_context() and
clk_restore_context() APIs during its suspend and resume handlers?
These APIs are intended for core PM operations and iterate over the entire
system's clock tree to save or restore state for all clocks system-wide.
Could restoring all clocks globally whenever this single leaf PHY resumes
forcefully reset or disrupt the clocks of completely unrelated devices,
potentially causing system lockups or crashes?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787240118.git.geert+renesas@glider.be?part=3
_______________________________________________
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
2026-08-21 10:07 ` [PATCH net-next 3/3] net: phy: air_en8811h: " Geert Uytterhoeven
2026-08-22 10:08 ` sashiko-bot [this message]
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=20260822100805.BB3BC1F00A3D@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