1. 07 5月, 2020 2 次提交
    • O
      ethtool: provide UAPI for PHY master/slave configuration. · bdbdac76
      Oleksij Rempel 提交于
      This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of
      auto-negotiation support, we needed to be able to configure the
      MASTER-SLAVE role of the port manually or from an application in user
      space.
      
      The same UAPI can be used for 1000BASE-T or MultiGBASE-T devices to
      force MASTER or SLAVE role. See IEEE 802.3-2018:
      22.2.4.3.7 MASTER-SLAVE control register (Register 9)
      22.2.4.3.8 MASTER-SLAVE status register (Register 10)
      40.5.2 MASTER-SLAVE configuration resolution
      45.2.1.185.1 MASTER-SLAVE config value (1.2100.14)
      45.2.7.10 MultiGBASE-T AN control 1 register (Register 7.32)
      
      The MASTER-SLAVE role affects the clock configuration:
      
      -------------------------------------------------------------------------------
      When the  PHY is configured as MASTER, the PMA Transmit function shall
      source TX_TCLK from a local clock source. When configured as SLAVE, the
      PMA Transmit function shall source TX_TCLK from the clock recovered from
      data stream provided by MASTER.
      
      iMX6Q                     KSZ9031                XXX
      ------\                /-----------\        /------------\
            |                |           |        |            |
       MAC  |<----RGMII----->| PHY Slave |<------>| PHY Master |
            |<--- 125 MHz ---+-<------/  |        | \          |
      ------/                \-----------/        \------------/
                                                     ^
                                                      \-TX_TCLK
      
      -------------------------------------------------------------------------------
      
      Since some clock or link related issues are only reproducible in a
      specific MASTER-SLAVE-role, MAC and PHY configuration, it is beneficial
      to provide generic (not 100BASE-T1 specific) interface to the user space
      for configuration flexibility and trouble shooting.
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bdbdac76
    • M
      net: phy: add concept of shared storage for PHYs · 63490847
      Michael Walle 提交于
      There are packages which contain multiple PHY devices, eg. a quad PHY
      transceiver. Provide functions to allocate and free shared storage.
      
      Usually, a quad PHY contains global registers, which don't belong to any
      PHY. Provide convenience functions to access these registers.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63490847
  2. 25 4月, 2020 3 次提交
  3. 27 3月, 2020 2 次提交
  4. 24 3月, 2020 1 次提交
  5. 13 3月, 2020 1 次提交
  6. 27 2月, 2020 1 次提交
  7. 24 2月, 2020 1 次提交
    • F
      net: phy: Avoid multiple suspends · 503ba7c6
      Florian Fainelli 提交于
      It is currently possible for a PHY device to be suspended as part of a
      network device driver's suspend call while it is still being attached to
      that net_device, either via phy_suspend() or implicitly via phy_stop().
      
      Later on, when the MDIO bus controller get suspended, we would attempt
      to suspend again the PHY because it is still attached to a network
      device.
      
      This is both a waste of time and creates an opportunity for improper
      clock/power management bugs to creep in.
      
      Fixes: 803dd9c7 ("net: phy: avoid suspending twice a PHY")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      503ba7c6
  8. 20 2月, 2020 1 次提交
    • P
      phy: avoid unnecessary link-up delay in polling mode · e96bd2d3
      Petr Oros 提交于
      commit 93c09704 ("net: phy: consider latched link-down status in
      polling mode") removed double-read of latched link-state register for
      polling mode from genphy_update_link(). This added extra ~1s delay into
      sequence link down->up.
      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. In phy_state_machine is checked
         link state but it is latched "link is down". The state machine is
         scheduled after one second and there is detected "link is up". This
         extra delay can be avoided when we keep link-state register double read
         in case when link was down previously.
      
      With this solution we don't miss a link-down event in polling mode and
      link-up is faster.
      
      Details about this quirky behavior on Realtek phy:
      Without patch:
      T0:    aneg is started, link goes down, link-down status is latched
      T0+3s: state machine runs, up-to-date link-down is read
      T0+4s: state machine runs, aneg is finished (BMSR_ANEGCOMPLETE==1),
             here i read link-down (BMSR_LSTATUS==0),
      T0+5s: state machine runs, aneg is finished (BMSR_ANEGCOMPLETE==1),
             up-to-date link-up is read (BMSR_LSTATUS==1),
             phydev->link goes up, state change PHY_NOLINK to PHY_RUNNING
      
      With patch:
      T0:    aneg is started, link goes down, link-down status is latched
      T0+3s: state machine runs, up-to-date link-down is read
      T0+4s: state machine runs, aneg is finished (BMSR_ANEGCOMPLETE==1),
             first BMSR read: BMSR_ANEGCOMPLETE==1 and BMSR_LSTATUS==0,
             second BMSR read: BMSR_ANEGCOMPLETE==1 and BMSR_LSTATUS==1,
             phydev->link goes up, state change PHY_NOLINK to PHY_RUNNING
      Signed-off-by: NPetr Oros <poros@redhat.com>
      Reviewed-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e96bd2d3
  9. 17 2月, 2020 2 次提交
  10. 15 1月, 2020 1 次提交
  11. 26 12月, 2019 2 次提交
  12. 21 12月, 2019 1 次提交
  13. 20 12月, 2019 3 次提交
  14. 24 11月, 2019 1 次提交
  15. 19 11月, 2019 2 次提交
    • R
      net: phy: avoid matching all-ones clause 45 PHY IDs · b95e86d8
      Russell King 提交于
      We currently match clause 45 PHYs using any ID read from a MMD marked
      as present in the "Devices in package" registers 5 and 6.  However,
      this is incorrect.  45.2 says:
      
        "The definition of the term package is vendor specific and could be
         a chip, module, or other similar entity."
      
      so a package could be more or less than the whole PHY - a PHY could be
      made up of several modules instantiated onto a single chip such as the
      Marvell 88x3310, or some of the MMDs could be disabled according to
      chip configuration, such as the Broadcom 84881.
      
      In the case of Broadcom 84881, the "Devices in package" registers
      contain 0xc000009b, meaning that there is a PHYXS present in the
      package, but all registers in MMD 4 return 0xffff.  This leads to our
      matching code incorrectly binding this PHY to one of our generic PHY
      drivers.
      
      This patch changes the way we determine whether to attempt to match a
      MMD identifier, or use it to request a module - if the identifier is
      all-ones, then we skip over it. When reading the identifiers, we
      initialise phydev->c45_ids.device_ids to all-ones, only reading the
      device ID if the "Devices in package" registers indicates we should.
      
      This avoids the generic drivers incorrectly matching on a PHY ID of
      0xffffffff.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b95e86d8
    • R
      net: phy: add core phylib sfp support · 298e54fa
      Russell King 提交于
      Add core phylib help for supporting SFP sockets on PHYs.  This provides
      a mechanism to inform the SFP layer about PHY up/down events, and also
      unregister the SFP bus when the PHY is going away.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      298e54fa
  16. 24 10月, 2019 2 次提交
  17. 17 10月, 2019 1 次提交
    • Y
      net: phy: Fix "link partner" information disappear issue · 3de5ae54
      Yonglong Liu 提交于
      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: NYonglong Liu <liuyonglong@huawei.com>
      Reviewed-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3de5ae54
  18. 05 10月, 2019 1 次提交
  19. 18 8月, 2019 1 次提交
  20. 16 8月, 2019 1 次提交
  21. 14 8月, 2019 1 次提交
  22. 12 8月, 2019 2 次提交
  23. 03 8月, 2019 1 次提交
  24. 13 7月, 2019 1 次提交
  25. 15 6月, 2019 1 次提交
  26. 07 6月, 2019 1 次提交
  27. 31 5月, 2019 1 次提交
  28. 30 5月, 2019 2 次提交