aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Berger <opendmb@gmail.com>2019-12-17 16:51:12 -0800
committerDavid S. Miller <davem@davemloft.net>2019-12-19 18:11:10 -0800
commit206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7 (patch)
tree94f144879cf11290a7b5fdffa7b3b7df2e262686
parentnet: bcmgenet: Refactor bcmgenet_set_features() (diff)
downloadlinux-dev-206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7.tar.xz
linux-dev-206f54b66cbf6f71e9e86f50f60ffdf7f565c3b7.zip
net: bcmgenet: Utilize bcmgenet_set_features() during resume/open
During driver resume and open, the HW may have lost its context/state, utilize bcmgenet_set_features() to make sure we do restore the correct set of features that were previously configured. Signed-off-by: Doug Berger <opendmb@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 811713e3d230..0e57effd5b19 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2884,6 +2884,11 @@ static int bcmgenet_open(struct net_device *dev)
init_umac(priv);
+ /* Apply features again in case we changed them while interface was
+ * down
+ */
+ bcmgenet_set_features(dev, dev->features);
+
bcmgenet_set_hw_addr(priv, dev->dev_addr);
if (priv->internal_phy) {
@@ -3687,6 +3692,9 @@ static int bcmgenet_resume(struct device *d)
genphy_config_aneg(dev->phydev);
bcmgenet_mii_config(priv->dev, false);
+ /* Restore enabled features */
+ bcmgenet_set_features(dev, dev->features);
+
bcmgenet_set_hw_addr(priv, dev->dev_addr);
if (priv->internal_phy) {