1 |
commit: 692deba84079e7c25e90e968b582ad005cf923a9 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 25 13:38:21 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 25 13:38:21 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=692deba8 |
7 |
|
8 |
Linux patch 4.14.30 |
9 |
|
10 |
0000_README | 4 + |
11 |
1029_linux-4.14.30.patch | 2536 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 2540 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index aaa36a2..f410864 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -159,6 +159,10 @@ Patch: 1028_linux-4.14.29.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.14.29 |
21 |
|
22 |
+Patch: 1029_linux-4.14.30.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.14.30 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1029_linux-4.14.30.patch b/1029_linux-4.14.30.patch |
31 |
new file mode 100644 |
32 |
index 0000000..6f52119 |
33 |
--- /dev/null |
34 |
+++ b/1029_linux-4.14.30.patch |
35 |
@@ -0,0 +1,2536 @@ |
36 |
+diff --git a/Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt b/Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt |
37 |
+deleted file mode 100644 |
38 |
+index 7175dc3740ac..000000000000 |
39 |
+--- a/Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt |
40 |
++++ /dev/null |
41 |
+@@ -1,30 +0,0 @@ |
42 |
+-Toppoly TD028TTEC1 Panel |
43 |
+-======================== |
44 |
+- |
45 |
+-Required properties: |
46 |
+-- compatible: "toppoly,td028ttec1" |
47 |
+- |
48 |
+-Optional properties: |
49 |
+-- label: a symbolic name for the panel |
50 |
+- |
51 |
+-Required nodes: |
52 |
+-- Video port for DPI input |
53 |
+- |
54 |
+-Example |
55 |
+-------- |
56 |
+- |
57 |
+-lcd-panel: td028ttec1@0 { |
58 |
+- compatible = "toppoly,td028ttec1"; |
59 |
+- reg = <0>; |
60 |
+- spi-max-frequency = <100000>; |
61 |
+- spi-cpol; |
62 |
+- spi-cpha; |
63 |
+- |
64 |
+- label = "lcd"; |
65 |
+- port { |
66 |
+- lcd_in: endpoint { |
67 |
+- remote-endpoint = <&dpi_out>; |
68 |
+- }; |
69 |
+- }; |
70 |
+-}; |
71 |
+- |
72 |
+diff --git a/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt |
73 |
+new file mode 100644 |
74 |
+index 000000000000..ed34253d9fb1 |
75 |
+--- /dev/null |
76 |
++++ b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt |
77 |
+@@ -0,0 +1,30 @@ |
78 |
++Toppoly TD028TTEC1 Panel |
79 |
++======================== |
80 |
++ |
81 |
++Required properties: |
82 |
++- compatible: "tpo,td028ttec1" |
83 |
++ |
84 |
++Optional properties: |
85 |
++- label: a symbolic name for the panel |
86 |
++ |
87 |
++Required nodes: |
88 |
++- Video port for DPI input |
89 |
++ |
90 |
++Example |
91 |
++------- |
92 |
++ |
93 |
++lcd-panel: td028ttec1@0 { |
94 |
++ compatible = "tpo,td028ttec1"; |
95 |
++ reg = <0>; |
96 |
++ spi-max-frequency = <100000>; |
97 |
++ spi-cpol; |
98 |
++ spi-cpha; |
99 |
++ |
100 |
++ label = "lcd"; |
101 |
++ port { |
102 |
++ lcd_in: endpoint { |
103 |
++ remote-endpoint = <&dpi_out>; |
104 |
++ }; |
105 |
++ }; |
106 |
++}; |
107 |
++ |
108 |
+diff --git a/Makefile b/Makefile |
109 |
+index 4b2aa0dd4043..29fc3c91f3e4 100644 |
110 |
+--- a/Makefile |
111 |
++++ b/Makefile |
112 |
+@@ -1,7 +1,7 @@ |
113 |
+ # SPDX-License-Identifier: GPL-2.0 |
114 |
+ VERSION = 4 |
115 |
+ PATCHLEVEL = 14 |
116 |
+-SUBLEVEL = 29 |
117 |
++SUBLEVEL = 30 |
118 |
+ EXTRAVERSION = |
119 |
+ NAME = Petit Gorille |
120 |
+ |
121 |
+diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c |
122 |
+index 8e9a41966881..5476279329a6 100644 |
123 |
+--- a/arch/alpha/kernel/console.c |
124 |
++++ b/arch/alpha/kernel/console.c |
125 |
+@@ -21,6 +21,7 @@ |
126 |
+ struct pci_controller *pci_vga_hose; |
127 |
+ static struct resource alpha_vga = { |
128 |
+ .name = "alpha-vga+", |
129 |
++ .flags = IORESOURCE_IO, |
130 |
+ .start = 0x3C0, |
131 |
+ .end = 0x3DF |
132 |
+ }; |
133 |
+diff --git a/arch/arm/boot/dts/aspeed-ast2500-evb.dts b/arch/arm/boot/dts/aspeed-ast2500-evb.dts |
134 |
+index f53e89d63477..c971cc93f42d 100644 |
135 |
+--- a/arch/arm/boot/dts/aspeed-ast2500-evb.dts |
136 |
++++ b/arch/arm/boot/dts/aspeed-ast2500-evb.dts |
137 |
+@@ -16,7 +16,7 @@ |
138 |
+ bootargs = "console=ttyS4,115200 earlyprintk"; |
139 |
+ }; |
140 |
+ |
141 |
+- memory { |
142 |
++ memory@80000000 { |
143 |
+ reg = <0x80000000 0x20000000>; |
144 |
+ }; |
145 |
+ }; |
146 |
+diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c |
147 |
+index bd810d01538a..093fd096f0c8 100644 |
148 |
+--- a/drivers/bluetooth/btqcomsmd.c |
149 |
++++ b/drivers/bluetooth/btqcomsmd.c |
150 |
+@@ -86,7 +86,8 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb) |
151 |
+ break; |
152 |
+ } |
153 |
+ |
154 |
+- kfree_skb(skb); |
155 |
++ if (!ret) |
156 |
++ kfree_skb(skb); |
157 |
+ |
158 |
+ return ret; |
159 |
+ } |
160 |
+diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c |
161 |
+index 392f412b4575..c9f0ac083a3e 100644 |
162 |
+--- a/drivers/bluetooth/hci_qca.c |
163 |
++++ b/drivers/bluetooth/hci_qca.c |
164 |
+@@ -933,6 +933,9 @@ static int qca_setup(struct hci_uart *hu) |
165 |
+ if (!ret) { |
166 |
+ set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); |
167 |
+ qca_debugfs_init(hdev); |
168 |
++ } else if (ret == -ENOENT) { |
169 |
++ /* No patch/nvm-config found, run with original fw/config */ |
170 |
++ ret = 0; |
171 |
+ } |
172 |
+ |
173 |
+ /* Setup bdaddr */ |
174 |
+diff --git a/drivers/char/mem.c b/drivers/char/mem.c |
175 |
+index 970e1242a282..3a70dba2c645 100644 |
176 |
+--- a/drivers/char/mem.c |
177 |
++++ b/drivers/char/mem.c |
178 |
+@@ -107,6 +107,8 @@ static ssize_t read_mem(struct file *file, char __user *buf, |
179 |
+ phys_addr_t p = *ppos; |
180 |
+ ssize_t read, sz; |
181 |
+ void *ptr; |
182 |
++ char *bounce; |
183 |
++ int err; |
184 |
+ |
185 |
+ if (p != *ppos) |
186 |
+ return 0; |
187 |
+@@ -129,15 +131,22 @@ static ssize_t read_mem(struct file *file, char __user *buf, |
188 |
+ } |
189 |
+ #endif |
190 |
+ |
191 |
++ bounce = kmalloc(PAGE_SIZE, GFP_KERNEL); |
192 |
++ if (!bounce) |
193 |
++ return -ENOMEM; |
194 |
++ |
195 |
+ while (count > 0) { |
196 |
+ unsigned long remaining; |
197 |
+ int allowed; |
198 |
+ |
199 |
+ sz = size_inside_page(p, count); |
200 |
+ |
201 |
++ err = -EPERM; |
202 |
+ allowed = page_is_allowed(p >> PAGE_SHIFT); |
203 |
+ if (!allowed) |
204 |
+- return -EPERM; |
205 |
++ goto failed; |
206 |
++ |
207 |
++ err = -EFAULT; |
208 |
+ if (allowed == 2) { |
209 |
+ /* Show zeros for restricted memory. */ |
210 |
+ remaining = clear_user(buf, sz); |
211 |
+@@ -149,24 +158,32 @@ static ssize_t read_mem(struct file *file, char __user *buf, |
212 |
+ */ |
213 |
+ ptr = xlate_dev_mem_ptr(p); |
214 |
+ if (!ptr) |
215 |
+- return -EFAULT; |
216 |
+- |
217 |
+- remaining = copy_to_user(buf, ptr, sz); |
218 |
++ goto failed; |
219 |
+ |
220 |
++ err = probe_kernel_read(bounce, ptr, sz); |
221 |
+ unxlate_dev_mem_ptr(p, ptr); |
222 |
++ if (err) |
223 |
++ goto failed; |
224 |
++ |
225 |
++ remaining = copy_to_user(buf, bounce, sz); |
226 |
+ } |
227 |
+ |
228 |
+ if (remaining) |
229 |
+- return -EFAULT; |
230 |
++ goto failed; |
231 |
+ |
232 |
+ buf += sz; |
233 |
+ p += sz; |
234 |
+ count -= sz; |
235 |
+ read += sz; |
236 |
+ } |
237 |
++ kfree(bounce); |
238 |
+ |
239 |
+ *ppos += read; |
240 |
+ return read; |
241 |
++ |
242 |
++failed: |
243 |
++ kfree(bounce); |
244 |
++ return err; |
245 |
+ } |
246 |
+ |
247 |
+ static ssize_t write_mem(struct file *file, const char __user *buf, |
248 |
+diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c |
249 |
+index 775af473fe11..5c2b26de303e 100644 |
250 |
+--- a/drivers/clk/at91/pmc.c |
251 |
++++ b/drivers/clk/at91/pmc.c |
252 |
+@@ -107,10 +107,20 @@ static int pmc_suspend(void) |
253 |
+ return 0; |
254 |
+ } |
255 |
+ |
256 |
++static bool pmc_ready(unsigned int mask) |
257 |
++{ |
258 |
++ unsigned int status; |
259 |
++ |
260 |
++ regmap_read(pmcreg, AT91_PMC_SR, &status); |
261 |
++ |
262 |
++ return ((status & mask) == mask) ? 1 : 0; |
263 |
++} |
264 |
++ |
265 |
+ static void pmc_resume(void) |
266 |
+ { |
267 |
+- int i, ret = 0; |
268 |
++ int i; |
269 |
+ u32 tmp; |
270 |
++ u32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA; |
271 |
+ |
272 |
+ regmap_read(pmcreg, AT91_PMC_MCKR, &tmp); |
273 |
+ if (pmc_cache.mckr != tmp) |
274 |
+@@ -134,13 +144,11 @@ static void pmc_resume(void) |
275 |
+ AT91_PMC_PCR_CMD); |
276 |
+ } |
277 |
+ |
278 |
+- if (pmc_cache.uckr & AT91_PMC_UPLLEN) { |
279 |
+- ret = regmap_read_poll_timeout(pmcreg, AT91_PMC_SR, tmp, |
280 |
+- !(tmp & AT91_PMC_LOCKU), |
281 |
+- 10, 5000); |
282 |
+- if (ret) |
283 |
+- pr_crit("USB PLL didn't lock when resuming\n"); |
284 |
+- } |
285 |
++ if (pmc_cache.uckr & AT91_PMC_UPLLEN) |
286 |
++ mask |= AT91_PMC_LOCKU; |
287 |
++ |
288 |
++ while (!pmc_ready(mask)) |
289 |
++ cpu_relax(); |
290 |
+ } |
291 |
+ |
292 |
+ static struct syscore_ops pmc_syscore_ops = { |
293 |
+diff --git a/drivers/clk/clk-axi-clkgen.c b/drivers/clk/clk-axi-clkgen.c |
294 |
+index 5e918e7afaba..95a6e9834392 100644 |
295 |
+--- a/drivers/clk/clk-axi-clkgen.c |
296 |
++++ b/drivers/clk/clk-axi-clkgen.c |
297 |
+@@ -40,6 +40,10 @@ |
298 |
+ #define MMCM_REG_FILTER1 0x4e |
299 |
+ #define MMCM_REG_FILTER2 0x4f |
300 |
+ |
301 |
++#define MMCM_CLKOUT_NOCOUNT BIT(6) |
302 |
++ |
303 |
++#define MMCM_CLK_DIV_NOCOUNT BIT(12) |
304 |
++ |
305 |
+ struct axi_clkgen { |
306 |
+ void __iomem *base; |
307 |
+ struct clk_hw clk_hw; |
308 |
+@@ -315,12 +319,27 @@ static unsigned long axi_clkgen_recalc_rate(struct clk_hw *clk_hw, |
309 |
+ unsigned int reg; |
310 |
+ unsigned long long tmp; |
311 |
+ |
312 |
+- axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_1, ®); |
313 |
+- dout = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
314 |
++ axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_2, ®); |
315 |
++ if (reg & MMCM_CLKOUT_NOCOUNT) { |
316 |
++ dout = 1; |
317 |
++ } else { |
318 |
++ axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_1, ®); |
319 |
++ dout = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
320 |
++ } |
321 |
++ |
322 |
+ axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_DIV, ®); |
323 |
+- d = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
324 |
+- axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB1, ®); |
325 |
+- m = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
326 |
++ if (reg & MMCM_CLK_DIV_NOCOUNT) |
327 |
++ d = 1; |
328 |
++ else |
329 |
++ d = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
330 |
++ |
331 |
++ axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB2, ®); |
332 |
++ if (reg & MMCM_CLKOUT_NOCOUNT) { |
333 |
++ m = 1; |
334 |
++ } else { |
335 |
++ axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB1, ®); |
336 |
++ m = (reg & 0x3f) + ((reg >> 6) & 0x3f); |
337 |
++ } |
338 |
+ |
339 |
+ if (d == 0 || dout == 0) |
340 |
+ return 0; |
341 |
+diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c |
342 |
+index 20d90769cced..653b0f38d475 100644 |
343 |
+--- a/drivers/clk/clk-si5351.c |
344 |
++++ b/drivers/clk/clk-si5351.c |
345 |
+@@ -72,7 +72,7 @@ static const char * const si5351_input_names[] = { |
346 |
+ "xtal", "clkin" |
347 |
+ }; |
348 |
+ static const char * const si5351_pll_names[] = { |
349 |
+- "plla", "pllb", "vxco" |
350 |
++ "si5351_plla", "si5351_pllb", "si5351_vxco" |
351 |
+ }; |
352 |
+ static const char * const si5351_msynth_names[] = { |
353 |
+ "ms0", "ms1", "ms2", "ms3", "ms4", "ms5", "ms6", "ms7" |
354 |
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c |
355 |
+index c8d83acda006..60c7fde37d23 100644 |
356 |
+--- a/drivers/clk/clk.c |
357 |
++++ b/drivers/clk/clk.c |
358 |
+@@ -2470,6 +2470,21 @@ static int __clk_core_init(struct clk_core *core) |
359 |
+ rate = 0; |
360 |
+ core->rate = core->req_rate = rate; |
361 |
+ |
362 |
++ /* |
363 |
++ * Enable CLK_IS_CRITICAL clocks so newly added critical clocks |
364 |
++ * don't get accidentally disabled when walking the orphan tree and |
365 |
++ * reparenting clocks |
366 |
++ */ |
367 |
++ if (core->flags & CLK_IS_CRITICAL) { |
368 |
++ unsigned long flags; |
369 |
++ |
370 |
++ clk_core_prepare(core); |
371 |
++ |
372 |
++ flags = clk_enable_lock(); |
373 |
++ clk_core_enable(core); |
374 |
++ clk_enable_unlock(flags); |
375 |
++ } |
376 |
++ |
377 |
+ /* |
378 |
+ * walk the list of orphan clocks and reparent any that newly finds a |
379 |
+ * parent. |
380 |
+@@ -2478,10 +2493,13 @@ static int __clk_core_init(struct clk_core *core) |
381 |
+ struct clk_core *parent = __clk_init_parent(orphan); |
382 |
+ |
383 |
+ /* |
384 |
+- * we could call __clk_set_parent, but that would result in a |
385 |
+- * redundant call to the .set_rate op, if it exists |
386 |
++ * We need to use __clk_set_parent_before() and _after() to |
387 |
++ * to properly migrate any prepare/enable count of the orphan |
388 |
++ * clock. This is important for CLK_IS_CRITICAL clocks, which |
389 |
++ * are enabled during init but might not have a parent yet. |
390 |
+ */ |
391 |
+ if (parent) { |
392 |
++ /* update the clk tree topology */ |
393 |
+ __clk_set_parent_before(orphan, parent); |
394 |
+ __clk_set_parent_after(orphan, parent, NULL); |
395 |
+ __clk_recalc_accuracies(orphan); |
396 |
+@@ -2500,16 +2518,6 @@ static int __clk_core_init(struct clk_core *core) |
397 |
+ if (core->ops->init) |
398 |
+ core->ops->init(core->hw); |
399 |
+ |
400 |
+- if (core->flags & CLK_IS_CRITICAL) { |
401 |
+- unsigned long flags; |
402 |
+- |
403 |
+- clk_core_prepare(core); |
404 |
+- |
405 |
+- flags = clk_enable_lock(); |
406 |
+- clk_core_enable(core); |
407 |
+- clk_enable_unlock(flags); |
408 |
+- } |
409 |
+- |
410 |
+ kref_init(&core->ref); |
411 |
+ out: |
412 |
+ clk_prepare_unlock(); |
413 |
+diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c |
414 |
+index d5e27bc7585a..859a62ea6120 100644 |
415 |
+--- a/drivers/cpufreq/longhaul.c |
416 |
++++ b/drivers/cpufreq/longhaul.c |
417 |
+@@ -894,7 +894,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) |
418 |
+ if ((longhaul_version != TYPE_LONGHAUL_V1) && (scale_voltage != 0)) |
419 |
+ longhaul_setup_voltagescaling(); |
420 |
+ |
421 |
+- policy->cpuinfo.transition_latency = 200000; /* nsec */ |
422 |
++ policy->transition_delay_us = 200000; /* usec */ |
423 |
+ |
424 |
+ return cpufreq_table_validate_and_show(policy, longhaul_table); |
425 |
+ } |
426 |
+diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c |
427 |
+index 0f9754e07719..6eb5cb92b986 100644 |
428 |
+--- a/drivers/crypto/axis/artpec6_crypto.c |
429 |
++++ b/drivers/crypto/axis/artpec6_crypto.c |
430 |
+@@ -22,6 +22,7 @@ |
431 |
+ #include <linux/slab.h> |
432 |
+ |
433 |
+ #include <crypto/aes.h> |
434 |
++#include <crypto/gcm.h> |
435 |
+ #include <crypto/internal/aead.h> |
436 |
+ #include <crypto/internal/hash.h> |
437 |
+ #include <crypto/internal/skcipher.h> |
438 |
+@@ -1934,7 +1935,7 @@ static int artpec6_crypto_prepare_aead(struct aead_request *areq) |
439 |
+ |
440 |
+ memcpy(req_ctx->hw_ctx.J0, areq->iv, crypto_aead_ivsize(cipher)); |
441 |
+ // The HW omits the initial increment of the counter field. |
442 |
+- crypto_inc(req_ctx->hw_ctx.J0+12, 4); |
443 |
++ memcpy(req_ctx->hw_ctx.J0 + GCM_AES_IV_SIZE, "\x00\x00\x00\x01", 4); |
444 |
+ |
445 |
+ ret = artpec6_crypto_setup_out_descr(common, &req_ctx->hw_ctx, |
446 |
+ sizeof(struct artpec6_crypto_aead_hw_ctx), false, false); |
447 |
+@@ -2956,7 +2957,7 @@ static struct aead_alg aead_algos[] = { |
448 |
+ .setkey = artpec6_crypto_aead_set_key, |
449 |
+ .encrypt = artpec6_crypto_aead_encrypt, |
450 |
+ .decrypt = artpec6_crypto_aead_decrypt, |
451 |
+- .ivsize = AES_BLOCK_SIZE, |
452 |
++ .ivsize = GCM_AES_IV_SIZE, |
453 |
+ .maxauthsize = AES_BLOCK_SIZE, |
454 |
+ |
455 |
+ .base = { |
456 |
+diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c |
457 |
+index 7df910e7c348..9272b173c746 100644 |
458 |
+--- a/drivers/dma/ti-dma-crossbar.c |
459 |
++++ b/drivers/dma/ti-dma-crossbar.c |
460 |
+@@ -54,7 +54,15 @@ struct ti_am335x_xbar_map { |
461 |
+ |
462 |
+ static inline void ti_am335x_xbar_write(void __iomem *iomem, int event, u8 val) |
463 |
+ { |
464 |
+- writeb_relaxed(val, iomem + event); |
465 |
++ /* |
466 |
++ * TPCC_EVT_MUX_60_63 register layout is different than the |
467 |
++ * rest, in the sense, that event 63 is mapped to lowest byte |
468 |
++ * and event 60 is mapped to highest, handle it separately. |
469 |
++ */ |
470 |
++ if (event >= 60 && event <= 63) |
471 |
++ writeb_relaxed(val, iomem + (63 - event % 4)); |
472 |
++ else |
473 |
++ writeb_relaxed(val, iomem + event); |
474 |
+ } |
475 |
+ |
476 |
+ static void ti_am335x_xbar_free(struct device *dev, void *route_data) |
477 |
+diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c |
478 |
+index 1ee1241ca797..5cc8ed31f26b 100644 |
479 |
+--- a/drivers/dma/xilinx/zynqmp_dma.c |
480 |
++++ b/drivers/dma/xilinx/zynqmp_dma.c |
481 |
+@@ -838,7 +838,8 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan) |
482 |
+ if (!chan) |
483 |
+ return; |
484 |
+ |
485 |
+- devm_free_irq(chan->zdev->dev, chan->irq, chan); |
486 |
++ if (chan->irq) |
487 |
++ devm_free_irq(chan->zdev->dev, chan->irq, chan); |
488 |
+ tasklet_kill(&chan->tasklet); |
489 |
+ list_del(&chan->common.device_node); |
490 |
+ clk_disable_unprepare(chan->clk_apb); |
491 |
+diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c |
492 |
+index ea5bb0e1632c..6e0fb50d0de4 100644 |
493 |
+--- a/drivers/gpu/drm/msm/msm_gem.c |
494 |
++++ b/drivers/gpu/drm/msm/msm_gem.c |
495 |
+@@ -93,14 +93,17 @@ static struct page **get_pages(struct drm_gem_object *obj) |
496 |
+ return p; |
497 |
+ } |
498 |
+ |
499 |
++ msm_obj->pages = p; |
500 |
++ |
501 |
+ msm_obj->sgt = drm_prime_pages_to_sg(p, npages); |
502 |
+ if (IS_ERR(msm_obj->sgt)) { |
503 |
++ void *ptr = ERR_CAST(msm_obj->sgt); |
504 |
++ |
505 |
+ dev_err(dev->dev, "failed to allocate sgt\n"); |
506 |
+- return ERR_CAST(msm_obj->sgt); |
507 |
++ msm_obj->sgt = NULL; |
508 |
++ return ptr; |
509 |
+ } |
510 |
+ |
511 |
+- msm_obj->pages = p; |
512 |
+- |
513 |
+ /* For non-cached buffers, ensure the new pages are clean |
514 |
+ * because display controller, GPU, etc. are not coherent: |
515 |
+ */ |
516 |
+@@ -135,7 +138,10 @@ static void put_pages(struct drm_gem_object *obj) |
517 |
+ if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) |
518 |
+ dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, |
519 |
+ msm_obj->sgt->nents, DMA_BIDIRECTIONAL); |
520 |
+- sg_free_table(msm_obj->sgt); |
521 |
++ |
522 |
++ if (msm_obj->sgt) |
523 |
++ sg_free_table(msm_obj->sgt); |
524 |
++ |
525 |
+ kfree(msm_obj->sgt); |
526 |
+ |
527 |
+ if (use_pages(obj)) |
528 |
+diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c |
529 |
+index 0a38a0e8c925..a0dfa14f4fab 100644 |
530 |
+--- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c |
531 |
++++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c |
532 |
+@@ -452,6 +452,8 @@ static int td028ttec1_panel_remove(struct spi_device *spi) |
533 |
+ } |
534 |
+ |
535 |
+ static const struct of_device_id td028ttec1_of_match[] = { |
536 |
++ { .compatible = "omapdss,tpo,td028ttec1", }, |
537 |
++ /* keep to not break older DTB */ |
538 |
+ { .compatible = "omapdss,toppoly,td028ttec1", }, |
539 |
+ {}, |
540 |
+ }; |
541 |
+@@ -471,6 +473,7 @@ static struct spi_driver td028ttec1_spi_driver = { |
542 |
+ |
543 |
+ module_spi_driver(td028ttec1_spi_driver); |
544 |
+ |
545 |
++MODULE_ALIAS("spi:tpo,td028ttec1"); |
546 |
+ MODULE_ALIAS("spi:toppoly,td028ttec1"); |
547 |
+ MODULE_AUTHOR("H. Nikolaus Schaller <hns@×××××××××.com>"); |
548 |
+ MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); |
549 |
+diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |
550 |
+index c60a85e82c6d..fd05f7e9f43f 100644 |
551 |
+--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |
552 |
++++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |
553 |
+@@ -298,7 +298,12 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait) |
554 |
+ msecs_to_jiffies(100))) { |
555 |
+ dev_err(dmm->dev, "timed out waiting for done\n"); |
556 |
+ ret = -ETIMEDOUT; |
557 |
++ goto cleanup; |
558 |
+ } |
559 |
++ |
560 |
++ /* Check the engine status before continue */ |
561 |
++ ret = wait_status(engine, DMM_PATSTATUS_READY | |
562 |
++ DMM_PATSTATUS_VALID | DMM_PATSTATUS_DONE); |
563 |
+ } |
564 |
+ |
565 |
+ cleanup: |
566 |
+diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h b/drivers/gpu/drm/tilcdc/tilcdc_regs.h |
567 |
+index 9d528c0a67a4..5048ebb86835 100644 |
568 |
+--- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h |
569 |
++++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h |
570 |
+@@ -133,7 +133,7 @@ static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data) |
571 |
+ struct tilcdc_drm_private *priv = dev->dev_private; |
572 |
+ volatile void __iomem *addr = priv->mmio + reg; |
573 |
+ |
574 |
+-#ifdef iowrite64 |
575 |
++#if defined(iowrite64) && !defined(iowrite64_is_nonatomic) |
576 |
+ iowrite64(data, addr); |
577 |
+ #else |
578 |
+ __iowmb(); |
579 |
+diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c |
580 |
+index d7a3e453016d..735dca089389 100644 |
581 |
+--- a/drivers/hwtracing/coresight/coresight-tpiu.c |
582 |
++++ b/drivers/hwtracing/coresight/coresight-tpiu.c |
583 |
+@@ -46,8 +46,11 @@ |
584 |
+ #define TPIU_ITATBCTR0 0xef8 |
585 |
+ |
586 |
+ /** register definition **/ |
587 |
++/* FFSR - 0x300 */ |
588 |
++#define FFSR_FT_STOPPED BIT(1) |
589 |
+ /* FFCR - 0x304 */ |
590 |
+ #define FFCR_FON_MAN BIT(6) |
591 |
++#define FFCR_STOP_FI BIT(12) |
592 |
+ |
593 |
+ /** |
594 |
+ * @base: memory mapped base address for this component. |
595 |
+@@ -85,10 +88,14 @@ static void tpiu_disable_hw(struct tpiu_drvdata *drvdata) |
596 |
+ { |
597 |
+ CS_UNLOCK(drvdata->base); |
598 |
+ |
599 |
+- /* Clear formatter controle reg. */ |
600 |
+- writel_relaxed(0x0, drvdata->base + TPIU_FFCR); |
601 |
++ /* Clear formatter and stop on flush */ |
602 |
++ writel_relaxed(FFCR_STOP_FI, drvdata->base + TPIU_FFCR); |
603 |
+ /* Generate manual flush */ |
604 |
+- writel_relaxed(FFCR_FON_MAN, drvdata->base + TPIU_FFCR); |
605 |
++ writel_relaxed(FFCR_STOP_FI | FFCR_FON_MAN, drvdata->base + TPIU_FFCR); |
606 |
++ /* Wait for flush to complete */ |
607 |
++ coresight_timeout(drvdata->base, TPIU_FFCR, FFCR_FON_MAN, 0); |
608 |
++ /* Wait for formatter to stop */ |
609 |
++ coresight_timeout(drvdata->base, TPIU_FFSR, FFSR_FT_STOPPED, 1); |
610 |
+ |
611 |
+ CS_LOCK(drvdata->base); |
612 |
+ } |
613 |
+diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c |
614 |
+index e457dface2d2..6cae00ecc905 100644 |
615 |
+--- a/drivers/infiniband/core/cma.c |
616 |
++++ b/drivers/infiniband/core/cma.c |
617 |
+@@ -3017,7 +3017,8 @@ static int cma_port_is_unique(struct rdma_bind_list *bind_list, |
618 |
+ continue; |
619 |
+ |
620 |
+ /* different dest port -> unique */ |
621 |
+- if (!cma_any_port(cur_daddr) && |
622 |
++ if (!cma_any_port(daddr) && |
623 |
++ !cma_any_port(cur_daddr) && |
624 |
+ (dport != cur_dport)) |
625 |
+ continue; |
626 |
+ |
627 |
+@@ -3028,7 +3029,8 @@ static int cma_port_is_unique(struct rdma_bind_list *bind_list, |
628 |
+ continue; |
629 |
+ |
630 |
+ /* different dst address -> unique */ |
631 |
+- if (!cma_any_addr(cur_daddr) && |
632 |
++ if (!cma_any_addr(daddr) && |
633 |
++ !cma_any_addr(cur_daddr) && |
634 |
+ cma_addr_cmp(daddr, cur_daddr)) |
635 |
+ continue; |
636 |
+ |
637 |
+@@ -3326,13 +3328,13 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) |
638 |
+ } |
639 |
+ #endif |
640 |
+ } |
641 |
++ daddr = cma_dst_addr(id_priv); |
642 |
++ daddr->sa_family = addr->sa_family; |
643 |
++ |
644 |
+ ret = cma_get_port(id_priv); |
645 |
+ if (ret) |
646 |
+ goto err2; |
647 |
+ |
648 |
+- daddr = cma_dst_addr(id_priv); |
649 |
+- daddr->sa_family = addr->sa_family; |
650 |
+- |
651 |
+ return 0; |
652 |
+ err2: |
653 |
+ if (id_priv->cma_dev) |
654 |
+@@ -4118,6 +4120,9 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, |
655 |
+ struct cma_multicast *mc; |
656 |
+ int ret; |
657 |
+ |
658 |
++ if (!id->device) |
659 |
++ return -EINVAL; |
660 |
++ |
661 |
+ id_priv = container_of(id, struct rdma_id_private, id); |
662 |
+ if (!cma_comp(id_priv, RDMA_CM_ADDR_BOUND) && |
663 |
+ !cma_comp(id_priv, RDMA_CM_ADDR_RESOLVED)) |
664 |
+@@ -4436,7 +4441,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) |
665 |
+ RDMA_NL_RDMA_CM_ATTR_SRC_ADDR)) |
666 |
+ goto out; |
667 |
+ if (ibnl_put_attr(skb, nlh, |
668 |
+- rdma_addr_size(cma_src_addr(id_priv)), |
669 |
++ rdma_addr_size(cma_dst_addr(id_priv)), |
670 |
+ cma_dst_addr(id_priv), |
671 |
+ RDMA_NL_RDMA_CM_ATTR_DST_ADDR)) |
672 |
+ goto out; |
673 |
+diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c |
674 |
+index 3c4faadb8cdd..81528f64061a 100644 |
675 |
+--- a/drivers/infiniband/core/iwpm_util.c |
676 |
++++ b/drivers/infiniband/core/iwpm_util.c |
677 |
+@@ -654,6 +654,7 @@ int iwpm_send_mapinfo(u8 nl_client, int iwpm_pid) |
678 |
+ } |
679 |
+ skb_num++; |
680 |
+ spin_lock_irqsave(&iwpm_mapinfo_lock, flags); |
681 |
++ ret = -EINVAL; |
682 |
+ for (i = 0; i < IWPM_MAPINFO_HASH_SIZE; i++) { |
683 |
+ hlist_for_each_entry(map_info, &iwpm_hash_bucket[i], |
684 |
+ hlist_node) { |
685 |
+diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c |
686 |
+index c8b3a45e9edc..77ca9da570a2 100644 |
687 |
+--- a/drivers/infiniband/core/ucma.c |
688 |
++++ b/drivers/infiniband/core/ucma.c |
689 |
+@@ -1348,7 +1348,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, |
690 |
+ return -ENOSPC; |
691 |
+ |
692 |
+ addr = (struct sockaddr *) &cmd->addr; |
693 |
+- if (!cmd->addr_size || (cmd->addr_size != rdma_addr_size(addr))) |
694 |
++ if (cmd->addr_size != rdma_addr_size(addr)) |
695 |
+ return -EINVAL; |
696 |
+ |
697 |
+ if (cmd->join_flags == RDMA_MC_JOIN_FLAG_FULLMEMBER) |
698 |
+@@ -1416,6 +1416,9 @@ static ssize_t ucma_join_ip_multicast(struct ucma_file *file, |
699 |
+ join_cmd.uid = cmd.uid; |
700 |
+ join_cmd.id = cmd.id; |
701 |
+ join_cmd.addr_size = rdma_addr_size((struct sockaddr *) &cmd.addr); |
702 |
++ if (!join_cmd.addr_size) |
703 |
++ return -EINVAL; |
704 |
++ |
705 |
+ join_cmd.join_flags = RDMA_MC_JOIN_FLAG_FULLMEMBER; |
706 |
+ memcpy(&join_cmd.addr, &cmd.addr, join_cmd.addr_size); |
707 |
+ |
708 |
+@@ -1431,6 +1434,9 @@ static ssize_t ucma_join_multicast(struct ucma_file *file, |
709 |
+ if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
710 |
+ return -EFAULT; |
711 |
+ |
712 |
++ if (!rdma_addr_size((struct sockaddr *)&cmd.addr)) |
713 |
++ return -EINVAL; |
714 |
++ |
715 |
+ return ucma_process_join(file, &cmd, out_len); |
716 |
+ } |
717 |
+ |
718 |
+diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c |
719 |
+index 130606c3b07c..9a4e899d94b3 100644 |
720 |
+--- a/drivers/infiniband/core/umem.c |
721 |
++++ b/drivers/infiniband/core/umem.c |
722 |
+@@ -352,7 +352,7 @@ int ib_umem_copy_from(void *dst, struct ib_umem *umem, size_t offset, |
723 |
+ return -EINVAL; |
724 |
+ } |
725 |
+ |
726 |
+- ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->nmap, dst, length, |
727 |
++ ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->npages, dst, length, |
728 |
+ offset + ib_umem_offset(umem)); |
729 |
+ |
730 |
+ if (ret < 0) |
731 |
+diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c |
732 |
+index 756ece6118c0..c4d8cc1c2b1d 100644 |
733 |
+--- a/drivers/infiniband/hw/mlx5/qp.c |
734 |
++++ b/drivers/infiniband/hw/mlx5/qp.c |
735 |
+@@ -1130,7 +1130,7 @@ static void destroy_raw_packet_qp_sq(struct mlx5_ib_dev *dev, |
736 |
+ ib_umem_release(sq->ubuffer.umem); |
737 |
+ } |
738 |
+ |
739 |
+-static int get_rq_pas_size(void *qpc) |
740 |
++static size_t get_rq_pas_size(void *qpc) |
741 |
+ { |
742 |
+ u32 log_page_size = MLX5_GET(qpc, qpc, log_page_size) + 12; |
743 |
+ u32 log_rq_stride = MLX5_GET(qpc, qpc, log_rq_stride); |
744 |
+@@ -1146,7 +1146,8 @@ static int get_rq_pas_size(void *qpc) |
745 |
+ } |
746 |
+ |
747 |
+ static int create_raw_packet_qp_rq(struct mlx5_ib_dev *dev, |
748 |
+- struct mlx5_ib_rq *rq, void *qpin) |
749 |
++ struct mlx5_ib_rq *rq, void *qpin, |
750 |
++ size_t qpinlen) |
751 |
+ { |
752 |
+ struct mlx5_ib_qp *mqp = rq->base.container_mibqp; |
753 |
+ __be64 *pas; |
754 |
+@@ -1155,9 +1156,12 @@ static int create_raw_packet_qp_rq(struct mlx5_ib_dev *dev, |
755 |
+ void *rqc; |
756 |
+ void *wq; |
757 |
+ void *qpc = MLX5_ADDR_OF(create_qp_in, qpin, qpc); |
758 |
+- int inlen; |
759 |
++ size_t rq_pas_size = get_rq_pas_size(qpc); |
760 |
++ size_t inlen; |
761 |
+ int err; |
762 |
+- u32 rq_pas_size = get_rq_pas_size(qpc); |
763 |
++ |
764 |
++ if (qpinlen < rq_pas_size + MLX5_BYTE_OFF(create_qp_in, pas)) |
765 |
++ return -EINVAL; |
766 |
+ |
767 |
+ inlen = MLX5_ST_SZ_BYTES(create_rq_in) + rq_pas_size; |
768 |
+ in = kvzalloc(inlen, GFP_KERNEL); |
769 |
+@@ -1236,7 +1240,7 @@ static void destroy_raw_packet_qp_tir(struct mlx5_ib_dev *dev, |
770 |
+ } |
771 |
+ |
772 |
+ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, |
773 |
+- u32 *in, |
774 |
++ u32 *in, size_t inlen, |
775 |
+ struct ib_pd *pd) |
776 |
+ { |
777 |
+ struct mlx5_ib_raw_packet_qp *raw_packet_qp = &qp->raw_packet_qp; |
778 |
+@@ -1266,7 +1270,7 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, |
779 |
+ |
780 |
+ if (qp->flags & MLX5_IB_QP_CVLAN_STRIPPING) |
781 |
+ rq->flags |= MLX5_IB_RQ_CVLAN_STRIPPING; |
782 |
+- err = create_raw_packet_qp_rq(dev, rq, in); |
783 |
++ err = create_raw_packet_qp_rq(dev, rq, in, inlen); |
784 |
+ if (err) |
785 |
+ goto err_destroy_sq; |
786 |
+ |
787 |
+@@ -1781,11 +1785,16 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, |
788 |
+ qp->flags |= MLX5_IB_QP_LSO; |
789 |
+ } |
790 |
+ |
791 |
++ if (inlen < 0) { |
792 |
++ err = -EINVAL; |
793 |
++ goto err; |
794 |
++ } |
795 |
++ |
796 |
+ if (init_attr->qp_type == IB_QPT_RAW_PACKET || |
797 |
+ qp->flags & MLX5_IB_QP_UNDERLAY) { |
798 |
+ qp->raw_packet_qp.sq.ubuffer.buf_addr = ucmd.sq_buf_addr; |
799 |
+ raw_packet_qp_copy_info(qp, &qp->raw_packet_qp); |
800 |
+- err = create_raw_packet_qp(dev, qp, in, pd); |
801 |
++ err = create_raw_packet_qp(dev, qp, in, inlen, pd); |
802 |
+ } else { |
803 |
+ err = mlx5_core_create_qp(dev->mdev, &base->mqp, in, inlen); |
804 |
+ } |
805 |
+@@ -1825,6 +1834,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, |
806 |
+ else if (qp->create_type == MLX5_QP_KERNEL) |
807 |
+ destroy_qp_kernel(dev, qp); |
808 |
+ |
809 |
++err: |
810 |
+ kvfree(in); |
811 |
+ return err; |
812 |
+ } |
813 |
+diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c |
814 |
+index 6d5fadad9090..3c7522d025f2 100644 |
815 |
+--- a/drivers/infiniband/hw/mlx5/srq.c |
816 |
++++ b/drivers/infiniband/hw/mlx5/srq.c |
817 |
+@@ -241,8 +241,8 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, |
818 |
+ { |
819 |
+ struct mlx5_ib_dev *dev = to_mdev(pd->device); |
820 |
+ struct mlx5_ib_srq *srq; |
821 |
+- int desc_size; |
822 |
+- int buf_size; |
823 |
++ size_t desc_size; |
824 |
++ size_t buf_size; |
825 |
+ int err; |
826 |
+ struct mlx5_srq_attr in = {0}; |
827 |
+ __u32 max_srq_wqes = 1 << MLX5_CAP_GEN(dev->mdev, log_max_srq_sz); |
828 |
+@@ -266,15 +266,18 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, |
829 |
+ |
830 |
+ desc_size = sizeof(struct mlx5_wqe_srq_next_seg) + |
831 |
+ srq->msrq.max_gs * sizeof(struct mlx5_wqe_data_seg); |
832 |
++ if (desc_size == 0 || srq->msrq.max_gs > desc_size) |
833 |
++ return ERR_PTR(-EINVAL); |
834 |
+ desc_size = roundup_pow_of_two(desc_size); |
835 |
+- desc_size = max_t(int, 32, desc_size); |
836 |
++ desc_size = max_t(size_t, 32, desc_size); |
837 |
++ if (desc_size < sizeof(struct mlx5_wqe_srq_next_seg)) |
838 |
++ return ERR_PTR(-EINVAL); |
839 |
+ srq->msrq.max_avail_gather = (desc_size - sizeof(struct mlx5_wqe_srq_next_seg)) / |
840 |
+ sizeof(struct mlx5_wqe_data_seg); |
841 |
+ srq->msrq.wqe_shift = ilog2(desc_size); |
842 |
+ buf_size = srq->msrq.max * desc_size; |
843 |
+- mlx5_ib_dbg(dev, "desc_size 0x%x, req wr 0x%x, srq size 0x%x, max_gs 0x%x, max_avail_gather 0x%x\n", |
844 |
+- desc_size, init_attr->attr.max_wr, srq->msrq.max, srq->msrq.max_gs, |
845 |
+- srq->msrq.max_avail_gather); |
846 |
++ if (buf_size < desc_size) |
847 |
++ return ERR_PTR(-EINVAL); |
848 |
+ in.type = init_attr->srq_type; |
849 |
+ |
850 |
+ if (pd->uobject) |
851 |
+diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c |
852 |
+index 66056f9a9700..48a49f8a5014 100644 |
853 |
+--- a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c |
854 |
++++ b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c |
855 |
+@@ -834,7 +834,7 @@ void ocrdma_add_port_stats(struct ocrdma_dev *dev) |
856 |
+ |
857 |
+ dev->reset_stats.type = OCRDMA_RESET_STATS; |
858 |
+ dev->reset_stats.dev = dev; |
859 |
+- if (!debugfs_create_file("reset_stats", S_IRUSR, dev->dir, |
860 |
++ if (!debugfs_create_file("reset_stats", 0200, dev->dir, |
861 |
+ &dev->reset_stats, &ocrdma_dbg_ops)) |
862 |
+ goto err; |
863 |
+ |
864 |
+diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c |
865 |
+index 3562c0c30492..6286b95d77ed 100644 |
866 |
+--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c |
867 |
++++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c |
868 |
+@@ -114,6 +114,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev, |
869 |
+ union pvrdma_cmd_resp rsp; |
870 |
+ struct pvrdma_cmd_create_cq *cmd = &req.create_cq; |
871 |
+ struct pvrdma_cmd_create_cq_resp *resp = &rsp.create_cq_resp; |
872 |
++ struct pvrdma_create_cq_resp cq_resp = {0}; |
873 |
+ struct pvrdma_create_cq ucmd; |
874 |
+ |
875 |
+ BUILD_BUG_ON(sizeof(struct pvrdma_cqe) != 64); |
876 |
+@@ -198,6 +199,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev, |
877 |
+ |
878 |
+ cq->ibcq.cqe = resp->cqe; |
879 |
+ cq->cq_handle = resp->cq_handle; |
880 |
++ cq_resp.cqn = resp->cq_handle; |
881 |
+ spin_lock_irqsave(&dev->cq_tbl_lock, flags); |
882 |
+ dev->cq_tbl[cq->cq_handle % dev->dsr->caps.max_cq] = cq; |
883 |
+ spin_unlock_irqrestore(&dev->cq_tbl_lock, flags); |
884 |
+@@ -206,7 +208,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev, |
885 |
+ cq->uar = &(to_vucontext(context)->uar); |
886 |
+ |
887 |
+ /* Copy udata back. */ |
888 |
+- if (ib_copy_to_udata(udata, &cq->cq_handle, sizeof(__u32))) { |
889 |
++ if (ib_copy_to_udata(udata, &cq_resp, sizeof(cq_resp))) { |
890 |
+ dev_warn(&dev->pdev->dev, |
891 |
+ "failed to copy back udata\n"); |
892 |
+ pvrdma_destroy_cq(&cq->ibcq); |
893 |
+diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c |
894 |
+index 48776f5ffb0e..aa533f08e017 100644 |
895 |
+--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c |
896 |
++++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c |
897 |
+@@ -444,6 +444,7 @@ struct ib_pd *pvrdma_alloc_pd(struct ib_device *ibdev, |
898 |
+ union pvrdma_cmd_resp rsp; |
899 |
+ struct pvrdma_cmd_create_pd *cmd = &req.create_pd; |
900 |
+ struct pvrdma_cmd_create_pd_resp *resp = &rsp.create_pd_resp; |
901 |
++ struct pvrdma_alloc_pd_resp pd_resp = {0}; |
902 |
+ int ret; |
903 |
+ void *ptr; |
904 |
+ |
905 |
+@@ -472,9 +473,10 @@ struct ib_pd *pvrdma_alloc_pd(struct ib_device *ibdev, |
906 |
+ pd->privileged = !context; |
907 |
+ pd->pd_handle = resp->pd_handle; |
908 |
+ pd->pdn = resp->pd_handle; |
909 |
++ pd_resp.pdn = resp->pd_handle; |
910 |
+ |
911 |
+ if (context) { |
912 |
+- if (ib_copy_to_udata(udata, &pd->pdn, sizeof(__u32))) { |
913 |
++ if (ib_copy_to_udata(udata, &pd_resp, sizeof(pd_resp))) { |
914 |
+ dev_warn(&dev->pdev->dev, |
915 |
+ "failed to copy back protection domain\n"); |
916 |
+ pvrdma_dealloc_pd(&pd->ibpd); |
917 |
+diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c |
918 |
+index f6935811ef3f..a009e943362a 100644 |
919 |
+--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c |
920 |
++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c |
921 |
+@@ -776,6 +776,22 @@ static void path_rec_completion(int status, |
922 |
+ spin_lock_irqsave(&priv->lock, flags); |
923 |
+ |
924 |
+ if (!IS_ERR_OR_NULL(ah)) { |
925 |
++ /* |
926 |
++ * pathrec.dgid is used as the database key from the LLADDR, |
927 |
++ * it must remain unchanged even if the SA returns a different |
928 |
++ * GID to use in the AH. |
929 |
++ */ |
930 |
++ if (memcmp(pathrec->dgid.raw, path->pathrec.dgid.raw, |
931 |
++ sizeof(union ib_gid))) { |
932 |
++ ipoib_dbg( |
933 |
++ priv, |
934 |
++ "%s got PathRec for gid %pI6 while asked for %pI6\n", |
935 |
++ dev->name, pathrec->dgid.raw, |
936 |
++ path->pathrec.dgid.raw); |
937 |
++ memcpy(pathrec->dgid.raw, path->pathrec.dgid.raw, |
938 |
++ sizeof(union ib_gid)); |
939 |
++ } |
940 |
++ |
941 |
+ path->pathrec = *pathrec; |
942 |
+ |
943 |
+ old_ah = path->ah; |
944 |
+diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c |
945 |
+index 9d4785ba24cb..e770c17cbca9 100644 |
946 |
+--- a/drivers/infiniband/ulp/isert/ib_isert.c |
947 |
++++ b/drivers/infiniband/ulp/isert/ib_isert.c |
948 |
+@@ -2124,6 +2124,9 @@ isert_rdma_rw_ctx_post(struct isert_cmd *cmd, struct isert_conn *conn, |
949 |
+ u32 rkey, offset; |
950 |
+ int ret; |
951 |
+ |
952 |
++ if (cmd->ctx_init_done) |
953 |
++ goto rdma_ctx_post; |
954 |
++ |
955 |
+ if (dir == DMA_FROM_DEVICE) { |
956 |
+ addr = cmd->write_va; |
957 |
+ rkey = cmd->write_stag; |
958 |
+@@ -2151,11 +2154,15 @@ isert_rdma_rw_ctx_post(struct isert_cmd *cmd, struct isert_conn *conn, |
959 |
+ se_cmd->t_data_sg, se_cmd->t_data_nents, |
960 |
+ offset, addr, rkey, dir); |
961 |
+ } |
962 |
++ |
963 |
+ if (ret < 0) { |
964 |
+ isert_err("Cmd: %p failed to prepare RDMA res\n", cmd); |
965 |
+ return ret; |
966 |
+ } |
967 |
+ |
968 |
++ cmd->ctx_init_done = true; |
969 |
++ |
970 |
++rdma_ctx_post: |
971 |
+ ret = rdma_rw_ctx_post(&cmd->rw, conn->qp, port_num, cqe, chain_wr); |
972 |
+ if (ret < 0) |
973 |
+ isert_err("Cmd: %p failed to post RDMA res\n", cmd); |
974 |
+diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h |
975 |
+index d6fd248320ae..3b296bac4f60 100644 |
976 |
+--- a/drivers/infiniband/ulp/isert/ib_isert.h |
977 |
++++ b/drivers/infiniband/ulp/isert/ib_isert.h |
978 |
+@@ -126,6 +126,7 @@ struct isert_cmd { |
979 |
+ struct rdma_rw_ctx rw; |
980 |
+ struct work_struct comp_work; |
981 |
+ struct scatterlist sg; |
982 |
++ bool ctx_init_done; |
983 |
+ }; |
984 |
+ |
985 |
+ static inline struct isert_cmd *tx_desc_to_cmd(struct iser_tx_desc *desc) |
986 |
+diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c |
987 |
+index f6697e55c2d4..003b4a4d4b78 100644 |
988 |
+--- a/drivers/iommu/intel-svm.c |
989 |
++++ b/drivers/iommu/intel-svm.c |
990 |
+@@ -129,6 +129,7 @@ int intel_svm_enable_prq(struct intel_iommu *iommu) |
991 |
+ pr_err("IOMMU: %s: Failed to request IRQ for page request queue\n", |
992 |
+ iommu->name); |
993 |
+ dmar_free_hwirq(irq); |
994 |
++ iommu->pr_irq = 0; |
995 |
+ goto err; |
996 |
+ } |
997 |
+ dmar_writeq(iommu->reg + DMAR_PQH_REG, 0ULL); |
998 |
+@@ -144,9 +145,11 @@ int intel_svm_finish_prq(struct intel_iommu *iommu) |
999 |
+ dmar_writeq(iommu->reg + DMAR_PQT_REG, 0ULL); |
1000 |
+ dmar_writeq(iommu->reg + DMAR_PQA_REG, 0ULL); |
1001 |
+ |
1002 |
+- free_irq(iommu->pr_irq, iommu); |
1003 |
+- dmar_free_hwirq(iommu->pr_irq); |
1004 |
+- iommu->pr_irq = 0; |
1005 |
++ if (iommu->pr_irq) { |
1006 |
++ free_irq(iommu->pr_irq, iommu); |
1007 |
++ dmar_free_hwirq(iommu->pr_irq); |
1008 |
++ iommu->pr_irq = 0; |
1009 |
++ } |
1010 |
+ |
1011 |
+ free_pages((unsigned long)iommu->prq, PRQ_ORDER); |
1012 |
+ iommu->prq = NULL; |
1013 |
+diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c |
1014 |
+index 172fc367ccaa..24840a2e5a75 100644 |
1015 |
+--- a/drivers/media/dvb-frontends/si2168.c |
1016 |
++++ b/drivers/media/dvb-frontends/si2168.c |
1017 |
+@@ -14,6 +14,8 @@ |
1018 |
+ * GNU General Public License for more details. |
1019 |
+ */ |
1020 |
+ |
1021 |
++#include <linux/delay.h> |
1022 |
++ |
1023 |
+ #include "si2168_priv.h" |
1024 |
+ |
1025 |
+ static const struct dvb_frontend_ops si2168_ops; |
1026 |
+@@ -435,6 +437,7 @@ static int si2168_init(struct dvb_frontend *fe) |
1027 |
+ if (ret) |
1028 |
+ goto err; |
1029 |
+ |
1030 |
++ udelay(100); |
1031 |
+ memcpy(cmd.args, "\x85", 1); |
1032 |
+ cmd.wlen = 1; |
1033 |
+ cmd.rlen = 1; |
1034 |
+diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c |
1035 |
+index a5f52137d306..d4bc78b4fcb5 100644 |
1036 |
+--- a/drivers/media/pci/bt8xx/bt878.c |
1037 |
++++ b/drivers/media/pci/bt8xx/bt878.c |
1038 |
+@@ -422,8 +422,7 @@ static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) |
1039 |
+ bt878_num); |
1040 |
+ if (bt878_num >= BT878_MAX) { |
1041 |
+ printk(KERN_ERR "bt878: Too many devices inserted\n"); |
1042 |
+- result = -ENOMEM; |
1043 |
+- goto fail0; |
1044 |
++ return -ENOMEM; |
1045 |
+ } |
1046 |
+ if (pci_enable_device(dev)) |
1047 |
+ return -EIO; |
1048 |
+diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c |
1049 |
+index 233622bef4a5..dc8fc2120b63 100644 |
1050 |
+--- a/drivers/media/platform/davinci/vpif_capture.c |
1051 |
++++ b/drivers/media/platform/davinci/vpif_capture.c |
1052 |
+@@ -1397,9 +1397,9 @@ static int vpif_async_bound(struct v4l2_async_notifier *notifier, |
1053 |
+ vpif_obj.config->chan_config->inputs[i].subdev_name = |
1054 |
+ (char *)to_of_node(subdev->fwnode)->full_name; |
1055 |
+ vpif_dbg(2, debug, |
1056 |
+- "%s: setting input %d subdev_name = %pOF\n", |
1057 |
++ "%s: setting input %d subdev_name = %s\n", |
1058 |
+ __func__, i, |
1059 |
+- to_of_node(subdev->fwnode)); |
1060 |
++ vpif_obj.config->chan_config->inputs[i].subdev_name); |
1061 |
+ return 0; |
1062 |
+ } |
1063 |
+ } |
1064 |
+diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c |
1065 |
+index 1afde5021ca6..8e9531f7f83f 100644 |
1066 |
+--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c |
1067 |
++++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c |
1068 |
+@@ -1315,6 +1315,12 @@ static int s5p_mfc_probe(struct platform_device *pdev) |
1069 |
+ goto err_dma; |
1070 |
+ } |
1071 |
+ |
1072 |
++ /* |
1073 |
++ * Load fails if fs isn't mounted. Try loading anyway. |
1074 |
++ * _open() will load it, it it fails now. Ignore failure. |
1075 |
++ */ |
1076 |
++ s5p_mfc_load_firmware(dev); |
1077 |
++ |
1078 |
+ mutex_init(&dev->mfc_mutex); |
1079 |
+ init_waitqueue_head(&dev->queue); |
1080 |
+ dev->hw_lock = 0; |
1081 |
+diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h |
1082 |
+index 4220914529b2..76119a8cc477 100644 |
1083 |
+--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h |
1084 |
++++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h |
1085 |
+@@ -290,6 +290,8 @@ struct s5p_mfc_priv_buf { |
1086 |
+ * @mfc_cmds: cmd structure holding HW commands function pointers |
1087 |
+ * @mfc_regs: structure holding MFC registers |
1088 |
+ * @fw_ver: loaded firmware sub-version |
1089 |
++ * @fw_get_done flag set when request_firmware() is complete and |
1090 |
++ * copied into fw_buf |
1091 |
+ * risc_on: flag indicates RISC is on or off |
1092 |
+ * |
1093 |
+ */ |
1094 |
+@@ -336,6 +338,7 @@ struct s5p_mfc_dev { |
1095 |
+ struct s5p_mfc_hw_cmds *mfc_cmds; |
1096 |
+ const struct s5p_mfc_regs *mfc_regs; |
1097 |
+ enum s5p_mfc_fw_ver fw_ver; |
1098 |
++ bool fw_get_done; |
1099 |
+ bool risc_on; /* indicates if RISC is on or off */ |
1100 |
+ }; |
1101 |
+ |
1102 |
+diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c |
1103 |
+index 69ef9c23a99a..d94e59e79fe9 100644 |
1104 |
+--- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c |
1105 |
++++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c |
1106 |
+@@ -55,6 +55,9 @@ int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev) |
1107 |
+ * into kernel. */ |
1108 |
+ mfc_debug_enter(); |
1109 |
+ |
1110 |
++ if (dev->fw_get_done) |
1111 |
++ return 0; |
1112 |
++ |
1113 |
+ for (i = MFC_FW_MAX_VERSIONS - 1; i >= 0; i--) { |
1114 |
+ if (!dev->variant->fw_name[i]) |
1115 |
+ continue; |
1116 |
+@@ -82,6 +85,7 @@ int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev) |
1117 |
+ } |
1118 |
+ memcpy(dev->fw_buf.virt, fw_blob->data, fw_blob->size); |
1119 |
+ wmb(); |
1120 |
++ dev->fw_get_done = true; |
1121 |
+ release_firmware(fw_blob); |
1122 |
+ mfc_debug_leave(); |
1123 |
+ return 0; |
1124 |
+@@ -93,6 +97,7 @@ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) |
1125 |
+ /* Before calling this function one has to make sure |
1126 |
+ * that MFC is no longer processing */ |
1127 |
+ s5p_mfc_release_priv_buf(dev, &dev->fw_buf); |
1128 |
++ dev->fw_get_done = false; |
1129 |
+ return 0; |
1130 |
+ } |
1131 |
+ |
1132 |
+diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c |
1133 |
+index 59280ac31937..23d0cedf4d9d 100644 |
1134 |
+--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c |
1135 |
++++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c |
1136 |
+@@ -83,7 +83,7 @@ static void c8sectpfe_timer_interrupt(unsigned long ac8sectpfei) |
1137 |
+ static void channel_swdemux_tsklet(unsigned long data) |
1138 |
+ { |
1139 |
+ struct channel_info *channel = (struct channel_info *)data; |
1140 |
+- struct c8sectpfei *fei = channel->fei; |
1141 |
++ struct c8sectpfei *fei; |
1142 |
+ unsigned long wp, rp; |
1143 |
+ int pos, num_packets, n, size; |
1144 |
+ u8 *buf; |
1145 |
+@@ -91,6 +91,8 @@ static void channel_swdemux_tsklet(unsigned long data) |
1146 |
+ if (unlikely(!channel || !channel->irec)) |
1147 |
+ return; |
1148 |
+ |
1149 |
++ fei = channel->fei; |
1150 |
++ |
1151 |
+ wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); |
1152 |
+ rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); |
1153 |
+ |
1154 |
+diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c |
1155 |
+index ccb516f18d72..9c6f2ce3b710 100644 |
1156 |
+--- a/drivers/mmc/core/block.c |
1157 |
++++ b/drivers/mmc/core/block.c |
1158 |
+@@ -2387,6 +2387,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp) |
1159 |
+ |
1160 |
+ if (n != EXT_CSD_STR_LEN) { |
1161 |
+ err = -EINVAL; |
1162 |
++ kfree(ext_csd); |
1163 |
+ goto out_free; |
1164 |
+ } |
1165 |
+ |
1166 |
+diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c |
1167 |
+index 66c9cf49ad2f..29bfff2ed4d3 100644 |
1168 |
+--- a/drivers/mmc/core/core.c |
1169 |
++++ b/drivers/mmc/core/core.c |
1170 |
+@@ -2751,6 +2751,14 @@ static int mmc_pm_notify(struct notifier_block *notify_block, |
1171 |
+ if (!err) |
1172 |
+ break; |
1173 |
+ |
1174 |
++ if (!mmc_card_is_removable(host)) { |
1175 |
++ dev_warn(mmc_dev(host), |
1176 |
++ "pre_suspend failed for non-removable host: " |
1177 |
++ "%d\n", err); |
1178 |
++ /* Avoid removing non-removable hosts */ |
1179 |
++ break; |
1180 |
++ } |
1181 |
++ |
1182 |
+ /* Calling bus_ops->remove() with a claimed host can deadlock */ |
1183 |
+ host->bus_ops->remove(host); |
1184 |
+ mmc_claim_host(host); |
1185 |
+diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c |
1186 |
+index 0842bbc2d7ad..4d0791f6ec23 100644 |
1187 |
+--- a/drivers/mmc/host/sdhci-xenon.c |
1188 |
++++ b/drivers/mmc/host/sdhci-xenon.c |
1189 |
+@@ -230,7 +230,14 @@ static void xenon_set_power(struct sdhci_host *host, unsigned char mode, |
1190 |
+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); |
1191 |
+ } |
1192 |
+ |
1193 |
++static void xenon_voltage_switch(struct sdhci_host *host) |
1194 |
++{ |
1195 |
++ /* Wait for 5ms after set 1.8V signal enable bit */ |
1196 |
++ usleep_range(5000, 5500); |
1197 |
++} |
1198 |
++ |
1199 |
+ static const struct sdhci_ops sdhci_xenon_ops = { |
1200 |
++ .voltage_switch = xenon_voltage_switch, |
1201 |
+ .set_clock = sdhci_set_clock, |
1202 |
+ .set_power = xenon_set_power, |
1203 |
+ .set_bus_width = sdhci_set_bus_width, |
1204 |
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h |
1205 |
+index 5176be76ca7d..4f3afcf92a7c 100644 |
1206 |
+--- a/drivers/net/hyperv/hyperv_net.h |
1207 |
++++ b/drivers/net/hyperv/hyperv_net.h |
1208 |
+@@ -635,14 +635,27 @@ struct nvsp_message { |
1209 |
+ #define NETVSC_MTU 65535 |
1210 |
+ #define NETVSC_MTU_MIN ETH_MIN_MTU |
1211 |
+ |
1212 |
+-#define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */ |
1213 |
+-#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */ |
1214 |
+-#define NETVSC_SEND_BUFFER_SIZE (1024 * 1024 * 15) /* 15MB */ |
1215 |
++/* Max buffer sizes allowed by a host */ |
1216 |
++#define NETVSC_RECEIVE_BUFFER_SIZE (1024 * 1024 * 31) /* 31MB */ |
1217 |
++#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024 * 1024 * 15) /* 15MB */ |
1218 |
++#define NETVSC_RECEIVE_BUFFER_DEFAULT (1024 * 1024 * 16) |
1219 |
++ |
1220 |
++#define NETVSC_SEND_BUFFER_SIZE (1024 * 1024 * 15) /* 15MB */ |
1221 |
++#define NETVSC_SEND_BUFFER_DEFAULT (1024 * 1024) |
1222 |
++ |
1223 |
+ #define NETVSC_INVALID_INDEX -1 |
1224 |
+ |
1225 |
+ #define NETVSC_SEND_SECTION_SIZE 6144 |
1226 |
+ #define NETVSC_RECV_SECTION_SIZE 1728 |
1227 |
+ |
1228 |
++/* Default size of TX buf: 1MB, RX buf: 16MB */ |
1229 |
++#define NETVSC_MIN_TX_SECTIONS 10 |
1230 |
++#define NETVSC_DEFAULT_TX (NETVSC_SEND_BUFFER_DEFAULT \ |
1231 |
++ / NETVSC_SEND_SECTION_SIZE) |
1232 |
++#define NETVSC_MIN_RX_SECTIONS 10 |
1233 |
++#define NETVSC_DEFAULT_RX (NETVSC_RECEIVE_BUFFER_DEFAULT \ |
1234 |
++ / NETVSC_RECV_SECTION_SIZE) |
1235 |
++ |
1236 |
+ #define NETVSC_RECEIVE_BUFFER_ID 0xcafe |
1237 |
+ #define NETVSC_SEND_BUFFER_ID 0 |
1238 |
+ |
1239 |
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c |
1240 |
+index 8d5077fb0492..a6bafcf55776 100644 |
1241 |
+--- a/drivers/net/hyperv/netvsc.c |
1242 |
++++ b/drivers/net/hyperv/netvsc.c |
1243 |
+@@ -262,6 +262,11 @@ static int netvsc_init_buf(struct hv_device *device, |
1244 |
+ buf_size = device_info->recv_sections * device_info->recv_section_size; |
1245 |
+ buf_size = roundup(buf_size, PAGE_SIZE); |
1246 |
+ |
1247 |
++ /* Legacy hosts only allow smaller receive buffer */ |
1248 |
++ if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_2) |
1249 |
++ buf_size = min_t(unsigned int, buf_size, |
1250 |
++ NETVSC_RECEIVE_BUFFER_SIZE_LEGACY); |
1251 |
++ |
1252 |
+ net_device->recv_buf = vzalloc(buf_size); |
1253 |
+ if (!net_device->recv_buf) { |
1254 |
+ netdev_err(ndev, |
1255 |
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c |
1256 |
+index a32ae02e1b6c..c849de3cb046 100644 |
1257 |
+--- a/drivers/net/hyperv/netvsc_drv.c |
1258 |
++++ b/drivers/net/hyperv/netvsc_drv.c |
1259 |
+@@ -46,10 +46,6 @@ |
1260 |
+ #include "hyperv_net.h" |
1261 |
+ |
1262 |
+ #define RING_SIZE_MIN 64 |
1263 |
+-#define NETVSC_MIN_TX_SECTIONS 10 |
1264 |
+-#define NETVSC_DEFAULT_TX 192 /* ~1M */ |
1265 |
+-#define NETVSC_MIN_RX_SECTIONS 10 /* ~64K */ |
1266 |
+-#define NETVSC_DEFAULT_RX 10485 /* Max ~16M */ |
1267 |
+ |
1268 |
+ #define LINKCHANGE_INT (2 * HZ) |
1269 |
+ #define VF_TAKEOVER_INT (HZ / 10) |
1270 |
+diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c |
1271 |
+index 1ea69b7585d9..7ddb709f69fc 100644 |
1272 |
+--- a/drivers/net/phy/meson-gxl.c |
1273 |
++++ b/drivers/net/phy/meson-gxl.c |
1274 |
+@@ -25,27 +25,53 @@ |
1275 |
+ |
1276 |
+ static int meson_gxl_config_init(struct phy_device *phydev) |
1277 |
+ { |
1278 |
++ int ret; |
1279 |
++ |
1280 |
+ /* Enable Analog and DSP register Bank access by */ |
1281 |
+- phy_write(phydev, 0x14, 0x0000); |
1282 |
+- phy_write(phydev, 0x14, 0x0400); |
1283 |
+- phy_write(phydev, 0x14, 0x0000); |
1284 |
+- phy_write(phydev, 0x14, 0x0400); |
1285 |
++ ret = phy_write(phydev, 0x14, 0x0000); |
1286 |
++ if (ret) |
1287 |
++ return ret; |
1288 |
++ ret = phy_write(phydev, 0x14, 0x0400); |
1289 |
++ if (ret) |
1290 |
++ return ret; |
1291 |
++ ret = phy_write(phydev, 0x14, 0x0000); |
1292 |
++ if (ret) |
1293 |
++ return ret; |
1294 |
++ ret = phy_write(phydev, 0x14, 0x0400); |
1295 |
++ if (ret) |
1296 |
++ return ret; |
1297 |
+ |
1298 |
+ /* Write Analog register 23 */ |
1299 |
+- phy_write(phydev, 0x17, 0x8E0D); |
1300 |
+- phy_write(phydev, 0x14, 0x4417); |
1301 |
++ ret = phy_write(phydev, 0x17, 0x8E0D); |
1302 |
++ if (ret) |
1303 |
++ return ret; |
1304 |
++ ret = phy_write(phydev, 0x14, 0x4417); |
1305 |
++ if (ret) |
1306 |
++ return ret; |
1307 |
+ |
1308 |
+ /* Enable fractional PLL */ |
1309 |
+- phy_write(phydev, 0x17, 0x0005); |
1310 |
+- phy_write(phydev, 0x14, 0x5C1B); |
1311 |
++ ret = phy_write(phydev, 0x17, 0x0005); |
1312 |
++ if (ret) |
1313 |
++ return ret; |
1314 |
++ ret = phy_write(phydev, 0x14, 0x5C1B); |
1315 |
++ if (ret) |
1316 |
++ return ret; |
1317 |
+ |
1318 |
+ /* Program fraction FR_PLL_DIV1 */ |
1319 |
+- phy_write(phydev, 0x17, 0x029A); |
1320 |
+- phy_write(phydev, 0x14, 0x5C1D); |
1321 |
++ ret = phy_write(phydev, 0x17, 0x029A); |
1322 |
++ if (ret) |
1323 |
++ return ret; |
1324 |
++ ret = phy_write(phydev, 0x14, 0x5C1D); |
1325 |
++ if (ret) |
1326 |
++ return ret; |
1327 |
+ |
1328 |
+ /* Program fraction FR_PLL_DIV1 */ |
1329 |
+- phy_write(phydev, 0x17, 0xAAAA); |
1330 |
+- phy_write(phydev, 0x14, 0x5C1C); |
1331 |
++ ret = phy_write(phydev, 0x17, 0xAAAA); |
1332 |
++ if (ret) |
1333 |
++ return ret; |
1334 |
++ ret = phy_write(phydev, 0x14, 0x5C1C); |
1335 |
++ if (ret) |
1336 |
++ return ret; |
1337 |
+ |
1338 |
+ return 0; |
1339 |
+ } |
1340 |
+diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c |
1341 |
+index 8bf10aba7452..3165bc7b8e1e 100644 |
1342 |
+--- a/drivers/net/phy/sfp.c |
1343 |
++++ b/drivers/net/phy/sfp.c |
1344 |
+@@ -318,12 +318,12 @@ static void sfp_sm_probe_phy(struct sfp *sfp) |
1345 |
+ msleep(T_PHY_RESET_MS); |
1346 |
+ |
1347 |
+ phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR); |
1348 |
+- if (IS_ERR(phy)) { |
1349 |
+- dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); |
1350 |
++ if (phy == ERR_PTR(-ENODEV)) { |
1351 |
++ dev_info(sfp->dev, "no PHY detected\n"); |
1352 |
+ return; |
1353 |
+ } |
1354 |
+- if (!phy) { |
1355 |
+- dev_info(sfp->dev, "no PHY detected\n"); |
1356 |
++ if (IS_ERR(phy)) { |
1357 |
++ dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); |
1358 |
+ return; |
1359 |
+ } |
1360 |
+ |
1361 |
+@@ -667,20 +667,19 @@ static int sfp_module_eeprom(struct sfp *sfp, struct ethtool_eeprom *ee, |
1362 |
+ len = min_t(unsigned int, last, ETH_MODULE_SFF_8079_LEN); |
1363 |
+ len -= first; |
1364 |
+ |
1365 |
+- ret = sfp->read(sfp, false, first, data, len); |
1366 |
++ ret = sfp_read(sfp, false, first, data, len); |
1367 |
+ if (ret < 0) |
1368 |
+ return ret; |
1369 |
+ |
1370 |
+ first += len; |
1371 |
+ data += len; |
1372 |
+ } |
1373 |
+- if (first >= ETH_MODULE_SFF_8079_LEN && |
1374 |
+- first < ETH_MODULE_SFF_8472_LEN) { |
1375 |
++ if (first < ETH_MODULE_SFF_8472_LEN && last > ETH_MODULE_SFF_8079_LEN) { |
1376 |
+ len = min_t(unsigned int, last, ETH_MODULE_SFF_8472_LEN); |
1377 |
+ len -= first; |
1378 |
+ first -= ETH_MODULE_SFF_8079_LEN; |
1379 |
+ |
1380 |
+- ret = sfp->read(sfp, true, first, data, len); |
1381 |
++ ret = sfp_read(sfp, true, first, data, len); |
1382 |
+ if (ret < 0) |
1383 |
+ return ret; |
1384 |
+ } |
1385 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
1386 |
+index b1632294174f..5d3d31f5933b 100644 |
1387 |
+--- a/drivers/net/usb/qmi_wwan.c |
1388 |
++++ b/drivers/net/usb/qmi_wwan.c |
1389 |
+@@ -826,7 +826,7 @@ static int qmi_wwan_resume(struct usb_interface *intf) |
1390 |
+ |
1391 |
+ static const struct driver_info qmi_wwan_info = { |
1392 |
+ .description = "WWAN/QMI device", |
1393 |
+- .flags = FLAG_WWAN, |
1394 |
++ .flags = FLAG_WWAN | FLAG_SEND_ZLP, |
1395 |
+ .bind = qmi_wwan_bind, |
1396 |
+ .unbind = qmi_wwan_unbind, |
1397 |
+ .manage_power = qmi_wwan_manage_power, |
1398 |
+@@ -835,7 +835,7 @@ static const struct driver_info qmi_wwan_info = { |
1399 |
+ |
1400 |
+ static const struct driver_info qmi_wwan_info_quirk_dtr = { |
1401 |
+ .description = "WWAN/QMI device", |
1402 |
+- .flags = FLAG_WWAN, |
1403 |
++ .flags = FLAG_WWAN | FLAG_SEND_ZLP, |
1404 |
+ .bind = qmi_wwan_bind, |
1405 |
+ .unbind = qmi_wwan_unbind, |
1406 |
+ .manage_power = qmi_wwan_manage_power, |
1407 |
+diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c |
1408 |
+index 35b752353aee..252c2206cbb5 100644 |
1409 |
+--- a/drivers/net/wireless/ath/ath10k/mac.c |
1410 |
++++ b/drivers/net/wireless/ath/ath10k/mac.c |
1411 |
+@@ -2553,7 +2553,7 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar, |
1412 |
+ } |
1413 |
+ break; |
1414 |
+ case WMI_VDEV_TYPE_STA: |
1415 |
+- if (vif->bss_conf.qos) |
1416 |
++ if (sta->wme) |
1417 |
+ arg->peer_flags |= arvif->ar->wmi.peer_flags->qos; |
1418 |
+ break; |
1419 |
+ case WMI_VDEV_TYPE_IBSS: |
1420 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c |
1421 |
+index ea18aa7afecb..93256f8bc0b5 100644 |
1422 |
+--- a/drivers/net/wireless/realtek/rtlwifi/base.c |
1423 |
++++ b/drivers/net/wireless/realtek/rtlwifi/base.c |
1424 |
+@@ -1664,7 +1664,7 @@ int rtl_tx_agg_oper(struct ieee80211_hw *hw, |
1425 |
+ void rtl_rx_ampdu_apply(struct rtl_priv *rtlpriv) |
1426 |
+ { |
1427 |
+ struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops; |
1428 |
+- u8 reject_agg, ctrl_agg_size = 0, agg_size; |
1429 |
++ u8 reject_agg = 0, ctrl_agg_size = 0, agg_size = 0; |
1430 |
+ |
1431 |
+ if (rtlpriv->cfg->ops->get_btc_status()) |
1432 |
+ btc_ops->btc_get_ampdu_cfg(rtlpriv, &reject_agg, |
1433 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c |
1434 |
+index 08dc8919ef60..d7331225c5f3 100644 |
1435 |
+--- a/drivers/net/wireless/realtek/rtlwifi/pci.c |
1436 |
++++ b/drivers/net/wireless/realtek/rtlwifi/pci.c |
1437 |
+@@ -1568,7 +1568,14 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) |
1438 |
+ dev_kfree_skb_irq(skb); |
1439 |
+ ring->idx = (ring->idx + 1) % ring->entries; |
1440 |
+ } |
1441 |
++ |
1442 |
++ if (rtlpriv->use_new_trx_flow) { |
1443 |
++ rtlpci->tx_ring[i].cur_tx_rp = 0; |
1444 |
++ rtlpci->tx_ring[i].cur_tx_wp = 0; |
1445 |
++ } |
1446 |
++ |
1447 |
+ ring->idx = 0; |
1448 |
++ ring->entries = rtlpci->txringcount[i]; |
1449 |
+ } |
1450 |
+ } |
1451 |
+ spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); |
1452 |
+diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c |
1453 |
+index d53d5f168363..7c621877a939 100644 |
1454 |
+--- a/drivers/pci/dwc/pcie-designware-ep.c |
1455 |
++++ b/drivers/pci/dwc/pcie-designware-ep.c |
1456 |
+@@ -197,20 +197,14 @@ static int dw_pcie_ep_map_addr(struct pci_epc *epc, phys_addr_t addr, |
1457 |
+ static int dw_pcie_ep_get_msi(struct pci_epc *epc) |
1458 |
+ { |
1459 |
+ int val; |
1460 |
+- u32 lower_addr; |
1461 |
+- u32 upper_addr; |
1462 |
+ struct dw_pcie_ep *ep = epc_get_drvdata(epc); |
1463 |
+ struct dw_pcie *pci = to_dw_pcie_from_ep(ep); |
1464 |
+ |
1465 |
+- val = dw_pcie_readb_dbi(pci, MSI_MESSAGE_CONTROL); |
1466 |
+- val = (val & MSI_CAP_MME_MASK) >> MSI_CAP_MME_SHIFT; |
1467 |
+- |
1468 |
+- lower_addr = dw_pcie_readl_dbi(pci, MSI_MESSAGE_ADDR_L32); |
1469 |
+- upper_addr = dw_pcie_readl_dbi(pci, MSI_MESSAGE_ADDR_U32); |
1470 |
+- |
1471 |
+- if (!(lower_addr || upper_addr)) |
1472 |
++ val = dw_pcie_readw_dbi(pci, MSI_MESSAGE_CONTROL); |
1473 |
++ if (!(val & MSI_CAP_MSI_EN_MASK)) |
1474 |
+ return -EINVAL; |
1475 |
+ |
1476 |
++ val = (val & MSI_CAP_MME_MASK) >> MSI_CAP_MME_SHIFT; |
1477 |
+ return val; |
1478 |
+ } |
1479 |
+ |
1480 |
+diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers/pci/dwc/pcie-designware.h |
1481 |
+index e5d9d77b778e..cb493bcae8b4 100644 |
1482 |
+--- a/drivers/pci/dwc/pcie-designware.h |
1483 |
++++ b/drivers/pci/dwc/pcie-designware.h |
1484 |
+@@ -101,6 +101,7 @@ |
1485 |
+ #define MSI_MESSAGE_CONTROL 0x52 |
1486 |
+ #define MSI_CAP_MMC_SHIFT 1 |
1487 |
+ #define MSI_CAP_MME_SHIFT 4 |
1488 |
++#define MSI_CAP_MSI_EN_MASK 0x1 |
1489 |
+ #define MSI_CAP_MME_MASK (7 << MSI_CAP_MME_SHIFT) |
1490 |
+ #define MSI_MESSAGE_ADDR_L32 0x54 |
1491 |
+ #define MSI_MESSAGE_ADDR_U32 0x58 |
1492 |
+diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c |
1493 |
+index 424fdd6ed1ca..16cec66b1d0b 100644 |
1494 |
+--- a/drivers/pci/endpoint/pci-ep-cfs.c |
1495 |
++++ b/drivers/pci/endpoint/pci-ep-cfs.c |
1496 |
+@@ -109,7 +109,10 @@ static int pci_epc_epf_link(struct config_item *epc_item, |
1497 |
+ goto err_add_epf; |
1498 |
+ |
1499 |
+ func_no = find_first_zero_bit(&epc_group->function_num_map, |
1500 |
+- sizeof(epc_group->function_num_map)); |
1501 |
++ BITS_PER_LONG); |
1502 |
++ if (func_no >= BITS_PER_LONG) |
1503 |
++ return -EINVAL; |
1504 |
++ |
1505 |
+ set_bit(func_no, &epc_group->function_num_map); |
1506 |
+ epf->func_no = func_no; |
1507 |
+ |
1508 |
+diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c |
1509 |
+index f09ff4789bb5..8f44a7d14bff 100644 |
1510 |
+--- a/drivers/pci/host/pcie-rcar.c |
1511 |
++++ b/drivers/pci/host/pcie-rcar.c |
1512 |
+@@ -1141,7 +1141,9 @@ static int rcar_pcie_probe(struct platform_device *pdev) |
1513 |
+ |
1514 |
+ INIT_LIST_HEAD(&pcie->resources); |
1515 |
+ |
1516 |
+- rcar_pcie_parse_request_of_pci_ranges(pcie); |
1517 |
++ err = rcar_pcie_parse_request_of_pci_ranges(pcie); |
1518 |
++ if (err) |
1519 |
++ goto err_free_bridge; |
1520 |
+ |
1521 |
+ err = rcar_pcie_get_resources(pcie); |
1522 |
+ if (err < 0) { |
1523 |
+@@ -1196,6 +1198,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) |
1524 |
+ |
1525 |
+ err_free_resource_list: |
1526 |
+ pci_free_resource_list(&pcie->resources); |
1527 |
++err_free_bridge: |
1528 |
+ pci_free_host_bridge(bridge); |
1529 |
+ |
1530 |
+ return err; |
1531 |
+diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c |
1532 |
+index 56fbe4c3e800..c55517312485 100644 |
1533 |
+--- a/drivers/pinctrl/core.c |
1534 |
++++ b/drivers/pinctrl/core.c |
1535 |
+@@ -1189,19 +1189,16 @@ struct pinctrl_state *pinctrl_lookup_state(struct pinctrl *p, |
1536 |
+ EXPORT_SYMBOL_GPL(pinctrl_lookup_state); |
1537 |
+ |
1538 |
+ /** |
1539 |
+- * pinctrl_select_state() - select/activate/program a pinctrl state to HW |
1540 |
++ * pinctrl_commit_state() - select/activate/program a pinctrl state to HW |
1541 |
+ * @p: the pinctrl handle for the device that requests configuration |
1542 |
+ * @state: the state handle to select/activate/program |
1543 |
+ */ |
1544 |
+-int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state) |
1545 |
++static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state) |
1546 |
+ { |
1547 |
+ struct pinctrl_setting *setting, *setting2; |
1548 |
+ struct pinctrl_state *old_state = p->state; |
1549 |
+ int ret; |
1550 |
+ |
1551 |
+- if (p->state == state) |
1552 |
+- return 0; |
1553 |
+- |
1554 |
+ if (p->state) { |
1555 |
+ /* |
1556 |
+ * For each pinmux setting in the old state, forget SW's record |
1557 |
+@@ -1265,6 +1262,19 @@ int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state) |
1558 |
+ |
1559 |
+ return ret; |
1560 |
+ } |
1561 |
++ |
1562 |
++/** |
1563 |
++ * pinctrl_select_state() - select/activate/program a pinctrl state to HW |
1564 |
++ * @p: the pinctrl handle for the device that requests configuration |
1565 |
++ * @state: the state handle to select/activate/program |
1566 |
++ */ |
1567 |
++int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state) |
1568 |
++{ |
1569 |
++ if (p->state == state) |
1570 |
++ return 0; |
1571 |
++ |
1572 |
++ return pinctrl_commit_state(p, state); |
1573 |
++} |
1574 |
+ EXPORT_SYMBOL_GPL(pinctrl_select_state); |
1575 |
+ |
1576 |
+ static void devm_pinctrl_release(struct device *dev, void *res) |
1577 |
+@@ -1430,7 +1440,7 @@ void pinctrl_unregister_map(const struct pinctrl_map *map) |
1578 |
+ int pinctrl_force_sleep(struct pinctrl_dev *pctldev) |
1579 |
+ { |
1580 |
+ if (!IS_ERR(pctldev->p) && !IS_ERR(pctldev->hog_sleep)) |
1581 |
+- return pinctrl_select_state(pctldev->p, pctldev->hog_sleep); |
1582 |
++ return pinctrl_commit_state(pctldev->p, pctldev->hog_sleep); |
1583 |
+ return 0; |
1584 |
+ } |
1585 |
+ EXPORT_SYMBOL_GPL(pinctrl_force_sleep); |
1586 |
+@@ -1442,7 +1452,7 @@ EXPORT_SYMBOL_GPL(pinctrl_force_sleep); |
1587 |
+ int pinctrl_force_default(struct pinctrl_dev *pctldev) |
1588 |
+ { |
1589 |
+ if (!IS_ERR(pctldev->p) && !IS_ERR(pctldev->hog_default)) |
1590 |
+- return pinctrl_select_state(pctldev->p, pctldev->hog_default); |
1591 |
++ return pinctrl_commit_state(pctldev->p, pctldev->hog_default); |
1592 |
+ return 0; |
1593 |
+ } |
1594 |
+ EXPORT_SYMBOL_GPL(pinctrl_force_default); |
1595 |
+diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c |
1596 |
+index b5cb7858ffdc..a9bc1e01f982 100644 |
1597 |
+--- a/drivers/pinctrl/pinctrl-rockchip.c |
1598 |
++++ b/drivers/pinctrl/pinctrl-rockchip.c |
1599 |
+@@ -1989,8 +1989,16 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip, unsigned offset) |
1600 |
+ { |
1601 |
+ struct rockchip_pin_bank *bank = gpiochip_get_data(chip); |
1602 |
+ u32 data; |
1603 |
++ int ret; |
1604 |
+ |
1605 |
++ ret = clk_enable(bank->clk); |
1606 |
++ if (ret < 0) { |
1607 |
++ dev_err(bank->drvdata->dev, |
1608 |
++ "failed to enable clock for bank %s\n", bank->name); |
1609 |
++ return ret; |
1610 |
++ } |
1611 |
+ data = readl_relaxed(bank->reg_base + GPIO_SWPORT_DDR); |
1612 |
++ clk_disable(bank->clk); |
1613 |
+ |
1614 |
+ return !(data & BIT(offset)); |
1615 |
+ } |
1616 |
+diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c |
1617 |
+index 8dfa7fcb1248..e7bbdf947bbc 100644 |
1618 |
+--- a/drivers/platform/chrome/cros_ec_proto.c |
1619 |
++++ b/drivers/platform/chrome/cros_ec_proto.c |
1620 |
+@@ -60,12 +60,14 @@ static int send_command(struct cros_ec_device *ec_dev, |
1621 |
+ struct cros_ec_command *msg) |
1622 |
+ { |
1623 |
+ int ret; |
1624 |
++ int (*xfer_fxn)(struct cros_ec_device *ec, struct cros_ec_command *msg); |
1625 |
+ |
1626 |
+ if (ec_dev->proto_version > 2) |
1627 |
+- ret = ec_dev->pkt_xfer(ec_dev, msg); |
1628 |
++ xfer_fxn = ec_dev->pkt_xfer; |
1629 |
+ else |
1630 |
+- ret = ec_dev->cmd_xfer(ec_dev, msg); |
1631 |
++ xfer_fxn = ec_dev->cmd_xfer; |
1632 |
+ |
1633 |
++ ret = (*xfer_fxn)(ec_dev, msg); |
1634 |
+ if (msg->result == EC_RES_IN_PROGRESS) { |
1635 |
+ int i; |
1636 |
+ struct cros_ec_command *status_msg; |
1637 |
+@@ -88,7 +90,7 @@ static int send_command(struct cros_ec_device *ec_dev, |
1638 |
+ for (i = 0; i < EC_COMMAND_RETRIES; i++) { |
1639 |
+ usleep_range(10000, 11000); |
1640 |
+ |
1641 |
+- ret = ec_dev->cmd_xfer(ec_dev, status_msg); |
1642 |
++ ret = (*xfer_fxn)(ec_dev, status_msg); |
1643 |
+ if (ret < 0) |
1644 |
+ break; |
1645 |
+ |
1646 |
+diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chrome/cros_ec_sysfs.c |
1647 |
+index f3baf9973989..24f1630a8b3f 100644 |
1648 |
+--- a/drivers/platform/chrome/cros_ec_sysfs.c |
1649 |
++++ b/drivers/platform/chrome/cros_ec_sysfs.c |
1650 |
+@@ -187,7 +187,7 @@ static ssize_t show_ec_version(struct device *dev, |
1651 |
+ count += scnprintf(buf + count, PAGE_SIZE - count, |
1652 |
+ "Build info: EC error %d\n", msg->result); |
1653 |
+ else { |
1654 |
+- msg->data[sizeof(msg->data) - 1] = '\0'; |
1655 |
++ msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; |
1656 |
+ count += scnprintf(buf + count, PAGE_SIZE - count, |
1657 |
+ "Build info: %s\n", msg->data); |
1658 |
+ } |
1659 |
+diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c |
1660 |
+index 9e336184491c..0e358d4b6738 100644 |
1661 |
+--- a/drivers/rtc/rtc-ac100.c |
1662 |
++++ b/drivers/rtc/rtc-ac100.c |
1663 |
+@@ -567,6 +567,12 @@ static int ac100_rtc_probe(struct platform_device *pdev) |
1664 |
+ return chip->irq; |
1665 |
+ } |
1666 |
+ |
1667 |
++ chip->rtc = devm_rtc_allocate_device(&pdev->dev); |
1668 |
++ if (IS_ERR(chip->rtc)) |
1669 |
++ return PTR_ERR(chip->rtc); |
1670 |
++ |
1671 |
++ chip->rtc->ops = &ac100_rtc_ops; |
1672 |
++ |
1673 |
+ ret = devm_request_threaded_irq(&pdev->dev, chip->irq, NULL, |
1674 |
+ ac100_rtc_irq, |
1675 |
+ IRQF_SHARED | IRQF_ONESHOT, |
1676 |
+@@ -586,17 +592,16 @@ static int ac100_rtc_probe(struct platform_device *pdev) |
1677 |
+ /* clear counter alarm pending interrupts */ |
1678 |
+ regmap_write(chip->regmap, AC100_ALM_INT_STA, AC100_ALM_INT_ENABLE); |
1679 |
+ |
1680 |
+- chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-ac100", |
1681 |
+- &ac100_rtc_ops, THIS_MODULE); |
1682 |
+- if (IS_ERR(chip->rtc)) { |
1683 |
+- dev_err(&pdev->dev, "unable to register device\n"); |
1684 |
+- return PTR_ERR(chip->rtc); |
1685 |
+- } |
1686 |
+- |
1687 |
+ ret = ac100_rtc_register_clks(chip); |
1688 |
+ if (ret) |
1689 |
+ return ret; |
1690 |
+ |
1691 |
++ ret = rtc_register_device(chip->rtc); |
1692 |
++ if (ret) { |
1693 |
++ dev_err(&pdev->dev, "unable to register device\n"); |
1694 |
++ return ret; |
1695 |
++ } |
1696 |
++ |
1697 |
+ dev_info(&pdev->dev, "RTC enabled\n"); |
1698 |
+ |
1699 |
+ return 0; |
1700 |
+diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c |
1701 |
+index 33417681f5d4..126723a5bc6f 100644 |
1702 |
+--- a/drivers/scsi/lpfc/lpfc_ct.c |
1703 |
++++ b/drivers/scsi/lpfc/lpfc_ct.c |
1704 |
+@@ -471,6 +471,7 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) |
1705 |
+ "Parse GID_FTrsp: did:x%x flg:x%x x%x", |
1706 |
+ Did, ndlp->nlp_flag, vport->fc_flag); |
1707 |
+ |
1708 |
++ ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); |
1709 |
+ /* By default, the driver expects to support FCP FC4 */ |
1710 |
+ if (fc4_type == FC_TYPE_FCP) |
1711 |
+ ndlp->nlp_fc4_type |= NLP_FC4_FCP; |
1712 |
+diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c |
1713 |
+index 3ebf6ccba6e6..91783dbdf10c 100644 |
1714 |
+--- a/drivers/scsi/lpfc/lpfc_els.c |
1715 |
++++ b/drivers/scsi/lpfc/lpfc_els.c |
1716 |
+@@ -2088,6 +2088,10 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, |
1717 |
+ ndlp = (struct lpfc_nodelist *) cmdiocb->context1; |
1718 |
+ spin_lock_irq(shost->host_lock); |
1719 |
+ ndlp->nlp_flag &= ~NLP_PRLI_SND; |
1720 |
++ |
1721 |
++ /* Driver supports multiple FC4 types. Counters matter. */ |
1722 |
++ vport->fc_prli_sent--; |
1723 |
++ ndlp->fc4_prli_sent--; |
1724 |
+ spin_unlock_irq(shost->host_lock); |
1725 |
+ |
1726 |
+ lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, |
1727 |
+@@ -2095,9 +2099,6 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, |
1728 |
+ irsp->ulpStatus, irsp->un.ulpWord[4], |
1729 |
+ ndlp->nlp_DID); |
1730 |
+ |
1731 |
+- /* Ddriver supports multiple FC4 types. Counters matter. */ |
1732 |
+- vport->fc_prli_sent--; |
1733 |
+- |
1734 |
+ /* PRLI completes to NPort <nlp_DID> */ |
1735 |
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, |
1736 |
+ "0103 PRLI completes to NPort x%06x " |
1737 |
+@@ -2111,7 +2112,6 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, |
1738 |
+ |
1739 |
+ if (irsp->ulpStatus) { |
1740 |
+ /* Check for retry */ |
1741 |
+- ndlp->fc4_prli_sent--; |
1742 |
+ if (lpfc_els_retry(phba, cmdiocb, rspiocb)) { |
1743 |
+ /* ELS command is being retried */ |
1744 |
+ goto out; |
1745 |
+@@ -2190,6 +2190,15 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1746 |
+ ndlp->nlp_fc4_type |= NLP_FC4_NVME; |
1747 |
+ local_nlp_type = ndlp->nlp_fc4_type; |
1748 |
+ |
1749 |
++ /* This routine will issue 1 or 2 PRLIs, so zero all the ndlp |
1750 |
++ * fields here before any of them can complete. |
1751 |
++ */ |
1752 |
++ ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); |
1753 |
++ ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); |
1754 |
++ ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; |
1755 |
++ ndlp->nlp_flag &= ~NLP_FIRSTBURST; |
1756 |
++ ndlp->nvme_fb_size = 0; |
1757 |
++ |
1758 |
+ send_next_prli: |
1759 |
+ if (local_nlp_type & NLP_FC4_FCP) { |
1760 |
+ /* Payload is 4 + 16 = 20 x14 bytes. */ |
1761 |
+@@ -2298,6 +2307,13 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1762 |
+ elsiocb->iocb_cmpl = lpfc_cmpl_els_prli; |
1763 |
+ spin_lock_irq(shost->host_lock); |
1764 |
+ ndlp->nlp_flag |= NLP_PRLI_SND; |
1765 |
++ |
1766 |
++ /* The vport counters are used for lpfc_scan_finished, but |
1767 |
++ * the ndlp is used to track outstanding PRLIs for different |
1768 |
++ * FC4 types. |
1769 |
++ */ |
1770 |
++ vport->fc_prli_sent++; |
1771 |
++ ndlp->fc4_prli_sent++; |
1772 |
+ spin_unlock_irq(shost->host_lock); |
1773 |
+ if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) == |
1774 |
+ IOCB_ERROR) { |
1775 |
+@@ -2308,12 +2324,6 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1776 |
+ return 1; |
1777 |
+ } |
1778 |
+ |
1779 |
+- /* The vport counters are used for lpfc_scan_finished, but |
1780 |
+- * the ndlp is used to track outstanding PRLIs for different |
1781 |
+- * FC4 types. |
1782 |
+- */ |
1783 |
+- vport->fc_prli_sent++; |
1784 |
+- ndlp->fc4_prli_sent++; |
1785 |
+ |
1786 |
+ /* The driver supports 2 FC4 types. Make sure |
1787 |
+ * a PRLI is issued for all types before exiting. |
1788 |
+diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c |
1789 |
+index b6957d944b9a..d489f6827cc1 100644 |
1790 |
+--- a/drivers/scsi/lpfc/lpfc_nportdisc.c |
1791 |
++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c |
1792 |
+@@ -390,6 +390,11 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1793 |
+ break; |
1794 |
+ } |
1795 |
+ |
1796 |
++ ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); |
1797 |
++ ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); |
1798 |
++ ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; |
1799 |
++ ndlp->nlp_flag &= ~NLP_FIRSTBURST; |
1800 |
++ |
1801 |
+ /* Check for Nport to NPort pt2pt protocol */ |
1802 |
+ if ((vport->fc_flag & FC_PT2PT) && |
1803 |
+ !(vport->fc_flag & FC_PT2PT_PLOGI)) { |
1804 |
+@@ -742,9 +747,6 @@ lpfc_rcv_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1805 |
+ lp = (uint32_t *) pcmd->virt; |
1806 |
+ npr = (PRLI *) ((uint8_t *) lp + sizeof (uint32_t)); |
1807 |
+ |
1808 |
+- ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); |
1809 |
+- ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; |
1810 |
+- ndlp->nlp_flag &= ~NLP_FIRSTBURST; |
1811 |
+ if ((npr->prliType == PRLI_FCP_TYPE) || |
1812 |
+ (npr->prliType == PRLI_NVME_TYPE)) { |
1813 |
+ if (npr->initiatorFunc) { |
1814 |
+@@ -769,8 +771,12 @@ lpfc_rcv_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1815 |
+ * type. Target mode does not issue gft_id so doesn't get |
1816 |
+ * the fc4 type set until now. |
1817 |
+ */ |
1818 |
+- if ((phba->nvmet_support) && (npr->prliType == PRLI_NVME_TYPE)) |
1819 |
++ if (phba->nvmet_support && (npr->prliType == PRLI_NVME_TYPE)) { |
1820 |
+ ndlp->nlp_fc4_type |= NLP_FC4_NVME; |
1821 |
++ lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
1822 |
++ } |
1823 |
++ if (npr->prliType == PRLI_FCP_TYPE) |
1824 |
++ ndlp->nlp_fc4_type |= NLP_FC4_FCP; |
1825 |
+ } |
1826 |
+ if (rport) { |
1827 |
+ /* We need to update the rport role values */ |
1828 |
+@@ -1552,7 +1558,6 @@ lpfc_rcv_prli_reglogin_issue(struct lpfc_vport *vport, |
1829 |
+ if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { |
1830 |
+ lpfc_rcv_prli(vport, ndlp, cmdiocb); |
1831 |
+ lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); |
1832 |
+- lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
1833 |
+ } else { |
1834 |
+ /* RPI registration has not completed. Reject the PRLI |
1835 |
+ * to prevent an illegal state transition when the |
1836 |
+@@ -1564,10 +1569,11 @@ lpfc_rcv_prli_reglogin_issue(struct lpfc_vport *vport, |
1837 |
+ ndlp->nlp_rpi, ndlp->nlp_state, |
1838 |
+ ndlp->nlp_flag); |
1839 |
+ memset(&stat, 0, sizeof(struct ls_rjt)); |
1840 |
+- stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; |
1841 |
+- stat.un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS; |
1842 |
++ stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY; |
1843 |
++ stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; |
1844 |
+ lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, |
1845 |
+ ndlp, NULL); |
1846 |
++ return ndlp->nlp_state; |
1847 |
+ } |
1848 |
+ } else { |
1849 |
+ /* Initiator mode. */ |
1850 |
+@@ -1922,13 +1928,6 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1851 |
+ return ndlp->nlp_state; |
1852 |
+ } |
1853 |
+ |
1854 |
+- /* Check out PRLI rsp */ |
1855 |
+- ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); |
1856 |
+- ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; |
1857 |
+- |
1858 |
+- /* NVME or FCP first burst must be negotiated for each PRLI. */ |
1859 |
+- ndlp->nlp_flag &= ~NLP_FIRSTBURST; |
1860 |
+- ndlp->nvme_fb_size = 0; |
1861 |
+ if (npr && (npr->acceptRspCode == PRLI_REQ_EXECUTED) && |
1862 |
+ (npr->prliType == PRLI_FCP_TYPE)) { |
1863 |
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, |
1864 |
+@@ -1945,8 +1944,6 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1865 |
+ if (npr->Retry) |
1866 |
+ ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; |
1867 |
+ |
1868 |
+- /* PRLI completed. Decrement count. */ |
1869 |
+- ndlp->fc4_prli_sent--; |
1870 |
+ } else if (nvpr && |
1871 |
+ (bf_get_be32(prli_acc_rsp_code, nvpr) == |
1872 |
+ PRLI_REQ_EXECUTED) && |
1873 |
+@@ -1991,8 +1988,6 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1874 |
+ be32_to_cpu(nvpr->word5), |
1875 |
+ ndlp->nlp_flag, ndlp->nlp_fcp_info, |
1876 |
+ ndlp->nlp_type); |
1877 |
+- /* PRLI completed. Decrement count. */ |
1878 |
+- ndlp->fc4_prli_sent--; |
1879 |
+ } |
1880 |
+ if (!(ndlp->nlp_type & NLP_FCP_TARGET) && |
1881 |
+ (vport->port_type == LPFC_NPIV_PORT) && |
1882 |
+@@ -2016,7 +2011,8 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
1883 |
+ ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; |
1884 |
+ if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) |
1885 |
+ lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); |
1886 |
+- else |
1887 |
++ else if (ndlp->nlp_type & |
1888 |
++ (NLP_FCP_INITIATOR | NLP_NVME_INITIATOR)) |
1889 |
+ lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
1890 |
+ } else |
1891 |
+ lpfc_printf_vlog(vport, |
1892 |
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1893 |
+index 11bd2e698b84..4bf406df051b 100644 |
1894 |
+--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1895 |
++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1896 |
+@@ -190,36 +190,30 @@ inline void megasas_return_cmd_fusion(struct megasas_instance *instance, |
1897 |
+ /** |
1898 |
+ * megasas_fire_cmd_fusion - Sends command to the FW |
1899 |
+ * @instance: Adapter soft state |
1900 |
+- * @req_desc: 32bit or 64bit Request descriptor |
1901 |
++ * @req_desc: 64bit Request descriptor |
1902 |
+ * |
1903 |
+- * Perform PCI Write. Ventura supports 32 bit Descriptor. |
1904 |
+- * Prior to Ventura (12G) MR controller supports 64 bit Descriptor. |
1905 |
++ * Perform PCI Write. |
1906 |
+ */ |
1907 |
+ |
1908 |
+ static void |
1909 |
+ megasas_fire_cmd_fusion(struct megasas_instance *instance, |
1910 |
+ union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc) |
1911 |
+ { |
1912 |
+- if (instance->is_ventura) |
1913 |
+- writel(le32_to_cpu(req_desc->u.low), |
1914 |
+- &instance->reg_set->inbound_single_queue_port); |
1915 |
+- else { |
1916 |
+ #if defined(writeq) && defined(CONFIG_64BIT) |
1917 |
+- u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) | |
1918 |
+- le32_to_cpu(req_desc->u.low)); |
1919 |
++ u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) | |
1920 |
++ le32_to_cpu(req_desc->u.low)); |
1921 |
+ |
1922 |
+- writeq(req_data, &instance->reg_set->inbound_low_queue_port); |
1923 |
++ writeq(req_data, &instance->reg_set->inbound_low_queue_port); |
1924 |
+ #else |
1925 |
+- unsigned long flags; |
1926 |
+- spin_lock_irqsave(&instance->hba_lock, flags); |
1927 |
+- writel(le32_to_cpu(req_desc->u.low), |
1928 |
+- &instance->reg_set->inbound_low_queue_port); |
1929 |
+- writel(le32_to_cpu(req_desc->u.high), |
1930 |
+- &instance->reg_set->inbound_high_queue_port); |
1931 |
+- mmiowb(); |
1932 |
+- spin_unlock_irqrestore(&instance->hba_lock, flags); |
1933 |
++ unsigned long flags; |
1934 |
++ spin_lock_irqsave(&instance->hba_lock, flags); |
1935 |
++ writel(le32_to_cpu(req_desc->u.low), |
1936 |
++ &instance->reg_set->inbound_low_queue_port); |
1937 |
++ writel(le32_to_cpu(req_desc->u.high), |
1938 |
++ &instance->reg_set->inbound_high_queue_port); |
1939 |
++ mmiowb(); |
1940 |
++ spin_unlock_irqrestore(&instance->hba_lock, flags); |
1941 |
+ #endif |
1942 |
+- } |
1943 |
+ } |
1944 |
+ |
1945 |
+ /** |
1946 |
+@@ -772,7 +766,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) |
1947 |
+ const char *sys_info; |
1948 |
+ MFI_CAPABILITIES *drv_ops; |
1949 |
+ u32 scratch_pad_2; |
1950 |
+- unsigned long flags; |
1951 |
+ |
1952 |
+ fusion = instance->ctrl_context; |
1953 |
+ |
1954 |
+@@ -900,14 +893,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) |
1955 |
+ break; |
1956 |
+ } |
1957 |
+ |
1958 |
+- /* For Ventura also IOC INIT required 64 bit Descriptor write. */ |
1959 |
+- spin_lock_irqsave(&instance->hba_lock, flags); |
1960 |
+- writel(le32_to_cpu(req_desc.u.low), |
1961 |
+- &instance->reg_set->inbound_low_queue_port); |
1962 |
+- writel(le32_to_cpu(req_desc.u.high), |
1963 |
+- &instance->reg_set->inbound_high_queue_port); |
1964 |
+- mmiowb(); |
1965 |
+- spin_unlock_irqrestore(&instance->hba_lock, flags); |
1966 |
++ megasas_fire_cmd_fusion(instance, &req_desc); |
1967 |
+ |
1968 |
+ wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS); |
1969 |
+ |
1970 |
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c |
1971 |
+index 87999905bca3..6efa739a1912 100644 |
1972 |
+--- a/drivers/scsi/mpt3sas/mpt3sas_base.c |
1973 |
++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c |
1974 |
+@@ -5659,14 +5659,14 @@ _base_reset_handler(struct MPT3SAS_ADAPTER *ioc, int reset_phase) |
1975 |
+ } |
1976 |
+ |
1977 |
+ /** |
1978 |
+- * _wait_for_commands_to_complete - reset controller |
1979 |
++ * mpt3sas_wait_for_commands_to_complete - reset controller |
1980 |
+ * @ioc: Pointer to MPT_ADAPTER structure |
1981 |
+ * |
1982 |
+ * This function waiting(3s) for all pending commands to complete |
1983 |
+ * prior to putting controller in reset. |
1984 |
+ */ |
1985 |
+-static void |
1986 |
+-_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc) |
1987 |
++void |
1988 |
++mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc) |
1989 |
+ { |
1990 |
+ u32 ioc_state; |
1991 |
+ unsigned long flags; |
1992 |
+@@ -5745,7 +5745,7 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, |
1993 |
+ is_fault = 1; |
1994 |
+ } |
1995 |
+ _base_reset_handler(ioc, MPT3_IOC_PRE_RESET); |
1996 |
+- _wait_for_commands_to_complete(ioc); |
1997 |
++ mpt3sas_wait_for_commands_to_complete(ioc); |
1998 |
+ _base_mask_interrupts(ioc); |
1999 |
+ r = _base_make_ioc_ready(ioc, type); |
2000 |
+ if (r) |
2001 |
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h |
2002 |
+index a77bb7dc12b1..2948cb7e9ae6 100644 |
2003 |
+--- a/drivers/scsi/mpt3sas/mpt3sas_base.h |
2004 |
++++ b/drivers/scsi/mpt3sas/mpt3sas_base.h |
2005 |
+@@ -1292,6 +1292,9 @@ void mpt3sas_base_update_missing_delay(struct MPT3SAS_ADAPTER *ioc, |
2006 |
+ |
2007 |
+ int mpt3sas_port_enable(struct MPT3SAS_ADAPTER *ioc); |
2008 |
+ |
2009 |
++void |
2010 |
++mpt3sas_wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc); |
2011 |
++ |
2012 |
+ |
2013 |
+ /* scsih shared API */ |
2014 |
+ u8 mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, |
2015 |
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
2016 |
+index 33ff691878e2..beb4bf8fe9b0 100644 |
2017 |
+--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
2018 |
++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
2019 |
+@@ -2471,7 +2471,8 @@ scsih_abort(struct scsi_cmnd *scmd) |
2020 |
+ _scsih_tm_display_info(ioc, scmd); |
2021 |
+ |
2022 |
+ sas_device_priv_data = scmd->device->hostdata; |
2023 |
+- if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { |
2024 |
++ if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
2025 |
++ ioc->remove_host) { |
2026 |
+ sdev_printk(KERN_INFO, scmd->device, |
2027 |
+ "device been deleted! scmd(%p)\n", scmd); |
2028 |
+ scmd->result = DID_NO_CONNECT << 16; |
2029 |
+@@ -2533,7 +2534,8 @@ scsih_dev_reset(struct scsi_cmnd *scmd) |
2030 |
+ _scsih_tm_display_info(ioc, scmd); |
2031 |
+ |
2032 |
+ sas_device_priv_data = scmd->device->hostdata; |
2033 |
+- if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { |
2034 |
++ if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
2035 |
++ ioc->remove_host) { |
2036 |
+ sdev_printk(KERN_INFO, scmd->device, |
2037 |
+ "device been deleted! scmd(%p)\n", scmd); |
2038 |
+ scmd->result = DID_NO_CONNECT << 16; |
2039 |
+@@ -2595,7 +2597,8 @@ scsih_target_reset(struct scsi_cmnd *scmd) |
2040 |
+ _scsih_tm_display_info(ioc, scmd); |
2041 |
+ |
2042 |
+ sas_device_priv_data = scmd->device->hostdata; |
2043 |
+- if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { |
2044 |
++ if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
2045 |
++ ioc->remove_host) { |
2046 |
+ starget_printk(KERN_INFO, starget, "target been deleted! scmd(%p)\n", |
2047 |
+ scmd); |
2048 |
+ scmd->result = DID_NO_CONNECT << 16; |
2049 |
+@@ -2652,7 +2655,7 @@ scsih_host_reset(struct scsi_cmnd *scmd) |
2050 |
+ ioc->name, scmd); |
2051 |
+ scsi_print_command(scmd); |
2052 |
+ |
2053 |
+- if (ioc->is_driver_loading) { |
2054 |
++ if (ioc->is_driver_loading || ioc->remove_host) { |
2055 |
+ pr_info(MPT3SAS_FMT "Blocking the host reset\n", |
2056 |
+ ioc->name); |
2057 |
+ r = FAILED; |
2058 |
+@@ -3957,7 +3960,7 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc) |
2059 |
+ _scsih_set_satl_pending(scmd, false); |
2060 |
+ mpt3sas_base_free_smid(ioc, smid); |
2061 |
+ scsi_dma_unmap(scmd); |
2062 |
+- if (ioc->pci_error_recovery) |
2063 |
++ if (ioc->pci_error_recovery || ioc->remove_host) |
2064 |
+ scmd->result = DID_NO_CONNECT << 16; |
2065 |
+ else |
2066 |
+ scmd->result = DID_RESET << 16; |
2067 |
+@@ -8240,6 +8243,10 @@ static void scsih_remove(struct pci_dev *pdev) |
2068 |
+ unsigned long flags; |
2069 |
+ |
2070 |
+ ioc->remove_host = 1; |
2071 |
++ |
2072 |
++ mpt3sas_wait_for_commands_to_complete(ioc); |
2073 |
++ _scsih_flush_running_cmds(ioc); |
2074 |
++ |
2075 |
+ _scsih_fw_event_cleanup_queue(ioc); |
2076 |
+ |
2077 |
+ spin_lock_irqsave(&ioc->fw_event_lock, flags); |
2078 |
+@@ -8310,6 +8317,10 @@ scsih_shutdown(struct pci_dev *pdev) |
2079 |
+ unsigned long flags; |
2080 |
+ |
2081 |
+ ioc->remove_host = 1; |
2082 |
++ |
2083 |
++ mpt3sas_wait_for_commands_to_complete(ioc); |
2084 |
++ _scsih_flush_running_cmds(ioc); |
2085 |
++ |
2086 |
+ _scsih_fw_event_cleanup_queue(ioc); |
2087 |
+ |
2088 |
+ spin_lock_irqsave(&ioc->fw_event_lock, flags); |
2089 |
+diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c |
2090 |
+index 403bea9d546b..50214b620865 100644 |
2091 |
+--- a/drivers/soc/qcom/smsm.c |
2092 |
++++ b/drivers/soc/qcom/smsm.c |
2093 |
+@@ -496,8 +496,10 @@ static int qcom_smsm_probe(struct platform_device *pdev) |
2094 |
+ if (!smsm->hosts) |
2095 |
+ return -ENOMEM; |
2096 |
+ |
2097 |
+- local_node = of_find_node_with_property(of_node_get(pdev->dev.of_node), |
2098 |
+- "#qcom,smem-state-cells"); |
2099 |
++ for_each_child_of_node(pdev->dev.of_node, local_node) { |
2100 |
++ if (of_find_property(local_node, "#qcom,smem-state-cells", NULL)) |
2101 |
++ break; |
2102 |
++ } |
2103 |
+ if (!local_node) { |
2104 |
+ dev_err(&pdev->dev, "no state entry\n"); |
2105 |
+ return -EINVAL; |
2106 |
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c |
2107 |
+index 837bb95eea62..092a5fc85b9a 100644 |
2108 |
+--- a/drivers/spi/spi-sh-msiof.c |
2109 |
++++ b/drivers/spi/spi-sh-msiof.c |
2110 |
+@@ -55,6 +55,8 @@ struct sh_msiof_spi_priv { |
2111 |
+ void *rx_dma_page; |
2112 |
+ dma_addr_t tx_dma_addr; |
2113 |
+ dma_addr_t rx_dma_addr; |
2114 |
++ bool native_cs_inited; |
2115 |
++ bool native_cs_high; |
2116 |
+ bool slave_aborted; |
2117 |
+ }; |
2118 |
+ |
2119 |
+@@ -528,8 +530,7 @@ static int sh_msiof_spi_setup(struct spi_device *spi) |
2120 |
+ { |
2121 |
+ struct device_node *np = spi->master->dev.of_node; |
2122 |
+ struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master); |
2123 |
+- |
2124 |
+- pm_runtime_get_sync(&p->pdev->dev); |
2125 |
++ u32 clr, set, tmp; |
2126 |
+ |
2127 |
+ if (!np) { |
2128 |
+ /* |
2129 |
+@@ -539,19 +540,31 @@ static int sh_msiof_spi_setup(struct spi_device *spi) |
2130 |
+ spi->cs_gpio = (uintptr_t)spi->controller_data; |
2131 |
+ } |
2132 |
+ |
2133 |
+- /* Configure pins before deasserting CS */ |
2134 |
+- sh_msiof_spi_set_pin_regs(p, !!(spi->mode & SPI_CPOL), |
2135 |
+- !!(spi->mode & SPI_CPHA), |
2136 |
+- !!(spi->mode & SPI_3WIRE), |
2137 |
+- !!(spi->mode & SPI_LSB_FIRST), |
2138 |
+- !!(spi->mode & SPI_CS_HIGH)); |
2139 |
+- |
2140 |
+- if (spi->cs_gpio >= 0) |
2141 |
++ if (spi->cs_gpio >= 0) { |
2142 |
+ gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); |
2143 |
++ return 0; |
2144 |
++ } |
2145 |
+ |
2146 |
++ if (spi_controller_is_slave(p->master)) |
2147 |
++ return 0; |
2148 |
+ |
2149 |
+- pm_runtime_put(&p->pdev->dev); |
2150 |
++ if (p->native_cs_inited && |
2151 |
++ (p->native_cs_high == !!(spi->mode & SPI_CS_HIGH))) |
2152 |
++ return 0; |
2153 |
+ |
2154 |
++ /* Configure native chip select mode/polarity early */ |
2155 |
++ clr = MDR1_SYNCMD_MASK; |
2156 |
++ set = MDR1_TRMD | TMDR1_PCON | MDR1_SYNCMD_SPI; |
2157 |
++ if (spi->mode & SPI_CS_HIGH) |
2158 |
++ clr |= BIT(MDR1_SYNCAC_SHIFT); |
2159 |
++ else |
2160 |
++ set |= BIT(MDR1_SYNCAC_SHIFT); |
2161 |
++ pm_runtime_get_sync(&p->pdev->dev); |
2162 |
++ tmp = sh_msiof_read(p, TMDR1) & ~clr; |
2163 |
++ sh_msiof_write(p, TMDR1, tmp | set); |
2164 |
++ pm_runtime_put(&p->pdev->dev); |
2165 |
++ p->native_cs_high = spi->mode & SPI_CS_HIGH; |
2166 |
++ p->native_cs_inited = true; |
2167 |
+ return 0; |
2168 |
+ } |
2169 |
+ |
2170 |
+diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c |
2171 |
+index d9941b0c468d..893b2836089c 100644 |
2172 |
+--- a/drivers/staging/android/ashmem.c |
2173 |
++++ b/drivers/staging/android/ashmem.c |
2174 |
+@@ -709,16 +709,14 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, |
2175 |
+ size_t pgstart, pgend; |
2176 |
+ int ret = -EINVAL; |
2177 |
+ |
2178 |
++ if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) |
2179 |
++ return -EFAULT; |
2180 |
++ |
2181 |
+ mutex_lock(&ashmem_mutex); |
2182 |
+ |
2183 |
+ if (unlikely(!asma->file)) |
2184 |
+ goto out_unlock; |
2185 |
+ |
2186 |
+- if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) { |
2187 |
+- ret = -EFAULT; |
2188 |
+- goto out_unlock; |
2189 |
+- } |
2190 |
+- |
2191 |
+ /* per custom, you can pass zero for len to mean "everything onward" */ |
2192 |
+ if (!pin.len) |
2193 |
+ pin.len = PAGE_ALIGN(asma->size) - pin.offset; |
2194 |
+diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig |
2195 |
+index cc2b4d9433ed..b811442c5ce6 100644 |
2196 |
+--- a/drivers/tty/Kconfig |
2197 |
++++ b/drivers/tty/Kconfig |
2198 |
+@@ -394,10 +394,14 @@ config GOLDFISH_TTY |
2199 |
+ depends on GOLDFISH |
2200 |
+ select SERIAL_CORE |
2201 |
+ select SERIAL_CORE_CONSOLE |
2202 |
+- select SERIAL_EARLYCON |
2203 |
+ help |
2204 |
+ Console and system TTY driver for the Goldfish virtual platform. |
2205 |
+ |
2206 |
++config GOLDFISH_TTY_EARLY_CONSOLE |
2207 |
++ bool |
2208 |
++ default y if GOLDFISH_TTY=y |
2209 |
++ select SERIAL_EARLYCON |
2210 |
++ |
2211 |
+ config DA_TTY |
2212 |
+ bool "DA TTY" |
2213 |
+ depends on METAG_DA |
2214 |
+diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c |
2215 |
+index 381e981dee06..85a500ddbcaa 100644 |
2216 |
+--- a/drivers/tty/goldfish.c |
2217 |
++++ b/drivers/tty/goldfish.c |
2218 |
+@@ -442,6 +442,7 @@ static int goldfish_tty_remove(struct platform_device *pdev) |
2219 |
+ return 0; |
2220 |
+ } |
2221 |
+ |
2222 |
++#ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE |
2223 |
+ static void gf_early_console_putchar(struct uart_port *port, int ch) |
2224 |
+ { |
2225 |
+ __raw_writel(ch, port->membase); |
2226 |
+@@ -465,6 +466,7 @@ static int __init gf_earlycon_setup(struct earlycon_device *device, |
2227 |
+ } |
2228 |
+ |
2229 |
+ OF_EARLYCON_DECLARE(early_gf_tty, "google,goldfish-tty", gf_earlycon_setup); |
2230 |
++#endif |
2231 |
+ |
2232 |
+ static const struct of_device_id goldfish_tty_of_match[] = { |
2233 |
+ { .compatible = "google,goldfish-tty", }, |
2234 |
+diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c |
2235 |
+index 7e638997bfc2..3015789265dd 100644 |
2236 |
+--- a/drivers/tty/serial/8250/8250_dw.c |
2237 |
++++ b/drivers/tty/serial/8250/8250_dw.c |
2238 |
+@@ -513,7 +513,8 @@ static int dw8250_probe(struct platform_device *pdev) |
2239 |
+ /* If no clock rate is defined, fail. */ |
2240 |
+ if (!p->uartclk) { |
2241 |
+ dev_err(dev, "clock rate not defined\n"); |
2242 |
+- return -EINVAL; |
2243 |
++ err = -EINVAL; |
2244 |
++ goto err_clk; |
2245 |
+ } |
2246 |
+ |
2247 |
+ data->pclk = devm_clk_get(dev, "apb_pclk"); |
2248 |
+diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c |
2249 |
+index 908110b5cf10..0d814a87acb2 100644 |
2250 |
+--- a/drivers/tty/serial/8250/8250_pci.c |
2251 |
++++ b/drivers/tty/serial/8250/8250_pci.c |
2252 |
+@@ -3389,11 +3389,9 @@ static int serial_pci_is_class_communication(struct pci_dev *dev) |
2253 |
+ /* |
2254 |
+ * If it is not a communications device or the programming |
2255 |
+ * interface is greater than 6, give up. |
2256 |
+- * |
2257 |
+- * (Should we try to make guesses for multiport serial devices |
2258 |
+- * later?) |
2259 |
+ */ |
2260 |
+ if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) && |
2261 |
++ ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MULTISERIAL) && |
2262 |
+ ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) || |
2263 |
+ (dev->class & 0xff) > 6) |
2264 |
+ return -ENODEV; |
2265 |
+@@ -3430,6 +3428,12 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) |
2266 |
+ { |
2267 |
+ int num_iomem, num_port, first_port = -1, i; |
2268 |
+ |
2269 |
++ /* |
2270 |
++ * Should we try to make guesses for multiport serial devices later? |
2271 |
++ */ |
2272 |
++ if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_MULTISERIAL) |
2273 |
++ return -ENODEV; |
2274 |
++ |
2275 |
+ num_iomem = num_port = 0; |
2276 |
+ for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { |
2277 |
+ if (pci_resource_flags(dev, i) & IORESOURCE_IO) { |
2278 |
+diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c |
2279 |
+index 7892d0be8af9..7e77bd2118ad 100644 |
2280 |
+--- a/drivers/tty/tty_io.c |
2281 |
++++ b/drivers/tty/tty_io.c |
2282 |
+@@ -1481,6 +1481,8 @@ static void release_tty(struct tty_struct *tty, int idx) |
2283 |
+ if (tty->link) |
2284 |
+ tty->link->port->itty = NULL; |
2285 |
+ tty_buffer_cancel_work(tty->port); |
2286 |
++ if (tty->link) |
2287 |
++ tty_buffer_cancel_work(tty->link->port); |
2288 |
+ |
2289 |
+ tty_kref_put(tty->link); |
2290 |
+ tty_kref_put(tty); |
2291 |
+diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c |
2292 |
+index 445b1dc5d441..a17ba1465815 100644 |
2293 |
+--- a/drivers/video/console/vgacon.c |
2294 |
++++ b/drivers/video/console/vgacon.c |
2295 |
+@@ -422,7 +422,10 @@ static const char *vgacon_startup(void) |
2296 |
+ vga_video_port_val = VGA_CRT_DM; |
2297 |
+ if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) { |
2298 |
+ static struct resource ega_console_resource = |
2299 |
+- { .name = "ega", .start = 0x3B0, .end = 0x3BF }; |
2300 |
++ { .name = "ega", |
2301 |
++ .flags = IORESOURCE_IO, |
2302 |
++ .start = 0x3B0, |
2303 |
++ .end = 0x3BF }; |
2304 |
+ vga_video_type = VIDEO_TYPE_EGAM; |
2305 |
+ vga_vram_size = 0x8000; |
2306 |
+ display_desc = "EGA+"; |
2307 |
+@@ -430,9 +433,15 @@ static const char *vgacon_startup(void) |
2308 |
+ &ega_console_resource); |
2309 |
+ } else { |
2310 |
+ static struct resource mda1_console_resource = |
2311 |
+- { .name = "mda", .start = 0x3B0, .end = 0x3BB }; |
2312 |
++ { .name = "mda", |
2313 |
++ .flags = IORESOURCE_IO, |
2314 |
++ .start = 0x3B0, |
2315 |
++ .end = 0x3BB }; |
2316 |
+ static struct resource mda2_console_resource = |
2317 |
+- { .name = "mda", .start = 0x3BF, .end = 0x3BF }; |
2318 |
++ { .name = "mda", |
2319 |
++ .flags = IORESOURCE_IO, |
2320 |
++ .start = 0x3BF, |
2321 |
++ .end = 0x3BF }; |
2322 |
+ vga_video_type = VIDEO_TYPE_MDA; |
2323 |
+ vga_vram_size = 0x2000; |
2324 |
+ display_desc = "*MDA"; |
2325 |
+@@ -454,15 +463,21 @@ static const char *vgacon_startup(void) |
2326 |
+ vga_vram_size = 0x8000; |
2327 |
+ |
2328 |
+ if (!screen_info.orig_video_isVGA) { |
2329 |
+- static struct resource ega_console_resource |
2330 |
+- = { .name = "ega", .start = 0x3C0, .end = 0x3DF }; |
2331 |
++ static struct resource ega_console_resource = |
2332 |
++ { .name = "ega", |
2333 |
++ .flags = IORESOURCE_IO, |
2334 |
++ .start = 0x3C0, |
2335 |
++ .end = 0x3DF }; |
2336 |
+ vga_video_type = VIDEO_TYPE_EGAC; |
2337 |
+ display_desc = "EGA"; |
2338 |
+ request_resource(&ioport_resource, |
2339 |
+ &ega_console_resource); |
2340 |
+ } else { |
2341 |
+- static struct resource vga_console_resource |
2342 |
+- = { .name = "vga+", .start = 0x3C0, .end = 0x3DF }; |
2343 |
++ static struct resource vga_console_resource = |
2344 |
++ { .name = "vga+", |
2345 |
++ .flags = IORESOURCE_IO, |
2346 |
++ .start = 0x3C0, |
2347 |
++ .end = 0x3DF }; |
2348 |
+ vga_video_type = VIDEO_TYPE_VGAC; |
2349 |
+ display_desc = "VGA+"; |
2350 |
+ request_resource(&ioport_resource, |
2351 |
+@@ -494,7 +509,10 @@ static const char *vgacon_startup(void) |
2352 |
+ } |
2353 |
+ } else { |
2354 |
+ static struct resource cga_console_resource = |
2355 |
+- { .name = "cga", .start = 0x3D4, .end = 0x3D5 }; |
2356 |
++ { .name = "cga", |
2357 |
++ .flags = IORESOURCE_IO, |
2358 |
++ .start = 0x3D4, |
2359 |
++ .end = 0x3D5 }; |
2360 |
+ vga_video_type = VIDEO_TYPE_CGA; |
2361 |
+ vga_vram_size = 0x2000; |
2362 |
+ display_desc = "*CGA"; |
2363 |
+diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c |
2364 |
+index 57e9e146ff74..4aeb908f2d1e 100644 |
2365 |
+--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c |
2366 |
++++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c |
2367 |
+@@ -455,6 +455,8 @@ static int td028ttec1_panel_remove(struct spi_device *spi) |
2368 |
+ } |
2369 |
+ |
2370 |
+ static const struct of_device_id td028ttec1_of_match[] = { |
2371 |
++ { .compatible = "omapdss,tpo,td028ttec1", }, |
2372 |
++ /* keep to not break older DTB */ |
2373 |
+ { .compatible = "omapdss,toppoly,td028ttec1", }, |
2374 |
+ {}, |
2375 |
+ }; |
2376 |
+@@ -474,6 +476,7 @@ static struct spi_driver td028ttec1_spi_driver = { |
2377 |
+ |
2378 |
+ module_spi_driver(td028ttec1_spi_driver); |
2379 |
+ |
2380 |
++MODULE_ALIAS("spi:tpo,td028ttec1"); |
2381 |
+ MODULE_ALIAS("spi:toppoly,td028ttec1"); |
2382 |
+ MODULE_AUTHOR("H. Nikolaus Schaller <hns@×××××××××.com>"); |
2383 |
+ MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); |
2384 |
+diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c |
2385 |
+index 0826e663bd5a..b30fb637ae94 100644 |
2386 |
+--- a/drivers/watchdog/watchdog_dev.c |
2387 |
++++ b/drivers/watchdog/watchdog_dev.c |
2388 |
+@@ -768,6 +768,7 @@ static int watchdog_open(struct inode *inode, struct file *file) |
2389 |
+ { |
2390 |
+ struct watchdog_core_data *wd_data; |
2391 |
+ struct watchdog_device *wdd; |
2392 |
++ bool hw_running; |
2393 |
+ int err; |
2394 |
+ |
2395 |
+ /* Get the corresponding watchdog device */ |
2396 |
+@@ -787,7 +788,8 @@ static int watchdog_open(struct inode *inode, struct file *file) |
2397 |
+ * If the /dev/watchdog device is open, we don't want the module |
2398 |
+ * to be unloaded. |
2399 |
+ */ |
2400 |
+- if (!watchdog_hw_running(wdd) && !try_module_get(wdd->ops->owner)) { |
2401 |
++ hw_running = watchdog_hw_running(wdd); |
2402 |
++ if (!hw_running && !try_module_get(wdd->ops->owner)) { |
2403 |
+ err = -EBUSY; |
2404 |
+ goto out_clear; |
2405 |
+ } |
2406 |
+@@ -798,7 +800,7 @@ static int watchdog_open(struct inode *inode, struct file *file) |
2407 |
+ |
2408 |
+ file->private_data = wd_data; |
2409 |
+ |
2410 |
+- if (!watchdog_hw_running(wdd)) |
2411 |
++ if (!hw_running) |
2412 |
+ kref_get(&wd_data->kref); |
2413 |
+ |
2414 |
+ /* dev/watchdog is a virtual (and thus non-seekable) filesystem */ |
2415 |
+@@ -964,14 +966,13 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) |
2416 |
+ * and schedule an immediate ping. |
2417 |
+ */ |
2418 |
+ if (watchdog_hw_running(wdd)) { |
2419 |
+- if (handle_boot_enabled) { |
2420 |
+- __module_get(wdd->ops->owner); |
2421 |
+- kref_get(&wd_data->kref); |
2422 |
++ __module_get(wdd->ops->owner); |
2423 |
++ kref_get(&wd_data->kref); |
2424 |
++ if (handle_boot_enabled) |
2425 |
+ queue_delayed_work(watchdog_wq, &wd_data->work, 0); |
2426 |
+- } else { |
2427 |
++ else |
2428 |
+ pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n", |
2429 |
+- wdd->id); |
2430 |
+- } |
2431 |
++ wdd->id); |
2432 |
+ } |
2433 |
+ |
2434 |
+ return 0; |
2435 |
+diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c |
2436 |
+index 8487486ec496..8ce60986fb75 100644 |
2437 |
+--- a/fs/nfsd/nfs4proc.c |
2438 |
++++ b/fs/nfsd/nfs4proc.c |
2439 |
+@@ -1372,14 +1372,14 @@ nfsd4_layoutget(struct svc_rqst *rqstp, |
2440 |
+ const struct nfsd4_layout_ops *ops; |
2441 |
+ struct nfs4_layout_stateid *ls; |
2442 |
+ __be32 nfserr; |
2443 |
+- int accmode; |
2444 |
++ int accmode = NFSD_MAY_READ_IF_EXEC; |
2445 |
+ |
2446 |
+ switch (lgp->lg_seg.iomode) { |
2447 |
+ case IOMODE_READ: |
2448 |
+- accmode = NFSD_MAY_READ; |
2449 |
++ accmode |= NFSD_MAY_READ; |
2450 |
+ break; |
2451 |
+ case IOMODE_RW: |
2452 |
+- accmode = NFSD_MAY_READ | NFSD_MAY_WRITE; |
2453 |
++ accmode |= NFSD_MAY_READ | NFSD_MAY_WRITE; |
2454 |
+ break; |
2455 |
+ default: |
2456 |
+ dprintk("%s: invalid iomode %d\n", |
2457 |
+diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h |
2458 |
+index 8f9fc6e5539a..bfb4a9d962a5 100644 |
2459 |
+--- a/include/linux/mlx5/driver.h |
2460 |
++++ b/include/linux/mlx5/driver.h |
2461 |
+@@ -432,8 +432,8 @@ struct mlx5_core_srq { |
2462 |
+ struct mlx5_core_rsc_common common; /* must be first */ |
2463 |
+ u32 srqn; |
2464 |
+ int max; |
2465 |
+- int max_gs; |
2466 |
+- int max_avail_gather; |
2467 |
++ size_t max_gs; |
2468 |
++ size_t max_avail_gather; |
2469 |
+ int wqe_shift; |
2470 |
+ void (*event) (struct mlx5_core_srq *, enum mlx5_event); |
2471 |
+ |
2472 |
+diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c |
2473 |
+index 1933654007c4..23e6d5532b5c 100644 |
2474 |
+--- a/net/ipv4/ip_gre.c |
2475 |
++++ b/net/ipv4/ip_gre.c |
2476 |
+@@ -303,8 +303,10 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, |
2477 |
+ return PACKET_REJECT; |
2478 |
+ |
2479 |
+ md = ip_tunnel_info_opts(&tun_dst->u.tun_info); |
2480 |
+- if (!md) |
2481 |
++ if (!md) { |
2482 |
++ dst_release((struct dst_entry *)tun_dst); |
2483 |
+ return PACKET_REJECT; |
2484 |
++ } |
2485 |
+ |
2486 |
+ md->index = index; |
2487 |
+ info = &tun_dst->u.tun_info; |
2488 |
+@@ -408,11 +410,13 @@ static int gre_rcv(struct sk_buff *skb) |
2489 |
+ if (unlikely(tpi.proto == htons(ETH_P_ERSPAN))) { |
2490 |
+ if (erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD) |
2491 |
+ return 0; |
2492 |
++ goto out; |
2493 |
+ } |
2494 |
+ |
2495 |
+ if (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD) |
2496 |
+ return 0; |
2497 |
+ |
2498 |
++out: |
2499 |
+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); |
2500 |
+ drop: |
2501 |
+ kfree_skb(skb); |
2502 |
+diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c |
2503 |
+index bcdc2d557de1..413f01be0c9b 100644 |
2504 |
+--- a/net/ipv6/ip6_vti.c |
2505 |
++++ b/net/ipv6/ip6_vti.c |
2506 |
+@@ -626,6 +626,7 @@ static void vti6_link_config(struct ip6_tnl *t) |
2507 |
+ { |
2508 |
+ struct net_device *dev = t->dev; |
2509 |
+ struct __ip6_tnl_parm *p = &t->parms; |
2510 |
++ struct net_device *tdev = NULL; |
2511 |
+ |
2512 |
+ memcpy(dev->dev_addr, &p->laddr, sizeof(struct in6_addr)); |
2513 |
+ memcpy(dev->broadcast, &p->raddr, sizeof(struct in6_addr)); |
2514 |
+@@ -638,6 +639,25 @@ static void vti6_link_config(struct ip6_tnl *t) |
2515 |
+ dev->flags |= IFF_POINTOPOINT; |
2516 |
+ else |
2517 |
+ dev->flags &= ~IFF_POINTOPOINT; |
2518 |
++ |
2519 |
++ if (p->flags & IP6_TNL_F_CAP_XMIT) { |
2520 |
++ int strict = (ipv6_addr_type(&p->raddr) & |
2521 |
++ (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL)); |
2522 |
++ struct rt6_info *rt = rt6_lookup(t->net, |
2523 |
++ &p->raddr, &p->laddr, |
2524 |
++ p->link, strict); |
2525 |
++ |
2526 |
++ if (rt) |
2527 |
++ tdev = rt->dst.dev; |
2528 |
++ ip6_rt_put(rt); |
2529 |
++ } |
2530 |
++ |
2531 |
++ if (!tdev && p->link) |
2532 |
++ tdev = __dev_get_by_index(t->net, p->link); |
2533 |
++ |
2534 |
++ if (tdev) |
2535 |
++ dev->mtu = max_t(int, tdev->mtu - dev->hard_header_len, |
2536 |
++ IPV6_MIN_MTU); |
2537 |
+ } |
2538 |
+ |
2539 |
+ /** |
2540 |
+diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include |
2541 |
+index 9ffd3dda3889..97769465de13 100644 |
2542 |
+--- a/scripts/Kbuild.include |
2543 |
++++ b/scripts/Kbuild.include |
2544 |
+@@ -160,12 +160,13 @@ cc-if-fullversion = $(shell [ $(cc-fullversion) $(1) $(2) ] && echo $(3) || echo |
2545 |
+ # cc-ldoption |
2546 |
+ # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
2547 |
+ cc-ldoption = $(call try-run,\ |
2548 |
+- $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
2549 |
++ $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
2550 |
+ |
2551 |
+ # ld-option |
2552 |
+ # Usage: LDFLAGS += $(call ld-option, -X) |
2553 |
+ ld-option = $(call try-run,\ |
2554 |
+- $(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
2555 |
++ $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -x c /dev/null -c -o "$$TMPO"; \ |
2556 |
++ $(LD) $(LDFLAGS) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
2557 |
+ |
2558 |
+ # ar-option |
2559 |
+ # Usage: KBUILD_ARFLAGS := $(call ar-option,D) |
2560 |
+diff --git a/security/Kconfig b/security/Kconfig |
2561 |
+index b5c2b5d0c6c0..87f2a6f842fd 100644 |
2562 |
+--- a/security/Kconfig |
2563 |
++++ b/security/Kconfig |
2564 |
+@@ -154,6 +154,7 @@ config HARDENED_USERCOPY |
2565 |
+ bool "Harden memory copies between kernel and userspace" |
2566 |
+ depends on HAVE_HARDENED_USERCOPY_ALLOCATOR |
2567 |
+ select BUG |
2568 |
++ imply STRICT_DEVMEM |
2569 |
+ help |
2570 |
+ This option checks for obviously wrong memory regions when |
2571 |
+ copying memory to/from the kernel (via copy_to_user() and |