Skip to content

Commit

Permalink
pch_gbe: ethtool cannot change parameters when link is down
Browse files Browse the repository at this point in the history
When attempting to change e.g. the advertising mask when the link is down
ecmd->speed is -1 causing mii_ethtool_sset() to bail out.

This bug bit when connecting to a gigabit switch through a 4-pin (industrial)
cable, since link negotiation would not complete (both endpoints claimed to
be gigabit-capable, but this is not possible with only 4 pins).
Any attempt to fix this by setting autonegation to not offer 1000Mbps
failed as the setting would not be accepted while the link was still down...

Set ecmd->speed to SPEED_1000 to satisfy mii_ethtool_sset()
(the actual value of ecmd->speed doesn't matter as long as it is valid,
since a re-negotation is forced afterwards).

Signed-off-by: Anders Larsen <al@alarsen.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Anders Larsen authored and David S. Miller committed Aug 20, 2013
1 parent 0aa857f commit c196ce0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ static int pch_gbe_set_settings(struct net_device *netdev,
* filled by get_settings() on a down link, speed is -1: */
if (speed == UINT_MAX) {
speed = SPEED_1000;
ethtool_cmd_speed_set(ecmd, speed);
ecmd->duplex = DUPLEX_FULL;
}
ret = mii_ethtool_sset(&adapter->mii, ecmd);
Expand Down

0 comments on commit c196ce0

Please sign in to comment.