Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joris Vaisvila" <joey@tinyisr.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/4] net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs
Date: Sun, 14 Jun 2026 18:20:47 +0000	[thread overview]
Message-ID: <20260614182048.68C771F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260613181845.111877-3-joey@tinyisr.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `mtk_soc_fe_phy_driver` lacks `.suspend` and `.resume` callbacks (typically assigned to `genphy_suspend` and `genphy_resume`). This causes a severe power management regression and breaks hardware initialization after system resume. Without a `.suspend` callback, `phy_suspend()` returns 0 without powering down the PHY (`BMCR_PDOWN`). Furthermore, `mdio_bus_phy_may_suspend()` returns false, which prevents `phydev->suspended_by_mdio_bus` from being set to 1 during system suspend. During system resume, `mdio_bus_phy_resume()` checks this flag and, seeing it is false, completely skips calling `phy_init_hw()`. Because `phy_init_hw()` is bypassed, the driver's `.config_init` callback (`mt7628_phy_config_init`) is never executed. Since this callback sets a critical undocumented bit required for 100 Mbps links, the PHY will silently fail to establish correct links if it loses power or state during suspend.
--

commit 6c0828ab418aa7d550c1020af637c9ed3e4c1236
Author: Joris Vaisvila <joey@tinyisr.com>

net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs

This commit adds support for the Fast Ethernet PHYs in the MT7628 SoCs.
It adds the MEDIATEK_FE_SOC_PHY Kconfig option and the corresponding
mtk-fe-soc.c driver to set an undocumented bit required for 100mbps links.

> diff --git a/drivers/net/phy/mediatek/mtk-fe-soc.c b/drivers/net/phy/mediatek/mtk-fe-soc.c
> new file mode 100644
> index 0000000000000..9eb4960bcaade
> --- /dev/null
> +++ b/drivers/net/phy/mediatek/mtk-fe-soc.c

[ ... ]

> +static struct phy_driver mtk_soc_fe_phy_driver[] = {
> +	{
> +		PHY_ID_MATCH_EXACT(MTK_FPHY_ID_MT7628),
> +		.name = "MediaTek MT7628 PHY",
> +		.config_init = mt7628_phy_config_init,
> +		.read_page = mt7628_phy_read_page,
> +		.write_page = mt7628_phy_write_page,
> +	},
> +};

[Severity: High]
Does this driver need .suspend and .resume callbacks (like genphy_suspend
and genphy_resume) to properly handle system power management?

Without a .suspend callback, mdio_bus_phy_may_suspend() returns false,
which prevents phydev->suspended_by_mdio_bus from being set during system
suspend.

During resume, mdio_bus_phy_resume() checks this flag and skips calling
phy_init_hw() entirely. Because phy_init_hw() is bypassed, the
mt7628_phy_config_init() callback is never executed after a resume.

Will this cause the PHY to silently fail to establish 100 Mbps links after
waking up from suspend because the undocumented bit is lost?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260613181845.111877-1-joey@tinyisr.com?part=2

  parent reply	other threads:[~2026-06-14 18:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 18:18 [PATCH net-next v5 0/4] net: dsa: mt7628 embedded switch initial support Joris Vaisvila
2026-06-13 18:18 ` [PATCH net-next v5 1/4] dt-bindings: net: dsa: add MT7628 ESW Joris Vaisvila
2026-06-13 18:18 ` [PATCH net-next v5 2/4] net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs Joris Vaisvila
2026-06-13 18:49   ` Daniel Golle
2026-06-14 18:20   ` sashiko-bot [this message]
2026-06-13 18:18 ` [PATCH net-next v5 3/4] net: dsa: initial MT7628 tagging driver Joris Vaisvila
2026-06-13 18:49   ` Daniel Golle
2026-06-13 18:18 ` [PATCH net-next v5 4/4] net: dsa: initial support for MT7628 embedded switch Joris Vaisvila
2026-06-13 18:52   ` Daniel Golle
2026-06-14 18:20   ` sashiko-bot

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=20260614182048.68C771F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=joey@tinyisr.com \
    --cc=robh@kernel.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