Re: [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG

From: Jan Hoffmann

Date: Fri Apr 03 2026 - 14:51:24 EST


Hi Russell,

On 2026-03-31 at 15:38, Russell King (Oracle) wrote:
On Fri, Mar 27, 2026 at 08:32:28PM +0100, Jan Hoffmann wrote:
+static int rtl8226_config_init(struct phy_device *phydev)
+{
+ int ret;
+
+ ret = rtl8226_config_mdi_order(phydev);
+ if (ret)
+ return ret;

As I've been pointing out in other patches, putting this "defaulting"
here is not a good idea - this path gets called when the PHY is attached
to the netdev and also when the PHY is being resumed - which will wipe
out the user's configuration just because their system suspended.

I don't think that gives the user a good experience.

In this case, there is no user configuration which could be overwritten. Whether MDI swapping needs to be enabled depends only on the board layout (the feature exists to avoid PCB traces having to cross).

But there is indeed no need to configure it on every resume, just once should be enough. Do I understand correctly that .probe would be the right place to do this then?

Thanks,
Jan