From ead765a527718bfb3b1cb6c673aa882b65afd095 Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Wed, 2 Jun 2021 18:27:55 +0300 Subject: [PATCH] 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 --- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.17.1