dpaa2-mac: workaround for zero advertising on the MAC
authorIoana Ciornei <ioana.ciornei@nxp.com>
Wed, 2 Jun 2021 15:27:55 +0000 (18:27 +0300)
committerXiaobo Xie <xiaobo.xie@nxp.com>
Thu, 3 Jun 2021 04:13:59 +0000 (06:13 +0200)
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 <ioana.ciornei@nxp.com>
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

index 4ed42f2..09d365a 100644 (file)
@@ -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;