]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 13:06:59 +0000 (14:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 13:06:59 +0000 (14:06 +0100)
added patches:
flow_dissector-do-not-dissect-l4-ports-for-fragments.patch
ibmvnic-fix-accelerated-vlan-handling.patch
inet-frags-better-deal-with-smp-races.patch
ip_tunnel-don-t-force-df-when-mtu-is-locked.patch
ipv6-fix-pmtu-updates-for-udp-raw-sockets-in-presence-of-vrf.patch
net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch
sctp-not-allow-to-set-asoc-prsctp_enable-by-sockopt.patch
tg3-add-phy-reset-for-5717-5719-5720-in-change-ring-and-flow-control-paths.patch
usbnet-smsc95xx-disable-carrier-check-while-suspending.patch

queue-4.9/flow_dissector-do-not-dissect-l4-ports-for-fragments.patch [new file with mode: 0644]
queue-4.9/ibmvnic-fix-accelerated-vlan-handling.patch [new file with mode: 0644]
queue-4.9/inet-frags-better-deal-with-smp-races.patch [new file with mode: 0644]
queue-4.9/ip_tunnel-don-t-force-df-when-mtu-is-locked.patch [new file with mode: 0644]
queue-4.9/ipv6-fix-pmtu-updates-for-udp-raw-sockets-in-presence-of-vrf.patch [new file with mode: 0644]
queue-4.9/net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch [new file with mode: 0644]
queue-4.9/sctp-not-allow-to-set-asoc-prsctp_enable-by-sockopt.patch [new file with mode: 0644]
queue-4.9/series [new file with mode: 0644]
queue-4.9/tg3-add-phy-reset-for-5717-5719-5720-in-change-ring-and-flow-control-paths.patch [new file with mode: 0644]
queue-4.9/usbnet-smsc95xx-disable-carrier-check-while-suspending.patch [new file with mode: 0644]

diff --git a/queue-4.9/flow_dissector-do-not-dissect-l4-ports-for-fragments.patch b/queue-4.9/flow_dissector-do-not-dissect-l4-ports-for-fragments.patch
new file mode 100644 (file)
index 0000000..6cad012
--- /dev/null
@@ -0,0 +1,49 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: 배석진 <soukjin.bae@samsung.com>
+Date: Fri, 9 Nov 2018 16:53:06 -0800
+Subject: flow_dissector: do not dissect l4 ports for fragments
+
+From: 배석진 <soukjin.bae@samsung.com>
+
+[ Upstream commit 62230715fd2453b3ba948c9d83cfb3ada9169169 ]
+
+Only first fragment has the sport/dport information,
+not the following ones.
+
+If we want consistent hash for all fragments, we need to
+ignore ports even for first fragment.
+
+This bug is visible for IPv6 traffic, if incoming fragments
+do not have a flow label, since skb_get_hash() will give
+different results for first fragment and following ones.
+
+It is also visible if any routing rule wants dissection
+and sport or dport.
+
+See commit 5e5d6fed3741 ("ipv6: route: dissect flow
+in input path if fib rules need it") for details.
+
+[edumazet] rewrote the changelog completely.
+
+Fixes: 06635a35d13d ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
+Signed-off-by: 배석진 <soukjin.bae@samsung.com>
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/flow_dissector.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/core/flow_dissector.c
++++ b/net/core/flow_dissector.c
+@@ -538,8 +538,8 @@ ip_proto_again:
+               break;
+       }
+-      if (dissector_uses_key(flow_dissector,
+-                             FLOW_DISSECTOR_KEY_PORTS)) {
++      if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_PORTS) &&
++          !(key_control->flags & FLOW_DIS_IS_FRAGMENT)) {
+               key_ports = skb_flow_dissector_target(flow_dissector,
+                                                     FLOW_DISSECTOR_KEY_PORTS,
+                                                     target_container);
diff --git a/queue-4.9/ibmvnic-fix-accelerated-vlan-handling.patch b/queue-4.9/ibmvnic-fix-accelerated-vlan-handling.patch
new file mode 100644 (file)
index 0000000..82e51bc
--- /dev/null
@@ -0,0 +1,29 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
+Date: Wed, 7 Nov 2018 17:50:52 +0100
+Subject: ibmvnic: fix accelerated VLAN handling
+
+From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
+
+[ Upstream commit e84b47941e15e6666afb8ee8b21d1c3fc1a013af ]
+
+Don't request tag insertion when it isn't present in outgoing skb.
+
+Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -786,7 +786,7 @@ static int ibmvnic_xmit(struct sk_buff *
+       tx_crq.v1.sge_len = cpu_to_be32(skb->len);
+       tx_crq.v1.ioba = cpu_to_be64(data_dma_addr);
+-      if (adapter->vlan_header_insertion) {
++      if (adapter->vlan_header_insertion && skb_vlan_tag_present(skb)) {
+               tx_crq.v1.flags2 |= IBMVNIC_TX_VLAN_INSERT;
+               tx_crq.v1.vlan_id = cpu_to_be16(skb->vlan_tci);
+       }
diff --git a/queue-4.9/inet-frags-better-deal-with-smp-races.patch b/queue-4.9/inet-frags-better-deal-with-smp-races.patch
new file mode 100644 (file)
index 0000000..b8e4e20
--- /dev/null
@@ -0,0 +1,84 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Eric Dumazet <edumazet@google.com>
+Date: Thu, 8 Nov 2018 17:34:27 -0800
+Subject: inet: frags: better deal with smp races
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 0d5b9311baf27bb545f187f12ecfd558220c607d ]
+
+Multiple cpus might attempt to insert a new fragment in rhashtable,
+if for example RPS is buggy, as reported by 배석진 in
+https://patchwork.ozlabs.org/patch/994601/
+
+We use rhashtable_lookup_get_insert_key() instead of
+rhashtable_insert_fast() to let cpus losing the race
+free their own inet_frag_queue and use the one that
+was inserted by another cpu.
+
+Fixes: 648700f76b03 ("inet: frags: use rhashtables for reassembly units")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reported-by: 배석진 <soukjin.bae@samsung.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/inet_fragment.c |   28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+--- a/net/ipv4/inet_fragment.c
++++ b/net/ipv4/inet_fragment.c
+@@ -180,21 +180,22 @@ static struct inet_frag_queue *inet_frag
+ }
+ static struct inet_frag_queue *inet_frag_create(struct netns_frags *nf,
+-                                              void *arg)
++                                              void *arg,
++                                              struct inet_frag_queue **prev)
+ {
+       struct inet_frags *f = nf->f;
+       struct inet_frag_queue *q;
+-      int err;
+       q = inet_frag_alloc(nf, f, arg);
+-      if (!q)
++      if (!q) {
++              *prev = ERR_PTR(-ENOMEM);
+               return NULL;
+-
++      }
+       mod_timer(&q->timer, jiffies + nf->timeout);
+-      err = rhashtable_insert_fast(&nf->rhashtable, &q->node,
+-                                   f->rhash_params);
+-      if (err < 0) {
++      *prev = rhashtable_lookup_get_insert_key(&nf->rhashtable, &q->key,
++                                               &q->node, f->rhash_params);
++      if (*prev) {
+               q->flags |= INET_FRAG_COMPLETE;
+               inet_frag_kill(q);
+               inet_frag_destroy(q);
+@@ -207,17 +208,18 @@ EXPORT_SYMBOL(inet_frag_create);
+ /* TODO : call from rcu_read_lock() and no longer use refcount_inc_not_zero() */
+ struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, void *key)
+ {
+-      struct inet_frag_queue *fq;
++      struct inet_frag_queue *fq = NULL, *prev;
+       rcu_read_lock();
+-      fq = rhashtable_lookup(&nf->rhashtable, key, nf->f->rhash_params);
+-      if (fq) {
++      prev = rhashtable_lookup(&nf->rhashtable, key, nf->f->rhash_params);
++      if (!prev)
++              fq = inet_frag_create(nf, key, &prev);
++      if (prev && !IS_ERR(prev)) {
++              fq = prev;
+               if (!atomic_inc_not_zero(&fq->refcnt))
+                       fq = NULL;
+-              rcu_read_unlock();
+-              return fq;
+       }
+       rcu_read_unlock();
+-      return inet_frag_create(nf, key);
++      return fq;
+ }
+ EXPORT_SYMBOL(inet_frag_find);
diff --git a/queue-4.9/ip_tunnel-don-t-force-df-when-mtu-is-locked.patch b/queue-4.9/ip_tunnel-don-t-force-df-when-mtu-is-locked.patch
new file mode 100644 (file)
index 0000000..7dfcc86
--- /dev/null
@@ -0,0 +1,39 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Sabrina Dubroca <sd@queasysnail.net>
+Date: Fri, 16 Nov 2018 16:58:19 +0100
+Subject: ip_tunnel: don't force DF when MTU is locked
+
+From: Sabrina Dubroca <sd@queasysnail.net>
+
+[ Upstream commit 16f7eb2b77b55da816c4e207f3f9440a8cafc00a ]
+
+The various types of tunnels running over IPv4 can ask to set the DF
+bit to do PMTU discovery. However, PMTU discovery is subject to the
+threshold set by the net.ipv4.route.min_pmtu sysctl, and is also
+disabled on routes with "mtu lock". In those cases, we shouldn't set
+the DF bit.
+
+This patch makes setting the DF bit conditional on the route's MTU
+locking state.
+
+This issue seems to be older than git history.
+
+Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
+Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/ip_tunnel_core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/ip_tunnel_core.c
++++ b/net/ipv4/ip_tunnel_core.c
+@@ -80,7 +80,7 @@ void iptunnel_xmit(struct sock *sk, stru
+       iph->version    =       4;
+       iph->ihl        =       sizeof(struct iphdr) >> 2;
+-      iph->frag_off   =       df;
++      iph->frag_off   =       ip_mtu_locked(&rt->dst) ? 0 : df;
+       iph->protocol   =       proto;
+       iph->tos        =       tos;
+       iph->daddr      =       dst;
diff --git a/queue-4.9/ipv6-fix-pmtu-updates-for-udp-raw-sockets-in-presence-of-vrf.patch b/queue-4.9/ipv6-fix-pmtu-updates-for-udp-raw-sockets-in-presence-of-vrf.patch
new file mode 100644 (file)
index 0000000..51fb1d6
--- /dev/null
@@ -0,0 +1,42 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: David Ahern <dsahern@gmail.com>
+Date: Sun, 18 Nov 2018 10:45:30 -0800
+Subject: ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF
+
+From: David Ahern <dsahern@gmail.com>
+
+[ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ]
+
+Preethi reported that PMTU discovery for UDP/raw applications is not
+working in the presence of VRF when the socket is not bound to a device.
+The problem is that ip6_sk_update_pmtu does not consider the L3 domain
+of the skb device if the socket is not bound. Update the function to
+set oif to the L3 master device if relevant.
+
+Fixes: ca254490c8df ("net: Add VRF support to IPv6 stack")
+Reported-by: Preethi Ramachandra <preethir@juniper.net>
+Signed-off-by: David Ahern <dsahern@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/route.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/net/ipv6/route.c
++++ b/net/ipv6/route.c
+@@ -1439,10 +1439,13 @@ EXPORT_SYMBOL_GPL(ip6_update_pmtu);
+ void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu)
+ {
++      int oif = sk->sk_bound_dev_if;
+       struct dst_entry *dst;
+-      ip6_update_pmtu(skb, sock_net(sk), mtu,
+-                      sk->sk_bound_dev_if, sk->sk_mark);
++      if (!oif && skb->dev)
++              oif = l3mdev_master_ifindex(skb->dev);
++
++      ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark);
+       dst = __sk_dst_get(sk);
+       if (!dst || !dst->obsolete ||
diff --git a/queue-4.9/net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch b/queue-4.9/net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch
new file mode 100644 (file)
index 0000000..6901cdd
--- /dev/null
@@ -0,0 +1,47 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Eric Dumazet <edumazet@google.com>
+Date: Sat, 17 Nov 2018 21:57:02 -0800
+Subject: net-gro: reset skb->pkt_type in napi_reuse_skb()
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 33d9a2c72f086cbf1087b2fd2d1a15aa9df14a7f ]
+
+eth_type_trans() assumes initial value for skb->pkt_type
+is PACKET_HOST.
+
+This is indeed the value right after a fresh skb allocation.
+
+However, it is possible that GRO merged a packet with a different
+value (like PACKET_OTHERHOST in case macvlan is used), so
+we need to make sure napi->skb will have pkt_type set back to
+PACKET_HOST.
+
+Otherwise, valid packets might be dropped by the stack because
+their pkt_type is not PACKET_HOST.
+
+napi_reuse_skb() was added in commit 96e93eab2033 ("gro: Add
+internal interfaces for VLAN"), but this bug always has
+been there.
+
+Fixes: 96e93eab2033 ("gro: Add internal interfaces for VLAN")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/dev.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -4756,6 +4756,10 @@ static void napi_reuse_skb(struct napi_s
+       skb->vlan_tci = 0;
+       skb->dev = napi->dev;
+       skb->skb_iif = 0;
++
++      /* eth_type_trans() assumes pkt_type is PACKET_HOST */
++      skb->pkt_type = PACKET_HOST;
++
+       skb->encapsulation = 0;
+       skb_shinfo(skb)->gso_type = 0;
+       skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));
diff --git a/queue-4.9/sctp-not-allow-to-set-asoc-prsctp_enable-by-sockopt.patch b/queue-4.9/sctp-not-allow-to-set-asoc-prsctp_enable-by-sockopt.patch
new file mode 100644 (file)
index 0000000..e8e3229
--- /dev/null
@@ -0,0 +1,74 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Xin Long <lucien.xin@gmail.com>
+Date: Sun, 18 Nov 2018 15:21:53 +0800
+Subject: sctp: not allow to set asoc prsctp_enable by sockopt
+
+From: Xin Long <lucien.xin@gmail.com>
+
+[ Upstream commit cc3ccf26f0649089b3a34a2781977755ea36e72c ]
+
+As rfc7496#section4.5 says about SCTP_PR_SUPPORTED:
+
+   This socket option allows the enabling or disabling of the
+   negotiation of PR-SCTP support for future associations.  For existing
+   associations, it allows one to query whether or not PR-SCTP support
+   was negotiated on a particular association.
+
+It means only sctp sock's prsctp_enable can be set.
+
+Note that for the limitation of SCTP_{CURRENT|ALL}_ASSOC, we will
+add it when introducing SCTP_{FUTURE|CURRENT|ALL}_ASSOC for linux
+sctp in another patchset.
+
+v1->v2:
+  - drop the params.assoc_id check as Neil suggested.
+
+Fixes: 28aa4c26fce2 ("sctp: add SCTP_PR_SUPPORTED on sctp sockopt")
+Reported-by: Ying Xu <yinxu@redhat.com>
+Signed-off-by: Xin Long <lucien.xin@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sctp/socket.c |   26 +++++---------------------
+ 1 file changed, 5 insertions(+), 21 deletions(-)
+
+--- a/net/sctp/socket.c
++++ b/net/sctp/socket.c
+@@ -3732,32 +3732,16 @@ static int sctp_setsockopt_pr_supported(
+                                       unsigned int optlen)
+ {
+       struct sctp_assoc_value params;
+-      struct sctp_association *asoc;
+-      int retval = -EINVAL;
+       if (optlen != sizeof(params))
+-              goto out;
++              return -EINVAL;
+-      if (copy_from_user(&params, optval, optlen)) {
+-              retval = -EFAULT;
+-              goto out;
+-      }
++      if (copy_from_user(&params, optval, optlen))
++              return -EFAULT;
+-      asoc = sctp_id2assoc(sk, params.assoc_id);
+-      if (asoc) {
+-              asoc->prsctp_enable = !!params.assoc_value;
+-      } else if (!params.assoc_id) {
+-              struct sctp_sock *sp = sctp_sk(sk);
++      sctp_sk(sk)->ep->prsctp_enable = !!params.assoc_value;
+-              sp->ep->prsctp_enable = !!params.assoc_value;
+-      } else {
+-              goto out;
+-      }
+-
+-      retval = 0;
+-
+-out:
+-      return retval;
++      return 0;
+ }
+ static int sctp_setsockopt_default_prinfo(struct sock *sk,
diff --git a/queue-4.9/series b/queue-4.9/series
new file mode 100644 (file)
index 0000000..536d4b0
--- /dev/null
@@ -0,0 +1,9 @@
+flow_dissector-do-not-dissect-l4-ports-for-fragments.patch
+ibmvnic-fix-accelerated-vlan-handling.patch
+ip_tunnel-don-t-force-df-when-mtu-is-locked.patch
+net-gro-reset-skb-pkt_type-in-napi_reuse_skb.patch
+sctp-not-allow-to-set-asoc-prsctp_enable-by-sockopt.patch
+tg3-add-phy-reset-for-5717-5719-5720-in-change-ring-and-flow-control-paths.patch
+usbnet-smsc95xx-disable-carrier-check-while-suspending.patch
+inet-frags-better-deal-with-smp-races.patch
+ipv6-fix-pmtu-updates-for-udp-raw-sockets-in-presence-of-vrf.patch
diff --git a/queue-4.9/tg3-add-phy-reset-for-5717-5719-5720-in-change-ring-and-flow-control-paths.patch b/queue-4.9/tg3-add-phy-reset-for-5717-5719-5720-in-change-ring-and-flow-control-paths.patch
new file mode 100644 (file)
index 0000000..301d957
--- /dev/null
@@ -0,0 +1,69 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Siva Reddy Kallam <siva.kallam@broadcom.com>
+Date: Tue, 20 Nov 2018 10:04:04 +0530
+Subject: tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
+
+From: Siva Reddy Kallam <siva.kallam@broadcom.com>
+
+[ Upstream commit 59663e42199c93d1d7314d1446f6782fc4b1eb81 ]
+
+This patch has the fix to avoid PHY lockup with 5717/5719/5720 in change
+ring and flow control paths. This patch solves the RX hang while doing
+continuous ring or flow control parameters with heavy traffic from peer.
+
+Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
+Acked-by: Michael Chan <michael.chan@broadcom.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/broadcom/tg3.c |   18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/tg3.c
++++ b/drivers/net/ethernet/broadcom/tg3.c
+@@ -12389,6 +12389,7 @@ static int tg3_set_ringparam(struct net_
+ {
+       struct tg3 *tp = netdev_priv(dev);
+       int i, irq_sync = 0, err = 0;
++      bool reset_phy = false;
+       if ((ering->rx_pending > tp->rx_std_ring_mask) ||
+           (ering->rx_jumbo_pending > tp->rx_jmb_ring_mask) ||
+@@ -12420,7 +12421,13 @@ static int tg3_set_ringparam(struct net_
+       if (netif_running(dev)) {
+               tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+-              err = tg3_restart_hw(tp, false);
++              /* Reset PHY to avoid PHY lock up */
++              if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
++                  tg3_asic_rev(tp) == ASIC_REV_5719 ||
++                  tg3_asic_rev(tp) == ASIC_REV_5720)
++                      reset_phy = true;
++
++              err = tg3_restart_hw(tp, reset_phy);
+               if (!err)
+                       tg3_netif_start(tp);
+       }
+@@ -12454,6 +12461,7 @@ static int tg3_set_pauseparam(struct net
+ {
+       struct tg3 *tp = netdev_priv(dev);
+       int err = 0;
++      bool reset_phy = false;
+       if (tp->link_config.autoneg == AUTONEG_ENABLE)
+               tg3_warn_mgmt_link_flap(tp);
+@@ -12544,7 +12552,13 @@ static int tg3_set_pauseparam(struct net
+               if (netif_running(dev)) {
+                       tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+-                      err = tg3_restart_hw(tp, false);
++                      /* Reset PHY to avoid PHY lock up */
++                      if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
++                          tg3_asic_rev(tp) == ASIC_REV_5719 ||
++                          tg3_asic_rev(tp) == ASIC_REV_5720)
++                              reset_phy = true;
++
++                      err = tg3_restart_hw(tp, reset_phy);
+                       if (!err)
+                               tg3_netif_start(tp);
+               }
diff --git a/queue-4.9/usbnet-smsc95xx-disable-carrier-check-while-suspending.patch b/queue-4.9/usbnet-smsc95xx-disable-carrier-check-while-suspending.patch
new file mode 100644 (file)
index 0000000..65d6a9c
--- /dev/null
@@ -0,0 +1,46 @@
+From foo@baz Wed Nov 21 13:17:56 CET 2018
+From: Frieder Schrempf <frieder.schrempf@kontron.de>
+Date: Wed, 31 Oct 2018 22:52:19 +0100
+Subject: usbnet: smsc95xx: disable carrier check while suspending
+
+From: Frieder Schrempf <frieder.schrempf@kontron.de>
+
+[ Upstream commit 7b900ead6cc66b2ee873cb042dfba169aa68b56c ]
+
+We need to make sure, that the carrier check polling is disabled
+while suspending. Otherwise we can end up with usbnet_read_cmd()
+being issued when only usbnet_read_cmd_nopm() is allowed. If this
+happens, read operations lock up.
+
+Fixes: d69d169493 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation")
+Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
+Reviewed-by: Raghuram Chary J <RaghuramChary.Jallipalli@microchip.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/usb/smsc95xx.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/net/usb/smsc95xx.c
++++ b/drivers/net/usb/smsc95xx.c
+@@ -1590,6 +1590,8 @@ static int smsc95xx_suspend(struct usb_i
+               return ret;
+       }
++      cancel_delayed_work_sync(&pdata->carrier_check);
++
+       if (pdata->suspend_flags) {
+               netdev_warn(dev->net, "error during last resume\n");
+               pdata->suspend_flags = 0;
+@@ -1832,6 +1834,11 @@ done:
+        */
+       if (ret && PMSG_IS_AUTO(message))
+               usbnet_resume(intf);
++
++      if (ret)
++              schedule_delayed_work(&pdata->carrier_check,
++                                    CARRIER_CHECK_DELAY);
++
+       return ret;
+ }