net: phy: Add driver for Motorcomm Quad 2.5GbE phy
Subsystems (5)
v22 cover net: phy: Add driver for Motorcomm Quad 2.5GbE phy
This patchset mainly implements the phy8824 driver. The phy8824 is an Ethernet PHY that provides one 10G SerDes output to four 2.5G ports. The driver mainly covers two application scenarios:
1. external PHY8824
2. PHY8824 embedded in a switch.
The patchset mainly consists of three parts:
1. the DTS for the phy8824
2. a generic template testmode configuration api.
3. the phy8824 functional functions.
changes in v22:
1) Using motorcomm,package-mode to replace phy-mode in DTS.
2) The corresponding parsing has also been updated, using "motorcomm,package-mode".
changes in v21:
patch 1: 1) Add maintainer for motorcomm,yt8824.yaml.
2) Using 10g-qxgmii instead of usxgmii.
patch 3: 1) Change the usxgmii space to serdes space.
2) Add lock operation during phy-package init in probe()
3) Add check for whether auto-negotiation is enabled when updating the link status in read_status().
changes in v20:
patch 1: Add phy-mode description in properties in motorcomm,yt8824.yaml
changes in v19:
patch 2: Replace the int type with the u16 type for test_mode. patch 3: 1) Merge yt8824_utp_normal_test_mode_paged() and
yt8824_utp_invalid_test_mode_paged() into
yt8824_utp_set_template_test_mode().2) Add a fatal error return when phy-mode is missing in the DTS.
changes in v18:
1. Split the template_testmode() into a small patch and optimize the implementation.
2. Optimize the definition and initialization of interface_mode by adopting the existing approach.
changes in v17:
patch 1: Remove redundant description.
Use phy-mode instead of motorcomm,interface to describe the interface.
Add the required checks.
patch 2: Use phy-mode to get interface mode.
Need return after init configuration is done to avoid falling into the error path.
changes in v16:
1. Add DTS documentation.
2. Fix redundant initialization.
changes in v14:
1. Refactor the error return path to preserve and return the initial error, rather than letting later errors mask it.
changes in v13:
1. Fix the lock release issue on the error path to prevent potential deadlock or resource leak.
2. Add a func yt8824_restore_defaults() to restore configuration on the error path,ensuring the hardware/device is left in a known good state upon failure.
changes in v12:
1. Refactor the yt8824_read_status() function to ensure proper state synchronization between hardware registers and the phy_device structure.
changes in v11:
1. Clean build_clang warning.
changes in v10:
1. Within the interface that swaps to the USXGMII reg space,the lock include shared_lock and mdio mutex must remain held throughout the entire operation and should only be released after all steps have completed.
2. Improve the template interface in phy-c45.c
3. Fix the handling of some failure paths.
changes in v9:
1. Add shared_lock mutex prevents UTPs from interfering with each other due to swapping reg space.
change in v8:
1. Clean up format warning.
2. Fix exception handling code logic based on Sashiko/Gemini.
3. Remove interrupt/handle function
changes in v7:
1. Refactor the using of mdio lock
In all cases of swapping to the USXGMII side interface, lock the MDIO bus at the beginning, switch to the UTP address space after the operation is completed, and then release the lock.The purpose of doing this is to ensure that it will not affect other UTPs operating in the UTP address space.
2. Rename YT8824_RSSR_FIBER_SPACE to YT8824_RSSR_USXGMII_SPACE.
changes in v6:
1. Add test mode helper in phy-c45.c
2. Refactor the using of swapping paged for utp and fiber
changes in v5:
1. Fix diffs issue which caused by unexpected whitespace.
2. Fix "exceeding 80 columns" warning.
changes in v4:
1. Remove motorcomm,yt8xxx.yaml, will update in other patch thread
2. Fix locking issue. Since every interface requires switching of space, the bus is already locked during the space switching process in phy_select_page(), other operations within the interface cannot be locked again before unlock in phy_restore_page().
3. Fix warning log identified during the inspection process using checkpatch.pl.
4. Fix the way of using common api in phy_package.c
changes in v3:
1. Using common apis defined in phy_package.c to handle shared top extend register space.
2. Add dts demo in motorcomm,yt8xxx.yaml.
3. Fix unnecessary redundant judgments.
4. Fix BMCR registers operation using magic number.
5. Rename function based on its approximate functionality.
changes in v2:
1. Remove duplicate code and replace it with existing api.
Kyle Switch (3):
dt-bindings: net: Document Motorcomm YT8824 PHY package
net: phy: Add support for Template Control register for PMA
net: phy: Add driver for Motorcomm Quad 2.5GbE phy
.../bindings/net/motorcomm,yt8824.yaml | 78 + MAINTAINERS | 2 + drivers/net/phy/Kconfig | 3 +- drivers/net/phy/motorcomm.c | 1602 ++++++++++++++++- drivers/net/phy/phy-c45.c | 23 + include/linux/phy.h | 1 + include/uapi/linux/mdio.h | 12 + 7 files changed, 1718 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml
Signature · 1 line
2.25.1
PATCH v22 1/3 dt-bindings: net: Document Motorcomm YT8824 PHY package
Motorcomm YT8824 Ethernet PHY is PHY package of 4 PHY-s.
--- .../bindings/net/motorcomm,yt8824.yaml | 78 +++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +78 -0
@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/motorcomm,yt8824.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MotorComm YT8824 Ethernet PHY + +maintainers: + - Kyle Switch <[email protected]> + +description: + Motorcomm YT8824 Ethernet PHY is a PHY package of 4 PHYs. + +$ref: ethernet-phy-package.yaml# + +properties: + compatible: + enum: + - motorcomm,yt8824-package + + motorcomm,package-mode: + description: | + PHY package can be configured in 2 modes: + - internal: YT8824 is embedded in the switch, using + an internal interface to the MAC. + - 10g-qxgmii: YT8824 is a standalone external PHY, + connected via 10G QXGMII. + $ref: /schemas/types.yaml#/definitions/string + enum: [ internal, 10g-qxgmii ] + + reg: + description: + The absolute MDIO address of the YT8824 shared top extend + register block. + For internal mode, this is fixed at 9; + For external mode, it is the base MDIO address of the four + member PHYs plus 4, where base is typically 0x0. + Note that this is NOT the reg of the first member PHY. + +required: + - compatible + - motorcomm,package-mode + - reg + +unevaluatedProperties: false + +examples: + - | + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy-package@9 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "motorcomm,yt8824-package"; + reg = <9>; + + motorcomm,package-mode = "internal"; + + ethernet-phy@4 { + reg = <4>; + }; + + ethernet-phy@5 { + reg = <5>; + }; + + ethernet-phy@6 { + reg = <6>; + }; + + ethernet-phy@7 { + reg = <7>; + }; + }; + };
MAINTAINERS +2 -0
@@ -18413,8 +18413,10 @@ F: drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c MOTORCOMM PHY DRIVER M: Frank <[email protected]> +M: Kyle Switch <[email protected]> L: [email protected] S: Maintained +F: Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml F: Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml F: drivers/net/phy/motorcomm.c
Signature · 1 line
2.25.1
[email protected]
AI reviewRe: [PATCH net-next v22 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you…
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit is titled "dt-bindings: net: Document Motorcomm YT8824 PHY package" and its body is one line ("Motorcomm YT8824 Ethernet PHY…
- [Low] (Baseline: fixed later in the series.) The concern was that the compatible "motorcomm,yt8824-package" and the required…
- [Low] The binding redefines the package node's reg as the MDIO address of the shared "top extend" register block and gives mode-…
- [Low] The required motorcomm,package-mode property (enum: internal, 10g-qxgmii) mixes two kinds of information.
- [Low] (Speculative, depends on the YT8824 hardware.) The package node sets unevaluatedProperties: false and defines only compatible, reg…
--
dt-bindings: net: Document Motorcomm YT8824 PHY package
This adds a new YAML binding for the Motorcomm YT8824 quad PHY package. It builds on ethernet-phy-package.yaml, adds a vendor motorcomm,package-mode property, and uses the package reg as the address of the shared top extend register block. It also updates the MOTORCOMM PHY DRIVER entry in MAINTAINERS.
Quoted 6 lines
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +0
-0@@ -0,0 +1,78 @@
[ ... ]
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml line 20
Quoted 6 lines
+$ref: ethernet-phy-package.yaml#
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +5
-0+ +properties: + compatible: + enum: + - motorcomm,yt8824-package
[Severity: Low]
At this commit, nothing in the tree uses the motorcomm,yt8824-package compatible or the motorcomm,package-mode property.
The later patch in the series, "net: phy: Add driver for Motorcomm Quad 2.5GbE phy", appears to add the user:
- yt8824_probe() calls devm_of_phy_package_join().
- yt8824_phy_package_probe_once() reads motorcomm,package-mode and returns -EINVAL when it is missing.
That matches the binding making the property required. It looks resolved by the end of the series, so I'm only noting it here.
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +10
-0+ + motorcomm,package-mode: + description: | + PHY package can be configured in 2 modes: + - internal: YT8824 is embedded in the switch, using + an internal interface to the MAC. + - 10g-qxgmii: YT8824 is a standalone external PHY, + connected via 10G QXGMII. + $ref: /schemas/types.yaml#/definitions/string + enum: [ internal, 10g-qxgmii ]
[Severity: Low]
Should "internal" be a separate compatible instead of a property value? It describes an embedded integration variant with a different programming model:
- The later driver uses yt8824_internal_config_init_paged() for it, but yt8824_extern_config_sds_init_paged() and yt8824_extern_config_utp_init_paged() for the external case.
- reg is fixed at 9.
writing-bindings.rst says "DON'T add properties to avoid a specific compatible".
"10g-qxgmii" is the standard phy-mode string, and the connected MAC nodes already carry it in phy-mode. In the later driver patch, yt8824_phy_package_probe_once() matches it with phy_mode_check(). Nothing compares priv->package_mode with phydev->interface.
Could a DT with package-mode = "internal" and a MAC using 10g-qxgmii (or the reverse) pass validation? In that case the PHY SerDes would be set up differently from the MAC side.
qcom,qca807x.yaml has a similar qcom,package-mode for SerDes selection, so the phy-mode overlap may be acceptable. The internal variant still seems to fit a compatible better.
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml line 39
Quoted 9 lines
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +9
-0+ + reg: + description: + The absolute MDIO address of the YT8824 shared top extend + register block. + For internal mode, this is fixed at 9; + For external mode, it is the base MDIO address of the four + member PHYs plus 4, where base is typically 0x0. + Note that this is NOT the reg of the first member PHY.
[Severity: Low]
These mode-dependent rules exist only in the description. There is no allOf/if/then keyed on motorcomm,package-mode, such as reg: const: 9 for "internal". So reg only inherits the 0..31 range from ethernet-phy-package.yaml.
Would a node with package-mode = "internal" and any other reg value still pass dt_binding_check?
The meaning also differs from the generic ethernet-phy-package.yaml text:
The base ID number for the PHY package. Commonly the ID of the first PHY in the PHY package.
A DT author could follow that convention. In the later driver, top extend accesses go through this path:
ytphy_write_top_ext()
__phy_package_write(phydev, 0, YTPHY_PAGE_SELECT, ...)
phy_package_address() returns base_addr + 0 here. With the wrong reg, these writes could reach member PHY 0's extended page registers instead of the top block.
The binding also doesn't say which MDIO addresses the member PHYs use in internal mode. The example puts them at 4..7 and the top block at 9. Could the description document this, including why address 8 is skipped?
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml line 46
Quoted 7 lines
Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml new file +7
-0+ +required: + - compatible + - motorcomm,package-mode + - reg + +unevaluatedProperties: false
[Severity: Low]
The package node sets unevaluatedProperties: false and defines only compatible, reg and motorcomm,package-mode. How would a board describe a package-level reset GPIO, supply rails or a SerDes reference clock for the standalone 10g-qxgmii configuration?
This depends on the YT8824 hardware, which I couldn't confirm.
If the chip has one shared reset pin, the only option left is the per-member reset-gpios from ethernet-phy.yaml. That would describe one shared pin as four per-PHY resets.
writing-bindings.rst says "DO attempt to make bindings complete even if a driver doesn't support some features."
[ ... ]
MAINTAINERS F: drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c · line 18416
Quoted 9 lines
MAINTAINERS +1
-0@@ -18413,8 +18413,10 @@ F: drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c MOTORCOMM PHY DRIVER M: Frank <[email protected]> +M: Kyle Switch <[email protected]>
[Severity: Low]
The commit message doesn't mention this M: line. It makes the author a co-maintainer of the whole MOTORCOMM PHY DRIVER entry, including drivers/net/phy/motorcomm.c and motorcomm,yt8xxx.yaml, not only the new binding.
Should this be a separate patch? Or could the changelog at least mention it, with an ack from the current maintainer?
The F: line for the new binding fits this patch. The later patches in the series don't touch MAINTAINERS again.
Quoted 5 lines
MAINTAINERS +1
-0L: [email protected] S: Maintained +F: Documentation/devicetree/bindings/net/motorcomm,yt8824.yaml F: Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml F: drivers/net/phy/motorcomm.c
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260929095430.508657-1-kyle.switch%40motor-comm.com
PATCH v22 2/3 net: phy: Add support for Template Control register for PMA
In reply to Kyle SwitchAdd support for the 10GBASE-T PMA Template Test Mode register field, which allows selecting one of eight test modes (Normal and TestMode1..TestMode7) used for PHY validation.
--- drivers/net/phy/phy-c45.c | 23 +++++++++++++++++++++++ include/linux/phy.h | 1 + include/uapi/linux/mdio.h | 12 ++++++++++++ 3 files changed, 36 insertions(+)
drivers/net/phy/phy-c45.c +23 -0
@@ -1408,6 +1408,29 @@ int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable) }EXPORT_SYMBOL_GPL (genphy_c45_fast_retrain); +/** +* genphy_c45_template_testmode - configure template testmode registers +* @phydev: target phy_device struct +* @test_mode: testmode includes Normal to Test mode 7 +* +* Description: Set template testmode include Normal to Test mode 7 +* +* Return: 0 on success, or a negative error code on failure (e.g. register +* read/write error). +*/ +int genphy_c45_template_testmode (struct phy_device *phydev,u16 test_mode) +{ +u16 ctrl; + +if (test_mode >MDIO_PMA_10GBT_TESTMODE_7 ) +return -EOPNOTSUPP ; + + ctrl =FIELD_PREP (MDIO_PMA_10GBT_TESTMODE_MASK , test_mode); +return phy_modify_mmd (phydev,MDIO_MMD_PMAPMD ,MDIO_PMA_10GBT_TESTMODE , +MDIO_PMA_10GBT_TESTMODE_MASK , ctrl); +} +EXPORT_SYMBOL_GPL (genphy_c45_template_testmode); +/** * genphy_c45_plca_get_cfg - get PLCA configuration from standard registers * @phydev: target phy_device struct
include/linux/phy.h +1 -0
@@ -2357,6 +2357,7 @@ int genphy_c45_loopback(struct phy_device *phydev, bool enable, int speed);int genphy_c45_pma_resume (struct phy_device *phydev);int genphy_c45_pma_suspend (struct phy_device *phydev);int genphy_c45_fast_retrain (struct phy_device *phydev,bool enable); +int genphy_c45_template_testmode (struct phy_device *phydev,u16 test_mode);int genphy_c45_plca_get_cfg (struct phy_device *phydev,struct phy_plca_cfg *plca_cfg); int genphy_c45_plca_set_cfg(struct phy_device *phydev,
include/uapi/linux/mdio.h +12 -0
@@ -63,6 +63,7 @@/* Media-dependent registers. */ #define MDIO_PMA_10GBT_SWAPPOL 130/* 10GBASE-T pair swap & polarity */ #define MDIO_PMA_10GBT_TXPWR 131/* 10GBASE-T TX power control */ +#define MDIO_PMA_10GBT_TESTMODE 132/* Test mode control */ #define MDIO_PMA_10GBT_SNR 133/* 10GBASE-T SNR margin, lane A. * Lanes B-D are numbered 134-136. */ #define MDIO_PMA_10GBR_FSRT_CSR 147/* 10GBASE-R fast retrain status and control */
@@ -320,6 +321,17 @@/* PMA 10GBASE-R Fast Retrain status and control register. */ #define MDIO_PMA_10GBR_FSRT_ENABLE 0x0001/* Fast retrain enable */ +/* PMA 10GBASE-T Template Test Mode Register*/ +#define MDIO_PMA_10GBT_TESTMODE_MASK GENMASK(15, 13)/* Template test mode */ +#define MDIO_PMA_10GBT_TESTMODE_NORMAL 0x0/* Template Normal */ +#define MDIO_PMA_10GBT_TESTMODE_1 0x1/* Template TestMode1 */ +#define MDIO_PMA_10GBT_TESTMODE_2 0x2/* Template TestMode2 */ +#define MDIO_PMA_10GBT_TESTMODE_3 0x3/* Template TestMode3 */ +#define MDIO_PMA_10GBT_TESTMODE_4 0x4/* Template TestMode4 */ +#define MDIO_PMA_10GBT_TESTMODE_5 0x5/* Template TestMode5 */ +#define MDIO_PMA_10GBT_TESTMODE_6 0x6/* Template TestMode6 */ +#define MDIO_PMA_10GBT_TESTMODE_7 0x7/* Template TestMode7 */ +/* PCS 10GBASE-R/-T status register 1. */ #define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001/* Block lock attained */
Signature · 1 line
2.25.1
Re: [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA
Quoted 5 lines · Kyle Switch
Add support for the 10GBASE-T PMA Template Test Mode register field, which allows selecting one of eight test modes (Normal and TestMode1..TestMode7) used for PHY validation.
Signed-off-by Kyle Switch <[email protected]>
Andrew
[email protected]
AI reviewRe: [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA
In reply to Kyle SwitchThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] uapi: kernel-internal GENMASK used in uapi header breaks userspace compilation - [Low] net: phy…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] uapi: kernel-internal GENMASK used in uapi header breaks userspace compilation
- [Low] net: phy: 'template' is a misnomer for standard 10GBASE-T test mode --
commit b002860110e66ac77172a47fcc853ce9025d5816
Author: Kyle Switch <[email protected]>
net: phy: Add support for Template Control register for PMA
Add support for the 10GBASE-T PMA Template Test Mode register field, which allows selecting one of eight test modes (Normal and TestMode1..TestMode7) used for PHY validation.
Quoted 4 lines
drivers/net/phy/phy-c45.c +0
-0
[ ... ]
Quoted 5 lines
drivers/net/phy/phy-c45.c +1
-0@@ -1408,6 +1408,29 @@ int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable) }EXPORT_SYMBOL_GPL (genphy_c45_fast_retrain); +/**
drivers/net/phy/phy-c45.c int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable) · line 1421
Quoted 10 lines
drivers/net/phy/phy-c45.c +10
-0+* genphy_c45_template_testmode - configure template testmode registers +* @phydev: target phy_device struct +* @test_mode: testmode includes Normal to Test mode 7 +* +* Description: Set template testmode include Normal to Test mode 7 +* +* Return: 0 on success, or a negative error code on failure (e.g. register +* read/write error). +*/ +int genphy_c45_template_testmode (struct phy_device *phydev,u16 test_mode)
[Severity: Low]
Does the word "template" accurately reflect the IEEE 802.3 standard?
The IEEE 802.3 standard (Clause 45.2.1.75) defines this as the 10GBASE-T test mode register. Using the word "template" in the core PHY API and UAPI comments appears to be a misnomer that could cause confusion, as it is not part of the standard nomenclature.
Quoted 11 lines
drivers/net/phy/phy-c45.c +11
-0+{ +u16 ctrl; + +if (test_mode >MDIO_PMA_10GBT_TESTMODE_7 ) +return -EOPNOTSUPP ; + + ctrl =FIELD_PREP (MDIO_PMA_10GBT_TESTMODE_MASK , test_mode); +return phy_modify_mmd (phydev,MDIO_MMD_PMAPMD ,MDIO_PMA_10GBT_TESTMODE , +MDIO_PMA_10GBT_TESTMODE_MASK , ctrl); +} +EXPORT_SYMBOL_GPL (genphy_c45_template_testmode);
[ ... ]
Quoted 4 lines
include/uapi/linux/mdio.h +0
-0
[ ... ]
include/uapi/linux/mdio.h line 325
Quoted 6 lines
include/uapi/linux/mdio.h +2
-0@@ -320,6 +321,17 @@/* PMA 10GBASE-R Fast Retrain status and control register. */ #define MDIO_PMA_10GBR_FSRT_ENABLE 0x0001/* Fast retrain enable */ +/* PMA 10GBASE-T Template Test Mode Register*/ +#define MDIO_PMA_10GBT_TESTMODE_MASK GENMASK(15, 13)/* Template test mode */
[Severity: High]
Will exposing the kernel-internal GENMASK macro in a UAPI header cause compilation failures for userspace programs?
Userspace applications including linux/mdio.h will fail to compile because GENMASK is defined in linux/bits.h, which is not available to userspace. UAPI headers must use __GENMASK instead.
include/uapi/linux/mdio.h line 333
Quoted 8 lines
include/uapi/linux/mdio.h +8
-0+#define MDIO_PMA_10GBT_TESTMODE_NORMAL 0x0/* Template Normal */ +#define MDIO_PMA_10GBT_TESTMODE_1 0x1/* Template TestMode1 */ +#define MDIO_PMA_10GBT_TESTMODE_2 0x2/* Template TestMode2 */ +#define MDIO_PMA_10GBT_TESTMODE_3 0x3/* Template TestMode3 */ +#define MDIO_PMA_10GBT_TESTMODE_4 0x4/* Template TestMode4 */ +#define MDIO_PMA_10GBT_TESTMODE_5 0x5/* Template TestMode5 */ +#define MDIO_PMA_10GBT_TESTMODE_6 0x6/* Template TestMode6 */ +#define MDIO_PMA_10GBT_TESTMODE_7 0x7/* Template TestMode7 */
[Severity: High]
Since kernel helpers like FIELD_PREP are not available in userspace, does providing these unshifted constants without a corresponding shift macro force userspace applications to hardcode the shifts when using them?
Quoted 3 lines
include/uapi/linux/mdio.h +0
-0/* PCS 10GBASE-R/-T status register 1. */ #define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001/* Block lock attained */
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewRe: [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA
In reply to Kyle SwitchThank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you…
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The new uAPI macro MDIO_PMA_10GBT_TESTMODE_MASK in include/uapi/linux/mdio.h is defined as GENMASK(15, 13).
- [Low] net: phy: 'template' is a misnomer for standard 10GBASE-T test mode
--
net: phy: Add support for Template Control register for PMA
This commit adds genphy_c45_template_testmode(), which programs the 10GBASE-T PMA template test mode field. It also adds new defines for the register (132) and for the Normal and TestMode1..TestMode7 values to include/uapi/linux/mdio.h.
Quoted 11 lines
include/uapi/linux/mdio.h +1
-0@@ -63,6 +63,7 @@/* Media-dependent registers. */ #define MDIO_PMA_10GBT_SWAPPOL 130/* 10GBASE-T pair swap & polarity */ #define MDIO_PMA_10GBT_TXPWR 131/* 10GBASE-T TX power control */ +#define MDIO_PMA_10GBT_TESTMODE 132/* Test mode control */ #define MDIO_PMA_10GBT_SNR 133/* 10GBASE-T SNR margin, lane A. * Lanes B-D are numbered 134-136. */
[ ... ]
include/uapi/linux/mdio.h line 325
Quoted 6 lines
include/uapi/linux/mdio.h +2
-0@@ -320,6 +321,17 @@/* PMA 10GBASE-R Fast Retrain status and control register. */ #define MDIO_PMA_10GBR_FSRT_ENABLE 0x0001/* Fast retrain enable */ +/* PMA 10GBASE-T Template Test Mode Register*/ +#define MDIO_PMA_10GBT_TESTMODE_MASK GENMASK(15, 13)/* Template test mode */
[Severity: Low]
Is "template" the right name for this helper? IEEE 802.3 calls PMA/PMD register 1.132 the 10GBASE-T test mode register. As far as I can tell, the word template is not part of the register's name in the standard.
The same wording shows up in several places:
- the exported symbol genphy_c45_template_testmode()
- its kerneldoc
- the "PMA 10GBASE-T Template Test Mode Register" comment and the "Template ..." value comments in include/uapi/linux/mdio.h
- the subject line ("Template Control register")
The new defines themselves are called MDIO_PMA_10GBT_TESTMODE_*, so the function name no longer matches the register it programs. Someone reading the code or grepping for the 10GBASE-T test mode register won't easily find this helper.
This has no functional impact. Still, once the symbol is exported from the core PHY library, other drivers may start using it and the name becomes harder to change.
If template refers to something in the Motorcomm datasheet or in the test procedure, could you say so in the commit message? Otherwise, would something like genphy_c45_10gbt_testmode() be closer to the standard's naming, with the comments and subject line updated to match?
[Severity: Low]
Will userspace be able to use this macro? GENMASK() comes from the kernel-internal include/linux/bits.h. This uapi header only includes:
#include <linux/types.h>
#include <linux/mii.h>
So a userspace program that includes <linux/mdio.h> and uses MDIO_PMA_10GBT_TESTMODE_MASK will not compile unless it defines GENMASK itself.
The MDIO_AN_C73_*_MASK defines in this header already have the same problem, but this change adds another one to the exported header.
Would __GENMASK(15, 13) from include/uapi/linux/bits.h, or a plain 0xe000, work better here?
This isn't a bug, but the new register define above uses spaces:
#define MDIO_PMA_10GBT_TESTMODE 132 /* Test mode control */
while the lines around it use tabs to line up the values and comments. The same goes for the new MDIO_PMA_10GBT_TESTMODE_* value defines.
Quoted 9 lines
include/uapi/linux/mdio.h +9
-0+#define MDIO_PMA_10GBT_TESTMODE_NORMAL 0x0/* Template Normal */ +#define MDIO_PMA_10GBT_TESTMODE_1 0x1/* Template TestMode1 */ +#define MDIO_PMA_10GBT_TESTMODE_2 0x2/* Template TestMode2 */ +#define MDIO_PMA_10GBT_TESTMODE_3 0x3/* Template TestMode3 */ +#define MDIO_PMA_10GBT_TESTMODE_4 0x4/* Template TestMode4 */ +#define MDIO_PMA_10GBT_TESTMODE_5 0x5/* Template TestMode5 */ +#define MDIO_PMA_10GBT_TESTMODE_6 0x6/* Template TestMode6 */ +#define MDIO_PMA_10GBT_TESTMODE_7 0x7/* Template TestMode7 */ +
[ ... ]
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260929095430.508657-1-kyle.switch%40motor-comm.com
PATCH v22 3/3 net: phy: Add driver for Motorcomm Quad 2.5GbE phy
In reply to Kyle SwitchAdd support for Motorcomm YT8824 quad-port 2.5G PHY to the existing motorcomm driver, using the phy_package helpers for the shared top extended register space.
--- drivers/net/phy/Kconfig | 3 +- drivers/net/phy/motorcomm.c | 1602 ++++++++++++++++++++++++++++++++++- 2 files changed, 1602 insertions(+), 3 deletions(-)
drivers/net/phy/Kconfig +2 -1
@@ -361,9 +361,10 @@ config MICROSEMI_PHY config MOTORCOMM_PHY tristate "Motorcomm PHYs" + select PHY_PACKAGE help Enables support for Motorcomm network PHYs. - Currently supports YT85xx Gigabit Ethernet PHYs. + Currently supports YT85xx Gigabit Ethernet PHYs and YT8824 4 * 2.5G PHY. config NATIONAL_PHY tristate "National Semiconductor PHYs"
drivers/net/phy/motorcomm.c +1600 -2
1,679 lines not on this page · raw message
Signature · 1 line
2.25.1
Andrew Lunn
maintainerdrivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 884
Quoted 8 lines
drivers/net/phy/motorcomm.c +8
-0+static int yt8824_restore_working_status (struct phy_device *phydev,int ret) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +int r; + +/* configure normal test mode */ + r =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_NORMAL );
The opening ( should be on the line before. The phydev as well.
Quoted 5 lines
+ *
yt8824_soft_reset()- called to do PHY software reset
+ * @phydev: a pointer to a &structphy_device
+ *
+ * Returns: 0 or negative errno code
+ */
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 912
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+static int yt8824_soft_reset (struct phy_device *phydev) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +int ret; + +mutex_lock (&priv->shared_lock); +if (priv->package_mode ==PHY_INTERFACE_MODE_INTERNAL ) { +/* test mode 1 */ + ret =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_1 );
Please look through the code and fix all these problems.
Also, what value does the comment have?
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 920
Quoted 8 lines
drivers/net/phy/motorcomm.c +8
-0+if (ret <0 ) + goto retry; + ret =yt8824_utp_softreset_paged (phydev); +if (ret <0 ) + goto retry; +/* normal mode */ + ret =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_NORMAL );
And this comment? You only need comments if the code is not obvious. The name of the function is often sufficient to explain what is happening.
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 983
Quoted 4 lines
drivers/net/phy/motorcomm.c +4
-0+/* pll calibration */ + ret =ytphy_write_ext_with_lock (phydev,0x0001 ,0x0003 ); +if (ret <0 ) + goto err_restore;
This comment is useful, it is not possible to know what 0x0001, 0x0003 means.
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 985
Quoted 1 line
drivers/net/phy/motorcomm.c +1
-0+ ret =ytphy_write_ext_with_lock (phydev,0xa20e ,0x0cba );
and this is just magic. Which is why we recommend #define, not magic numbers.
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 1522
Quoted 5 lines
drivers/net/phy/motorcomm.c +5
-0+/* power down */ + ret =phy_modify (phydev,MII_BMCR ,BMCR_PDOWN ,BMCR_PDOWN ); +if (ret <0 ) + goto err_restore; + ret =ytphy_write_ext_with_lock (phydev,0xa20e ,0xcba );
You comment about the obvious power down, but nothing about what this magic does :-(
Andrew
Quoted 27 lines · Andrew Lunn
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 884
Quoted 8 lines
drivers/net/phy/motorcomm.c +8
-0+static int yt8824_restore_working_status (struct phy_device *phydev,int ret) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +int r; + +/* configure normal test mode */ + r =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_NORMAL );The opening ( should be on the line before. The phydev as well.
Quoted 5 lines
+ *
yt8824_soft_reset()- called to do PHY software reset
+ * @phydev: a pointer to a &structphy_device
+ *
+ * Returns: 0 or negative errno code
+ */drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 912
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+static int yt8824_soft_reset (struct phy_device *phydev) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +int ret; + +mutex_lock (&priv->shared_lock); +if (priv->package_mode ==PHY_INTERFACE_MODE_INTERNAL ) { +/* test mode 1 */ + ret =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_1 );Please look through the code and fix all these problems.
Quoted 2 lines
Also, what value does the comment have?
okay, meaningless comments will be removed.
Quoted 23 lines
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 920
Quoted 8 lines
drivers/net/phy/motorcomm.c +8
-0+if (ret <0 ) + goto retry; + ret =yt8824_utp_softreset_paged (phydev); +if (ret <0 ) + goto retry; +/* normal mode */ + ret =yt8824_utp_set_template_test_mode + (phydev,MDIO_PMA_10GBT_TESTMODE_NORMAL );And this comment? You only need comments if the code is not obvious. The name of the function is often sufficient to explain what is happening.
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 983
Quoted 4 lines
drivers/net/phy/motorcomm.c +4
-0+/* pll calibration */ + ret =ytphy_write_ext_with_lock (phydev,0x0001 ,0x0003 ); +if (ret <0 ) + goto err_restore;This comment is useful, it is not possible to know what
0x0001,0x0003means.drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 985
Quoted 1 line
drivers/net/phy/motorcomm.c +1
-0+ ret =ytphy_write_ext_with_lock (phydev,0xa20e ,0x0cba );and this is just magic. Which is why we recommend #define, not magic numbers.
Quoted 7 lines
drivers/net/phy/motorcomm.c static int ytphy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) · line 1522
Quoted 5 lines
drivers/net/phy/motorcomm.c +5
-0+/* power down */ + ret =phy_modify (phydev,MII_BMCR ,BMCR_PDOWN ,BMCR_PDOWN ); +if (ret <0 ) + goto err_restore; + ret =ytphy_write_ext_with_lock (phydev,0xa20e ,0xcba );You comment about the obvious power down, but nothing about what this magic does :-(
okay, magic numbers will be replaced with meaningful definitions.
Quoted 2 lines
Andrew
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider.
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 2
If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).
- [Medium] In drivers/net/phy/motorcomm.c, yt8824_read_status_paged() clears phydev->speed and phydev->duplex to UNKNOWN whenever the link…
- [Medium] yt8824_read_status_paged() only calls genphy_c45_read_lpa() when phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete.
- [Low] yt8824_probe() calls phy_package_probe_once(), and __phy_package_set_once() does !test_and_set_bit(), so the shared…
- [Low] In yt8824_config_aneg(), the comment says ADV2_5G is advertised 'when 2.5G is explicitly forced', and the condition has a…
--
net: phy: Add driver for Motorcomm Quad 2.5GbE phy
This adds support for the Motorcomm YT8824 quad-port 2.5G PHY to the existing motorcomm driver. It uses the phy_package helpers for the shared top extended register space, and a package-wide mutex to serialize UTP and SerDes register space switching. The package mode comes from the "motorcomm,package-mode" DT property.
Quoted 4 lines
drivers/net/phy/motorcomm.c +0
-0
[ ... ]
Quoted 4 lines
drivers/net/phy/motorcomm.c +0
-0@@ -3104,6 +4230,461 @@ static int yt8821_resume(struct phy_device *phydev)return yt8821_modify_utp_fiber_bmcr (phydev,BMCR_PDOWN ,0 ); }
[ ... ]
Quoted 8 lines
drivers/net/phy/motorcomm.c +8
-0+static int yt8824_read_status_paged (struct phy_device *phydev) +{ +int ret; +int val; + + ret =phy8824_page_write_with_lock (phydev,YT8824_RSSR_UTP_SPACE ); +if (ret <0 ) +return ret;
drivers/net/phy/motorcomm.c static int yt8821_resume(struct phy_device *phydev) · line 4309
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+ + ret =genphy_read_status (phydev); +if (ret <0 ) +return ret; + +if (phydev->autoneg ==AUTONEG_ENABLE && phydev->autoneg_complete) { + ret =genphy_c45_read_lpa (phydev); +if (ret <0 ) +return ret; + }
[Severity: Medium]
Can ETHTOOL_LINK_MODE_2500baseT_Full_BIT stay set in phydev->lp_advertising after a 2.5G link partner goes away?
If autoneg has not completed (link loss, or renegotiation in progress), genphy_read_status()->genphy_read_lpa() clears only the C22 and 1000BASE-T bits:
drivers/net/phy/phy_device.c:genphy_read_lpa() {
...
if (phydev->autoneg == AUTONEG_ENABLE) {
if (!phydev->autoneg_complete) {
mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising,
0);
mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, 0);
return 0;
...
}Only the !MDIO_AN_STAT1_COMPLETE branch of genphy_c45_read_lpa() clears the 2.5G link partner bit:
if (!(val & MDIO_AN_STAT1_COMPLETE)) {
...
mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, 0);The autoneg_complete gate here means that branch never runs. So ethtool would keep showing 2500baseT/Full in the link partner advertisement until the next negotiation completes. yt8821_read_status() has the same gate, and this code copies it.
drivers/net/phy/motorcomm.c static int yt8821_resume(struct phy_device *phydev) · line 4313
Quoted 4 lines
drivers/net/phy/motorcomm.c +4
-0+ +if (!phydev->link) { + phydev->speed =SPEED_UNKNOWN ; + phydev->duplex =DUPLEX_UNKNOWN ;
[Severity: Medium]
Does this throw away the forced speed and duplex when autoneg is disabled?
With autoneg off, genphy_read_status()->genphy_read_status_fixed() has just loaded the forced speed and duplex from BMCR. Whenever the link is down, this block overwrites them with SPEED_UNKNOWN and DUPLEX_UNKNOWN.
On the next restart (ip link set down/up, or phy_start() on resume), the path looks like this:
_phy_start_aneg()
phy_sanitize_settings()
phy_caps_lookup(SPEED_UNKNOWN, DUPLEX_UNKNOWN, supported, false)
/* no match, falls back to 'last', the slowest capability */
yt8824_config_aneg()
__genphy_config_aneg()
genphy_setup_forced()BMCR then gets the slowest supported mode, normally 10 Mb/s half duplex. It no longer matches what was requested with, for example, "ethtool -s ethX autoneg off speed 100 duplex full".
The PHY_HALTED handling in _phy_state_machine() avoids this by resetting speed and duplex only when autoneg is enabled:
case PHY_HALTED:
if (phydev->link) {
if (phydev->autoneg == AUTONEG_ENABLE) {
phydev->speed = SPEED_UNKNOWN;
phydev->duplex = DUPLEX_UNKNOWN;
}Should this block be limited to AUTONEG_ENABLE as well?
Quoted 4 lines
drivers/net/phy/motorcomm.c +4
-0+if (phydev->autoneg ==AUTONEG_ENABLE ) +phy_resolve_aneg_pause (phydev); +return 0 ; + }
[ ... ]
Quoted 14 lines
drivers/net/phy/motorcomm.c +14
-0+static int yt8824_config_aneg (struct phy_device *phydev) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +int phy_ctrl =0 ; +int ret; + +mutex_lock (&priv->shared_lock); + ret =phy8824_page_write_with_lock (phydev,YT8824_RSSR_UTP_SPACE ); +if (ret <0 ) + goto err; + +/* +* Only advertise 2.5G when autoneg is enabled, or when 2.5G is +* explicitly forced. When a different speed is forced, clear
drivers/net/phy/motorcomm.c static int yt8821_resume(struct phy_device *phydev) · line 4592
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+* ADV2_5G so a 2.5G-capable link partner cannot negotiate 2.5G. +* __genphy_config_aneg() only rewrites the +* clause 22 registers on the forced-speed path, so it will not +* clear this bit. +*/ +if ((phydev->autoneg ==AUTONEG_ENABLE || + phydev->speed ==SPEED_2500 ) && +linkmode_test_bit (ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + phydev->advertising)) + phy_ctrl =MDIO_AN_10GBT_CTRL_ADV2_5G ;
[Severity: Low]
Is the phydev->speed == SPEED_2500 part of this condition reachable?
phy_ethtool_ksettings_set() rejects AUTONEG_DISABLE for any speed other than 10, 100 or 1000:
if (autoneg == AUTONEG_DISABLE && ((speed != SPEED_1000 && speed != SPEED_100 && speed != SPEED_10) ||
phylink_ethtool_ksettings_set() goes through the same helper. The comment about 2.5G being "explicitly forced" therefore describes a case the driver cannot currently reach.
If it were reachable, the C45 advertisement would come from phydev->advertising. The forced C22 advertisement in __genphy_config_aneg() comes from phy_caps_lookup(speed, duplex, supported) instead, so the two halves would use different sources.
Could the condition and the comment cover only the autoneg case?
Quoted 3 lines
drivers/net/phy/motorcomm.c +3
-0+ + ret =phy_modify_mmd_changed (phydev,MDIO_MMD_AN ,MDIO_AN_10GBT_CTRL , +MDIO_AN_10GBT_CTRL_ADV2_5G , phy_ctrl);
[ ... ]
Quoted 16 lines
drivers/net/phy/motorcomm.c +16
-0+static int yt8824_phy_package_probe_once (struct phy_device *phydev) +{ +struct yt8824_shared_priv *priv =phy_package_get_priv (phydev); +struct device_node *np =phy_package_get_node (phydev); +const char *mode; + +if (!priv || !np) { +phydev_err (phydev,"%s: missing shared priv or DT node\n" , + __func__); +return -EINVAL ; + } +/* Initialise shared lock for YT8824 */ +mutex_init (&priv->shared_lock); + priv->package_mode =PHY_INTERFACE_MODE_INTERNAL ; +if (!of_property_read_string (np,"motorcomm,package-mode" , + &mode)) {
[ ... ]
Quoted 7 lines
drivers/net/phy/motorcomm.c +7
-0+ }else { +phydev_err (phydev,"missing package-mode in PHY package node.\n" ); +return -EINVAL ; + } + +return 0 ; +}
[ ... ]
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+static int yt8824_probe (struct phy_device *phydev) +{ +struct device *dev = &phydev->mdio.dev; +struct yt8824_shared_priv *shared_priv; +int ret; + + ret =devm_of_phy_package_join (dev, phydev,sizeof (*shared_priv)); +if (ret) +return ret; +
drivers/net/phy/motorcomm.c static int yt8821_resume(struct phy_device *phydev) · line 4683
Quoted 10 lines
drivers/net/phy/motorcomm.c +10
-0+/* Ensure other PHY probes wait for shared mutex initialization. */ +phy_package_lock (phydev); +if (phy_package_probe_once (phydev)) { + ret =yt8824_phy_package_probe_once (phydev); +if (ret) { +phy_package_unlock (phydev); +return ret; + } + } +phy_package_unlock (phydev);
[Severity: Low]
What happens to sibling PHYs in the package whenyt8824_phy_package_probe_once() fails?
phy_package_probe_once() ends up in __phy_package_set_once(), which does !test_and_set_bit(). The once-bit is therefore set before the DT property is validated. On -EINVAL the bit is not cleared, and the failure is not recorded in the shared priv.
devm_of_phy_package_join() runs outside the package lock. A sibling that joined earlier (async probing, or overlapping manual binds) keeps the shared object alive:
PHY A PHY Bdevm_of_phy_package_join() devm_of_phy_package_join()phy_package_lock()phy_package_probe_once() -> trueyt8824_phy_package_probe_once()
package_mode = INTERNAL
return -EINVALphy_package_unlock()
phy_package_lock()
phy_package_probe_once() -> false
phy_package_unlock()
return 0PHY B then binds with the PHY_INTERFACE_MODE_INTERNAL default that was written before the property check. Its config_init runs the internal-mode sequence on a package whose DT was already rejected.
With the default synchronous probing, the failed probe's devres unwind drops the refcount to zero first. This only shows up with async probing.
Could the first probe's result be stored in yt8824_shared_priv so that later joiners also fail?
As a side note, the !priv || !np check can't trigger, because of_phy_package_join() always sets both.
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260929095430.508657-1-kyle.switch%40motor-comm.com