1. 09 2月, 2019 1 次提交
    • H
      net: phy: consider latched link-down status in polling mode · 93c09704
      Heiner Kallweit 提交于
      The link status value latches link-down events. To get the current
      status we read the register twice in genphy_update_link(). There's
      a potential risk that we miss a link-down event in polling mode.
      This may cause issues if the user e.g. connects his machine to a
      different network.
      
      On the other hand reading the latched value may cause issues in
      interrupt mode. Following scenario:
      
      - After boot link goes up
      - phy_start() is called triggering an aneg restart, hence link goes
        down and link-down info is latched.
      - After aneg has finished link goes up and triggers an interrupt.
        Interrupt handler reads link status, means it reads the latched
        "link is down" info. But there won't be another interrupt as long
        as link stays up, therefore phylib will never recognize that link
        is up.
      
      Deal with both scenarios by reading the register twice in interrupt
      mode only.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93c09704
  2. 25 1月, 2019 2 次提交
  3. 23 1月, 2019 3 次提交
  4. 20 1月, 2019 1 次提交
  5. 19 1月, 2019 4 次提交
  6. 18 1月, 2019 2 次提交
  7. 17 1月, 2019 4 次提交
  8. 19 12月, 2018 2 次提交
  9. 06 12月, 2018 2 次提交
  10. 05 12月, 2018 1 次提交
  11. 04 12月, 2018 4 次提交
  12. 28 11月, 2018 1 次提交
  13. 17 11月, 2018 1 次提交
  14. 12 11月, 2018 4 次提交
  15. 23 10月, 2018 1 次提交
  16. 02 10月, 2018 2 次提交
  17. 27 9月, 2018 3 次提交
    • H
      net: phy: fix WoL handling when suspending the PHY · 93f41e67
      Heiner Kallweit 提交于
      Core of the problem is that phy_suspend() suspends the PHY when it
      should not because of WoL. phy_suspend() checks for WoL already, but
      this works only if the PHY driver handles WoL (what is rarely the case).
      Typically WoL is handled by the MAC driver.
      
      This patch uses new member wol_enabled of struct net_device as
      additional criteria in the check when not to suspend the PHY because
      of WoL.
      
      Last but not least change phy_detach() to call phy_suspend() before
      attached_dev is set to NULL. phy_suspend() accesses attached_dev
      when checking whether the MAC driver activated WoL.
      
      Fixes: f1e911d5 ("r8169: add basic phylib support")
      Fixes: e8cfd9d6c772 ("net: phy: call state machine synchronously in phy_stop")
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93f41e67
    • D
      Revert "net: phy: fix WoL handling when suspending the PHY" · d31d1d03
      David S. Miller 提交于
      This reverts commit e0511f6c.
      
      I commited the wrong version of these changes.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d31d1d03
    • H
      net: phy: fix WoL handling when suspending the PHY · e0511f6c
      Heiner Kallweit 提交于
      Actually there's nothing wrong with the two changes marked as "Fixes",
      they just revealed a problem which has been existing before.
      After having switched r8169 to phylib it was reported that WoL from
      shutdown doesn't work any longer (WoL from suspend isn't affected).
      Reason is that during shutdown phy_disconnect()->phy_detach()->
      phy_suspend() is called.
      A similar issue occurs when the phylib state machine calls
      phy_suspend() when handling state PHY_HALTED.
      
      Core of the problem is that phy_suspend() suspends the PHY when it
      should not due to WoL. phy_suspend() checks for WoL already, but this
      works only if the PHY driver handles WoL (what is rarely the case).
      Typically WoL is handled by the MAC driver.
      
      phylib knows about this and handles it in mdio_bus_phy_may_suspend(),
      but that's used only when suspending the system, not in other cases
      like shutdown.
      
      Therefore factor out the relevant check from
      mdio_bus_phy_may_suspend() to a new function phy_may_suspend() and
      use it in phy_suspend().
      
      Last but not least change phy_detach() to call phy_suspend() before
      attached_dev is set to NULL. phy_suspend() accesses attached_dev
      when checking whether the MAC driver activated WoL.
      
      Fixes: f1e911d5 ("r8169: add basic phylib support")
      Fixes: e8cfd9d6c772 ("net: phy: call state machine synchronously in phy_stop")
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0511f6c
  18. 26 9月, 2018 1 次提交
  19. 13 9月, 2018 1 次提交