[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200804.130420.1170398750895013643.davem@davemloft.net>
Date: Tue, 04 Aug 2020 13:04:20 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: lucien.xin@...il.com
Cc: netdev@...r.kernel.org, dnelson@...hat.com,
linux-arm-kernel@...ts.infradead.org, sgoutham@...ium.com,
rric@...nel.org, pabeni@...hat.com
Subject: Re: [PATCHv2 net] net: thunderx: use spin_lock_bh in
nicvf_set_rx_mode_task()
From: Xin Long <lucien.xin@...il.com>
Date: Tue, 4 Aug 2020 15:02:30 +0800
> 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@...hat.com>
> Tested-by: Dean Nelson <dnelson@...hat.com>
> Fixes: 469998c861fa ("net: thunderx: prevent concurrent data re-writing by nicvf_set_rx_mode")
> Signed-off-by: Xin Long <lucien.xin@...il.com>
Applied and queued up for -stable, thank you.
Powered by blists - more mailing lists