1. 25 6月, 2020 1 次提交
    • J
      net: phy: make phy_disable_interrupts() non-static · 3dd4ef1b
      Jisheng Zhang 提交于
      We face an issue with rtl8211f, a pin is shared between INTB and PMEB,
      and the PHY Register Accessible Interrupt is enabled by default, so
      the INTB/PMEB pin is always active in polling mode case.
      
      As Heiner pointed out "I was thinking about calling
      phy_disable_interrupts() in phy_init_hw(), to have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state."
      
      Make phy_disable_interrupts() non-static so that it could be used in
      phy_init_hw() to have a defined init state.
      Suggested-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3dd4ef1b
  2. 27 5月, 2020 3 次提交
  3. 19 5月, 2020 1 次提交
    • D
      net: phy: simplify phy_link_change arguments · a307593a
      Doug Berger 提交于
      This function was introduced to allow for different handling of
      link up and link down events particularly with regard to the
      netif_carrier. The third argument do_carrier allowed the flag to
      be left unchanged.
      
      Since then the phylink has introduced an implementation that
      completely ignores the third parameter since it never wants to
      change the flag and the phylib always sets the third parameter
      to true so the flag is always changed.
      
      Therefore the third argument (i.e. do_carrier) is no longer
      necessary and can be removed. This also means that the phylib
      phy_link_down() function no longer needs its second argument.
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a307593a
  4. 14 5月, 2020 1 次提交
  5. 11 5月, 2020 4 次提交
  6. 07 5月, 2020 1 次提交
    • 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
  7. 24 3月, 2020 1 次提交
    • H
      net: phy: add and use phy_check_downshift · 5eee3bb7
      Heiner Kallweit 提交于
      So far PHY drivers have to check whether a downshift occurred to be
      able to notify the user. To make life of drivers authors a little bit
      easier move the downshift notification to phylib. phy_check_downshift()
      compares the highest mutually advertised speed with the actual value
      of phydev->speed (typically read by the PHY driver from a
      vendor-specific register) to detect a downshift.
      
      v2:
      - Add downshift hint to phy_print_status
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5eee3bb7
  8. 18 3月, 2020 1 次提交
    • H
      net: phy: improve phy_driver callback handle_interrupt · 9010f9de
      Heiner Kallweit 提交于
      did_interrupt() clears the interrupt, therefore handle_interrupt() can
      not check which event triggered the interrupt. To overcome this
      constraint and allow more flexibility for customer interrupt handlers,
      let's decouple handle_interrupt() from parts of the phylib interrupt
      handling. Custom interrupt handlers now have to implement the
      did_interrupt() functionality in handle_interrupt() if needed.
      
      Fortunately we have just one custom interrupt handler so far (in the
      mscc PHY driver), convert it to the changed API.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9010f9de
  9. 02 3月, 2020 1 次提交
  10. 21 1月, 2020 2 次提交
  11. 20 1月, 2020 1 次提交
  12. 26 12月, 2019 1 次提交
  13. 24 11月, 2019 1 次提交
  14. 19 11月, 2019 1 次提交
  15. 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
  16. 05 10月, 2019 1 次提交
  17. 06 9月, 2019 1 次提交
  18. 29 8月, 2019 1 次提交
  19. 28 8月, 2019 1 次提交
    • M
      Add genphy_c45_config_aneg() function to phy-c45.c · 94acaeb5
      Marco Hartmann 提交于
      Commit 34786005 ("net: phy: prevent PHYs w/o Clause 22 regs from calling
      genphy_config_aneg") introduced a check that aborts phy_config_aneg()
      if the phy is a C45 phy.
      This causes phy_state_machine() to call phy_error() so that the phy
      ends up in PHY_HALTED state.
      
      Instead of returning -EOPNOTSUPP, call genphy_c45_config_aneg()
      (analogous to the C22 case) so that the state machine can run
      correctly.
      
      genphy_c45_config_aneg() closely resembles mv3310_config_aneg()
      in drivers/net/phy/marvell10g.c, excluding vendor specific
      configurations for 1000BaseT.
      
      Fixes: 22b56e82 ("net: phy: replace genphy_10g_driver with genphy_c45_driver")
      Signed-off-by: NMarco Hartmann <marco.hartmann@nxp.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94acaeb5
  20. 14 8月, 2019 1 次提交
  21. 09 7月, 2019 1 次提交
  22. 06 6月, 2019 1 次提交
  23. 01 6月, 2019 1 次提交
  24. 31 5月, 2019 3 次提交
  25. 08 5月, 2019 1 次提交
  26. 04 5月, 2019 1 次提交
  27. 19 4月, 2019 1 次提交
  28. 21 3月, 2019 1 次提交
    • H
      net: phy: improve handling link_change_notify callback · 5c5f626b
      Heiner Kallweit 提交于
      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=2Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c5f626b
  29. 04 3月, 2019 1 次提交
  30. 15 2月, 2019 2 次提交
  31. 14 2月, 2019 1 次提交