Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: use phy_interface in stmmac_check_pcs_mode()

In the majority, if not all cases, mac_interface and phy_interface
are the same with the exception of some drivers that I have suggested
only use phy_interface and set mac_interface to PHY_INTERFACE_MODE_NA.

The only two that currently set mac_interface to PHY_INTERFACE_MODE_NA
are dwmac-loongson and dwmac-lpc18xx, neither of which use RGMII nor
SGMII.

In order to phase out the use of mac_interface, we need to have a path
for existing drivers so they can update to only using phy_interface
without causing regressions.

Therefore, in order to keep the "pcs" code working, we need to choose
the STMMAC integrated PCS mode based on phy_interface if mac_interface
is PHY_INTERFACE_MODE_NA.

This will allow more drivers to set mac_interface to
PHY_INTERFACE_MODE_NA without risking regressions.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1uytpG-00000006H29-1Ltk@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
0522f152 32a8d2a1

+3
+3
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1120 1120 { 1121 1121 int interface = priv->plat->mac_interface; 1122 1122 1123 + if (interface == PHY_INTERFACE_MODE_NA) 1124 + interface = priv->plat->phy_interface; 1125 + 1123 1126 if (priv->dma_cap.pcs) { 1124 1127 if ((interface == PHY_INTERFACE_MODE_RGMII) || 1125 1128 (interface == PHY_INTERFACE_MODE_RGMII_ID) ||