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: remove mac_interface

mac_interface has served little purpose, and has only caused confusion.
Now that we have cleaned up all platform glue drivers which should not
have been using mac_interface, there are no users remaining. Remove
mac_interface.

This results in the special dwmac specific "mac-mode" DT property
becoming redundant, and an in case, no DTS files in the kernel make use
of this property. Add a warning if the property is set, and it is
different from the "phy-mode".

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://patch.msgid.link/E1uytpv-00000006H2x-196h@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
6b0ed6a3 3a94ecdf

+9 -16
-2
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
··· 98 98 /* Set default value for multicast hash bins */ 99 99 plat->multicast_filter_bins = 256; 100 100 101 - plat->mac_interface = PHY_INTERFACE_MODE_NA; 102 - 103 101 /* Set default value for unicast filter entries */ 104 102 plat->unicast_filter_entries = 1; 105 103
-1
drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
··· 41 41 if (IS_ERR(plat_dat)) 42 42 return PTR_ERR(plat_dat); 43 43 44 - plat_dat->mac_interface = PHY_INTERFACE_MODE_NA; 45 44 plat_dat->has_gmac = true; 46 45 47 46 reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");
+1 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1118 1118 */ 1119 1119 static void stmmac_check_pcs_mode(struct stmmac_priv *priv) 1120 1120 { 1121 - int interface = priv->plat->mac_interface; 1122 - 1123 - if (interface == PHY_INTERFACE_MODE_NA) 1124 - interface = priv->plat->phy_interface; 1121 + int interface = priv->plat->phy_interface; 1125 1122 1126 1123 if (priv->dma_cap.pcs) { 1127 1124 if ((interface == PHY_INTERFACE_MODE_RGMII) ||
+5 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 453 453 return ERR_PTR(phy_mode); 454 454 455 455 plat->phy_interface = phy_mode; 456 + 456 457 rc = stmmac_of_get_mac_mode(np); 457 - plat->mac_interface = rc < 0 ? plat->phy_interface : rc; 458 + if (rc >= 0 && rc != phy_mode) 459 + dev_warn(&pdev->dev, 460 + "\"mac-mode\" property used for %s but differs to \"phy-mode\" of %s, and will be ignored. Please report.\n", 461 + phy_modes(rc), phy_modes(phy_mode)); 458 462 459 463 /* Some wrapper drivers still rely on phy_node. Let's save it while 460 464 * they are not converted to phylink. */
+3 -8
include/linux/stmmac.h
··· 190 190 int bus_id; 191 191 int phy_addr; 192 192 /* MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media 193 - * ^ ^ 194 - * mac_interface phy_interface 193 + * ^ 194 + * phy_interface 195 195 * 196 196 * The Synopsys dwmac core only covers the MAC and an optional 197 197 * integrated PCS. Where the integrated PCS is used with a SerDes, ··· 208 208 * is used, this counts as "the rest of the SoC" in the above 209 209 * paragraph. 210 210 * 211 - * Thus, mac_interface is of little use inside the stmmac code; 212 - * please do not use unless there is a definite requirement, and 213 - * make sure to gain review feedback first. 214 - */ 215 - phy_interface_t mac_interface; 216 - /* phy_interface is the PHY-side interface - the interface used by 211 + * phy_interface is the PHY-side interface - the interface used by 217 212 * an attached PHY or SFP etc. This is equivalent to the interface 218 213 * that phylink uses. 219 214 */