Merge "net: stmmac: Fixed ethool speed issue"

This commit is contained in:
qctecmdr 2024-04-09 22:21:54 -07:00 committed by Gerrit - the friendly Code Review server
commit e06ee7e928
3 changed files with 20 additions and 22 deletions

View file

@ -1741,8 +1741,6 @@ static int ethqos_set_early_eth_param(struct stmmac_priv *priv,
priv->plat->mdio_bus_data->phy_mask =
priv->plat->mdio_bus_data->phy_mask | DUPLEX_FULL | SPEED_100;
priv->plat->max_speed = SPEED_100;
if (pparams.is_valid_ipv4_addr) {
INIT_DELAYED_WORK(&ethqos->ipv4_addr_assign_wq,
ethqos_is_ipv4_NW_stack_ready);

View file

@ -328,6 +328,7 @@ struct stmmac_priv {
bool phy_irq_enabled;
bool boot_kpi;
bool early_eth;
bool early_eth_config_set;
};
enum stmmac_state {

View file

@ -1040,37 +1040,36 @@ static void stmmac_validate(struct phylink_config *config,
phylink_set(mask, 1000baseT_Half);
}
linkmode_and(supported, supported, mac_supported);
linkmode_andnot(supported, supported, mask);
linkmode_and(state->advertising,
state->advertising, mac_supported);
linkmode_andnot(state->advertising,
state->advertising, mask);
/* Early ethernet settings to bring up link in 100M,
* Auto neg Off with full duplex link.
*/
if (max_speed == SPEED_100 && priv->early_eth) {
if (priv->early_eth && !priv->early_eth_config_set) {
priv->phydev->autoneg = AUTONEG_DISABLE;
priv->phydev->speed = SPEED_100;
priv->phydev->duplex = DUPLEX_FULL;
phylink_set(mac_supported, 100baseT_Full);
phylink_set(mac_supported, TP);
phylink_set(mac_supported, MII);
phylink_set(mac_supported, 10baseT_Full);
phylink_clear(mac_supported, Autoneg);
linkmode_and(supported, supported, mac_supported);
linkmode_andnot(supported, supported, mask);
phylink_clear(mac_supported, Autoneg);
linkmode_and(state->advertising, state->advertising, mac_supported);
linkmode_andnot(state->advertising, state->advertising, mask);
pr_info(" qcom-ethqos: %s early eth setting successful\n",
__func__);
stmmac_set_speed100(priv->phydev);
} else {
linkmode_and(supported, supported, mac_supported);
linkmode_andnot(supported, supported, mask);
phylink_clear(mac_supported, 1000baseT_Full);
linkmode_and(state->advertising,
state->advertising, mac_supported);
linkmode_andnot(state->advertising,
state->advertising, mask);
pr_info("qcom-ethqos: %s early eth setting successful\n",
__func__);
stmmac_set_speed100(priv->phydev);
/* Validate method will also be called
* when we change speed using ethtool.
* Add check to avoid multiple calls
*/
priv->early_eth_config_set = 1;
}
}