]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.20-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2019 15:02:58 +0000 (16:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2019 15:02:58 +0000 (16:02 +0100)
added patches:
net-phylink-avoid-resolving-link-state-too-early.patch

queue-4.20/net-phylink-avoid-resolving-link-state-too-early.patch [new file with mode: 0644]
queue-4.20/series

diff --git a/queue-4.20/net-phylink-avoid-resolving-link-state-too-early.patch b/queue-4.20/net-phylink-avoid-resolving-link-state-too-early.patch
new file mode 100644 (file)
index 0000000..743a864
--- /dev/null
@@ -0,0 +1,70 @@
+From 87454b6edc1b0143fdb3d9853285477e95af74a4 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Mon, 11 Feb 2019 15:04:24 +0000
+Subject: net: phylink: avoid resolving link state too early
+
+From: Russell King <rmk+kernel@armlinux.org.uk>
+
+commit 87454b6edc1b0143fdb3d9853285477e95af74a4 upstream.
+
+During testing on Armada 388 platforms, it was found with a certain
+module configuration that it was possible to trigger a kernel oops
+during the module load process, caused by the phylink resolver being
+triggered for a currently disabled interface.
+
+This problem was introduced by changing the way the SFP registration
+works, which now can result in the sfp link down notification being
+called during phylink_create().
+
+Fixes: b5bfc21af5cb ("net: sfp: do not probe SFP module before we're attached")
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/phy/phylink.c |   19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -475,6 +475,17 @@ static void phylink_run_resolve(struct p
+               queue_work(system_power_efficient_wq, &pl->resolve);
+ }
++static void phylink_run_resolve_and_disable(struct phylink *pl, int bit)
++{
++      unsigned long state = pl->phylink_disable_state;
++
++      set_bit(bit, &pl->phylink_disable_state);
++      if (state == 0) {
++              queue_work(system_power_efficient_wq, &pl->resolve);
++              flush_work(&pl->resolve);
++      }
++}
++
+ static void phylink_fixed_poll(struct timer_list *t)
+ {
+       struct phylink *pl = container_of(t, struct phylink, link_poll);
+@@ -928,9 +939,7 @@ void phylink_stop(struct phylink *pl)
+       if (pl->link_an_mode == MLO_AN_FIXED && !IS_ERR(pl->link_gpio))
+               del_timer_sync(&pl->link_poll);
+-      set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
+-      queue_work(system_power_efficient_wq, &pl->resolve);
+-      flush_work(&pl->resolve);
++      phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED);
+ }
+ EXPORT_SYMBOL_GPL(phylink_stop);
+@@ -1637,9 +1646,7 @@ static void phylink_sfp_link_down(void *
+       ASSERT_RTNL();
+-      set_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state);
+-      queue_work(system_power_efficient_wq, &pl->resolve);
+-      flush_work(&pl->resolve);
++      phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_LINK);
+ }
+ static void phylink_sfp_link_up(void *upstream)
index cc24dfcd3ca197b0cc9383f603e02954cdad82bb..7dd675d7363a4c1d5fbf2f10f35f1d2850f577cd 100644 (file)
@@ -181,3 +181,4 @@ netfilter-ipv6-don-t-preserve-original-oif-for-loopback-address.patch
 netfilter-nfnetlink_osf-add-missing-fmatch-check.patch
 netfilter-ipt_clusterip-fix-sleep-in-atomic-bug-in-clusterip_config_entry_put.patch
 pinctrl-max77620-use-define-directive-for-max77620_pinconf_param-values.patch
+net-phylink-avoid-resolving-link-state-too-early.patch