1. 11 May, 2018 11 commits
    • Eric Dumazet's avatar
      tcp: switch pacing timer to softirq based hrtimer · 73a6bab5
      Eric Dumazet authored
      linux-4.16 got support for softirq based hrtimers.
      TCP can switch its pacing hrtimer to this variant, since this
      avoids going through a tasklet and some atomic operations.
      
      pacing timer logic looks like other (jiffies based) tcp timers.
      
      v2: use hrtimer_try_to_cancel() in tcp_clear_xmit_timers()
          to correctly release reference on socket if needed.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73a6bab5
    • David S. Miller's avatar
      Merge branch 'dsa-Plug-in-PHYLINK-support' · 4cbd7a7d
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: dsa: Plug in PHYLINK support
      
      This patch series adds PHYLINK support to DSA which is necessary to support more
      complex PHY and pluggable modules setups.
      
      Patch series can be found here:
      
      https://github.com/ffainelli/linux/commits/dsa-phylink-v2
      
      This was tested on:
      
      - dsa-loop
      - bcm_sf2
      - mv88e6xxx
      - b53
      
      With a variety of test cases:
      - internal & external MDIO PHYs
      - MoCA with link notification through interrupt/MMIO register
      - built-in PHYs
      - ifconfig up/down for several cycles works
      - bind/unbind of the drivers
      
      Changes in v2:
      
      - fixed link configuration for mv88e6xxx (Andrew) after introducing polling
      
      This is technically v2 of what was posted back in March 2018, changes from last
      time:
      
      - fixed probe/remove of drivers
      - fixed missing gpiod_put() for link GPIOs
      - fixed polling of link GPIOs (Russell I would need your SoB on the patch you
        provided offline initially, added some modifications to it)
      - tested across a wider set of platforms
      
      And everything should still work as expected. Please be aware of the following:
      
      - switch drivers (like bcm_sf2) which may have user-facing network ports using
        fixed links would need to implement phylink_mac_ops to remain functional.
        PHYLINK does not create a phy_device for fixed links, therefore our
        call to adjust_link() from phylink_mac_link_{up,down} would not be calling
        into the driver. This *should not* affect CPU/DSA ports which are configured
        through adjust_link() but have no network devices
      
      - support for SFP/SFF is now possible, but switch drivers will still need some
        modifications to properly support those, including, but not limited to using
        the correct binding information. This will be submitted on top of this series
      
      Please do test on your respective platforms/switches and let me know if you
      find any issues, hopefully everything still works like before.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4cbd7a7d
    • Florian Fainelli's avatar
      net: dsa: bcm_sf2: Get rid of PHYLIB functions · 58d56fcc
      Florian Fainelli authored
      Now that we have converted the bcm_sf2 driver to implement PHYLINK MAC
      operations, we can remove the PHYLIB callbacks: adjust_link() and
      fixed_link_update() which are no longer called by DSA.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58d56fcc
    • Florian Fainelli's avatar
      net: dsa: Plug in PHYLINK support · aab9c406
      Florian Fainelli authored
      Add support for PHYLINK within the DSA subsystem in order to support more
      complex devices such as pluggable (SFP) and non-pluggable (SFF) modules, 10G
      PHYs, and traditional PHYs. Using PHYLINK allows us to drop some amount of
      complexity we had while probing fixed and non-fixed PHYs using Device Tree.
      
      Because PHYLINK separates the Ethernet MAC/port configuration into different
      stages, we let switch drivers implement those, and for now, we maintain
      functionality by calling dsa_slave_adjust_link() during
      phylink_mac_link_{up,down} which provides semantically equivalent steps.
      
      Drivers willing to take advantage of PHYLINK should implement the phylink_mac_*
      operations that DSA wraps.
      
      We cannot quite remove the adjust_link() callback just yet, because a number of
      drivers rely on that for configuring their "CPU" and "DSA" ports, this is done
      dsa_port_setup_phy_of() and dsa_port_fixed_link_register_of() still.
      
      Drivers that utilize fixed links for user-facing ports (e.g: bcm_sf2) will need
      to implement phylink_mac_ops from now on to preserve functionality, since PHYLINK
      *does not* create a phy_device instance for fixed links.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aab9c406
    • Russell King's avatar
      net: dsa: mv88e6xxx: add PHYLINK support · c9a2356f
      Russell King authored
      Add rudimentary phylink support to mv88e6xxx. This allows the driver
      using user ports with fixed links to keep operating normally. User ports
      with normal PHYs are not affected since the switch automatically manages
      their link parameters. User facing ports which use a SFP/SFF with a
      non-fixed link mode might require a call to phylink_mac_change() to
      operate properly.
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      [Andrew: fixed link setting after adding link polling]
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      [florian: expand commit message]
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9a2356f
    • Florian Fainelli's avatar
      net: dsa: Eliminate dsa_slave_get_link() · c4aef9fc
      Florian Fainelli authored
      Since we use PHYLIB to manage the per-port link indication, this will
      also be reflected correctly in the network device's carrier state, so we
      can use ethtool_op_get_link() instead.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c4aef9fc
    • Florian Fainelli's avatar
      net: dsa: bcm_sf2: Implement phylink_mac_ops · bc0cb653
      Florian Fainelli authored
      Make the bcm_sf2 driver implement phylink_mac_ops since it needs to
      support a wide variety of network interfaces: internal & external MDIO
      PHYs, fixed PHYs, MoCA with MMIO link status.
      
      A large amount of what needs to be done already exists under
      bcm_sf2_sw_adjust_link() so we are essentially breaking this down into
      the necessary operation for PHYLINK to work: mac_config, mac_link_up,
      mac_link_down and validate. We can now entirely get rid of most of what
      fixed_link_update() provided because only the link information is actually
      necessary. We still have to force DUPLEX_FULL for legacy Device Tree bindings
      that did not specify that before.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc0cb653
    • Florian Fainelli's avatar
      net: dsa: Add PHYLINK switch operations · 11d8f3dd
      Florian Fainelli authored
      In preparation for adding support for PHYLINK within DSA, define a number of
      operations that we will need and that switch drivers can start implementing.
      Proper integration with PHYLINK will follow in subsequent patches.
      
      We start selecting PHYLINK (which implies PHYLIB) in net/dsa/Kconfig
      such that drivers can be guaranteed that this dependency is properly
      taken care of and can start referencing PHYLINK helper functions without
      requiring stubs or anything.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11d8f3dd
    • Russell King's avatar
      net: phy: phylink: Poll link GPIOs · 9cd00a8a
      Russell King authored
      When using a fixed link with a link GPIO, we need to poll that GPIO to
      determine link state changes. This is consistent with what fixed_phy.c does.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9cd00a8a
    • Florian Fainelli's avatar
      net: phy: phylink: Release link GPIO · daab3349
      Florian Fainelli authored
      We are not releasing the link GPIO descriptor with gpiod_put() which results in
      subsequent probing to get -EBUSY when calling fwnode_get_named_gpiod(). Fix this
      by doing the release in phylink_destroy().
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      daab3349
    • Florian Fainelli's avatar
      net: phy: phylink: Use gpiod_get_value_cansleep() · bb322a90
      Florian Fainelli authored
      The GPIO provider for the link GPIO line might require the use of the
      _cansleep() API, utilize that. This is safe to do since we run in workqueue
      context.
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb322a90
  2. 10 May, 2018 29 commits