All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 net-next 0/8] Let phylink manage in-band AN for the PHY
@ 2022-11-18  0:01 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
                   ` (9 more replies)
  0 siblings, 10 replies; 53+ messages in thread
From: Vladimir Oltean @ 2022-11-18  0:01 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Heiner Kallweit, Andrew Lunn, Russell King, Florian Fainelli,
	UNGLinuxDriver, bcm-kernel-feedback-list, Madalin Bucur,
	Camelia Groza, Claudiu Manoil, Ioana Ciornei, Maxim Kochetkov,
	Sean Anderson, Antoine Tenart, Michael Walle, Raag Jadav,
	Siddharth Vadapalli, Ong Boon Leong, Colin Foster, Marek Behun

Problem statement
~~~~~~~~~~~~~~~~~

The on-board SERDES link between an NXP (Lynx) PCS and a PHY may not
work, depending on whether U-Boot networking was used on that port or not.

There is no mechanism in Linux (with phylib/phylink, at least) to ensure
that the MAC driver and the PHY driver have synchronized settings for
in-band autoneg. It all depends on the 'managed = "in-band-status"'
device tree property, which does not reflect a stable and unchanging
reality, and furthermore, some (older) device trees may have this
property missing when they shouldn't.

Proposed solution
~~~~~~~~~~~~~~~~~

Extend the phy_device API with 2 new methods:
- phy_validate_an_inband()
- phy_config_an_inband()

Extend phylink with an opt-in bool sync_an_inband which makes sure that
the configured "unsigned int mode" (MLO_AN_PHY/MLO_AN_INBAND) is both
supported by the PHY, and actually applied to the PHY.

Make NXP drivers which use phylink and the Lynx PCS driver opt into the
new behavior. Other drivers can trivially do this as well, by setting
struct phylink_config :: sync_an_inband to true.

Compared to other solutions
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sean Anderson, in commit 5d93cfcf7360 ("net: dpaa: Convert to phylink"),
sets phylink_config :: ovr_an_inband to true. This doesn't quite solve
all problems, because we don't *know* that the PHY is set for in-band
autoneg. For example with the VSC8514, it all depends on what the
bootloader has/has not done. This solution eliminates the bootloader
dependency by actually programming in-band autoneg in the VSC8514 PHY.

Change log
~~~~~~~~~~

Changes in v4:
Make all new behavior opt-in.
Fix bug when Generic PHY driver is used.
Dropped support for PHY_AN_INBAND_OFF in at803x.

Changes in v3:
Added patch for the Atheros PHY family.
v3 at:
https://patchwork.kernel.org/project/netdevbpf/cover/20210922181446.2677089-1-vladimir.oltean@nxp.com/

Changes in v2:
Incorporated feedback from Russell, which was to consider PHYs on SFP
modules too, and unify phylink's detection of PHYs with broken in-band
autoneg with the newly introduced PHY driver methods.
v2 at:
https://patchwork.kernel.org/project/netdevbpf/cover/20210212172341.3489046-1-olteanv@gmail.com/

Vladimir Oltean (8):
  net: phylink: let phylink_sfp_config_phy() determine the MLO_AN_* mode
    to use
  net: phylink: introduce generic method to query PHY in-band autoneg
    capability
  net: phy: bcm84881: move the in-band capability check where it belongs
  net: phylink: add option to sync in-band autoneg setting between PCS
    and PHY
  net: phylink: explicitly configure in-band autoneg for on-board PHYs
  net: phy: mscc: configure in-band auto-negotiation for VSC8514
  net: phy: at803x: validate in-band autoneg for AT8031/AT8033
  net: opt MAC drivers which use Lynx PCS into phylink sync_an_inband

 drivers/net/dsa/ocelot/felix.c                |  2 +
 .../net/ethernet/freescale/dpaa2/dpaa2-mac.c  |  1 +
 .../net/ethernet/freescale/enetc/enetc_pf.c   |  1 +
 .../net/ethernet/freescale/fman/fman_memac.c  | 16 +--
 drivers/net/phy/at803x.c                      | 10 ++
 drivers/net/phy/bcm84881.c                    | 10 ++
 drivers/net/phy/mscc/mscc.h                   |  2 +
 drivers/net/phy/mscc/mscc_main.c              | 21 ++++
 drivers/net/phy/phy.c                         | 51 ++++++++++
 drivers/net/phy/phylink.c                     | 97 +++++++++++++++----
 include/linux/phy.h                           | 27 ++++++
 include/linux/phylink.h                       |  7 ++
 12 files changed, 212 insertions(+), 33 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2022-12-05 17:20 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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)
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.