Skip to content

Commit 640f93c

Browse files
XidianGeneraldavem330
authored andcommitted
i40e: Fix a sleep-in-atomic bug
The driver may sleep under a spin lock, and the function call path is: i40e_ndo_set_vf_port_vlan (acquire the lock by spin_lock_bh) i40e_vsi_remove_pvid i40e_vlan_stripping_disable i40e_aq_update_vsi_params i40e_asq_send_command mutex_lock --> may sleep To fixed it, the spin lock is released before "i40e_vsi_remove_pvid", and the lock is acquired again after this function. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 849a44d commit 640f93c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,10 +3017,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,
30173017
VLAN_VID_MASK));
30183018
}
30193019

3020+
spin_unlock_bh(&vsi->mac_filter_hash_lock);
30203021
if (vlan_id || qos)
30213022
ret = i40e_vsi_add_pvid(vsi, vlanprio);
30223023
else
30233024
i40e_vsi_remove_pvid(vsi);
3025+
spin_lock_bh(&vsi->mac_filter_hash_lock);
30243026

30253027
if (vlan_id) {
30263028
dev_info(&pf->pdev->dev, "Setting VLAN %d, QOS 0x%x on VF %d\n",

0 commit comments

Comments
 (0)