1. 25 11月, 2021 1 次提交
    • R
      net: phylink: Force link down and retrigger resolve on interface change · 80662f4f
      Russell King (Oracle) 提交于
      On PHY state change the phylink_resolve() function can read stale
      information from the MAC and report incorrect link speed and duplex to
      the kernel message log.
      
      Example with a Marvell 88X3310 PHY connected to a SerDes port on Marvell
      88E6393X switch:
      - PHY driver triggers state change due to PHY interface mode being
        changed from 10gbase-r to 2500base-x due to copper change in speed
        from 10Gbps to 2.5Gbps, but the PHY itself either hasn't yet changed
        its interface to the host, or the interrupt about loss of SerDes link
        hadn't arrived yet (there can be a delay of several milliseconds for
        this), so we still think that the 10gbase-r mode is up
      - phylink_resolve()
        - phylink_mac_pcs_get_state()
          - this fills in speed=10g link=up
        - interface mode is updated to 2500base-x but speed is left at 10Gbps
        - phylink_major_config()
          - interface is changed to 2500base-x
        - phylink_link_up()
          - mv88e6xxx_mac_link_up()
            - .port_set_speed_duplex()
              - speed is set to 10Gbps
          - reports "Link is Up - 10Gbps/Full" to dmesg
      
      Afterwards when the interrupt finally arrives for mv88e6xxx, another
      resolve is forced in which we get the correct speed from
      phylink_mac_pcs_get_state(), but since the interface is not being
      changed anymore, we don't call phylink_major_config() but only
      phylink_mac_config(), which does not set speed/duplex anymore.
      
      To fix this, we need to force the link down and trigger another resolve
      on PHY interface change event.
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NMarek Behún <kabel@kernel.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      80662f4f
  2. 05 11月, 2021 1 次提交
  3. 03 11月, 2021 1 次提交
  4. 29 10月, 2021 1 次提交
    • R
      net: phylink: avoid mvneta warning when setting pause parameters · fd8d9731
      Russell King (Oracle) 提交于
      mvneta does not support asymetric pause modes, and it flags this by the
      lack of AsymPause in the supported field. When setting pause modes, we
      check that pause->rx_pause == pause->tx_pause, but only when pause
      autoneg is enabled. When pause autoneg is disabled, we still allow
      pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
      does not support asymetric pause, and causes mvneta to issue a warning.
      
      Fix this by removing the test for pause->autoneg, so we always check
      that pause->rx_pause == pause->tx_pause for network devices that do not
      support AsymPause.
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd8d9731
  5. 28 10月, 2021 2 次提交
  6. 27 10月, 2021 1 次提交
  7. 26 10月, 2021 1 次提交
  8. 25 10月, 2021 17 次提交
  9. 24 10月, 2021 4 次提交
    • J
      net: phy: constify netdev->dev_addr references · 86466cbe
      Jakub Kicinski 提交于
      netdev->dev_addr will become a const soon(ish),
      constify the local variables referring to it.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86466cbe
    • S
      net: convert users of bitmap_foo() to linkmode_foo() · 4973056c
      Sean Anderson 提交于
      This converts instances of
      	bitmap_foo(args..., __ETHTOOL_LINK_MODE_MASK_NBITS)
      to
      	linkmode_foo(args...)
      
      I manually fixed up some lines to prevent them from being excessively
      long. Otherwise, this change was generated with the following semantic
      patch:
      
      // Generated with
      // echo linux/linkmode.h > includes
      // git grep -Flf includes include/ | cut -f 2- -d / | cat includes - \
      // | sort | uniq | tee new_includes | wc -l && mv new_includes includes
      // and repeating until the number stopped going up
      @i@
      @@
      
      (
       #include <linux/acpi_mdio.h>
      |
       #include <linux/brcmphy.h>
      |
       #include <linux/dsa/loop.h>
      |
       #include <linux/dsa/sja1105.h>
      |
       #include <linux/ethtool.h>
      |
       #include <linux/ethtool_netlink.h>
      |
       #include <linux/fec.h>
      |
       #include <linux/fs_enet_pd.h>
      |
       #include <linux/fsl/enetc_mdio.h>
      |
       #include <linux/fwnode_mdio.h>
      |
       #include <linux/linkmode.h>
      |
       #include <linux/lsm_audit.h>
      |
       #include <linux/mdio-bitbang.h>
      |
       #include <linux/mdio.h>
      |
       #include <linux/mdio-mux.h>
      |
       #include <linux/mii.h>
      |
       #include <linux/mii_timestamper.h>
      |
       #include <linux/mlx5/accel.h>
      |
       #include <linux/mlx5/cq.h>
      |
       #include <linux/mlx5/device.h>
      |
       #include <linux/mlx5/driver.h>
      |
       #include <linux/mlx5/eswitch.h>
      |
       #include <linux/mlx5/fs.h>
      |
       #include <linux/mlx5/port.h>
      |
       #include <linux/mlx5/qp.h>
      |
       #include <linux/mlx5/rsc_dump.h>
      |
       #include <linux/mlx5/transobj.h>
      |
       #include <linux/mlx5/vport.h>
      |
       #include <linux/of_mdio.h>
      |
       #include <linux/of_net.h>
      |
       #include <linux/pcs-lynx.h>
      |
       #include <linux/pcs/pcs-xpcs.h>
      |
       #include <linux/phy.h>
      |
       #include <linux/phy_led_triggers.h>
      |
       #include <linux/phylink.h>
      |
       #include <linux/platform_data/bcmgenet.h>
      |
       #include <linux/platform_data/xilinx-ll-temac.h>
      |
       #include <linux/pxa168_eth.h>
      |
       #include <linux/qed/qed_eth_if.h>
      |
       #include <linux/qed/qed_fcoe_if.h>
      |
       #include <linux/qed/qed_if.h>
      |
       #include <linux/qed/qed_iov_if.h>
      |
       #include <linux/qed/qed_iscsi_if.h>
      |
       #include <linux/qed/qed_ll2_if.h>
      |
       #include <linux/qed/qed_nvmetcp_if.h>
      |
       #include <linux/qed/qed_rdma_if.h>
      |
       #include <linux/sfp.h>
      |
       #include <linux/sh_eth.h>
      |
       #include <linux/smsc911x.h>
      |
       #include <linux/soc/nxp/lpc32xx-misc.h>
      |
       #include <linux/stmmac.h>
      |
       #include <linux/sunrpc/svc_rdma.h>
      |
       #include <linux/sxgbe_platform.h>
      |
       #include <net/cfg80211.h>
      |
       #include <net/dsa.h>
      |
       #include <net/mac80211.h>
      |
       #include <net/selftests.h>
      |
       #include <rdma/ib_addr.h>
      |
       #include <rdma/ib_cache.h>
      |
       #include <rdma/ib_cm.h>
      |
       #include <rdma/ib_hdrs.h>
      |
       #include <rdma/ib_mad.h>
      |
       #include <rdma/ib_marshall.h>
      |
       #include <rdma/ib_pack.h>
      |
       #include <rdma/ib_pma.h>
      |
       #include <rdma/ib_sa.h>
      |
       #include <rdma/ib_smi.h>
      |
       #include <rdma/ib_umem.h>
      |
       #include <rdma/ib_umem_odp.h>
      |
       #include <rdma/ib_verbs.h>
      |
       #include <rdma/iw_cm.h>
      |
       #include <rdma/mr_pool.h>
      |
       #include <rdma/opa_addr.h>
      |
       #include <rdma/opa_port_info.h>
      |
       #include <rdma/opa_smi.h>
      |
       #include <rdma/opa_vnic.h>
      |
       #include <rdma/rdma_cm.h>
      |
       #include <rdma/rdma_cm_ib.h>
      |
       #include <rdma/rdmavt_cq.h>
      |
       #include <rdma/rdma_vt.h>
      |
       #include <rdma/rdmavt_qp.h>
      |
       #include <rdma/rw.h>
      |
       #include <rdma/tid_rdma_defs.h>
      |
       #include <rdma/uverbs_ioctl.h>
      |
       #include <rdma/uverbs_named_ioctl.h>
      |
       #include <rdma/uverbs_std_types.h>
      |
       #include <rdma/uverbs_types.h>
      |
       #include <soc/mscc/ocelot.h>
      |
       #include <soc/mscc/ocelot_ptp.h>
      |
       #include <soc/mscc/ocelot_vcap.h>
      |
       #include <trace/events/ib_mad.h>
      |
       #include <trace/events/rdma_core.h>
      |
       #include <trace/events/rdma.h>
      |
       #include <trace/events/rpcrdma.h>
      |
       #include <uapi/linux/ethtool.h>
      |
       #include <uapi/linux/ethtool_netlink.h>
      |
       #include <uapi/linux/mdio.h>
      |
       #include <uapi/linux/mii.h>
      )
      
      @depends on i@
      expression list args;
      @@
      
      (
      - bitmap_zero(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_zero(args)
      |
      - bitmap_copy(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_copy(args)
      |
      - bitmap_and(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_and(args)
      |
      - bitmap_or(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_or(args)
      |
      - bitmap_empty(args, ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_empty(args)
      |
      - bitmap_andnot(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_andnot(args)
      |
      - bitmap_equal(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_equal(args)
      |
      - bitmap_intersects(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_intersects(args)
      |
      - bitmap_subset(args, __ETHTOOL_LINK_MODE_MASK_NBITS)
      + linkmode_subset(args)
      )
      
      Add missing linux/mii.h include to mellanox. -DaveM
      Signed-off-by: NSean Anderson <sean.anderson@seco.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4973056c
    • F
      net: phy: bcm7xxx: Add EPHY entry for 7712 · 218f23e8
      Florian Fainelli 提交于
      7712 is a 16nm process SoC with a 10/100 integrated Ethernet PHY,
      utilize the recently defined 16nm EPHY macro to configure that PHY.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      218f23e8
    • S
      net: phylink: Convert some users of mdiobus_* to mdiodev_* · c8fb89a7
      Sean Anderson 提交于
      This refactors the phylink pcs helper functions to use mdiobus_* instead
      of mdiodev_*.
      Signed-off-by: NSean Anderson <sean.anderson@seco.com>
      Reviewed-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8fb89a7
  10. 20 10月, 2021 1 次提交
  11. 19 10月, 2021 2 次提交
    • R
      net: phylink: Support disabling autonegotiation for PCS · 92817dad
      Robert Hancock 提交于
      The auto-negotiation state in the PCS as set by
      phylink_mii_c22_pcs_config was previously always enabled when the
      driver is configured for in-band autonegotiation, even if
      autonegotiation was disabled on the interface with ethtool. Update the
      code to set the BMCR_ANENABLE bit based on the interface's
      autonegotiation enabled state.
      
      Update phylink_mii_c22_pcs_get_state to not check
      autonegotiation-related fields when autonegotiation is disabled.
      
      Update phylink_mac_pcs_get_state to initialize the state based on the
      interface's configured speed, duplex and pause parameters rather than
      to unknown when autonegotiation is disabled, before calling the
      driver's pcs_get_state functions, as they are not likely to provide
      meaningful data for these fields when autonegotiation is disabled. In
      this case the driver is really just filling in the link state field.
      
      Note that in cases where there is a downstream PHY connected, such as
      with SGMII and a copper PHY, the configuration set by ethtool is
      handled by phy_ethtool_ksettings_set and not propagated to the PCS.
      This is correct since SGMII or 1000Base-X autonegotiation with the PCS
      should normally still be used even if the copper side has disabled it.
      Signed-off-by: NRobert Hancock <robert.hancock@calian.com>
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      92817dad
    • R
      net: phylink: rejig SFP interface selection in ksettings_set() · dc90604b
      Russell King (Oracle) 提交于
      Commit ea269a6f ("net: phylink: Update SFP selected interface on
      advertising changes") added a better solution to selecting the
      interface mode for SFPs using the advertisement mask. This method will
      work for mvneta and mvpp2 when selecting between 2500base-X and
      1000base-X without needing to use the basex helper, or indicate that
      we support both 1000base-X and 2500base-X when in either of these two
      interface modes.
      
      Hence, we need to eliminate the validation prior to selecting the
      interface, otherwise when we clean up mvneta's validation function, we
      will end up locking to 2500base-X as we validate with an interface mode
      of PHY_INERFACE_MODE_2500BASEX.
      
      The supported mask will already have been reduced down to the union of
      support for the SFP and MAC already, so we can be confident that the
      advertisement mask is already appropriately restricted. We only need to
      select the appropriate interface, and then revalidate with the new
      interface mode.
      
      We get rid of the check for pl->sfp_port too, this is meaningless here
      as it doesn't get cleared when a module is removed, so it doesn't
      indicate if a module is present. Just rely on pl->sfp_bus.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc90604b
  12. 18 10月, 2021 1 次提交
  13. 15 10月, 2021 3 次提交
  14. 10 10月, 2021 4 次提交