* Re: [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG [not found] <20260327202001.413280-1-jan@3e8.eu> @ 2026-03-31 13:24 ` Paolo Abeni 2026-03-31 13:38 ` Russell King (Oracle) 1 sibling, 0 replies; 3+ messages in thread From: Paolo Abeni @ 2026-03-31 13:24 UTC (permalink / raw) To: Jan Hoffmann, Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski, Daniel Golle, Markus Stockhausen, Damien Dejean Cc: netdev, linux-kernel On 3/27/26 8:32 PM, Jan Hoffmann wrote: > +static int rtl8226_config_mdi_order(struct phy_device *phydev) > +{ > + u32 order; > + int ret; > + > + ret = of_property_read_u32(phydev->mdio.dev.of_node, "enet-phy-pair-order", &order); > + > + /* Property not present, nothing to do */ > + if (ret == -EINVAL || ret == -ENOSYS) > + return 0; > + > + if (ret) > + return ret; > + > + /* Only enabling MDI swapping is supported */ > + if (order != 1) > + return -EINVAL; I guess some existing setup may have "enet-phy-pair-order" == 0, and the above will make them fail. I think you should just pass with no action in such a case. /P ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG [not found] <20260327202001.413280-1-jan@3e8.eu> 2026-03-31 13:24 ` [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG Paolo Abeni @ 2026-03-31 13:38 ` Russell King (Oracle) 2026-04-03 18:49 ` Jan Hoffmann 1 sibling, 1 reply; 3+ messages in thread From: Russell King (Oracle) @ 2026-03-31 13:38 UTC (permalink / raw) To: Jan Hoffmann Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Golle, Markus Stockhausen, Damien Dejean, netdev, linux-kernel 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. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG 2026-03-31 13:38 ` Russell King (Oracle) @ 2026-04-03 18:49 ` Jan Hoffmann 0 siblings, 0 replies; 3+ messages in thread From: Jan Hoffmann @ 2026-04-03 18:49 UTC (permalink / raw) To: Russell King (Oracle) Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Golle, Markus Stockhausen, Damien Dejean, netdev, linux-kernel 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-03 18:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260327202001.413280-1-jan@3e8.eu>
2026-03-31 13:24 ` [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG Paolo Abeni
2026-03-31 13:38 ` Russell King (Oracle)
2026-04-03 18:49 ` Jan Hoffmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox