1. 27 Sep, 2019 1 commit
  2. 30 Apr, 2019 1 commit
  3. 17 Apr, 2019 1 commit
  4. 16 Apr, 2019 1 commit
  5. 27 Feb, 2019 1 commit
    • Rajasingh Thavamani's avatar
      net: phy: Micrel KSZ8061: link failure after cable connect · 232ba3a5
      Rajasingh Thavamani authored
      With Micrel KSZ8061 PHY, the link may occasionally not come up after
      Ethernet cable connect. The vendor's (Microchip, former Micrel) errata
      sheet 80000688A.pdf descripes the problem and possible workarounds in
      detail, see below.
      The batch implements workaround 1, which permanently fixes the issue.
      
      DESCRIPTION
      Link-up may not occur properly when the Ethernet cable is initially
      connected. This issue occurs more commonly when the cable is connected
      slowly, but it may occur any time a cable is connected. This issue occurs
      in the auto-negotiation circuit, and will not occur if auto-negotiation
      is disabled (which requires that the two link partners be set to the
      same speed and duplex).
      
      END USER IMPLICATIONS
      When this issue occurs, link is not established. Subsequent cable
      plug/unplaug cycle will not correct the issue.
      
      WORk AROUND
      There are four approaches to work around this issue:
      1. This issue can be prevented by setting bit 15 in MMD device address 1,
         register 2, prior to connecting the cable or prior to setting the
         Restart Auto-negotiation bit in register 0h. The MMD registers are
         accessed via the indirect access registers Dh and Eh, or via the Micrel
         EthUtil utility as shown here:
         . if using the EthUtil utility (usually with a Micrel KSZ8061
           Evaluation Board), type the following commands:
           > address 1
           > mmd 1
           > iw 2 b61a
         . Alternatively, write the following registers to write to the
           indirect MMD register:
           Write register Dh, data 0001h
           Write register Eh, data 0002h
           Write register Dh, data 4001h
           Write register Eh, data B61Ah
      2. The issue can be avoided by disabling auto-negotiation in the KSZ8061,
         either by the strapping option, or by clearing bit 12 in register 0h.
         Care must be taken to ensure that the KSZ8061 and the link partner
         will link with the same speed and duplex. Note that the KSZ8061
         defaults to full-duplex when auto-negotiation is off, but other
         devices may default to half-duplex in the event of failed
         auto-negotiation.
      3. The issue can be avoided by connecting the cable prior to powering-up
         or resetting the KSZ8061, and leaving it plugged in thereafter.
      4. If the above measures are not taken and the problem occurs, link can
         be recovered by setting the Restart Auto-Negotiation bit in
         register 0h, or by resetting or power cycling the device. Reset may
         be either hardware reset or software reset (register 0h, bit 15).
      
      PLAN
      This errata will not be corrected in the future revision.
      
      Fixes: 7ab59dc1
      
       ("drivers/net/phy/micrel_phy: Add support for new PHYs")
      Signed-off-by: default avatarAlexander Onnasch <alexander.onnasch@landisgyr.com>
      Signed-off-by: default avatarRajasingh Thavamani <T.Rajasingh@landisgyr.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      232ba3a5
  6. 23 Jan, 2019 1 commit
  7. 17 Jan, 2019 1 commit
  8. 16 Jan, 2019 2 commits
  9. 04 Dec, 2018 1 commit
  10. 03 Dec, 2018 1 commit
  11. 11 Nov, 2018 2 commits
  12. 20 Oct, 2018 1 commit
  13. 16 May, 2018 1 commit
    • Markus Niebel's avatar
      net: phy: micrel: add 125MHz reference clock workaround · e1b505a6
      Markus Niebel authored
      
      
      The micrel KSZ9031 phy has a optional clock pin (CLK125_NDO) which can be
      used as reference clock for the MAC unit. The clock signal must meet the
      RGMII requirements to ensure the correct data transmission between the
      MAC and the PHY. The KSZ9031 phy does not fulfill the duty cycle
      requirement if the phy is configured as slave. For a complete
      describtion look at the errata sheets: DS80000691D or DS80000692D.
      
      The errata sheet recommends to force the phy into master mode whenever
      there is a 1000Base-T link-up as work around. Only set the
      "micrel,force-master" property if you use the phy reference clock provided
      by CLK125_NDO pin as MAC reference clock in your application.
      
      Attenation, this workaround is only usable if the link partner can
      be configured to slave mode for 1000Base-T.
      
      Signed-off-by: default avatarMarkus Niebel <Markus.Niebel@tqs.de>
      [m.felsch@pengutronix.de: fix dt-binding documentation]
      [m.felsch@pengutronix.de: use already existing result var for read/write]
      [m.felsch@pengutronix.de: add error handling]
      [m.felsch@pengutronix.de: add more comments]
      Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e1b505a6
  14. 28 Apr, 2018 1 commit
  15. 22 Mar, 2018 1 commit
  16. 06 Mar, 2018 1 commit
  17. 26 Dec, 2017 1 commit
  18. 01 Dec, 2017 2 commits
  19. 22 Jun, 2017 1 commit
  20. 01 Jun, 2017 2 commits
  21. 16 May, 2017 1 commit
  22. 26 Apr, 2017 1 commit
  23. 17 Apr, 2017 1 commit
    • Grygorii Strashko's avatar
      net: phy: micrel: fix crash when statistic requested for KSZ9031 phy · bfe72442
      Grygorii Strashko authored
      Now the command:
      	ethtool --phy-statistics eth0
      will cause system crash with meassage "Unable to handle kernel NULL pointer
      dereference at virtual address 00000010" from:
      
       (kszphy_get_stats) from [<c069f1d8>] (ethtool_get_phy_stats+0xd8/0x210)
       (ethtool_get_phy_stats) from [<c06a0738>] (dev_ethtool+0x5b8/0x228c)
       (dev_ethtool) from [<c06b5484>] (dev_ioctl+0x3fc/0x964)
       (dev_ioctl) from [<c0679f7c>] (sock_ioctl+0x170/0x2c0)
       (sock_ioctl) from [<c02419d4>] (do_vfs_ioctl+0xa8/0x95c)
       (do_vfs_ioctl) from [<c02422c4>] (SyS_ioctl+0x3c/0x64)
       (SyS_ioctl) from [<c0107d60>] (ret_fast_syscall+0x0/0x44)
      
      The reason: phy_driver structure for KSZ9031 phy has no .probe() callback
      defined. As result, struct phy_device *phydev->priv pointer will not be
      initializes (null).
      This issue will affect also following phys:
       KSZ8795, KSZ886X, KSZ8873MLL, KSZ9031, KSZ9021, KSZ8061, KS8737
      
      Fix it by:
      - adding .probe() = kszphy_probe() callback to KSZ9031, KSZ9021
      phys. The kszphy_probe() can be re-used as it doesn't do any phy specific
      settings.
      - removing statistic callbacks from other phys (KSZ8795, KSZ886X,
      KSZ8873MLL, KSZ8061, KS8737) as they doesn't have corresponding
      statistic counters.
      
      Fixes: 2b2427d0
      
       ("phy: micrel: Add ethtool statistics counters")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bfe72442
  24. 22 Mar, 2017 1 commit
  25. 29 Jan, 2017 1 commit
  26. 27 Jan, 2017 1 commit
  27. 11 Dec, 2016 1 commit
    • Timur Tabi's avatar
      net: phy: phy drivers should not set SUPPORTED_[Asym_]Pause · 529ed127
      Timur Tabi authored
      Instead of having individual PHY drivers set the SUPPORTED_Pause and
      SUPPORTED_Asym_Pause flags, phylib itself should set those flags,
      unless there is a hardware erratum or other special case.  During
      autonegotiation, the PHYs will determine whether to enable pause
      frame support.
      
      Pause frames are a feature that is supported by the MAC.  It is the MAC
      that generates the frames and that processes them.  The PHY can only be
      configured to allow them to pass through.
      
      This commit also effectively reverts the recently applied c7a61319
      
      
      ("net: phy: dp83848: Support ethernet pause frames").
      
      So the new process is:
      
      1) Unless the PHY driver overrides it, phylib sets the SUPPORTED_Pause
      and SUPPORTED_AsymPause bits in phydev->supported.  This indicates that
      the PHY supports pause frames.
      
      2) The MAC driver checks phydev->supported before it calls phy_start().
      If (SUPPORTED_Pause | SUPPORTED_AsymPause) is set, then the MAC driver
      sets those bits in phydev->advertising, if it wants to enable pause
      frame support.
      
      3) When the link state changes, the MAC driver checks phydev->pause and
      phydev->asym_pause,  If the bits are set, then it enables the corresponding
      features in the MAC.  The algorithm is:
      
      	if (phydev->pause)
      		The MAC should be programmed to receive and honor
                      pause frames it receives, i.e. enable receive flow control.
      
      	if (phydev->pause != phydev->asym_pause)
      		The MAC should be programmed to transmit pause
      		frames when needed, i.e. enable transmit flow control.
      
      Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      529ed127
  28. 24 Nov, 2016 1 commit
  29. 06 Oct, 2016 1 commit
  30. 23 Aug, 2016 1 commit
  31. 09 Aug, 2016 1 commit
  32. 01 Aug, 2016 1 commit
  33. 15 Jul, 2016 1 commit
  34. 12 May, 2016 1 commit
  35. 01 Mar, 2016 2 commits