Re: [PATCH net 1/3] net: hns3: fix loopback test of serdes and phy is failed if duplex is half
From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-09-17 16:59:16
Also in:
lkml
From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-09-17 16:59:16
Also in:
lkml
On Wed, Sep 17, 2025 at 08:29:52PM +0800, Jijie Shao wrote:
If duplex setting is half, mac and phy can not transmit and receive data at the same time.
Lets think about the fundamentals of Ethernet, MII and half duplex. Is this specific to your MAC/PHY combination, or just generally true? Should this is solved in phylib, because it is true for every MAC/PHY combination? phylib returning -EINAL to phy_loopback() would seem like the correct thing to do. Is it specific to your PHY, but independent of the MAC? Then the PHY should return -EINVAL in its set_loopback() method.
+ hdev->hw.mac.duplex_last = phydev->duplex; + + ret = phy_set_bits(phydev, MII_BMCR, BMCR_FULLDPLX);
A MAC driver should not be doing this. What if the PHY is C45 only?
And Marvell PHYs need a soft reset before such an operation take
effect.
Andrew
---
pw-bot: cr