]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: felix: unconditionally configure MAC speed to 1000Mbps
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 5 Jul 2020 16:16:23 +0000 (19:16 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 5 Jul 2020 22:25:58 +0000 (15:25 -0700)
commitda1c4ba1f741ee8f7a7f88d52bc2482fae26200d
tree32827b1f3fde8f5668b6d15441b2bc9020d7ac1c
parentb1c7b87443c2c12c4fe095114736b8ad6f963f67
net: dsa: felix: unconditionally configure MAC speed to 1000Mbps

In VSC9959, the PCS is the one who performs rate adaptation (symbol
duplication) to the speed negotiated by the PHY. The MAC is unaware of
that and must remain configured for gigabit. If it is configured at
OCELOT_SPEED_10 or OCELOT_SPEED_100, it'll start transmitting PAUSE
frames out of control and never recover, _even if_ we then reconfigure
it at OCELOT_SPEED_1000 afterwards.

This patch fixes a bug that luckily did not have any functional impact.
We were writing 10, 100, 1000 etc into this 2-bit field in
DEV_CLOCK_CFG, but the hardware expects values in the range 0, 1, 2, 3.
So all speed values were getting truncated to 0, which is
OCELOT_SPEED_2500, and which also appears to be fine.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c