diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-05-11 11:24:16 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-11 23:06:18 -0400 |
commit | df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 (patch) | |
tree | c1bd0626eb82ad413cb88be179fae52ebb3abaa5 | |
parent | 6832a333ed4a7cc4fcb170c045d1d96d0976fdd4 (diff) | |
download | op-kernel-dev-df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3.zip op-kernel-dev-df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3.tar.gz |
net: phy: Call bus->reset() after releasing PHYs from reset
The API convention makes it that a given MDIO bus reset should be able
to access PHY devices in its reset() callback and perform additional
MDIO accesses in order to bring the bus and PHYs in a working state.
Commit 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that
contract by first calling bus->reset() and then release all PHYs from
reset using their shared GPIO line, so restore the expected
functionality here.
Fixes: 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index a898e5c..8e73f5f 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -364,9 +364,6 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) mutex_init(&bus->mdio_lock); - if (bus->reset) - bus->reset(bus); - /* de-assert bus level PHY GPIO resets */ if (bus->num_reset_gpios > 0) { bus->reset_gpiod = devm_kcalloc(&bus->dev, @@ -396,6 +393,9 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) } } + if (bus->reset) + bus->reset(bus); + for (i = 0; i < PHY_MAX_ADDR; i++) { if ((bus->phy_mask & (1 << i)) == 0) { struct phy_device *phydev; |