summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorBruno Thomsen <bruno.thomsen@gmail.com>2020-07-30 21:57:48 +0200
committerDavid S. Miller <davem@davemloft.net>2020-08-03 15:01:02 -0700
commitbb3831294cd50750806f2ce8d73317dc8feeda09 (patch)
treeb1954b61b77d4b8ed1a001a58609941317e9f712 /drivers/net
parent6259e0f5478d7a7e4ff3e38bc739b612b8907246 (diff)
net: mdiobus: add reset-post-delay-us handling
Load new "reset-post-delay-us" value from MDIO properties, and if configured to a greater then zero delay do a flexible sleeping delay after MDIO bus reset deassert. This allows devices to exit reset state before start bus communication. Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/mdio_bus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 5df3782b05b4..0af20faad69d 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -556,6 +556,8 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
gpiod_set_value_cansleep(gpiod, 1);
fsleep(bus->reset_delay_us);
gpiod_set_value_cansleep(gpiod, 0);
+ if (bus->reset_post_delay_us > 0)
+ fsleep(bus->reset_post_delay_us);
}
if (bus->reset) {