Skip to content
Snippets Groups Projects
  1. Jan 21, 2020
  2. Jan 20, 2020
  3. Dec 26, 2019
  4. Nov 23, 2019
  5. Nov 19, 2019
  6. Oct 16, 2019
    • Yonglong Liu's avatar
      net: phy: Fix "link partner" information disappear issue · 3de5ae54
      Yonglong Liu authored
      
      Some drivers just call phy_ethtool_ksettings_set() to set the
      links, for those phy drivers that use genphy_read_status(), if
      autoneg is on, and the link is up, than execute "ethtool -s
      ethx autoneg on" will cause "link partner" information disappear.
      
      The call trace is phy_ethtool_ksettings_set()->phy_start_aneg()
      ->linkmode_zero(phydev->lp_advertising)->genphy_read_status(),
      the link didn't change, so genphy_read_status() just return, and
      phydev->lp_advertising is zero now.
      
      This patch moves the clear operation of lp_advertising from
      phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and
      if autoneg on and autoneg not complete, just clear what the
      generic functions care about.
      
      Fixes: 88d6272a ("net: phy: avoid unneeded MDIO reads in genphy_read_status")
      Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
      Reviewed-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3de5ae54
  7. Oct 05, 2019
  8. Sep 06, 2019
  9. Aug 28, 2019
  10. Aug 14, 2019
  11. Jul 09, 2019
  12. Jun 06, 2019
  13. May 31, 2019
  14. May 30, 2019
  15. May 07, 2019
  16. May 04, 2019
  17. Apr 18, 2019
  18. Mar 20, 2019
    • Heiner Kallweit's avatar
      net: phy: improve handling link_change_notify callback · 5c5f626b
      Heiner Kallweit authored
      Currently the Phy driver's link_change_notify callback is called
      whenever the state machine is run (every second if polling), no matter
      whether the state changed or not. This isn't needed and may confuse
      users considering the name of the callback. Actually it contradicts
      its kernel-doc description. Therefore let's change the behavior and
      call this callback only in case of an actual state change.
      
      This requires changes to the at803x and rockchip drivers.
      at803x can be simplified so that it reacts on a state change to
      PHY_NOLINK only.
      The rockchip driver can also be much simplified. We simply re-init
      the AFE/DSP registers whenever we change to PHY_RUNNING and speed
      is 100Mbps. This causes very small overhead because we do this even
      if the speed was 100Mbps already. But this is negligible and
      I think justified by the much simpler code.
      
      Changes are compile-tested only.
      
      A little bit problematic seems to be to find somebody with the
      hardware to test the changes to the two PHY drivers. See also [0].
      David may be able to test the Rockchip driver.
      
      [0] https://marc.info/?t=153782508800006&r=1&w=2
      
      
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c5f626b
  19. Mar 04, 2019
  20. Feb 14, 2019
  21. Feb 06, 2019
  22. Jan 25, 2019
  23. Jan 23, 2019
  24. Jan 18, 2019
  25. Jan 17, 2019
  26. Jan 15, 2019
  27. Dec 18, 2018
    • Heiner Kallweit's avatar
      net: phy: print stack trace in phy_error · fa7b28c1
      Heiner Kallweit authored
      
      So far phy_error() silently stops the PHY state machine. If the network
      driver doesn't inform about a  MDIO error then the user may wonder why
      his network is down. Let's print the stack trace to facilitate search
      for the root cause of the error.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa7b28c1
    • Heiner Kallweit's avatar
      net: phy: improve phy state checking · 2b3e88ea
      Heiner Kallweit authored
      
      Add helpers phy_is_started() and __phy_is_started() to avoid open-coded
      checks whether PHY has been started. To make the check easier move
      PHY_HALTED before PHY_UP in enum phy_state. Further improvements:
      
      phy_start_aneg():
      Return -EBUSY and print warning if function is called from a non-started
      state (DOWN, READY, HALTED). Better check because function is exported
      and drivers may use it incorrectly.
      
      phy_interrupt():
      Return IRQ_NONE also if state is DOWN or READY. We should never receive
      an interrupt in one of these states, but better play safe.
      
      phy_stop():
      Just return and print a warning if PHY is in a non-started state.
      This warning should help to identify drivers with unbalanced calls to
      phy_start() / phy_stop().
      
      phy_state_machine():
      Schedule state machine run only if PHY is in a started state.
      E.g. if state is READY we don't need the state machine, it will be
      started by phy_start().
      
      v2:
      - don't use __func__ within phy_warn_state
      v3:
      - use WARN() instead of printing error message to facilitate debugging
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b3e88ea
Loading