Message ID | 20241004212711.422811-1-qingtao.cao@digi.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v4,1/1] net: phy: marvell: make use of fiber autoneg bypass mode | expand |
On Sat, Oct 05, 2024 at 07:27:11AM +1000, Qingtao Cao wrote: > 88E151x supports the SGMII autoneg bypass mode and it defaults to be > enabled. When it is activated, the device assumes a link-up status so > avoid bringing down fibre link in this case Please can you stop posting new patches while there is still discussion going on. I'm simply going to NAK this patch, because you haven't given any time for discussion to conclude on your previous offering, and I see no point in even bothering to read this while the whole subject of whether AN bypass should be used is still unsettled. Please wait for discussion to conclude before posting new patches.
On Fri, Oct 04, 2024 at 10:54:03PM +0100, Russell King (Oracle) wrote: > On Sat, Oct 05, 2024 at 07:27:11AM +1000, Qingtao Cao wrote: > > 88E151x supports the SGMII autoneg bypass mode and it defaults to be > > enabled. When it is activated, the device assumes a link-up status so > > avoid bringing down fibre link in this case > > Please can you stop posting new patches while there is still discussion > going on. > > I'm simply going to NAK this patch, because you haven't given any time > for discussion to conclude on your previous offering, and I see no > point in even bothering to read this while the whole subject of > whether AN bypass should be used is still unsettled. > > Please wait for discussion to conclude before posting new patches. +1 Andrew --- pw-bot: cr
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 9964bf3dea2f..6d48add9dc0a 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -195,6 +195,9 @@ #define MII_88E1510_MSCR_2 0x15 +#define MII_88E151X_FSCR2 0x1a +#define MII_88E151X_FSCR2_BYPASS_STATUS BIT(5) + #define MII_VCT5_TX_RX_MDI0_COUPLING 0x10 #define MII_VCT5_TX_RX_MDI1_COUPLING 0x11 #define MII_VCT5_TX_RX_MDI2_COUPLING 0x12 @@ -1623,12 +1626,24 @@ static void fiber_lpa_mod_linkmode_lpa_t(unsigned long *advertising, u32 lpa) static int marvell_read_status_page_an(struct phy_device *phydev, int fiber, int status) { + int fscr2; int lpa; int err; if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) { phydev->link = 0; - return 0; + if (!fiber) + return 0; + + /* Already on page 1 for fibre */ + fscr2 = phy_read(phydev, MII_88E151X_FSCR2); + if (fscr2 < 0) + return fscr2; + + if (!(fscr2 & MII_88E151X_FSCR2_BYPASS_STATUS)) + return 0; + + phydev->link = 1; } if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
88E151x supports the SGMII autoneg bypass mode and it defaults to be enabled. When it is activated, the device assumes a link-up status so avoid bringing down fibre link in this case Test case: 1. Two 88E151x are connected with SFP 2. One enables autoneg while the other is 1000BASE-X 3. On the one with autoneg, the link can still be up with this change otherwise not Signed-off-by: Qingtao Cao <qingtao.cao@digi.com> --- drivers/net/phy/marvell.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)