net: dsa: mv88e6xxx: Respect SPEED_UNFORCED, don't set force bit
authorAndrew Lunn <andrew@lunn.ch>
Wed, 16 Nov 2016 03:26:48 +0000 (04:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 20:12:51 +0000 (15:12 -0500)
The SPEED_UNFORCED indicates the MAC & PHY should perform
auto-negotiation to determine a speed which works. If this is called
for, don't set the force bit. If it is set, the MAC actually does
10Gbps, why the internal PHYs don't support.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/port.c

index e4978f6367aac351e8de67a779b72e930779c17e..af4772d86086ae28e3f6721c7212322fbf51faf4 100644 (file)
@@ -213,7 +213,7 @@ static int mv88e6xxx_port_set_speed(struct mv88e6xxx_chip *chip, int port,
                reg &= ~PORT_PCS_CTRL_ALTSPEED;
        if (force_bit) {
                reg &= ~PORT_PCS_CTRL_FORCE_SPEED;
-               if (speed)
+               if (speed != SPEED_UNFORCED)
                        ctrl |= PORT_PCS_CTRL_FORCE_SPEED;
        }
        reg |= ctrl;