1 |
commit: 670be8e162dc47617539d7f1b0ccc5fc844d9512 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 11 22:51:14 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 11 22:51:14 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=670be8e1 |
7 |
|
8 |
Linux patch 4.14.180 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1179_linux-4.14.180.patch | 866 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 870 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 0eb3dcb..83c6864 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -759,6 +759,10 @@ Patch: 1178_linux-4.14.179.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.179 |
23 |
|
24 |
+Patch: 1179_linux-4.14.180.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.180 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1179_linux-4.14.180.patch b/1179_linux-4.14.180.patch |
33 |
new file mode 100644 |
34 |
index 0000000..6be6ec5 |
35 |
--- /dev/null |
36 |
+++ b/1179_linux-4.14.180.patch |
37 |
@@ -0,0 +1,866 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index d2baacc1b0f6..525565f44b17 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 179 |
47 |
++SUBLEVEL = 180 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c |
52 |
+index 6ca1b3a1e196..54e949d5452d 100644 |
53 |
+--- a/arch/powerpc/kernel/pci_of_scan.c |
54 |
++++ b/arch/powerpc/kernel/pci_of_scan.c |
55 |
+@@ -82,10 +82,16 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev) |
56 |
+ const __be32 *addrs; |
57 |
+ u32 i; |
58 |
+ int proplen; |
59 |
++ bool mark_unset = false; |
60 |
+ |
61 |
+ addrs = of_get_property(node, "assigned-addresses", &proplen); |
62 |
+- if (!addrs) |
63 |
+- return; |
64 |
++ if (!addrs || !proplen) { |
65 |
++ addrs = of_get_property(node, "reg", &proplen); |
66 |
++ if (!addrs || !proplen) |
67 |
++ return; |
68 |
++ mark_unset = true; |
69 |
++ } |
70 |
++ |
71 |
+ pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs); |
72 |
+ for (; proplen >= 20; proplen -= 20, addrs += 5) { |
73 |
+ flags = pci_parse_of_flags(of_read_number(addrs, 1), 0); |
74 |
+@@ -110,6 +116,8 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev) |
75 |
+ continue; |
76 |
+ } |
77 |
+ res->flags = flags; |
78 |
++ if (mark_unset) |
79 |
++ res->flags |= IORESOURCE_UNSET; |
80 |
+ res->name = pci_name(dev); |
81 |
+ region.start = base; |
82 |
+ region.end = base + size - 1; |
83 |
+diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c |
84 |
+index 35c842aa8705..4c7cf8787a84 100644 |
85 |
+--- a/arch/s390/kernel/diag.c |
86 |
++++ b/arch/s390/kernel/diag.c |
87 |
+@@ -128,7 +128,7 @@ void diag_stat_inc(enum diag_stat_enum nr) |
88 |
+ } |
89 |
+ EXPORT_SYMBOL(diag_stat_inc); |
90 |
+ |
91 |
+-void diag_stat_inc_norecursion(enum diag_stat_enum nr) |
92 |
++void notrace diag_stat_inc_norecursion(enum diag_stat_enum nr) |
93 |
+ { |
94 |
+ this_cpu_inc(diag_stat.counter[nr]); |
95 |
+ trace_s390_diagnose_norecursion(diag_map[nr].code); |
96 |
+diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c |
97 |
+index b649a6538350..808f4fbe869e 100644 |
98 |
+--- a/arch/s390/kernel/smp.c |
99 |
++++ b/arch/s390/kernel/smp.c |
100 |
+@@ -406,7 +406,7 @@ int smp_find_processor_id(u16 address) |
101 |
+ return -1; |
102 |
+ } |
103 |
+ |
104 |
+-bool arch_vcpu_is_preempted(int cpu) |
105 |
++bool notrace arch_vcpu_is_preempted(int cpu) |
106 |
+ { |
107 |
+ if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu)) |
108 |
+ return false; |
109 |
+@@ -416,7 +416,7 @@ bool arch_vcpu_is_preempted(int cpu) |
110 |
+ } |
111 |
+ EXPORT_SYMBOL(arch_vcpu_is_preempted); |
112 |
+ |
113 |
+-void smp_yield_cpu(int cpu) |
114 |
++void notrace smp_yield_cpu(int cpu) |
115 |
+ { |
116 |
+ if (MACHINE_HAS_DIAG9C) { |
117 |
+ diag_stat_inc_norecursion(DIAG_STAT_X09C); |
118 |
+diff --git a/arch/s390/kernel/trace.c b/arch/s390/kernel/trace.c |
119 |
+index 490b52e85014..11a669f3cc93 100644 |
120 |
+--- a/arch/s390/kernel/trace.c |
121 |
++++ b/arch/s390/kernel/trace.c |
122 |
+@@ -14,7 +14,7 @@ EXPORT_TRACEPOINT_SYMBOL(s390_diagnose); |
123 |
+ |
124 |
+ static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth); |
125 |
+ |
126 |
+-void trace_s390_diagnose_norecursion(int diag_nr) |
127 |
++void notrace trace_s390_diagnose_norecursion(int diag_nr) |
128 |
+ { |
129 |
+ unsigned long flags; |
130 |
+ unsigned int *depth; |
131 |
+diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c |
132 |
+index 434e6dced6b7..274d36915110 100644 |
133 |
+--- a/drivers/net/dsa/b53/b53_common.c |
134 |
++++ b/drivers/net/dsa/b53/b53_common.c |
135 |
+@@ -1094,6 +1094,7 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, |
136 |
+ u16 vid, struct b53_arl_entry *ent, u8 *idx, |
137 |
+ bool is_valid) |
138 |
+ { |
139 |
++ DECLARE_BITMAP(free_bins, B53_ARLTBL_MAX_BIN_ENTRIES); |
140 |
+ unsigned int i; |
141 |
+ int ret; |
142 |
+ |
143 |
+@@ -1101,6 +1102,8 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, |
144 |
+ if (ret) |
145 |
+ return ret; |
146 |
+ |
147 |
++ bitmap_zero(free_bins, dev->num_arl_entries); |
148 |
++ |
149 |
+ /* Read the bins */ |
150 |
+ for (i = 0; i < dev->num_arl_entries; i++) { |
151 |
+ u64 mac_vid; |
152 |
+@@ -1112,13 +1115,21 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, |
153 |
+ B53_ARLTBL_DATA_ENTRY(i), &fwd_entry); |
154 |
+ b53_arl_to_entry(ent, mac_vid, fwd_entry); |
155 |
+ |
156 |
+- if (!(fwd_entry & ARLTBL_VALID)) |
157 |
++ if (!(fwd_entry & ARLTBL_VALID)) { |
158 |
++ set_bit(i, free_bins); |
159 |
+ continue; |
160 |
++ } |
161 |
+ if ((mac_vid & ARLTBL_MAC_MASK) != mac) |
162 |
+ continue; |
163 |
+ *idx = i; |
164 |
++ return 0; |
165 |
+ } |
166 |
+ |
167 |
++ if (bitmap_weight(free_bins, dev->num_arl_entries) == 0) |
168 |
++ return -ENOSPC; |
169 |
++ |
170 |
++ *idx = find_first_bit(free_bins, dev->num_arl_entries); |
171 |
++ |
172 |
+ return -ENOENT; |
173 |
+ } |
174 |
+ |
175 |
+@@ -1148,10 +1159,21 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, |
176 |
+ if (op) |
177 |
+ return ret; |
178 |
+ |
179 |
+- /* We could not find a matching MAC, so reset to a new entry */ |
180 |
+- if (ret) { |
181 |
++ switch (ret) { |
182 |
++ case -ENOSPC: |
183 |
++ dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n", |
184 |
++ addr, vid); |
185 |
++ return is_valid ? ret : 0; |
186 |
++ case -ENOENT: |
187 |
++ /* We could not find a matching MAC, so reset to a new entry */ |
188 |
++ dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n", |
189 |
++ addr, vid, idx); |
190 |
+ fwd_entry = 0; |
191 |
+- idx = 1; |
192 |
++ break; |
193 |
++ default: |
194 |
++ dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n", |
195 |
++ addr, vid, idx); |
196 |
++ break; |
197 |
+ } |
198 |
+ |
199 |
+ memset(&ent, 0, sizeof(ent)); |
200 |
+diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h |
201 |
+index 1b2a337d673d..247aef92b759 100644 |
202 |
+--- a/drivers/net/dsa/b53/b53_regs.h |
203 |
++++ b/drivers/net/dsa/b53/b53_regs.h |
204 |
+@@ -313,6 +313,9 @@ |
205 |
+ #define ARLTBL_STATIC BIT(15) |
206 |
+ #define ARLTBL_VALID BIT(16) |
207 |
+ |
208 |
++/* Maximum number of bin entries in the ARL for all switches */ |
209 |
++#define B53_ARLTBL_MAX_BIN_ENTRIES 4 |
210 |
++ |
211 |
+ /* ARL Search Control Register (8 bit) */ |
212 |
+ #define B53_ARL_SRCH_CTL 0x50 |
213 |
+ #define B53_ARL_SRCH_CTL_25 0x20 |
214 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c |
215 |
+index f48f7d104af2..123ee5c11bc0 100644 |
216 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c |
217 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c |
218 |
+@@ -645,7 +645,8 @@ static struct sk_buff *bcm_sysport_rx_refill(struct bcm_sysport_priv *priv, |
219 |
+ dma_addr_t mapping; |
220 |
+ |
221 |
+ /* Allocate a new SKB for a new packet */ |
222 |
+- skb = netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH); |
223 |
++ skb = __netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH, |
224 |
++ GFP_ATOMIC | __GFP_NOWARN); |
225 |
+ if (!skb) { |
226 |
+ priv->mib.alloc_rx_buff_failed++; |
227 |
+ netif_err(priv, rx_err, ndev, "SKB alloc failed\n"); |
228 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
229 |
+index 4b3660c63b86..38391230ca86 100644 |
230 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
231 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
232 |
+@@ -1674,7 +1674,8 @@ static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv, |
233 |
+ dma_addr_t mapping; |
234 |
+ |
235 |
+ /* Allocate a new Rx skb */ |
236 |
+- skb = netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT); |
237 |
++ skb = __netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT, |
238 |
++ GFP_ATOMIC | __GFP_NOWARN); |
239 |
+ if (!skb) { |
240 |
+ priv->mib.alloc_rx_buff_failed++; |
241 |
+ netif_err(priv, rx_err, priv->dev, |
242 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
243 |
+index 5b3b06a0a3bf..33407df6bea6 100644 |
244 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
245 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
246 |
+@@ -274,16 +274,19 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) |
247 |
+ phymode == PHY_INTERFACE_MODE_MII || |
248 |
+ phymode == PHY_INTERFACE_MODE_GMII || |
249 |
+ phymode == PHY_INTERFACE_MODE_SGMII) { |
250 |
+- ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); |
251 |
+ regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, |
252 |
+ &module); |
253 |
+ module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2)); |
254 |
+ regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, |
255 |
+ module); |
256 |
+- } else { |
257 |
+- ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2)); |
258 |
+ } |
259 |
+ |
260 |
++ if (dwmac->f2h_ptp_ref_clk) |
261 |
++ ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); |
262 |
++ else |
263 |
++ ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << |
264 |
++ (reg_shift / 2)); |
265 |
++ |
266 |
+ regmap_write(sys_mgr_base_addr, reg_offset, ctrl); |
267 |
+ |
268 |
+ /* Deassert reset for the phy configuration to be sampled by |
269 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
270 |
+index 41d528fbebb4..ccf7381c8bae 100644 |
271 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
272 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
273 |
+@@ -36,12 +36,16 @@ static u32 stmmac_config_sub_second_increment(void __iomem *ioaddr, |
274 |
+ unsigned long data; |
275 |
+ u32 reg_value; |
276 |
+ |
277 |
+- /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second |
278 |
+- * formula = (1/ptp_clock) * 1000000000 |
279 |
+- * where ptp_clock is 50MHz if fine method is used to update system |
280 |
++ /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second |
281 |
++ * increment to twice the number of nanoseconds of a clock cycle. |
282 |
++ * The calculation of the default_addend value by the caller will set it |
283 |
++ * to mid-range = 2^31 when the remainder of this division is zero, |
284 |
++ * which will make the accumulator overflow once every 2 ptp_clock |
285 |
++ * cycles, adding twice the number of nanoseconds of a clock cycle : |
286 |
++ * 2000000000ULL / ptp_clock. |
287 |
+ */ |
288 |
+ if (value & PTP_TCR_TSCFUPDT) |
289 |
+- data = (1000000000ULL / 50000000); |
290 |
++ data = (2000000000ULL / ptp_clock); |
291 |
+ else |
292 |
+ data = (1000000000ULL / ptp_clock); |
293 |
+ |
294 |
+diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c |
295 |
+index 502c346aa790..7d396c81ec3e 100644 |
296 |
+--- a/drivers/net/wimax/i2400m/usb-fw.c |
297 |
++++ b/drivers/net/wimax/i2400m/usb-fw.c |
298 |
+@@ -354,6 +354,7 @@ out: |
299 |
+ usb_autopm_put_interface(i2400mu->usb_iface); |
300 |
+ d_fnend(8, dev, "(i2400m %p ack %p size %zu) = %ld\n", |
301 |
+ i2400m, ack, ack_size, (long) result); |
302 |
++ usb_put_urb(¬if_urb); |
303 |
+ return result; |
304 |
+ |
305 |
+ error_exceeded: |
306 |
+diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c |
307 |
+index 6391dc5b0ebe..834e88e20550 100644 |
308 |
+--- a/drivers/vhost/vsock.c |
309 |
++++ b/drivers/vhost/vsock.c |
310 |
+@@ -499,6 +499,11 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) |
311 |
+ mutex_unlock(&vq->mutex); |
312 |
+ } |
313 |
+ |
314 |
++ /* Some packets may have been queued before the device was started, |
315 |
++ * let's kick the send worker to send them. |
316 |
++ */ |
317 |
++ vhost_work_queue(&vsock->dev, &vsock->send_pkt_work); |
318 |
++ |
319 |
+ mutex_unlock(&vsock->dev.mutex); |
320 |
+ return 0; |
321 |
+ |
322 |
+diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c |
323 |
+index 697edc92dff2..58e7288e5151 100644 |
324 |
+--- a/fs/cifs/connect.c |
325 |
++++ b/fs/cifs/connect.c |
326 |
+@@ -348,8 +348,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server) |
327 |
+ return rc; |
328 |
+ } |
329 |
+ |
330 |
++ spin_lock(&cifs_tcp_ses_lock); |
331 |
+ rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr, |
332 |
+ strlen(ipaddr)); |
333 |
++ spin_unlock(&cifs_tcp_ses_lock); |
334 |
+ kfree(ipaddr); |
335 |
+ |
336 |
+ return !rc ? -1 : 0; |
337 |
+diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h |
338 |
+index 2e179778576c..c316ff030b1d 100644 |
339 |
+--- a/include/linux/ieee80211.h |
340 |
++++ b/include/linux/ieee80211.h |
341 |
+@@ -621,6 +621,15 @@ static inline bool ieee80211_is_qos_nullfunc(__le16 fc) |
342 |
+ cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); |
343 |
+ } |
344 |
+ |
345 |
++/** |
346 |
++ * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame |
347 |
++ * @fc: frame control bytes in little-endian byteorder |
348 |
++ */ |
349 |
++static inline bool ieee80211_is_any_nullfunc(__le16 fc) |
350 |
++{ |
351 |
++ return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); |
352 |
++} |
353 |
++ |
354 |
+ /** |
355 |
+ * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU |
356 |
+ * @fc: frame control field in little-endian byteorder |
357 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
358 |
+index 207d7c35214f..62c390a1cea8 100644 |
359 |
+--- a/kernel/trace/trace.c |
360 |
++++ b/kernel/trace/trace.c |
361 |
+@@ -7720,6 +7720,7 @@ static int instance_mkdir(const char *name) |
362 |
+ struct trace_array *tr; |
363 |
+ int ret; |
364 |
+ |
365 |
++ mutex_lock(&event_mutex); |
366 |
+ mutex_lock(&trace_types_lock); |
367 |
+ |
368 |
+ ret = -EEXIST; |
369 |
+@@ -7775,6 +7776,7 @@ static int instance_mkdir(const char *name) |
370 |
+ list_add(&tr->list, &ftrace_trace_arrays); |
371 |
+ |
372 |
+ mutex_unlock(&trace_types_lock); |
373 |
++ mutex_unlock(&event_mutex); |
374 |
+ |
375 |
+ return 0; |
376 |
+ |
377 |
+@@ -7786,6 +7788,7 @@ static int instance_mkdir(const char *name) |
378 |
+ |
379 |
+ out_unlock: |
380 |
+ mutex_unlock(&trace_types_lock); |
381 |
++ mutex_unlock(&event_mutex); |
382 |
+ |
383 |
+ return ret; |
384 |
+ |
385 |
+@@ -7798,6 +7801,7 @@ static int instance_rmdir(const char *name) |
386 |
+ int ret; |
387 |
+ int i; |
388 |
+ |
389 |
++ mutex_lock(&event_mutex); |
390 |
+ mutex_lock(&trace_types_lock); |
391 |
+ |
392 |
+ ret = -ENODEV; |
393 |
+@@ -7843,6 +7847,7 @@ static int instance_rmdir(const char *name) |
394 |
+ |
395 |
+ out_unlock: |
396 |
+ mutex_unlock(&trace_types_lock); |
397 |
++ mutex_unlock(&event_mutex); |
398 |
+ |
399 |
+ return ret; |
400 |
+ } |
401 |
+diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c |
402 |
+index 2b0a01b2be2d..421166a39253 100644 |
403 |
+--- a/kernel/trace/trace_events.c |
404 |
++++ b/kernel/trace/trace_events.c |
405 |
+@@ -1403,8 +1403,8 @@ static int subsystem_open(struct inode *inode, struct file *filp) |
406 |
+ return -ENODEV; |
407 |
+ |
408 |
+ /* Make sure the system still exists */ |
409 |
+- mutex_lock(&trace_types_lock); |
410 |
+ mutex_lock(&event_mutex); |
411 |
++ mutex_lock(&trace_types_lock); |
412 |
+ list_for_each_entry(tr, &ftrace_trace_arrays, list) { |
413 |
+ list_for_each_entry(dir, &tr->systems, list) { |
414 |
+ if (dir == inode->i_private) { |
415 |
+@@ -1418,8 +1418,8 @@ static int subsystem_open(struct inode *inode, struct file *filp) |
416 |
+ } |
417 |
+ } |
418 |
+ exit_loop: |
419 |
+- mutex_unlock(&event_mutex); |
420 |
+ mutex_unlock(&trace_types_lock); |
421 |
++ mutex_unlock(&event_mutex); |
422 |
+ |
423 |
+ if (!system) |
424 |
+ return -ENODEV; |
425 |
+@@ -2305,15 +2305,15 @@ static void __add_event_to_tracers(struct trace_event_call *call); |
426 |
+ int trace_add_event_call(struct trace_event_call *call) |
427 |
+ { |
428 |
+ int ret; |
429 |
+- mutex_lock(&trace_types_lock); |
430 |
+ mutex_lock(&event_mutex); |
431 |
++ mutex_lock(&trace_types_lock); |
432 |
+ |
433 |
+ ret = __register_event(call, NULL); |
434 |
+ if (ret >= 0) |
435 |
+ __add_event_to_tracers(call); |
436 |
+ |
437 |
+- mutex_unlock(&event_mutex); |
438 |
+ mutex_unlock(&trace_types_lock); |
439 |
++ mutex_unlock(&event_mutex); |
440 |
+ return ret; |
441 |
+ } |
442 |
+ |
443 |
+@@ -2367,13 +2367,13 @@ int trace_remove_event_call(struct trace_event_call *call) |
444 |
+ { |
445 |
+ int ret; |
446 |
+ |
447 |
+- mutex_lock(&trace_types_lock); |
448 |
+ mutex_lock(&event_mutex); |
449 |
++ mutex_lock(&trace_types_lock); |
450 |
+ down_write(&trace_event_sem); |
451 |
+ ret = probe_remove_event_call(call); |
452 |
+ up_write(&trace_event_sem); |
453 |
+- mutex_unlock(&event_mutex); |
454 |
+ mutex_unlock(&trace_types_lock); |
455 |
++ mutex_unlock(&event_mutex); |
456 |
+ |
457 |
+ return ret; |
458 |
+ } |
459 |
+@@ -2435,8 +2435,8 @@ static int trace_module_notify(struct notifier_block *self, |
460 |
+ { |
461 |
+ struct module *mod = data; |
462 |
+ |
463 |
+- mutex_lock(&trace_types_lock); |
464 |
+ mutex_lock(&event_mutex); |
465 |
++ mutex_lock(&trace_types_lock); |
466 |
+ switch (val) { |
467 |
+ case MODULE_STATE_COMING: |
468 |
+ trace_module_add_events(mod); |
469 |
+@@ -2445,8 +2445,8 @@ static int trace_module_notify(struct notifier_block *self, |
470 |
+ trace_module_remove_events(mod); |
471 |
+ break; |
472 |
+ } |
473 |
+- mutex_unlock(&event_mutex); |
474 |
+ mutex_unlock(&trace_types_lock); |
475 |
++ mutex_unlock(&event_mutex); |
476 |
+ |
477 |
+ return 0; |
478 |
+ } |
479 |
+@@ -2961,24 +2961,24 @@ create_event_toplevel_files(struct dentry *parent, struct trace_array *tr) |
480 |
+ * creates the event hierachry in the @parent/events directory. |
481 |
+ * |
482 |
+ * Returns 0 on success. |
483 |
++ * |
484 |
++ * Must be called with event_mutex held. |
485 |
+ */ |
486 |
+ int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr) |
487 |
+ { |
488 |
+ int ret; |
489 |
+ |
490 |
+- mutex_lock(&event_mutex); |
491 |
++ lockdep_assert_held(&event_mutex); |
492 |
+ |
493 |
+ ret = create_event_toplevel_files(parent, tr); |
494 |
+ if (ret) |
495 |
+- goto out_unlock; |
496 |
++ goto out; |
497 |
+ |
498 |
+ down_write(&trace_event_sem); |
499 |
+ __trace_add_event_dirs(tr); |
500 |
+ up_write(&trace_event_sem); |
501 |
+ |
502 |
+- out_unlock: |
503 |
+- mutex_unlock(&event_mutex); |
504 |
+- |
505 |
++ out: |
506 |
+ return ret; |
507 |
+ } |
508 |
+ |
509 |
+@@ -3007,9 +3007,10 @@ early_event_add_tracer(struct dentry *parent, struct trace_array *tr) |
510 |
+ return ret; |
511 |
+ } |
512 |
+ |
513 |
++/* Must be called with event_mutex held */ |
514 |
+ int event_trace_del_tracer(struct trace_array *tr) |
515 |
+ { |
516 |
+- mutex_lock(&event_mutex); |
517 |
++ lockdep_assert_held(&event_mutex); |
518 |
+ |
519 |
+ /* Disable any event triggers and associated soft-disabled events */ |
520 |
+ clear_event_triggers(tr); |
521 |
+@@ -3030,8 +3031,6 @@ int event_trace_del_tracer(struct trace_array *tr) |
522 |
+ |
523 |
+ tr->event_dir = NULL; |
524 |
+ |
525 |
+- mutex_unlock(&event_mutex); |
526 |
+- |
527 |
+ return 0; |
528 |
+ } |
529 |
+ |
530 |
+diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h |
531 |
+index 08c60d10747f..e01b705556aa 100644 |
532 |
+--- a/lib/mpi/longlong.h |
533 |
++++ b/lib/mpi/longlong.h |
534 |
+@@ -756,22 +756,22 @@ do { \ |
535 |
+ do { \ |
536 |
+ if (__builtin_constant_p(bh) && (bh) == 0) \ |
537 |
+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ |
538 |
+- : "=r" ((USItype)(sh)), \ |
539 |
+- "=&r" ((USItype)(sl)) \ |
540 |
++ : "=r" (sh), \ |
541 |
++ "=&r" (sl) \ |
542 |
+ : "%r" ((USItype)(ah)), \ |
543 |
+ "%r" ((USItype)(al)), \ |
544 |
+ "rI" ((USItype)(bl))); \ |
545 |
+ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ |
546 |
+ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ |
547 |
+- : "=r" ((USItype)(sh)), \ |
548 |
+- "=&r" ((USItype)(sl)) \ |
549 |
++ : "=r" (sh), \ |
550 |
++ "=&r" (sl) \ |
551 |
+ : "%r" ((USItype)(ah)), \ |
552 |
+ "%r" ((USItype)(al)), \ |
553 |
+ "rI" ((USItype)(bl))); \ |
554 |
+ else \ |
555 |
+ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ |
556 |
+- : "=r" ((USItype)(sh)), \ |
557 |
+- "=&r" ((USItype)(sl)) \ |
558 |
++ : "=r" (sh), \ |
559 |
++ "=&r" (sl) \ |
560 |
+ : "%r" ((USItype)(ah)), \ |
561 |
+ "r" ((USItype)(bh)), \ |
562 |
+ "%r" ((USItype)(al)), \ |
563 |
+@@ -781,36 +781,36 @@ do { \ |
564 |
+ do { \ |
565 |
+ if (__builtin_constant_p(ah) && (ah) == 0) \ |
566 |
+ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ |
567 |
+- : "=r" ((USItype)(sh)), \ |
568 |
+- "=&r" ((USItype)(sl)) \ |
569 |
++ : "=r" (sh), \ |
570 |
++ "=&r" (sl) \ |
571 |
+ : "r" ((USItype)(bh)), \ |
572 |
+ "rI" ((USItype)(al)), \ |
573 |
+ "r" ((USItype)(bl))); \ |
574 |
+ else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \ |
575 |
+ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ |
576 |
+- : "=r" ((USItype)(sh)), \ |
577 |
+- "=&r" ((USItype)(sl)) \ |
578 |
++ : "=r" (sh), \ |
579 |
++ "=&r" (sl) \ |
580 |
+ : "r" ((USItype)(bh)), \ |
581 |
+ "rI" ((USItype)(al)), \ |
582 |
+ "r" ((USItype)(bl))); \ |
583 |
+ else if (__builtin_constant_p(bh) && (bh) == 0) \ |
584 |
+ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ |
585 |
+- : "=r" ((USItype)(sh)), \ |
586 |
+- "=&r" ((USItype)(sl)) \ |
587 |
++ : "=r" (sh), \ |
588 |
++ "=&r" (sl) \ |
589 |
+ : "r" ((USItype)(ah)), \ |
590 |
+ "rI" ((USItype)(al)), \ |
591 |
+ "r" ((USItype)(bl))); \ |
592 |
+ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ |
593 |
+ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ |
594 |
+- : "=r" ((USItype)(sh)), \ |
595 |
+- "=&r" ((USItype)(sl)) \ |
596 |
++ : "=r" (sh), \ |
597 |
++ "=&r" (sl) \ |
598 |
+ : "r" ((USItype)(ah)), \ |
599 |
+ "rI" ((USItype)(al)), \ |
600 |
+ "r" ((USItype)(bl))); \ |
601 |
+ else \ |
602 |
+ __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ |
603 |
+- : "=r" ((USItype)(sh)), \ |
604 |
+- "=&r" ((USItype)(sl)) \ |
605 |
++ : "=r" (sh), \ |
606 |
++ "=&r" (sl) \ |
607 |
+ : "r" ((USItype)(ah)), \ |
608 |
+ "r" ((USItype)(bh)), \ |
609 |
+ "rI" ((USItype)(al)), \ |
610 |
+@@ -821,7 +821,7 @@ do { \ |
611 |
+ do { \ |
612 |
+ USItype __m0 = (m0), __m1 = (m1); \ |
613 |
+ __asm__ ("mulhwu %0,%1,%2" \ |
614 |
+- : "=r" ((USItype) ph) \ |
615 |
++ : "=r" (ph) \ |
616 |
+ : "%r" (__m0), \ |
617 |
+ "r" (__m1)); \ |
618 |
+ (pl) = __m0 * __m1; \ |
619 |
+diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c |
620 |
+index 67feeb207dad..668330ace961 100644 |
621 |
+--- a/net/core/netclassid_cgroup.c |
622 |
++++ b/net/core/netclassid_cgroup.c |
623 |
+@@ -131,10 +131,8 @@ static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft, |
624 |
+ cs->classid = (u32)value; |
625 |
+ |
626 |
+ css_task_iter_start(css, 0, &it); |
627 |
+- while ((p = css_task_iter_next(&it))) { |
628 |
++ while ((p = css_task_iter_next(&it))) |
629 |
+ update_classid_task(p, cs->classid); |
630 |
+- cond_resched(); |
631 |
+- } |
632 |
+ css_task_iter_end(&it); |
633 |
+ |
634 |
+ return 0; |
635 |
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
636 |
+index 36bd59ff49c4..ab26b8b95471 100644 |
637 |
+--- a/net/mac80211/mlme.c |
638 |
++++ b/net/mac80211/mlme.c |
639 |
+@@ -2273,7 +2273,7 @@ void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, |
640 |
+ if (!ieee80211_is_data(hdr->frame_control)) |
641 |
+ return; |
642 |
+ |
643 |
+- if (ieee80211_is_nullfunc(hdr->frame_control) && |
644 |
++ if (ieee80211_is_any_nullfunc(hdr->frame_control) && |
645 |
+ sdata->u.mgd.probe_send_count > 0) { |
646 |
+ if (ack) |
647 |
+ ieee80211_sta_reset_conn_monitor(sdata); |
648 |
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c |
649 |
+index 7c92b1471c34..56d7a3dfa543 100644 |
650 |
+--- a/net/mac80211/rx.c |
651 |
++++ b/net/mac80211/rx.c |
652 |
+@@ -1255,8 +1255,7 @@ ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx) |
653 |
+ return RX_CONTINUE; |
654 |
+ |
655 |
+ if (ieee80211_is_ctl(hdr->frame_control) || |
656 |
+- ieee80211_is_nullfunc(hdr->frame_control) || |
657 |
+- ieee80211_is_qos_nullfunc(hdr->frame_control) || |
658 |
++ ieee80211_is_any_nullfunc(hdr->frame_control) || |
659 |
+ is_multicast_ether_addr(hdr->addr1)) |
660 |
+ return RX_CONTINUE; |
661 |
+ |
662 |
+@@ -1643,8 +1642,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) |
663 |
+ * Drop (qos-)data::nullfunc frames silently, since they |
664 |
+ * are used only to control station power saving mode. |
665 |
+ */ |
666 |
+- if (ieee80211_is_nullfunc(hdr->frame_control) || |
667 |
+- ieee80211_is_qos_nullfunc(hdr->frame_control)) { |
668 |
++ if (ieee80211_is_any_nullfunc(hdr->frame_control)) { |
669 |
+ I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); |
670 |
+ |
671 |
+ /* |
672 |
+@@ -2134,7 +2132,7 @@ static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc) |
673 |
+ |
674 |
+ /* Drop unencrypted frames if key is set. */ |
675 |
+ if (unlikely(!ieee80211_has_protected(fc) && |
676 |
+- !ieee80211_is_nullfunc(fc) && |
677 |
++ !ieee80211_is_any_nullfunc(fc) && |
678 |
+ ieee80211_is_data(fc) && rx->key)) |
679 |
+ return -EACCES; |
680 |
+ |
681 |
+diff --git a/net/mac80211/status.c b/net/mac80211/status.c |
682 |
+index fbe7354aeac7..fcfa6714e492 100644 |
683 |
+--- a/net/mac80211/status.c |
684 |
++++ b/net/mac80211/status.c |
685 |
+@@ -478,8 +478,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, |
686 |
+ rcu_read_lock(); |
687 |
+ sdata = ieee80211_sdata_from_skb(local, skb); |
688 |
+ if (sdata) { |
689 |
+- if (ieee80211_is_nullfunc(hdr->frame_control) || |
690 |
+- ieee80211_is_qos_nullfunc(hdr->frame_control)) |
691 |
++ if (ieee80211_is_any_nullfunc(hdr->frame_control)) |
692 |
+ cfg80211_probe_status(sdata->dev, hdr->addr1, |
693 |
+ cookie, acked, |
694 |
+ GFP_ATOMIC); |
695 |
+@@ -856,7 +855,7 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, |
696 |
+ I802_DEBUG_INC(local->dot11FailedCount); |
697 |
+ } |
698 |
+ |
699 |
+- if ((ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)) && |
700 |
++ if (ieee80211_is_any_nullfunc(fc) && |
701 |
+ ieee80211_has_pm(fc) && |
702 |
+ ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS) && |
703 |
+ !(info->flags & IEEE80211_TX_CTL_INJECTED) && |
704 |
+diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c |
705 |
+index 513d071ccac7..1b1f2d6cb3f4 100644 |
706 |
+--- a/net/mac80211/tx.c |
707 |
++++ b/net/mac80211/tx.c |
708 |
+@@ -296,7 +296,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) |
709 |
+ if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && |
710 |
+ test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && |
711 |
+ !ieee80211_is_probe_req(hdr->frame_control) && |
712 |
+- !ieee80211_is_nullfunc(hdr->frame_control)) |
713 |
++ !ieee80211_is_any_nullfunc(hdr->frame_control)) |
714 |
+ /* |
715 |
+ * When software scanning only nullfunc frames (to notify |
716 |
+ * the sleep state to the AP) and probe requests (for the |
717 |
+diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c |
718 |
+index f67df16bd340..e698edd56bd5 100644 |
719 |
+--- a/net/sctp/sm_make_chunk.c |
720 |
++++ b/net/sctp/sm_make_chunk.c |
721 |
+@@ -858,7 +858,11 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc, |
722 |
+ struct sctp_chunk *retval; |
723 |
+ __u32 ctsn; |
724 |
+ |
725 |
+- ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); |
726 |
++ if (chunk && chunk->asoc) |
727 |
++ ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map); |
728 |
++ else |
729 |
++ ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); |
730 |
++ |
731 |
+ shut.cum_tsn_ack = htonl(ctsn); |
732 |
+ |
733 |
+ retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0, |
734 |
+diff --git a/scripts/config b/scripts/config |
735 |
+index e0e39826dae9..eee5b7f3a092 100755 |
736 |
+--- a/scripts/config |
737 |
++++ b/scripts/config |
738 |
+@@ -7,6 +7,9 @@ myname=${0##*/} |
739 |
+ # If no prefix forced, use the default CONFIG_ |
740 |
+ CONFIG_="${CONFIG_-CONFIG_}" |
741 |
+ |
742 |
++# We use an uncommon delimiter for sed substitutions |
743 |
++SED_DELIM=$(echo -en "\001") |
744 |
++ |
745 |
+ usage() { |
746 |
+ cat >&2 <<EOL |
747 |
+ Manipulate options in a .config file from the command line. |
748 |
+@@ -83,7 +86,7 @@ txt_subst() { |
749 |
+ local infile="$3" |
750 |
+ local tmpfile="$infile.swp" |
751 |
+ |
752 |
+- sed -e "s:$before:$after:" "$infile" >"$tmpfile" |
753 |
++ sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" |
754 |
+ # replace original file with the edited one |
755 |
+ mv "$tmpfile" "$infile" |
756 |
+ } |
757 |
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c |
758 |
+index 46670da04707..7779f5460715 100644 |
759 |
+--- a/sound/pci/hda/hda_intel.c |
760 |
++++ b/sound/pci/hda/hda_intel.c |
761 |
+@@ -2172,9 +2172,10 @@ static const struct hdac_io_ops pci_hda_io_ops = { |
762 |
+ * some HD-audio PCI entries are exposed without any codecs, and such devices |
763 |
+ * should be ignored from the beginning. |
764 |
+ */ |
765 |
+-static const struct snd_pci_quirk driver_blacklist[] = { |
766 |
+- SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0), |
767 |
+- SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0), |
768 |
++static const struct pci_device_id driver_blacklist[] = { |
769 |
++ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */ |
770 |
++ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ |
771 |
++ { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ |
772 |
+ {} |
773 |
+ }; |
774 |
+ |
775 |
+@@ -2197,7 +2198,7 @@ static int azx_probe(struct pci_dev *pci, |
776 |
+ bool schedule_probe; |
777 |
+ int err; |
778 |
+ |
779 |
+- if (snd_pci_quirk_lookup(pci, driver_blacklist)) { |
780 |
++ if (pci_match_id(driver_blacklist, pci)) { |
781 |
+ dev_info(&pci->dev, "Skipping the blacklisted device\n"); |
782 |
+ return -ENODEV; |
783 |
+ } |
784 |
+diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c |
785 |
+index 1c3626347e12..aeeec1144558 100644 |
786 |
+--- a/sound/soc/codecs/hdac_hdmi.c |
787 |
++++ b/sound/soc/codecs/hdac_hdmi.c |
788 |
+@@ -142,14 +142,14 @@ static struct hdac_hdmi_pcm * |
789 |
+ hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi, |
790 |
+ struct hdac_hdmi_cvt *cvt) |
791 |
+ { |
792 |
+- struct hdac_hdmi_pcm *pcm = NULL; |
793 |
++ struct hdac_hdmi_pcm *pcm; |
794 |
+ |
795 |
+ list_for_each_entry(pcm, &hdmi->pcm_list, head) { |
796 |
+ if (pcm->cvt == cvt) |
797 |
+- break; |
798 |
++ return pcm; |
799 |
+ } |
800 |
+ |
801 |
+- return pcm; |
802 |
++ return NULL; |
803 |
+ } |
804 |
+ |
805 |
+ static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, |
806 |
+diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c |
807 |
+index ca8a70ab22a8..d64cb28e8dc5 100644 |
808 |
+--- a/sound/soc/codecs/sgtl5000.c |
809 |
++++ b/sound/soc/codecs/sgtl5000.c |
810 |
+@@ -1563,6 +1563,40 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, |
811 |
+ dev_err(&client->dev, |
812 |
+ "Error %d initializing CHIP_CLK_CTRL\n", ret); |
813 |
+ |
814 |
++ /* Mute everything to avoid pop from the following power-up */ |
815 |
++ ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_CTRL, |
816 |
++ SGTL5000_CHIP_ANA_CTRL_DEFAULT); |
817 |
++ if (ret) { |
818 |
++ dev_err(&client->dev, |
819 |
++ "Error %d muting outputs via CHIP_ANA_CTRL\n", ret); |
820 |
++ goto disable_clk; |
821 |
++ } |
822 |
++ |
823 |
++ /* |
824 |
++ * If VAG is powered-on (e.g. from previous boot), it would be disabled |
825 |
++ * by the write to ANA_POWER in later steps of the probe code. This |
826 |
++ * may create a loud pop even with all outputs muted. The proper way |
827 |
++ * to circumvent this is disabling the bit first and waiting the proper |
828 |
++ * cool-down time. |
829 |
++ */ |
830 |
++ ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, &value); |
831 |
++ if (ret) { |
832 |
++ dev_err(&client->dev, "Failed to read ANA_POWER: %d\n", ret); |
833 |
++ goto disable_clk; |
834 |
++ } |
835 |
++ if (value & SGTL5000_VAG_POWERUP) { |
836 |
++ ret = regmap_update_bits(sgtl5000->regmap, |
837 |
++ SGTL5000_CHIP_ANA_POWER, |
838 |
++ SGTL5000_VAG_POWERUP, |
839 |
++ 0); |
840 |
++ if (ret) { |
841 |
++ dev_err(&client->dev, "Error %d disabling VAG\n", ret); |
842 |
++ goto disable_clk; |
843 |
++ } |
844 |
++ |
845 |
++ msleep(SGTL5000_VAG_POWERDOWN_DELAY); |
846 |
++ } |
847 |
++ |
848 |
+ /* Follow section 2.2.1.1 of AN3663 */ |
849 |
+ ana_pwr = SGTL5000_ANA_POWER_DEFAULT; |
850 |
+ if (sgtl5000->num_supplies <= VDDD) { |
851 |
+diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h |
852 |
+index 22f3442af982..9ea41749d037 100644 |
853 |
+--- a/sound/soc/codecs/sgtl5000.h |
854 |
++++ b/sound/soc/codecs/sgtl5000.h |
855 |
+@@ -236,6 +236,7 @@ |
856 |
+ /* |
857 |
+ * SGTL5000_CHIP_ANA_CTRL |
858 |
+ */ |
859 |
++#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133 |
860 |
+ #define SGTL5000_LINE_OUT_MUTE 0x0100 |
861 |
+ #define SGTL5000_HP_SEL_MASK 0x0040 |
862 |
+ #define SGTL5000_HP_SEL_SHIFT 6 |
863 |
+diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c |
864 |
+index 4d948757d300..5e5ed5475473 100644 |
865 |
+--- a/sound/soc/sh/rcar/ssiu.c |
866 |
++++ b/sound/soc/sh/rcar/ssiu.c |
867 |
+@@ -172,7 +172,7 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, |
868 |
+ i; |
869 |
+ |
870 |
+ for_each_rsnd_mod_array(i, pos, io, rsnd_ssi_array) { |
871 |
+- shift = (i * 4) + 16; |
872 |
++ shift = (i * 4) + 20; |
873 |
+ val = (val & ~(0xF << shift)) | |
874 |
+ rsnd_mod_id(pos) << shift; |
875 |
+ } |
876 |
+diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c |
877 |
+index a215b9ad148c..50aa45525be5 100644 |
878 |
+--- a/sound/soc/soc-topology.c |
879 |
++++ b/sound/soc/soc-topology.c |
880 |
+@@ -1954,7 +1954,9 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, |
881 |
+ _pcm = pcm; |
882 |
+ } else { |
883 |
+ abi_match = false; |
884 |
+- pcm_new_ver(tplg, pcm, &_pcm); |
885 |
++ ret = pcm_new_ver(tplg, pcm, &_pcm); |
886 |
++ if (ret < 0) |
887 |
++ return ret; |
888 |
+ } |
889 |
+ |
890 |
+ /* create the FE DAIs and DAI links */ |
891 |
+diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c |
892 |
+index c5587844fbb8..ad723a5d0f83 100644 |
893 |
+--- a/tools/testing/selftests/ipc/msgque.c |
894 |
++++ b/tools/testing/selftests/ipc/msgque.c |
895 |
+@@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque) |
896 |
+ for (kern_id = 0; kern_id < 256; kern_id++) { |
897 |
+ ret = msgctl(kern_id, MSG_STAT, &ds); |
898 |
+ if (ret < 0) { |
899 |
+- if (errno == -EINVAL) |
900 |
++ if (errno == EINVAL) |
901 |
+ continue; |
902 |
+ printf("Failed to get stats for IPC queue with id %d\n", |
903 |
+ kern_id); |