Commit ea977d19 authored by Andrea Merello's avatar Andrea Merello Committed by David S. Miller
Browse files

net: phy: allow for reset line to be tied to a sleepy GPIO controller

mdio_device_reset() makes use of the atomic-pretending API flavor for
handling the PHY reset GPIO line.

I found no hint that mdio_device_reset() is called from atomic context
and indeed it uses usleep_range() since long time, so I would assume that
it is OK to sleep there.

This patch switch to gpiod_set_value_cansleep() in mdio_device_reset().
This is relevant if e.g. the PHY reset line is tied to a I2C GPIO

This has been tested on a ZynqMP board running an upstream 4.19 kernel and
then hand-ported on current kernel tree.
Signed-off-by: default avatarAndrea Merello <>
Reviewed-by: default avatarAndrew Lunn <>
Signed-off-by: default avatarDavid S. Miller <>
parent b406472b
......@@ -121,7 +121,7 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)
if (mdiodev->reset_gpio)
gpiod_set_value(mdiodev->reset_gpio, value);
gpiod_set_value_cansleep(mdiodev->reset_gpio, value);
if (mdiodev->reset_ctrl) {
if (value)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment