1. 29 Mar, 2021 23 commits
  2. 26 Mar, 2021 17 commits
    • Liu Jian's avatar
      farsync: use DEFINE_SPINLOCK() for spinlock · a1281601
      Liu Jian authored
      spinlock can be initialized automatically with DEFINE_SPINLOCK()
      rather than explicitly calling spin_lock_init().
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1281601
    • David S. Miller's avatar
      Merge branch 'llc-kdoc' · c3c97fd0
      David S. Miller authored
      Yang Yingliang says:
      
      ====================
      net: llc: Correct some function names in header
      
      Fix some make W=1 kernel build warnings in net/llc/
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3c97fd0
    • Yang Yingliang's avatar
      net: llc: Correct function name llc_pdu_set_pf_bit() in header · 72e6afe6
      Yang Yingliang authored
      Fix the following make W=1 kernel build warning:
      
       net/llc/llc_pdu.c:36: warning: expecting prototype for pdu_set_pf_bit(). Prototype was for llc_pdu_set_pf_bit() instead
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72e6afe6
    • Yang Yingliang's avatar
      net: llc: Correct function name llc_sap_action_unitdata_ind() in header · 8114f099
      Yang Yingliang authored
      Fix the following make W=1 kernel build warning:
      
        net/llc/llc_s_ac.c:38: warning: expecting prototype for llc_sap_action_unit_data_ind(). Prototype was for llc_sap_action_unitdata_ind() instead
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8114f099
    • Yang Yingliang's avatar
      net: llc: Correct some function names in header · 26440a63
      Yang Yingliang authored
      Fix the following make W=1 kernel build warning:
      
       net/llc/llc_c_ev.c:622: warning: expecting prototype for conn_ev_qlfy_last_frame_eq_1(). Prototype was for llc_conn_ev_qlfy_last_frame_eq_1() instead
       net/llc/llc_c_ev.c:636: warning: expecting prototype for conn_ev_qlfy_last_frame_eq_0(). Prototype was for llc_conn_ev_qlfy_last_frame_eq_0() instead
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26440a63
    • Hoang Le's avatar
      tipc: fix kernel-doc warnings · bc556d3e
      Hoang Le authored
      Fix kernel-doc warning introduced in
      commit b83e214b ("tipc: add extack messages for bearer/media failure"):
      
      net/tipc/bearer.c:248: warning: Function parameter or member 'extack' not described in 'tipc_enable_bearer'
      
      Fixes: b83e214b ("tipc: add extack messages for bearer/media failure")
      Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc556d3e
    • Mohammad Athari Bin Ismail's avatar
      net: stmmac: Fix kernel panic due to NULL pointer dereference of fpe_cfg · 63c173ff
      Mohammad Athari Bin Ismail authored
      In this patch, "net: stmmac: support FPE link partner hand-shaking
      procedure", priv->plat->fpe_cfg wouldn`t be "devm_kzalloc"ed if
      dma_cap->frpsel is 0 (Flexible Rx Parser is not supported in SoC) in
      tc_init(). So, fpe_cfg will be remain as NULL and accessing it will cause
      kernel panic.
      
      To fix this, move the "devm_kzalloc"ing of priv->plat->fpe_cfg before
      dma_cap->frpsel checking in tc_init(). Additionally, checking of
      priv->dma_cap.fpesel is added before calling stmmac_fpe_link_state_handle()
      as only FPE supported SoC is allowed to call the function.
      
      Below is the kernel panic dump reported by Marek Szyprowski
      <m.szyprowski@samsung.com>:
      
      meson8b-dwmac ff3f0000.ethernet eth0: PHY [0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=35)
      meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found
      meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW
      meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000001
      Mem abort info:
      ...
      user pgtable: 4k pages, 48-bit VAs, pgdp=00000000044eb000
      [0000000000000001] pgd=0000000000000000, p4d=0000000000000000
      Internal error: Oops: 96000004 [#1] PREEMPT SMP
      Modules linked in: dw_hdmi_i2s_audio dw_hdmi_cec meson_gxl realtek meson_gxbb_wdt snd_soc_meson_axg_sound_card dwmac_generic axg_audio meson_dw_hdmi crct10dif_ce snd_soc_meson_card_utils snd_soc_meson_axg_tdmout panfrost rc_odroid gpu_sched reset_meson_audio_arb meson_ir snd_soc_meson_g12a_tohdmitx snd_soc_meson_axg_frddr sclk_div clk_phase snd_soc_meson_codec_glue dwmac_meson8b snd_soc_meson_axg_fifo stmmac_platform meson_rng meson_drm stmmac rtc_meson_vrtc rng_core meson_canvas pwm_meson dw_hdmi mdio_mux_meson_g12a pcs_xpcs snd_soc_meson_axg_tdm_interface snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
      CPU: 1 PID: 7 Comm: kworker/u8:0 Not tainted 5.12.0-rc4-next-20210325+
      Hardware name: Hardkernel ODROID-C4 (DT)
      Workqueue: events_power_efficient phylink_resolve
      pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
      pc : stmmac_mac_link_up+0x14c/0x348 [stmmac]
      lr : stmmac_mac_link_up+0x284/0x348 [stmmac] ...
      Call trace:
       stmmac_mac_link_up+0x14c/0x348 [stmmac]
       phylink_resolve+0x104/0x420
       process_one_work+0x2a8/0x718
       worker_thread+0x48/0x460
       kthread+0x134/0x160
       ret_from_fork+0x10/0x18
      Code: b971ba60 350007c0 f958c260 f9402000 (39400401)
      ---[ end trace 0c9deb6c510228aa ]---
      
      Fixes: 5a558611 ("net: stmmac: support FPE link partner hand-shaking
      procedure")
      Reported-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarMohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
      Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63c173ff
    • Xu Jia's avatar
      net: ethernet: remove duplicated include · aeab5cfb
      Xu Jia authored
      Remove duplicated include from mtk_ppe_offload.c.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarXu Jia <xujia39@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aeab5cfb
    • David S. Miller's avatar
      Merge branch 'axienet-clock-additions' · 4e6d698f
      David S. Miller authored
      Robert Hancock says:
      
      ====================
      axienet clock additions
      
      Add support to the axienet driver for controlling all of the clocks that
      the logic core may utilize.
      
      Changed since v3:
      -Added Acked-by to patch 1
      -Now applies to net-next tree after earlier patches merged in - code
      unchanged from v3
      
      Changed since v2:
      -Additional clock description clarification
      
      Changed since v1:
      -Clarified clock usages in documentation and code comments
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e6d698f
    • Robert Hancock's avatar
      net: axienet: Enable more clocks · b11bfb9a
      Robert Hancock authored
      This driver was only enabling the first clock on the device, regardless
      of its name. However, this controller logic can have multiple clocks
      which should all be enabled. Add support for enabling additional clocks.
      The clock names used are matching those used in the Xilinx version of this
      driver as well as the Xilinx device tree generator, except for mgt_clk
      which is not present there.
      
      For backward compatibility, if no named clocks are present, the first
      clock present is used for determining the MDIO bus clock divider.
      Reviewed-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b11bfb9a
    • Robert Hancock's avatar
      dt-bindings: net: xilinx_axienet: Document additional clocks · a0e55dcd
      Robert Hancock authored
      Update DT bindings to describe all of the clocks that the axienet
      driver will now be able to make use of.
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0e55dcd
    • David S. Miller's avatar
      Merge branch 'mld-sleepable' · 32bc7a2c
      David S. Miller authored
      Taehee Yoo says:
      
      ====================
      mld: change context from atomic to sleepable
      
      This patchset changes the context of MLD module.
      Before this patchset, MLD functions are atomic context so it couldn't use
      sleepable functions and flags.
      
      There are several reasons why MLD functions are under atomic context.
      1. It uses timer API.
      Timer expiration functions are executed in the atomic context.
      2. atomic locks
      MLD functions use rwlock and spinlock to protect their own resources.
      
      So, in order to switch context, this patchset converts resources to use
      RCU and removes atomic locks and timer API.
      
      1. The first patch convert from the timer API to delayed work.
      Timer API is used for delaying some works.
      MLD protocol has a delay mechanism, which is used for replying to a query.
      If a listener receives a query from a router, it should send a response
      after some delay. But because of timer expire function is executed in
      the atomic context, this patch convert from timer API to the delayed work.
      
      2. The fourth patch deletes inet6_dev->mc_lock.
      The mc_lock has protected inet6_dev->mc_tomb pointer.
      But this pointer is already protected by RTNL and it isn't be used by
      datapath. So, it isn't be needed and because of this, many atomic context
      critical sections are deleted.
      
      3. The fifth patch convert ip6_sf_socklist to RCU.
      ip6_sf_socklist has been protected by ipv6_mc_socklist->sflock(rwlock).
      But this is already protected by RTNL So if it is converted to use RCU
      in order to be used in the datapath, the sflock is no more needed.
      So, its control path context can be switched to sleepable.
      
      4. The sixth patch convert ip6_sf_list to RCU.
      The reason for this patch is the same as the previous patch.
      
      5. The seventh patch convert ifmcaddr6 to RCU.
      The reason for this patch is the same as the previous patch.
      
      6. Add new workqueues for processing query/report event.
      By this patch, query and report events are processed by workqueue
      So context is sleepable, not atomic.
      While this logic, it acquires RTNL.
      
      7. Add new mc_lock.
      The purpose of this lock is to protect per-interface mld data.
      Per-interface mld data is usually used by query/report event handler.
      So, query/report event workers need only this lock instead of RTNL.
      Therefore, it could reduce bottleneck.
      
      Changelog:
      v2 -> v3:
      1. Do not use msecs_to_jiffies().
      (by Cong Wang)
      2. Do not add unnecessary rtnl_lock() and rtnl_unlock().
      (by Cong Wang)
      3. Fix sparse warnings because of rcu annotation.
      (by kernel test robot)
         - Remove some rcu_assign_pointer(), which was used for non-rcu pointer.
         - Add union for rcu pointer.
         - Use rcu API in mld_clear_zeros().
         - Remove remained rcu_read_unlock().
         - Use rcu API for tomb resources.
      4. withdraw prevopus 2nd and 3rd patch.
         - "separate two flags from ifmcaddr6->mca_flags"
         - "add a new delayed_work, mc_delrec_work"
      5. Add 6th and 7th patch.
      
      v1 -> v2:
      1. Withdraw unnecessary refactoring patches.
      (by Cong Wang, Eric Dumazet, David Ahern)
          a) convert from array to list.
          b) function rename.
      2. Separate big one patch into small several patches.
      3. Do not rename 'ifmcaddr6->mca_lock'.
      In the v1 patch, this variable was changed to 'ifmcaddr6->mca_work_lock'.
      But this is actually not needed.
      4. Do not use atomic_t for 'ifmcaddr6->mca_sfcount' and
      'ipv6_mc_socklist'->sf_count'.
      5. Do not add mld_check_leave_group() function.
      6. Do not add ip6_mc_del_src_bulk() function.
      7. Do not add ip6_mc_add_src_bulk() function.
      8. Do not use rcu_read_lock() in the qeth_l3_add_mcast_rtnl().
      (by Julian Wiedmann)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32bc7a2c
    • Taehee Yoo's avatar
      mld: add mc_lock for protecting per-interface mld data · 63ed8de4
      Taehee Yoo authored
      The purpose of this lock is to avoid a bottleneck in the query/report
      event handler logic.
      
      By previous patches, almost all mld data is protected by RTNL.
      So, the query and report event handler, which is data path logic
      acquires RTNL too. Therefore if a lot of query and report events
      are received, it uses RTNL for a long time.
      So it makes the control-plane bottleneck because of using RTNL.
      In order to avoid this bottleneck, mc_lock is added.
      
      mc_lock protect only per-interface mld data and per-interface mld
      data is used in the query/report event handler logic.
      So, no longer rtnl_lock is needed in the query/report event handler logic.
      Therefore bottleneck will be disappeared by mc_lock.
      Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63ed8de4
    • Taehee Yoo's avatar
      mld: add new workqueues for process mld events · f185de28
      Taehee Yoo authored
      When query/report packets are received, mld module processes them.
      But they are processed under BH context so it couldn't use sleepable
      functions. So, in order to switch context, the two workqueues are
      added which processes query and report event.
      
      In the struct inet6_dev, mc_{query | report}_queue are added so it
      is per-interface queue.
      And mc_{query | report}_work are workqueue structure.
      
      When the query or report event is received, skb is queued to proper
      queue and worker function is scheduled immediately.
      Workqueues and queues are protected by spinlock, which is
      mc_{query | report}_lock, and worker functions are protected by RTNL.
      Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f185de28
    • Taehee Yoo's avatar
      mld: convert ifmcaddr6 to RCU · 88e2ca30
      Taehee Yoo authored
      The ifmcaddr6 has been protected by inet6_dev->lock(rwlock) so that
      the critical section is atomic context. In order to switch this context,
      changing locking is needed. The ifmcaddr6 actually already protected by
      RTNL So if it's converted to use RCU, its control path context can be
      switched to sleepable.
      Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88e2ca30
    • Taehee Yoo's avatar
      mld: convert ip6_sf_list to RCU · 4b200e39
      Taehee Yoo authored
      The ip6_sf_list has been protected by mca_lock(spin_lock) so that the
      critical section is atomic context. In order to switch this context,
      changing locking is needed. The ip6_sf_list actually already protected
      by RTNL So if it's converted to use RCU, its control path context can
      be switched to sleepable.
      But It doesn't remove mca_lock yet because ifmcaddr6 isn't converted
      to RCU yet. So, It's not fully converted to the sleepable context.
      Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b200e39
    • Taehee Yoo's avatar
      mld: convert ipv6_mc_socklist->sflist to RCU · 882ba1f7
      Taehee Yoo authored
      The sflist has been protected by rwlock so that the critical section
      is atomic context.
      In order to switch this context, changing locking is needed.
      The sflist actually already protected by RTNL So if it's converted
      to use RCU, its control path context can be switched to sleepable.
      Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      882ba1f7