From 815a6700d29113c0e7288d6972db285ef4e3f5bc Mon Sep 17 00:00:00 2001 From: Jan Sondhauss Date: Wed, 16 Dec 2020 16:14:48 +0100 Subject: [PATCH] dsa: don't enable phydevs during initialization Signed-off-by: Jan Sondhauss --- drivers/net/phy/phy_device.c | 1 - net/dsa/slave.c | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index a42df2c1bd04..6414d2a7dee0 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1547,7 +1547,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, if (err) goto error; - phy_resume(phydev); if (!phydev->is_on_sfp_module) phy_led_triggers_register(phydev); diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 48db91b33390..772402b6d4ed 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2476,6 +2476,7 @@ static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr, { struct dsa_port *dp = dsa_slave_to_port(slave_dev); struct dsa_switch *ds = dp->ds; + int res; slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); if (!slave_dev->phydev) { @@ -2485,7 +2486,10 @@ static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr, slave_dev->phydev->dev_flags |= flags; - return phylink_connect_phy(dp->pl, slave_dev->phydev); + res = phylink_connect_phy(dp->pl, slave_dev->phydev); + phy_suspend(slave_dev->phydev); + + return res; } static int dsa_slave_phy_setup(struct net_device *slave_dev)