From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34139 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbcIINhp (ORCPT ); Fri, 9 Sep 2016 09:37:45 -0400 Subject: Patch "[PATCH 004/135] i40e: fix: do not sleep in netdev_ops" has been added to the 4.4-stable tree To: jesse.brandeburg@intel.com, alexander.levin@verizon.com, andrewx.bowers@intel.com, gregkh@linuxfoundation.org, jeffrey.t.kirsher@intel.com Cc: , From: Date: Fri, 09 Sep 2016 15:37:44 +0200 Message-ID: <1473428264156108@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled [PATCH 004/135] i40e: fix: do not sleep in netdev_ops to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: 0004-i40e-fix-do-not-sleep-in-netdev_ops.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 85e29ebd4dc47ea1a11d368455843967464384bd Mon Sep 17 00:00:00 2001 From: Jesse Brandeburg Date: Thu, 5 Nov 2015 17:01:01 -0800 Subject: [PATCH 004/135] i40e: fix: do not sleep in netdev_ops [ Upstream commit 0e4425ed641f3eef67c892bc541949cd745a9ba9 ] The driver was being called by VLAN, bonding, teaming operations that expected to be able to hold locks like rcu_read_lock(). This causes the driver to be held to the requirement to not sleep, and was found by the kernel debug options for checking sleep inside critical section, and the locking validator. Change-ID: Ibc68c835f5ffa8ffe0638ffe910a66fc5649a7f7 Signed-off-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_main.c | 44 ++++++++++++---------------- 1 file changed, 20 insertions(+), 24 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -1547,9 +1547,11 @@ static int i40e_set_mac(struct net_devic spin_unlock_bh(&vsi->mac_filter_list_lock); } - i40e_sync_vsi_filters(vsi, false); ether_addr_copy(netdev->dev_addr, addr->sa_data); - + /* schedule our worker thread which will take care of + * applying the new filter changes + */ + i40e_service_event_schedule(vsi->back); return 0; } @@ -2112,12 +2114,7 @@ int i40e_sync_vsi_filters(struct i40e_vs */ if (pf->cur_promisc != cur_promisc) { pf->cur_promisc = cur_promisc; - if (grab_rtnl) - i40e_do_reset_safe(pf, - BIT(__I40E_PF_RESET_REQUESTED)); - else - i40e_do_reset(pf, - BIT(__I40E_PF_RESET_REQUESTED)); + set_bit(__I40E_PF_RESET_REQUESTED, &pf->state); } } else { ret = i40e_aq_set_vsi_unicast_promiscuous( @@ -2377,16 +2374,13 @@ int i40e_vsi_add_vlan(struct i40e_vsi *v } } - /* Make sure to release before sync_vsi_filter because that - * function will lock/unlock as necessary - */ spin_unlock_bh(&vsi->mac_filter_list_lock); - if (test_bit(__I40E_DOWN, &vsi->back->state) || - test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state)) - return 0; - - return i40e_sync_vsi_filters(vsi, false); + /* schedule our worker thread which will take care of + * applying the new filter changes + */ + i40e_service_event_schedule(vsi->back); + return 0; } /** @@ -2459,16 +2453,13 @@ int i40e_vsi_kill_vlan(struct i40e_vsi * } } - /* Make sure to release before sync_vsi_filter because that - * function with lock/unlock as necessary - */ spin_unlock_bh(&vsi->mac_filter_list_lock); - if (test_bit(__I40E_DOWN, &vsi->back->state) || - test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state)) - return 0; - - return i40e_sync_vsi_filters(vsi, false); + /* schedule our worker thread which will take care of + * applying the new filter changes + */ + i40e_service_event_schedule(vsi->back); + return 0; } /** @@ -2711,6 +2702,11 @@ static void i40e_config_xps_tx_ring(stru netif_set_xps_queue(ring->netdev, mask, ring->queue_index); free_cpumask_var(mask); } + + /* schedule our worker thread which will take care of + * applying the new filter changes + */ + i40e_service_event_schedule(vsi->back); } /** Patches currently in stable-queue which might be from jesse.brandeburg@intel.com are queue-4.4/0004-i40e-fix-do-not-sleep-in-netdev_ops.patch