Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e3455ea authored by Suraj Jaiswal's avatar Suraj Jaiswal
Browse files

net: stmmac: Fixed ethool speed issue



Don't modify emac supported capabilities during
early ethernet boot up. Only update advertise values
otherwise speed can't be changed using ethtool.

Change-Id: Id25ddd17a81fefd4d17116f0ff7237272f2607c0
Acked-by: default avatarNagarjuna Chaganti <nchagant@qti.qualcomm.com>
Signed-off-by: default avatarSuraj Jaiswal <jsuraj@codeaurora.org>
parent 36d251b7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1308,7 +1308,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;
	priv->early_eth = ethqos->early_eth_enabled;
	qcom_ethqos_add_ipaddr(&pparams, priv->dev);

+1 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ struct stmmac_priv {
	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
	bool boot_kpi;
	bool early_eth;
	bool early_eth_config_set;
#ifdef CONFIG_DEBUG_FS
	struct dentry *dbgfs_dir;
#endif
+16 −23
Original line number Diff line number Diff line
@@ -869,25 +869,23 @@ static void stmmac_validate(struct phylink_config *config,
		phylink_set(mask, 1000baseT_Half);
	}

	bitmap_and(supported, supported, mac_supported,
		   __ETHTOOL_LINK_MODE_MASK_NBITS);
	bitmap_andnot(supported, supported, mask,
		      __ETHTOOL_LINK_MODE_MASK_NBITS);
	bitmap_and(state->advertising, state->advertising, mac_supported,
		   __ETHTOOL_LINK_MODE_MASK_NBITS);
	bitmap_andnot(state->advertising, state->advertising, mask,
		      __ETHTOOL_LINK_MODE_MASK_NBITS);

	/* 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);
	bitmap_and(supported, supported, mac_supported,
		   __ETHTOOL_LINK_MODE_MASK_NBITS);
	bitmap_andnot(supported, supported, mask,
		      __ETHTOOL_LINK_MODE_MASK_NBITS);

	phylink_clear(mac_supported, Autoneg);
		phylink_clear(mac_supported, 1000baseT_Full);
	bitmap_and(state->advertising, state->advertising, mac_supported,
		   __ETHTOOL_LINK_MODE_MASK_NBITS);
	bitmap_andnot(state->advertising, state->advertising, mask,
@@ -897,16 +895,11 @@ static void stmmac_validate(struct phylink_config *config,
		__func__);

		stmmac_set_speed100(priv->phydev);
	} else {
		bitmap_and(supported, supported, mac_supported,
			   __ETHTOOL_LINK_MODE_MASK_NBITS);
		bitmap_andnot(supported, supported, mask,
			      __ETHTOOL_LINK_MODE_MASK_NBITS);
		bitmap_and(state->advertising, state->advertising,
			   mac_supported,
			   __ETHTOOL_LINK_MODE_MASK_NBITS);
		bitmap_andnot(state->advertising, state->advertising, mask,
			      __ETHTOOL_LINK_MODE_MASK_NBITS);
		/* Validate method will also be called
		 * when we change speed using ethtool.
		 * Add check to avoid multiple calls
		 */
		priv->early_eth_config_set = 1;
	}

}