Magellan Linux

Annotation of /trunk/kernel-alx/patches-4.9/0322-4.9.223-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3597 - (hide annotations) (download)
Thu Aug 13 10:21:38 2020 UTC (3 years, 9 months ago) by niro
File size: 23842 byte(s)
linux-223
1 niro 3597 diff --git a/Makefile b/Makefile
2     index 67c9106594be..2a923301987e 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 4
7     PATCHLEVEL = 9
8     -SUBLEVEL = 222
9     +SUBLEVEL = 223
10     EXTRAVERSION =
11     NAME = Roaring Lionus
12    
13     diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
14     index d3ba9f4105b5..8e04fe8325db 100644
15     --- a/arch/mips/kernel/perf_event_mipsxx.c
16     +++ b/arch/mips/kernel/perf_event_mipsxx.c
17     @@ -1605,7 +1605,6 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
18     break;
19     case CPU_P5600:
20     case CPU_P6600:
21     - case CPU_I6400:
22     /* 8-bit event numbers */
23     raw_id = config & 0x1ff;
24     base_id = raw_id & 0xff;
25     @@ -1618,6 +1617,11 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
26     raw_event.range = P;
27     #endif
28     break;
29     + case CPU_I6400:
30     + /* 8-bit event numbers */
31     + base_id = config & 0xff;
32     + raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
33     + break;
34     case CPU_1004K:
35     if (IS_BOTH_COUNTERS_1004K_EVENT(base_id))
36     raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
37     diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
38     index e0648a09d9c8..194c0ab82e7c 100644
39     --- a/arch/powerpc/kernel/pci_of_scan.c
40     +++ b/arch/powerpc/kernel/pci_of_scan.c
41     @@ -82,10 +82,16 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
42     const __be32 *addrs;
43     u32 i;
44     int proplen;
45     + bool mark_unset = false;
46    
47     addrs = of_get_property(node, "assigned-addresses", &proplen);
48     - if (!addrs)
49     - return;
50     + if (!addrs || !proplen) {
51     + addrs = of_get_property(node, "reg", &proplen);
52     + if (!addrs || !proplen)
53     + return;
54     + mark_unset = true;
55     + }
56     +
57     pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
58     for (; proplen >= 20; proplen -= 20, addrs += 5) {
59     flags = pci_parse_of_flags(of_read_number(addrs, 1), 0);
60     @@ -110,6 +116,8 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
61     continue;
62     }
63     res->flags = flags;
64     + if (mark_unset)
65     + res->flags |= IORESOURCE_UNSET;
66     res->name = pci_name(dev);
67     region.start = base;
68     region.end = base + size - 1;
69     diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
70     index 47c3d7f32900..437762a1e487 100644
71     --- a/drivers/iio/adc/ad7793.c
72     +++ b/drivers/iio/adc/ad7793.c
73     @@ -570,7 +570,7 @@ static const struct iio_info ad7797_info = {
74     .read_raw = &ad7793_read_raw,
75     .write_raw = &ad7793_write_raw,
76     .write_raw_get_fmt = &ad7793_write_raw_get_fmt,
77     - .attrs = &ad7793_attribute_group,
78     + .attrs = &ad7797_attribute_group,
79     .validate_trigger = ad_sd_validate_trigger,
80     .driver_module = THIS_MODULE,
81     };
82     diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
83     index 71525950c641..060f9b176929 100644
84     --- a/drivers/net/dsa/b53/b53_common.c
85     +++ b/drivers/net/dsa/b53/b53_common.c
86     @@ -1109,6 +1109,7 @@ static int b53_arl_read(struct b53_device *dev, u64 mac,
87     u16 vid, struct b53_arl_entry *ent, u8 *idx,
88     bool is_valid)
89     {
90     + DECLARE_BITMAP(free_bins, B53_ARLTBL_MAX_BIN_ENTRIES);
91     unsigned int i;
92     int ret;
93    
94     @@ -1116,6 +1117,8 @@ static int b53_arl_read(struct b53_device *dev, u64 mac,
95     if (ret)
96     return ret;
97    
98     + bitmap_zero(free_bins, dev->num_arl_entries);
99     +
100     /* Read the bins */
101     for (i = 0; i < dev->num_arl_entries; i++) {
102     u64 mac_vid;
103     @@ -1127,13 +1130,21 @@ static int b53_arl_read(struct b53_device *dev, u64 mac,
104     B53_ARLTBL_DATA_ENTRY(i), &fwd_entry);
105     b53_arl_to_entry(ent, mac_vid, fwd_entry);
106    
107     - if (!(fwd_entry & ARLTBL_VALID))
108     + if (!(fwd_entry & ARLTBL_VALID)) {
109     + set_bit(i, free_bins);
110     continue;
111     + }
112     if ((mac_vid & ARLTBL_MAC_MASK) != mac)
113     continue;
114     *idx = i;
115     + return 0;
116     }
117    
118     + if (bitmap_weight(free_bins, dev->num_arl_entries) == 0)
119     + return -ENOSPC;
120     +
121     + *idx = find_first_bit(free_bins, dev->num_arl_entries);
122     +
123     return -ENOENT;
124     }
125    
126     @@ -1163,10 +1174,21 @@ static int b53_arl_op(struct b53_device *dev, int op, int port,
127     if (op)
128     return ret;
129    
130     - /* We could not find a matching MAC, so reset to a new entry */
131     - if (ret) {
132     + switch (ret) {
133     + case -ENOSPC:
134     + dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n",
135     + addr, vid);
136     + return is_valid ? ret : 0;
137     + case -ENOENT:
138     + /* We could not find a matching MAC, so reset to a new entry */
139     + dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n",
140     + addr, vid, idx);
141     fwd_entry = 0;
142     - idx = 1;
143     + break;
144     + default:
145     + dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n",
146     + addr, vid, idx);
147     + break;
148     }
149    
150     memset(&ent, 0, sizeof(ent));
151     diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
152     index 85c44bfba55a..3cf246c6bdcc 100644
153     --- a/drivers/net/dsa/b53/b53_regs.h
154     +++ b/drivers/net/dsa/b53/b53_regs.h
155     @@ -280,6 +280,9 @@
156     #define ARLTBL_STATIC BIT(15)
157     #define ARLTBL_VALID BIT(16)
158    
159     +/* Maximum number of bin entries in the ARL for all switches */
160     +#define B53_ARLTBL_MAX_BIN_ENTRIES 4
161     +
162     /* ARL Search Control Register (8 bit) */
163     #define B53_ARL_SRCH_CTL 0x50
164     #define B53_ARL_SRCH_CTL_25 0x20
165     diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
166     index 6519dd33c7ca..5d67dbdd943d 100644
167     --- a/drivers/net/ethernet/broadcom/bcmsysport.c
168     +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
169     @@ -504,7 +504,8 @@ static struct sk_buff *bcm_sysport_rx_refill(struct bcm_sysport_priv *priv,
170     dma_addr_t mapping;
171    
172     /* Allocate a new SKB for a new packet */
173     - skb = netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH);
174     + skb = __netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH,
175     + GFP_ATOMIC | __GFP_NOWARN);
176     if (!skb) {
177     priv->mib.alloc_rx_buff_failed++;
178     netif_err(priv, rx_err, ndev, "SKB alloc failed\n");
179     diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
180     index a23404480597..5d4189c94718 100644
181     --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
182     +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
183     @@ -1596,7 +1596,8 @@ static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv,
184     dma_addr_t mapping;
185    
186     /* Allocate a new Rx skb */
187     - skb = netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT);
188     + skb = __netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT,
189     + GFP_ATOMIC | __GFP_NOWARN);
190     if (!skb) {
191     priv->mib.alloc_rx_buff_failed++;
192     netif_err(priv, rx_err, priv->dev,
193     diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
194     index 25136941a964..5b91a95476de 100644
195     --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
196     +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
197     @@ -40,12 +40,16 @@ static u32 stmmac_config_sub_second_increment(void __iomem *ioaddr,
198     unsigned long data;
199     u32 reg_value;
200    
201     - /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second
202     - * formula = (1/ptp_clock) * 1000000000
203     - * where ptp_clock is 50MHz if fine method is used to update system
204     + /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second
205     + * increment to twice the number of nanoseconds of a clock cycle.
206     + * The calculation of the default_addend value by the caller will set it
207     + * to mid-range = 2^31 when the remainder of this division is zero,
208     + * which will make the accumulator overflow once every 2 ptp_clock
209     + * cycles, adding twice the number of nanoseconds of a clock cycle :
210     + * 2000000000ULL / ptp_clock.
211     */
212     if (value & PTP_TCR_TSCFUPDT)
213     - data = (1000000000ULL / 50000000);
214     + data = (2000000000ULL / ptp_clock);
215     else
216     data = (1000000000ULL / ptp_clock);
217    
218     diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c
219     index e74664b84925..4e4167976acf 100644
220     --- a/drivers/net/wimax/i2400m/usb-fw.c
221     +++ b/drivers/net/wimax/i2400m/usb-fw.c
222     @@ -354,6 +354,7 @@ out:
223     usb_autopm_put_interface(i2400mu->usb_iface);
224     d_fnend(8, dev, "(i2400m %p ack %p size %zu) = %ld\n",
225     i2400m, ack, ack_size, (long) result);
226     + usb_put_urb(&notif_urb);
227     return result;
228    
229     error_exceeded:
230     diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
231     index 2e37097916b5..2ac966400c42 100644
232     --- a/drivers/vhost/vsock.c
233     +++ b/drivers/vhost/vsock.c
234     @@ -460,6 +460,11 @@ static int vhost_vsock_start(struct vhost_vsock *vsock)
235     mutex_unlock(&vq->mutex);
236     }
237    
238     + /* Some packets may have been queued before the device was started,
239     + * let's kick the send worker to send them.
240     + */
241     + vhost_work_queue(&vsock->dev, &vsock->send_pkt_work);
242     +
243     mutex_unlock(&vsock->dev.mutex);
244     return 0;
245    
246     diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
247     index f2707ff795d4..c018d161735c 100644
248     --- a/fs/cifs/connect.c
249     +++ b/fs/cifs/connect.c
250     @@ -341,8 +341,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)
251     return rc;
252     }
253    
254     + spin_lock(&cifs_tcp_ses_lock);
255     rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr,
256     strlen(ipaddr));
257     + spin_unlock(&cifs_tcp_ses_lock);
258     kfree(ipaddr);
259    
260     return !rc ? -1 : 0;
261     diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
262     index d3417c18ee2f..dbab3036e4f5 100644
263     --- a/include/linux/ieee80211.h
264     +++ b/include/linux/ieee80211.h
265     @@ -619,6 +619,15 @@ static inline bool ieee80211_is_qos_nullfunc(__le16 fc)
266     cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
267     }
268    
269     +/**
270     + * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame
271     + * @fc: frame control bytes in little-endian byteorder
272     + */
273     +static inline bool ieee80211_is_any_nullfunc(__le16 fc)
274     +{
275     + return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc));
276     +}
277     +
278     /**
279     * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU
280     * @fc: frame control field in little-endian byteorder
281     diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
282     index 0f64fcee4ccd..8f383cca6bb1 100644
283     --- a/lib/mpi/longlong.h
284     +++ b/lib/mpi/longlong.h
285     @@ -756,22 +756,22 @@ do { \
286     do { \
287     if (__builtin_constant_p(bh) && (bh) == 0) \
288     __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
289     - : "=r" ((USItype)(sh)), \
290     - "=&r" ((USItype)(sl)) \
291     + : "=r" (sh), \
292     + "=&r" (sl) \
293     : "%r" ((USItype)(ah)), \
294     "%r" ((USItype)(al)), \
295     "rI" ((USItype)(bl))); \
296     else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
297     __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
298     - : "=r" ((USItype)(sh)), \
299     - "=&r" ((USItype)(sl)) \
300     + : "=r" (sh), \
301     + "=&r" (sl) \
302     : "%r" ((USItype)(ah)), \
303     "%r" ((USItype)(al)), \
304     "rI" ((USItype)(bl))); \
305     else \
306     __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
307     - : "=r" ((USItype)(sh)), \
308     - "=&r" ((USItype)(sl)) \
309     + : "=r" (sh), \
310     + "=&r" (sl) \
311     : "%r" ((USItype)(ah)), \
312     "r" ((USItype)(bh)), \
313     "%r" ((USItype)(al)), \
314     @@ -781,36 +781,36 @@ do { \
315     do { \
316     if (__builtin_constant_p(ah) && (ah) == 0) \
317     __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
318     - : "=r" ((USItype)(sh)), \
319     - "=&r" ((USItype)(sl)) \
320     + : "=r" (sh), \
321     + "=&r" (sl) \
322     : "r" ((USItype)(bh)), \
323     "rI" ((USItype)(al)), \
324     "r" ((USItype)(bl))); \
325     else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \
326     __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
327     - : "=r" ((USItype)(sh)), \
328     - "=&r" ((USItype)(sl)) \
329     + : "=r" (sh), \
330     + "=&r" (sl) \
331     : "r" ((USItype)(bh)), \
332     "rI" ((USItype)(al)), \
333     "r" ((USItype)(bl))); \
334     else if (__builtin_constant_p(bh) && (bh) == 0) \
335     __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
336     - : "=r" ((USItype)(sh)), \
337     - "=&r" ((USItype)(sl)) \
338     + : "=r" (sh), \
339     + "=&r" (sl) \
340     : "r" ((USItype)(ah)), \
341     "rI" ((USItype)(al)), \
342     "r" ((USItype)(bl))); \
343     else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
344     __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
345     - : "=r" ((USItype)(sh)), \
346     - "=&r" ((USItype)(sl)) \
347     + : "=r" (sh), \
348     + "=&r" (sl) \
349     : "r" ((USItype)(ah)), \
350     "rI" ((USItype)(al)), \
351     "r" ((USItype)(bl))); \
352     else \
353     __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
354     - : "=r" ((USItype)(sh)), \
355     - "=&r" ((USItype)(sl)) \
356     + : "=r" (sh), \
357     + "=&r" (sl) \
358     : "r" ((USItype)(ah)), \
359     "r" ((USItype)(bh)), \
360     "rI" ((USItype)(al)), \
361     @@ -821,7 +821,7 @@ do { \
362     do { \
363     USItype __m0 = (m0), __m1 = (m1); \
364     __asm__ ("mulhwu %0,%1,%2" \
365     - : "=r" ((USItype) ph) \
366     + : "=r" (ph) \
367     : "%r" (__m0), \
368     "r" (__m1)); \
369     (pl) = __m0 * __m1; \
370     diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
371     index 048389b5aa0f..58b80270e58c 100644
372     --- a/net/mac80211/mlme.c
373     +++ b/net/mac80211/mlme.c
374     @@ -2277,7 +2277,7 @@ void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
375     if (!ieee80211_is_data(hdr->frame_control))
376     return;
377    
378     - if (ieee80211_is_nullfunc(hdr->frame_control) &&
379     + if (ieee80211_is_any_nullfunc(hdr->frame_control) &&
380     sdata->u.mgd.probe_send_count > 0) {
381     if (ack)
382     ieee80211_sta_reset_conn_monitor(sdata);
383     diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
384     index a6f265262f15..d3334fd84ca2 100644
385     --- a/net/mac80211/rx.c
386     +++ b/net/mac80211/rx.c
387     @@ -1231,8 +1231,7 @@ ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx)
388     return RX_CONTINUE;
389    
390     if (ieee80211_is_ctl(hdr->frame_control) ||
391     - ieee80211_is_nullfunc(hdr->frame_control) ||
392     - ieee80211_is_qos_nullfunc(hdr->frame_control) ||
393     + ieee80211_is_any_nullfunc(hdr->frame_control) ||
394     is_multicast_ether_addr(hdr->addr1))
395     return RX_CONTINUE;
396    
397     @@ -1617,8 +1616,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
398     * Drop (qos-)data::nullfunc frames silently, since they
399     * are used only to control station power saving mode.
400     */
401     - if (ieee80211_is_nullfunc(hdr->frame_control) ||
402     - ieee80211_is_qos_nullfunc(hdr->frame_control)) {
403     + if (ieee80211_is_any_nullfunc(hdr->frame_control)) {
404     I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc);
405    
406     /*
407     @@ -2112,7 +2110,7 @@ static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
408    
409     /* Drop unencrypted frames if key is set. */
410     if (unlikely(!ieee80211_has_protected(fc) &&
411     - !ieee80211_is_nullfunc(fc) &&
412     + !ieee80211_is_any_nullfunc(fc) &&
413     ieee80211_is_data(fc) && rx->key))
414     return -EACCES;
415    
416     diff --git a/net/mac80211/status.c b/net/mac80211/status.c
417     index 246d113bd755..1d81064b241d 100644
418     --- a/net/mac80211/status.c
419     +++ b/net/mac80211/status.c
420     @@ -480,8 +480,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local,
421     rcu_read_lock();
422     sdata = ieee80211_sdata_from_skb(local, skb);
423     if (sdata) {
424     - if (ieee80211_is_nullfunc(hdr->frame_control) ||
425     - ieee80211_is_qos_nullfunc(hdr->frame_control))
426     + if (ieee80211_is_any_nullfunc(hdr->frame_control))
427     cfg80211_probe_status(sdata->dev, hdr->addr1,
428     cookie, acked,
429     GFP_ATOMIC);
430     @@ -914,7 +913,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
431     I802_DEBUG_INC(local->dot11FailedCount);
432     }
433    
434     - if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc) &&
435     + if (ieee80211_is_any_nullfunc(fc) && ieee80211_has_pm(fc) &&
436     ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS) &&
437     !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
438     local->ps_sdata && !(local->scanning)) {
439     diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
440     index 850264fac378..6216279efc46 100644
441     --- a/net/mac80211/tx.c
442     +++ b/net/mac80211/tx.c
443     @@ -294,7 +294,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
444     if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) &&
445     test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) &&
446     !ieee80211_is_probe_req(hdr->frame_control) &&
447     - !ieee80211_is_nullfunc(hdr->frame_control))
448     + !ieee80211_is_any_nullfunc(hdr->frame_control))
449     /*
450     * When software scanning only nullfunc frames (to notify
451     * the sleep state to the AP) and probe requests (for the
452     diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
453     index fc67d356b5fa..acb0c2631c79 100644
454     --- a/net/sctp/sm_make_chunk.c
455     +++ b/net/sctp/sm_make_chunk.c
456     @@ -856,7 +856,11 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
457     sctp_shutdownhdr_t shut;
458     __u32 ctsn;
459    
460     - ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
461     + if (chunk && chunk->asoc)
462     + ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map);
463     + else
464     + ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
465     +
466     shut.cum_tsn_ack = htonl(ctsn);
467    
468     retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0,
469     diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
470     index 2c472e1b4827..a84c3b681699 100644
471     --- a/net/sunrpc/xprtrdma/backchannel.c
472     +++ b/net/sunrpc/xprtrdma/backchannel.c
473     @@ -71,21 +71,13 @@ out_fail:
474     static int rpcrdma_bc_setup_reps(struct rpcrdma_xprt *r_xprt,
475     unsigned int count)
476     {
477     - struct rpcrdma_rep *rep;
478     int rc = 0;
479    
480     while (count--) {
481     - rep = rpcrdma_create_rep(r_xprt);
482     - if (IS_ERR(rep)) {
483     - pr_err("RPC: %s: reply buffer alloc failed\n",
484     - __func__);
485     - rc = PTR_ERR(rep);
486     + rc = rpcrdma_create_rep(r_xprt);
487     + if (rc)
488     break;
489     - }
490     -
491     - rpcrdma_recv_buffer_put(rep);
492     }
493     -
494     return rc;
495     }
496    
497     diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
498     index 1a2b1f61ed26..915a1ddabe03 100644
499     --- a/net/sunrpc/xprtrdma/verbs.c
500     +++ b/net/sunrpc/xprtrdma/verbs.c
501     @@ -891,10 +891,17 @@ rpcrdma_create_req(struct rpcrdma_xprt *r_xprt)
502     return req;
503     }
504    
505     -struct rpcrdma_rep *
506     -rpcrdma_create_rep(struct rpcrdma_xprt *r_xprt)
507     +/**
508     + * rpcrdma_create_rep - Allocate an rpcrdma_rep object
509     + * @r_xprt: controlling transport
510     + *
511     + * Returns 0 on success or a negative errno on failure.
512     + */
513     +int
514     + rpcrdma_create_rep(struct rpcrdma_xprt *r_xprt)
515     {
516     struct rpcrdma_create_data_internal *cdata = &r_xprt->rx_data;
517     + struct rpcrdma_buffer *buf = &r_xprt->rx_buf;
518     struct rpcrdma_ia *ia = &r_xprt->rx_ia;
519     struct rpcrdma_rep *rep;
520     int rc;
521     @@ -919,12 +926,18 @@ rpcrdma_create_rep(struct rpcrdma_xprt *r_xprt)
522     rep->rr_recv_wr.wr_cqe = &rep->rr_cqe;
523     rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;
524     rep->rr_recv_wr.num_sge = 1;
525     - return rep;
526     +
527     + spin_lock(&buf->rb_lock);
528     + list_add(&rep->rr_list, &buf->rb_recv_bufs);
529     + spin_unlock(&buf->rb_lock);
530     + return 0;
531    
532     out_free:
533     kfree(rep);
534     out:
535     - return ERR_PTR(rc);
536     + dprintk("RPC: %s: reply buffer %d alloc failed\n",
537     + __func__, rc);
538     + return rc;
539     }
540    
541     int
542     @@ -967,17 +980,10 @@ rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
543     }
544    
545     INIT_LIST_HEAD(&buf->rb_recv_bufs);
546     - for (i = 0; i < buf->rb_max_requests + RPCRDMA_MAX_BC_REQUESTS; i++) {
547     - struct rpcrdma_rep *rep;
548     -
549     - rep = rpcrdma_create_rep(r_xprt);
550     - if (IS_ERR(rep)) {
551     - dprintk("RPC: %s: reply buffer %d alloc failed\n",
552     - __func__, i);
553     - rc = PTR_ERR(rep);
554     + for (i = 0; i <= buf->rb_max_requests; i++) {
555     + rc = rpcrdma_create_rep(r_xprt);
556     + if (rc)
557     goto out;
558     - }
559     - list_add(&rep->rr_list, &buf->rb_recv_bufs);
560     }
561    
562     return 0;
563     diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
564     index 48989d5b2883..002305c38f7c 100644
565     --- a/net/sunrpc/xprtrdma/xprt_rdma.h
566     +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
567     @@ -502,8 +502,8 @@ int rpcrdma_ep_post_recv(struct rpcrdma_ia *, struct rpcrdma_rep *);
568     * Buffer calls - xprtrdma/verbs.c
569     */
570     struct rpcrdma_req *rpcrdma_create_req(struct rpcrdma_xprt *);
571     -struct rpcrdma_rep *rpcrdma_create_rep(struct rpcrdma_xprt *);
572     void rpcrdma_destroy_req(struct rpcrdma_req *);
573     +int rpcrdma_create_rep(struct rpcrdma_xprt *r_xprt);
574     int rpcrdma_buffer_create(struct rpcrdma_xprt *);
575     void rpcrdma_buffer_destroy(struct rpcrdma_buffer *);
576    
577     diff --git a/scripts/config b/scripts/config
578     index 026aeb4f32ee..73de17d39698 100755
579     --- a/scripts/config
580     +++ b/scripts/config
581     @@ -6,6 +6,9 @@ myname=${0##*/}
582     # If no prefix forced, use the default CONFIG_
583     CONFIG_="${CONFIG_-CONFIG_}"
584    
585     +# We use an uncommon delimiter for sed substitutions
586     +SED_DELIM=$(echo -en "\001")
587     +
588     usage() {
589     cat >&2 <<EOL
590     Manipulate options in a .config file from the command line.
591     @@ -82,7 +85,7 @@ txt_subst() {
592     local infile="$3"
593     local tmpfile="$infile.swp"
594    
595     - sed -e "s:$before:$after:" "$infile" >"$tmpfile"
596     + sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile"
597     # replace original file with the edited one
598     mv "$tmpfile" "$infile"
599     }
600     diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
601     index ab16b81c0c7f..16a692fc7f64 100644
602     --- a/sound/pci/hda/hda_intel.c
603     +++ b/sound/pci/hda/hda_intel.c
604     @@ -1966,9 +1966,10 @@ static const struct hdac_io_ops pci_hda_io_ops = {
605     * some HD-audio PCI entries are exposed without any codecs, and such devices
606     * should be ignored from the beginning.
607     */
608     -static const struct snd_pci_quirk driver_blacklist[] = {
609     - SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0),
610     - SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0),
611     +static const struct pci_device_id driver_blacklist[] = {
612     + { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */
613     + { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */
614     + { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */
615     {}
616     };
617    
618     @@ -1991,7 +1992,7 @@ static int azx_probe(struct pci_dev *pci,
619     bool schedule_probe;
620     int err;
621    
622     - if (snd_pci_quirk_lookup(pci, driver_blacklist)) {
623     + if (pci_match_id(driver_blacklist, pci)) {
624     dev_info(&pci->dev, "Skipping the blacklisted device\n");
625     return -ENODEV;
626     }
627     diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
628     index 39810b713d5f..0c2a1413a8f5 100644
629     --- a/sound/soc/codecs/sgtl5000.c
630     +++ b/sound/soc/codecs/sgtl5000.c
631     @@ -1464,6 +1464,40 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
632     dev_err(&client->dev,
633     "Error %d initializing CHIP_CLK_CTRL\n", ret);
634    
635     + /* Mute everything to avoid pop from the following power-up */
636     + ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_CTRL,
637     + SGTL5000_CHIP_ANA_CTRL_DEFAULT);
638     + if (ret) {
639     + dev_err(&client->dev,
640     + "Error %d muting outputs via CHIP_ANA_CTRL\n", ret);
641     + goto disable_clk;
642     + }
643     +
644     + /*
645     + * If VAG is powered-on (e.g. from previous boot), it would be disabled
646     + * by the write to ANA_POWER in later steps of the probe code. This
647     + * may create a loud pop even with all outputs muted. The proper way
648     + * to circumvent this is disabling the bit first and waiting the proper
649     + * cool-down time.
650     + */
651     + ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, &value);
652     + if (ret) {
653     + dev_err(&client->dev, "Failed to read ANA_POWER: %d\n", ret);
654     + goto disable_clk;
655     + }
656     + if (value & SGTL5000_VAG_POWERUP) {
657     + ret = regmap_update_bits(sgtl5000->regmap,
658     + SGTL5000_CHIP_ANA_POWER,
659     + SGTL5000_VAG_POWERUP,
660     + 0);
661     + if (ret) {
662     + dev_err(&client->dev, "Error %d disabling VAG\n", ret);
663     + goto disable_clk;
664     + }
665     +
666     + msleep(SGTL5000_VAG_POWERDOWN_DELAY);
667     + }
668     +
669     /* Follow section 2.2.1.1 of AN3663 */
670     ana_pwr = SGTL5000_ANA_POWER_DEFAULT;
671     if (sgtl5000->num_supplies <= VDDD) {
672     diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h
673     index 22f3442af982..9ea41749d037 100644
674     --- a/sound/soc/codecs/sgtl5000.h
675     +++ b/sound/soc/codecs/sgtl5000.h
676     @@ -236,6 +236,7 @@
677     /*
678     * SGTL5000_CHIP_ANA_CTRL
679     */
680     +#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133
681     #define SGTL5000_LINE_OUT_MUTE 0x0100
682     #define SGTL5000_HP_SEL_MASK 0x0040
683     #define SGTL5000_HP_SEL_SHIFT 6
684     diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
685     index 1b2ce334bb3f..47c074d73e61 100644
686     --- a/tools/testing/selftests/ipc/msgque.c
687     +++ b/tools/testing/selftests/ipc/msgque.c
688     @@ -135,7 +135,7 @@ int dump_queue(struct msgque_data *msgque)
689     for (kern_id = 0; kern_id < 256; kern_id++) {
690     ret = msgctl(kern_id, MSG_STAT, &ds);
691     if (ret < 0) {
692     - if (errno == -EINVAL)
693     + if (errno == EINVAL)
694     continue;
695     printf("Failed to get stats for IPC queue with id %d\n",
696     kern_id);