Skip to content

Commit

Permalink
ice: Fix link_down_on_close message
Browse files Browse the repository at this point in the history
[ Upstream commit 6a8d8bb ]

The driver should not report an error message when for a medialess port
the link_down_on_close flag is enabled and the physical link cannot be
set down.

Fixes: 8ac7132 ("ice: Fix interface being down after reset with link-down-on-close flag on")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wieczerzycka authored and gregkh committed Jan 10, 2024
1 parent 03ed388 commit 49b1e2a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)

/* Ensure we have media as we cannot configure a medialess port */
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
return -EPERM;
return -ENOMEDIUM;

ice_print_topo_conflict(vsi);

Expand Down Expand Up @@ -9173,8 +9173,12 @@ int ice_stop(struct net_device *netdev)
int link_err = ice_force_phys_link_state(vsi, false);

if (link_err) {
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
vsi->vsi_num, link_err);
if (link_err == -ENOMEDIUM)
netdev_info(vsi->netdev, "Skipping link reconfig - no media attached, VSI %d\n",
vsi->vsi_num);
else
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
vsi->vsi_num, link_err);
return -EIO;
}
}
Expand Down

0 comments on commit 49b1e2a

Please sign in to comment.