1. Jul 18, 2022
  2. Jul 16, 2022
  3. Jul 15, 2022
    • David S. Miller's avatar
      Merge branch 'stmmac-dwmac-mediatec-clock-fix' · 8f3184b9
      David S. Miller authored
      
      
      Biao Huang says:
      
      ====================
      stmmac: dwmac-mediatek: fix clock issue
      
      changes in v5:
      1. add reivewd-by as Matthias's comments.
      2. fix "warning: unused variable 'ret' [-Wunused-variable]" as Jakub's comments
      
      changes in v4:
      1. improve commit message and test ko insertion/remove as Matthias's comments.
      2. add patch "net: stmmac: fix pm runtime issue in stmmac_dvr_remove()" to
         fix vlan filter deletion issue.
      3. add patch "net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow"
         to fix unbalanced ptp clock issue in suspend/resume flow.
      
      changes in v3:
      1. delete mediatek_dwmac_exit() since there is no operation in it,
      as Matthias's comments.
      
      changes in v2:
      1. clock configuration is still needed in probe,
      and invoke mediatek_dwmac_clks_config() instead.
      2. update commit message.
      
      v1:
      remove duplicated clock configuration in init/exit.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f3184b9
    • Biao Huang's avatar
      net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow · f4c7d894
      Biao Huang authored
      Current stmmac driver will prepare/enable ptp_ref clock in
      stmmac_init_tstamp_counter().
      
      The stmmac_pltfr_noirq_suspend will disable it once in suspend flow.
      
      But in resume flow,
      	stmmac_pltfr_noirq_resume --> stmmac_init_tstamp_counter
      	stmmac_resume --> stmmac_hw_setup --> stmmac_init_ptp --> stmmac_init_tstamp_counter
      ptp_ref clock reference counter increases twice, which leads to unbalance
      ptp clock when resume back.
      
      Move ptp_ref clock prepare/enable out of stmmac_init_tstamp_counter to fix it.
      
      Fixes: 0735e639
      
       ("net: stmmac: skip only stmmac_ptp_register when resume from suspend")
      Signed-off-by: default avatarBiao Huang <biao.huang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4c7d894
    • Biao Huang's avatar
      net: stmmac: fix pm runtime issue in stmmac_dvr_remove() · 0d9a1591
      Biao Huang authored
      If netif is running when stmmac_dvr_remove is invoked,
      the unregister_netdev will call ndo_stop(stmmac_release) and
      vlan_kill_rx_filter(stmmac_vlan_rx_kill_vid).
      
      Currently, stmmac_dvr_remove() will disable pm runtime before
      unregister_netdev. When stmmac_vlan_rx_kill_vid is invoked,
      pm_runtime_resume_and_get in it returns EACCESS error number,
      and reports:
      
      	dwmac-mediatek 11021000.ethernet eth0: stmmac_dvr_remove: removing driver
      	dwmac-mediatek 11021000.ethernet eth0: FPE workqueue stop
      	dwmac-mediatek 11021000.ethernet eth0: failed to kill vid 0081/0
      
      Move the pm_runtime_disable to the end of stmmac_dvr_remove
      to fix this issue.
      
      Fixes: 64495203
      
       ("net: stmmac: properly handle with runtime pm in stmmac_dvr_remove()")
      Signed-off-by: default avatarBiao Huang <biao.huang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d9a1591
    • Biao Huang's avatar
      stmmac: dwmac-mediatek: fix clock issue · fa4b3ca6
      Biao Huang authored
      The pm_runtime takes care of the clock handling in current
      stmmac drivers, and dwmac-mediatek implement the
      mediatek_dwmac_clks_config() as the callback for pm_runtime.
      
      Then, stripping duplicated clocks handling in old init()/exit()
      to fix clock issue in suspend/resume test.
      
      As to clocks in probe/remove, vendor need symmetric handling to
      ensure clocks balance.
      
      Test pass, including suspend/resume and ko insertion/remove.
      
      Fixes: 3186bdad
      
       ("stmmac: dwmac-mediatek: add platform level clocks management")
      Signed-off-by: default avatarBiao Huang <biao.huang@mediatek.com>
      Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa4b3ca6
    • David S. Miller's avatar
      Merge branch 'net-sysctl-races-round2' · 782d86fe
      David S. Miller authored
      
      
      Kuniyuki Iwashima says:
      
      ====================
      sysctl: Fix data-races around ipv4_net_table (Round 2).
      
      This series fixes data-races around 15 knobs after ip_default_ttl in
      ipv4_net_table.
      
      These two knobs are skipped.
        - ip_local_port_range is safe with its own lock.
        - ip_local_reserved_ports uses proc_do_large_bitmap(), which will need
          an additional lock and can be fixed later.
      
      So, the next round will start with igmp_link_local_mcast_reports.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      782d86fe
    • Kuniyuki Iwashima's avatar
      tcp: Fix a data-race around sysctl_tcp_probe_interval. · 2a85388f
      Kuniyuki Iwashima authored
      While reading sysctl_tcp_probe_interval, it can be changed concurrently.
      Thus, we need to add READ_ONCE() to its reader.
      
      Fixes: 05cbc0db
      
       ("ipv4: Create probe timer for tcp PMTU as per RFC4821")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a85388f
    • Kuniyuki Iwashima's avatar
      tcp: Fix a data-race around sysctl_tcp_probe_threshold. · 92c0aa41
      Kuniyuki Iwashima authored
      While reading sysctl_tcp_probe_threshold, it can be changed concurrently.
      Thus, we need to add READ_ONCE() to its reader.
      
      Fixes: 6b58e0a5
      
       ("ipv4: Use binary search to choose tcp PMTU probe_size")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      92c0aa41
    • Kuniyuki Iwashima's avatar
      tcp: Fix a data-race around sysctl_tcp_mtu_probe_floor. · 8e92d442
      Kuniyuki Iwashima authored
      While reading sysctl_tcp_mtu_probe_floor, it can be changed concurrently.
      Thus, we need to add READ_ONCE() to its reader.
      
      Fixes: c04b79b6
      
       ("tcp: add new tcp_mtu_probe_floor sysctl")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e92d442