From: Greg Kroah-Hartman Date: Tue, 26 Nov 2019 13:54:12 +0000 (+0100) Subject: 5.3-stable patches X-Git-Tag: v4.4.204~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04f057acb8755109be0eb24c55b770b6f5697a7f;p=thirdparty%2Fkernel%2Fstable-queue.git 5.3-stable patches added patches: mdio_bus-fix-init-if-config_reset_controller-n.patch --- 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 index 00000000000..642cc505e3e --- /dev/null +++ b/queue-5.3/mdio_bus-fix-init-if-config_reset_controller-n.patch @@ -0,0 +1,52 @@ +From 6e4ff1c94a0477598ddbe4da47530aecdb4f7dff Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Tue, 19 Nov 2019 12:25:24 +0100 +Subject: mdio_bus: Fix init if CONFIG_RESET_CONTROLLER=n + +From: Geert Uytterhoeven + +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 +Cc: YueHaibing +Cc: David S. Miller +Signed-off-by: Linus Torvalds +Signed-off-by: David S. Miller +Cc: Marek Behún +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 9674c4e97b7..00000000000 --- a/queue-5.3/mdio_bus-fix-mdio_register_device-when-reset_controller-is-disabled.patch +++ /dev/null @@ -1,52 +0,0 @@ -From foo@baz Mon 25 Nov 2019 02:27:19 PM CET -From: "Marek Behún" -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" - -[ 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 -Fixes: 71dd6c0dff51b ("net: phy: add support for reset-controller") -Cc: Dmitry Torokhov -Cc: Andrew Lunn -Cc: Andy Shevchenko -Reviewed-by: Andrew Lunn -Signed-off-by: David S. Miller -Signed-off-by: Greg Kroah-Hartman ---- - 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/series b/queue-5.3/series index 93c69524d0e..f39c4fe5f2e 100644 --- a/queue-5.3/series +++ b/queue-5.3/series @@ -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