diff options
author | David Bauer <mail@david-bauer.net> | 2020-02-08 23:36:12 +0100 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2020-02-16 15:36:29 +0100 |
commit | ae35ff576764fb68b84fcac070e5d2b1ccb4966d (patch) | |
tree | f0c8b6f94458c849622d725ad92b1db8e06321cf /target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch | |
parent | 49caf9f98a7798d16da81a5e1dd141763389e509 (diff) | |
download | upstream-ae35ff576764fb68b84fcac070e5d2b1ccb4966d.tar.gz upstream-ae35ff576764fb68b84fcac070e5d2b1ccb4966d.tar.bz2 upstream-ae35ff576764fb68b84fcac070e5d2b1ccb4966d.zip |
ath79: backport phy reset-controller patches
The Siemens WS-AP3610 asserts reset to the ethernet PHY with the
reset-register. Backport the necessary patches to de-assert reset
when probing the PHY.
These patches can be dropped when using kernel 5.4.
Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch')
-rw-r--r-- | target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch b/target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch new file mode 100644 index 0000000000..16e7f20370 --- /dev/null +++ b/target/linux/ath79/patches-4.19/701-mdio-bus-dont-use-managed-reset-controller.patch @@ -0,0 +1,44 @@ +From 32085f25d7b68404055f3525c780142fc72e543f Mon Sep 17 00:00:00 2001 +From: David Bauer <mail@david-bauer.net> +Date: Fri, 22 Nov 2019 22:44:51 +0100 +Subject: [PATCH] mdio_bus: don't use managed reset-controller + +Geert Uytterhoeven reported that using devm_reset_controller_get leads +to a WARNING when probing a reset-controlled PHY. This is because the +device devm_reset_controller_get gets supplied is not actually the +one being probed. + +Acquire an unmanaged reset-control as well as free the reset_control on +unregister to fix this. + +Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> +CC: Andrew Lunn <andrew@lunn.ch> +Signed-off-by: David Bauer <mail@david-bauer.net> +Reviewed-by: Andrew Lunn <andrew@lunn.ch> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + drivers/net/phy/mdio_bus.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -74,8 +74,8 @@ static int mdiobus_register_reset(struct + struct reset_control *reset = NULL; + + if (mdiodev->dev.of_node) +- reset = devm_reset_control_get_exclusive(&mdiodev->dev, +- "phy"); ++ reset = of_reset_control_get_exclusive(mdiodev->dev.of_node, ++ "phy"); + if (PTR_ERR(reset) == -ENOENT || + PTR_ERR(reset) == -ENOTSUPP) + reset = NULL; +@@ -118,6 +118,8 @@ int mdiobus_unregister_device(struct mdi + if (mdiodev->bus->mdio_map[mdiodev->addr] != mdiodev) + return -EINVAL; + ++ reset_control_put(mdiodev->reset_ctrl); ++ + mdiodev->bus->mdio_map[mdiodev->addr] = NULL; + + return 0; |