]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.3-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Nov 2019 13:54:12 +0000 (14:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Nov 2019 13:54:12 +0000 (14:54 +0100)
added patches:
mdio_bus-fix-init-if-config_reset_controller-n.patch

queue-5.3/mdio_bus-fix-init-if-config_reset_controller-n.patch [new file with mode: 0644]
queue-5.3/mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch [deleted file]
queue-5.3/series

diff --git a/queue-5.3/mdio_bus-fix-init-if-config_reset_controller-n.patch b/queue-5.3/mdio_bus-fix-init-if-config_reset_controller-n.patch
new file mode 100644 (file)
index 0000000..642cc50
--- /dev/null
@@ -0,0 +1,52 @@
+From 6e4ff1c94a0477598ddbe4da47530aecdb4f7dff Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue, 19 Nov 2019 12:25:24 +0100
+Subject: mdio_bus: Fix init if CONFIG_RESET_CONTROLLER=n
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+commit 6e4ff1c94a0477598ddbe4da47530aecdb4f7dff upstream.
+
+Commit 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization
+to constant") accidentally changed a check from -ENOTSUPP to -ENOSYS,
+causing failures if reset controller support is not enabled.  E.g. on
+r7s72100/rskrza1:
+
+    sh-eth e8203000.ethernet: MDIO init failed: -524
+    sh-eth: probe of e8203000.ethernet failed with error -524
+
+Seen on r8a7740/armadillo, r7s72100/rskrza1, and r7s9210/rza2mevb.
+
+Fixes: 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Cc: YueHaibing <yuehaibing@huawei.com>
+Cc: David S. Miller <davem@davemloft.net>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Cc: Marek Behún <marek.behun@nic.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/phy/mdio_bus.c |   11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/phy/mdio_bus.c
++++ b/drivers/net/phy/mdio_bus.c
+@@ -68,11 +68,12 @@ static int mdiobus_register_reset(struct
+       if (mdiodev->dev.of_node)
+               reset = devm_reset_control_get_exclusive(&mdiodev->dev,
+                                                        "phy");
+-      if (PTR_ERR(reset) == -ENOENT ||
+-          PTR_ERR(reset) == -ENOTSUPP)
+-              reset = NULL;
+-      else if (IS_ERR(reset))
+-              return PTR_ERR(reset);
++      if (IS_ERR(reset)) {
++              if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOTSUPP)
++                      reset = NULL;
++              else
++                      return PTR_ERR(reset);
++      }
+       mdiodev->reset_ctrl = reset;
diff --git a/queue-5.3/mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch b/queue-5.3/mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch
deleted file mode 100644 (file)
index 9674c4e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-From foo@baz Mon 25 Nov 2019 02:27:19 PM CET
-From: "Marek Behún" <marek.behun@nic.cz>
-Date: Mon, 18 Nov 2019 19:15:05 +0100
-Subject: mdio_bus: fix mdio_register_device when RESET_CONTROLLER is disabled
-
-From: "Marek Behún" <marek.behun@nic.cz>
-
-[ Upstream commit 075e238d12c21c8bde700d21fb48be7a3aa80194 ]
-
-When CONFIG_RESET_CONTROLLER is disabled, the
-devm_reset_control_get_exclusive function returns -ENOTSUPP. This is not
-handled in subsequent check and then the mdio device fails to probe.
-
-When CONFIG_RESET_CONTROLLER is enabled, its code checks in OF for reset
-device, and since it is not present, returns -ENOENT. -ENOENT is handled.
-Add -ENOTSUPP also.
-
-This happened to me when upgrading kernel on Turris Omnia. You either
-have to enable CONFIG_RESET_CONTROLLER or use this patch.
-
-Signed-off-by: Marek Behún <marek.behun@nic.cz>
-Fixes: 71dd6c0dff51b ("net: phy: add support for reset-controller")
-Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Cc: Andrew Lunn <andrew@lunn.ch>
-Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-Reviewed-by: Andrew Lunn <andrew@lunn.ch>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/net/phy/mdio_bus.c |   11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -68,11 +68,12 @@ static int mdiobus_register_reset(struct
-       if (mdiodev->dev.of_node)
-               reset = devm_reset_control_get_exclusive(&mdiodev->dev,
-                                                        "phy");
--      if (PTR_ERR(reset) == -ENOENT ||
--          PTR_ERR(reset) == -ENOTSUPP)
--              reset = NULL;
--      else if (IS_ERR(reset))
--              return PTR_ERR(reset);
-+      if (IS_ERR(reset)) {
-+              if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOTSUPP)
-+                      reset = NULL;
-+              else
-+                      return PTR_ERR(reset);
-+      }
-       mdiodev->reset_ctrl = reset;
index 93c69524d0e40e67213e47ff20ee00e3262518b5..f39c4fe5f2e5f853849e3ab158ff918a2b91375d 100644 (file)
@@ -10,7 +10,6 @@ net-mlx5e-fix-set-vf-link-state-error-flow.patch
 net-mlx5-fix-auto-group-size-calculation.patch
 net-tls-enable-sk_msg-redirect-to-tls-socket-egress.patch
 ipv6-route-return-if-there-is-no-fib_nh_gw_family.patch
-mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch
 taprio-don-t-reject-same-mqprio-settings.patch
 net-ipv4-fix-sysctl-max-for-fib_multipath_hash_policy.patch
 net-mlx5e-fix-error-flow-cleanup-in-mlx5e_tc_tun_create_header_ipv4-6.patch
@@ -42,3 +41,4 @@ ath9k_hw-fix-uninitialized-variable-data.patch
 revert-bluetooth-hci_ll-set-operational-frequency-earlier.patch
 revert-dm-crypt-use-wq_highpri-for-the-io-and-crypt-workqueues.patch
 md-raid10-prevent-access-of-uninitialized-resync_pages-offset.patch
+mdio_bus-fix-init-if-config_reset_controller-n.patch