]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
i40e: close client on remove and shutdown
authorMitch Williams <mitch.a.williams@intel.com>
Thu, 30 Mar 2017 07:46:08 +0000 (00:46 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 7 Apr 2017 03:22:28 +0000 (20:22 -0700)
When the driver is removed or shut down, close any attached clients
(i.e. i40iw). This prevents a panic seen sometimes on forced driver
removal or system shutdown when iWarp is running.

Change-ID: I4f6161e5a73ffbb2fd5883567b007310302bfcb5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 7147c67a939de4e7146410f76439e4287311a972..d83430faaa41225a19acb70a52ca9ca8736ce904 100644 (file)
@@ -11395,6 +11395,11 @@ static void i40e_remove(struct pci_dev *pdev)
        if (pf->service_task.func)
                cancel_work_sync(&pf->service_task);
 
+       /* Client close must be called explicitly here because the timer
+        * has been stopped.
+        */
+       i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
+
        if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
                i40e_free_vfs(pf);
                pf->flags &= ~I40E_FLAG_SRIOV_ENABLED;
@@ -11635,6 +11640,11 @@ static void i40e_shutdown(struct pci_dev *pdev)
        cancel_work_sync(&pf->service_task);
        i40e_fdir_teardown(pf);
 
+       /* Client close must be called explicitly here because the timer
+        * has been stopped.
+        */
+       i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
+
        if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))
                i40e_enable_mc_magic_wake(pf);