@@ -6011,14 +6011,14 @@ static int mlx5e_resume(struct auxiliary_device *adev)
6011
6011
return 0 ;
6012
6012
}
6013
6013
6014
- static int _mlx5e_suspend (struct auxiliary_device * adev )
6014
+ static int _mlx5e_suspend (struct auxiliary_device * adev , bool pre_netdev_reg )
6015
6015
{
6016
6016
struct mlx5e_dev * mlx5e_dev = auxiliary_get_drvdata (adev );
6017
6017
struct mlx5e_priv * priv = mlx5e_dev -> priv ;
6018
6018
struct net_device * netdev = priv -> netdev ;
6019
6019
struct mlx5_core_dev * mdev = priv -> mdev ;
6020
6020
6021
- if (!netif_device_present (netdev )) {
6021
+ if (!pre_netdev_reg && ! netif_device_present (netdev )) {
6022
6022
if (test_bit (MLX5E_STATE_DESTROYING , & priv -> state ))
6023
6023
mlx5e_destroy_mdev_resources (mdev );
6024
6024
return - ENODEV ;
@@ -6031,7 +6031,7 @@ static int _mlx5e_suspend(struct auxiliary_device *adev)
6031
6031
6032
6032
static int mlx5e_suspend (struct auxiliary_device * adev , pm_message_t state )
6033
6033
{
6034
- return _mlx5e_suspend (adev );
6034
+ return _mlx5e_suspend (adev , false );
6035
6035
}
6036
6036
6037
6037
static int _mlx5e_probe (struct auxiliary_device * adev )
@@ -6095,7 +6095,7 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
6095
6095
return 0 ;
6096
6096
6097
6097
err_resume :
6098
- _mlx5e_suspend (adev );
6098
+ _mlx5e_suspend (adev , true );
6099
6099
err_profile_cleanup :
6100
6100
profile -> cleanup (priv );
6101
6101
err_destroy_netdev :
@@ -6121,7 +6121,7 @@ static void mlx5e_remove(struct auxiliary_device *adev)
6121
6121
mlx5_core_uplink_netdev_set (priv -> mdev , NULL );
6122
6122
mlx5e_dcbnl_delete_app (priv );
6123
6123
unregister_netdev (priv -> netdev );
6124
- _mlx5e_suspend (adev );
6124
+ _mlx5e_suspend (adev , false );
6125
6125
/* Avoid cleanup if profile rollback failed. */
6126
6126
if (priv -> profile )
6127
6127
priv -> profile -> cleanup (priv );
0 commit comments