Re: [PATCH net 1/3] net: hns3: fix loopback test of serdes and phy is failed if duplex is half
From: Jijie Shao
Date: Fri Sep 19 2025 - 02:37:02 EST
on 2025/9/18 0:58, Andrew Lunn wrote:
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 dataLets think about the fundamentals of Ethernet, MII and half duplex.
at the same time.
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.
My idea is to prevent customers from seeing command failures,
so I switched from half-duplex to full-duplex for testing.
But it doesn't seem quite appropriate.
+ hdev->hw.mac.duplex_last = phydev->duplex;A MAC driver should not be doing this. What if the PHY is C45 only?
+
+ ret = phy_set_bits(phydev, MII_BMCR, BMCR_FULLDPLX);
And Marvell PHYs need a soft reset before such an operation take
effect.
Andrew
Thanks for the reminder.
Thanks,
Jijie Shao