Skip to content

Commit

Permalink
ice: avoid setting features during reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henry Tieman authored and Jeff Kirsher committed Nov 8, 2019
1 parent b94b013 commit 5f8cc35
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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
*/
Expand Down

0 comments on commit 5f8cc35

Please sign in to comment.