]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 3 Jan 2021 01:25:44 +0000 (02:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:16:15 +0000 (20:16 +0100)
commit171a2bce9d6ce3bb070b3fc21a3066f1f7d03777
treeb12e2f5084b1060c9675f9b770cb6bb7fcef78f7
parentc0883010d3b3c59aa6caa1f0034ff47028df6e53
net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access

[ Upstream commit 709a3c9dff2a639966ae7d8ba6239d2b8aba036d ]

There is one GSWIP_MII_CFG register for each switch-port except the CPU
port. The register offset for the first port is 0x0, 0x02 for the
second, 0x04 for the third and so on.

Update the driver to not only restrict the GSWIP_MII_CFG registers to
ports 0, 1 and 5. Handle ports 0..5 instead but skip the CPU port. This
means we are not overwriting the configuration for the third port (port
two since we start counting from zero) with the settings for the sixth
port (with number five) anymore.

The GSWIP_MII_PCDU(p) registers are not updated because there's really
only three (one for each of the following ports: 0, 1, 5).

Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/lantiq_gswip.c