From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
UNGLinuxDriver@microchip.com,
bcm-kernel-feedback-list@broadcom.com,
Madalin Bucur <madalin.bucur@oss.nxp.com>,
Camelia Groza <camelia.groza@nxp.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Ioana Ciornei <ioana.ciornei@nxp.com>,
Maxim Kochetkov <fido_max@inbox.ru>,
Sean Anderson <sean.anderson@seco.com>,
Antoine Tenart <atenart@kernel.org>,
Michael Walle <michael@walle.cc>,
Raag Jadav <raagjadav@gmail.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>,
Ong Boon Leong <boon.leong.ong@intel.com>,
Colin Foster <colin.foster@in-advantage.com>,
Marek Behun <marek.behun@nic.cz>
Subject: Re: [PATCH v4 net-next 3/8] net: phy: bcm84881: move the in-band capability check where it belongs
Date: Fri, 25 Nov 2022 13:43:34 +0000 [thread overview]
Message-ID: <Y4DGhv/6BHNaMEYQ@shell.armlinux.org.uk> (raw)
In-Reply-To: <20221125123022.cnqobhnuzyqb5ukw@skbuf>
Hi Vladimir,
On Fri, Nov 25, 2022 at 02:30:42PM +0200, Vladimir Oltean wrote:
> Hi Russell,
>
> Sorry for the delay. Had to do something else yesterday and the day before.
I think there was some kind of celebration going on in the US for at
least one of those days...
> I tested the patch and it does detect the operating mode of my PHY.
Thanks for testing.
> My modules are these:
>
> [ 6.465788] sfp sfp-0: module UBNT UF-RJ45-1G rev 1.0 sn X20072804742 dc 200617
> ethtool -m dpmac7
> Identifier : 0x03 (SFP)
> Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
> Connector : 0x00 (unknown or unspecified)
> Transceiver codes : 0x00 0x00 0x00 0x08 0x00 0x00 0x00 0x00 0x00
> Transceiver type : Ethernet: 1000BASE-T
> Encoding : 0x01 (8B/10B)
> BR, Nominal : 1300MBd
> Rate identifier : 0x00 (unspecified)
> Length (SMF,km) : 0km
> Length (SMF) : 0m
> Length (50um) : 0m
> Length (62.5um) : 0m
> Length (Copper) : 100m
> Length (OM3) : 0m
> Laser wavelength : 0nm
> Vendor name : UBNT
> Vendor OUI : 00:00:00
> Vendor PN : UF-RJ45-1G
> Vendor rev : 1.0
> Option values : 0x00 0x1a
> Option : RX_LOS implemented
> Option : TX_FAULT implemented
> Option : TX_DISABLE implemented
> BR margin, max : 0%
> BR margin, min : 0%
> Vendor SN : X20072804742
> Date code : 200617
>
> Here is how the PHY driver does a few things:
>
> [ 3079.596985] fsl_dpaa2_eth dpni.1 dpmac7: configuring for inband/sgmii link mode
> [ 3079.689892] fsl_dpaa2_eth dpni.1 dpmac7: PHY driver reported AN inband 0x4 // PHY_AN_INBAND_ON_TIMEOUT
> [ 3079.696826] fsl_dpaa2_eth dpni.1 dpmac7: switched to phy/sgmii link mode
> [ 3079.779656] Marvell 88E1111 i2c:sfp-0:16: m88e1111_config_init_sgmii: EXT_SR before 0x9088 after 0x9084, fiber page BMCR 0x1140
> [ 3079.865386] fsl_dpaa2_eth dpni.1 dpmac7: PHY [i2c:sfp-0:16] driver [Marvell 88E1111] (irq=POLL)
>
> So the default EXT_SR is being changed by the PHY driver from 0x9088 to
> 0x9084 (MII_M1111_HWCFG_MODE_COPPER_1000X_AN -> MII_M1111_HWCFG_MODE_SGMII_NO_CLK).
>
> I don't know if it's possible to force these modules to operate in
> 1000BASE-X mode. If you're interested in the results there, please give
> me some guidance.
The value of "EXT_SR before" is 1000base-X, so if you change sfp-bus.c::
sfp_select_interface() to use 1000BASEX instead of SGMII then you'll be
using 1000BASEX instead (and it should work, although at fixed 1G
speeds). The only reason the module is working in SGMII mode is because,
as you've noticed above, we switch it to SGMII mode in
m88e1111_config_init_sgmii().
> I was curious if the fiber page BMCR has an effect for in-band autoneg,
> and at least for SGMII it surely does. If I add this to
> m88e1111_config_init_sgmii():
>
> phy_modify_paged(phydev, MII_MARVELL_FIBER_PAGE, MII_BMCR,
> BMCR_ANENABLE, 0);
>
> (and force an intentional mismatch) then I am able to break the link
> with my Lynx PCS.
Yes, the fiber page is re-used for the host side of the link when
operating in SGMII and 1000baseX modes, so changes there have the
expected effect.
> If my hunch is correct that this also holds true for 1000BASE-X, then
> you are also correct that m88e1111_config_init_1000basex() only allows
> AN bypass but does not seem to enable in-band AN in itself, if it wasn't
> enabled.
>
> The implication here is that maybe we should test for the fiber page
> BMCR in both SGMII and 1000BASE-X modes?
I think a more comprehensive test would be to write the fiber page
BMCR with 0x140 before changing the mode from 1000baseX to SGMII and
see whether the BMCR changes value. My suspicion is it won't, and
the hwcfg_mode only has an effect on the settings in the fiber page
under hardware reset conditions, and mode changes have no effect on
the fiber page.
If that is correct, then I think we have two options:
1. make m88e1111_config_init_1000basex() actually do what the comment
says, and enable AN in the fiber page (risky). That would make it
conform with how I implemented the validate_an_inband() function.
2. update the comment in m88e1111_config_init_1000basex() to reflect
what's actually happening with the hardware, and make
validate_an_inband() read the fiber page BMCR for 1000base-X too.
> Should we call m88e1111_validate_an_inband() also for the Finisar
> variant of the 88E1111? What about 88E1112?
Entirely probable - this patch is minimalist in order for your tests,
I didn't bother with the 151x devices. I'll prepare a more
comprehensive patch next week.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2022-11-25 13:43 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 0:01 [PATCH v4 net-next 0/8] Let phylink manage in-band AN for the PHY Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 1/8] net: phylink: let phylink_sfp_config_phy() determine the MLO_AN_* mode to use Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 2/8] net: phylink: introduce generic method to query PHY in-band autoneg capability Vladimir Oltean
2022-11-18 15:11 ` Sean Anderson
2022-11-18 15:42 ` Vladimir Oltean
2022-11-18 15:49 ` Sean Anderson
2022-11-18 15:56 ` Vladimir Oltean
2022-11-18 15:57 ` Sean Anderson
2022-11-18 16:00 ` Vladimir Oltean
2022-11-22 9:21 ` Russell King (Oracle)
2022-11-22 9:41 ` Vladimir Oltean
2022-11-22 9:52 ` Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 3/8] net: phy: bcm84881: move the in-band capability check where it belongs Vladimir Oltean
2022-11-22 9:38 ` Russell King (Oracle)
2022-11-22 10:01 ` Vladimir Oltean
2022-11-22 11:16 ` Russell King (Oracle)
2022-11-22 12:11 ` Vladimir Oltean
2022-11-22 16:58 ` Russell King (Oracle)
2022-11-22 17:56 ` Vladimir Oltean
2022-11-22 18:14 ` Vladimir Oltean
2022-11-22 18:28 ` Russell King (Oracle)
2022-11-22 19:36 ` Vladimir Oltean
2022-11-23 12:08 ` Russell King (Oracle)
2022-11-23 13:11 ` Russell King (Oracle)
2022-11-25 12:30 ` Vladimir Oltean
2022-11-25 13:43 ` Russell King (Oracle) [this message]
2022-11-25 15:35 ` Vladimir Oltean
2022-11-27 22:14 ` Russell King (Oracle)
2022-11-29 13:40 ` Russell King (Oracle)
2022-11-29 13:43 ` Russell King (Oracle)
2022-11-29 14:07 ` Andrew Lunn
2022-11-22 12:24 ` Vladimir Oltean
2022-11-22 17:51 ` Russell King (Oracle)
2022-11-18 0:01 ` [PATCH v4 net-next 4/8] net: phylink: add option to sync in-band autoneg setting between PCS and PHY Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 5/8] net: phylink: explicitly configure in-band autoneg for on-board PHYs Vladimir Oltean
2022-11-18 10:09 ` Russell King (Oracle)
2022-11-18 11:25 ` Vladimir Oltean
2022-11-18 14:37 ` Russell King (Oracle)
2022-11-18 0:01 ` [PATCH v4 net-next 6/8] net: phy: mscc: configure in-band auto-negotiation for VSC8514 Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 7/8] net: phy: at803x: validate in-band autoneg for AT8031/AT8033 Vladimir Oltean
2022-11-18 0:01 ` [PATCH v4 net-next 8/8] net: opt MAC drivers which use Lynx PCS into phylink sync_an_inband Vladimir Oltean
2022-11-21 18:38 ` [PATCH v4 net-next 0/8] Let phylink manage in-band AN for the PHY Sean Anderson
2022-11-21 19:44 ` Vladimir Oltean
2022-11-21 22:42 ` Sean Anderson
2022-11-22 0:17 ` Vladimir Oltean
2022-11-22 16:10 ` Sean Anderson
2022-11-22 16:30 ` Vladimir Oltean
2022-11-22 16:45 ` Sean Anderson
2022-11-22 17:59 ` Russell King (Oracle)
2022-11-22 18:09 ` Sean Anderson
2022-11-22 9:16 ` Russell King (Oracle)
2022-12-02 12:16 ` Maxim Kochetkov
2022-12-05 17:19 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4DGhv/6BHNaMEYQ@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=atenart@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=boon.leong.ong@intel.com \
--cc=camelia.groza@nxp.com \
--cc=claudiu.manoil@nxp.com \
--cc=colin.foster@in-advantage.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=fido_max@inbox.ru \
--cc=hkallweit1@gmail.com \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=madalin.bucur@oss.nxp.com \
--cc=marek.behun@nic.cz \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raagjadav@gmail.com \
--cc=s-vadapalli@ti.com \
--cc=sean.anderson@seco.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).