All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/9] Decoupling PHYLINK from struct net_device
@ 2019-05-23  1:20 Ioana Ciornei
  2019-05-23  1:20 ` [RFC PATCH net-next 1/9] net: phy: Add phy_sysfs_create_links helper function Ioana Ciornei
                   ` (9 more replies)
  0 siblings, 10 replies; 38+ messages in thread
From: Ioana Ciornei @ 2019-05-23  1:20 UTC (permalink / raw)
  To: linux, f.fainelli, andrew, hkallweit1, maxime.chevallier, olteanv
  Cc: netdev, davem, Ioana Ciornei

Following two separate discussion threads in:
  https://www.spinics.net/lists/netdev/msg569087.html
and:
  https://www.spinics.net/lists/netdev/msg570450.html

PHYLINK was reworked in order to add a new "raw" interface, alongside
the one based on struct net_device. The raw interface works by passing
structures to the owner of the phylink instance through a blocking
notifier call.

The event API exposed by the new notifier mechanism is a 1:1 mapping to
the existing PHYLINK mac_ops, plus the PHYLINK fixed-link callback.

PHYLIB (which PHYLINK uses) was reworked to the extent that it does not
crash when connecting to a PHY and the net_device pointer is NULL.

Lastly, DSA has been reworked in its way that it handles PHYs for ports
that lack a net_device (CPU and DSA ports).  For these, it was
previously using PHYLIB and is now using the PHYLINK raw API.

The implication of the above is that DSA drivers that used to rely on
the .adjust_link to configure their CPU/DSA ports as fixed-link are now
broken.  Full explanation is found in patch 8/9, and a sample fix for
the SJA1105 driver is found in 9/9.  The drivers below are affected:

* b53: Uses .adjust_link for fixed-links on CPU port, as well as
  .phylink_mac_config.
  Migration to 100% PHYLINK does not appear trivial.

* ksz9477: rtl8366rb: mt7530: vsc73xx: Uses .adjust_link exclusively.
  Either the devicetree bindings document or code checks/comments reveal
  that the adjust_link is used for handling a fixed-link.
  Migration to PHYLINK appears trivial.

* qca8k: lan9303: Uses .adjust_link to configure fixed-link ports (skips
  the rest).
  Migration to PHYLINK appears trivial.

The patchset was tested on the NXP LS1021A-TSN board having the
following Ethernet layout:
  https://lkml.org/lkml/2019/5/5/279
The CPU port was moved from the internal RGMII fixed-link (enet2 ->
switch port 4) to an external loopback Cat5 cable between the enet1 port
and the front-facing swp2 SJA1105 port. In this mode, both the master
and the CPU port have an attached PHY which detects link change events:

[   42.785627] fsl-gianfar soc:ethernet@2d50000 eth1: Link is Down
[   43.025678] Broadcom BCM5464 mdio@2d24000:03: Link is Down
[   49.025793] fsl-gianfar soc:ethernet@2d50000 eth1: Link is Up - 1Gbps/Full - flow control off
[   49.266299] Broadcom BCM5464 mdio@2d24000:03: Link is Up - 1Gbps/Full - flow control off

Ioana Ciornei (7):
  net: phy: Guard against the presence of a netdev
  net: phy: Add phy_standalone sysfs entry
  net: phylink: Add phylink_mac_link_{up,down} wrapper functions
  net: phylink: Add phylink_create_raw
  net: phylink: Make fixed link notifier calls edge-triggered
  net: dsa: Move the phylink driver calls into port.c
  net: dsa: Use PHYLINK for the CPU/DSA ports

Vladimir Oltean (2):
  net: phy: Add phy_sysfs_create_links helper function
  net: dsa: sja1105: Fix broken fixed-link interfaces on user ports

 drivers/net/dsa/sja1105/sja1105_main.c |  11 +-
 drivers/net/phy/phy_device.c           |  88 +++++++---
 drivers/net/phy/phylink.c              | 224 ++++++++++++++++++++-----
 include/linux/phylink.h                |  21 +++
 include/net/dsa.h                      |   3 +
 net/dsa/dsa_priv.h                     |  19 +++
 net/dsa/port.c                         | 207 ++++++++++++++++-------
 net/dsa/slave.c                        |  49 +-----
 8 files changed, 441 insertions(+), 181 deletions(-)

-- 
2.21.0


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

end of thread, other threads:[~2019-05-24 13:55 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  1:20 [RFC PATCH net-next 0/9] Decoupling PHYLINK from struct net_device Ioana Ciornei
2019-05-23  1:20 ` [RFC PATCH net-next 1/9] net: phy: Add phy_sysfs_create_links helper function Ioana Ciornei
2019-05-23  2:00   ` Florian Fainelli
2019-05-23  1:20 ` [RFC PATCH net-next 2/9] net: phy: Guard against the presence of a netdev Ioana Ciornei
2019-05-23  2:02   ` Florian Fainelli
2019-05-23 22:18   ` Andrew Lunn
2019-05-24 10:30     ` Ioana Ciornei
2019-05-24 13:10       ` Andrew Lunn
2019-05-24 13:55         ` Ioana Ciornei
2019-05-23  1:20 ` [RFC PATCH net-next 3/9] net: phy: Add phy_standalone sysfs entry Ioana Ciornei
2019-05-23  2:05   ` Florian Fainelli
2019-05-24 10:52     ` Ioana Ciornei
2019-05-23  1:20 ` [RFC PATCH net-next 4/9] net: phylink: Add phylink_mac_link_{up,down} wrapper functions Ioana Ciornei
2019-05-23  2:05   ` Florian Fainelli
2019-05-23  1:20 ` [RFC PATCH net-next 5/9] net: phylink: Add phylink_create_raw Ioana Ciornei
2019-05-23  2:25   ` Florian Fainelli
2019-05-23  2:29     ` Florian Fainelli
2019-05-23 12:10       ` Ioana Ciornei
2019-05-23 14:32         ` Florian Fainelli
2019-05-23 20:32           ` Vladimir Oltean
2019-05-23 21:30             ` Florian Fainelli
2019-05-23 21:27   ` Russell King - ARM Linux admin
2019-05-23 21:37     ` Vladimir Oltean
2019-05-23 21:55   ` Russell King - ARM Linux admin
2019-05-23 22:04     ` Vladimir Oltean
2019-05-23 22:35       ` Russell King - ARM Linux admin
2019-05-23  1:20 ` [RFC PATCH net-next 7/9] net: dsa: Move the phylink driver calls into port.c Ioana Ciornei
2019-05-23  2:13   ` Florian Fainelli
2019-05-23 22:03   ` Russell King - ARM Linux admin
2019-05-23  1:20 ` [RFC PATCH net-next 6/9] net: phylink: Make fixed link notifier calls edge-triggered Ioana Ciornei
2019-05-23  1:20 ` [RFC PATCH net-next 8/9] net: dsa: Use PHYLINK for the CPU/DSA ports Ioana Ciornei
2019-05-23  2:17   ` Florian Fainelli
2019-05-23 20:01     ` Vladimir Oltean
2019-05-24 13:19       ` Andrew Lunn
2019-05-24 13:44         ` Vladimir Oltean
2019-05-23  1:20 ` [RFC PATCH net-next 9/9] net: dsa: sja1105: Fix broken fixed-link interfaces on user ports Ioana Ciornei
2019-05-23  2:26   ` Florian Fainelli
2019-05-23 15:12 ` [RFC PATCH net-next 0/9] Decoupling PHYLINK from struct net_device Maxime Chevallier

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.