4.4.15-stable review
Greg Kroah-Hartman
maintainercover 4.4.15-stable review
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.4.15-rc1
Steinar H. Gunderson <[email protected]>
usb: dwc3: exynos: Fix deferred probing storm.
Thierry Reding <[email protected]>
usb: host: ehci-tegra: Grab the correct UTMI pads reset
Bin Liu <[email protected]>
usb: gadget: fix spinlock dead lock in gadgetfs
Sudip Mukherjee <[email protected]>
USB: mos7720: delete parport
Mathias Nyman <[email protected]>
xhci: Fix handling timeouted commands on hosts in weird states.
Hans de Goede <[email protected]>
USB: xhci: Add broken streams quirk for Frescologic device id 1009
Thomas Petazzoni <[email protected]>
usb: xhci-plat: properly handle probe deferral for devm_clk_get()
Gabriel Krisman Bertazi <[email protected]>
xhci: Cleanup only when releasing primary hcd
Bin Liu <[email protected]>
usb: musb: host: correct cppi dma channel for isoch transfer
Andrew Goodbody <[email protected]>
usb: musb: Ensure rx reinit occurs for shared_fifo endpoints
Andrew Goodbody <[email protected]>
usb: musb: Stop bulk endpoint while queue is rotated
Bin Liu <[email protected]>
usb: musb: only restore devctl when session was set in backup
Hans de Goede <[email protected]>
usb: quirks: Add no-lpm quirk for Acer C120 LED Projector
Hans de Goede <[email protected]>
usb: quirks: Fix sorting
Hans de Goede <[email protected]>
USB: uas: Fix slave queue_depth not being set
Mathias Krause <[email protected]>
crypto: user - re-add size check for CRYPTO_MSG_GETALG
Linus Walleij <[email protected]>
crypto: ux500 - memmove the right size
Anton Blanchard <[email protected]>
crypto: vmx - Increase priority of aes-cbc cipher
Basil Gunn <[email protected]>
AX.25: Close socket connection on session completion
Daniel Borkmann <[email protected]>
bpf: try harder on clones when writing into skb
Feng Tang <[email protected]>
net: alx: Work around the DMA RX overflow issue
Nicolas Ferre <[email protected]>
net: macb: fix default configuration for GMAC on AT91
David Barroso <[email protected]>
neigh: Explicitly declare RCU-bh read side critical section in neigh_xmit()
Daniel Borkmann <[email protected]>
bpf, perf: delay release of BPF prog after grace period
Willem de Bruijn <[email protected]>
sock_diag: do not broadcast raw socket destruction
daniel <[email protected]>
Bridge: Fix ipv6 mc snooping if bridge has no ipv6 address
Tom Goff <[email protected]>
ipmr/ip6mr: Initialize the last assert time of mfc entries.
Eric Dumazet <[email protected]>
netem: fix a use after free
Herbert Xu <[email protected]>
esp: Fix ESN generation under UDP encapsulation
Simon Horman <[email protected]>
sit: correct IP protocol used in ipip6_err
Jason A. Donenfeld <[email protected]>
net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG
Eric Dumazet <[email protected]>
net_sched: fix pfifo_head_drop behavior vs backlog
-------------
Diffstat:
Makefile | 4 +-- crypto/crypto_user.c | 1 + drivers/crypto/ux500/hash/hash_core.c | 4 +-- drivers/crypto/vmx/aes_cbc.c | 2 +- drivers/crypto/vmx/aes_ctr.c | 2 +- drivers/net/ethernet/atheros/alx/main.c | 7 ++++- drivers/net/ethernet/cadence/macb.c | 13 +++++---- drivers/net/ethernet/cadence/macb.h | 2 +- drivers/usb/core/quirks.c | 23 ++++++++------- drivers/usb/dwc3/dwc3-exynos.c | 19 +++++++----- drivers/usb/gadget/legacy/inode.c | 17 ++++++++--- drivers/usb/host/ehci-tegra.c | 2 +- drivers/usb/host/xhci-pci.c | 5 ++++ drivers/usb/host/xhci-plat.c | 3 ++ drivers/usb/host/xhci-ring.c | 30 +++++++++++++++---- drivers/usb/host/xhci.c | 27 +++++++++-------- drivers/usb/musb/musb_core.c | 3 +- drivers/usb/musb/musb_host.c | 23 +++++++++------ drivers/usb/serial/mos7720.c | 1 + drivers/usb/storage/uas.c | 1 + include/linux/bpf.h | 4 +++ include/linux/net.h | 3 +- include/linux/skbuff.h | 7 +++++ include/linux/sock_diag.h | 6 ++++ kernel/events/core.c | 2 +- net/ax25/af_ax25.c | 3 +- net/ax25/ax25_ds_timer.c | 5 +++- net/ax25/ax25_std_timer.c | 5 +++- net/ax25/ax25_subr.c | 3 +- net/bridge/br_multicast.c | 4 +++ net/bridge/br_private.h | 23 ++++++++++++--- net/core/filter.c | 18 +++++++----- net/core/neighbour.c | 6 +++- net/ipv4/esp4.c | 52 ++++++++++++++++++++------------- net/ipv4/ipmr.c | 4 ++- net/ipv6/ip6mr.c | 1 + net/ipv6/sit.c | 4 +-- net/sched/act_csum.c | 8 ++--- net/sched/act_nat.c | 18 ++++-------- net/sched/sch_fifo.c | 4 +++ net/sched/sch_netem.c | 12 ++++---- 41 files changed, 249 insertions(+), 132 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/32 net_sched: fix pfifo_head_drop behavior vs backlog
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 6c0d54f1897d229748d4f41ef919078db6db2123 ]
When the qdisc is full, we drop a packet at the head of the queue, queue the current skb and return NET_XMIT_CN
Now we track backlog on upper qdiscs, we need to call qdisc_tree_reduce_backlog(), even if the qlen did not change.
--- net/sched/sch_fifo.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_fifo.c +4 -0
@@ -37,14 +37,18 @@ static int pfifo_enqueue(struct sk_buffstatic int pfifo_tail_enqueue (struct sk_buff *skb,struct Qdisc *sch) { +unsigned int prev_backlog; +if (likely (skb_queue_len (&sch->q) < sch->limit))return qdisc_enqueue_tail (skb, sch); + prev_backlog = sch->qstats.backlog;/* queue full, remove one skb to fulfill the limit */ __qdisc_queue_drop_head (sch, &sch->q);qdisc_qstats_drop (sch);qdisc_enqueue_tail (skb, sch); +qdisc_tree_reduce_backlog (sch,0 , prev_backlog - sch->qstats.backlog);return NET_XMIT_CN ; }
Greg Kroah-Hartman
maintainerPATCH 2/32 net: Dont forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Jason A. Donenfeld" <[email protected]>
[ Upstream commit daddef76c3deaaa7922f9d7b18edbf0a061215c3 ]
The implementation of net_dbg_ratelimited in the CONFIG_DYNAMIC_DEBUG case was added with 2c94b5373 ("net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case"). The implementation strategy was to take the usual definition of the dynamic_pr_debug macro, but alter it by adding a call to "net_ratelimit()" in the if statement. This is, in fact, the correct approach.
However, while doing this, the author of the commit forgot to surround fmt by pr_fmt, resulting in unprefixed log messages appearing in the console. So, this commit adds back the pr_fmt(fmt) invocation, making net_dbg_ratelimited properly consistent across DEBUG, no DEBUG, and DYNAMIC_DEBUG cases, and bringing parity with the behavior of dynamic_pr_debug as well.
--- include/linux/net.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/net.h +2 -1
@@ -251,7 +251,8 @@ do { \DEFINE_DYNAMIC_DEBUG_METADATA (descriptor, fmt); \if (unlikely (descriptor.flags & _DPRINTK_FLAGS_PRINT) && \net_ratelimit ()) \ - __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \ +__dynamic_pr_debug (&descriptor,pr_fmt (fmt), \ + ##__VA_ARGS__); \ } while (0)#elif defined(DEBUG )#define net_dbg_ratelimited (fmt, ...) \
Greg Kroah-Hartman
maintainerPATCH 3/32 sit: correct IP protocol used in ipip6_err
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
[ Upstream commit d5d8760b78d0cfafe292f965f599988138b06a70 ]
Since 32b8a8e59c9c ("sit: add IPv4 over IPv4 support") ipip6_err() may be called for packets whose IP protocol is IPPROTO_IPIP as well as those whose IP protocol is IPPROTO_IPV6.
In the case of IPPROTO_IPIP packets the correct protocol value is not passed to ipv4_update_pmtu() or ipv4_redirect().
This patch resolves this problem by using the IP protocol of the packet rather than a hard-coded value. This appears to be consistent with the usage of the protocol of a packet by icmp_socket_deliver() the caller of ipip6_err().
I was able to exercise the redirect case by using a setup where an ICMP redirect was received for the destination of the encapsulated packet. However, it appears that although incorrect the protocol field is not used in this case and thus no problem manifests. On inspection it does not appear that a problem will manifest in the fragmentation needed/update pmtu case either.
In short I believe this is a cosmetic fix. None the less, the use of IPPROTO_IPV6 seems wrong and confusing.
--- net/ipv6/sit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/sit.c +2 -2
@@ -560,13 +560,13 @@ static int ipip6_err(struct sk_buff *skbif (type ==ICMP_DEST_UNREACH && code ==ICMP_FRAG_NEEDED ) {ipv4_update_pmtu (skb,dev_net (skb->dev), info, - t->parms.link,0 ,IPPROTO_IPV6 ,0 ); + t->parms.link,0 , iph->protocol,0 ); err =0 ; goto out; }if (type ==ICMP_REDIRECT ) {ipv4_redirect (skb,dev_net (skb->dev), t->parms.link,0 , -IPPROTO_IPV6 ,0 ); + iph->protocol,0 ); err =0 ; goto out; }
Greg Kroah-Hartman
maintainerPATCH 4/32 esp: Fix ESN generation under UDP encapsulation
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 962fcef33b03395051367181a0549d29d109d9a4 ]
Blair Steven noticed that ESN in conjunction with UDP encapsulation is broken because we set the temporary ESP header to the wrong spot.
This patch fixes this by first of all using the right spot, i.e., 4 bytes off the real ESP header, and then saving this information so that after encryption we can restore it properly.
--- net/ipv4/esp4.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-)
net/ipv4/esp4.c +32 -20
@@ -23,6 +23,11 @@ struct esp_skb_cb {void *tmp; }; +struct esp_output_extra { +__be32 seqhi; +u32 esphoff; +}; +#define ESP_SKB_CB (__skb) ((struct esp_skb_cb *)&((__skb)->cb[0]))static u32 esp4_get_mtu (struct xfrm_state *x,int mtu);
@@ -35,11 +40,11 @@ static u32 esp4_get_mtu(struct xfrm_stat* * TODO: Use spare space in skb for this where possible. */ -static void *esp_alloc_tmp (struct crypto_aead *aead,int nfrags,int seqhilen) +static void *esp_alloc_tmp (struct crypto_aead *aead,int nfrags,int extralen) {unsigned int len; - len = seqhilen; + len = extralen; len +=crypto_aead_ivsize (aead);
@@ -57,15 +62,16 @@ static void *esp_alloc_tmp(struct cryptoreturn kmalloc (len,GFP_ATOMIC ); } -static inline __be32 *esp_tmp_seqhi (void *tmp) +static inline void *esp_tmp_extra (void *tmp) { -return PTR_ALIGN ((__be32 *)tmp, __alignof__(__be32 )); +return PTR_ALIGN (tmp, __alignof__(struct esp_output_extra )); } -static inline u8 *esp_tmp_iv (struct crypto_aead *aead,void *tmp,int seqhilen) + +static inline u8 *esp_tmp_iv (struct crypto_aead *aead,void *tmp,int extralen) {return crypto_aead_ivsize (aead) ? -PTR_ALIGN ((u8 *)tmp + seqhilen, -crypto_aead_alignmask (aead) +1 ) : tmp + seqhilen; +PTR_ALIGN ((u8 *)tmp + extralen, +crypto_aead_alignmask (aead) +1 ) : tmp + extralen; }static inline struct aead_request *esp_tmp_req (struct crypto_aead *aead,u8 *iv)
@@ -99,7 +105,7 @@ static void esp_restore_header(struct sk {struct ip_esp_hdr *esph = (void *)(skb->data + offset);void *tmp =ESP_SKB_CB (skb)->tmp; -__be32 *seqhi =esp_tmp_seqhi (tmp); +__be32 *seqhi =esp_tmp_extra (tmp); esph->seq_no = esph->spi; esph->spi = *seqhi;
@@ -107,7 +113,11 @@ static void esp_restore_header(struct skstatic void esp_output_restore_header (struct sk_buff *skb) { -esp_restore_header (skb,skb_transport_offset (skb) -sizeof (__be32)); +void *tmp =ESP_SKB_CB (skb)->tmp; +struct esp_output_extra *extra =esp_tmp_extra (tmp); + +esp_restore_header (skb,skb_transport_offset (skb) + extra->esphoff - +sizeof (__be32)); }static void esp_output_done_esn (struct crypto_async_request *base,int err)
@@ -121,6 +131,7 @@ static void esp_output_done_esn(struct cstatic int esp_output (struct xfrm_state *x,struct sk_buff *skb) {int err; +struct esp_output_extra *extra;struct ip_esp_hdr *esph;struct crypto_aead *aead;struct aead_request *req;
@@ -137,8 +148,7 @@ static int esp_output(struct xfrm_stateint tfclen;int nfrags;int assoclen; -int seqhilen; -__be32 *seqhi; +int extralen;__be64 seqno;/* skb is pure payload to encrypt */
@@ -166,21 +176,21 @@ static int esp_output(struct xfrm_state nfrags = err; assoclen =sizeof (*esph); - seqhilen =0 ; + extralen =0 ;if (x->props.flags &XFRM_STATE_ESN ) { - seqhilen +=sizeof (__be32); - assoclen += seqhilen; + extralen +=sizeof (*extra); + assoclen +=sizeof (__be32); } - tmp =esp_alloc_tmp (aead, nfrags, seqhilen); + tmp =esp_alloc_tmp (aead, nfrags, extralen);if (!tmp) { err = -ENOMEM ; goto error; } - seqhi =esp_tmp_seqhi (tmp); - iv =esp_tmp_iv (aead, tmp, seqhilen); + extra =esp_tmp_extra (tmp); + iv =esp_tmp_iv (aead, tmp, extralen); req =esp_tmp_req (aead, iv); sg =esp_req_sg (aead, req);
@@ -247,8 +257,10 @@ static int esp_output(struct xfrm_state* encryption. */ if ((x->props.flags &XFRM_STATE_ESN )) { - esph = (void *)(skb_transport_header (skb) -sizeof (__be32)); - *seqhi = esph->spi; + extra->esphoff = (unsigned char *)esph - +skb_transport_header (skb); + esph = (struct ip_esp_hdr *)((unsigned char *)esph -4 ); + extra->seqhi = esph->spi; esph->seq_no =htonl (XFRM_SKB_CB (skb)->seq.output.hi);aead_request_set_callback (req,0 , esp_output_done_esn, skb); }
@@ -445,7 +457,7 @@ static int esp_input(struct xfrm_state * goto out;ESP_SKB_CB (skb)->tmp = tmp; - seqhi =esp_tmp_seqhi (tmp); + seqhi =esp_tmp_extra (tmp); iv =esp_tmp_iv (aead, tmp, seqhilen); req =esp_tmp_req (aead, iv); sg =esp_req_sg (aead, req);
Greg Kroah-Hartman
maintainerPATCH 5/32 netem: fix a use after free
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 21de12ee5568fd1aec47890c72967abf791ac80a ]
If the packet was dropped by lower qdisc, then we must not access it later.
Save qdisc_pkt_len(skb) in a temp variable.
--- net/sched/sch_netem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/sched/sch_netem.c +6 -6
@@ -650,14 +650,14 @@ deliver:#endif if (q->qdisc) { +unsigned int pkt_len =qdisc_pkt_len (skb);int err =qdisc_enqueue (skb, q->qdisc); -if (unlikely (err !=NET_XMIT_SUCCESS )) { -if (net_xmit_drop_count (err)) { -qdisc_qstats_drop (sch); -qdisc_tree_reduce_backlog (sch,1 , -qdisc_pkt_len (skb)); - } +if (err !=NET_XMIT_SUCCESS && +net_xmit_drop_count (err)) { +qdisc_qstats_drop (sch); +qdisc_tree_reduce_backlog (sch,1 , + pkt_len); } goto tfifo_dequeue; }
Greg Kroah-Hartman
maintainerPATCH 6/32 ipmr/ip6mr: Initialize the last assert time of mfc entries.
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Goff <[email protected]>
[ Upstream commit 70a0dec45174c976c64b4c8c1d0898581f759948 ]
This fixes wrong-interface signaling on 32-bit platforms for entries created when jiffies > 2^31 + MFC_ASSERT_THRESH.
--- net/ipv4/ipmr.c | 4 +++- net/ipv6/ip6mr.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
net/ipv4/ipmr.c +3 -1
@@ -882,8 +882,10 @@ static struct mfc_cache *ipmr_cache_allo {struct mfc_cache *c =kmem_cache_zalloc (mrt_cachep,GFP_KERNEL ); -if (c) +if (c) { + c->mfc_un.res.last_assert = jiffies -MFC_ASSERT_THRESH -1 ; c->mfc_un.res.minvif =MAXVIFS ; + }return c; }
net/ipv6/ip6mr.c +1 -0
@@ -1074,6 +1074,7 @@ static struct mfc6_cache *ip6mr_cache_alstruct mfc6_cache *c =kmem_cache_zalloc (mrt_cachep,GFP_KERNEL );if (!c)return NULL ; + c->mfc_un.res.last_assert = jiffies -MFC_ASSERT_THRESH -1 ; c->mfc_un.res.minvif =MAXMIFS ;return c; }
Greg Kroah-Hartman
maintainerPATCH 8/32 sock_diag: do not broadcast raw socket destruction
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit 9a0fee2b552b1235fb1706ae1fc664ae74573be8 ]
Diag intends to broadcast tcp_sk and udp_sk socket destruction. Testing sk->sk_protocol for IPPROTO_TCP/IPPROTO_UDP alone is not sufficient for this. Raw sockets can have the same type.
Add a test for sk->sk_type.
--- include/linux/sock_diag.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/sock_diag.h +6 -0
@@ -35,6 +35,9 @@ enum sknetlink_groups sock_diag_destroy_ {switch (sk->sk_family) {case AF_INET : +if (sk->sk_type ==SOCK_RAW ) +return SKNLGRP_NONE ; +switch (sk->sk_protocol) {case IPPROTO_TCP :return SKNLGRP_INET_TCP_DESTROY ;
@@ -44,6 +47,9 @@ enum sknetlink_groups sock_diag_destroy_return SKNLGRP_NONE ; }case AF_INET6 : +if (sk->sk_type ==SOCK_RAW ) +return SKNLGRP_NONE ; +switch (sk->sk_protocol) {case IPPROTO_TCP :return SKNLGRP_INET6_TCP_DESTROY ;
Greg Kroah-Hartman
maintainerPATCH 9/32 bpf, perf: delay release of BPF prog after grace period
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit ceb56070359b7329b5678b5d95a376fcb24767be ]
Commit dead9f29ddcc ("perf: Fix race in BPF program unregister") moved destruction of BPF program from free_event_rcu() callback to __free_event(), which is problematic if used with tail calls: if prog A is attached as trace event directly, but at the same time present in a tail call map used by another trace event program elsewhere, then we need to delay destruction via RCU grace period since it can still be in use by the program doing the tail call (the prog first needs to be dropped from the tail call map, then trace event with prog A attached destroyed, so we get immediate destruction).
--- include/linux/bpf.h | 4 ++++ kernel/events/core.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
include/linux/bpf.h +4 -0
@@ -198,6 +198,10 @@ static inline struct bpf_prog *bpf_prog_static inline void bpf_prog_put (struct bpf_prog *prog) { } + +static inline void bpf_prog_put_rcu (struct bpf_prog *prog) +{ +}#endif /* CONFIG_BPF_SYSCALL */ /* verifier prototypes for helper functions called from eBPF programs */
kernel/events/core.c +1 -1
@@ -7101,7 +7101,7 @@ static void perf_event_free_bpf_prog(str prog = event->tp_event->prog;if (prog) { event->tp_event->prog =NULL ; -bpf_prog_put (prog); +bpf_prog_put_rcu (prog); } }
Greg Kroah-Hartman
maintainerPATCH 10/32 neigh: Explicitly declare RCU-bh read side critical section in neigh_xmit()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Barroso <[email protected]>
[ Upstream commit b560f03ddfb072bca65e9440ff0dc4f9b1d1f056 ]
neigh_xmit() expects to be called inside an RCU-bh read side critical section, and while one of its two current callers gets this right, the other one doesn't.
More specifically, neigh_xmit() has two callers, mpls_forward() and mpls_output(), and while both callers call neigh_xmit() under rcu_read_lock(), this provides sufficient protection for neigh_xmit() only in the case of mpls_forward(), as that is always called from softirq context and therefore doesn't need explicit BH protection, while mpls_output() can be called from process context with softirqs enabled.
When mpls_output() is called from process context, with softirqs enabled, we can be preempted by a softirq at any time, and RCU-bh considers the completion of a softirq as signaling the end of any pending read-side critical sections, so if we do get a softirq while we are in the part of neigh_xmit() that expects to be run inside an RCU-bh read side critical section, we can end up with an unexpected RCU grace period running right in the middle of that critical section, making things go boom.
This patch fixes this impedance mismatch in the callee, by making neigh_xmit() always take rcu_read_{,un}lock_bh() around the code that expects to be treated as an RCU-bh read side critical section, as this seems a safer option than fixing it in the callers.
--- net/core/neighbour.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/core/neighbour.c +5 -1
@@ -2467,13 +2467,17 @@ int neigh_xmit(int index, struct net_dev tbl = neigh_tables[index];if (!tbl) goto out; +rcu_read_lock_bh (); neigh =__neigh_lookup_noref (tbl, addr, dev);if (!neigh) neigh =__neigh_create (tbl, addr, dev, false); err =PTR_ERR (neigh); -if (IS_ERR (neigh)) +if (IS_ERR (neigh)) { +rcu_read_unlock_bh (); goto out_kfree_skb; + } err = neigh->output (neigh, skb); +rcu_read_unlock_bh (); }else if (index ==NEIGH_LINK_TABLE ) { err = dev_hard_header(skb, dev, ntohs(skb->protocol),
Greg Kroah-Hartman
maintainerPATCH 11/32 net: macb: fix default configuration for GMAC on AT91
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Ferre <[email protected]>
[ Upstream commit 6bdaa5e9ed39b3b3328f35d218e8ad5a99cfc4d2 ]
On AT91 SoCs, the User Register (USRIO) exposes a switch to configure the "Reduced" or "Traditional" version of the Media Independent Interface (RMII vs. MII or RGMII vs. GMII).
As on the older EMAC version, on GMAC, this switch is set by default to the non-reduced type of interface, so use the existing capability and extend it to GMII as well. We then keep the current logic in the macb_init() function.
The capabilities of sama5d2, sama5d4 and sama5d3 GEM interface are updated in the macb_config structure to be able to properly enable them with a traditional interface (GMII or MII).
--- drivers/net/ethernet/cadence/macb.c | 13 +++++++------ drivers/net/ethernet/cadence/macb.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/ethernet/cadence/macb.c +7 -6
@@ -2405,9 +2405,9 @@ static int macb_init(struct platform_devif (bp->phy_interface ==PHY_INTERFACE_MODE_RGMII ) val =GEM_BIT (RGMII );else if (bp->phy_interface ==PHY_INTERFACE_MODE_RMII && - (bp->caps &MACB_CAPS_USRIO_DEFAULT_IS_MII )) + (bp->caps &MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII )) val =MACB_BIT (RMII ); -else if (!(bp->caps &MACB_CAPS_USRIO_DEFAULT_IS_MII )) +else if (!(bp->caps &MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII )) val =MACB_BIT (MII );if (bp->caps &MACB_CAPS_USRIO_HAS_CLKEN )
@@ -2738,7 +2738,7 @@ static int at91ether_init(struct platfor }static const struct macb_config at91sam9260_config = { - .caps =MACB_CAPS_USRIO_HAS_CLKEN |MACB_CAPS_USRIO_DEFAULT_IS_MII , + .caps =MACB_CAPS_USRIO_HAS_CLKEN |MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII , .clk_init = macb_clk_init, .init = macb_init, };
@@ -2751,21 +2751,22 @@ static const struct macb_config pc302gem };static const struct macb_config sama5d2_config = { - .caps =0 , + .caps =MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII , .dma_burst_length =16 , .clk_init = macb_clk_init, .init = macb_init, };static const struct macb_config sama5d3_config = { - .caps =MACB_CAPS_SG_DISABLED |MACB_CAPS_GIGABIT_MODE_AVAILABLE , + .caps =MACB_CAPS_SG_DISABLED |MACB_CAPS_GIGABIT_MODE_AVAILABLE + |MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII , .dma_burst_length =16 , .clk_init = macb_clk_init, .init = macb_init, };static const struct macb_config sama5d4_config = { - .caps =0 , + .caps =MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII , .dma_burst_length =4 , .clk_init = macb_clk_init, .init = macb_init,
drivers/net/ethernet/cadence/macb.h +1 -1
@@ -398,7 +398,7 @@/* Capability mask bits */ #define MACB_CAPS_ISR_CLEAR_ON_WRITE 0x00000001#define MACB_CAPS_USRIO_HAS_CLKEN 0x00000002 -#define MACB_CAPS_USRIO_DEFAULT_IS_MII 0x00000004 +#define MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII 0x00000004#define MACB_CAPS_NO_GIGABIT_HALF 0x00000008#define MACB_CAPS_FIFO_MODE 0x10000000#define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000
Greg Kroah-Hartman
maintainerPATCH 12/32 net: alx: Work around the DMA RX overflow issue
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Tang <[email protected]>
[ Upstream commit 881d0327db37ad917a367c77aff1afa1ee41e0a9 ]
Note: This is a verified backported patch for stable 4.4 kernel, and it could also be applied to 4.3/4.2/4.1/3.18/3.16
There is a problem with alx devices, that the network link will be lost in 1-5 minutes after the device is up.
Quoted 1 line
Quoted 1 line
From debugging without datasheet, we found the error always
happen when the DMA RX address is set to 0x....fc0, which is very likely to be a HW/silicon problem.
This patch will apply rx skb with 64 bytes longer space, and if the allocated skb has a 0x...fc0 address, it will use skb_resever(skb, 64) to advance the address, so that the RX overflow can be avoided.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761
--- drivers/net/ethernet/atheros/alx/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/atheros/alx/main.c +6 -1
@@ -86,9 +86,14 @@ static int alx_refill_rx_ring(struct alxwhile (!cur_buf->skb && next != rxq->read_idx) {struct alx_rfd *rfd = &rxq->rfd[cur]; - skb =__netdev_alloc_skb (alx->dev, alx->rxbuf_size, gfp); + skb =__netdev_alloc_skb (alx->dev, alx->rxbuf_size +64 , gfp);if (!skb)break ; + +/* Workround for the HW RX DMA overflow issue */ +if (((unsigned long )skb->data &0xfff ) ==0xfc0 ) +skb_reserve (skb,64 ); + dma =dma_map_single (&alx->hw.pdev->dev, skb->data, alx->rxbuf_size,DMA_FROM_DEVICE );
Greg Kroah-Hartman
maintainerPATCH 13/32 bpf: try harder on clones when writing into skb
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 3697649ff29e0f647565eed04b27a7779c646a22 ]
When we're dealing with clones and the area is not writeable, try harder and get a copy via pskb_expand_head(). Replace also other occurences in tc actions with the new skb_try_make_writable().
--- include/linux/skbuff.h | 7 +++++++ net/core/filter.c | 18 ++++++++++-------- net/sched/act_csum.c | 8 ++------ net/sched/act_nat.c | 18 +++++------------- 4 files changed, 24 insertions(+), 27 deletions(-)
include/linux/skbuff.h +7 -0
@@ -2564,6 +2564,13 @@ static inline int skb_clone_writable(conskb_headroom (skb) + len <= skb->hdr_len; } +static inline int skb_try_make_writable (struct sk_buff *skb, +unsigned int write_len) +{ +return skb_cloned (skb) && !skb_clone_writable (skb, write_len) && +pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ); +} +static inline int __skb_cow (struct sk_buff *skb,unsigned int headroom,int cloned) {
net/core/filter.c +10 -8
@@ -1275,9 +1275,7 @@ static u64 bpf_skb_store_bytes(u64 r1, u*/ if (unlikely ((u32 ) offset >0xffff || len >sizeof (buf)))return -EFAULT ; - -if (unlikely (skb_cloned (skb) && - !skb_clone_writable (skb, offset + len))) +if (unlikely (skb_try_make_writable (skb, offset + len)))return -EFAULT ; ptr =skb_header_pointer (skb, offset, len, buf);
@@ -1321,8 +1319,7 @@ static u64 bpf_l3_csum_replace(u64 r1, uif (unlikely ((u32 ) offset >0xffff ))return -EFAULT ; -if (unlikely (skb_cloned (skb) && - !skb_clone_writable (skb, offset +sizeof (sum)))) +if (unlikely (skb_try_make_writable (skb, offset +sizeof (sum))))return -EFAULT ; ptr =skb_header_pointer (skb, offset,sizeof (sum), &sum);
@@ -1367,9 +1364,7 @@ static u64 bpf_l4_csum_replace(u64 r1, uif (unlikely ((u32 ) offset >0xffff ))return -EFAULT ; - -if (unlikely (skb_cloned (skb) && - !skb_clone_writable (skb, offset +sizeof (sum)))) +if (unlikely (skb_try_make_writable (skb, offset +sizeof (sum))))return -EFAULT ; ptr =skb_header_pointer (skb, offset,sizeof (sum), &sum);
@@ -1554,6 +1549,13 @@ bool bpf_helper_changes_skb_data(void *freturn true;if (func == bpf_skb_vlan_pop)return true; +if (func == bpf_skb_store_bytes) +return true; +if (func == bpf_l3_csum_replace) +return true; +if (func == bpf_l4_csum_replace) +return true; +return false; }
net/sched/act_csum.c +2 -6
@@ -105,9 +105,7 @@ static void *tcf_csum_skb_nextlayer(struint hl = ihl + jhl;if (!pskb_may_pull (skb, ipl + ntkoff) || (ipl < hl) || - (skb_cloned (skb) && - !skb_clone_writable (skb, hl + ntkoff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, hl + ntkoff))return NULL ;else return (void *)(skb_network_header (skb) + ihl);
@@ -365,9 +363,7 @@ static int tcf_csum_ipv4(struct sk_buff }if (update_flags &TCA_CSUM_UPDATE_FLAG_IPV4HDR ) { -if (skb_cloned (skb) && - !skb_clone_writable (skb,sizeof (*iph) + ntkoff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb,sizeof (*iph) + ntkoff)) goto fail;ip_send_check (ip_hdr (skb));
net/sched/act_nat.c +5 -13
@@ -126,9 +126,7 @@ static int tcf_nat(struct sk_buff *skb, addr = iph->daddr;if (!((old_addr ^ addr) & mask)) { -if (skb_cloned (skb) && - !skb_clone_writable (skb,sizeof (*iph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb,sizeof (*iph) + noff)) goto drop; new_addr &= mask;
@@ -156,9 +154,7 @@ static int tcf_nat(struct sk_buff *skb,struct tcphdr *tcph;if (!pskb_may_pull (skb, ihl +sizeof (*tcph) + noff) || - (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*tcph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, ihl +sizeof (*tcph) + noff)) goto drop; tcph = (void *)(skb_network_header (skb) + ihl);
@@ -171,9 +167,7 @@ static int tcf_nat(struct sk_buff *skb,struct udphdr *udph;if (!pskb_may_pull (skb, ihl +sizeof (*udph) + noff) || - (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*udph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, ihl +sizeof (*udph) + noff)) goto drop; udph = (void *)(skb_network_header (skb) + ihl);
@@ -213,10 +207,8 @@ static int tcf_nat(struct sk_buff *skb,if ((old_addr ^ addr) & mask)break ; -if (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*icmph) + -sizeof (*iph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb, ihl +sizeof (*icmph) + +sizeof (*iph) + noff)) goto drop; icmph = (void *)(skb_network_header (skb) + ihl);
Greg Kroah-Hartman
maintainerPATCH 14/32 AX.25: Close socket connection on session completion
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Basil Gunn <[email protected]>
[ Upstream commit 4a7d99ea1b27734558feb6833f180cd38a159940 ]
A socket connection made in ax.25 is not closed when session is completed. The heartbeat timer is stopped prematurely and this is where the socket gets closed. Allow heatbeat timer to run to close socket. Symptom occurs in kernels >= 4.2.0
Originally sent 6/15/2016. Resend with distribution list matching scripts/maintainer.pl output.
--- net/ax25/af_ax25.c | 3 ++- net/ax25/ax25_ds_timer.c | 5 ++++- net/ax25/ax25_std_timer.c | 5 ++++- net/ax25/ax25_subr.c | 3 ++- 4 files changed, 12 insertions(+), 4 deletions(-)
net/ax25/af_ax25.c +2 -1
@@ -976,7 +976,8 @@ static int ax25_release(struct socket *srelease_sock (sk);ax25_disconnect (ax25,0 );lock_sock (sk); -ax25_destroy_socket (ax25); +if (!sock_flag (ax25->sk,SOCK_DESTROY )) +ax25_destroy_socket (ax25);break ;case AX25_STATE_3 :
net/ax25/ax25_ds_timer.c +4 -1
@@ -102,6 +102,7 @@ void ax25_ds_heartbeat_expiry(ax25_cb *aswitch (ax25->state) {case AX25_STATE_0 : +case AX25_STATE_2 :/* Magic here: If we listen() and a new link dies before it is accepted() it isn't 'dead' so doesn't get removed. */ if (!sk || sock_flag(sk, SOCK_DESTROY) ||
@@ -111,6 +112,7 @@ void ax25_ds_heartbeat_expiry(ax25_cb *asock_hold (sk);ax25_destroy_socket (ax25);bh_unlock_sock (sk); +/* Ungrab socket and destroy it */ sock_put (sk); }else ax25_destroy_socket (ax25);
@@ -213,7 +215,8 @@ void ax25_ds_t1_timeout(ax25_cb *ax25)case AX25_STATE_2 :if (ax25->n2count == ax25->n2) {ax25_send_control (ax25,AX25_DISC ,AX25_POLLON ,AX25_COMMAND ); -ax25_disconnect (ax25,ETIMEDOUT ); +if (!sock_flag (ax25->sk,SOCK_DESTROY )) +ax25_disconnect (ax25,ETIMEDOUT );return ; }else { ax25->n2count++;
net/ax25/ax25_std_timer.c +4 -1
@@ -38,6 +38,7 @@ void ax25_std_heartbeat_expiry(ax25_cb *switch (ax25->state) {case AX25_STATE_0 : +case AX25_STATE_2 :/* Magic here: If we listen() and a new link dies before it is accepted() it isn't 'dead' so doesn't get removed. */ if (!sk || sock_flag(sk, SOCK_DESTROY) ||
@@ -47,6 +48,7 @@ void ax25_std_heartbeat_expiry(ax25_cb *sock_hold (sk);ax25_destroy_socket (ax25);bh_unlock_sock (sk); +/* Ungrab socket and destroy it */ sock_put (sk); }else ax25_destroy_socket (ax25);
@@ -144,7 +146,8 @@ void ax25_std_t1timer_expiry(ax25_cb *axcase AX25_STATE_2 :if (ax25->n2count == ax25->n2) {ax25_send_control (ax25,AX25_DISC ,AX25_POLLON ,AX25_COMMAND ); -ax25_disconnect (ax25,ETIMEDOUT ); +if (!sock_flag (ax25->sk,SOCK_DESTROY )) +ax25_disconnect (ax25,ETIMEDOUT );return ; }else { ax25->n2count++;
net/ax25/ax25_subr.c +2 -1
@@ -264,7 +264,8 @@ void ax25_disconnect(ax25_cb *ax25, int {ax25_clear_queues (ax25); -ax25_stop_heartbeat (ax25); +if (!sock_flag (ax25->sk,SOCK_DESTROY )) +ax25_stop_heartbeat (ax25);ax25_stop_t1timer (ax25);ax25_stop_t2timer (ax25);ax25_stop_t3timer (ax25);
Greg Kroah-Hartman
maintainerPATCH 15/32 crypto: vmx - Increase priority of aes-cbc cipher
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 12d3f49e1ffbbf8cbbb60acae5a21103c5c841ac upstream.
All of the VMX AES ciphers (AES, AES-CBC and AES-CTR) are set at priority 1000. Unfortunately this means we never use AES-CBC and AES-CTR, because the base AES-CBC cipher that is implemented on top of AES inherits its priority.
To fix this, AES-CBC and AES-CTR have to be a higher priority. Set them to 2000.
Testing on a POWER8 with:
cryptsetup benchmark --cipher aes --key-size 256
Shows decryption speed increase from 402.4 MB/s to 3069.2 MB/s, over 7x faster. Thanks to Mike Strosaker for helping me debug this issue.
--- drivers/crypto/vmx/aes_cbc.c | 2 +- drivers/crypto/vmx/aes_ctr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/vmx/aes_cbc.c +1 -1
@@ -182,7 +182,7 @@ struct crypto_alg p8_aes_cbc_alg = { .cra_name = "cbc(aes)", .cra_driver_name = "p8_aes_cbc", .cra_module = THIS_MODULE, - .cra_priority = 1000, + .cra_priority = 2000, .cra_type = &crypto_blkcipher_type, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER | CRYPTO_ALG_NEED_FALLBACK, .cra_alignmask = 0,
drivers/crypto/vmx/aes_ctr.c +1 -1
@@ -166,7 +166,7 @@ struct crypto_alg p8_aes_ctr_alg = { .cra_name = "ctr(aes)", .cra_driver_name = "p8_aes_ctr", .cra_module = THIS_MODULE, - .cra_priority = 1000, + .cra_priority = 2000, .cra_type = &crypto_blkcipher_type, .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER | CRYPTO_ALG_NEED_FALLBACK, .cra_alignmask = 0,
Greg Kroah-Hartman
maintainerPATCH 16/32 crypto: ux500 - memmove the right size
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 19ced623db2fe91604d69f7d86b03144c5107739 upstream.
The hash buffer is really HASH_BLOCK_SIZE bytes, someone must have thought that memmove takes n*u32 words by mistake. Tests work as good/bad as before after this patch.
--- drivers/crypto/ux500/hash/hash_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/ux500/hash/hash_core.c +2 -2
@@ -797,7 +797,7 @@ static int hash_process_data(struct hash &device_data->state);memmove (req_ctx->state.buffer, device_data->state.buffer, -HASH_BLOCK_SIZE /sizeof (u32)); +HASH_BLOCK_SIZE );if (ret) { dev_err(device_data->dev, "%s: hash_resume_state() failed!\n",
@@ -848,7 +848,7 @@ static int hash_process_data(struct hashmemmove (device_data->state.buffer, req_ctx->state.buffer, -HASH_BLOCK_SIZE /sizeof (u32)); +HASH_BLOCK_SIZE );if (ret) {dev_err (device_data->dev,"%s: hash_save_state() failed!\n" , __func__);
Greg Kroah-Hartman
maintainerPATCH 17/32 crypto: user - re-add size check for CRYPTO_MSG_GETALG
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 055ddaace03580455a7b7dbea8e93d62acee61fc upstream.
Commit 9aa867e46565 ("crypto: user - Add CRYPTO_MSG_DELRNG") accidentally removed the minimum size check for CRYPTO_MSG_GETALG netlink messages. This allows userland to send a truncated CRYPTO_MSG_GETALG message as short as a netlink header only making crypto_report() operate on uninitialized memory by accessing data beyond the end of the netlink message.
Fix this be re-adding the minimum required size of CRYPTO_MSG_GETALG messages to the crypto_msg_min[] array.
--- crypto/crypto_user.c | 1 + 1 file changed, 1 insertion(+)
crypto/crypto_user.c +1 -0
@@ -455,6 +455,7 @@ static const int crypto_msg_min[CRYPTO_N [CRYPTO_MSG_NEWALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg), [CRYPTO_MSG_DELALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg), [CRYPTO_MSG_UPDATEALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg), + [CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg), [CRYPTO_MSG_DELRNG - CRYPTO_MSG_BASE] = 0, };
Greg Kroah-Hartman
maintainerPATCH 18/32 USB: uas: Fix slave queue_depth not being set
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 593224ea77b1ca842f45cf76f4deeef44dfbacd1 upstream.
Commit 198de51dbc34 ("USB: uas: Limit qdepth at the scsi-host level") removed the scsi_change_queue_depth() call from uas_slave_configure() assuming that the slave would inherit the host's queue_depth, which that commit sets to the same value.
This is incorrect, without the scsi_change_queue_depth() call the slave's queue_depth defaults to 1, introducing a performance regression.
This commit restores the call, fixing the performance regression.
--- drivers/usb/storage/uas.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/storage/uas.c +1 -0
@@ -811,6 +811,7 @@ static int uas_slave_configure(struct scif (devinfo->flags &US_FL_BROKEN_FUA ) sdev->broken_fua =1 ; +scsi_change_queue_depth (sdev, devinfo->qdepth -2 );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 19/32 usb: quirks: Fix sorting
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 81099f97bd31e25ff2719a435b1860fc3876122f upstream.
Properly sort all the entries by vendor id.
--- drivers/usb/core/quirks.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/usb/core/quirks.c +10 -10
@@ -44,6 +44,9 @@ static const struct usb_device_id usb_qu/* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, + /* USB3503 */ + { USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Microsoft Wireless Laser Mouse 6000 Receiver */ { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
@@ -173,6 +176,10 @@ static const struct usb_device_id usb_qu/* MAYA44USB sound device */ { USB_DEVICE(0x0a92, 0x0091), .driver_info = USB_QUIRK_RESET_RESUME }, + /* ASUS Base Station(T100) */ + { USB_DEVICE(0x0b05, 0x17e0), .driver_info = + USB_QUIRK_IGNORE_REMOTE_WAKEUP }, + /* Action Semiconductor flash disk */ { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255 },
@@ -188,16 +195,6 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x1908, 0x1315), .driver_info = USB_QUIRK_HONOR_BNUMINTERFACES }, - /* INTEL VALUE SSD */ - { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, - - /* USB3503 */ - { USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME }, - - /* ASUS Base Station(T100) */ - { USB_DEVICE(0x0b05, 0x17e0), .driver_info = - USB_QUIRK_IGNORE_REMOTE_WAKEUP }, - /* Protocol and OTG Electrical Test Device */ { USB_DEVICE(0x1a0a, 0x0200), .driver_info = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
@@ -208,6 +205,9 @@ static const struct usb_device_id usb_qu/* Blackmagic Design UltraStudio SDI */ { USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM }, + /* INTEL VALUE SSD */ + { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, + { }/* terminating entry must be last */ };
Greg Kroah-Hartman
maintainerPATCH 20/32 usb: quirks: Add no-lpm quirk for Acer C120 LED Projector
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 32cb0b37098f4beeff5ad9e325f11b42a6ede56c upstream.
The Acer C120 LED Projector is a USB-3 connected pico projector which takes both its power and video data from USB-3.
In combination with some hubs this device does not play well with lpm, so disable lpm for it.
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -199,6 +199,9 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x1a0a, 0x0200), .driver_info = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + /* Acer C120 LED Projector */ + { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM }, + /* Blackmagic Design Intensity Shuttle */ { USB_DEVICE(0x1edb, 0xbd3b), .driver_info = USB_QUIRK_NO_LPM },
Greg Kroah-Hartman
maintainerPATCH 21/32 usb: musb: only restore devctl when session was set in backup
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bin Liu <[email protected]>
commit 84ac5d1140f716a616522f952734e850448d2556 upstream.
If the session bit was not set in the backup of devctl register, restoring devctl would clear the session bit. Therefor, only restore devctl register when the session bit was set in the backup.
This solves the device enumeration failure in otg mode exposed by commit 56f487c (PM / Runtime: Update last_busy in rpm_resume).
--- drivers/usb/musb/musb_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/musb_core.c +2 -1
@@ -2401,7 +2401,8 @@ static void musb_restore_context(structmusb_writew (musb_base,MUSB_INTRTXE , musb->intrtxe);musb_writew (musb_base,MUSB_INTRRXE , musb->intrrxe);musb_writeb (musb_base,MUSB_INTRUSBE , musb->context.intrusbe); -musb_writeb (musb_base,MUSB_DEVCTL , musb->context.devctl); +if (musb->context.devctl &MUSB_DEVCTL_SESSION ) +musb_writeb (musb_base,MUSB_DEVCTL , musb->context.devctl);for (i =0 ; i < musb->config->num_eps; ++i) {struct musb_hw_ep *hw_ep;
Greg Kroah-Hartman
maintainerPATCH 22/32 usb: musb: Stop bulk endpoint while queue is rotated
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Goodbody <[email protected]>
commit 7b2c17f829545df27a910e8d82e133c21c9a8c9c upstream.
Ensure that the endpoint is stopped by clearing REQPKT before clearing DATAERR_NAKTIMEOUT before rotating the queue on the dedicated bulk endpoint.
This addresses an issue where a race could result in the endpoint receiving data before it was reprogrammed resulting in a warning about such data from musb_rx_reinit before it was thrown away. The data thrown away was a valid packet that had been correctly ACKed which meant the host and device got out of sync.
--- drivers/usb/musb/musb_host.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/usb/musb/musb_host.c +7 -1
@@ -995,9 +995,15 @@ static void musb_bulk_nak_timeout(structif (is_in) { dma =is_dma_capable () ? ep->rx_channel :NULL ; -/* clear nak timeout bit */ +/* +* Need to stop the transaction by clearing REQPKT first +* then the NAK Timeout bit ref MUSBMHDRC USB 2.0 HIGH-SPEED +* DUAL-ROLE CONTROLLER Programmer's Guide, section 9.2.2 +*/ rx_csr =musb_readw (epio,MUSB_RXCSR ); rx_csr |=MUSB_RXCSR_H_WZC_BITS ; + rx_csr &= ~MUSB_RXCSR_H_REQPKT ; +musb_writew (epio,MUSB_RXCSR , rx_csr); rx_csr &= ~MUSB_RXCSR_DATAERROR ;musb_writew (epio,MUSB_RXCSR , rx_csr);
Greg Kroah-Hartman
maintainerPATCH 23/32 usb: musb: Ensure rx reinit occurs for shared_fifo endpoints
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Goodbody <[email protected]>
commit f3eec0cf784e0d6c47822ca6b66df3d5812af7e6 upstream.
shared_fifo endpoints would only get a previous tx state cleared out, the rx state was only cleared for non shared_fifo endpoints Change this so that the rx state is cleared for all endpoints. This addresses an issue that resulted in rx packets being dropped silently.
--- drivers/usb/musb/musb_host.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/usb/musb/musb_host.c +6 -7
@@ -594,14 +594,13 @@ musb_rx_reinit(struct musb *musb, structmusb_writew (ep->regs,MUSB_TXCSR ,0 );/* scrub all previous state, clearing toggle */ - }else { - csr =musb_readw (ep->regs,MUSB_RXCSR ); -if (csr &MUSB_RXCSR_RXPKTRDY ) -WARNING ("rx%d, packet/%d ready?\n" , ep->epnum, -musb_readw (ep->regs,MUSB_RXCOUNT )); - -musb_h_flush_rxfifo (ep,MUSB_RXCSR_CLRDATATOG ); } + csr =musb_readw (ep->regs,MUSB_RXCSR ); +if (csr &MUSB_RXCSR_RXPKTRDY ) +WARNING ("rx%d, packet/%d ready?\n" , ep->epnum, +musb_readw (ep->regs,MUSB_RXCOUNT )); + +musb_h_flush_rxfifo (ep,MUSB_RXCSR_CLRDATATOG );/* target addr and (for multipoint) hub addr/port */ if (musb->is_multipoint) {
Greg Kroah-Hartman
maintainerPATCH 24/32 usb: musb: host: correct cppi dma channel for isoch transfer
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bin Liu <[email protected]>
commit 04471eb8c3158c0ad9df4b24da845a63b2e8f23a upstream.
Incorrect cppi dma channel is referenced in musb_rx_dma_iso_cppi41(), which causes kernel NULL pointer reference oops later when calling cppi41_dma_channel_program().
part1)
--- drivers/usb/musb/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/musb/musb_host.c +1 -1
@@ -1556,7 +1556,7 @@ static int musb_rx_dma_iso_cppi41(struct struct urb *urb, size_t len) { -struct dma_channel *channel = hw_ep->tx_channel; +struct dma_channel *channel = hw_ep->rx_channel;void __iomem *epio = hw_ep->regs;dma_addr_t *buf;u32 length, res;
Greg Kroah-Hartman
maintainerPATCH 25/32 xhci: Cleanup only when releasing primary hcd
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Krisman Bertazi <[email protected]>
commit 27a41a83ec54d0edfcaf079310244e7f013a7701 upstream.
Under stress occasions some TI devices might not return early when reading the status register during the quirk invocation of xhci_irq made by usb_hcd_pci_remove. This means that instead of returning, we end up handling this interruption in the middle of a shutdown. Since xhci->event_ring has already been freed in xhci_mem_cleanup, we end up accessing freed memory, causing the Oops below.
commit 8c24d6d7b09d ("usb: xhci: stop everything on the first call to xhci_stop") is the one that changed the instant in which we clean up the event queue when stopping a device. Before, we didn't call xhci_mem_cleanup at the first time xhci_stop is executed (for the shared HCD), instead, we only did it after the invocation for the primary HCD, much later at the removal path. The code flow for this oops looks like this:
xhci_pci_remove()
usb_remove_hcd(xhci->shared) xhci_stop(xhci->shared) xhci_halt() xhci_mem_cleanup(xhci); // Free the event_queue usb_hcd_pci_remove(primary) xhci_irq() // Access the event_queue if STS_EINT is set. Crash. xhci_stop() xhci_halt() // return early
The fix modifies xhci_stop to only cleanup the xhci data when releasing the primary HCD. This way, we still have the event_queue configured when invoking xhci_irq. We still halt the device on the first call to xhci_stop, though.
I could reproduce this issue several times on the mainline kernel by doing a bind-unbind stress test with a specific storage gadget attached. I also ran the same test over-night with my patch applied and didn't observe the issue anymore.
[ 113.334124] Unable to handle kernel paging request for data at address 0x00000028 [ 113.335514] Faulting instruction address: 0xd00000000d4f767c [ 113.336839] Oops: Kernel access of bad area, sig: 11 [#1] [ 113.338214] SMP NR_CPUS=1024 NUMA PowerNV
[c000000efe47ba90] c000000000720850 usb_hcd_irq+0x50/0x80 [c000000efe47bac0] c00000000073d328 usb_hcd_pci_remove+0x68/0x1f0 [c000000efe47bb00] d00000000daf0128 xhci_pci_remove+0x78/0xb0 [xhci_pci]
[c000000efe47bb30] c00000000055cf70 pci_device_remove+0x70/0x110 [c000000efe47bb70] c00000000061c6bc __device_release_driver+0xbc/0x190 [c000000efe47bba0] c00000000061c7d0 device_release_driver+0x40/0x70 [c000000efe47bbd0] c000000000619510 unbind_store+0x120/0x150 [c000000efe47bc20] c0000000006183c4 drv_attr_store+0x64/0xa0 [c000000efe47bc60] c00000000039f1d0 sysfs_kf_write+0x80/0xb0 [c000000efe47bca0] c00000000039e14c kernfs_fop_write+0x18c/0x1f0 [c000000efe47bcf0] c0000000002e962c __vfs_write+0x6c/0x190 [c000000efe47bd90] c0000000002eab40 vfs_write+0xc0/0x200 [c000000efe47bde0] c0000000002ec85c SyS_write+0x6c/0x110 [c000000efe47be30] c000000000009260 system_call+0x38/0x108
--- drivers/usb/host/xhci-ring.c | 3 ++- drivers/usb/host/xhci.c | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-)
drivers/usb/host/xhci-ring.c +2 -1
@@ -2727,7 +2727,8 @@ hw_died:writel (irq_pending, &xhci->ir_set->irq_pending); } -if (xhci->xhc_state &XHCI_STATE_DYING ) { +if (xhci->xhc_state &XHCI_STATE_DYING || + xhci->xhc_state &XHCI_STATE_HALTED ) {xhci_dbg (xhci,"xHCI dying, ignoring interrupt. " "Shouldn't IRQs be disabled?\n" );/* Clear the event handler busy flag (RW1C);
drivers/usb/host/xhci.c +16 -13
@@ -680,20 +680,23 @@ void xhci_stop(struct usb_hcd *hcd)u32 temp;struct xhci_hcd *xhci =hcd_to_xhci (hcd); -if (xhci->xhc_state &XHCI_STATE_HALTED ) -return ; -mutex_lock (&xhci->mutex); -spin_lock_irq (&xhci->lock); - xhci->xhc_state |=XHCI_STATE_HALTED ; - xhci->cmd_ring_state =CMD_RING_STATE_STOPPED ; - -/* Make sure the xHC is halted for a USB3 roothub -* (xhci_stop() could be called as part of failed init). -*/ -xhci_halt (xhci); -xhci_reset (xhci); -spin_unlock_irq (&xhci->lock); + +if (!(xhci->xhc_state &XHCI_STATE_HALTED )) { +spin_lock_irq (&xhci->lock); + + xhci->xhc_state |=XHCI_STATE_HALTED ; + xhci->cmd_ring_state =CMD_RING_STATE_STOPPED ; +xhci_halt (xhci); +xhci_reset (xhci); + +spin_unlock_irq (&xhci->lock); + } + +if (!usb_hcd_is_primary_hcd (hcd)) { +mutex_unlock (&xhci->mutex); +return ; + }xhci_cleanup_msix (xhci);
Greg Kroah-Hartman
maintainerPATCH 26/32 usb: xhci-plat: properly handle probe deferral for devm_clk_get()
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit de95c40d5beaa47f6dc8fe9ac4159b4672b51523 upstream.
On some platforms, the clocks might be registered by a platform driver. When this is the case, the clock platform driver may very well be probed after xhci-plat, in which case the first probe() invocation of xhci-plat will receive -EPROBE_DEFER as the return value of devm_clk_get().
The current code handles that as a normal error, and simply assumes that this means that the system doesn't have a clock for the XHCI controller, and continues probing without calling clk_prepare_enable(). Unfortunately, this doesn't work on systems where the XHCI controller does have a clock, but that clock is provided by another platform driver. In order to fix this situation, we handle the -EPROBE_DEFER error condition specially, and abort the XHCI controller probe(). It will be retried later automatically, the clock will be available, devm_clk_get() will succeed, and the probe() will continue with the clock prepared and enabled as expected.
In practice, such issue is seen on the ARM64 Marvell 7K/8K platform, where the clocks are registered by a platform driver.
--- drivers/usb/host/xhci-plat.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/xhci-plat.c +3 -0
@@ -132,6 +132,9 @@ static int xhci_plat_probe(struct platfo ret =clk_prepare_enable (clk);if (ret) goto put_hcd; + }else if (PTR_ERR (clk) == -EPROBE_DEFER ) { + ret = -EPROBE_DEFER ; + goto put_hcd; } if (of_device_is_compatible(pdev->dev.of_node,
Greg Kroah-Hartman
maintainerPATCH 27/32 USB: xhci: Add broken streams quirk for Frescologic device id 1009
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit d95815ba6a0f287213118c136e64d8c56daeaeab upstream.
I got one of these cards for testing uas with, it seems that with streams it dma-s all over the place, corrupting memory. On my first tests it managed to dma over the BIOS of the motherboard somehow and completely bricked it.
Tests on another motherboard show that it does work with streams disabled.
--- drivers/usb/host/xhci-pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/host/xhci-pci.c +5 -0
@@ -37,6 +37,7 @@/* Device for a quirk */ #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000 +#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400#define PCI_VENDOR_ID_ETRON 0x1b6f
@@ -115,6 +116,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |=XHCI_TRUST_TX_LENGTH ; } +if (pdev->vendor ==PCI_VENDOR_ID_FRESCO_LOGIC && + pdev->device ==PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 ) + xhci->quirks |=XHCI_BROKEN_STREAMS ; +if (pdev->vendor ==PCI_VENDOR_ID_NEC ) xhci->quirks |=XHCI_NEC_HOST ;
Greg Kroah-Hartman
maintainerPATCH 28/32 xhci: Fix handling timeouted commands on hosts in weird states.
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit 3425aa03f484d45dc21e0e791c2f6c74ea656421 upstream.
If commands timeout we mark them for abortion, then stop the command ring, and turn the commands to no-ops and finally restart the command ring.
If the host is working properly the no-op commands will finish and pending completions are called.
If we notice the host is failing, driver clears the command ring and completes, deletes and frees all pending commands.
There are two separate cases reported where host is believed to work properly but is not. In the first case we successfully stop the ring but no abort or stop command ring event is ever sent and host locks up.
The second case is if a host is removed, command times out and driver believes the ring is stopped, and assumes it will be restarted, but actually ends up timing out on the same command forever.
If one of the pending commands has the xhci->mutex held it will block xhci_stop() in the remove codepath which otherwise would cleanup pending commands.
Add a check that clears all pending commands in case host is removed, or we are stuck timing out on the same command. Also restart the command timeout timer when stopping the command ring to ensure we recive an ring stop/abort event.
--- drivers/usb/host/xhci-ring.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-)
drivers/usb/host/xhci-ring.c +22 -5
@@ -289,6 +289,14 @@ static int xhci_abort_cmd_ring(struct xh temp_64 =xhci_read_64 (xhci, &xhci->op_regs->cmd_ring); xhci->cmd_ring_state =CMD_RING_STATE_ABORTED ; + +/* +* Writing the CMD_RING_ABORT bit should cause a cmd completion event, +* however on some host hw the CMD_RING_RUNNING bit is correctly cleared +* but the completion event in never sent. Use the cmd timeout timer to +* handle those cases. Use twice the time to cover the bit polling retry +*/ +mod_timer (&xhci->cmd_timer, jiffies + (2 *XHCI_CMD_DEFAULT_TIMEOUT ));xhci_write_64 (xhci, temp_64 |CMD_RING_ABORT , &xhci->op_regs->cmd_ring);
@@ -313,6 +321,7 @@ static int xhci_abort_cmd_ring(struct xhxhci_err (xhci,"Stopped the command ring failed, " "maybe the host is dead\n" ); +del_timer (&xhci->cmd_timer); xhci->xhc_state |=XHCI_STATE_DYING ;xhci_quiesce (xhci);xhci_halt (xhci);
@@ -1252,22 +1261,21 @@ void xhci_handle_command_timeout(unsigneint ret;unsigned long flags;u64 hw_ring_state; -struct xhci_command *cur_cmd =NULL ; +bool second_timeout = false; xhci = (struct xhci_hcd *) data;/* mark this command to be cancelled */ spin_lock_irqsave (&xhci->lock, flags);if (xhci->current_cmd) { - cur_cmd = xhci->current_cmd; - cur_cmd->status =COMP_CMD_ABORT ; +if (xhci->current_cmd->status ==COMP_CMD_ABORT ) + second_timeout = true; + xhci->current_cmd->status =COMP_CMD_ABORT ; } -/* Make sure command ring is running before aborting it */ hw_ring_state =xhci_read_64 (xhci, &xhci->op_regs->cmd_ring);if ((xhci->cmd_ring_state &CMD_RING_STATE_RUNNING ) && (hw_ring_state &CMD_RING_RUNNING )) { -spin_unlock_irqrestore (&xhci->lock, flags);xhci_dbg (xhci,"Command timeout\n" ); ret =xhci_abort_cmd_ring (xhci);
@@ -1279,6 +1287,15 @@ void xhci_handle_command_timeout(unsigne }return ; } + +/* command ring failed to restart, or host removed. Bail out */ +if (second_timeout || xhci->xhc_state &XHCI_STATE_REMOVING ) { +spin_unlock_irqrestore (&xhci->lock, flags); +xhci_dbg (xhci,"command timed out twice, ring start fail?\n" ); +xhci_cleanup_command_queue (xhci); +return ; + } +/* command timeout on stopped ring, ring can't be aborted */ xhci_dbg (xhci,"Command timeout on stopped ring\n" );xhci_handle_stopped_cmd_ring (xhci, xhci->current_cmd);
Greg Kroah-Hartman
maintainerPATCH 29/32 USB: mos7720: delete parport
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudip Mukherjee <[email protected]>
commit dcb21ad4385731b7fc3ef39d255685f2f63c8c5d upstream.
parport subsystem has introduced parport_del_port() to delete a port when it is going away. Without parport_del_port() the registered port will not be unregistered.
To reproduce and verify the error:
Command to be used is : ls /sys/bus/parport/devices
1) without the device attached there is no output as there is no registered parport.
2) Attach the device, and the command will show "parport0".
3) Remove the device and the command still shows "parport0".
4) Attach the device again and we get "parport1".
With the patch applied:
1) without the device attached there is no output as there is no registered parport.
2) Attach the device, and the command will show "parport0".
3) Remove the device and there is no output as "parport0" is now removed.
4) Attach device again to get "parport0" again.
--- drivers/usb/serial/mos7720.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/mos7720.c +1 -0
@@ -2007,6 +2007,7 @@ static void mos7720_release(struct usb_s urblist_entry) usb_unlink_urb(urbtrack->urb);spin_unlock_irqrestore (&mos_parport->listlock, flags); +parport_del_port (mos_parport->pp);kref_put (&mos_parport->ref_count, destroy_mos_parport); }
Greg Kroah-Hartman
maintainerPATCH 30/32 usb: gadget: fix spinlock dead lock in gadgetfs
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bin Liu <[email protected]>
commit d246dcb2331c5783743720e6510892eb1d2801d9 upstream.
[ 40.467381] =============================================
[ 40.473013] [ INFO: possible recursive locking detected ]
[ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted
[ 40.483466] ---------------------------------------------
[ 40.489098] usb/733 is trying to acquire lock:
[ 40.493734] (&(&dev->lock)->rlock){-.....}, at: [<bf129288>] ep0_complete+0x18/0xdc [gadgetfs]
[ 40.502882]
[ 40.502882] but task is already holding lock:
[ 40.508967] (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[ 40.517811]
[ 40.517811] other info that might help us debug this:
[ 40.524623] Possible unsafe locking scenario:
[ 40.524623]
[ 40.530798] CPU0
[ 40.533346] ----
[ 40.535894] lock(&(&dev->lock)->rlock);
[ 40.540088] lock(&(&dev->lock)->rlock);
[ 40.544284]
[ 40.544284] *** DEADLOCK ***
[ 40.544284]
[ 40.550461] May be due to missing lock nesting notation
[ 40.550461]
[ 40.557544] 2 locks held by usb/733:
[ 40.561271] #0: (&f->f_pos_lock){+.+.+.}, at: [<c02a6114>] __fdget_pos+0x40/0x48
[ 40.569219] #1: (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[ 40.578523]
[ 40.578523] stack backtrace:
[ 40.583075] CPU: 0 PID: 733 Comm: usb Not tainted 4.6.0-08691-g7f3db9a #37
[ 40.590246] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 40.596625] [<c010ffbc>] (unwind_backtrace) from [<c010c1bc>] (show_stack+0x10/0x14)
[ 40.604718] [<c010c1bc>] (show_stack) from [<c04207fc>] (dump_stack+0xb0/0xe4)
[ 40.612267] [<c04207fc>] (dump_stack) from [<c01886ec>] (__lock_acquire+0xf68/0x1994)
[ 40.620440] [<c01886ec>] (__lock_acquire) from [<c0189528>] (lock_acquire+0xd8/0x238)
[ 40.628621] [<c0189528>] (lock_acquire) from [<c06ad6b4>] (_raw_spin_lock_irqsave+0x38/0x4c)
[ 40.637440] [<c06ad6b4>] (_raw_spin_lock_irqsave) from [<bf129288>] (ep0_complete+0x18/0xdc [gadgetfs])
[ 40.647339] [<bf129288>] (ep0_complete [gadgetfs]) from [<bf10a728>] (musb_g_giveback+0x118/0x1b0 [musb_hdrc])
[ 40.657842] [<bf10a728>] (musb_g_giveback [musb_hdrc]) from [<bf108768>] (musb_g_ep0_queue+0x16c/0x188 [musb_hdrc])
[ 40.668772] [<bf108768>] (musb_g_ep0_queue [musb_hdrc]) from [<bf12a944>] (ep0_read+0x544/0x5e0 [gadgetfs])
[ 40.678963] [<bf12a944>] (ep0_read [gadgetfs]) from [<c0284470>] (__vfs_read+0x20/0x110)
[ 40.687414] [<c0284470>] (__vfs_read) from [<c0285324>] (vfs_read+0x88/0x114)
[ 40.694864] [<c0285324>] (vfs_read) from [<c0286150>] (SyS_read+0x44/0x9c)
[ 40.702051] [<c0286150>] (SyS_read) from [<c0107820>] (ret_fast_syscall+0x0/0x1c)This is caused by the spinlock bug in ep0_read(). Fix the two other deadlock sources in gadgetfs_setup() too.
--- drivers/usb/gadget/legacy/inode.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/usb/gadget/legacy/inode.c +13 -4
@@ -937,8 +937,11 @@ ep0_read (struct file *fd, char __user *struct usb_ep *ep = dev->gadget->ep0;struct usb_request *req = dev->req; -if ((retval =setup_req (ep, req,0 )) ==0 ) - retval =usb_ep_queue (ep, req,GFP_ATOMIC ); +if ((retval =setup_req (ep, req,0 )) ==0 ) { +spin_unlock_irq (&dev->lock); + retval =usb_ep_queue (ep, req,GFP_KERNEL ); +spin_lock_irq (&dev->lock); + } dev->state =STATE_DEV_CONNECTED ;/* assume that was SET_CONFIGURATION */
@@ -1456,8 +1459,11 @@ delegate: w_length);if (value <0 )break ; + +spin_unlock (&dev->lock); value =usb_ep_queue (gadget->ep0, dev->req, -GFP_ATOMIC ); +GFP_KERNEL ); +spin_lock (&dev->lock);if (value <0 ) {clean_req (gadget->ep0, dev->req);break ;
@@ -1480,11 +1486,14 @@ delegate:if (value >=0 && dev->state !=STATE_DEV_SETUP ) { req->length = value; req->zero = value < w_length; - value =usb_ep_queue (gadget->ep0, req,GFP_ATOMIC ); + +spin_unlock (&dev->lock); + value =usb_ep_queue (gadget->ep0, req,GFP_KERNEL );if (value <0 ) {DBG (dev,"ep_queue --> %d\n" , value); req->status =0 ; } +return value; }/* device stalls when value < 0 */
Greg Kroah-Hartman
maintainerPATCH 31/32 usb: host: ehci-tegra: Grab the correct UTMI pads reset
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thierry Reding <[email protected]>
commit f8a15a9650694feaa0dabf197b0c94d37cd3fb42 upstream.
There are three EHCI controllers on Tegra SoCs, each with its own reset line. However, the first controller contains a set of UTMI configuration registers that are shared with its siblings. These registers will only be reset as part of the first controller's reset. For proper operation it must be ensured that the UTMI configuration registers are reset before any of the EHCI controllers are enabled, irrespective of the probe order.
Commit a47cc24cd1e5 ("USB: EHCI: tegra: Fix probe order issue leading to broken USB") introduced code that ensures the first controller is always reset before setting up any of the controllers, and is never again reset afterwards.
This code, however, grabs the wrong reset. Each EHCI controller has two reset controls attached: 1) the USB controller reset and 2) the UTMI pads reset (really the first controller's reset). In order to reset the UTMI pads registers the code must grab the second reset, but instead it grabbing the first.
--- drivers/usb/host/ehci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci-tegra.c +1 -1
@@ -89,7 +89,7 @@ static int tegra_reset_usb_controller(stif (!usb1_reset_attempted) {struct reset_control *usb1_reset; - usb1_reset =of_reset_control_get (phy_np,"usb" ); + usb1_reset =of_reset_control_get (phy_np,"utmi-pads" );if (IS_ERR (usb1_reset)) {dev_warn (&pdev->dev,"can't get utmi-pads reset from the PHY\n" );
Greg Kroah-Hartman
maintainerPATCH 32/32 usb: dwc3: exynos: Fix deferred probing storm.
In reply to Greg Kroah-Hartman4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steinar H. Gunderson <[email protected]>
commit 4879efb34f7d49235fac334d76d9c6a77a021413 upstream.
dwc3-exynos has two problems during init if the regulators are slow to come up (for instance if the I2C bus driver is not on the initramfs) and return probe deferral. First, every time this happens, the driver leaks the USB phys created; they need to be deallocated on error.
Second, since the phy devices are created before the regulators fail, this means that there's a new device to re-trigger deferred probing, which causes it to essentially go into a busy loop of re-probing the device until the regulators come up.
Move the phy creation to after the regulators have succeeded, and also fix cleanup on failure. On my ODROID XU4 system (with Debian's initramfs which doesn't contain the I2C driver), this reduces the number of probe attempts (for each of the two controllers) from more than 2000 to eight.
--- drivers/usb/dwc3/dwc3-exynos.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/usb/dwc3/dwc3-exynos.c +11 -8
@@ -128,12 +128,6 @@ static int dwc3_exynos_probe(struct platplatform_set_drvdata (pdev, exynos); - ret =dwc3_exynos_register_phys (exynos); -if (ret) { -dev_err (dev,"couldn't register PHYs\n" ); -return ret; - } - exynos->dev = dev; exynos->clk =devm_clk_get (dev,"usbdrd30" );
@@ -183,20 +177,29 @@ static int dwc3_exynos_probe(struct plat goto err3; } + ret =dwc3_exynos_register_phys (exynos); +if (ret) { +dev_err (dev,"couldn't register PHYs\n" ); + goto err4; + } +if (node) { ret =of_platform_populate (node,NULL ,NULL , dev);if (ret) {dev_err (dev,"failed to add dwc3 core\n" ); - goto err4; + goto err5; } }else {dev_err (dev,"no device node, failed to add dwc3 core\n" ); ret = -ENODEV ; - goto err4; + goto err5; }return 0 ; +err5: +platform_device_unregister (exynos->usb2_phy); +platform_device_unregister (exynos->usb3_phy); err4:regulator_disable (exynos->vdd10); err3:
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Greg, I'd like you to include the following patch as well, since this has been causing crashes with current 4.4 series:
Quoted 4 lines
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
[SNIP]
Quoted 2 lines
Greg Kroah-Hartman
maintainerQuoted 8 lines · Nikolay Borisov
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 4 lines
Greg, I'd like you to include the following patch as well, since this has been causing crashes with current 4.4 series:
Please read the note from the 4.6 -rc announcement...
And if you want a patch applied, make a new thread with the subject all about that specific one and send it to stable@, don't send it to the -rc1 announcement please.
thanks,
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
Build results:
total: 148 pass: 148 fail: 0 Qemu test results: total: 101 pass: 101 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 9 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 148 pass: 148 fail: 0 Qemu test results: total: 101 pass: 101 fail: 0Details are available at http://kerneltests.org/builders.
Thanks for testing both of these and letting me know.
greg k-h
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
We were looking into why the kernelci.org bot isn't responding to this and it's because the actual patch count in the git tree is 33 (not 32) because it includes the commit adds -rc1 to the Makefile. So, the kernelci bot was waiting for a build to show up that matched this email (which it didn't find.)
Can you update your scripts to include that final patch so the patch count is right? It's already included in the one-big patch, and the diffstat etc. below, so that would make everything line up.
Quoted 5 lines
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gz
nit: this isn't a working URL, and adding an https://www. prefix onto that, that file dosen't seem to exist there yet.
Thanks,
Kevin
[1]
$ git checkout stable-rc/linux-4.4.y HEAD is now at 5db8024c795f... Linux 4.4.15-rc1 $ git describe v4.4.14-33-g5db8024c795f
Quoted 154 lines
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 4.4.15-rc1Steinar H. Gunderson <[email protected]>
usb: dwc3: exynos: Fix deferred probing storm.Thierry Reding <[email protected]>
usb: host: ehci-tegra: Grab the correct UTMI pads resetBin Liu <[email protected]>
usb: gadget: fix spinlock dead lock in gadgetfsSudip Mukherjee <[email protected]>
USB: mos7720: delete parportMathias Nyman <[email protected]>
xhci: Fix handling timeouted commands on hosts in weird states.Hans de Goede <[email protected]>
USB: xhci: Add broken streams quirk for Frescologic device id 1009Thomas Petazzoni <[email protected]>
usb: xhci-plat: properly handle probe deferral fordevm_clk_get()Gabriel Krisman Bertazi <[email protected]>
xhci: Cleanup only when releasing primary hcdBin Liu <[email protected]>
usb: musb: host: correct cppi dma channel for isoch transferAndrew Goodbody <[email protected]>
usb: musb: Ensure rx reinit occurs forshared_fifoendpointsAndrew Goodbody <[email protected]>
usb: musb: Stop bulk endpoint while queue is rotatedBin Liu <[email protected]>
usb: musb: only restore devctl when session was set in backupHans de Goede <[email protected]>
usb: quirks: Add no-lpm quirk for Acer C120 LED ProjectorHans de Goede <[email protected]>
usb: quirks: Fix sortingHans de Goede <[email protected]>
USB: uas: Fix slavequeue_depthnot being setMathias Krause <[email protected]>
crypto: user - re-add size check forCRYPTO_MSG_GETALGLinus Walleij <[email protected]>
crypto: ux500 - memmove the right sizeAnton Blanchard <[email protected]>
crypto: vmx - Increase priority of aes-cbc cipherBasil Gunn <[email protected]>
AX.25: Close socket connection on session completionDaniel Borkmann <[email protected]>
bpf: try harder on clones when writing into skbFeng Tang <[email protected]>
net: alx: Work around the DMA RX overflow issueNicolas Ferre <[email protected]>
net: macb: fix default configuration for GMAC on AT91David Barroso <[email protected]>
neigh: Explicitly declare RCU-bh read side critical section inneigh_xmit()Daniel Borkmann <[email protected]>
bpf, perf: delay release of BPF prog after grace periodWillem de Bruijn <[email protected]>
sock_diag: do not broadcast raw socket destructiondaniel <[email protected]>
Bridge: Fix ipv6 mc snooping if bridge has no ipv6 addressTom Goff <[email protected]>
ipmr/ip6mr: Initialize the last assert time of mfc entries.Eric Dumazet <[email protected]>
netem: fix a use after freeHerbert Xu <[email protected]>
esp: Fix ESN generation under UDP encapsulationSimon Horman <[email protected]>
sit: correct IP protocol used inipip6_errJason A. Donenfeld <[email protected]>
net: Don't forgetpr_fmtonnet_dbg_ratelimitedforCONFIG_DYNAMIC_DEBUGEric Dumazet <[email protected]>
net_sched: fixpfifo_head_dropbehavior vs backlog-------------
Diffstat:
Makefile | 4 +-- crypto/crypto_user.c | 1 + drivers/crypto/ux500/hash/hash_core.c | 4 +-- drivers/crypto/vmx/aes_cbc.c | 2 +- drivers/crypto/vmx/aes_ctr.c | 2 +- drivers/net/ethernet/atheros/alx/main.c | 7 ++++- drivers/net/ethernet/cadence/macb.c | 13 +++++---- drivers/net/ethernet/cadence/macb.h | 2 +- drivers/usb/core/quirks.c | 23 ++++++++------- drivers/usb/dwc3/dwc3-exynos.c | 19 +++++++----- drivers/usb/gadget/legacy/inode.c | 17 ++++++++--- drivers/usb/host/ehci-tegra.c | 2 +- drivers/usb/host/xhci-pci.c | 5 ++++ drivers/usb/host/xhci-plat.c | 3 ++ drivers/usb/host/xhci-ring.c | 30 +++++++++++++++---- drivers/usb/host/xhci.c | 27 +++++++++-------- drivers/usb/musb/musb_core.c | 3 +- drivers/usb/musb/musb_host.c | 23 +++++++++------ drivers/usb/serial/mos7720.c | 1 + drivers/usb/storage/uas.c | 1 + include/linux/bpf.h | 4 +++ include/linux/net.h | 3 +- include/linux/skbuff.h | 7 +++++ include/linux/sock_diag.h | 6 ++++ kernel/events/core.c | 2 +- net/ax25/af_ax25.c | 3 +- net/ax25/ax25_ds_timer.c | 5 +++- net/ax25/ax25_std_timer.c | 5 +++- net/ax25/ax25_subr.c | 3 +- net/bridge/br_multicast.c | 4 +++ net/bridge/br_private.h | 23 ++++++++++++--- net/core/filter.c | 18 +++++++----- net/core/neighbour.c | 6 +++- net/ipv4/esp4.c | 52 ++++++++++++++++++++------------- net/ipv4/ipmr.c | 4 ++- net/ipv6/ip6mr.c | 1 + net/ipv6/sit.c | 4 +-- net/sched/act_csum.c | 8 ++--- net/sched/act_nat.c | 18 ++++-------- net/sched/sch_fifo.c | 4 +++ net/sched/sch_netem.c | 12 ++++---- 41 files changed, 249 insertions(+), 132 deletions(-)
Greg Kroah-Hartman
maintainerQuoted 17 lines · Kevin Hilman
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
We were looking into why the kernelci.org bot isn't responding to this and it's because the actual patch count in the git tree is 33 (not 32) because it includes the commit adds -rc1 to the
Makefile. So, the kernelci bot was waiting for a build to show up that matched this email (which it didn't find.)Can you update your scripts to include that final patch so the patch count is right? It's already included in the one-big patch, and the diffstat etc. below, so that would make everything line up.
Quoted 8 lines
Quoted 5 lines
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gznit: this isn't a working URL, and adding an https://www. prefix onto that, that file dosen't seem to exist there yet.
Should be there soon, sorry, an error on my end.
I'll look into fixing all these things when I return from LinuxCon Japan, right now I'm on vacation and really don't want to be messing with my stable scripts...
thanks,
greg k-h
Quoted 24 lines · Greg Kroah-Hartman
Quoted 23 lines · Kevin Hilman
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
We were looking into why the kernelci.org bot isn't responding to this and it's because the actual patch count in the git tree is 33 (not 32) because it includes the commit adds -rc1 to the
Makefile. So, the kernelci bot was waiting for a build to show up that matched this email (which it didn't find.)Can you update your scripts to include that final patch so the patch count is right? It's already included in the one-big patch, and the diffstat etc. below, so that would make everything line up.
Quoted 5 lines
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gz
Quoted 8 lines
Quoted 2 lines
nit: this isn't a working URL, and adding an https://www. prefix onto that, that file dosen't seem to exist there yet.
Should be there soon, sorry, an error on my end.
I'll look into fixing all these things when I return from LinuxCon Japan, right now I'm on vacation and really don't want to be messing with my stable scripts...
OK, no problem. In the mean time, we'll manually trigger the kernel CI bot for the stable-rc reviews.
Thanks, and safe travels.
Kevin
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.
another minor nit/request: can you update your scripts to push all the released stable tags to the new stable-rc tree?
Currently, it's missing the v4.4.14 tag, so the git-describe comes looking like it's 115 patches on top of v4.4.13 instead of 33 patches on top of v4.4.14:
$ git checkout origin/linux-4.4.y HEAD is now at 5db8024c795f... Linux 4.4.15-rc1 $ git describe v4.4.13-115-g5db8024c795f
Note that in my previous email, I did the git describe in a tree that also had the released stable tree tags, so the git describe came out right, but the auto-builders don't do that.
For the git describe to be most useful, it probably makes the most sense if the released stable tree tags are also pushed to the stable-rc tree.
Thanks,
Kevin
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.4.15 release. There are 32 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Jul 9 01:16:17 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah