net: dsa: microchip: fix RGMII error in KSZ DSA driver
authorTristram Ha <tristram.ha@microchip.com>
Tue, 28 May 2024 21:34:26 +0000 (14:34 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 May 2024 01:44:36 +0000 (18:44 -0700)
The driver should return RMII interface when XMII is running in RMII mode.

Fixes: 0ab7f6bf1675 ("net: dsa: microchip: ksz9477: use common xmii function")
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Acked-by: Jerry Ray <jerry.ray@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/1716932066-3342-1-git-send-email-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.c

index 1e0085cd9a9ad5fb3dccde133bb0b1251bad237a..2818e24e2a51dd39073ee1bc8d51ea7dfa2dc1e0 100644 (file)
@@ -3142,7 +3142,7 @@ phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit)
                else
                        interface = PHY_INTERFACE_MODE_MII;
        } else if (val == bitval[P_RMII_SEL]) {
-               interface = PHY_INTERFACE_MODE_RGMII;
+               interface = PHY_INTERFACE_MODE_RMII;
        } else {
                interface = PHY_INTERFACE_MODE_RGMII;
                if (data8 & P_RGMII_ID_EG_ENABLE)