From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v7 01/12] net: phylink: keep and use MAC supported_interfaces in phylink struct
Date: Tue, 16 Jun 2026 14:32:16 +0000 [thread overview]
Message-ID: <20260616143217.48F091F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260615122950.22281-2-ansuelsmth@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch makes a one-time copy of `supported_interfaces` during `phylink_create()`, which breaks drivers like `mtk_eth_soc` that modify `phylink_config.supported_interfaces` after calling `phylink_create()`.
--
commit c809e12abb9cfbf31d18f5e71f4e3d15bb4f6a01
Author: Christian Marangi <ansuelsmth@gmail.com>
net: phylink: keep and use MAC supported_interfaces in phylink struct
This patch introduces a cached copy of the supported_interfaces mask in the
phylink struct. It initializes this copy during phylink_create() and
transitions the phylink core to validate against this internal mask rather
than the original phylink_config.
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 087ac63f9193d..4d59c0dd78dbf 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
[ ... ]
> @@ -1868,6 +1873,9 @@ struct phylink *phylink_create(struct phylink_config *config,
> mutex_init(&pl->state_mutex);
> INIT_WORK(&pl->resolve, phylink_resolve);
>
> + phy_interface_copy(pl->supported_interfaces,
> + config->supported_interfaces);
> +
[Severity: High]
Does this one-time copy in phylink_create() break drivers that modify their
supported_interfaces after initialization?
For example, in drivers/net/ethernet/mediatek/mtk_eth_soc.c:mtk_add_mac(),
the driver appends PHY_INTERFACE_MODE_INTERNAL to
mac->phylink_config.supported_interfaces after phylink_create() has already
been called:
drivers/net/ethernet/mediatek/mtk_eth_soc.c:mtk_add_mac() {
...
mac->phylink = phylink_create(&mac->phylink_config, ...);
...
if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_2P5GPHY) &&
id == MTK_GMAC2_ID)
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
mac->phylink_config.supported_interfaces);
...
}
Since phylink now validates against the cached pl->supported_interfaces mask,
will it reject PHY_INTERFACE_MODE_INTERNAL as unsupported and prevent the
internal 2.5G PHY from linking successfully on affected Mediatek platforms?
> pl->config = config;
> if (config->type == PHYLINK_NETDEV) {
> pl->netdev = to_net_dev(config->dev);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260615122950.22281-1-ansuelsmth@gmail.com?part=1
next prev parent reply other threads:[~2026-06-16 14:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 12:29 [PATCH net-next v7 00/12] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-06-15 12:29 ` [PATCH net-next v7 01/12] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-06-15 13:33 ` Maxime Chevallier
2026-06-15 14:18 ` Christian Marangi
2026-06-16 14:32 ` sashiko-bot [this message]
2026-06-15 12:29 ` [PATCH net-next v7 02/12] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-06-15 13:31 ` Maxime Chevallier
2026-06-15 14:17 ` Christian Marangi
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 03/12] net: phylink: add phylink_release_pcs() to externally release a PCS Christian Marangi
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 04/12] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 05/12] net: phylink: support late PCS provider attach Christian Marangi
2026-06-15 14:07 ` Maxime Chevallier
2026-06-15 14:10 ` Christian Marangi
2026-06-15 14:29 ` Maxime Chevallier
2026-06-15 14:35 ` Christian Marangi
2026-06-15 14:44 ` Maxime Chevallier
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 06/12] net: Document PCS subsystem Christian Marangi
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 07/12] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-06-15 12:29 ` [PATCH net-next v7 08/12] of: property: fw_devlink: Add support for "pcs-handle" Christian Marangi
2026-06-15 12:29 ` [PATCH net-next v7 09/12] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 10/12] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-06-15 12:29 ` [PATCH net-next v7 11/12] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-06-15 16:31 ` Benjamin Larsson
2026-06-16 14:32 ` sashiko-bot
2026-06-15 12:29 ` [PATCH net-next v7 12/12] net: airoha: add phylink support Christian Marangi
2026-06-15 16:07 ` Benjamin Larsson
2026-06-16 14:32 ` 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=20260616143217.48F091F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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