diff options
author | Xin Long <lucien.xin@gmail.com> | 2020-08-04 10:02:30 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-04 23:03:36 +0300 |
commit | bab9693a9a8c6dd19f670408ec1e78e12a320682 (patch) | |
tree | e9bdca142d32f2ee95dc4c9fa733c59c9a88cfec /drivers/net/ethernet/davicom | |
parent | 2ac24d6d685cb1c0e0fbb189dc607b05720fb5d1 (diff) | |
download | linux-bab9693a9a8c6dd19f670408ec1e78e12a320682.tar.xz |
net: thunderx: use spin_lock_bh in nicvf_set_rx_mode_task()
A dead lock was triggered on thunderx driver:
CPU0 CPU1
---- ----
[01] lock(&(&nic->rx_mode_wq_lock)->rlock);
[11] lock(&(&mc->mca_lock)->rlock);
[12] lock(&(&nic->rx_mode_wq_lock)->rlock);
[02] <Interrupt> lock(&(&mc->mca_lock)->rlock);
The path for each is:
[01] worker_thread() -> process_one_work() -> nicvf_set_rx_mode_task()
[02] mld_ifc_timer_expire()
[11] ipv6_add_dev() -> ipv6_dev_mc_inc() -> igmp6_group_added() ->
[12] dev_mc_add() -> __dev_set_rx_mode() -> nicvf_set_rx_mode()
To fix it, it needs to disable bh on [1], so that the timer on [2]
wouldn't be triggered until rx_mode_wq_lock is released. So change
to use spin_lock_bh() instead of spin_lock().
Thanks to Paolo for helping with this.
v1->v2:
- post to netdev.
Reported-by: Rafael P. <rparrazo@redhat.com>
Tested-by: Dean Nelson <dnelson@redhat.com>
Fixes: 469998c861fa ("net: thunderx: prevent concurrent data re-writing by nicvf_set_rx_mode")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/davicom')
0 files changed, 0 insertions, 0 deletions