]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ice: avoid setting features during reset
authorHenry Tieman <henry.w.tieman@intel.com>
Wed, 6 Nov 2019 10:05:30 +0000 (02:05 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 8 Nov 2019 20:02:43 +0000 (12:02 -0800)
Certain subsystems behave very badly when called during reset (core
dump). This patch returns -EBUSY when reconfiguring some subsystems
during reset. With this patch some ethtool functions will not core
dump during reset.

Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index d963aec59845be1aaedf355b644e805a218422f4..cb93fe5529f6894b07d567f2ab1d96c4ec473324 100644 (file)
@@ -3776,6 +3776,7 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
 {
        struct ice_netdev_priv *np = netdev_priv(netdev);
        struct ice_vsi *vsi = np->vsi;
+       struct ice_pf *pf = vsi->back;
        int ret = 0;
 
        /* Don't set any netdev advanced features with device in Safe Mode */
@@ -3785,6 +3786,13 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
                return ret;
        }
 
+       /* Do not change setting during reset */
+       if (ice_is_reset_in_progress(pf->state)) {
+               dev_err(&vsi->back->pdev->dev,
+                       "Device is resetting, changing advanced netdev features temporarily unavailable.\n");
+               return -EBUSY;
+       }
+
        /* Multiple features can be changed in one call so keep features in
         * separate if/else statements to guarantee each feature is checked
         */