From: Ioana Ciornei Date: Wed, 2 Jun 2021 15:27:55 +0000 (+0300) Subject: dpaa2-mac: workaround for zero advertising on the MAC X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~55 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=ead765a527718bfb3b1cb6c673aa882b65afd095;p=linux.git dpaa2-mac: workaround for zero advertising on the MAC It seems there are some circumstances in the latest MC firmware versions where an empty advertising field is returned by the dpmac_get_link_cfg() command. This will eventually lead to the link not going up. Work around this issue by skipping PHY reconfiguration if this happens. Signed-off-by: Ioana Ciornei --- diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index 4ed42f2101ee..09d365a4a122 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -518,6 +518,12 @@ static void dpaa2_mac_ksettings_change(struct dpaa2_mac *priv) return; } + /* There are some circumstances (MC bugs) when the advertising is all + * zeroes. Just skip any configuration if this happens. + */ + if (!link_cfg.advertising) + return; + phylink_ethtool_ksettings_get(priv->phylink, &priv->kset); priv->kset.base.speed = link_cfg.rate;