1 |
commit: 084b3de03579737835c8d41c780b095d17825501 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 23 11:02:22 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 23 11:02:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=084b3de0 |
7 |
|
8 |
Linux patch 4.9.211 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1210_linux-4.9.211.patch | 3295 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3299 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 98a33c2..abe93da 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -883,6 +883,10 @@ Patch: 1209_linux-4.9.210.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.210 |
23 |
|
24 |
+Patch: 1210_linux-4.9.211.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.211 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1210_linux-4.9.211.patch b/1210_linux-4.9.211.patch |
33 |
new file mode 100644 |
34 |
index 0000000..658a62d |
35 |
--- /dev/null |
36 |
+++ b/1210_linux-4.9.211.patch |
37 |
@@ -0,0 +1,3295 @@ |
38 |
+diff --git a/Documentation/ABI/testing/sysfs-bus-mei b/Documentation/ABI/testing/sysfs-bus-mei |
39 |
+index 6bd45346ac7e..3f8701e8fa24 100644 |
40 |
+--- a/Documentation/ABI/testing/sysfs-bus-mei |
41 |
++++ b/Documentation/ABI/testing/sysfs-bus-mei |
42 |
+@@ -4,7 +4,7 @@ KernelVersion: 3.10 |
43 |
+ Contact: Samuel Ortiz <sameo@×××××××××××.com> |
44 |
+ linux-mei@×××××××××××.com |
45 |
+ Description: Stores the same MODALIAS value emitted by uevent |
46 |
+- Format: mei:<mei device name>:<device uuid>: |
47 |
++ Format: mei:<mei device name>:<device uuid>:<protocol version> |
48 |
+ |
49 |
+ What: /sys/bus/mei/devices/.../name |
50 |
+ Date: May 2015 |
51 |
+diff --git a/Makefile b/Makefile |
52 |
+index aa871ec44dd9..7fd68e080fe4 100644 |
53 |
+--- a/Makefile |
54 |
++++ b/Makefile |
55 |
+@@ -1,6 +1,6 @@ |
56 |
+ VERSION = 4 |
57 |
+ PATCHLEVEL = 9 |
58 |
+-SUBLEVEL = 210 |
59 |
++SUBLEVEL = 211 |
60 |
+ EXTRAVERSION = |
61 |
+ NAME = Roaring Lionus |
62 |
+ |
63 |
+diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
64 |
+index e79f3defe002..c2ad4f97cef0 100644 |
65 |
+--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
66 |
++++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi |
67 |
+@@ -56,10 +56,10 @@ |
68 |
+ |
69 |
+ pmu { |
70 |
+ compatible = "arm,armv8-pmuv3"; |
71 |
+- interrupts = <0 120 8>, |
72 |
+- <0 121 8>, |
73 |
+- <0 122 8>, |
74 |
+- <0 123 8>; |
75 |
++ interrupts = <0 170 4>, |
76 |
++ <0 171 4>, |
77 |
++ <0 172 4>, |
78 |
++ <0 173 4>; |
79 |
+ interrupt-affinity = <&cpu0>, |
80 |
+ <&cpu1>, |
81 |
+ <&cpu2>, |
82 |
+diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h |
83 |
+index 547519abc751..ff721659eb94 100644 |
84 |
+--- a/arch/arm64/include/asm/kvm_mmu.h |
85 |
++++ b/arch/arm64/include/asm/kvm_mmu.h |
86 |
+@@ -300,6 +300,11 @@ static inline bool __kvm_cpu_uses_extended_idmap(void) |
87 |
+ return __cpu_uses_extended_idmap(); |
88 |
+ } |
89 |
+ |
90 |
++/* |
91 |
++ * Can't use pgd_populate here, because the extended idmap adds an extra level |
92 |
++ * above CONFIG_PGTABLE_LEVELS (which is 2 or 3 if we're using the extended |
93 |
++ * idmap), and pgd_populate is only available if CONFIG_PGTABLE_LEVELS = 4. |
94 |
++ */ |
95 |
+ static inline void __kvm_extend_hypmap(pgd_t *boot_hyp_pgd, |
96 |
+ pgd_t *hyp_pgd, |
97 |
+ pgd_t *merged_hyp_pgd, |
98 |
+diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h |
99 |
+index 56ba1389a95a..199f434f99a4 100644 |
100 |
+--- a/arch/arm64/include/asm/pgtable.h |
101 |
++++ b/arch/arm64/include/asm/pgtable.h |
102 |
+@@ -353,6 +353,7 @@ static inline int pmd_protnone(pmd_t pmd) |
103 |
+ |
104 |
+ #define pud_write(pud) pte_write(pud_pte(pud)) |
105 |
+ #define pud_pfn(pud) (((pud_val(pud) & PUD_MASK) & PHYS_MASK) >> PAGE_SHIFT) |
106 |
++#define pfn_pud(pfn,prot) (__pud(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))) |
107 |
+ |
108 |
+ #define set_pmd_at(mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)) |
109 |
+ |
110 |
+diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c |
111 |
+index 76c9b51fa7f1..c4aec129ed20 100644 |
112 |
+--- a/arch/arm64/kernel/hibernate.c |
113 |
++++ b/arch/arm64/kernel/hibernate.c |
114 |
+@@ -247,8 +247,7 @@ static int create_safe_exec_page(void *src_start, size_t length, |
115 |
+ } |
116 |
+ |
117 |
+ pte = pte_offset_kernel(pmd, dst_addr); |
118 |
+- set_pte(pte, __pte(virt_to_phys((void *)dst) | |
119 |
+- pgprot_val(PAGE_KERNEL_EXEC))); |
120 |
++ set_pte(pte, pfn_pte(virt_to_pfn(dst), PAGE_KERNEL_EXEC)); |
121 |
+ |
122 |
+ /* |
123 |
+ * Load our new page tables. A strict BBM approach requires that we |
124 |
+diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c |
125 |
+index efd65fc85238..60be5bc0984a 100644 |
126 |
+--- a/arch/arm64/mm/mmu.c |
127 |
++++ b/arch/arm64/mm/mmu.c |
128 |
+@@ -28,8 +28,6 @@ |
129 |
+ #include <linux/memblock.h> |
130 |
+ #include <linux/fs.h> |
131 |
+ #include <linux/io.h> |
132 |
+-#include <linux/slab.h> |
133 |
+-#include <linux/stop_machine.h> |
134 |
+ |
135 |
+ #include <asm/barrier.h> |
136 |
+ #include <asm/cputype.h> |
137 |
+@@ -95,6 +93,17 @@ static phys_addr_t __init early_pgtable_alloc(void) |
138 |
+ return phys; |
139 |
+ } |
140 |
+ |
141 |
++static bool pgattr_change_is_safe(u64 old, u64 new) |
142 |
++{ |
143 |
++ /* |
144 |
++ * The following mapping attributes may be updated in live |
145 |
++ * kernel mappings without the need for break-before-make. |
146 |
++ */ |
147 |
++ static const pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE; |
148 |
++ |
149 |
++ return old == 0 || new == 0 || ((old ^ new) & ~mask) == 0; |
150 |
++} |
151 |
++ |
152 |
+ static void alloc_init_pte(pmd_t *pmd, unsigned long addr, |
153 |
+ unsigned long end, unsigned long pfn, |
154 |
+ pgprot_t prot, |
155 |
+@@ -115,8 +124,17 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr, |
156 |
+ |
157 |
+ pte = pte_set_fixmap_offset(pmd, addr); |
158 |
+ do { |
159 |
++ pte_t old_pte = *pte; |
160 |
++ |
161 |
+ set_pte(pte, pfn_pte(pfn, prot)); |
162 |
+ pfn++; |
163 |
++ |
164 |
++ /* |
165 |
++ * After the PTE entry has been populated once, we |
166 |
++ * only allow updates to the permission attributes. |
167 |
++ */ |
168 |
++ BUG_ON(!pgattr_change_is_safe(pte_val(old_pte), pte_val(*pte))); |
169 |
++ |
170 |
+ } while (pte++, addr += PAGE_SIZE, addr != end); |
171 |
+ |
172 |
+ pte_clear_fixmap(); |
173 |
+@@ -146,27 +164,27 @@ static void alloc_init_pmd(pud_t *pud, unsigned long addr, unsigned long end, |
174 |
+ |
175 |
+ pmd = pmd_set_fixmap_offset(pud, addr); |
176 |
+ do { |
177 |
++ pmd_t old_pmd = *pmd; |
178 |
++ |
179 |
+ next = pmd_addr_end(addr, end); |
180 |
++ |
181 |
+ /* try section mapping first */ |
182 |
+ if (((addr | next | phys) & ~SECTION_MASK) == 0 && |
183 |
+ allow_block_mappings) { |
184 |
+- pmd_t old_pmd =*pmd; |
185 |
+ pmd_set_huge(pmd, phys, prot); |
186 |
++ |
187 |
+ /* |
188 |
+- * Check for previous table entries created during |
189 |
+- * boot (__create_page_tables) and flush them. |
190 |
++ * After the PMD entry has been populated once, we |
191 |
++ * only allow updates to the permission attributes. |
192 |
+ */ |
193 |
+- if (!pmd_none(old_pmd)) { |
194 |
+- flush_tlb_all(); |
195 |
+- if (pmd_table(old_pmd)) { |
196 |
+- phys_addr_t table = pmd_page_paddr(old_pmd); |
197 |
+- if (!WARN_ON_ONCE(slab_is_available())) |
198 |
+- memblock_free(table, PAGE_SIZE); |
199 |
+- } |
200 |
+- } |
201 |
++ BUG_ON(!pgattr_change_is_safe(pmd_val(old_pmd), |
202 |
++ pmd_val(*pmd))); |
203 |
+ } else { |
204 |
+ alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys), |
205 |
+ prot, pgtable_alloc); |
206 |
++ |
207 |
++ BUG_ON(pmd_val(old_pmd) != 0 && |
208 |
++ pmd_val(old_pmd) != pmd_val(*pmd)); |
209 |
+ } |
210 |
+ phys += next - addr; |
211 |
+ } while (pmd++, addr = next, addr != end); |
212 |
+@@ -204,33 +222,28 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, |
213 |
+ |
214 |
+ pud = pud_set_fixmap_offset(pgd, addr); |
215 |
+ do { |
216 |
++ pud_t old_pud = *pud; |
217 |
++ |
218 |
+ next = pud_addr_end(addr, end); |
219 |
+ |
220 |
+ /* |
221 |
+ * For 4K granule only, attempt to put down a 1GB block |
222 |
+ */ |
223 |
+ if (use_1G_block(addr, next, phys) && allow_block_mappings) { |
224 |
+- pud_t old_pud = *pud; |
225 |
+ pud_set_huge(pud, phys, prot); |
226 |
+ |
227 |
+ /* |
228 |
+- * If we have an old value for a pud, it will |
229 |
+- * be pointing to a pmd table that we no longer |
230 |
+- * need (from swapper_pg_dir). |
231 |
+- * |
232 |
+- * Look up the old pmd table and free it. |
233 |
++ * After the PUD entry has been populated once, we |
234 |
++ * only allow updates to the permission attributes. |
235 |
+ */ |
236 |
+- if (!pud_none(old_pud)) { |
237 |
+- flush_tlb_all(); |
238 |
+- if (pud_table(old_pud)) { |
239 |
+- phys_addr_t table = pud_page_paddr(old_pud); |
240 |
+- if (!WARN_ON_ONCE(slab_is_available())) |
241 |
+- memblock_free(table, PAGE_SIZE); |
242 |
+- } |
243 |
+- } |
244 |
++ BUG_ON(!pgattr_change_is_safe(pud_val(old_pud), |
245 |
++ pud_val(*pud))); |
246 |
+ } else { |
247 |
+ alloc_init_pmd(pud, addr, next, phys, prot, |
248 |
+ pgtable_alloc, allow_block_mappings); |
249 |
++ |
250 |
++ BUG_ON(pud_val(old_pud) != 0 && |
251 |
++ pud_val(old_pud) != pud_val(*pud)); |
252 |
+ } |
253 |
+ phys += next - addr; |
254 |
+ } while (pud++, addr = next, addr != end); |
255 |
+@@ -396,6 +409,9 @@ void mark_rodata_ro(void) |
256 |
+ section_size = (unsigned long)__init_begin - (unsigned long)__start_rodata; |
257 |
+ create_mapping_late(__pa(__start_rodata), (unsigned long)__start_rodata, |
258 |
+ section_size, PAGE_KERNEL_RO); |
259 |
++ |
260 |
++ /* flush the TLBs after updating live kernel mappings */ |
261 |
++ flush_tlb_all(); |
262 |
+ } |
263 |
+ |
264 |
+ static void __init map_kernel_segment(pgd_t *pgd, void *va_start, void *va_end, |
265 |
+@@ -479,8 +495,8 @@ static void __init map_kernel(pgd_t *pgd) |
266 |
+ * entry instead. |
267 |
+ */ |
268 |
+ BUG_ON(!IS_ENABLED(CONFIG_ARM64_16K_PAGES)); |
269 |
+- set_pud(pud_set_fixmap_offset(pgd, FIXADDR_START), |
270 |
+- __pud(__pa(bm_pmd) | PUD_TYPE_TABLE)); |
271 |
++ pud_populate(&init_mm, pud_set_fixmap_offset(pgd, FIXADDR_START), |
272 |
++ lm_alias(bm_pmd)); |
273 |
+ pud_clear_fixmap(); |
274 |
+ } else { |
275 |
+ BUG(); |
276 |
+@@ -595,7 +611,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node) |
277 |
+ if (!p) |
278 |
+ return -ENOMEM; |
279 |
+ |
280 |
+- set_pmd(pmd, __pmd(__pa(p) | PROT_SECT_NORMAL)); |
281 |
++ pmd_set_huge(pmd, __pa(p), __pgprot(PROT_SECT_NORMAL)); |
282 |
+ } else |
283 |
+ vmemmap_verify((pte_t *)pmd, node, addr, next); |
284 |
+ } while (addr = next, addr != end); |
285 |
+@@ -779,17 +795,35 @@ int __init arch_ioremap_pmd_supported(void) |
286 |
+ return !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS); |
287 |
+ } |
288 |
+ |
289 |
+-int pud_set_huge(pud_t *pud, phys_addr_t phys, pgprot_t prot) |
290 |
++int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot) |
291 |
+ { |
292 |
++ pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT | |
293 |
++ pgprot_val(mk_sect_prot(prot))); |
294 |
++ pud_t new_pud = pfn_pud(__phys_to_pfn(phys), sect_prot); |
295 |
++ |
296 |
++ /* Only allow permission changes for now */ |
297 |
++ if (!pgattr_change_is_safe(READ_ONCE(pud_val(*pudp)), |
298 |
++ pud_val(new_pud))) |
299 |
++ return 0; |
300 |
++ |
301 |
+ BUG_ON(phys & ~PUD_MASK); |
302 |
+- set_pud(pud, __pud(phys | PUD_TYPE_SECT | pgprot_val(mk_sect_prot(prot)))); |
303 |
++ set_pud(pudp, new_pud); |
304 |
+ return 1; |
305 |
+ } |
306 |
+ |
307 |
+-int pmd_set_huge(pmd_t *pmd, phys_addr_t phys, pgprot_t prot) |
308 |
++int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot) |
309 |
+ { |
310 |
++ pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT | |
311 |
++ pgprot_val(mk_sect_prot(prot))); |
312 |
++ pmd_t new_pmd = pfn_pmd(__phys_to_pfn(phys), sect_prot); |
313 |
++ |
314 |
++ /* Only allow permission changes for now */ |
315 |
++ if (!pgattr_change_is_safe(READ_ONCE(pmd_val(*pmdp)), |
316 |
++ pmd_val(new_pmd))) |
317 |
++ return 0; |
318 |
++ |
319 |
+ BUG_ON(phys & ~PMD_MASK); |
320 |
+- set_pmd(pmd, __pmd(phys | PMD_TYPE_SECT | pgprot_val(mk_sect_prot(prot)))); |
321 |
++ set_pmd(pmdp, new_pmd); |
322 |
+ return 1; |
323 |
+ } |
324 |
+ |
325 |
+diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h |
326 |
+index a62ba368b27d..1ae06190b68f 100644 |
327 |
+--- a/arch/hexagon/include/asm/atomic.h |
328 |
++++ b/arch/hexagon/include/asm/atomic.h |
329 |
+@@ -103,7 +103,7 @@ static inline void atomic_##op(int i, atomic_t *v) \ |
330 |
+ "1: %0 = memw_locked(%1);\n" \ |
331 |
+ " %0 = "#op "(%0,%2);\n" \ |
332 |
+ " memw_locked(%1,P3)=%0;\n" \ |
333 |
+- " if !P3 jump 1b;\n" \ |
334 |
++ " if (!P3) jump 1b;\n" \ |
335 |
+ : "=&r" (output) \ |
336 |
+ : "r" (&v->counter), "r" (i) \ |
337 |
+ : "memory", "p3" \ |
338 |
+@@ -119,7 +119,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \ |
339 |
+ "1: %0 = memw_locked(%1);\n" \ |
340 |
+ " %0 = "#op "(%0,%2);\n" \ |
341 |
+ " memw_locked(%1,P3)=%0;\n" \ |
342 |
+- " if !P3 jump 1b;\n" \ |
343 |
++ " if (!P3) jump 1b;\n" \ |
344 |
+ : "=&r" (output) \ |
345 |
+ : "r" (&v->counter), "r" (i) \ |
346 |
+ : "memory", "p3" \ |
347 |
+@@ -136,7 +136,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \ |
348 |
+ "1: %0 = memw_locked(%2);\n" \ |
349 |
+ " %1 = "#op "(%0,%3);\n" \ |
350 |
+ " memw_locked(%2,P3)=%1;\n" \ |
351 |
+- " if !P3 jump 1b;\n" \ |
352 |
++ " if (!P3) jump 1b;\n" \ |
353 |
+ : "=&r" (output), "=&r" (val) \ |
354 |
+ : "r" (&v->counter), "r" (i) \ |
355 |
+ : "memory", "p3" \ |
356 |
+@@ -185,7 +185,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) |
357 |
+ " }" |
358 |
+ " memw_locked(%2, p3) = %1;" |
359 |
+ " {" |
360 |
+- " if !p3 jump 1b;" |
361 |
++ " if (!p3) jump 1b;" |
362 |
+ " }" |
363 |
+ "2:" |
364 |
+ : "=&r" (__oldval), "=&r" (tmp) |
365 |
+diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h |
366 |
+index 2691a1857d20..634306cda006 100644 |
367 |
+--- a/arch/hexagon/include/asm/bitops.h |
368 |
++++ b/arch/hexagon/include/asm/bitops.h |
369 |
+@@ -52,7 +52,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr) |
370 |
+ "1: R12 = memw_locked(R10);\n" |
371 |
+ " { P0 = tstbit(R12,R11); R12 = clrbit(R12,R11); }\n" |
372 |
+ " memw_locked(R10,P1) = R12;\n" |
373 |
+- " {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" |
374 |
++ " {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" |
375 |
+ : "=&r" (oldval) |
376 |
+ : "r" (addr), "r" (nr) |
377 |
+ : "r10", "r11", "r12", "p0", "p1", "memory" |
378 |
+@@ -76,7 +76,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr) |
379 |
+ "1: R12 = memw_locked(R10);\n" |
380 |
+ " { P0 = tstbit(R12,R11); R12 = setbit(R12,R11); }\n" |
381 |
+ " memw_locked(R10,P1) = R12;\n" |
382 |
+- " {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" |
383 |
++ " {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" |
384 |
+ : "=&r" (oldval) |
385 |
+ : "r" (addr), "r" (nr) |
386 |
+ : "r10", "r11", "r12", "p0", "p1", "memory" |
387 |
+@@ -102,7 +102,7 @@ static inline int test_and_change_bit(int nr, volatile void *addr) |
388 |
+ "1: R12 = memw_locked(R10);\n" |
389 |
+ " { P0 = tstbit(R12,R11); R12 = togglebit(R12,R11); }\n" |
390 |
+ " memw_locked(R10,P1) = R12;\n" |
391 |
+- " {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" |
392 |
++ " {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" |
393 |
+ : "=&r" (oldval) |
394 |
+ : "r" (addr), "r" (nr) |
395 |
+ : "r10", "r11", "r12", "p0", "p1", "memory" |
396 |
+@@ -237,7 +237,7 @@ static inline int ffs(int x) |
397 |
+ int r; |
398 |
+ |
399 |
+ asm("{ P0 = cmp.eq(%1,#0); %0 = ct0(%1);}\n" |
400 |
+- "{ if P0 %0 = #0; if !P0 %0 = add(%0,#1);}\n" |
401 |
++ "{ if (P0) %0 = #0; if (!P0) %0 = add(%0,#1);}\n" |
402 |
+ : "=&r" (r) |
403 |
+ : "r" (x) |
404 |
+ : "p0"); |
405 |
+diff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h |
406 |
+index a6e34e2acbba..db258424059f 100644 |
407 |
+--- a/arch/hexagon/include/asm/cmpxchg.h |
408 |
++++ b/arch/hexagon/include/asm/cmpxchg.h |
409 |
+@@ -44,7 +44,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, |
410 |
+ __asm__ __volatile__ ( |
411 |
+ "1: %0 = memw_locked(%1);\n" /* load into retval */ |
412 |
+ " memw_locked(%1,P0) = %2;\n" /* store into memory */ |
413 |
+- " if !P0 jump 1b;\n" |
414 |
++ " if (!P0) jump 1b;\n" |
415 |
+ : "=&r" (retval) |
416 |
+ : "r" (ptr), "r" (x) |
417 |
+ : "memory", "p0" |
418 |
+diff --git a/arch/hexagon/include/asm/futex.h b/arch/hexagon/include/asm/futex.h |
419 |
+index c607b77c8215..12bd92f3ea41 100644 |
420 |
+--- a/arch/hexagon/include/asm/futex.h |
421 |
++++ b/arch/hexagon/include/asm/futex.h |
422 |
+@@ -15,7 +15,7 @@ |
423 |
+ /* For example: %1 = %4 */ \ |
424 |
+ insn \ |
425 |
+ "2: memw_locked(%3,p2) = %1;\n" \ |
426 |
+- " if !p2 jump 1b;\n" \ |
427 |
++ " if (!p2) jump 1b;\n" \ |
428 |
+ " %1 = #0;\n" \ |
429 |
+ "3:\n" \ |
430 |
+ ".section .fixup,\"ax\"\n" \ |
431 |
+@@ -83,10 +83,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, |
432 |
+ "1: %1 = memw_locked(%3)\n" |
433 |
+ " {\n" |
434 |
+ " p2 = cmp.eq(%1,%4)\n" |
435 |
+- " if !p2.new jump:NT 3f\n" |
436 |
++ " if (!p2.new) jump:NT 3f\n" |
437 |
+ " }\n" |
438 |
+ "2: memw_locked(%3,p2) = %5\n" |
439 |
+- " if !p2 jump 1b\n" |
440 |
++ " if (!p2) jump 1b\n" |
441 |
+ "3:\n" |
442 |
+ ".section .fixup,\"ax\"\n" |
443 |
+ "4: %0 = #%6\n" |
444 |
+diff --git a/arch/hexagon/include/asm/spinlock.h b/arch/hexagon/include/asm/spinlock.h |
445 |
+index a1c55788c5d6..f61bb3185305 100644 |
446 |
+--- a/arch/hexagon/include/asm/spinlock.h |
447 |
++++ b/arch/hexagon/include/asm/spinlock.h |
448 |
+@@ -44,9 +44,9 @@ static inline void arch_read_lock(arch_rwlock_t *lock) |
449 |
+ __asm__ __volatile__( |
450 |
+ "1: R6 = memw_locked(%0);\n" |
451 |
+ " { P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" |
452 |
+- " { if !P3 jump 1b; }\n" |
453 |
++ " { if (!P3) jump 1b; }\n" |
454 |
+ " memw_locked(%0,P3) = R6;\n" |
455 |
+- " { if !P3 jump 1b; }\n" |
456 |
++ " { if (!P3) jump 1b; }\n" |
457 |
+ : |
458 |
+ : "r" (&lock->lock) |
459 |
+ : "memory", "r6", "p3" |
460 |
+@@ -60,7 +60,7 @@ static inline void arch_read_unlock(arch_rwlock_t *lock) |
461 |
+ "1: R6 = memw_locked(%0);\n" |
462 |
+ " R6 = add(R6,#-1);\n" |
463 |
+ " memw_locked(%0,P3) = R6\n" |
464 |
+- " if !P3 jump 1b;\n" |
465 |
++ " if (!P3) jump 1b;\n" |
466 |
+ : |
467 |
+ : "r" (&lock->lock) |
468 |
+ : "memory", "r6", "p3" |
469 |
+@@ -75,7 +75,7 @@ static inline int arch_read_trylock(arch_rwlock_t *lock) |
470 |
+ __asm__ __volatile__( |
471 |
+ " R6 = memw_locked(%1);\n" |
472 |
+ " { %0 = #0; P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" |
473 |
+- " { if !P3 jump 1f; }\n" |
474 |
++ " { if (!P3) jump 1f; }\n" |
475 |
+ " memw_locked(%1,P3) = R6;\n" |
476 |
+ " { %0 = P3 }\n" |
477 |
+ "1:\n" |
478 |
+@@ -102,9 +102,9 @@ static inline void arch_write_lock(arch_rwlock_t *lock) |
479 |
+ __asm__ __volatile__( |
480 |
+ "1: R6 = memw_locked(%0)\n" |
481 |
+ " { P3 = cmp.eq(R6,#0); R6 = #-1;}\n" |
482 |
+- " { if !P3 jump 1b; }\n" |
483 |
++ " { if (!P3) jump 1b; }\n" |
484 |
+ " memw_locked(%0,P3) = R6;\n" |
485 |
+- " { if !P3 jump 1b; }\n" |
486 |
++ " { if (!P3) jump 1b; }\n" |
487 |
+ : |
488 |
+ : "r" (&lock->lock) |
489 |
+ : "memory", "r6", "p3" |
490 |
+@@ -118,7 +118,7 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) |
491 |
+ __asm__ __volatile__( |
492 |
+ " R6 = memw_locked(%1)\n" |
493 |
+ " { %0 = #0; P3 = cmp.eq(R6,#0); R6 = #-1;}\n" |
494 |
+- " { if !P3 jump 1f; }\n" |
495 |
++ " { if (!P3) jump 1f; }\n" |
496 |
+ " memw_locked(%1,P3) = R6;\n" |
497 |
+ " %0 = P3;\n" |
498 |
+ "1:\n" |
499 |
+@@ -141,9 +141,9 @@ static inline void arch_spin_lock(arch_spinlock_t *lock) |
500 |
+ __asm__ __volatile__( |
501 |
+ "1: R6 = memw_locked(%0);\n" |
502 |
+ " P3 = cmp.eq(R6,#0);\n" |
503 |
+- " { if !P3 jump 1b; R6 = #1; }\n" |
504 |
++ " { if (!P3) jump 1b; R6 = #1; }\n" |
505 |
+ " memw_locked(%0,P3) = R6;\n" |
506 |
+- " { if !P3 jump 1b; }\n" |
507 |
++ " { if (!P3) jump 1b; }\n" |
508 |
+ : |
509 |
+ : "r" (&lock->lock) |
510 |
+ : "memory", "r6", "p3" |
511 |
+@@ -163,7 +163,7 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock) |
512 |
+ __asm__ __volatile__( |
513 |
+ " R6 = memw_locked(%1);\n" |
514 |
+ " P3 = cmp.eq(R6,#0);\n" |
515 |
+- " { if !P3 jump 1f; R6 = #1; %0 = #0; }\n" |
516 |
++ " { if (!P3) jump 1f; R6 = #1; %0 = #0; }\n" |
517 |
+ " memw_locked(%1,P3) = R6;\n" |
518 |
+ " %0 = P3;\n" |
519 |
+ "1:\n" |
520 |
+diff --git a/arch/hexagon/kernel/stacktrace.c b/arch/hexagon/kernel/stacktrace.c |
521 |
+index f94918b449a8..03a0e10ecdcc 100644 |
522 |
+--- a/arch/hexagon/kernel/stacktrace.c |
523 |
++++ b/arch/hexagon/kernel/stacktrace.c |
524 |
+@@ -23,8 +23,6 @@ |
525 |
+ #include <linux/thread_info.h> |
526 |
+ #include <linux/module.h> |
527 |
+ |
528 |
+-register unsigned long current_frame_pointer asm("r30"); |
529 |
+- |
530 |
+ struct stackframe { |
531 |
+ unsigned long fp; |
532 |
+ unsigned long rets; |
533 |
+@@ -42,7 +40,7 @@ void save_stack_trace(struct stack_trace *trace) |
534 |
+ |
535 |
+ low = (unsigned long)task_stack_page(current); |
536 |
+ high = low + THREAD_SIZE; |
537 |
+- fp = current_frame_pointer; |
538 |
++ fp = (unsigned long)__builtin_frame_address(0); |
539 |
+ |
540 |
+ while (fp >= low && fp <= (high - sizeof(*frame))) { |
541 |
+ frame = (struct stackframe *)fp; |
542 |
+diff --git a/arch/hexagon/kernel/vm_entry.S b/arch/hexagon/kernel/vm_entry.S |
543 |
+index 67c6ccc14770..9f4a73ff7203 100644 |
544 |
+--- a/arch/hexagon/kernel/vm_entry.S |
545 |
++++ b/arch/hexagon/kernel/vm_entry.S |
546 |
+@@ -382,7 +382,7 @@ ret_from_fork: |
547 |
+ R26.L = #LO(do_work_pending); |
548 |
+ R0 = #VM_INT_DISABLE; |
549 |
+ } |
550 |
+- if P0 jump check_work_pending |
551 |
++ if (P0) jump check_work_pending |
552 |
+ { |
553 |
+ R0 = R25; |
554 |
+ callr R24 |
555 |
+diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile |
556 |
+index ad31c76c7a29..2f77e250b91d 100644 |
557 |
+--- a/arch/mips/boot/compressed/Makefile |
558 |
++++ b/arch/mips/boot/compressed/Makefile |
559 |
+@@ -29,6 +29,9 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ |
560 |
+ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ |
561 |
+ -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS) |
562 |
+ |
563 |
++# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. |
564 |
++KCOV_INSTRUMENT := n |
565 |
++ |
566 |
+ # decompressor objects (linked with vmlinuz) |
567 |
+ vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o |
568 |
+ |
569 |
+diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c |
570 |
+index 98cc8ba07c23..00dbf1e895a9 100644 |
571 |
+--- a/arch/powerpc/platforms/powernv/pci.c |
572 |
++++ b/arch/powerpc/platforms/powernv/pci.c |
573 |
+@@ -923,6 +923,23 @@ void __init pnv_pci_init(void) |
574 |
+ if (!firmware_has_feature(FW_FEATURE_OPAL)) |
575 |
+ return; |
576 |
+ |
577 |
++#ifdef CONFIG_PCIEPORTBUS |
578 |
++ /* |
579 |
++ * On PowerNV PCIe devices are (currently) managed in cooperation |
580 |
++ * with firmware. This isn't *strictly* required, but there's enough |
581 |
++ * assumptions baked into both firmware and the platform code that |
582 |
++ * it's unwise to allow the portbus services to be used. |
583 |
++ * |
584 |
++ * We need to fix this eventually, but for now set this flag to disable |
585 |
++ * the portbus driver. The AER service isn't required since that AER |
586 |
++ * events are handled via EEH. The pciehp hotplug driver can't work |
587 |
++ * without kernel changes (and portbus binding breaks pnv_php). The |
588 |
++ * other services also require some thinking about how we're going |
589 |
++ * to integrate them. |
590 |
++ */ |
591 |
++ pcie_ports_disabled = true; |
592 |
++#endif |
593 |
++ |
594 |
+ /* Look for IODA IO-Hubs. */ |
595 |
+ for_each_compatible_node(np, NULL, "ibm,ioda-hub") { |
596 |
+ pnv_pci_init_ioda_hub(np); |
597 |
+diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S |
598 |
+index efdfba21a5b2..9e3a183561a9 100644 |
599 |
+--- a/arch/x86/boot/compressed/head_64.S |
600 |
++++ b/arch/x86/boot/compressed/head_64.S |
601 |
+@@ -227,6 +227,11 @@ ENTRY(efi32_stub_entry) |
602 |
+ leal efi32_config(%ebp), %eax |
603 |
+ movl %eax, efi_config(%ebp) |
604 |
+ |
605 |
++ /* Disable paging */ |
606 |
++ movl %cr0, %eax |
607 |
++ btrl $X86_CR0_PG_BIT, %eax |
608 |
++ movl %eax, %cr0 |
609 |
++ |
610 |
+ jmp startup_32 |
611 |
+ ENDPROC(efi32_stub_entry) |
612 |
+ #endif |
613 |
+diff --git a/block/blk-settings.c b/block/blk-settings.c |
614 |
+index f679ae122843..0d644f37e3c6 100644 |
615 |
+--- a/block/blk-settings.c |
616 |
++++ b/block/blk-settings.c |
617 |
+@@ -349,7 +349,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); |
618 |
+ * storage device can address. The default of 512 covers most |
619 |
+ * hardware. |
620 |
+ **/ |
621 |
+-void blk_queue_logical_block_size(struct request_queue *q, unsigned short size) |
622 |
++void blk_queue_logical_block_size(struct request_queue *q, unsigned int size) |
623 |
+ { |
624 |
+ q->limits.logical_block_size = size; |
625 |
+ |
626 |
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
627 |
+index c08ee8cf1e29..6ee3e928ebf1 100644 |
628 |
+--- a/drivers/block/xen-blkfront.c |
629 |
++++ b/drivers/block/xen-blkfront.c |
630 |
+@@ -1104,8 +1104,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, |
631 |
+ if (!VDEV_IS_EXTENDED(info->vdevice)) { |
632 |
+ err = xen_translate_vdev(info->vdevice, &minor, &offset); |
633 |
+ if (err) |
634 |
+- return err; |
635 |
+- nr_parts = PARTS_PER_DISK; |
636 |
++ return err; |
637 |
++ nr_parts = PARTS_PER_DISK; |
638 |
+ } else { |
639 |
+ minor = BLKIF_MINOR_EXT(info->vdevice); |
640 |
+ nr_parts = PARTS_PER_EXT_DISK; |
641 |
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c |
642 |
+index c745dad7f85e..af4f2ffc4fc5 100644 |
643 |
+--- a/drivers/clk/clk.c |
644 |
++++ b/drivers/clk/clk.c |
645 |
+@@ -2448,11 +2448,17 @@ static int __clk_core_init(struct clk_core *core) |
646 |
+ if (core->flags & CLK_IS_CRITICAL) { |
647 |
+ unsigned long flags; |
648 |
+ |
649 |
+- clk_core_prepare(core); |
650 |
++ ret = clk_core_prepare(core); |
651 |
++ if (ret) |
652 |
++ goto out; |
653 |
+ |
654 |
+ flags = clk_enable_lock(); |
655 |
+- clk_core_enable(core); |
656 |
++ ret = clk_core_enable(core); |
657 |
+ clk_enable_unlock(flags); |
658 |
++ if (ret) { |
659 |
++ clk_core_unprepare(core); |
660 |
++ goto out; |
661 |
++ } |
662 |
+ } |
663 |
+ |
664 |
+ /* |
665 |
+diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c |
666 |
+index 2bb88d125113..7f8c7cf3c2ab 100644 |
667 |
+--- a/drivers/clk/samsung/clk-exynos5420.c |
668 |
++++ b/drivers/clk/samsung/clk-exynos5420.c |
669 |
+@@ -170,6 +170,8 @@ static const unsigned long exynos5x_clk_regs[] __initconst = { |
670 |
+ GATE_BUS_CPU, |
671 |
+ GATE_SCLK_CPU, |
672 |
+ CLKOUT_CMU_CPU, |
673 |
++ APLL_CON0, |
674 |
++ KPLL_CON0, |
675 |
+ CPLL_CON0, |
676 |
+ DPLL_CON0, |
677 |
+ EPLL_CON0, |
678 |
+diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c |
679 |
+index 49386ce04bf5..1389f0582e29 100644 |
680 |
+--- a/drivers/dma/ioat/dma.c |
681 |
++++ b/drivers/dma/ioat/dma.c |
682 |
+@@ -394,10 +394,11 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) |
683 |
+ |
684 |
+ descs->virt = dma_alloc_coherent(to_dev(ioat_chan), |
685 |
+ SZ_2M, &descs->hw, flags); |
686 |
+- if (!descs->virt && (i > 0)) { |
687 |
++ if (!descs->virt) { |
688 |
+ int idx; |
689 |
+ |
690 |
+ for (idx = 0; idx < i; idx++) { |
691 |
++ descs = &ioat_chan->descs[idx]; |
692 |
+ dma_free_coherent(to_dev(ioat_chan), SZ_2M, |
693 |
+ descs->virt, descs->hw); |
694 |
+ descs->virt = NULL; |
695 |
+diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c |
696 |
+index bd777687233b..b67f61d31e25 100644 |
697 |
+--- a/drivers/gpio/gpio-mpc8xxx.c |
698 |
++++ b/drivers/gpio/gpio-mpc8xxx.c |
699 |
+@@ -306,6 +306,7 @@ static int mpc8xxx_probe(struct platform_device *pdev) |
700 |
+ return -ENOMEM; |
701 |
+ |
702 |
+ gc = &mpc8xxx_gc->gc; |
703 |
++ gc->parent = &pdev->dev; |
704 |
+ |
705 |
+ if (of_property_read_bool(np, "little-endian")) { |
706 |
+ ret = bgpio_init(gc, &pdev->dev, 4, |
707 |
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
708 |
+index 58193c939691..505dead07619 100644 |
709 |
+--- a/drivers/gpio/gpiolib.c |
710 |
++++ b/drivers/gpio/gpiolib.c |
711 |
+@@ -3049,8 +3049,9 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, |
712 |
+ |
713 |
+ if (chip->ngpio <= p->chip_hwnum) { |
714 |
+ dev_err(dev, |
715 |
+- "requested GPIO %d is out of range [0..%d] for chip %s\n", |
716 |
+- idx, chip->ngpio, chip->label); |
717 |
++ "requested GPIO %u (%u) is out of range [0..%u] for chip %s\n", |
718 |
++ idx, p->chip_hwnum, chip->ngpio - 1, |
719 |
++ chip->label); |
720 |
+ return ERR_PTR(-EINVAL); |
721 |
+ } |
722 |
+ |
723 |
+diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c |
724 |
+index 750c16897130..ed6591f92f71 100644 |
725 |
+--- a/drivers/hid/hidraw.c |
726 |
++++ b/drivers/hid/hidraw.c |
727 |
+@@ -257,13 +257,14 @@ out: |
728 |
+ static unsigned int hidraw_poll(struct file *file, poll_table *wait) |
729 |
+ { |
730 |
+ struct hidraw_list *list = file->private_data; |
731 |
++ unsigned int mask = POLLOUT | POLLWRNORM; /* hidraw is always writable */ |
732 |
+ |
733 |
+ poll_wait(file, &list->hidraw->wait, wait); |
734 |
+ if (list->head != list->tail) |
735 |
+- return POLLIN | POLLRDNORM; |
736 |
++ mask |= POLLIN | POLLRDNORM; |
737 |
+ if (!list->hidraw->exist) |
738 |
+- return POLLERR | POLLHUP; |
739 |
+- return 0; |
740 |
++ mask |= POLLERR | POLLHUP; |
741 |
++ return mask; |
742 |
+ } |
743 |
+ |
744 |
+ static int hidraw_open(struct inode *inode, struct file *file) |
745 |
+diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c |
746 |
+index d9b46da0e0aa..731a7b3e0187 100644 |
747 |
+--- a/drivers/hid/uhid.c |
748 |
++++ b/drivers/hid/uhid.c |
749 |
+@@ -769,13 +769,14 @@ unlock: |
750 |
+ static unsigned int uhid_char_poll(struct file *file, poll_table *wait) |
751 |
+ { |
752 |
+ struct uhid_device *uhid = file->private_data; |
753 |
++ unsigned int mask = POLLOUT | POLLWRNORM; /* uhid is always writable */ |
754 |
+ |
755 |
+ poll_wait(file, &uhid->waitq, wait); |
756 |
+ |
757 |
+ if (uhid->head != uhid->tail) |
758 |
+- return POLLIN | POLLRDNORM; |
759 |
++ mask |= POLLIN | POLLRDNORM; |
760 |
+ |
761 |
+- return EPOLLOUT | EPOLLWRNORM; |
762 |
++ return mask; |
763 |
+ } |
764 |
+ |
765 |
+ static const struct file_operations uhid_fops = { |
766 |
+diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c |
767 |
+index c950aa10d0ae..5abe095901c8 100644 |
768 |
+--- a/drivers/iio/imu/adis16480.c |
769 |
++++ b/drivers/iio/imu/adis16480.c |
770 |
+@@ -372,12 +372,14 @@ static int adis16480_get_calibbias(struct iio_dev *indio_dev, |
771 |
+ case IIO_MAGN: |
772 |
+ case IIO_PRESSURE: |
773 |
+ ret = adis_read_reg_16(&st->adis, reg, &val16); |
774 |
+- *bias = sign_extend32(val16, 15); |
775 |
++ if (ret == 0) |
776 |
++ *bias = sign_extend32(val16, 15); |
777 |
+ break; |
778 |
+ case IIO_ANGL_VEL: |
779 |
+ case IIO_ACCEL: |
780 |
+ ret = adis_read_reg_32(&st->adis, reg, &val32); |
781 |
+- *bias = sign_extend32(val32, 31); |
782 |
++ if (ret == 0) |
783 |
++ *bias = sign_extend32(val32, 31); |
784 |
+ break; |
785 |
+ default: |
786 |
+ ret = -EINVAL; |
787 |
+diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c |
788 |
+index 5d05c38c4ba9..2f037cd59d53 100644 |
789 |
+--- a/drivers/iio/industrialio-buffer.c |
790 |
++++ b/drivers/iio/industrialio-buffer.c |
791 |
+@@ -546,7 +546,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, |
792 |
+ const unsigned long *mask, bool timestamp) |
793 |
+ { |
794 |
+ unsigned bytes = 0; |
795 |
+- int length, i; |
796 |
++ int length, i, largest = 0; |
797 |
+ |
798 |
+ /* How much space will the demuxed element take? */ |
799 |
+ for_each_set_bit(i, mask, |
800 |
+@@ -554,13 +554,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, |
801 |
+ length = iio_storage_bytes_for_si(indio_dev, i); |
802 |
+ bytes = ALIGN(bytes, length); |
803 |
+ bytes += length; |
804 |
++ largest = max(largest, length); |
805 |
+ } |
806 |
+ |
807 |
+ if (timestamp) { |
808 |
+ length = iio_storage_bytes_for_timestamp(indio_dev); |
809 |
+ bytes = ALIGN(bytes, length); |
810 |
+ bytes += length; |
811 |
++ largest = max(largest, length); |
812 |
+ } |
813 |
++ |
814 |
++ bytes = ALIGN(bytes, largest); |
815 |
+ return bytes; |
816 |
+ } |
817 |
+ |
818 |
+diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c |
819 |
+index 6914cc18b4a1..8acf337c3691 100644 |
820 |
+--- a/drivers/infiniband/ulp/srpt/ib_srpt.c |
821 |
++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c |
822 |
+@@ -1234,9 +1234,11 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, |
823 |
+ struct srpt_send_ioctx *ioctx, u64 tag, |
824 |
+ int status) |
825 |
+ { |
826 |
++ struct se_cmd *cmd = &ioctx->cmd; |
827 |
+ struct srp_rsp *srp_rsp; |
828 |
+ const u8 *sense_data; |
829 |
+ int sense_data_len, max_sense_len; |
830 |
++ u32 resid = cmd->residual_count; |
831 |
+ |
832 |
+ /* |
833 |
+ * The lowest bit of all SAM-3 status codes is zero (see also |
834 |
+@@ -1258,6 +1260,28 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, |
835 |
+ srp_rsp->tag = tag; |
836 |
+ srp_rsp->status = status; |
837 |
+ |
838 |
++ if (cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { |
839 |
++ if (cmd->data_direction == DMA_TO_DEVICE) { |
840 |
++ /* residual data from an underflow write */ |
841 |
++ srp_rsp->flags = SRP_RSP_FLAG_DOUNDER; |
842 |
++ srp_rsp->data_out_res_cnt = cpu_to_be32(resid); |
843 |
++ } else if (cmd->data_direction == DMA_FROM_DEVICE) { |
844 |
++ /* residual data from an underflow read */ |
845 |
++ srp_rsp->flags = SRP_RSP_FLAG_DIUNDER; |
846 |
++ srp_rsp->data_in_res_cnt = cpu_to_be32(resid); |
847 |
++ } |
848 |
++ } else if (cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { |
849 |
++ if (cmd->data_direction == DMA_TO_DEVICE) { |
850 |
++ /* residual data from an overflow write */ |
851 |
++ srp_rsp->flags = SRP_RSP_FLAG_DOOVER; |
852 |
++ srp_rsp->data_out_res_cnt = cpu_to_be32(resid); |
853 |
++ } else if (cmd->data_direction == DMA_FROM_DEVICE) { |
854 |
++ /* residual data from an overflow read */ |
855 |
++ srp_rsp->flags = SRP_RSP_FLAG_DIOVER; |
856 |
++ srp_rsp->data_in_res_cnt = cpu_to_be32(resid); |
857 |
++ } |
858 |
++ } |
859 |
++ |
860 |
+ if (sense_data_len) { |
861 |
+ BUILD_BUG_ON(MIN_MAX_RSP_SIZE <= sizeof(*srp_rsp)); |
862 |
+ max_sense_len = ch->max_ti_iu_len - sizeof(*srp_rsp); |
863 |
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c |
864 |
+index 87d3060f8609..71b89e47e952 100644 |
865 |
+--- a/drivers/iommu/iommu.c |
866 |
++++ b/drivers/iommu/iommu.c |
867 |
+@@ -439,6 +439,7 @@ err_put_group: |
868 |
+ mutex_unlock(&group->mutex); |
869 |
+ dev->iommu_group = NULL; |
870 |
+ kobject_put(group->devices_kobj); |
871 |
++ sysfs_remove_link(group->devices_kobj, device->name); |
872 |
+ err_free_name: |
873 |
+ kfree(device->name); |
874 |
+ err_remove_link: |
875 |
+diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c |
876 |
+index b8cf956b577b..771ec28e87cb 100644 |
877 |
+--- a/drivers/md/dm-snap-persistent.c |
878 |
++++ b/drivers/md/dm-snap-persistent.c |
879 |
+@@ -17,7 +17,7 @@ |
880 |
+ #include "dm-bufio.h" |
881 |
+ |
882 |
+ #define DM_MSG_PREFIX "persistent snapshot" |
883 |
+-#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */ |
884 |
++#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */ |
885 |
+ |
886 |
+ #define DM_PREFETCH_CHUNKS 12 |
887 |
+ |
888 |
+diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c |
889 |
+index 258986a2699d..cf745211799f 100644 |
890 |
+--- a/drivers/md/raid0.c |
891 |
++++ b/drivers/md/raid0.c |
892 |
+@@ -82,7 +82,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) |
893 |
+ char b[BDEVNAME_SIZE]; |
894 |
+ char b2[BDEVNAME_SIZE]; |
895 |
+ struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); |
896 |
+- unsigned short blksize = 512; |
897 |
++ unsigned blksize = 512; |
898 |
+ |
899 |
+ *private_conf = ERR_PTR(-ENOMEM); |
900 |
+ if (!conf) |
901 |
+diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c |
902 |
+index e00fa03ddc3e..0c0eec671d49 100644 |
903 |
+--- a/drivers/media/platform/exynos4-is/fimc-isp-video.c |
904 |
++++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c |
905 |
+@@ -316,7 +316,7 @@ static int isp_video_release(struct file *file) |
906 |
+ ivc->streaming = 0; |
907 |
+ } |
908 |
+ |
909 |
+- vb2_fop_release(file); |
910 |
++ _vb2_fop_release(file, NULL); |
911 |
+ |
912 |
+ if (v4l2_fh_is_singular_file(file)) { |
913 |
+ fimc_pipeline_call(&ivc->ve, close); |
914 |
+diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c |
915 |
+index e3735bfcc02f..c5513f55e64e 100644 |
916 |
+--- a/drivers/media/usb/zr364xx/zr364xx.c |
917 |
++++ b/drivers/media/usb/zr364xx/zr364xx.c |
918 |
+@@ -711,7 +711,8 @@ static int zr364xx_vidioc_querycap(struct file *file, void *priv, |
919 |
+ struct zr364xx_camera *cam = video_drvdata(file); |
920 |
+ |
921 |
+ strlcpy(cap->driver, DRIVER_DESC, sizeof(cap->driver)); |
922 |
+- strlcpy(cap->card, cam->udev->product, sizeof(cap->card)); |
923 |
++ if (cam->udev->product) |
924 |
++ strlcpy(cap->card, cam->udev->product, sizeof(cap->card)); |
925 |
+ strlcpy(cap->bus_info, dev_name(&cam->udev->dev), |
926 |
+ sizeof(cap->bus_info)); |
927 |
+ cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | |
928 |
+diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c |
929 |
+index 14cf6dfc3b14..4d837bcad5db 100644 |
930 |
+--- a/drivers/message/fusion/mptctl.c |
931 |
++++ b/drivers/message/fusion/mptctl.c |
932 |
+@@ -100,19 +100,19 @@ struct buflist { |
933 |
+ * Function prototypes. Called from OS entry point mptctl_ioctl. |
934 |
+ * arg contents specific to function. |
935 |
+ */ |
936 |
+-static int mptctl_fw_download(unsigned long arg); |
937 |
+-static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd); |
938 |
+-static int mptctl_gettargetinfo(unsigned long arg); |
939 |
+-static int mptctl_readtest(unsigned long arg); |
940 |
+-static int mptctl_mpt_command(unsigned long arg); |
941 |
+-static int mptctl_eventquery(unsigned long arg); |
942 |
+-static int mptctl_eventenable(unsigned long arg); |
943 |
+-static int mptctl_eventreport(unsigned long arg); |
944 |
+-static int mptctl_replace_fw(unsigned long arg); |
945 |
+- |
946 |
+-static int mptctl_do_reset(unsigned long arg); |
947 |
+-static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); |
948 |
+-static int mptctl_hp_targetinfo(unsigned long arg); |
949 |
++static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg); |
950 |
++static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
951 |
++static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
952 |
++static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg); |
953 |
++static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg); |
954 |
++static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg); |
955 |
++static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg); |
956 |
++static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg); |
957 |
++static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg); |
958 |
++ |
959 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg); |
960 |
++static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); |
961 |
++static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg); |
962 |
+ |
963 |
+ static int mptctl_probe(struct pci_dev *, const struct pci_device_id *); |
964 |
+ static void mptctl_remove(struct pci_dev *); |
965 |
+@@ -123,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg); |
966 |
+ /* |
967 |
+ * Private function calls. |
968 |
+ */ |
969 |
+-static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr); |
970 |
+-static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); |
971 |
++static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr); |
972 |
++static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen); |
973 |
+ static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags, |
974 |
+ struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); |
975 |
+ static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, |
976 |
+@@ -656,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
977 |
+ * by TM and FW reloads. |
978 |
+ */ |
979 |
+ if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) { |
980 |
+- return mptctl_getiocinfo(arg, _IOC_SIZE(cmd)); |
981 |
++ return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); |
982 |
+ } else if (cmd == MPTTARGETINFO) { |
983 |
+- return mptctl_gettargetinfo(arg); |
984 |
++ return mptctl_gettargetinfo(iocp, arg); |
985 |
+ } else if (cmd == MPTTEST) { |
986 |
+- return mptctl_readtest(arg); |
987 |
++ return mptctl_readtest(iocp, arg); |
988 |
+ } else if (cmd == MPTEVENTQUERY) { |
989 |
+- return mptctl_eventquery(arg); |
990 |
++ return mptctl_eventquery(iocp, arg); |
991 |
+ } else if (cmd == MPTEVENTENABLE) { |
992 |
+- return mptctl_eventenable(arg); |
993 |
++ return mptctl_eventenable(iocp, arg); |
994 |
+ } else if (cmd == MPTEVENTREPORT) { |
995 |
+- return mptctl_eventreport(arg); |
996 |
++ return mptctl_eventreport(iocp, arg); |
997 |
+ } else if (cmd == MPTFWREPLACE) { |
998 |
+- return mptctl_replace_fw(arg); |
999 |
++ return mptctl_replace_fw(iocp, arg); |
1000 |
+ } |
1001 |
+ |
1002 |
+ /* All of these commands require an interrupt or |
1003 |
+@@ -678,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
1004 |
+ return ret; |
1005 |
+ |
1006 |
+ if (cmd == MPTFWDOWNLOAD) |
1007 |
+- ret = mptctl_fw_download(arg); |
1008 |
++ ret = mptctl_fw_download(iocp, arg); |
1009 |
+ else if (cmd == MPTCOMMAND) |
1010 |
+- ret = mptctl_mpt_command(arg); |
1011 |
++ ret = mptctl_mpt_command(iocp, arg); |
1012 |
+ else if (cmd == MPTHARDRESET) |
1013 |
+- ret = mptctl_do_reset(arg); |
1014 |
++ ret = mptctl_do_reset(iocp, arg); |
1015 |
+ else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK)) |
1016 |
+- ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd)); |
1017 |
++ ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); |
1018 |
+ else if (cmd == HP_GETTARGETINFO) |
1019 |
+- ret = mptctl_hp_targetinfo(arg); |
1020 |
++ ret = mptctl_hp_targetinfo(iocp, arg); |
1021 |
+ else |
1022 |
+ ret = -EINVAL; |
1023 |
+ |
1024 |
+@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
1025 |
+ return ret; |
1026 |
+ } |
1027 |
+ |
1028 |
+-static int mptctl_do_reset(unsigned long arg) |
1029 |
++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) |
1030 |
+ { |
1031 |
+ struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg; |
1032 |
+ struct mpt_ioctl_diag_reset krinfo; |
1033 |
+- MPT_ADAPTER *iocp; |
1034 |
+ |
1035 |
+ if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { |
1036 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - " |
1037 |
+@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) |
1038 |
+ return -EFAULT; |
1039 |
+ } |
1040 |
+ |
1041 |
+- if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { |
1042 |
+- printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n", |
1043 |
+- __FILE__, __LINE__, krinfo.hdr.iocnum); |
1044 |
+- return -ENODEV; /* (-6) No such device or address */ |
1045 |
+- } |
1046 |
+- |
1047 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", |
1048 |
+ iocp->name)); |
1049 |
+ |
1050 |
+@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) |
1051 |
+ * -ENOMSG if FW upload returned bad status |
1052 |
+ */ |
1053 |
+ static int |
1054 |
+-mptctl_fw_download(unsigned long arg) |
1055 |
++mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) |
1056 |
+ { |
1057 |
+ struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; |
1058 |
+ struct mpt_fw_xfer kfwdl; |
1059 |
+@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) |
1060 |
+ return -EFAULT; |
1061 |
+ } |
1062 |
+ |
1063 |
+- return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); |
1064 |
++ return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); |
1065 |
+ } |
1066 |
+ |
1067 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1068 |
+@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) |
1069 |
+ * -ENOMSG if FW upload returned bad status |
1070 |
+ */ |
1071 |
+ static int |
1072 |
+-mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
1073 |
++mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) |
1074 |
+ { |
1075 |
+ FWDownload_t *dlmsg; |
1076 |
+ MPT_FRAME_HDR *mf; |
1077 |
+- MPT_ADAPTER *iocp; |
1078 |
+ FWDownloadTCSGE_t *ptsge; |
1079 |
+ MptSge_t *sgl, *sgIn; |
1080 |
+ char *sgOut; |
1081 |
+@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
1082 |
+ pFWDownloadReply_t ReplyMsg = NULL; |
1083 |
+ unsigned long timeleft; |
1084 |
+ |
1085 |
+- if (mpt_verify_adapter(ioc, &iocp) < 0) { |
1086 |
+- printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", |
1087 |
+- ioc); |
1088 |
+- return -ENODEV; /* (-6) No such device or address */ |
1089 |
+- } else { |
1090 |
+- |
1091 |
+- /* Valid device. Get a message frame and construct the FW download message. |
1092 |
+- */ |
1093 |
+- if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
1094 |
+- return -EAGAIN; |
1095 |
+- } |
1096 |
++ /* Valid device. Get a message frame and construct the FW download message. |
1097 |
++ */ |
1098 |
++ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
1099 |
++ return -EAGAIN; |
1100 |
+ |
1101 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT |
1102 |
+ "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); |
1103 |
+@@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) |
1104 |
+ iocp->name, ufwbuf)); |
1105 |
+ dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", |
1106 |
+ iocp->name, (int)fwlen)); |
1107 |
+- dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", |
1108 |
+- iocp->name, ioc)); |
1109 |
+ |
1110 |
+ dlmsg = (FWDownload_t*) mf; |
1111 |
+ ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; |
1112 |
+@@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE |
1113 |
+ * -ENODEV if no such device/adapter |
1114 |
+ */ |
1115 |
+ static int |
1116 |
+-mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
1117 |
++mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
1118 |
+ { |
1119 |
+ struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; |
1120 |
+ struct mpt_ioctl_iocinfo *karg; |
1121 |
+- MPT_ADAPTER *ioc; |
1122 |
+ struct pci_dev *pdev; |
1123 |
+- int iocnum; |
1124 |
+ unsigned int port; |
1125 |
+ int cim_rev; |
1126 |
+ struct scsi_device *sdev; |
1127 |
+@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
1128 |
+ return PTR_ERR(karg); |
1129 |
+ } |
1130 |
+ |
1131 |
+- if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || |
1132 |
+- (ioc == NULL)) { |
1133 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", |
1134 |
+- __FILE__, __LINE__, iocnum); |
1135 |
+- kfree(karg); |
1136 |
+- return -ENODEV; |
1137 |
+- } |
1138 |
+- |
1139 |
+ /* Verify the data transfer size is correct. */ |
1140 |
+ if (karg->hdr.maxDataSize != data_size) { |
1141 |
+ printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " |
1142 |
+@@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) |
1143 |
+ * -ENODEV if no such device/adapter |
1144 |
+ */ |
1145 |
+ static int |
1146 |
+-mptctl_gettargetinfo (unsigned long arg) |
1147 |
++mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg) |
1148 |
+ { |
1149 |
+ struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; |
1150 |
+ struct mpt_ioctl_targetinfo karg; |
1151 |
+- MPT_ADAPTER *ioc; |
1152 |
+ VirtDevice *vdevice; |
1153 |
+ char *pmem; |
1154 |
+ int *pdata; |
1155 |
+- int iocnum; |
1156 |
+ int numDevices = 0; |
1157 |
+ int lun; |
1158 |
+ int maxWordsLeft; |
1159 |
+@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) |
1160 |
+ return -EFAULT; |
1161 |
+ } |
1162 |
+ |
1163 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1164 |
+- (ioc == NULL)) { |
1165 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", |
1166 |
+- __FILE__, __LINE__, iocnum); |
1167 |
+- return -ENODEV; |
1168 |
+- } |
1169 |
+- |
1170 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", |
1171 |
+ ioc->name)); |
1172 |
+ /* Get the port number and set the maximum number of bytes |
1173 |
+@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) |
1174 |
+ * -ENODEV if no such device/adapter |
1175 |
+ */ |
1176 |
+ static int |
1177 |
+-mptctl_readtest (unsigned long arg) |
1178 |
++mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg) |
1179 |
+ { |
1180 |
+ struct mpt_ioctl_test __user *uarg = (void __user *) arg; |
1181 |
+ struct mpt_ioctl_test karg; |
1182 |
+- MPT_ADAPTER *ioc; |
1183 |
+- int iocnum; |
1184 |
+ |
1185 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { |
1186 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " |
1187 |
+@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) |
1188 |
+ return -EFAULT; |
1189 |
+ } |
1190 |
+ |
1191 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1192 |
+- (ioc == NULL)) { |
1193 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", |
1194 |
+- __FILE__, __LINE__, iocnum); |
1195 |
+- return -ENODEV; |
1196 |
+- } |
1197 |
+- |
1198 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", |
1199 |
+ ioc->name)); |
1200 |
+ /* Fill in the data and return the structure to the calling |
1201 |
+@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) |
1202 |
+ * -ENODEV if no such device/adapter |
1203 |
+ */ |
1204 |
+ static int |
1205 |
+-mptctl_eventquery (unsigned long arg) |
1206 |
++mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg) |
1207 |
+ { |
1208 |
+ struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; |
1209 |
+ struct mpt_ioctl_eventquery karg; |
1210 |
+- MPT_ADAPTER *ioc; |
1211 |
+- int iocnum; |
1212 |
+ |
1213 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { |
1214 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " |
1215 |
+@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) |
1216 |
+ return -EFAULT; |
1217 |
+ } |
1218 |
+ |
1219 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1220 |
+- (ioc == NULL)) { |
1221 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", |
1222 |
+- __FILE__, __LINE__, iocnum); |
1223 |
+- return -ENODEV; |
1224 |
+- } |
1225 |
+- |
1226 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", |
1227 |
+ ioc->name)); |
1228 |
+ karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; |
1229 |
+@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) |
1230 |
+ |
1231 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1232 |
+ static int |
1233 |
+-mptctl_eventenable (unsigned long arg) |
1234 |
++mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg) |
1235 |
+ { |
1236 |
+ struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; |
1237 |
+ struct mpt_ioctl_eventenable karg; |
1238 |
+- MPT_ADAPTER *ioc; |
1239 |
+- int iocnum; |
1240 |
+ |
1241 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { |
1242 |
+ printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " |
1243 |
+@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) |
1244 |
+ return -EFAULT; |
1245 |
+ } |
1246 |
+ |
1247 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1248 |
+- (ioc == NULL)) { |
1249 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", |
1250 |
+- __FILE__, __LINE__, iocnum); |
1251 |
+- return -ENODEV; |
1252 |
+- } |
1253 |
+- |
1254 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", |
1255 |
+ ioc->name)); |
1256 |
+ if (ioc->events == NULL) { |
1257 |
+@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) |
1258 |
+ |
1259 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1260 |
+ static int |
1261 |
+-mptctl_eventreport (unsigned long arg) |
1262 |
++mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg) |
1263 |
+ { |
1264 |
+ struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; |
1265 |
+ struct mpt_ioctl_eventreport karg; |
1266 |
+- MPT_ADAPTER *ioc; |
1267 |
+- int iocnum; |
1268 |
+ int numBytes, maxEvents, max; |
1269 |
+ |
1270 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { |
1271 |
+@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) |
1272 |
+ return -EFAULT; |
1273 |
+ } |
1274 |
+ |
1275 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1276 |
+- (ioc == NULL)) { |
1277 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", |
1278 |
+- __FILE__, __LINE__, iocnum); |
1279 |
+- return -ENODEV; |
1280 |
+- } |
1281 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", |
1282 |
+ ioc->name)); |
1283 |
+ |
1284 |
+@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) |
1285 |
+ |
1286 |
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1287 |
+ static int |
1288 |
+-mptctl_replace_fw (unsigned long arg) |
1289 |
++mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg) |
1290 |
+ { |
1291 |
+ struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; |
1292 |
+ struct mpt_ioctl_replace_fw karg; |
1293 |
+- MPT_ADAPTER *ioc; |
1294 |
+- int iocnum; |
1295 |
+ int newFwSize; |
1296 |
+ |
1297 |
+ if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { |
1298 |
+@@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg) |
1299 |
+ return -EFAULT; |
1300 |
+ } |
1301 |
+ |
1302 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1303 |
+- (ioc == NULL)) { |
1304 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", |
1305 |
+- __FILE__, __LINE__, iocnum); |
1306 |
+- return -ENODEV; |
1307 |
+- } |
1308 |
+- |
1309 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", |
1310 |
+ ioc->name)); |
1311 |
+ /* If caching FW, Free the old FW image |
1312 |
+@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) |
1313 |
+ * -ENOMEM if memory allocation error |
1314 |
+ */ |
1315 |
+ static int |
1316 |
+-mptctl_mpt_command (unsigned long arg) |
1317 |
++mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg) |
1318 |
+ { |
1319 |
+ struct mpt_ioctl_command __user *uarg = (void __user *) arg; |
1320 |
+ struct mpt_ioctl_command karg; |
1321 |
+- MPT_ADAPTER *ioc; |
1322 |
+- int iocnum; |
1323 |
+ int rc; |
1324 |
+ |
1325 |
+ |
1326 |
+@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) |
1327 |
+ return -EFAULT; |
1328 |
+ } |
1329 |
+ |
1330 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1331 |
+- (ioc == NULL)) { |
1332 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", |
1333 |
+- __FILE__, __LINE__, iocnum); |
1334 |
+- return -ENODEV; |
1335 |
+- } |
1336 |
+- |
1337 |
+- rc = mptctl_do_mpt_command (karg, &uarg->MF); |
1338 |
++ rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); |
1339 |
+ |
1340 |
+ return rc; |
1341 |
+ } |
1342 |
+@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) |
1343 |
+ * -EPERM if SCSI I/O and target is untagged |
1344 |
+ */ |
1345 |
+ static int |
1346 |
+-mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
1347 |
++mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) |
1348 |
+ { |
1349 |
+- MPT_ADAPTER *ioc; |
1350 |
+ MPT_FRAME_HDR *mf = NULL; |
1351 |
+ MPIHeader_t *hdr; |
1352 |
+ char *psge; |
1353 |
+@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
1354 |
+ dma_addr_t dma_addr_in; |
1355 |
+ dma_addr_t dma_addr_out; |
1356 |
+ int sgSize = 0; /* Num SG elements */ |
1357 |
+- int iocnum, flagsLength; |
1358 |
++ int flagsLength; |
1359 |
+ int sz, rc = 0; |
1360 |
+ int msgContext; |
1361 |
+ u16 req_idx; |
1362 |
+@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) |
1363 |
+ bufIn.kptr = bufOut.kptr = NULL; |
1364 |
+ bufIn.len = bufOut.len = 0; |
1365 |
+ |
1366 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1367 |
+- (ioc == NULL)) { |
1368 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", |
1369 |
+- __FILE__, __LINE__, iocnum); |
1370 |
+- return -ENODEV; |
1371 |
+- } |
1372 |
+- |
1373 |
+ spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
1374 |
+ if (ioc->ioc_reset_in_progress) { |
1375 |
+ spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
1376 |
+@@ -2418,17 +2321,15 @@ done_free_mem: |
1377 |
+ * -ENOMEM if memory allocation error |
1378 |
+ */ |
1379 |
+ static int |
1380 |
+-mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
1381 |
++mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) |
1382 |
+ { |
1383 |
+ hp_host_info_t __user *uarg = (void __user *) arg; |
1384 |
+- MPT_ADAPTER *ioc; |
1385 |
+ struct pci_dev *pdev; |
1386 |
+ char *pbuf=NULL; |
1387 |
+ dma_addr_t buf_dma; |
1388 |
+ hp_host_info_t karg; |
1389 |
+ CONFIGPARMS cfg; |
1390 |
+ ConfigPageHeader_t hdr; |
1391 |
+- int iocnum; |
1392 |
+ int rc, cim_rev; |
1393 |
+ ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; |
1394 |
+ MPT_FRAME_HDR *mf = NULL; |
1395 |
+@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) |
1396 |
+ return -EFAULT; |
1397 |
+ } |
1398 |
+ |
1399 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1400 |
+- (ioc == NULL)) { |
1401 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", |
1402 |
+- __FILE__, __LINE__, iocnum); |
1403 |
+- return -ENODEV; |
1404 |
+- } |
1405 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", |
1406 |
+ ioc->name)); |
1407 |
+ |
1408 |
+@@ -2670,15 +2565,13 @@ retry_wait: |
1409 |
+ * -ENOMEM if memory allocation error |
1410 |
+ */ |
1411 |
+ static int |
1412 |
+-mptctl_hp_targetinfo(unsigned long arg) |
1413 |
++mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) |
1414 |
+ { |
1415 |
+ hp_target_info_t __user *uarg = (void __user *) arg; |
1416 |
+ SCSIDevicePage0_t *pg0_alloc; |
1417 |
+ SCSIDevicePage3_t *pg3_alloc; |
1418 |
+- MPT_ADAPTER *ioc; |
1419 |
+ MPT_SCSI_HOST *hd = NULL; |
1420 |
+ hp_target_info_t karg; |
1421 |
+- int iocnum; |
1422 |
+ int data_sz; |
1423 |
+ dma_addr_t page_dma; |
1424 |
+ CONFIGPARMS cfg; |
1425 |
+@@ -2692,12 +2585,6 @@ mptctl_hp_targetinfo(unsigned long arg) |
1426 |
+ return -EFAULT; |
1427 |
+ } |
1428 |
+ |
1429 |
+- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || |
1430 |
+- (ioc == NULL)) { |
1431 |
+- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", |
1432 |
+- __FILE__, __LINE__, iocnum); |
1433 |
+- return -ENODEV; |
1434 |
+- } |
1435 |
+ if (karg.hdr.id >= MPT_MAX_FC_DEVICES) |
1436 |
+ return -EINVAL; |
1437 |
+ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", |
1438 |
+@@ -2865,7 +2752,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, |
1439 |
+ kfw.fwlen = kfw32.fwlen; |
1440 |
+ kfw.bufp = compat_ptr(kfw32.bufp); |
1441 |
+ |
1442 |
+- ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); |
1443 |
++ ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); |
1444 |
+ |
1445 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
1446 |
+ |
1447 |
+@@ -2919,7 +2806,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, |
1448 |
+ |
1449 |
+ /* Pass new structure to do_mpt_command |
1450 |
+ */ |
1451 |
+- ret = mptctl_do_mpt_command (karg, &uarg->MF); |
1452 |
++ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); |
1453 |
+ |
1454 |
+ mutex_unlock(&iocp->ioctl_cmds.mutex); |
1455 |
+ |
1456 |
+diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c |
1457 |
+index eb29113e0bac..b11737f7bdca 100644 |
1458 |
+--- a/drivers/misc/enclosure.c |
1459 |
++++ b/drivers/misc/enclosure.c |
1460 |
+@@ -419,10 +419,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) |
1461 |
+ cdev = &edev->component[i]; |
1462 |
+ if (cdev->dev == dev) { |
1463 |
+ enclosure_remove_links(cdev); |
1464 |
+- device_del(&cdev->cdev); |
1465 |
+ put_device(dev); |
1466 |
+ cdev->dev = NULL; |
1467 |
+- return device_add(&cdev->cdev); |
1468 |
++ return 0; |
1469 |
+ } |
1470 |
+ } |
1471 |
+ return -ENODEV; |
1472 |
+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c |
1473 |
+index c42523b7d5ed..63a9b53a65ed 100644 |
1474 |
+--- a/drivers/mtd/spi-nor/spi-nor.c |
1475 |
++++ b/drivers/mtd/spi-nor/spi-nor.c |
1476 |
+@@ -1046,7 +1046,7 @@ static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len, |
1477 |
+ size_t *retlen, u_char *buf) |
1478 |
+ { |
1479 |
+ struct spi_nor *nor = mtd_to_spi_nor(mtd); |
1480 |
+- int ret; |
1481 |
++ ssize_t ret; |
1482 |
+ |
1483 |
+ dev_dbg(nor->dev, "from 0x%08x, len %zd\n", (u32)from, len); |
1484 |
+ |
1485 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h |
1486 |
+index e11920d12774..27c49d400bcd 100644 |
1487 |
+--- a/drivers/net/ethernet/stmicro/stmmac/common.h |
1488 |
++++ b/drivers/net/ethernet/stmicro/stmmac/common.h |
1489 |
+@@ -326,8 +326,8 @@ struct dma_features { |
1490 |
+ unsigned int enh_desc; |
1491 |
+ }; |
1492 |
+ |
1493 |
+-/* GMAC TX FIFO is 8K, Rx FIFO is 16K */ |
1494 |
+-#define BUF_SIZE_16KiB 16384 |
1495 |
++/* RX Buffer size must be multiple of 4/8/16 bytes */ |
1496 |
++#define BUF_SIZE_16KiB 16368 |
1497 |
+ #define BUF_SIZE_8KiB 8192 |
1498 |
+ #define BUF_SIZE_4KiB 4096 |
1499 |
+ #define BUF_SIZE_2KiB 2048 |
1500 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1501 |
+index a2b7c685cbf1..8c1a5361f661 100644 |
1502 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1503 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1504 |
+@@ -929,7 +929,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize) |
1505 |
+ { |
1506 |
+ int ret = bufsize; |
1507 |
+ |
1508 |
+- if (mtu >= BUF_SIZE_4KiB) |
1509 |
++ if (mtu >= BUF_SIZE_8KiB) |
1510 |
++ ret = BUF_SIZE_16KiB; |
1511 |
++ else if (mtu >= BUF_SIZE_4KiB) |
1512 |
+ ret = BUF_SIZE_8KiB; |
1513 |
+ else if (mtu >= BUF_SIZE_2KiB) |
1514 |
+ ret = BUF_SIZE_4KiB; |
1515 |
+diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c |
1516 |
+index 854947b9db4e..e2b3d3c4d4df 100644 |
1517 |
+--- a/drivers/net/macvlan.c |
1518 |
++++ b/drivers/net/macvlan.c |
1519 |
+@@ -234,7 +234,7 @@ static void macvlan_broadcast(struct sk_buff *skb, |
1520 |
+ struct net_device *src, |
1521 |
+ enum macvlan_mode mode) |
1522 |
+ { |
1523 |
+- const struct ethhdr *eth = skb_eth_hdr(skb); |
1524 |
++ const struct ethhdr *eth = eth_hdr(skb); |
1525 |
+ const struct macvlan_dev *vlan; |
1526 |
+ struct sk_buff *nskb; |
1527 |
+ unsigned int i; |
1528 |
+@@ -487,10 +487,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) |
1529 |
+ const struct macvlan_dev *dest; |
1530 |
+ |
1531 |
+ if (vlan->mode == MACVLAN_MODE_BRIDGE) { |
1532 |
+- const struct ethhdr *eth = (void *)skb->data; |
1533 |
++ const struct ethhdr *eth = skb_eth_hdr(skb); |
1534 |
+ |
1535 |
+ /* send to other bridge ports directly */ |
1536 |
+ if (is_multicast_ether_addr(eth->h_dest)) { |
1537 |
++ skb_reset_mac_header(skb); |
1538 |
+ macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); |
1539 |
+ goto xmit_world; |
1540 |
+ } |
1541 |
+diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c |
1542 |
+index 8045cc401009..473dd79e167b 100644 |
1543 |
+--- a/drivers/net/usb/lan78xx.c |
1544 |
++++ b/drivers/net/usb/lan78xx.c |
1545 |
+@@ -3375,6 +3375,7 @@ static int lan78xx_probe(struct usb_interface *intf, |
1546 |
+ |
1547 |
+ if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len)) |
1548 |
+ netdev->mtu = dev->hard_mtu - netdev->hard_header_len; |
1549 |
++ netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); |
1550 |
+ |
1551 |
+ dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; |
1552 |
+ dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1; |
1553 |
+diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c |
1554 |
+index 15dc70c11857..3c037b76a0cc 100644 |
1555 |
+--- a/drivers/net/usb/r8152.c |
1556 |
++++ b/drivers/net/usb/r8152.c |
1557 |
+@@ -4365,6 +4365,9 @@ static int rtl8152_probe(struct usb_interface *intf, |
1558 |
+ return -ENODEV; |
1559 |
+ } |
1560 |
+ |
1561 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 3) |
1562 |
++ return -ENODEV; |
1563 |
++ |
1564 |
+ usb_reset_device(udev); |
1565 |
+ netdev = alloc_etherdev(sizeof(struct r8152)); |
1566 |
+ if (!netdev) { |
1567 |
+diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c |
1568 |
+index b2c1e872d5ed..af85a1b3135e 100644 |
1569 |
+--- a/drivers/net/wan/fsl_ucc_hdlc.c |
1570 |
++++ b/drivers/net/wan/fsl_ucc_hdlc.c |
1571 |
+@@ -77,7 +77,7 @@ static struct ucc_tdm_info utdm_primary_info = { |
1572 |
+ }, |
1573 |
+ }; |
1574 |
+ |
1575 |
+-static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM]; |
1576 |
++static struct ucc_tdm_info utdm_info[UCC_MAX_NUM]; |
1577 |
+ |
1578 |
+ static int uhdlc_init(struct ucc_hdlc_private *priv) |
1579 |
+ { |
1580 |
+diff --git a/drivers/net/wimax/i2400m/op-rfkill.c b/drivers/net/wimax/i2400m/op-rfkill.c |
1581 |
+index b0dba35a8ad2..dc6fe93ce71f 100644 |
1582 |
+--- a/drivers/net/wimax/i2400m/op-rfkill.c |
1583 |
++++ b/drivers/net/wimax/i2400m/op-rfkill.c |
1584 |
+@@ -147,6 +147,7 @@ error_msg_to_dev: |
1585 |
+ error_alloc: |
1586 |
+ d_fnend(4, dev, "(wimax_dev %p state %d) = %d\n", |
1587 |
+ wimax_dev, state, result); |
1588 |
++ kfree(cmd); |
1589 |
+ return result; |
1590 |
+ } |
1591 |
+ |
1592 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/regd.c b/drivers/net/wireless/realtek/rtlwifi/regd.c |
1593 |
+index 6ee6bf8e7eaf..ab53cf42cf42 100644 |
1594 |
+--- a/drivers/net/wireless/realtek/rtlwifi/regd.c |
1595 |
++++ b/drivers/net/wireless/realtek/rtlwifi/regd.c |
1596 |
+@@ -427,7 +427,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, |
1597 |
+ struct wiphy *wiphy = hw->wiphy; |
1598 |
+ struct country_code_to_enum_rd *country = NULL; |
1599 |
+ |
1600 |
+- if (wiphy == NULL || &rtlpriv->regd == NULL) |
1601 |
++ if (!wiphy) |
1602 |
+ return -EINVAL; |
1603 |
+ |
1604 |
+ /* init country_code from efuse channel plan */ |
1605 |
+diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1606 |
+index dbb23899ddcb..891295ebd875 100644 |
1607 |
+--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1608 |
++++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c |
1609 |
+@@ -199,6 +199,7 @@ void rsi_mac80211_detach(struct rsi_hw *adapter) |
1610 |
+ ieee80211_stop_queues(hw); |
1611 |
+ ieee80211_unregister_hw(hw); |
1612 |
+ ieee80211_free_hw(hw); |
1613 |
++ adapter->hw = NULL; |
1614 |
+ } |
1615 |
+ |
1616 |
+ rsi_remove_dbgfs(adapter); |
1617 |
+diff --git a/drivers/net/wireless/st/cw1200/fwio.c b/drivers/net/wireless/st/cw1200/fwio.c |
1618 |
+index 30e7646d04af..16be7fa82a23 100644 |
1619 |
+--- a/drivers/net/wireless/st/cw1200/fwio.c |
1620 |
++++ b/drivers/net/wireless/st/cw1200/fwio.c |
1621 |
+@@ -323,12 +323,12 @@ int cw1200_load_firmware(struct cw1200_common *priv) |
1622 |
+ goto out; |
1623 |
+ } |
1624 |
+ |
1625 |
+- priv->hw_type = cw1200_get_hw_type(val32, &major_revision); |
1626 |
+- if (priv->hw_type < 0) { |
1627 |
++ ret = cw1200_get_hw_type(val32, &major_revision); |
1628 |
++ if (ret < 0) { |
1629 |
+ pr_err("Can't deduce hardware type.\n"); |
1630 |
+- ret = -ENOTSUPP; |
1631 |
+ goto out; |
1632 |
+ } |
1633 |
++ priv->hw_type = ret; |
1634 |
+ |
1635 |
+ /* Set DPLL Reg value, and read back to confirm writes work */ |
1636 |
+ ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID, |
1637 |
+diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c |
1638 |
+index bab8ac63c4f3..3008bba360f3 100644 |
1639 |
+--- a/drivers/pci/pcie/ptm.c |
1640 |
++++ b/drivers/pci/pcie/ptm.c |
1641 |
+@@ -29,7 +29,7 @@ static void pci_ptm_info(struct pci_dev *dev) |
1642 |
+ snprintf(clock_desc, sizeof(clock_desc), ">254ns"); |
1643 |
+ break; |
1644 |
+ default: |
1645 |
+- snprintf(clock_desc, sizeof(clock_desc), "%udns", |
1646 |
++ snprintf(clock_desc, sizeof(clock_desc), "%uns", |
1647 |
+ dev->ptm_granularity); |
1648 |
+ break; |
1649 |
+ } |
1650 |
+diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c |
1651 |
+index aede41a92cac..4ae758c3d8ba 100644 |
1652 |
+--- a/drivers/platform/x86/asus-wmi.c |
1653 |
++++ b/drivers/platform/x86/asus-wmi.c |
1654 |
+@@ -461,13 +461,7 @@ static void kbd_led_update(struct work_struct *work) |
1655 |
+ |
1656 |
+ asus = container_of(work, struct asus_wmi, kbd_led_work); |
1657 |
+ |
1658 |
+- /* |
1659 |
+- * bits 0-2: level |
1660 |
+- * bit 7: light on/off |
1661 |
+- */ |
1662 |
+- if (asus->kbd_led_wk > 0) |
1663 |
+- ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); |
1664 |
+- |
1665 |
++ ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); |
1666 |
+ asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL); |
1667 |
+ } |
1668 |
+ |
1669 |
+diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c |
1670 |
+index c1c5c4e3b3b4..c981301efbe5 100644 |
1671 |
+--- a/drivers/rtc/rtc-msm6242.c |
1672 |
++++ b/drivers/rtc/rtc-msm6242.c |
1673 |
+@@ -132,7 +132,8 @@ static int msm6242_read_time(struct device *dev, struct rtc_time *tm) |
1674 |
+ msm6242_read(priv, MSM6242_SECOND1); |
1675 |
+ tm->tm_min = msm6242_read(priv, MSM6242_MINUTE10) * 10 + |
1676 |
+ msm6242_read(priv, MSM6242_MINUTE1); |
1677 |
+- tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10 & 3)) * 10 + |
1678 |
++ tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10) & |
1679 |
++ MSM6242_HOUR10_HR_MASK) * 10 + |
1680 |
+ msm6242_read(priv, MSM6242_HOUR1); |
1681 |
+ tm->tm_mday = msm6242_read(priv, MSM6242_DAY10) * 10 + |
1682 |
+ msm6242_read(priv, MSM6242_DAY1); |
1683 |
+diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c |
1684 |
+index 1a61fa56f3ad..494a7fbd512b 100644 |
1685 |
+--- a/drivers/rtc/rtc-mt6397.c |
1686 |
++++ b/drivers/rtc/rtc-mt6397.c |
1687 |
+@@ -55,6 +55,14 @@ |
1688 |
+ |
1689 |
+ #define RTC_AL_SEC 0x0018 |
1690 |
+ |
1691 |
++#define RTC_AL_SEC_MASK 0x003f |
1692 |
++#define RTC_AL_MIN_MASK 0x003f |
1693 |
++#define RTC_AL_HOU_MASK 0x001f |
1694 |
++#define RTC_AL_DOM_MASK 0x001f |
1695 |
++#define RTC_AL_DOW_MASK 0x0007 |
1696 |
++#define RTC_AL_MTH_MASK 0x000f |
1697 |
++#define RTC_AL_YEA_MASK 0x007f |
1698 |
++ |
1699 |
+ #define RTC_PDN2 0x002e |
1700 |
+ #define RTC_PDN2_PWRON_ALARM BIT(4) |
1701 |
+ |
1702 |
+@@ -111,7 +119,7 @@ static irqreturn_t mtk_rtc_irq_handler_thread(int irq, void *data) |
1703 |
+ irqen = irqsta & ~RTC_IRQ_EN_AL; |
1704 |
+ mutex_lock(&rtc->lock); |
1705 |
+ if (regmap_write(rtc->regmap, rtc->addr_base + RTC_IRQ_EN, |
1706 |
+- irqen) < 0) |
1707 |
++ irqen) == 0) |
1708 |
+ mtk_rtc_write_trigger(rtc); |
1709 |
+ mutex_unlock(&rtc->lock); |
1710 |
+ |
1711 |
+@@ -233,12 +241,12 @@ static int mtk_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) |
1712 |
+ alm->pending = !!(pdn2 & RTC_PDN2_PWRON_ALARM); |
1713 |
+ mutex_unlock(&rtc->lock); |
1714 |
+ |
1715 |
+- tm->tm_sec = data[RTC_OFFSET_SEC]; |
1716 |
+- tm->tm_min = data[RTC_OFFSET_MIN]; |
1717 |
+- tm->tm_hour = data[RTC_OFFSET_HOUR]; |
1718 |
+- tm->tm_mday = data[RTC_OFFSET_DOM]; |
1719 |
+- tm->tm_mon = data[RTC_OFFSET_MTH]; |
1720 |
+- tm->tm_year = data[RTC_OFFSET_YEAR]; |
1721 |
++ tm->tm_sec = data[RTC_OFFSET_SEC] & RTC_AL_SEC_MASK; |
1722 |
++ tm->tm_min = data[RTC_OFFSET_MIN] & RTC_AL_MIN_MASK; |
1723 |
++ tm->tm_hour = data[RTC_OFFSET_HOUR] & RTC_AL_HOU_MASK; |
1724 |
++ tm->tm_mday = data[RTC_OFFSET_DOM] & RTC_AL_DOM_MASK; |
1725 |
++ tm->tm_mon = data[RTC_OFFSET_MTH] & RTC_AL_MTH_MASK; |
1726 |
++ tm->tm_year = data[RTC_OFFSET_YEAR] & RTC_AL_YEA_MASK; |
1727 |
+ |
1728 |
+ tm->tm_year += RTC_MIN_YEAR_OFFSET; |
1729 |
+ tm->tm_mon--; |
1730 |
+@@ -259,14 +267,25 @@ static int mtk_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) |
1731 |
+ tm->tm_year -= RTC_MIN_YEAR_OFFSET; |
1732 |
+ tm->tm_mon++; |
1733 |
+ |
1734 |
+- data[RTC_OFFSET_SEC] = tm->tm_sec; |
1735 |
+- data[RTC_OFFSET_MIN] = tm->tm_min; |
1736 |
+- data[RTC_OFFSET_HOUR] = tm->tm_hour; |
1737 |
+- data[RTC_OFFSET_DOM] = tm->tm_mday; |
1738 |
+- data[RTC_OFFSET_MTH] = tm->tm_mon; |
1739 |
+- data[RTC_OFFSET_YEAR] = tm->tm_year; |
1740 |
+- |
1741 |
+ mutex_lock(&rtc->lock); |
1742 |
++ ret = regmap_bulk_read(rtc->regmap, rtc->addr_base + RTC_AL_SEC, |
1743 |
++ data, RTC_OFFSET_COUNT); |
1744 |
++ if (ret < 0) |
1745 |
++ goto exit; |
1746 |
++ |
1747 |
++ data[RTC_OFFSET_SEC] = ((data[RTC_OFFSET_SEC] & ~(RTC_AL_SEC_MASK)) | |
1748 |
++ (tm->tm_sec & RTC_AL_SEC_MASK)); |
1749 |
++ data[RTC_OFFSET_MIN] = ((data[RTC_OFFSET_MIN] & ~(RTC_AL_MIN_MASK)) | |
1750 |
++ (tm->tm_min & RTC_AL_MIN_MASK)); |
1751 |
++ data[RTC_OFFSET_HOUR] = ((data[RTC_OFFSET_HOUR] & ~(RTC_AL_HOU_MASK)) | |
1752 |
++ (tm->tm_hour & RTC_AL_HOU_MASK)); |
1753 |
++ data[RTC_OFFSET_DOM] = ((data[RTC_OFFSET_DOM] & ~(RTC_AL_DOM_MASK)) | |
1754 |
++ (tm->tm_mday & RTC_AL_DOM_MASK)); |
1755 |
++ data[RTC_OFFSET_MTH] = ((data[RTC_OFFSET_MTH] & ~(RTC_AL_MTH_MASK)) | |
1756 |
++ (tm->tm_mon & RTC_AL_MTH_MASK)); |
1757 |
++ data[RTC_OFFSET_YEAR] = ((data[RTC_OFFSET_YEAR] & ~(RTC_AL_YEA_MASK)) | |
1758 |
++ (tm->tm_year & RTC_AL_YEA_MASK)); |
1759 |
++ |
1760 |
+ if (alm->enabled) { |
1761 |
+ ret = regmap_bulk_write(rtc->regmap, |
1762 |
+ rtc->addr_base + RTC_AL_SEC, |
1763 |
+diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1764 |
+index 133901fd3e35..6d1f8b22bd83 100644 |
1765 |
+--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1766 |
++++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c |
1767 |
+@@ -915,12 +915,12 @@ void bnx2i_free_hba(struct bnx2i_hba *hba) |
1768 |
+ INIT_LIST_HEAD(&hba->ep_ofld_list); |
1769 |
+ INIT_LIST_HEAD(&hba->ep_active_list); |
1770 |
+ INIT_LIST_HEAD(&hba->ep_destroy_list); |
1771 |
+- pci_dev_put(hba->pcidev); |
1772 |
+ |
1773 |
+ if (hba->regview) { |
1774 |
+ pci_iounmap(hba->pcidev, hba->regview); |
1775 |
+ hba->regview = NULL; |
1776 |
+ } |
1777 |
++ pci_dev_put(hba->pcidev); |
1778 |
+ bnx2i_free_mp_bdt(hba); |
1779 |
+ bnx2i_release_free_cid_que(hba); |
1780 |
+ iscsi_host_free(shost); |
1781 |
+diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c |
1782 |
+index e974106f2bb5..3d6e653f5147 100644 |
1783 |
+--- a/drivers/scsi/cxgbi/libcxgbi.c |
1784 |
++++ b/drivers/scsi/cxgbi/libcxgbi.c |
1785 |
+@@ -121,7 +121,8 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev) |
1786 |
+ "cdev 0x%p, p# %u.\n", cdev, cdev->nports); |
1787 |
+ cxgbi_hbas_remove(cdev); |
1788 |
+ cxgbi_device_portmap_cleanup(cdev); |
1789 |
+- cxgbi_ppm_release(cdev->cdev2ppm(cdev)); |
1790 |
++ if (cdev->cdev2ppm) |
1791 |
++ cxgbi_ppm_release(cdev->cdev2ppm(cdev)); |
1792 |
+ if (cdev->pmap.max_connect) |
1793 |
+ cxgbi_free_big_mem(cdev->pmap.port_csk); |
1794 |
+ kfree(cdev); |
1795 |
+diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c |
1796 |
+index 7bd376d95ed5..b02ac389e6c6 100644 |
1797 |
+--- a/drivers/scsi/esas2r/esas2r_flash.c |
1798 |
++++ b/drivers/scsi/esas2r/esas2r_flash.c |
1799 |
+@@ -1197,6 +1197,7 @@ bool esas2r_nvram_read_direct(struct esas2r_adapter *a) |
1800 |
+ if (!esas2r_read_flash_block(a, a->nvram, FLS_OFFSET_NVR, |
1801 |
+ sizeof(struct esas2r_sas_nvram))) { |
1802 |
+ esas2r_hdebug("NVRAM read failed, using defaults"); |
1803 |
++ up(&a->nvram_semaphore); |
1804 |
+ return false; |
1805 |
+ } |
1806 |
+ |
1807 |
+diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c |
1808 |
+index 9795d6f3e197..c5b89a003d2a 100644 |
1809 |
+--- a/drivers/scsi/fnic/vnic_dev.c |
1810 |
++++ b/drivers/scsi/fnic/vnic_dev.c |
1811 |
+@@ -445,26 +445,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) |
1812 |
+ |
1813 |
+ int vnic_dev_hang_notify(struct vnic_dev *vdev) |
1814 |
+ { |
1815 |
+- u64 a0, a1; |
1816 |
++ u64 a0 = 0, a1 = 0; |
1817 |
+ int wait = 1000; |
1818 |
+ return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait); |
1819 |
+ } |
1820 |
+ |
1821 |
+ int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) |
1822 |
+ { |
1823 |
+- u64 a0, a1; |
1824 |
++ u64 a[2] = {}; |
1825 |
+ int wait = 1000; |
1826 |
+ int err, i; |
1827 |
+ |
1828 |
+ for (i = 0; i < ETH_ALEN; i++) |
1829 |
+ mac_addr[i] = 0; |
1830 |
+ |
1831 |
+- err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait); |
1832 |
++ err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait); |
1833 |
+ if (err) |
1834 |
+ return err; |
1835 |
+ |
1836 |
+ for (i = 0; i < ETH_ALEN; i++) |
1837 |
+- mac_addr[i] = ((u8 *)&a0)[i]; |
1838 |
++ mac_addr[i] = ((u8 *)&a)[i]; |
1839 |
+ |
1840 |
+ return 0; |
1841 |
+ } |
1842 |
+@@ -489,38 +489,32 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, |
1843 |
+ |
1844 |
+ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) |
1845 |
+ { |
1846 |
+- u64 a0 = 0, a1 = 0; |
1847 |
++ u64 a[2] = {}; |
1848 |
+ int wait = 1000; |
1849 |
+ int err; |
1850 |
+ int i; |
1851 |
+ |
1852 |
+ for (i = 0; i < ETH_ALEN; i++) |
1853 |
+- ((u8 *)&a0)[i] = addr[i]; |
1854 |
++ ((u8 *)&a)[i] = addr[i]; |
1855 |
+ |
1856 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); |
1857 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait); |
1858 |
+ if (err) |
1859 |
+- printk(KERN_ERR |
1860 |
+- "Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n", |
1861 |
+- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], |
1862 |
+- err); |
1863 |
++ pr_err("Can't add addr [%pM], %d\n", addr, err); |
1864 |
+ } |
1865 |
+ |
1866 |
+ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) |
1867 |
+ { |
1868 |
+- u64 a0 = 0, a1 = 0; |
1869 |
++ u64 a[2] = {}; |
1870 |
+ int wait = 1000; |
1871 |
+ int err; |
1872 |
+ int i; |
1873 |
+ |
1874 |
+ for (i = 0; i < ETH_ALEN; i++) |
1875 |
+- ((u8 *)&a0)[i] = addr[i]; |
1876 |
++ ((u8 *)&a)[i] = addr[i]; |
1877 |
+ |
1878 |
+- err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); |
1879 |
++ err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait); |
1880 |
+ if (err) |
1881 |
+- printk(KERN_ERR |
1882 |
+- "Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n", |
1883 |
+- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], |
1884 |
+- err); |
1885 |
++ pr_err("Can't del addr [%pM], %d\n", addr, err); |
1886 |
+ } |
1887 |
+ |
1888 |
+ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) |
1889 |
+diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c |
1890 |
+index c291fdff1b33..ea3b77ba12a2 100644 |
1891 |
+--- a/drivers/scsi/qla4xxx/ql4_mbx.c |
1892 |
++++ b/drivers/scsi/qla4xxx/ql4_mbx.c |
1893 |
+@@ -641,9 +641,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) |
1894 |
+ |
1895 |
+ if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) != |
1896 |
+ QLA_SUCCESS) { |
1897 |
+- dma_free_coherent(&ha->pdev->dev, |
1898 |
+- sizeof(struct addr_ctrl_blk), |
1899 |
+- init_fw_cb, init_fw_cb_dma); |
1900 |
+ goto exit_init_fw_cb; |
1901 |
+ } |
1902 |
+ |
1903 |
+diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c |
1904 |
+index 617a60737590..22472d140ef7 100644 |
1905 |
+--- a/drivers/scsi/scsi_trace.c |
1906 |
++++ b/drivers/scsi/scsi_trace.c |
1907 |
+@@ -21,7 +21,7 @@ |
1908 |
+ #include <trace/events/scsi.h> |
1909 |
+ |
1910 |
+ #define SERVICE_ACTION16(cdb) (cdb[1] & 0x1f) |
1911 |
+-#define SERVICE_ACTION32(cdb) ((cdb[8] << 8) | cdb[9]) |
1912 |
++#define SERVICE_ACTION32(cdb) (get_unaligned_be16(&cdb[8])) |
1913 |
+ |
1914 |
+ static const char * |
1915 |
+ scsi_trace_misc(struct trace_seq *, unsigned char *, int); |
1916 |
+@@ -51,17 +51,12 @@ static const char * |
1917 |
+ scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len) |
1918 |
+ { |
1919 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1920 |
+- sector_t lba = 0, txlen = 0; |
1921 |
++ u32 lba, txlen; |
1922 |
+ |
1923 |
+- lba |= (cdb[2] << 24); |
1924 |
+- lba |= (cdb[3] << 16); |
1925 |
+- lba |= (cdb[4] << 8); |
1926 |
+- lba |= cdb[5]; |
1927 |
+- txlen |= (cdb[7] << 8); |
1928 |
+- txlen |= cdb[8]; |
1929 |
++ lba = get_unaligned_be32(&cdb[2]); |
1930 |
++ txlen = get_unaligned_be16(&cdb[7]); |
1931 |
+ |
1932 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1933 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1934 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1935 |
+ cdb[1] >> 5); |
1936 |
+ |
1937 |
+ if (cdb[0] == WRITE_SAME) |
1938 |
+@@ -76,19 +71,12 @@ static const char * |
1939 |
+ scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len) |
1940 |
+ { |
1941 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1942 |
+- sector_t lba = 0, txlen = 0; |
1943 |
+- |
1944 |
+- lba |= (cdb[2] << 24); |
1945 |
+- lba |= (cdb[3] << 16); |
1946 |
+- lba |= (cdb[4] << 8); |
1947 |
+- lba |= cdb[5]; |
1948 |
+- txlen |= (cdb[6] << 24); |
1949 |
+- txlen |= (cdb[7] << 16); |
1950 |
+- txlen |= (cdb[8] << 8); |
1951 |
+- txlen |= cdb[9]; |
1952 |
+- |
1953 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1954 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1955 |
++ u32 lba, txlen; |
1956 |
++ |
1957 |
++ lba = get_unaligned_be32(&cdb[2]); |
1958 |
++ txlen = get_unaligned_be32(&cdb[6]); |
1959 |
++ |
1960 |
++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen, |
1961 |
+ cdb[1] >> 5); |
1962 |
+ trace_seq_putc(p, 0); |
1963 |
+ |
1964 |
+@@ -99,23 +87,13 @@ static const char * |
1965 |
+ scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len) |
1966 |
+ { |
1967 |
+ const char *ret = trace_seq_buffer_ptr(p); |
1968 |
+- sector_t lba = 0, txlen = 0; |
1969 |
+- |
1970 |
+- lba |= ((u64)cdb[2] << 56); |
1971 |
+- lba |= ((u64)cdb[3] << 48); |
1972 |
+- lba |= ((u64)cdb[4] << 40); |
1973 |
+- lba |= ((u64)cdb[5] << 32); |
1974 |
+- lba |= (cdb[6] << 24); |
1975 |
+- lba |= (cdb[7] << 16); |
1976 |
+- lba |= (cdb[8] << 8); |
1977 |
+- lba |= cdb[9]; |
1978 |
+- txlen |= (cdb[10] << 24); |
1979 |
+- txlen |= (cdb[11] << 16); |
1980 |
+- txlen |= (cdb[12] << 8); |
1981 |
+- txlen |= cdb[13]; |
1982 |
+- |
1983 |
+- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u", |
1984 |
+- (unsigned long long)lba, (unsigned long long)txlen, |
1985 |
++ u64 lba; |
1986 |
++ u32 txlen; |
1987 |
++ |
1988 |
++ lba = get_unaligned_be64(&cdb[2]); |
1989 |
++ txlen = get_unaligned_be32(&cdb[10]); |
1990 |
++ |
1991 |
++ trace_seq_printf(p, "lba=%llu txlen=%u protect=%u", lba, txlen, |
1992 |
+ cdb[1] >> 5); |
1993 |
+ |
1994 |
+ if (cdb[0] == WRITE_SAME_16) |
1995 |
+@@ -130,8 +108,8 @@ static const char * |
1996 |
+ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
1997 |
+ { |
1998 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
1999 |
+- sector_t lba = 0, txlen = 0; |
2000 |
+- u32 ei_lbrt = 0; |
2001 |
++ u64 lba; |
2002 |
++ u32 ei_lbrt, txlen; |
2003 |
+ |
2004 |
+ switch (SERVICE_ACTION32(cdb)) { |
2005 |
+ case READ_32: |
2006 |
+@@ -151,26 +129,12 @@ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len) |
2007 |
+ goto out; |
2008 |
+ } |
2009 |
+ |
2010 |
+- lba |= ((u64)cdb[12] << 56); |
2011 |
+- lba |= ((u64)cdb[13] << 48); |
2012 |
+- lba |= ((u64)cdb[14] << 40); |
2013 |
+- lba |= ((u64)cdb[15] << 32); |
2014 |
+- lba |= (cdb[16] << 24); |
2015 |
+- lba |= (cdb[17] << 16); |
2016 |
+- lba |= (cdb[18] << 8); |
2017 |
+- lba |= cdb[19]; |
2018 |
+- ei_lbrt |= (cdb[20] << 24); |
2019 |
+- ei_lbrt |= (cdb[21] << 16); |
2020 |
+- ei_lbrt |= (cdb[22] << 8); |
2021 |
+- ei_lbrt |= cdb[23]; |
2022 |
+- txlen |= (cdb[28] << 24); |
2023 |
+- txlen |= (cdb[29] << 16); |
2024 |
+- txlen |= (cdb[30] << 8); |
2025 |
+- txlen |= cdb[31]; |
2026 |
+- |
2027 |
+- trace_seq_printf(p, "%s_32 lba=%llu txlen=%llu protect=%u ei_lbrt=%u", |
2028 |
+- cmd, (unsigned long long)lba, |
2029 |
+- (unsigned long long)txlen, cdb[10] >> 5, ei_lbrt); |
2030 |
++ lba = get_unaligned_be64(&cdb[12]); |
2031 |
++ ei_lbrt = get_unaligned_be32(&cdb[20]); |
2032 |
++ txlen = get_unaligned_be32(&cdb[28]); |
2033 |
++ |
2034 |
++ trace_seq_printf(p, "%s_32 lba=%llu txlen=%u protect=%u ei_lbrt=%u", |
2035 |
++ cmd, lba, txlen, cdb[10] >> 5, ei_lbrt); |
2036 |
+ |
2037 |
+ if (SERVICE_ACTION32(cdb) == WRITE_SAME_32) |
2038 |
+ trace_seq_printf(p, " unmap=%u", cdb[10] >> 3 & 1); |
2039 |
+@@ -185,7 +149,7 @@ static const char * |
2040 |
+ scsi_trace_unmap(struct trace_seq *p, unsigned char *cdb, int len) |
2041 |
+ { |
2042 |
+ const char *ret = trace_seq_buffer_ptr(p); |
2043 |
+- unsigned int regions = cdb[7] << 8 | cdb[8]; |
2044 |
++ unsigned int regions = get_unaligned_be16(&cdb[7]); |
2045 |
+ |
2046 |
+ trace_seq_printf(p, "regions=%u", (regions - 8) / 16); |
2047 |
+ trace_seq_putc(p, 0); |
2048 |
+@@ -197,8 +161,8 @@ static const char * |
2049 |
+ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
2050 |
+ { |
2051 |
+ const char *ret = trace_seq_buffer_ptr(p), *cmd; |
2052 |
+- sector_t lba = 0; |
2053 |
+- u32 alloc_len = 0; |
2054 |
++ u64 lba; |
2055 |
++ u32 alloc_len; |
2056 |
+ |
2057 |
+ switch (SERVICE_ACTION16(cdb)) { |
2058 |
+ case SAI_READ_CAPACITY_16: |
2059 |
+@@ -212,21 +176,10 @@ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len) |
2060 |
+ goto out; |
2061 |
+ } |
2062 |
+ |
2063 |
+- lba |= ((u64)cdb[2] << 56); |
2064 |
+- lba |= ((u64)cdb[3] << 48); |
2065 |
+- lba |= ((u64)cdb[4] << 40); |
2066 |
+- lba |= ((u64)cdb[5] << 32); |
2067 |
+- lba |= (cdb[6] << 24); |
2068 |
+- lba |= (cdb[7] << 16); |
2069 |
+- lba |= (cdb[8] << 8); |
2070 |
+- lba |= cdb[9]; |
2071 |
+- alloc_len |= (cdb[10] << 24); |
2072 |
+- alloc_len |= (cdb[11] << 16); |
2073 |
+- alloc_len |= (cdb[12] << 8); |
2074 |
+- alloc_len |= cdb[13]; |
2075 |
+- |
2076 |
+- trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, |
2077 |
+- (unsigned long long)lba, alloc_len); |
2078 |
++ lba = get_unaligned_be64(&cdb[2]); |
2079 |
++ alloc_len = get_unaligned_be32(&cdb[10]); |
2080 |
++ |
2081 |
++ trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, lba, alloc_len); |
2082 |
+ |
2083 |
+ out: |
2084 |
+ trace_seq_putc(p, 0); |
2085 |
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c |
2086 |
+index b40fe8d583c0..62d6955ac69b 100644 |
2087 |
+--- a/drivers/scsi/sd.c |
2088 |
++++ b/drivers/scsi/sd.c |
2089 |
+@@ -2005,8 +2005,10 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer |
2090 |
+ u8 type; |
2091 |
+ int ret = 0; |
2092 |
+ |
2093 |
+- if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) |
2094 |
++ if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) { |
2095 |
++ sdkp->protection_type = 0; |
2096 |
+ return ret; |
2097 |
++ } |
2098 |
+ |
2099 |
+ type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ |
2100 |
+ |
2101 |
+diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c |
2102 |
+index 691c04b3e5b6..938840af9c50 100644 |
2103 |
+--- a/drivers/spi/spi-atmel.c |
2104 |
++++ b/drivers/spi/spi-atmel.c |
2105 |
+@@ -315,7 +315,6 @@ struct atmel_spi { |
2106 |
+ struct atmel_spi_dma dma; |
2107 |
+ |
2108 |
+ bool keep_cs; |
2109 |
+- bool cs_active; |
2110 |
+ |
2111 |
+ u32 fifo_size; |
2112 |
+ }; |
2113 |
+@@ -1404,11 +1403,9 @@ static int atmel_spi_one_transfer(struct spi_master *master, |
2114 |
+ &msg->transfers)) { |
2115 |
+ as->keep_cs = true; |
2116 |
+ } else { |
2117 |
+- as->cs_active = !as->cs_active; |
2118 |
+- if (as->cs_active) |
2119 |
+- cs_activate(as, msg->spi); |
2120 |
+- else |
2121 |
+- cs_deactivate(as, msg->spi); |
2122 |
++ cs_deactivate(as, msg->spi); |
2123 |
++ udelay(10); |
2124 |
++ cs_activate(as, msg->spi); |
2125 |
+ } |
2126 |
+ } |
2127 |
+ |
2128 |
+@@ -1431,7 +1428,6 @@ static int atmel_spi_transfer_one_message(struct spi_master *master, |
2129 |
+ atmel_spi_lock(as); |
2130 |
+ cs_activate(as, spi); |
2131 |
+ |
2132 |
+- as->cs_active = true; |
2133 |
+ as->keep_cs = false; |
2134 |
+ |
2135 |
+ msg->status = 0; |
2136 |
+diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c |
2137 |
+index cb6497ce4b61..6e75095af681 100644 |
2138 |
+--- a/drivers/target/target_core_fabric_lib.c |
2139 |
++++ b/drivers/target/target_core_fabric_lib.c |
2140 |
+@@ -130,7 +130,7 @@ static int srp_get_pr_transport_id( |
2141 |
+ memset(buf + 8, 0, leading_zero_bytes); |
2142 |
+ rc = hex2bin(buf + 8 + leading_zero_bytes, p, count); |
2143 |
+ if (rc < 0) { |
2144 |
+- pr_debug("hex2bin failed for %s: %d\n", __func__, rc); |
2145 |
++ pr_debug("hex2bin failed for %s: %d\n", p, rc); |
2146 |
+ return rc; |
2147 |
+ } |
2148 |
+ |
2149 |
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
2150 |
+index 6d596c635159..e75bd8d7e6f6 100644 |
2151 |
+--- a/drivers/tty/serial/imx.c |
2152 |
++++ b/drivers/tty/serial/imx.c |
2153 |
+@@ -548,7 +548,7 @@ static void imx_dma_tx(struct imx_port *sport) |
2154 |
+ dev_err(dev, "DMA mapping error for TX.\n"); |
2155 |
+ return; |
2156 |
+ } |
2157 |
+- desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents, |
2158 |
++ desc = dmaengine_prep_slave_sg(chan, sgl, ret, |
2159 |
+ DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); |
2160 |
+ if (!desc) { |
2161 |
+ dma_unmap_sg(dev, sgl, sport->dma_tx_nents, |
2162 |
+diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c |
2163 |
+index 42caccb5e87e..30b577384a1d 100644 |
2164 |
+--- a/drivers/tty/serial/pch_uart.c |
2165 |
++++ b/drivers/tty/serial/pch_uart.c |
2166 |
+@@ -252,6 +252,7 @@ struct eg20t_port { |
2167 |
+ struct dma_chan *chan_rx; |
2168 |
+ struct scatterlist *sg_tx_p; |
2169 |
+ int nent; |
2170 |
++ int orig_nent; |
2171 |
+ struct scatterlist sg_rx; |
2172 |
+ int tx_dma_use; |
2173 |
+ void *rx_buf_virt; |
2174 |
+@@ -806,9 +807,10 @@ static void pch_dma_tx_complete(void *arg) |
2175 |
+ } |
2176 |
+ xmit->tail &= UART_XMIT_SIZE - 1; |
2177 |
+ async_tx_ack(priv->desc_tx); |
2178 |
+- dma_unmap_sg(port->dev, sg, priv->nent, DMA_TO_DEVICE); |
2179 |
++ dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); |
2180 |
+ priv->tx_dma_use = 0; |
2181 |
+ priv->nent = 0; |
2182 |
++ priv->orig_nent = 0; |
2183 |
+ kfree(priv->sg_tx_p); |
2184 |
+ pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); |
2185 |
+ } |
2186 |
+@@ -1033,6 +1035,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv) |
2187 |
+ dev_err(priv->port.dev, "%s:dma_map_sg Failed\n", __func__); |
2188 |
+ return 0; |
2189 |
+ } |
2190 |
++ priv->orig_nent = num; |
2191 |
+ priv->nent = nent; |
2192 |
+ |
2193 |
+ for (i = 0; i < nent; i++, sg++) { |
2194 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
2195 |
+index acf4752302a6..9f05f9a81f69 100644 |
2196 |
+--- a/drivers/usb/core/hub.c |
2197 |
++++ b/drivers/usb/core/hub.c |
2198 |
+@@ -1162,6 +1162,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) |
2199 |
+ * PORT_OVER_CURRENT is not. So check for any of them. |
2200 |
+ */ |
2201 |
+ if (udev || (portstatus & USB_PORT_STAT_CONNECTION) || |
2202 |
++ (portchange & USB_PORT_STAT_C_CONNECTION) || |
2203 |
+ (portstatus & USB_PORT_STAT_OVERCURRENT) || |
2204 |
+ (portchange & USB_PORT_STAT_C_OVERCURRENT)) |
2205 |
+ set_bit(port1, hub->change_bits); |
2206 |
+diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c |
2207 |
+index 9a2c0c76d11b..0291dc7cd284 100644 |
2208 |
+--- a/drivers/usb/serial/ch341.c |
2209 |
++++ b/drivers/usb/serial/ch341.c |
2210 |
+@@ -555,9 +555,13 @@ static int ch341_tiocmget(struct tty_struct *tty) |
2211 |
+ static int ch341_reset_resume(struct usb_serial *serial) |
2212 |
+ { |
2213 |
+ struct usb_serial_port *port = serial->port[0]; |
2214 |
+- struct ch341_private *priv = usb_get_serial_port_data(port); |
2215 |
++ struct ch341_private *priv; |
2216 |
+ int ret; |
2217 |
+ |
2218 |
++ priv = usb_get_serial_port_data(port); |
2219 |
++ if (!priv) |
2220 |
++ return 0; |
2221 |
++ |
2222 |
+ /* reconfigure ch341 serial port after bus-reset */ |
2223 |
+ ch341_configure(serial->dev, priv); |
2224 |
+ |
2225 |
+diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c |
2226 |
+index e5649adcc84c..191588006e0e 100644 |
2227 |
+--- a/drivers/usb/serial/io_edgeport.c |
2228 |
++++ b/drivers/usb/serial/io_edgeport.c |
2229 |
+@@ -572,6 +572,7 @@ static void edge_interrupt_callback(struct urb *urb) |
2230 |
+ struct usb_serial_port *port; |
2231 |
+ unsigned char *data = urb->transfer_buffer; |
2232 |
+ int length = urb->actual_length; |
2233 |
++ unsigned long flags; |
2234 |
+ int bytes_avail; |
2235 |
+ int position; |
2236 |
+ int txCredits; |
2237 |
+@@ -603,7 +604,7 @@ static void edge_interrupt_callback(struct urb *urb) |
2238 |
+ if (length > 1) { |
2239 |
+ bytes_avail = data[0] | (data[1] << 8); |
2240 |
+ if (bytes_avail) { |
2241 |
+- spin_lock(&edge_serial->es_lock); |
2242 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
2243 |
+ edge_serial->rxBytesAvail += bytes_avail; |
2244 |
+ dev_dbg(dev, |
2245 |
+ "%s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d\n", |
2246 |
+@@ -626,7 +627,8 @@ static void edge_interrupt_callback(struct urb *urb) |
2247 |
+ edge_serial->read_in_progress = false; |
2248 |
+ } |
2249 |
+ } |
2250 |
+- spin_unlock(&edge_serial->es_lock); |
2251 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, |
2252 |
++ flags); |
2253 |
+ } |
2254 |
+ } |
2255 |
+ /* grab the txcredits for the ports if available */ |
2256 |
+@@ -638,10 +640,12 @@ static void edge_interrupt_callback(struct urb *urb) |
2257 |
+ if (txCredits) { |
2258 |
+ port = edge_serial->serial->port[portNumber]; |
2259 |
+ edge_port = usb_get_serial_port_data(port); |
2260 |
+- if (edge_port->open) { |
2261 |
+- spin_lock(&edge_port->ep_lock); |
2262 |
++ if (edge_port && edge_port->open) { |
2263 |
++ spin_lock_irqsave(&edge_port->ep_lock, |
2264 |
++ flags); |
2265 |
+ edge_port->txCredits += txCredits; |
2266 |
+- spin_unlock(&edge_port->ep_lock); |
2267 |
++ spin_unlock_irqrestore(&edge_port->ep_lock, |
2268 |
++ flags); |
2269 |
+ dev_dbg(dev, "%s - txcredits for port%d = %d\n", |
2270 |
+ __func__, portNumber, |
2271 |
+ edge_port->txCredits); |
2272 |
+@@ -682,6 +686,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
2273 |
+ int retval; |
2274 |
+ __u16 raw_data_length; |
2275 |
+ int status = urb->status; |
2276 |
++ unsigned long flags; |
2277 |
+ |
2278 |
+ if (status) { |
2279 |
+ dev_dbg(&urb->dev->dev, "%s - nonzero read bulk status received: %d\n", |
2280 |
+@@ -701,7 +706,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
2281 |
+ |
2282 |
+ usb_serial_debug_data(dev, __func__, raw_data_length, data); |
2283 |
+ |
2284 |
+- spin_lock(&edge_serial->es_lock); |
2285 |
++ spin_lock_irqsave(&edge_serial->es_lock, flags); |
2286 |
+ |
2287 |
+ /* decrement our rxBytes available by the number that we just got */ |
2288 |
+ edge_serial->rxBytesAvail -= raw_data_length; |
2289 |
+@@ -725,7 +730,7 @@ static void edge_bulk_in_callback(struct urb *urb) |
2290 |
+ edge_serial->read_in_progress = false; |
2291 |
+ } |
2292 |
+ |
2293 |
+- spin_unlock(&edge_serial->es_lock); |
2294 |
++ spin_unlock_irqrestore(&edge_serial->es_lock, flags); |
2295 |
+ } |
2296 |
+ |
2297 |
+ |
2298 |
+@@ -1662,7 +1667,8 @@ static void edge_break(struct tty_struct *tty, int break_state) |
2299 |
+ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
2300 |
+ unsigned char *buffer, __u16 bufferLength) |
2301 |
+ { |
2302 |
+- struct device *dev = &edge_serial->serial->dev->dev; |
2303 |
++ struct usb_serial *serial = edge_serial->serial; |
2304 |
++ struct device *dev = &serial->dev->dev; |
2305 |
+ struct usb_serial_port *port; |
2306 |
+ struct edgeport_port *edge_port; |
2307 |
+ __u16 lastBufferLength; |
2308 |
+@@ -1767,11 +1773,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
2309 |
+ |
2310 |
+ /* spit this data back into the tty driver if this |
2311 |
+ port is open */ |
2312 |
+- if (rxLen) { |
2313 |
+- port = edge_serial->serial->port[ |
2314 |
+- edge_serial->rxPort]; |
2315 |
++ if (rxLen && edge_serial->rxPort < serial->num_ports) { |
2316 |
++ port = serial->port[edge_serial->rxPort]; |
2317 |
+ edge_port = usb_get_serial_port_data(port); |
2318 |
+- if (edge_port->open) { |
2319 |
++ if (edge_port && edge_port->open) { |
2320 |
+ dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", |
2321 |
+ __func__, rxLen, |
2322 |
+ edge_serial->rxPort); |
2323 |
+@@ -1779,8 +1784,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, |
2324 |
+ rxLen); |
2325 |
+ edge_port->port->icount.rx += rxLen; |
2326 |
+ } |
2327 |
+- buffer += rxLen; |
2328 |
+ } |
2329 |
++ buffer += rxLen; |
2330 |
+ break; |
2331 |
+ |
2332 |
+ case EXPECT_HDR3: /* Expect 3rd byte of status header */ |
2333 |
+@@ -1815,6 +1820,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, |
2334 |
+ __u8 code = edge_serial->rxStatusCode; |
2335 |
+ |
2336 |
+ /* switch the port pointer to the one being currently talked about */ |
2337 |
++ if (edge_serial->rxPort >= edge_serial->serial->num_ports) |
2338 |
++ return; |
2339 |
+ port = edge_serial->serial->port[edge_serial->rxPort]; |
2340 |
+ edge_port = usb_get_serial_port_data(port); |
2341 |
+ if (edge_port == NULL) { |
2342 |
+diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c |
2343 |
+index 185ef1d8c6cd..e08755e9b612 100644 |
2344 |
+--- a/drivers/usb/serial/keyspan.c |
2345 |
++++ b/drivers/usb/serial/keyspan.c |
2346 |
+@@ -567,6 +567,8 @@ static void usa49_glocont_callback(struct urb *urb) |
2347 |
+ for (i = 0; i < serial->num_ports; ++i) { |
2348 |
+ port = serial->port[i]; |
2349 |
+ p_priv = usb_get_serial_port_data(port); |
2350 |
++ if (!p_priv) |
2351 |
++ continue; |
2352 |
+ |
2353 |
+ if (p_priv->resend_cont) { |
2354 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
2355 |
+@@ -968,6 +970,8 @@ static void usa67_glocont_callback(struct urb *urb) |
2356 |
+ for (i = 0; i < serial->num_ports; ++i) { |
2357 |
+ port = serial->port[i]; |
2358 |
+ p_priv = usb_get_serial_port_data(port); |
2359 |
++ if (!p_priv) |
2360 |
++ continue; |
2361 |
+ |
2362 |
+ if (p_priv->resend_cont) { |
2363 |
+ dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
2364 |
+diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c |
2365 |
+index 64bf258e7e00..9606dde3194c 100644 |
2366 |
+--- a/drivers/usb/serial/opticon.c |
2367 |
++++ b/drivers/usb/serial/opticon.c |
2368 |
+@@ -116,7 +116,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, |
2369 |
+ retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
2370 |
+ requesttype, |
2371 |
+ USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, |
2372 |
+- 0, 0, buffer, 1, 0); |
2373 |
++ 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT); |
2374 |
+ kfree(buffer); |
2375 |
+ |
2376 |
+ if (retval < 0) |
2377 |
+diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c |
2378 |
+index 1d17779b2203..19952ccd028a 100644 |
2379 |
+--- a/drivers/usb/serial/quatech2.c |
2380 |
++++ b/drivers/usb/serial/quatech2.c |
2381 |
+@@ -872,7 +872,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch) |
2382 |
+ u8 newMSR = (u8) *ch; |
2383 |
+ unsigned long flags; |
2384 |
+ |
2385 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
2386 |
+ port_priv = usb_get_serial_port_data(port); |
2387 |
++ if (!port_priv) |
2388 |
++ return; |
2389 |
+ |
2390 |
+ spin_lock_irqsave(&port_priv->lock, flags); |
2391 |
+ port_priv->shadowMSR = newMSR; |
2392 |
+@@ -900,7 +903,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) |
2393 |
+ unsigned long flags; |
2394 |
+ u8 newLSR = (u8) *ch; |
2395 |
+ |
2396 |
++ /* May be called from qt2_process_read_urb() for an unbound port. */ |
2397 |
+ port_priv = usb_get_serial_port_data(port); |
2398 |
++ if (!port_priv) |
2399 |
++ return; |
2400 |
+ |
2401 |
+ if (newLSR & UART_LSR_BI) |
2402 |
+ newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI); |
2403 |
+diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c |
2404 |
+index 511242111403..15e05ebf37ac 100644 |
2405 |
+--- a/drivers/usb/serial/usb-serial-simple.c |
2406 |
++++ b/drivers/usb/serial/usb-serial-simple.c |
2407 |
+@@ -89,6 +89,8 @@ DEVICE(moto_modem, MOTO_IDS); |
2408 |
+ #define MOTOROLA_TETRA_IDS() \ |
2409 |
+ { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \ |
2410 |
+ { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ |
2411 |
++ { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \ |
2412 |
++ { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \ |
2413 |
+ { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ |
2414 |
+ DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); |
2415 |
+ |
2416 |
+diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c |
2417 |
+index a894c0fdc04b..8a24a11b7ffc 100644 |
2418 |
+--- a/drivers/usb/serial/usb-serial.c |
2419 |
++++ b/drivers/usb/serial/usb-serial.c |
2420 |
+@@ -1351,6 +1351,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) |
2421 |
+ return -EINVAL; |
2422 |
+ } |
2423 |
+ |
2424 |
++ /* Prevent individual ports from being unbound. */ |
2425 |
++ driver->driver.suppress_bind_attrs = true; |
2426 |
++ |
2427 |
+ usb_serial_operations_init(driver); |
2428 |
+ |
2429 |
+ /* Add this device to our list of devices */ |
2430 |
+diff --git a/firmware/Makefile b/firmware/Makefile |
2431 |
+index e297e1b52636..03232621cc08 100644 |
2432 |
+--- a/firmware/Makefile |
2433 |
++++ b/firmware/Makefile |
2434 |
+@@ -156,7 +156,7 @@ quiet_cmd_fwbin = MK_FW $@ |
2435 |
+ PROGBITS=$(if $(CONFIG_ARM),%,@)progbits; \ |
2436 |
+ echo "/* Generated by firmware/Makefile */" > $@;\ |
2437 |
+ echo " .section .rodata" >>$@;\ |
2438 |
+- echo " .p2align $${ASM_ALIGN}" >>$@;\ |
2439 |
++ echo " .p2align 4" >>$@;\ |
2440 |
+ echo "_fw_$${FWSTR}_bin:" >>$@;\ |
2441 |
+ echo " .incbin \"$(2)\"" >>$@;\ |
2442 |
+ echo "_fw_end:" >>$@;\ |
2443 |
+diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c |
2444 |
+index 41f1a5dd33a5..4dcce3f034f4 100644 |
2445 |
+--- a/fs/cifs/smb2file.c |
2446 |
++++ b/fs/cifs/smb2file.c |
2447 |
+@@ -69,7 +69,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, |
2448 |
+ goto out; |
2449 |
+ |
2450 |
+ |
2451 |
+- if (oparms->tcon->use_resilient) { |
2452 |
++ if (oparms->tcon->use_resilient) { |
2453 |
+ nr_ioctl_req.Timeout = 0; /* use server default (120 seconds) */ |
2454 |
+ nr_ioctl_req.Reserved = 0; |
2455 |
+ rc = SMB2_ioctl(xid, oparms->tcon, fid->persistent_fid, |
2456 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
2457 |
+index 00c320e2ba1e..8133e6529994 100644 |
2458 |
+--- a/fs/ext4/inode.c |
2459 |
++++ b/fs/ext4/inode.c |
2460 |
+@@ -5472,10 +5472,25 @@ static int ext4_expand_extra_isize(struct inode *inode, |
2461 |
+ { |
2462 |
+ struct ext4_inode *raw_inode; |
2463 |
+ struct ext4_xattr_ibody_header *header; |
2464 |
++ unsigned int inode_size = EXT4_INODE_SIZE(inode->i_sb); |
2465 |
++ struct ext4_inode_info *ei = EXT4_I(inode); |
2466 |
+ |
2467 |
+ if (EXT4_I(inode)->i_extra_isize >= new_extra_isize) |
2468 |
+ return 0; |
2469 |
+ |
2470 |
++ /* this was checked at iget time, but double check for good measure */ |
2471 |
++ if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) || |
2472 |
++ (ei->i_extra_isize & 3)) { |
2473 |
++ EXT4_ERROR_INODE(inode, "bad extra_isize %u (inode size %u)", |
2474 |
++ ei->i_extra_isize, |
2475 |
++ EXT4_INODE_SIZE(inode->i_sb)); |
2476 |
++ return -EFSCORRUPTED; |
2477 |
++ } |
2478 |
++ if ((new_extra_isize < ei->i_extra_isize) || |
2479 |
++ (new_extra_isize < 4) || |
2480 |
++ (new_extra_isize > inode_size - EXT4_GOOD_OLD_INODE_SIZE)) |
2481 |
++ return -EINVAL; /* Should never happen */ |
2482 |
++ |
2483 |
+ raw_inode = ext4_raw_inode(&iloc); |
2484 |
+ |
2485 |
+ header = IHDR(inode, raw_inode); |
2486 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
2487 |
+index 3261478bfc32..391ab55808c9 100644 |
2488 |
+--- a/fs/ext4/super.c |
2489 |
++++ b/fs/ext4/super.c |
2490 |
+@@ -3342,6 +3342,40 @@ int ext4_calculate_overhead(struct super_block *sb) |
2491 |
+ return 0; |
2492 |
+ } |
2493 |
+ |
2494 |
++static void ext4_clamp_want_extra_isize(struct super_block *sb) |
2495 |
++{ |
2496 |
++ struct ext4_sb_info *sbi = EXT4_SB(sb); |
2497 |
++ struct ext4_super_block *es = sbi->s_es; |
2498 |
++ unsigned def_extra_isize = sizeof(struct ext4_inode) - |
2499 |
++ EXT4_GOOD_OLD_INODE_SIZE; |
2500 |
++ |
2501 |
++ if (sbi->s_inode_size == EXT4_GOOD_OLD_INODE_SIZE) { |
2502 |
++ sbi->s_want_extra_isize = 0; |
2503 |
++ return; |
2504 |
++ } |
2505 |
++ if (sbi->s_want_extra_isize < 4) { |
2506 |
++ sbi->s_want_extra_isize = def_extra_isize; |
2507 |
++ if (ext4_has_feature_extra_isize(sb)) { |
2508 |
++ if (sbi->s_want_extra_isize < |
2509 |
++ le16_to_cpu(es->s_want_extra_isize)) |
2510 |
++ sbi->s_want_extra_isize = |
2511 |
++ le16_to_cpu(es->s_want_extra_isize); |
2512 |
++ if (sbi->s_want_extra_isize < |
2513 |
++ le16_to_cpu(es->s_min_extra_isize)) |
2514 |
++ sbi->s_want_extra_isize = |
2515 |
++ le16_to_cpu(es->s_min_extra_isize); |
2516 |
++ } |
2517 |
++ } |
2518 |
++ /* Check if enough inode space is available */ |
2519 |
++ if ((sbi->s_want_extra_isize > sbi->s_inode_size) || |
2520 |
++ (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > |
2521 |
++ sbi->s_inode_size)) { |
2522 |
++ sbi->s_want_extra_isize = def_extra_isize; |
2523 |
++ ext4_msg(sb, KERN_INFO, |
2524 |
++ "required extra inode space not available"); |
2525 |
++ } |
2526 |
++} |
2527 |
++ |
2528 |
+ static void ext4_set_resv_clusters(struct super_block *sb) |
2529 |
+ { |
2530 |
+ ext4_fsblk_t resv_clusters; |
2531 |
+@@ -4156,29 +4190,7 @@ no_journal: |
2532 |
+ if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY)) |
2533 |
+ sb->s_flags |= MS_RDONLY; |
2534 |
+ |
2535 |
+- /* determine the minimum size of new large inodes, if present */ |
2536 |
+- if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |
2537 |
+- sbi->s_want_extra_isize = sizeof(struct ext4_inode) - |
2538 |
+- EXT4_GOOD_OLD_INODE_SIZE; |
2539 |
+- if (ext4_has_feature_extra_isize(sb)) { |
2540 |
+- if (sbi->s_want_extra_isize < |
2541 |
+- le16_to_cpu(es->s_want_extra_isize)) |
2542 |
+- sbi->s_want_extra_isize = |
2543 |
+- le16_to_cpu(es->s_want_extra_isize); |
2544 |
+- if (sbi->s_want_extra_isize < |
2545 |
+- le16_to_cpu(es->s_min_extra_isize)) |
2546 |
+- sbi->s_want_extra_isize = |
2547 |
+- le16_to_cpu(es->s_min_extra_isize); |
2548 |
+- } |
2549 |
+- } |
2550 |
+- /* Check if enough inode space is available */ |
2551 |
+- if (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > |
2552 |
+- sbi->s_inode_size) { |
2553 |
+- sbi->s_want_extra_isize = sizeof(struct ext4_inode) - |
2554 |
+- EXT4_GOOD_OLD_INODE_SIZE; |
2555 |
+- ext4_msg(sb, KERN_INFO, "required extra inode space not" |
2556 |
+- "available"); |
2557 |
+- } |
2558 |
++ ext4_clamp_want_extra_isize(sb); |
2559 |
+ |
2560 |
+ ext4_set_resv_clusters(sb); |
2561 |
+ |
2562 |
+@@ -4959,6 +4971,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) |
2563 |
+ goto restore_opts; |
2564 |
+ } |
2565 |
+ |
2566 |
++ ext4_clamp_want_extra_isize(sb); |
2567 |
++ |
2568 |
+ if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ |
2569 |
+ test_opt(sb, JOURNAL_CHECKSUM)) { |
2570 |
+ ext4_msg(sb, KERN_ERR, "changing journal_checksum " |
2571 |
+diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c |
2572 |
+index 0206c8c20784..b2cccd4083b8 100644 |
2573 |
+--- a/fs/f2fs/data.c |
2574 |
++++ b/fs/f2fs/data.c |
2575 |
+@@ -1267,7 +1267,7 @@ static int f2fs_write_data_page(struct page *page, |
2576 |
+ loff_t i_size = i_size_read(inode); |
2577 |
+ const pgoff_t end_index = ((unsigned long long) i_size) |
2578 |
+ >> PAGE_SHIFT; |
2579 |
+- loff_t psize = (page->index + 1) << PAGE_SHIFT; |
2580 |
++ loff_t psize = (loff_t)(page->index + 1) << PAGE_SHIFT; |
2581 |
+ unsigned offset = 0; |
2582 |
+ bool need_balance_fs = false; |
2583 |
+ int err = 0; |
2584 |
+diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c |
2585 |
+index f46ac1651bd5..e3c438c8b8ce 100644 |
2586 |
+--- a/fs/f2fs/file.c |
2587 |
++++ b/fs/f2fs/file.c |
2588 |
+@@ -980,7 +980,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, |
2589 |
+ } |
2590 |
+ dn.ofs_in_node++; |
2591 |
+ i++; |
2592 |
+- new_size = (dst + i) << PAGE_SHIFT; |
2593 |
++ new_size = (loff_t)(dst + i) << PAGE_SHIFT; |
2594 |
+ if (dst_inode->i_size < new_size) |
2595 |
+ f2fs_i_size_write(dst_inode, new_size); |
2596 |
+ } while (--ilen && (do_replace[i] || blkaddr[i] == NULL_ADDR)); |
2597 |
+diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c |
2598 |
+index 13cf69aa4cae..733c05135305 100644 |
2599 |
+--- a/fs/ocfs2/journal.c |
2600 |
++++ b/fs/ocfs2/journal.c |
2601 |
+@@ -1080,6 +1080,14 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) |
2602 |
+ |
2603 |
+ ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); |
2604 |
+ |
2605 |
++ if (replayed) { |
2606 |
++ jbd2_journal_lock_updates(journal->j_journal); |
2607 |
++ status = jbd2_journal_flush(journal->j_journal); |
2608 |
++ jbd2_journal_unlock_updates(journal->j_journal); |
2609 |
++ if (status < 0) |
2610 |
++ mlog_errno(status); |
2611 |
++ } |
2612 |
++ |
2613 |
+ status = ocfs2_journal_toggle_dirty(osb, 1, replayed); |
2614 |
+ if (status < 0) { |
2615 |
+ mlog_errno(status); |
2616 |
+diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c |
2617 |
+index dbc2ada9884f..07900105523f 100644 |
2618 |
+--- a/fs/reiserfs/xattr.c |
2619 |
++++ b/fs/reiserfs/xattr.c |
2620 |
+@@ -318,8 +318,12 @@ static int reiserfs_for_each_xattr(struct inode *inode, |
2621 |
+ out_dir: |
2622 |
+ dput(dir); |
2623 |
+ out: |
2624 |
+- /* -ENODATA isn't an error */ |
2625 |
+- if (err == -ENODATA) |
2626 |
++ /* |
2627 |
++ * -ENODATA: this object doesn't have any xattrs |
2628 |
++ * -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk. |
2629 |
++ * Neither are errors |
2630 |
++ */ |
2631 |
++ if (err == -ENODATA || err == -EOPNOTSUPP) |
2632 |
+ err = 0; |
2633 |
+ return err; |
2634 |
+ } |
2635 |
+diff --git a/include/dt-bindings/reset/amlogic,meson8b-reset.h b/include/dt-bindings/reset/amlogic,meson8b-reset.h |
2636 |
+index 614aff2c7aff..a03e86fe2c57 100644 |
2637 |
+--- a/include/dt-bindings/reset/amlogic,meson8b-reset.h |
2638 |
++++ b/include/dt-bindings/reset/amlogic,meson8b-reset.h |
2639 |
+@@ -95,9 +95,9 @@ |
2640 |
+ #define RESET_VD_RMEM 64 |
2641 |
+ #define RESET_AUDIN 65 |
2642 |
+ #define RESET_DBLK 66 |
2643 |
+-#define RESET_PIC_DC 66 |
2644 |
+-#define RESET_PSC 66 |
2645 |
+-#define RESET_NAND 66 |
2646 |
++#define RESET_PIC_DC 67 |
2647 |
++#define RESET_PSC 68 |
2648 |
++#define RESET_NAND 69 |
2649 |
+ #define RESET_GE2D 70 |
2650 |
+ #define RESET_PARSER_REG 71 |
2651 |
+ #define RESET_PARSER_FETCH 72 |
2652 |
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h |
2653 |
+index 7582a5712458..2fc4ba6fa07f 100644 |
2654 |
+--- a/include/linux/blkdev.h |
2655 |
++++ b/include/linux/blkdev.h |
2656 |
+@@ -277,6 +277,7 @@ struct queue_limits { |
2657 |
+ unsigned int max_sectors; |
2658 |
+ unsigned int max_segment_size; |
2659 |
+ unsigned int physical_block_size; |
2660 |
++ unsigned int logical_block_size; |
2661 |
+ unsigned int alignment_offset; |
2662 |
+ unsigned int io_min; |
2663 |
+ unsigned int io_opt; |
2664 |
+@@ -286,7 +287,6 @@ struct queue_limits { |
2665 |
+ unsigned int discard_granularity; |
2666 |
+ unsigned int discard_alignment; |
2667 |
+ |
2668 |
+- unsigned short logical_block_size; |
2669 |
+ unsigned short max_segments; |
2670 |
+ unsigned short max_integrity_segments; |
2671 |
+ |
2672 |
+@@ -996,7 +996,7 @@ extern void blk_queue_max_discard_sectors(struct request_queue *q, |
2673 |
+ unsigned int max_discard_sectors); |
2674 |
+ extern void blk_queue_max_write_same_sectors(struct request_queue *q, |
2675 |
+ unsigned int max_write_same_sectors); |
2676 |
+-extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); |
2677 |
++extern void blk_queue_logical_block_size(struct request_queue *, unsigned int); |
2678 |
+ extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); |
2679 |
+ extern void blk_queue_alignment_offset(struct request_queue *q, |
2680 |
+ unsigned int alignment); |
2681 |
+@@ -1221,7 +1221,7 @@ static inline unsigned int queue_max_segment_size(struct request_queue *q) |
2682 |
+ return q->limits.max_segment_size; |
2683 |
+ } |
2684 |
+ |
2685 |
+-static inline unsigned short queue_logical_block_size(struct request_queue *q) |
2686 |
++static inline unsigned queue_logical_block_size(struct request_queue *q) |
2687 |
+ { |
2688 |
+ int retval = 512; |
2689 |
+ |
2690 |
+@@ -1231,7 +1231,7 @@ static inline unsigned short queue_logical_block_size(struct request_queue *q) |
2691 |
+ return retval; |
2692 |
+ } |
2693 |
+ |
2694 |
+-static inline unsigned short bdev_logical_block_size(struct block_device *bdev) |
2695 |
++static inline unsigned int bdev_logical_block_size(struct block_device *bdev) |
2696 |
+ { |
2697 |
+ return queue_logical_block_size(bdev_get_queue(bdev)); |
2698 |
+ } |
2699 |
+diff --git a/include/linux/poll.h b/include/linux/poll.h |
2700 |
+index 37b057b63b46..4bee398ed2fa 100644 |
2701 |
+--- a/include/linux/poll.h |
2702 |
++++ b/include/linux/poll.h |
2703 |
+@@ -14,7 +14,11 @@ |
2704 |
+ extern struct ctl_table epoll_table[]; /* for sysctl */ |
2705 |
+ /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating |
2706 |
+ additional memory. */ |
2707 |
++#ifdef __clang__ |
2708 |
++#define MAX_STACK_ALLOC 768 |
2709 |
++#else |
2710 |
+ #define MAX_STACK_ALLOC 832 |
2711 |
++#endif |
2712 |
+ #define FRONTEND_STACK_ALLOC 256 |
2713 |
+ #define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC |
2714 |
+ #define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC |
2715 |
+diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h |
2716 |
+index 260c4aa1d976..3f6b8b9ef49d 100644 |
2717 |
+--- a/include/linux/regulator/ab8500.h |
2718 |
++++ b/include/linux/regulator/ab8500.h |
2719 |
+@@ -43,8 +43,6 @@ enum ab8505_regulator_id { |
2720 |
+ AB8505_LDO_ANAMIC2, |
2721 |
+ AB8505_LDO_AUX8, |
2722 |
+ AB8505_LDO_ANA, |
2723 |
+- AB8505_SYSCLKREQ_2, |
2724 |
+- AB8505_SYSCLKREQ_4, |
2725 |
+ AB8505_NUM_REGULATORS, |
2726 |
+ }; |
2727 |
+ |
2728 |
+diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h |
2729 |
+index 9d57639223c3..28a0d7a8c142 100644 |
2730 |
+--- a/include/net/cfg80211.h |
2731 |
++++ b/include/net/cfg80211.h |
2732 |
+@@ -4181,6 +4181,17 @@ static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len) |
2733 |
+ const u8 *cfg80211_find_vendor_ie(unsigned int oui, int oui_type, |
2734 |
+ const u8 *ies, int len); |
2735 |
+ |
2736 |
++/** |
2737 |
++ * cfg80211_send_layer2_update - send layer 2 update frame |
2738 |
++ * |
2739 |
++ * @dev: network device |
2740 |
++ * @addr: STA MAC address |
2741 |
++ * |
2742 |
++ * Wireless drivers can use this function to update forwarding tables in bridge |
2743 |
++ * devices upon STA association. |
2744 |
++ */ |
2745 |
++void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr); |
2746 |
++ |
2747 |
+ /** |
2748 |
+ * DOC: Regulatory enforcement infrastructure |
2749 |
+ * |
2750 |
+diff --git a/mm/page-writeback.c b/mm/page-writeback.c |
2751 |
+index f6a376a51099..462c778b9fb5 100644 |
2752 |
+--- a/mm/page-writeback.c |
2753 |
++++ b/mm/page-writeback.c |
2754 |
+@@ -200,11 +200,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, |
2755 |
+ if (this_bw < tot_bw) { |
2756 |
+ if (min) { |
2757 |
+ min *= this_bw; |
2758 |
+- do_div(min, tot_bw); |
2759 |
++ min = div64_ul(min, tot_bw); |
2760 |
+ } |
2761 |
+ if (max < 100) { |
2762 |
+ max *= this_bw; |
2763 |
+- do_div(max, tot_bw); |
2764 |
++ max = div64_ul(max, tot_bw); |
2765 |
+ } |
2766 |
+ } |
2767 |
+ |
2768 |
+diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c |
2769 |
+index df7c6a080188..3b440b8d7c05 100644 |
2770 |
+--- a/net/batman-adv/distributed-arp-table.c |
2771 |
++++ b/net/batman-adv/distributed-arp-table.c |
2772 |
+@@ -242,6 +242,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
2773 |
+ u32 hash = 0; |
2774 |
+ const struct batadv_dat_entry *dat = data; |
2775 |
+ const unsigned char *key; |
2776 |
++ __be16 vid; |
2777 |
+ u32 i; |
2778 |
+ |
2779 |
+ key = (const unsigned char *)&dat->ip; |
2780 |
+@@ -251,7 +252,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) |
2781 |
+ hash ^= (hash >> 6); |
2782 |
+ } |
2783 |
+ |
2784 |
+- key = (const unsigned char *)&dat->vid; |
2785 |
++ vid = htons(dat->vid); |
2786 |
++ key = (__force const unsigned char *)&vid; |
2787 |
+ for (i = 0; i < sizeof(dat->vid); i++) { |
2788 |
+ hash += key[i]; |
2789 |
+ hash += (hash << 10); |
2790 |
+diff --git a/net/core/ethtool.c b/net/core/ethtool.c |
2791 |
+index 454f73fcb3a6..476665f917a2 100644 |
2792 |
+--- a/net/core/ethtool.c |
2793 |
++++ b/net/core/ethtool.c |
2794 |
+@@ -2332,9 +2332,10 @@ out: |
2795 |
+ return ret; |
2796 |
+ } |
2797 |
+ |
2798 |
+-static int ethtool_get_per_queue_coalesce(struct net_device *dev, |
2799 |
+- void __user *useraddr, |
2800 |
+- struct ethtool_per_queue_op *per_queue_opt) |
2801 |
++static noinline_for_stack int |
2802 |
++ethtool_get_per_queue_coalesce(struct net_device *dev, |
2803 |
++ void __user *useraddr, |
2804 |
++ struct ethtool_per_queue_op *per_queue_opt) |
2805 |
+ { |
2806 |
+ u32 bit; |
2807 |
+ int ret; |
2808 |
+@@ -2364,9 +2365,10 @@ static int ethtool_get_per_queue_coalesce(struct net_device *dev, |
2809 |
+ return 0; |
2810 |
+ } |
2811 |
+ |
2812 |
+-static int ethtool_set_per_queue_coalesce(struct net_device *dev, |
2813 |
+- void __user *useraddr, |
2814 |
+- struct ethtool_per_queue_op *per_queue_opt) |
2815 |
++static noinline_for_stack int |
2816 |
++ethtool_set_per_queue_coalesce(struct net_device *dev, |
2817 |
++ void __user *useraddr, |
2818 |
++ struct ethtool_per_queue_op *per_queue_opt) |
2819 |
+ { |
2820 |
+ u32 bit; |
2821 |
+ int i, ret = 0; |
2822 |
+@@ -2423,7 +2425,7 @@ roll_back: |
2823 |
+ return ret; |
2824 |
+ } |
2825 |
+ |
2826 |
+-static int ethtool_set_per_queue(struct net_device *dev, |
2827 |
++static int noinline_for_stack ethtool_set_per_queue(struct net_device *dev, |
2828 |
+ void __user *useraddr, u32 sub_cmd) |
2829 |
+ { |
2830 |
+ struct ethtool_per_queue_op per_queue_opt; |
2831 |
+diff --git a/net/dccp/feat.c b/net/dccp/feat.c |
2832 |
+index f227f002c73d..db87d9f58019 100644 |
2833 |
+--- a/net/dccp/feat.c |
2834 |
++++ b/net/dccp/feat.c |
2835 |
+@@ -738,7 +738,12 @@ static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local, |
2836 |
+ if (dccp_feat_clone_sp_val(&fval, sp_val, sp_len)) |
2837 |
+ return -ENOMEM; |
2838 |
+ |
2839 |
+- return dccp_feat_push_change(fn, feat, is_local, mandatory, &fval); |
2840 |
++ if (dccp_feat_push_change(fn, feat, is_local, mandatory, &fval)) { |
2841 |
++ kfree(fval.sp.vec); |
2842 |
++ return -ENOMEM; |
2843 |
++ } |
2844 |
++ |
2845 |
++ return 0; |
2846 |
+ } |
2847 |
+ |
2848 |
+ /** |
2849 |
+diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c |
2850 |
+index 0c90cacee7aa..8108741cf8fb 100644 |
2851 |
+--- a/net/dsa/tag_qca.c |
2852 |
++++ b/net/dsa/tag_qca.c |
2853 |
+@@ -40,9 +40,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) |
2854 |
+ struct dsa_slave_priv *p = netdev_priv(dev); |
2855 |
+ u16 *phdr, hdr; |
2856 |
+ |
2857 |
+- dev->stats.tx_packets++; |
2858 |
+- dev->stats.tx_bytes += skb->len; |
2859 |
+- |
2860 |
+ if (skb_cow_head(skb, 0) < 0) |
2861 |
+ goto out_free; |
2862 |
+ |
2863 |
+diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c |
2864 |
+index 52694cb759b0..aead5ac4dbf6 100644 |
2865 |
+--- a/net/hsr/hsr_device.c |
2866 |
++++ b/net/hsr/hsr_device.c |
2867 |
+@@ -281,6 +281,8 @@ static void send_hsr_supervision_frame(struct hsr_port *master, |
2868 |
+ skb->dev->dev_addr, skb->len) <= 0) |
2869 |
+ goto out; |
2870 |
+ skb_reset_mac_header(skb); |
2871 |
++ skb_reset_network_header(skb); |
2872 |
++ skb_reset_transport_header(skb); |
2873 |
+ |
2874 |
+ if (hsrVer > 0) { |
2875 |
+ hsr_tag = (typeof(hsr_tag)) skb_put(skb, sizeof(struct hsr_tag)); |
2876 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
2877 |
+index d819e91df90d..e02b86265194 100644 |
2878 |
+--- a/net/ipv4/netfilter/arp_tables.c |
2879 |
++++ b/net/ipv4/netfilter/arp_tables.c |
2880 |
+@@ -515,12 +515,13 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, |
2881 |
+ return 0; |
2882 |
+ } |
2883 |
+ |
2884 |
+-static inline void cleanup_entry(struct arpt_entry *e) |
2885 |
++static void cleanup_entry(struct arpt_entry *e, struct net *net) |
2886 |
+ { |
2887 |
+ struct xt_tgdtor_param par; |
2888 |
+ struct xt_entry_target *t; |
2889 |
+ |
2890 |
+ t = arpt_get_target(e); |
2891 |
++ par.net = net; |
2892 |
+ par.target = t->u.kernel.target; |
2893 |
+ par.targinfo = t->data; |
2894 |
+ par.family = NFPROTO_ARP; |
2895 |
+@@ -612,7 +613,7 @@ static int translate_table(struct net *net, |
2896 |
+ xt_entry_foreach(iter, entry0, newinfo->size) { |
2897 |
+ if (i-- == 0) |
2898 |
+ break; |
2899 |
+- cleanup_entry(iter); |
2900 |
++ cleanup_entry(iter, net); |
2901 |
+ } |
2902 |
+ return ret; |
2903 |
+ } |
2904 |
+@@ -939,7 +940,7 @@ static int __do_replace(struct net *net, const char *name, |
2905 |
+ /* Decrease module usage counts and free resource */ |
2906 |
+ loc_cpu_old_entry = oldinfo->entries; |
2907 |
+ xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size) |
2908 |
+- cleanup_entry(iter); |
2909 |
++ cleanup_entry(iter, net); |
2910 |
+ |
2911 |
+ xt_free_table_info(oldinfo); |
2912 |
+ if (copy_to_user(counters_ptr, counters, |
2913 |
+@@ -1003,7 +1004,7 @@ static int do_replace(struct net *net, const void __user *user, |
2914 |
+ |
2915 |
+ free_newinfo_untrans: |
2916 |
+ xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
2917 |
+- cleanup_entry(iter); |
2918 |
++ cleanup_entry(iter, net); |
2919 |
+ free_newinfo: |
2920 |
+ xt_free_table_info(newinfo); |
2921 |
+ return ret; |
2922 |
+@@ -1300,7 +1301,7 @@ static int compat_do_replace(struct net *net, void __user *user, |
2923 |
+ |
2924 |
+ free_newinfo_untrans: |
2925 |
+ xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
2926 |
+- cleanup_entry(iter); |
2927 |
++ cleanup_entry(iter, net); |
2928 |
+ free_newinfo: |
2929 |
+ xt_free_table_info(newinfo); |
2930 |
+ return ret; |
2931 |
+@@ -1527,7 +1528,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len |
2932 |
+ return ret; |
2933 |
+ } |
2934 |
+ |
2935 |
+-static void __arpt_unregister_table(struct xt_table *table) |
2936 |
++static void __arpt_unregister_table(struct net *net, struct xt_table *table) |
2937 |
+ { |
2938 |
+ struct xt_table_info *private; |
2939 |
+ void *loc_cpu_entry; |
2940 |
+@@ -1539,7 +1540,7 @@ static void __arpt_unregister_table(struct xt_table *table) |
2941 |
+ /* Decrease module usage counts and free resources */ |
2942 |
+ loc_cpu_entry = private->entries; |
2943 |
+ xt_entry_foreach(iter, loc_cpu_entry, private->size) |
2944 |
+- cleanup_entry(iter); |
2945 |
++ cleanup_entry(iter, net); |
2946 |
+ if (private->number > private->initial_entries) |
2947 |
+ module_put(table_owner); |
2948 |
+ xt_free_table_info(private); |
2949 |
+@@ -1579,7 +1580,7 @@ int arpt_register_table(struct net *net, |
2950 |
+ |
2951 |
+ ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2952 |
+ if (ret != 0) { |
2953 |
+- __arpt_unregister_table(new_table); |
2954 |
++ __arpt_unregister_table(net, new_table); |
2955 |
+ *res = NULL; |
2956 |
+ } |
2957 |
+ |
2958 |
+@@ -1594,7 +1595,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table, |
2959 |
+ const struct nf_hook_ops *ops) |
2960 |
+ { |
2961 |
+ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
2962 |
+- __arpt_unregister_table(table); |
2963 |
++ __arpt_unregister_table(net, table); |
2964 |
+ } |
2965 |
+ |
2966 |
+ /* The built-in targets: standard (NULL) and error. */ |
2967 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2968 |
+index 9644dcef5a2b..52014c5312b9 100644 |
2969 |
+--- a/net/ipv4/tcp_input.c |
2970 |
++++ b/net/ipv4/tcp_input.c |
2971 |
+@@ -923,9 +923,10 @@ static void tcp_update_reordering(struct sock *sk, const int metric, |
2972 |
+ /* This must be called before lost_out is incremented */ |
2973 |
+ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) |
2974 |
+ { |
2975 |
+- if (!tp->retransmit_skb_hint || |
2976 |
+- before(TCP_SKB_CB(skb)->seq, |
2977 |
+- TCP_SKB_CB(tp->retransmit_skb_hint)->seq)) |
2978 |
++ if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) || |
2979 |
++ (tp->retransmit_skb_hint && |
2980 |
++ before(TCP_SKB_CB(skb)->seq, |
2981 |
++ TCP_SKB_CB(tp->retransmit_skb_hint)->seq))) |
2982 |
+ tp->retransmit_skb_hint = skb; |
2983 |
+ |
2984 |
+ if (!tp->lost_out || |
2985 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
2986 |
+index 3b2c4692d966..88dd5d218fe3 100644 |
2987 |
+--- a/net/mac80211/cfg.c |
2988 |
++++ b/net/mac80211/cfg.c |
2989 |
+@@ -1048,50 +1048,6 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) |
2990 |
+ return 0; |
2991 |
+ } |
2992 |
+ |
2993 |
+-/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ |
2994 |
+-struct iapp_layer2_update { |
2995 |
+- u8 da[ETH_ALEN]; /* broadcast */ |
2996 |
+- u8 sa[ETH_ALEN]; /* STA addr */ |
2997 |
+- __be16 len; /* 6 */ |
2998 |
+- u8 dsap; /* 0 */ |
2999 |
+- u8 ssap; /* 0 */ |
3000 |
+- u8 control; |
3001 |
+- u8 xid_info[3]; |
3002 |
+-} __packed; |
3003 |
+- |
3004 |
+-static void ieee80211_send_layer2_update(struct sta_info *sta) |
3005 |
+-{ |
3006 |
+- struct iapp_layer2_update *msg; |
3007 |
+- struct sk_buff *skb; |
3008 |
+- |
3009 |
+- /* Send Level 2 Update Frame to update forwarding tables in layer 2 |
3010 |
+- * bridge devices */ |
3011 |
+- |
3012 |
+- skb = dev_alloc_skb(sizeof(*msg)); |
3013 |
+- if (!skb) |
3014 |
+- return; |
3015 |
+- msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg)); |
3016 |
+- |
3017 |
+- /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID) |
3018 |
+- * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ |
3019 |
+- |
3020 |
+- eth_broadcast_addr(msg->da); |
3021 |
+- memcpy(msg->sa, sta->sta.addr, ETH_ALEN); |
3022 |
+- msg->len = htons(6); |
3023 |
+- msg->dsap = 0; |
3024 |
+- msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ |
3025 |
+- msg->control = 0xaf; /* XID response lsb.1111F101. |
3026 |
+- * F=0 (no poll command; unsolicited frame) */ |
3027 |
+- msg->xid_info[0] = 0x81; /* XID format identifier */ |
3028 |
+- msg->xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */ |
3029 |
+- msg->xid_info[2] = 0; /* XID sender's receive window size (RW) */ |
3030 |
+- |
3031 |
+- skb->dev = sta->sdata->dev; |
3032 |
+- skb->protocol = eth_type_trans(skb, sta->sdata->dev); |
3033 |
+- memset(skb->cb, 0, sizeof(skb->cb)); |
3034 |
+- netif_rx_ni(skb); |
3035 |
+-} |
3036 |
+- |
3037 |
+ static int sta_apply_auth_flags(struct ieee80211_local *local, |
3038 |
+ struct sta_info *sta, |
3039 |
+ u32 mask, u32 set) |
3040 |
+@@ -1401,7 +1357,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, |
3041 |
+ struct sta_info *sta; |
3042 |
+ struct ieee80211_sub_if_data *sdata; |
3043 |
+ int err; |
3044 |
+- int layer2_update; |
3045 |
+ |
3046 |
+ if (params->vlan) { |
3047 |
+ sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
3048 |
+@@ -1445,18 +1400,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, |
3049 |
+ test_sta_flag(sta, WLAN_STA_ASSOC)) |
3050 |
+ rate_control_rate_init(sta); |
3051 |
+ |
3052 |
+- layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |
3053 |
+- sdata->vif.type == NL80211_IFTYPE_AP; |
3054 |
+- |
3055 |
+ err = sta_info_insert_rcu(sta); |
3056 |
+ if (err) { |
3057 |
+ rcu_read_unlock(); |
3058 |
+ return err; |
3059 |
+ } |
3060 |
+ |
3061 |
+- if (layer2_update) |
3062 |
+- ieee80211_send_layer2_update(sta); |
3063 |
+- |
3064 |
+ rcu_read_unlock(); |
3065 |
+ |
3066 |
+ return 0; |
3067 |
+@@ -1565,7 +1514,9 @@ static int ieee80211_change_station(struct wiphy *wiphy, |
3068 |
+ atomic_inc(&sta->sdata->bss->num_mcast_sta); |
3069 |
+ } |
3070 |
+ |
3071 |
+- ieee80211_send_layer2_update(sta); |
3072 |
++ if (sta->sta_state == IEEE80211_STA_AUTHORIZED) |
3073 |
++ cfg80211_send_layer2_update(sta->sdata->dev, |
3074 |
++ sta->sta.addr); |
3075 |
+ } |
3076 |
+ |
3077 |
+ err = sta_apply_parameters(local, sta, params); |
3078 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
3079 |
+index 8e8a185dbb9b..c800bc7c5176 100644 |
3080 |
+--- a/net/mac80211/sta_info.c |
3081 |
++++ b/net/mac80211/sta_info.c |
3082 |
+@@ -1896,6 +1896,10 @@ int sta_info_move_state(struct sta_info *sta, |
3083 |
+ ieee80211_check_fast_xmit(sta); |
3084 |
+ ieee80211_check_fast_rx(sta); |
3085 |
+ } |
3086 |
++ if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |
3087 |
++ sta->sdata->vif.type == NL80211_IFTYPE_AP) |
3088 |
++ cfg80211_send_layer2_update(sta->sdata->dev, |
3089 |
++ sta->sta.addr); |
3090 |
+ break; |
3091 |
+ default: |
3092 |
+ break; |
3093 |
+diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h |
3094 |
+index 2e8e7e5fb4a6..9b32059dee2d 100644 |
3095 |
+--- a/net/netfilter/ipset/ip_set_bitmap_gen.h |
3096 |
++++ b/net/netfilter/ipset/ip_set_bitmap_gen.h |
3097 |
+@@ -66,9 +66,9 @@ mtype_destroy(struct ip_set *set) |
3098 |
+ if (SET_WITH_TIMEOUT(set)) |
3099 |
+ del_timer_sync(&map->gc); |
3100 |
+ |
3101 |
+- ip_set_free(map->members); |
3102 |
+ if (set->dsize && set->extensions & IPSET_EXT_DESTROY) |
3103 |
+ mtype_ext_cleanup(set); |
3104 |
++ ip_set_free(map->members); |
3105 |
+ ip_set_free(map); |
3106 |
+ |
3107 |
+ set->data = NULL; |
3108 |
+diff --git a/net/socket.c b/net/socket.c |
3109 |
+index bf99bc1fab2c..65afc8ec68d4 100644 |
3110 |
+--- a/net/socket.c |
3111 |
++++ b/net/socket.c |
3112 |
+@@ -3160,6 +3160,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, |
3113 |
+ case SIOCSARP: |
3114 |
+ case SIOCGARP: |
3115 |
+ case SIOCDARP: |
3116 |
++ case SIOCOUTQNSD: |
3117 |
+ case SIOCATMARK: |
3118 |
+ return sock_do_ioctl(net, sock, cmd, arg); |
3119 |
+ } |
3120 |
+diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h |
3121 |
+index 11cf83c8ad4f..8cd56eaba7d6 100644 |
3122 |
+--- a/net/wireless/rdev-ops.h |
3123 |
++++ b/net/wireless/rdev-ops.h |
3124 |
+@@ -525,6 +525,10 @@ static inline int |
3125 |
+ rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) |
3126 |
+ { |
3127 |
+ int ret; |
3128 |
++ |
3129 |
++ if (!rdev->ops->set_wiphy_params) |
3130 |
++ return -EOPNOTSUPP; |
3131 |
++ |
3132 |
+ trace_rdev_set_wiphy_params(&rdev->wiphy, changed); |
3133 |
+ ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
3134 |
+ trace_rdev_return_int(&rdev->wiphy, ret); |
3135 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
3136 |
+index c93f333c675b..262922cf6a0c 100644 |
3137 |
+--- a/net/wireless/util.c |
3138 |
++++ b/net/wireless/util.c |
3139 |
+@@ -653,7 +653,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page, |
3140 |
+ struct skb_shared_info *sh = skb_shinfo(skb); |
3141 |
+ int page_offset; |
3142 |
+ |
3143 |
+- page_ref_inc(page); |
3144 |
++ get_page(page); |
3145 |
+ page_offset = ptr - page_address(page); |
3146 |
+ skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); |
3147 |
+ } |
3148 |
+@@ -1794,3 +1794,48 @@ EXPORT_SYMBOL(rfc1042_header); |
3149 |
+ const unsigned char bridge_tunnel_header[] __aligned(2) = |
3150 |
+ { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; |
3151 |
+ EXPORT_SYMBOL(bridge_tunnel_header); |
3152 |
++ |
3153 |
++/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ |
3154 |
++struct iapp_layer2_update { |
3155 |
++ u8 da[ETH_ALEN]; /* broadcast */ |
3156 |
++ u8 sa[ETH_ALEN]; /* STA addr */ |
3157 |
++ __be16 len; /* 6 */ |
3158 |
++ u8 dsap; /* 0 */ |
3159 |
++ u8 ssap; /* 0 */ |
3160 |
++ u8 control; |
3161 |
++ u8 xid_info[3]; |
3162 |
++} __packed; |
3163 |
++ |
3164 |
++void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr) |
3165 |
++{ |
3166 |
++ struct iapp_layer2_update *msg; |
3167 |
++ struct sk_buff *skb; |
3168 |
++ |
3169 |
++ /* Send Level 2 Update Frame to update forwarding tables in layer 2 |
3170 |
++ * bridge devices */ |
3171 |
++ |
3172 |
++ skb = dev_alloc_skb(sizeof(*msg)); |
3173 |
++ if (!skb) |
3174 |
++ return; |
3175 |
++ msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg)); |
3176 |
++ |
3177 |
++ /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID) |
3178 |
++ * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ |
3179 |
++ |
3180 |
++ eth_broadcast_addr(msg->da); |
3181 |
++ ether_addr_copy(msg->sa, addr); |
3182 |
++ msg->len = htons(6); |
3183 |
++ msg->dsap = 0; |
3184 |
++ msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ |
3185 |
++ msg->control = 0xaf; /* XID response lsb.1111F101. |
3186 |
++ * F=0 (no poll command; unsolicited frame) */ |
3187 |
++ msg->xid_info[0] = 0x81; /* XID format identifier */ |
3188 |
++ msg->xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */ |
3189 |
++ msg->xid_info[2] = 0; /* XID sender's receive window size (RW) */ |
3190 |
++ |
3191 |
++ skb->dev = dev; |
3192 |
++ skb->protocol = eth_type_trans(skb, dev); |
3193 |
++ memset(skb->cb, 0, sizeof(skb->cb)); |
3194 |
++ netif_rx_ni(skb); |
3195 |
++} |
3196 |
++EXPORT_SYMBOL(cfg80211_send_layer2_update); |
3197 |
+diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c |
3198 |
+index b80985fbc334..0e1feb597586 100644 |
3199 |
+--- a/sound/core/seq/seq_timer.c |
3200 |
++++ b/sound/core/seq/seq_timer.c |
3201 |
+@@ -479,15 +479,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, |
3202 |
+ q = queueptr(idx); |
3203 |
+ if (q == NULL) |
3204 |
+ continue; |
3205 |
+- if ((tmr = q->timer) == NULL || |
3206 |
+- (ti = tmr->timeri) == NULL) { |
3207 |
+- queuefree(q); |
3208 |
+- continue; |
3209 |
+- } |
3210 |
++ mutex_lock(&q->timer_mutex); |
3211 |
++ tmr = q->timer; |
3212 |
++ if (!tmr) |
3213 |
++ goto unlock; |
3214 |
++ ti = tmr->timeri; |
3215 |
++ if (!ti) |
3216 |
++ goto unlock; |
3217 |
+ snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name); |
3218 |
+ resolution = snd_timer_resolution(ti) * tmr->ticks; |
3219 |
+ snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000); |
3220 |
+ snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base); |
3221 |
++unlock: |
3222 |
++ mutex_unlock(&q->timer_mutex); |
3223 |
+ queuefree(q); |
3224 |
+ } |
3225 |
+ } |
3226 |
+diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c |
3227 |
+index 6e88460cd13d..0abca8783bb3 100644 |
3228 |
+--- a/tools/perf/builtin-report.c |
3229 |
++++ b/tools/perf/builtin-report.c |
3230 |
+@@ -671,6 +671,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) |
3231 |
+ struct stat st; |
3232 |
+ bool has_br_stack = false; |
3233 |
+ int branch_mode = -1; |
3234 |
++ int last_key = 0; |
3235 |
+ bool branch_call_mode = false; |
3236 |
+ char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT; |
3237 |
+ const char * const report_usage[] = { |
3238 |
+@@ -956,7 +957,8 @@ repeat: |
3239 |
+ else |
3240 |
+ use_browser = 0; |
3241 |
+ |
3242 |
+- if (setup_sorting(session->evlist) < 0) { |
3243 |
++ if ((last_key != K_SWITCH_INPUT_DATA) && |
3244 |
++ (setup_sorting(session->evlist) < 0)) { |
3245 |
+ if (sort_order) |
3246 |
+ parse_options_usage(report_usage, options, "s", 1); |
3247 |
+ if (field_order) |
3248 |
+@@ -1011,6 +1013,7 @@ repeat: |
3249 |
+ ret = __cmd_report(&report); |
3250 |
+ if (ret == K_SWITCH_INPUT_DATA) { |
3251 |
+ perf_session__delete(session); |
3252 |
++ last_key = K_SWITCH_INPUT_DATA; |
3253 |
+ goto repeat; |
3254 |
+ } else |
3255 |
+ ret = 0; |
3256 |
+diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h |
3257 |
+index 159d616e170b..fdd7a1cb6be9 100644 |
3258 |
+--- a/tools/perf/util/hist.h |
3259 |
++++ b/tools/perf/util/hist.h |
3260 |
+@@ -312,10 +312,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format) |
3261 |
+ list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list) |
3262 |
+ |
3263 |
+ #define hists__for_each_format(hists, format) \ |
3264 |
+- perf_hpp_list__for_each_format((hists)->hpp_list, fmt) |
3265 |
++ perf_hpp_list__for_each_format((hists)->hpp_list, format) |
3266 |
+ |
3267 |
+ #define hists__for_each_sort_list(hists, format) \ |
3268 |
+- perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt) |
3269 |
++ perf_hpp_list__for_each_sort_list((hists)->hpp_list, format) |
3270 |
+ |
3271 |
+ extern struct perf_hpp_fmt perf_hpp__format[]; |
3272 |
+ |
3273 |
+diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c |
3274 |
+index 6ca804a01cf9..ffaa798df75e 100644 |
3275 |
+--- a/tools/perf/util/probe-finder.c |
3276 |
++++ b/tools/perf/util/probe-finder.c |
3277 |
+@@ -612,38 +612,26 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod, |
3278 |
+ const char *function, |
3279 |
+ struct probe_trace_point *tp) |
3280 |
+ { |
3281 |
+- Dwarf_Addr eaddr, highaddr; |
3282 |
++ Dwarf_Addr eaddr; |
3283 |
+ GElf_Sym sym; |
3284 |
+ const char *symbol; |
3285 |
+ |
3286 |
+ /* Verify the address is correct */ |
3287 |
+- if (dwarf_entrypc(sp_die, &eaddr) != 0) { |
3288 |
+- pr_warning("Failed to get entry address of %s\n", |
3289 |
+- dwarf_diename(sp_die)); |
3290 |
+- return -ENOENT; |
3291 |
+- } |
3292 |
+- if (dwarf_highpc(sp_die, &highaddr) != 0) { |
3293 |
+- pr_warning("Failed to get end address of %s\n", |
3294 |
+- dwarf_diename(sp_die)); |
3295 |
+- return -ENOENT; |
3296 |
+- } |
3297 |
+- if (paddr > highaddr) { |
3298 |
+- pr_warning("Offset specified is greater than size of %s\n", |
3299 |
++ if (!dwarf_haspc(sp_die, paddr)) { |
3300 |
++ pr_warning("Specified offset is out of %s\n", |
3301 |
+ dwarf_diename(sp_die)); |
3302 |
+ return -EINVAL; |
3303 |
+ } |
3304 |
+ |
3305 |
+- symbol = dwarf_diename(sp_die); |
3306 |
++ /* Try to get actual symbol name from symtab */ |
3307 |
++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
3308 |
+ if (!symbol) { |
3309 |
+- /* Try to get the symbol name from symtab */ |
3310 |
+- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); |
3311 |
+- if (!symbol) { |
3312 |
+- pr_warning("Failed to find symbol at 0x%lx\n", |
3313 |
+- (unsigned long)paddr); |
3314 |
+- return -ENOENT; |
3315 |
+- } |
3316 |
+- eaddr = sym.st_value; |
3317 |
++ pr_warning("Failed to find symbol at 0x%lx\n", |
3318 |
++ (unsigned long)paddr); |
3319 |
++ return -ENOENT; |
3320 |
+ } |
3321 |
++ eaddr = sym.st_value; |
3322 |
++ |
3323 |
+ tp->offset = (unsigned long)(paddr - eaddr); |
3324 |
+ tp->address = (unsigned long)paddr; |
3325 |
+ tp->symbol = strdup(symbol); |
3326 |
+diff --git a/tools/testing/selftests/rseq/settings b/tools/testing/selftests/rseq/settings |
3327 |
+new file mode 100644 |
3328 |
+index 000000000000..e7b9417537fb |
3329 |
+--- /dev/null |
3330 |
++++ b/tools/testing/selftests/rseq/settings |
3331 |
+@@ -0,0 +1 @@ |
3332 |
++timeout=0 |