From: Paolo Abeni <pabeni@redhat.com>
To: Damien Dejean <dam.dejean@gmail.com>,
andrew@lunn.ch, krzk+dt@kernel.org, robh@kernel.org,
kuba@kernel.org, maxime.chevallier@bootlin.com
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, edumazet@google.com,
davem@davemloft.net, hkallweit1@gmail.com
Subject: Re: [PATCH v6 4/4] net: phy: realtek: add RTL8224 polarity support
Date: Wed, 11 Feb 2026 12:36:49 +0100 [thread overview]
Message-ID: <def77227-7b69-4f23-8f68-949173eda6a4@redhat.com> (raw)
In-Reply-To: <20260207092539.647768-4-dam.dejean@gmail.com>
On 2/7/26 10:25 AM, Damien Dejean wrote:
> diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
> index 4f0c1b72f7e0..d15d3b41e5d1 100644
> --- a/drivers/net/phy/realtek/realtek_main.c
> +++ b/drivers/net/phy/realtek/realtek_main.c
> @@ -172,6 +172,7 @@
> #define RTL8224_SRAM_RTCT_LEN(pair) (0x8028 + (pair) * 4)
>
> #define RTL8224_VND1_MDI_PAIR_SWAP 0xa90
> +#define RTL8224_VND1_MDI_POLARITY_SWAP 0xa94
>
> #define RTL8366RB_POWER_SAVE 0x15
> #define RTL8366RB_POWER_SAVE_ON BIT(12)
> @@ -1861,9 +1862,51 @@ static int rtl8224_mdi_config_order(struct phy_device *phydev)
> return ret;
> }
>
> +static int rtl8224_mdi_config_polarity(struct phy_device *phydev)
> +{
> + struct device_node *np = phydev->mdio.dev.of_node;
> + u8 offset = (phydev->mdio.addr & 3) * 4;
> + u32 polarity = 0;
> + int ret, val;
> +
> + ret = of_property_read_u32(np, "enet-phy-pair-polarity", &polarity);
> +
> + /* Do nothing if the property is not present */
> + if (ret == -EINVAL)
> + return 0;
> +
> + if (ret)
> + return ret;
> +
> + if (polarity & ~0xf)
> + return -EINVAL;
> +
> + phy_lock_mdio_bus(phydev);
> + val = __phy_package_read_mmd(phydev, 0, MDIO_MMD_VEND1,
> + RTL8224_VND1_MDI_POLARITY_SWAP);
> + if (val < 0) {
> + ret = val;
> + goto exit;
> + }
> +
> + val &= ~(0xf << offset);
> + val |= polarity << offset;
> + ret = __phy_package_write_mmd(phydev, 0, MDIO_MMD_VEND1,
> + RTL8224_VND1_MDI_POLARITY_SWAP, val);
> +exit:
> + phy_unlock_mdio_bus(phydev);
> + return ret;
> +}
> +
> static int rtl8224_config_init(struct phy_device *phydev)
> {
> - return rtl8224_mdi_config_order(phydev);
> + int ret;
> +
> + ret = rtl8224_mdi_config_order(phydev);
> + if (ret)
> + return ret;
> +
> + return rtl8224_mdi_config_polarity(phydev);
This very close to what you implemented into patch 2/4. Likely you can
deduplicate the code a bit factoring out some common helper.
Side notes: you should include the target tree in the subj prefix -
'net-next' in this case, a per patch changelog for the introduced
changes WRT the previous revision and a cover letter.
Also note that net-next is now closed for the merge window; you will
have to wait unit ~23 Feb before reposting.
/P
> }
>
> static int rtl8224_probe(struct phy_device *phydev)
next prev parent reply other threads:[~2026-02-11 11:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 9:25 [PATCH v6 1/4] dt-bindings: net: ethernet-phy: add property enet-phy-pair-order Damien Dejean
2026-02-07 9:25 ` [PATCH v6 2/4] net: phy: realtek: add RTL8224 pair order support Damien Dejean
2026-02-07 9:25 ` [PATCH v6 3/4] dt-bindings: net: ethernet-phy: add property enet-phy-pair-polarity Damien Dejean
2026-03-05 23:42 ` Rob Herring (Arm)
2026-02-07 9:25 ` [PATCH v6 4/4] net: phy: realtek: add RTL8224 polarity support Damien Dejean
2026-02-11 11:36 ` Paolo Abeni [this message]
2026-02-21 20:20 ` Damien Dejean
2026-03-05 23:41 ` [PATCH v6 1/4] dt-bindings: net: ethernet-phy: add property enet-phy-pair-order Rob Herring (Arm)
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=def77227-7b69-4f23-8f68-949173eda6a4@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew@lunn.ch \
--cc=dam.dejean@gmail.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.org \
/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