1. 01 Dec, 2023 4 commits
    • Andy Shevchenko's avatar
    • Andrew Halaney's avatar
      net: phy: mdio_device: Reset device only when necessary · df16c1c5
      Andrew Halaney authored
      Currently the phy reset sequence is as shown below for a
      devicetree described mdio phy on boot:
      
      1. Assert the phy_device's reset as part of registering
      2. Deassert the phy_device's reset as part of registering
      3. Deassert the phy_device's reset as part of phy_probe
      4. Deassert the phy_device's reset as part of phy_hw_init
      
      The extra two deasserts include waiting the deassert delay afterwards,
      which is adding unnecessary delay.
      
      This applies to both possible types of resets (reset controller
      reference and a reset gpio) that can be used.
      
      Here's some snipped tracing output using the following command line
      params "trace_event=gpio:* trace_options=stacktrace" illustrating
      the reset handling and where its coming from:
      
          /* Assert */
             systemd-udevd-283     [002] .....     6.780434: gpio_value: 544 set 0
             systemd-udevd-283     [002] .....     6.783849: <stack trace>
           => gpiod_set_raw_value_commit
           => gpiod_set_value_nocheck
           => gpiod_set_value_cansleep
           => mdio_device_reset
           => mdiobus_register_device
           => phy_device_register
           => fwnode_mdiobus_phy_device_register
           => fwnode_mdiobus_register_phy
           => __of_mdiobus_register
           => stmmac_mdio_register
           => stmmac_dvr_probe
           => stmmac_pltfr_probe
           => devm_stmmac_pltfr_probe
           => qcom_ethqos_probe
           => platform_probe
      
          /* Deassert */
             systemd-udevd-283     [002] .....     6.802480: gpio_value: 544 set 1
             systemd-udevd-283     [002] .....     6.805886: <stack trace>
           => gpiod_set_raw_value_commit
           => gpiod_set_value_nocheck
           => gpiod_set_value_cansleep
           => mdio_device_reset
           => phy_device_register
           => fwnode_mdiobus_phy_device_register
           => fwnode_mdiobus_register_phy
           => __of_mdiobus_register
           => stmmac_mdio_register
           => stmmac_dvr_probe
           => stmmac_pltfr_probe
           => devm_stmmac_pltfr_probe
           => qcom_ethqos_probe
           => platform_probe
      
          /* Deassert */
             systemd-udevd-283     [002] .....     6.882601: gpio_value: 544 set 1
             systemd-udevd-283     [002] .....     6.886014: <stack trace>
           => gpiod_set_raw_value_commit
           => gpiod_set_value_nocheck
           => gpiod_set_value_cansleep
           => mdio_device_reset
           => phy_probe
           => really_probe
           => __driver_probe_device
           => driver_probe_device
           => __device_attach_driver
           => bus_for_each_drv
           => __device_attach
           => device_initial_probe
           => bus_probe_device
           => device_add
           => phy_device_register
           => fwnode_mdiobus_phy_device_register
           => fwnode_mdiobus_register_phy
           => __of_mdiobus_register
           => stmmac_mdio_register
           => stmmac_dvr_probe
           => stmmac_pltfr_probe
           => devm_stmmac_pltfr_probe
           => qcom_ethqos_probe
           => platform_probe
      
          /* Deassert */
            NetworkManager-477     [000] .....     7.023144: gpio_value: 544 set 1
            NetworkManager-477     [000] .....     7.026596: <stack trace>
           => gpiod_set_raw_value_commit
           => gpiod_set_value_nocheck
           => gpiod_set_value_cansleep
           => mdio_device_reset
           => phy_init_hw
           => phy_attach_direct
           => phylink_fwnode_phy_connect
           => __stmmac_open
           => stmmac_open
      
      There's a lot of paths where the device is getting its reset
      asserted and deasserted. Let's track the state and only actually
      do the assert/deassert when it changes.
      Reported-by: default avatarSagar Cheluvegowda <quic_scheluve@quicinc.com>
      Signed-off-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20231127-net-phy-reset-once-v2-1-448e8658779e@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      df16c1c5
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 753c8608
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2023-11-30
      
      We've added 30 non-merge commits during the last 7 day(s) which contain
      a total of 58 files changed, 1598 insertions(+), 154 deletions(-).
      
      The main changes are:
      
      1) Add initial TX metadata implementation for AF_XDP with support in mlx5
         and stmmac drivers. Two types of offloads are supported right now, that
         is, TX timestamp and TX checksum offload, from Stanislav Fomichev with
         stmmac implementation from Song Yoong Siang.
      
      2) Change BPF verifier logic to validate global subprograms lazily instead
         of unconditionally before the main program, so they can be guarded using
         BPF CO-RE techniques, from Andrii Nakryiko.
      
      3) Add BPF link_info support for uprobe multi link along with bpftool
         integration for the latter, from Jiri Olsa.
      
      4) Use pkg-config in BPF selftests to determine ld flags which is
         in particular needed for linking statically, from Akihiko Odaki.
      
      5) Fix a few BPF selftest failures to adapt to the upcoming LLVM18,
         from Yonghong Song.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (30 commits)
        bpf/tests: Remove duplicate JSGT tests
        selftests/bpf: Add TX side to xdp_hw_metadata
        selftests/bpf: Convert xdp_hw_metadata to XDP_USE_NEED_WAKEUP
        selftests/bpf: Add TX side to xdp_metadata
        selftests/bpf: Add csum helpers
        selftests/xsk: Support tx_metadata_len
        xsk: Add option to calculate TX checksum in SW
        xsk: Validate xsk_tx_metadata flags
        xsk: Document tx_metadata_len layout
        net: stmmac: Add Tx HWTS support to XDP ZC
        net/mlx5e: Implement AF_XDP TX timestamp and checksum offload
        tools: ynl: Print xsk-features from the sample
        xsk: Add TX timestamp and TX checksum offload support
        xsk: Support tx_metadata_len
        selftests/bpf: Use pkg-config for libelf
        selftests/bpf: Override PKG_CONFIG for static builds
        selftests/bpf: Choose pkg-config for the target
        bpftool: Add support to display uprobe_multi links
        selftests/bpf: Add link_info test for uprobe_multi link
        selftests/bpf: Use bpf_link__destroy in fill_link_info tests
        ...
      ====================
      
      Conflicts:
      
      Documentation/netlink/specs/netdev.yaml:
        839ff60d ("net: page_pool: add nlspec for basic access to page pools")
        48eb03dd ("xsk: Add TX timestamp and TX checksum offload support")
      https://lore.kernel.org/all/20231201094705.1ee3cab8@canb.auug.org.au/
      
      While at it also regen, tree is dirty after:
        48eb03dd ("xsk: Add TX timestamp and TX checksum offload support")
      looks like code wasn't re-rendered after "render-max" was removed.
      
      Link: https://lore.kernel.org/r/20231130145708.32573-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      753c8608
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 975f2d73
      Jakub Kicinski authored
      Cross-merge networking fixes after downstream PR.
      
      No conflicts.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      975f2d73
  2. 30 Nov, 2023 36 commits