Skip to content

Commit 17e712c

Browse files
Yinjun Zhangdavem330
authored andcommitted
nfp: fix potential deadlock when canceling dim work
When port is linked down, the process which has acquired rtnl_lock will wait for the in-progress dim work to finish, and the work also acquires rtnl_lock, which may cause deadlock. Currently IRQ_MOD registers can be configured by `ethtool -C` and dim work, and which will take effect depends on the execution order, rtnl_lock is useless here, so remove them. Fixes: 9d32e4e ("nfp: add support for coalesce adaptive feature") Signed-off-by: Yinjun Zhang <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f8d384a commit 17e712c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,10 +3016,8 @@ static void nfp_net_rx_dim_work(struct work_struct *work)
30163016

30173017
/* copy RX interrupt coalesce parameters */
30183018
value = (moder.pkts << 16) | (factor * moder.usec);
3019-
rtnl_lock();
30203019
nn_writel(nn, NFP_NET_CFG_RXR_IRQ_MOD(r_vec->rx_ring->idx), value);
30213020
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
3022-
rtnl_unlock();
30233021

30243022
dim->state = DIM_START_MEASURE;
30253023
}
@@ -3047,10 +3045,8 @@ static void nfp_net_tx_dim_work(struct work_struct *work)
30473045

30483046
/* copy TX interrupt coalesce parameters */
30493047
value = (moder.pkts << 16) | (factor * moder.usec);
3050-
rtnl_lock();
30513048
nn_writel(nn, NFP_NET_CFG_TXR_IRQ_MOD(r_vec->tx_ring->idx), value);
30523049
(void)nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_IRQMOD);
3053-
rtnl_unlock();
30543050

30553051
dim->state = DIM_START_MEASURE;
30563052
}

0 commit comments

Comments
 (0)