Skip to content

Commit 6a8d8bb

Browse files
Wieczerzyckaanguy11
authored andcommitted
ice: Fix link_down_on_close message
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 <[email protected]> Signed-off-by: Katarzyna Wieczerzycka <[email protected]> Signed-off-by: Wojciech Drewek <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 49fcf34 commit 6a8d8bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)
21462146

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

21512151
ice_print_topo_conflict(vsi);
21522152

@@ -9187,8 +9187,12 @@ int ice_stop(struct net_device *netdev)
91879187
int link_err = ice_force_phys_link_state(vsi, false);
91889188

91899189
if (link_err) {
9190-
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
9191-
vsi->vsi_num, link_err);
9190+
if (link_err == -ENOMEDIUM)
9191+
netdev_info(vsi->netdev, "Skipping link reconfig - no media attached, VSI %d\n",
9192+
vsi->vsi_num);
9193+
else
9194+
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
9195+
vsi->vsi_num, link_err);
91929196
return -EIO;
91939197
}
91949198
}

0 commit comments

Comments
 (0)