1 |
commit: 3b8f01df4ca760d54640e17fd95ac407b78fd536 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 21 11:24:21 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 21 11:24:21 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=3b8f01df |
7 |
|
8 |
Linux patcj 4.14.1 |
9 |
|
10 |
0000_README | 4 + |
11 |
1000_linux-4.14.1.patch | 1360 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1364 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index fe79f36..a8d45fc 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -43,6 +43,10 @@ EXPERIMENTAL |
19 |
Individual Patch Descriptions: |
20 |
-------------------------------------------------------------------------- |
21 |
|
22 |
+Patch: 1000_linux-4.14.1.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.14.1 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1000_linux-4.14.1.patch b/1000_linux-4.14.1.patch |
31 |
new file mode 100644 |
32 |
index 0000000..4a007ec |
33 |
--- /dev/null |
34 |
+++ b/1000_linux-4.14.1.patch |
35 |
@@ -0,0 +1,1360 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index ccd981892ef2..01f9df1af256 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,9 +1,9 @@ |
41 |
+ # SPDX-License-Identifier: GPL-2.0 |
42 |
+ VERSION = 4 |
43 |
+ PATCHLEVEL = 14 |
44 |
+-SUBLEVEL = 0 |
45 |
++SUBLEVEL = 1 |
46 |
+ EXTRAVERSION = |
47 |
+-NAME = Fearless Coyote |
48 |
++NAME = Petit Gorille |
49 |
+ |
50 |
+ # *DOCUMENTATION* |
51 |
+ # To see a list of typical targets execute "make help" |
52 |
+diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h |
53 |
+index 3e3823db303e..c73b5a3ab7b9 100644 |
54 |
+--- a/arch/sparc/include/asm/cmpxchg_32.h |
55 |
++++ b/arch/sparc/include/asm/cmpxchg_32.h |
56 |
+@@ -63,6 +63,9 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) |
57 |
+ (unsigned long)_n_, sizeof(*(ptr))); \ |
58 |
+ }) |
59 |
+ |
60 |
++u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new); |
61 |
++#define cmpxchg64(ptr, old, new) __cmpxchg_u64(ptr, old, new) |
62 |
++ |
63 |
+ #include <asm-generic/cmpxchg-local.h> |
64 |
+ |
65 |
+ /* |
66 |
+diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h |
67 |
+index e25d25b0a34b..b361702ef52a 100644 |
68 |
+--- a/arch/sparc/include/asm/mmu_context_64.h |
69 |
++++ b/arch/sparc/include/asm/mmu_context_64.h |
70 |
+@@ -8,9 +8,11 @@ |
71 |
+ |
72 |
+ #include <linux/spinlock.h> |
73 |
+ #include <linux/mm_types.h> |
74 |
++#include <linux/smp.h> |
75 |
+ |
76 |
+ #include <asm/spitfire.h> |
77 |
+ #include <asm-generic/mm_hooks.h> |
78 |
++#include <asm/percpu.h> |
79 |
+ |
80 |
+ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
81 |
+ { |
82 |
+diff --git a/arch/sparc/include/asm/tsb.h b/arch/sparc/include/asm/tsb.h |
83 |
+index 25b6abdb3908..522a677e050d 100644 |
84 |
+--- a/arch/sparc/include/asm/tsb.h |
85 |
++++ b/arch/sparc/include/asm/tsb.h |
86 |
+@@ -217,7 +217,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; |
87 |
+ sllx REG2, 32, REG2; \ |
88 |
+ andcc REG1, REG2, %g0; \ |
89 |
+ be,pt %xcc, 700f; \ |
90 |
+- sethi %hi(0x1ffc0000), REG2; \ |
91 |
++ sethi %hi(0xffe00000), REG2; \ |
92 |
+ sllx REG2, 1, REG2; \ |
93 |
+ brgez,pn REG1, FAIL_LABEL; \ |
94 |
+ andn REG1, REG2, REG1; \ |
95 |
+diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c |
96 |
+index 5010df497387..465a901a0ada 100644 |
97 |
+--- a/arch/sparc/lib/atomic32.c |
98 |
++++ b/arch/sparc/lib/atomic32.c |
99 |
+@@ -173,6 +173,20 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) |
100 |
+ } |
101 |
+ EXPORT_SYMBOL(__cmpxchg_u32); |
102 |
+ |
103 |
++u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new) |
104 |
++{ |
105 |
++ unsigned long flags; |
106 |
++ u64 prev; |
107 |
++ |
108 |
++ spin_lock_irqsave(ATOMIC_HASH(ptr), flags); |
109 |
++ if ((prev = *ptr) == old) |
110 |
++ *ptr = new; |
111 |
++ spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); |
112 |
++ |
113 |
++ return prev; |
114 |
++} |
115 |
++EXPORT_SYMBOL(__cmpxchg_u64); |
116 |
++ |
117 |
+ unsigned long __xchg_u32(volatile u32 *ptr, u32 new) |
118 |
+ { |
119 |
+ unsigned long flags; |
120 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c |
121 |
+index 87cc9ab7a13c..4b8187639c2d 100644 |
122 |
+--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c |
123 |
++++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c |
124 |
+@@ -245,6 +245,9 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc |
125 |
+ |
126 |
+ if (m->status & MCI_STATUS_UC) { |
127 |
+ |
128 |
++ if (ctx == IN_KERNEL) |
129 |
++ return MCE_PANIC_SEVERITY; |
130 |
++ |
131 |
+ /* |
132 |
+ * On older systems where overflow_recov flag is not present, we |
133 |
+ * should simply panic if an error overflow occurs. If |
134 |
+@@ -255,10 +258,6 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc |
135 |
+ if (mce_flags.smca) |
136 |
+ return mce_severity_amd_smca(m, ctx); |
137 |
+ |
138 |
+- /* software can try to contain */ |
139 |
+- if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL)) |
140 |
+- return MCE_PANIC_SEVERITY; |
141 |
+- |
142 |
+ /* kill current process */ |
143 |
+ return MCE_AR_SEVERITY; |
144 |
+ } else { |
145 |
+diff --git a/crypto/dh.c b/crypto/dh.c |
146 |
+index b1032a5c1bfa..aadaf36fb56f 100644 |
147 |
+--- a/crypto/dh.c |
148 |
++++ b/crypto/dh.c |
149 |
+@@ -21,19 +21,12 @@ struct dh_ctx { |
150 |
+ MPI xa; |
151 |
+ }; |
152 |
+ |
153 |
+-static inline void dh_clear_params(struct dh_ctx *ctx) |
154 |
++static void dh_clear_ctx(struct dh_ctx *ctx) |
155 |
+ { |
156 |
+ mpi_free(ctx->p); |
157 |
+ mpi_free(ctx->g); |
158 |
+- ctx->p = NULL; |
159 |
+- ctx->g = NULL; |
160 |
+-} |
161 |
+- |
162 |
+-static void dh_free_ctx(struct dh_ctx *ctx) |
163 |
+-{ |
164 |
+- dh_clear_params(ctx); |
165 |
+ mpi_free(ctx->xa); |
166 |
+- ctx->xa = NULL; |
167 |
++ memset(ctx, 0, sizeof(*ctx)); |
168 |
+ } |
169 |
+ |
170 |
+ /* |
171 |
+@@ -71,10 +64,8 @@ static int dh_set_params(struct dh_ctx *ctx, struct dh *params) |
172 |
+ return -EINVAL; |
173 |
+ |
174 |
+ ctx->g = mpi_read_raw_data(params->g, params->g_size); |
175 |
+- if (!ctx->g) { |
176 |
+- mpi_free(ctx->p); |
177 |
++ if (!ctx->g) |
178 |
+ return -EINVAL; |
179 |
+- } |
180 |
+ |
181 |
+ return 0; |
182 |
+ } |
183 |
+@@ -86,21 +77,23 @@ static int dh_set_secret(struct crypto_kpp *tfm, const void *buf, |
184 |
+ struct dh params; |
185 |
+ |
186 |
+ /* Free the old MPI key if any */ |
187 |
+- dh_free_ctx(ctx); |
188 |
++ dh_clear_ctx(ctx); |
189 |
+ |
190 |
+ if (crypto_dh_decode_key(buf, len, ¶ms) < 0) |
191 |
+- return -EINVAL; |
192 |
++ goto err_clear_ctx; |
193 |
+ |
194 |
+ if (dh_set_params(ctx, ¶ms) < 0) |
195 |
+- return -EINVAL; |
196 |
++ goto err_clear_ctx; |
197 |
+ |
198 |
+ ctx->xa = mpi_read_raw_data(params.key, params.key_size); |
199 |
+- if (!ctx->xa) { |
200 |
+- dh_clear_params(ctx); |
201 |
+- return -EINVAL; |
202 |
+- } |
203 |
++ if (!ctx->xa) |
204 |
++ goto err_clear_ctx; |
205 |
+ |
206 |
+ return 0; |
207 |
++ |
208 |
++err_clear_ctx: |
209 |
++ dh_clear_ctx(ctx); |
210 |
++ return -EINVAL; |
211 |
+ } |
212 |
+ |
213 |
+ static int dh_compute_value(struct kpp_request *req) |
214 |
+@@ -158,7 +151,7 @@ static void dh_exit_tfm(struct crypto_kpp *tfm) |
215 |
+ { |
216 |
+ struct dh_ctx *ctx = dh_get_ctx(tfm); |
217 |
+ |
218 |
+- dh_free_ctx(ctx); |
219 |
++ dh_clear_ctx(ctx); |
220 |
+ } |
221 |
+ |
222 |
+ static struct kpp_alg dh = { |
223 |
+diff --git a/crypto/dh_helper.c b/crypto/dh_helper.c |
224 |
+index 8ba8a3f82620..7f00c771fe8d 100644 |
225 |
+--- a/crypto/dh_helper.c |
226 |
++++ b/crypto/dh_helper.c |
227 |
+@@ -83,6 +83,14 @@ int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) |
228 |
+ if (secret.len != crypto_dh_key_len(params)) |
229 |
+ return -EINVAL; |
230 |
+ |
231 |
++ /* |
232 |
++ * Don't permit the buffer for 'key' or 'g' to be larger than 'p', since |
233 |
++ * some drivers assume otherwise. |
234 |
++ */ |
235 |
++ if (params->key_size > params->p_size || |
236 |
++ params->g_size > params->p_size) |
237 |
++ return -EINVAL; |
238 |
++ |
239 |
+ /* Don't allocate memory. Set pointers to data within |
240 |
+ * the given buffer |
241 |
+ */ |
242 |
+@@ -90,6 +98,14 @@ int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) |
243 |
+ params->p = (void *)(ptr + params->key_size); |
244 |
+ params->g = (void *)(ptr + params->key_size + params->p_size); |
245 |
+ |
246 |
++ /* |
247 |
++ * Don't permit 'p' to be 0. It's not a prime number, and it's subject |
248 |
++ * to corner cases such as 'mod 0' being undefined or |
249 |
++ * crypto_kpp_maxsize() returning 0. |
250 |
++ */ |
251 |
++ if (memchr_inv(params->p, 0, params->p_size) == NULL) |
252 |
++ return -EINVAL; |
253 |
++ |
254 |
+ return 0; |
255 |
+ } |
256 |
+ EXPORT_SYMBOL_GPL(crypto_dh_decode_key); |
257 |
+diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c |
258 |
+index 8685c7e4debd..ee52c355bee0 100644 |
259 |
+--- a/drivers/crypto/bcm/cipher.c |
260 |
++++ b/drivers/crypto/bcm/cipher.c |
261 |
+@@ -256,6 +256,44 @@ spu_ablkcipher_tx_sg_create(struct brcm_message *mssg, |
262 |
+ return 0; |
263 |
+ } |
264 |
+ |
265 |
++static int mailbox_send_message(struct brcm_message *mssg, u32 flags, |
266 |
++ u8 chan_idx) |
267 |
++{ |
268 |
++ int err; |
269 |
++ int retry_cnt = 0; |
270 |
++ struct device *dev = &(iproc_priv.pdev->dev); |
271 |
++ |
272 |
++ err = mbox_send_message(iproc_priv.mbox[chan_idx], mssg); |
273 |
++ if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) { |
274 |
++ while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { |
275 |
++ /* |
276 |
++ * Mailbox queue is full. Since MAY_SLEEP is set, assume |
277 |
++ * not in atomic context and we can wait and try again. |
278 |
++ */ |
279 |
++ retry_cnt++; |
280 |
++ usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); |
281 |
++ err = mbox_send_message(iproc_priv.mbox[chan_idx], |
282 |
++ mssg); |
283 |
++ atomic_inc(&iproc_priv.mb_no_spc); |
284 |
++ } |
285 |
++ } |
286 |
++ if (err < 0) { |
287 |
++ atomic_inc(&iproc_priv.mb_send_fail); |
288 |
++ return err; |
289 |
++ } |
290 |
++ |
291 |
++ /* Check error returned by mailbox controller */ |
292 |
++ err = mssg->error; |
293 |
++ if (unlikely(err < 0)) { |
294 |
++ dev_err(dev, "message error %d", err); |
295 |
++ /* Signal txdone for mailbox channel */ |
296 |
++ } |
297 |
++ |
298 |
++ /* Signal txdone for mailbox channel */ |
299 |
++ mbox_client_txdone(iproc_priv.mbox[chan_idx], err); |
300 |
++ return err; |
301 |
++} |
302 |
++ |
303 |
+ /** |
304 |
+ * handle_ablkcipher_req() - Submit as much of a block cipher request as fits in |
305 |
+ * a single SPU request message, starting at the current position in the request |
306 |
+@@ -293,7 +331,6 @@ static int handle_ablkcipher_req(struct iproc_reqctx_s *rctx) |
307 |
+ u32 pad_len; /* total length of all padding */ |
308 |
+ bool update_key = false; |
309 |
+ struct brcm_message *mssg; /* mailbox message */ |
310 |
+- int retry_cnt = 0; |
311 |
+ |
312 |
+ /* number of entries in src and dst sg in mailbox message. */ |
313 |
+ u8 rx_frag_num = 2; /* response header and STATUS */ |
314 |
+@@ -462,24 +499,9 @@ static int handle_ablkcipher_req(struct iproc_reqctx_s *rctx) |
315 |
+ if (err) |
316 |
+ return err; |
317 |
+ |
318 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); |
319 |
+- if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { |
320 |
+- while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { |
321 |
+- /* |
322 |
+- * Mailbox queue is full. Since MAY_SLEEP is set, assume |
323 |
+- * not in atomic context and we can wait and try again. |
324 |
+- */ |
325 |
+- retry_cnt++; |
326 |
+- usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); |
327 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], |
328 |
+- mssg); |
329 |
+- atomic_inc(&iproc_priv.mb_no_spc); |
330 |
+- } |
331 |
+- } |
332 |
+- if (unlikely(err < 0)) { |
333 |
+- atomic_inc(&iproc_priv.mb_send_fail); |
334 |
++ err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); |
335 |
++ if (unlikely(err < 0)) |
336 |
+ return err; |
337 |
+- } |
338 |
+ |
339 |
+ return -EINPROGRESS; |
340 |
+ } |
341 |
+@@ -710,7 +732,6 @@ static int handle_ahash_req(struct iproc_reqctx_s *rctx) |
342 |
+ u32 spu_hdr_len; |
343 |
+ unsigned int digestsize; |
344 |
+ u16 rem = 0; |
345 |
+- int retry_cnt = 0; |
346 |
+ |
347 |
+ /* |
348 |
+ * number of entries in src and dst sg. Always includes SPU msg header. |
349 |
+@@ -904,24 +925,10 @@ static int handle_ahash_req(struct iproc_reqctx_s *rctx) |
350 |
+ if (err) |
351 |
+ return err; |
352 |
+ |
353 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); |
354 |
+- if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { |
355 |
+- while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { |
356 |
+- /* |
357 |
+- * Mailbox queue is full. Since MAY_SLEEP is set, assume |
358 |
+- * not in atomic context and we can wait and try again. |
359 |
+- */ |
360 |
+- retry_cnt++; |
361 |
+- usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); |
362 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], |
363 |
+- mssg); |
364 |
+- atomic_inc(&iproc_priv.mb_no_spc); |
365 |
+- } |
366 |
+- } |
367 |
+- if (err < 0) { |
368 |
+- atomic_inc(&iproc_priv.mb_send_fail); |
369 |
++ err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); |
370 |
++ if (unlikely(err < 0)) |
371 |
+ return err; |
372 |
+- } |
373 |
++ |
374 |
+ return -EINPROGRESS; |
375 |
+ } |
376 |
+ |
377 |
+@@ -1320,7 +1327,6 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx) |
378 |
+ int assoc_nents = 0; |
379 |
+ bool incl_icv = false; |
380 |
+ unsigned int digestsize = ctx->digestsize; |
381 |
+- int retry_cnt = 0; |
382 |
+ |
383 |
+ /* number of entries in src and dst sg. Always includes SPU msg header. |
384 |
+ */ |
385 |
+@@ -1558,24 +1564,9 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx) |
386 |
+ if (err) |
387 |
+ return err; |
388 |
+ |
389 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], mssg); |
390 |
+- if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) { |
391 |
+- while ((err == -ENOBUFS) && (retry_cnt < SPU_MB_RETRY_MAX)) { |
392 |
+- /* |
393 |
+- * Mailbox queue is full. Since MAY_SLEEP is set, assume |
394 |
+- * not in atomic context and we can wait and try again. |
395 |
+- */ |
396 |
+- retry_cnt++; |
397 |
+- usleep_range(MBOX_SLEEP_MIN, MBOX_SLEEP_MAX); |
398 |
+- err = mbox_send_message(iproc_priv.mbox[rctx->chan_idx], |
399 |
+- mssg); |
400 |
+- atomic_inc(&iproc_priv.mb_no_spc); |
401 |
+- } |
402 |
+- } |
403 |
+- if (err < 0) { |
404 |
+- atomic_inc(&iproc_priv.mb_send_fail); |
405 |
++ err = mailbox_send_message(mssg, req->base.flags, rctx->chan_idx); |
406 |
++ if (unlikely(err < 0)) |
407 |
+ return err; |
408 |
+- } |
409 |
+ |
410 |
+ return -EINPROGRESS; |
411 |
+ } |
412 |
+@@ -4537,7 +4528,7 @@ static int spu_mb_init(struct device *dev) |
413 |
+ mcl->dev = dev; |
414 |
+ mcl->tx_block = false; |
415 |
+ mcl->tx_tout = 0; |
416 |
+- mcl->knows_txdone = false; |
417 |
++ mcl->knows_txdone = true; |
418 |
+ mcl->rx_callback = spu_rx_callback; |
419 |
+ mcl->tx_done = NULL; |
420 |
+ |
421 |
+diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c |
422 |
+index 34ff53290b03..47edc7fbf91f 100644 |
423 |
+--- a/drivers/dma/dmatest.c |
424 |
++++ b/drivers/dma/dmatest.c |
425 |
+@@ -702,6 +702,7 @@ static int dmatest_func(void *data) |
426 |
+ * free it this time?" dancing. For now, just |
427 |
+ * leave it dangling. |
428 |
+ */ |
429 |
++ WARN(1, "dmatest: Kernel stack may be corrupted!!\n"); |
430 |
+ dmaengine_unmap_put(um); |
431 |
+ result("test timed out", total_tests, src_off, dst_off, |
432 |
+ len, 0); |
433 |
+diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c |
434 |
+index dc0591654011..6241fa787d66 100644 |
435 |
+--- a/drivers/edac/sb_edac.c |
436 |
++++ b/drivers/edac/sb_edac.c |
437 |
+@@ -462,6 +462,7 @@ static const struct pci_id_table pci_dev_descr_sbridge_table[] = { |
438 |
+ static const struct pci_id_descr pci_dev_descr_ibridge[] = { |
439 |
+ /* Processor Home Agent */ |
440 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0, 0, IMC0) }, |
441 |
++ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1, 1, IMC1) }, |
442 |
+ |
443 |
+ /* Memory controller */ |
444 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA, 0, IMC0) }, |
445 |
+@@ -472,7 +473,6 @@ static const struct pci_id_descr pci_dev_descr_ibridge[] = { |
446 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TAD3, 0, IMC0) }, |
447 |
+ |
448 |
+ /* Optional, mode 2HA */ |
449 |
+- { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1, 1, IMC1) }, |
450 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA, 1, IMC1) }, |
451 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS, 1, IMC1) }, |
452 |
+ { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TAD0, 1, IMC1) }, |
453 |
+@@ -2291,6 +2291,13 @@ static int sbridge_get_onedevice(struct pci_dev **prev, |
454 |
+ next_imc: |
455 |
+ sbridge_dev = get_sbridge_dev(bus, dev_descr->dom, multi_bus, sbridge_dev); |
456 |
+ if (!sbridge_dev) { |
457 |
++ /* If the HA1 wasn't found, don't create EDAC second memory controller */ |
458 |
++ if (dev_descr->dom == IMC1 && devno != 1) { |
459 |
++ edac_dbg(0, "Skip IMC1: %04x:%04x (since HA1 was absent)\n", |
460 |
++ PCI_VENDOR_ID_INTEL, dev_descr->dev_id); |
461 |
++ pci_dev_put(pdev); |
462 |
++ return 0; |
463 |
++ } |
464 |
+ |
465 |
+ if (dev_descr->dom == SOCK) |
466 |
+ goto out_imc; |
467 |
+diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig |
468 |
+index 374301fcbc86..8c7a0ce147a1 100644 |
469 |
+--- a/drivers/hid/Kconfig |
470 |
++++ b/drivers/hid/Kconfig |
471 |
+@@ -230,7 +230,7 @@ config HID_CMEDIA |
472 |
+ |
473 |
+ config HID_CP2112 |
474 |
+ tristate "Silicon Labs CP2112 HID USB-to-SMBus Bridge support" |
475 |
+- depends on USB_HID && I2C && GPIOLIB |
476 |
++ depends on USB_HID && HIDRAW && I2C && GPIOLIB |
477 |
+ select GPIOLIB_IRQCHIP |
478 |
+ ---help--- |
479 |
+ Support for Silicon Labs CP2112 HID USB to SMBus Master Bridge. |
480 |
+diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h |
481 |
+index 8a03654048bf..feb62fd4dfc3 100644 |
482 |
+--- a/drivers/hid/wacom_wac.h |
483 |
++++ b/drivers/hid/wacom_wac.h |
484 |
+@@ -166,6 +166,7 @@ |
485 |
+ ((f)->physical == HID_DG_PEN) || \ |
486 |
+ ((f)->application == HID_DG_PEN) || \ |
487 |
+ ((f)->application == HID_DG_DIGITIZER) || \ |
488 |
++ ((f)->application == WACOM_HID_WD_PEN) || \ |
489 |
+ ((f)->application == WACOM_HID_WD_DIGITIZER) || \ |
490 |
+ ((f)->application == WACOM_HID_G9_PEN) || \ |
491 |
+ ((f)->application == WACOM_HID_G11_PEN)) |
492 |
+diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c |
493 |
+index 7b3f31cc63d2..0c46155a8e9d 100644 |
494 |
+--- a/drivers/media/rc/imon.c |
495 |
++++ b/drivers/media/rc/imon.c |
496 |
+@@ -2517,6 +2517,11 @@ static int imon_probe(struct usb_interface *interface, |
497 |
+ mutex_lock(&driver_lock); |
498 |
+ |
499 |
+ first_if = usb_ifnum_to_if(usbdev, 0); |
500 |
++ if (!first_if) { |
501 |
++ ret = -ENODEV; |
502 |
++ goto fail; |
503 |
++ } |
504 |
++ |
505 |
+ first_if_ctx = usb_get_intfdata(first_if); |
506 |
+ |
507 |
+ if (ifnum == 0) { |
508 |
+diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c |
509 |
+index 6020170fe99a..92098c1b78e5 100644 |
510 |
+--- a/drivers/media/usb/dvb-usb/dib0700_devices.c |
511 |
++++ b/drivers/media/usb/dvb-usb/dib0700_devices.c |
512 |
+@@ -291,7 +291,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
513 |
+ stk7700d_dib7000p_mt2266_config) |
514 |
+ != 0) { |
515 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
516 |
+- dvb_detach(&state->dib7000p_ops); |
517 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
518 |
+ return -ENODEV; |
519 |
+ } |
520 |
+ } |
521 |
+@@ -325,7 +325,7 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
522 |
+ stk7700d_dib7000p_mt2266_config) |
523 |
+ != 0) { |
524 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
525 |
+- dvb_detach(&state->dib7000p_ops); |
526 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
527 |
+ return -ENODEV; |
528 |
+ } |
529 |
+ } |
530 |
+@@ -478,7 +478,7 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) |
531 |
+ &stk7700ph_dib7700_xc3028_config) != 0) { |
532 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
533 |
+ __func__); |
534 |
+- dvb_detach(&state->dib7000p_ops); |
535 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
536 |
+ return -ENODEV; |
537 |
+ } |
538 |
+ |
539 |
+@@ -1010,7 +1010,7 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
540 |
+ &dib7070p_dib7000p_config) != 0) { |
541 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
542 |
+ __func__); |
543 |
+- dvb_detach(&state->dib7000p_ops); |
544 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
545 |
+ return -ENODEV; |
546 |
+ } |
547 |
+ |
548 |
+@@ -1068,7 +1068,7 @@ static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap) |
549 |
+ &dib7770p_dib7000p_config) != 0) { |
550 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
551 |
+ __func__); |
552 |
+- dvb_detach(&state->dib7000p_ops); |
553 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
554 |
+ return -ENODEV; |
555 |
+ } |
556 |
+ |
557 |
+@@ -3056,7 +3056,7 @@ static int nim7090_frontend_attach(struct dvb_usb_adapter *adap) |
558 |
+ |
559 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) { |
560 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
561 |
+- dvb_detach(&state->dib7000p_ops); |
562 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
563 |
+ return -ENODEV; |
564 |
+ } |
565 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config); |
566 |
+@@ -3109,7 +3109,7 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap) |
567 |
+ /* initialize IC 0 */ |
568 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config[0]) != 0) { |
569 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
570 |
+- dvb_detach(&state->dib7000p_ops); |
571 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
572 |
+ return -ENODEV; |
573 |
+ } |
574 |
+ |
575 |
+@@ -3139,7 +3139,7 @@ static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap) |
576 |
+ i2c = state->dib7000p_ops.get_i2c_master(adap->dev->adapter[0].fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_6_7, 1); |
577 |
+ if (state->dib7000p_ops.i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) { |
578 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
579 |
+- dvb_detach(&state->dib7000p_ops); |
580 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
581 |
+ return -ENODEV; |
582 |
+ } |
583 |
+ |
584 |
+@@ -3214,7 +3214,7 @@ static int tfe7790p_frontend_attach(struct dvb_usb_adapter *adap) |
585 |
+ 1, 0x10, &tfe7790p_dib7000p_config) != 0) { |
586 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
587 |
+ __func__); |
588 |
+- dvb_detach(&state->dib7000p_ops); |
589 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
590 |
+ return -ENODEV; |
591 |
+ } |
592 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, |
593 |
+@@ -3309,7 +3309,7 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
594 |
+ stk7070pd_dib7000p_config) != 0) { |
595 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
596 |
+ __func__); |
597 |
+- dvb_detach(&state->dib7000p_ops); |
598 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
599 |
+ return -ENODEV; |
600 |
+ } |
601 |
+ |
602 |
+@@ -3384,7 +3384,7 @@ static int novatd_frontend_attach(struct dvb_usb_adapter *adap) |
603 |
+ stk7070pd_dib7000p_config) != 0) { |
604 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
605 |
+ __func__); |
606 |
+- dvb_detach(&state->dib7000p_ops); |
607 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
608 |
+ return -ENODEV; |
609 |
+ } |
610 |
+ } |
611 |
+@@ -3620,7 +3620,7 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap) |
612 |
+ |
613 |
+ if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap) == 0) { |
614 |
+ /* Demodulator not found for some reason? */ |
615 |
+- dvb_detach(&state->dib7000p_ops); |
616 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
617 |
+ return -ENODEV; |
618 |
+ } |
619 |
+ |
620 |
+diff --git a/drivers/platform/x86/peaq-wmi.c b/drivers/platform/x86/peaq-wmi.c |
621 |
+index bc98ef95514a..2da48ecc90c1 100644 |
622 |
+--- a/drivers/platform/x86/peaq-wmi.c |
623 |
++++ b/drivers/platform/x86/peaq-wmi.c |
624 |
+@@ -8,6 +8,7 @@ |
625 |
+ */ |
626 |
+ |
627 |
+ #include <linux/acpi.h> |
628 |
++#include <linux/dmi.h> |
629 |
+ #include <linux/input-polldev.h> |
630 |
+ #include <linux/kernel.h> |
631 |
+ #include <linux/module.h> |
632 |
+@@ -64,8 +65,23 @@ static void peaq_wmi_poll(struct input_polled_dev *dev) |
633 |
+ } |
634 |
+ } |
635 |
+ |
636 |
++/* Some other devices (Shuttle XS35) use the same WMI GUID for other purposes */ |
637 |
++static const struct dmi_system_id peaq_dmi_table[] = { |
638 |
++ { |
639 |
++ .matches = { |
640 |
++ DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"), |
641 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"), |
642 |
++ }, |
643 |
++ }, |
644 |
++ {} |
645 |
++}; |
646 |
++ |
647 |
+ static int __init peaq_wmi_init(void) |
648 |
+ { |
649 |
++ /* WMI GUID is not unique, also check for a DMI match */ |
650 |
++ if (!dmi_check_system(peaq_dmi_table)) |
651 |
++ return -ENODEV; |
652 |
++ |
653 |
+ if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) |
654 |
+ return -ENODEV; |
655 |
+ |
656 |
+@@ -86,6 +102,9 @@ static int __init peaq_wmi_init(void) |
657 |
+ |
658 |
+ static void __exit peaq_wmi_exit(void) |
659 |
+ { |
660 |
++ if (!dmi_check_system(peaq_dmi_table)) |
661 |
++ return; |
662 |
++ |
663 |
+ if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) |
664 |
+ return; |
665 |
+ |
666 |
+diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c |
667 |
+index 5dcc9bf1c5bc..e3242a0925a6 100644 |
668 |
+--- a/drivers/rpmsg/qcom_glink_native.c |
669 |
++++ b/drivers/rpmsg/qcom_glink_native.c |
670 |
+@@ -1616,3 +1616,6 @@ void qcom_glink_native_unregister(struct qcom_glink *glink) |
671 |
+ device_unregister(glink->dev); |
672 |
+ } |
673 |
+ EXPORT_SYMBOL_GPL(qcom_glink_native_unregister); |
674 |
++ |
675 |
++MODULE_DESCRIPTION("Qualcomm GLINK driver"); |
676 |
++MODULE_LICENSE("GPL v2"); |
677 |
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c |
678 |
+index e8b5a5e21b2e..3ff0ee88c467 100644 |
679 |
+--- a/drivers/spi/spi.c |
680 |
++++ b/drivers/spi/spi.c |
681 |
+@@ -2245,11 +2245,12 @@ static int __unregister(struct device *dev, void *null) |
682 |
+ void spi_unregister_controller(struct spi_controller *ctlr) |
683 |
+ { |
684 |
+ struct spi_controller *found; |
685 |
++ int id = ctlr->bus_num; |
686 |
+ int dummy; |
687 |
+ |
688 |
+ /* First make sure that this controller was ever added */ |
689 |
+ mutex_lock(&board_lock); |
690 |
+- found = idr_find(&spi_master_idr, ctlr->bus_num); |
691 |
++ found = idr_find(&spi_master_idr, id); |
692 |
+ mutex_unlock(&board_lock); |
693 |
+ if (found != ctlr) { |
694 |
+ dev_dbg(&ctlr->dev, |
695 |
+@@ -2269,7 +2270,7 @@ void spi_unregister_controller(struct spi_controller *ctlr) |
696 |
+ device_unregister(&ctlr->dev); |
697 |
+ /* free bus id */ |
698 |
+ mutex_lock(&board_lock); |
699 |
+- idr_remove(&spi_master_idr, ctlr->bus_num); |
700 |
++ idr_remove(&spi_master_idr, id); |
701 |
+ mutex_unlock(&board_lock); |
702 |
+ } |
703 |
+ EXPORT_SYMBOL_GPL(spi_unregister_controller); |
704 |
+diff --git a/drivers/staging/ccree/cc_lli_defs.h b/drivers/staging/ccree/cc_lli_defs.h |
705 |
+index 851d3907167e..a9c417b07b04 100644 |
706 |
+--- a/drivers/staging/ccree/cc_lli_defs.h |
707 |
++++ b/drivers/staging/ccree/cc_lli_defs.h |
708 |
+@@ -59,7 +59,7 @@ static inline void cc_lli_set_addr(u32 *lli_p, dma_addr_t addr) |
709 |
+ lli_p[LLI_WORD0_OFFSET] = (addr & U32_MAX); |
710 |
+ #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
711 |
+ lli_p[LLI_WORD1_OFFSET] &= ~LLI_HADDR_MASK; |
712 |
+- lli_p[LLI_WORD1_OFFSET] |= FIELD_PREP(LLI_HADDR_MASK, (addr >> 16)); |
713 |
++ lli_p[LLI_WORD1_OFFSET] |= FIELD_PREP(LLI_HADDR_MASK, (addr >> 32)); |
714 |
+ #endif /* CONFIG_ARCH_DMA_ADDR_T_64BIT */ |
715 |
+ } |
716 |
+ |
717 |
+diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c |
718 |
+index e97b19148497..1e7321a1404c 100644 |
719 |
+--- a/drivers/staging/greybus/spilib.c |
720 |
++++ b/drivers/staging/greybus/spilib.c |
721 |
+@@ -544,11 +544,14 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev, |
722 |
+ |
723 |
+ return 0; |
724 |
+ |
725 |
+-exit_spi_unregister: |
726 |
+- spi_unregister_master(master); |
727 |
+ exit_spi_put: |
728 |
+ spi_master_put(master); |
729 |
+ |
730 |
++ return ret; |
731 |
++ |
732 |
++exit_spi_unregister: |
733 |
++ spi_unregister_master(master); |
734 |
++ |
735 |
+ return ret; |
736 |
+ } |
737 |
+ EXPORT_SYMBOL_GPL(gb_spilib_master_init); |
738 |
+@@ -558,7 +561,6 @@ void gb_spilib_master_exit(struct gb_connection *connection) |
739 |
+ struct spi_master *master = gb_connection_get_data(connection); |
740 |
+ |
741 |
+ spi_unregister_master(master); |
742 |
+- spi_master_put(master); |
743 |
+ } |
744 |
+ EXPORT_SYMBOL_GPL(gb_spilib_master_exit); |
745 |
+ |
746 |
+diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c |
747 |
+index 3fd5f4102b36..afb9dadc1cfe 100644 |
748 |
+--- a/drivers/staging/rtl8188eu/core/rtw_recv.c |
749 |
++++ b/drivers/staging/rtl8188eu/core/rtw_recv.c |
750 |
+@@ -259,10 +259,12 @@ static int recvframe_chkmic(struct adapter *adapter, |
751 |
+ } |
752 |
+ |
753 |
+ /* icv_len included the mic code */ |
754 |
+- datalen = precvframe->pkt->len-prxattrib->hdrlen - 8; |
755 |
++ datalen = precvframe->pkt->len-prxattrib->hdrlen - |
756 |
++ prxattrib->iv_len-prxattrib->icv_len-8; |
757 |
+ pframe = precvframe->pkt->data; |
758 |
+- payload = pframe+prxattrib->hdrlen; |
759 |
++ payload = pframe+prxattrib->hdrlen+prxattrib->iv_len; |
760 |
+ |
761 |
++ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n prxattrib->iv_len=%d prxattrib->icv_len=%d\n", prxattrib->iv_len, prxattrib->icv_len)); |
762 |
+ rtw_seccalctkipmic(mickey, pframe, payload, datalen, &miccode[0], |
763 |
+ (unsigned char)prxattrib->priority); /* care the length of the data */ |
764 |
+ |
765 |
+@@ -407,15 +409,9 @@ static struct recv_frame *decryptor(struct adapter *padapter, |
766 |
+ default: |
767 |
+ break; |
768 |
+ } |
769 |
+- if (res != _FAIL) { |
770 |
+- memmove(precv_frame->pkt->data + precv_frame->attrib.iv_len, precv_frame->pkt->data, precv_frame->attrib.hdrlen); |
771 |
+- skb_pull(precv_frame->pkt, precv_frame->attrib.iv_len); |
772 |
+- skb_trim(precv_frame->pkt, precv_frame->pkt->len - precv_frame->attrib.icv_len); |
773 |
+- } |
774 |
+ } else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 && |
775 |
+- (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)) { |
776 |
+- psecuritypriv->hw_decrypted = true; |
777 |
+- } |
778 |
++ (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)) |
779 |
++ psecuritypriv->hw_decrypted = true; |
780 |
+ |
781 |
+ if (res == _FAIL) { |
782 |
+ rtw_free_recvframe(return_packet, &padapter->recvpriv.free_recv_queue); |
783 |
+@@ -456,7 +452,7 @@ static struct recv_frame *portctrl(struct adapter *adapter, |
784 |
+ |
785 |
+ if (auth_alg == 2) { |
786 |
+ /* get ether_type */ |
787 |
+- ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE; |
788 |
++ ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE + pfhdr->attrib.iv_len; |
789 |
+ memcpy(&be_tmp, ptr, 2); |
790 |
+ ether_type = ntohs(be_tmp); |
791 |
+ |
792 |
+@@ -1138,8 +1134,6 @@ static int validate_recv_data_frame(struct adapter *adapter, |
793 |
+ } |
794 |
+ |
795 |
+ if (pattrib->privacy) { |
796 |
+- struct sk_buff *skb = precv_frame->pkt; |
797 |
+- |
798 |
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy)); |
799 |
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x))=%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0], IS_MCAST(pattrib->ra))); |
800 |
+ |
801 |
+@@ -1148,13 +1142,6 @@ static int validate_recv_data_frame(struct adapter *adapter, |
802 |
+ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n pattrib->encrypt=%d\n", pattrib->encrypt)); |
803 |
+ |
804 |
+ SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt); |
805 |
+- |
806 |
+- if (pattrib->bdecrypted == 1 && pattrib->encrypt > 0) { |
807 |
+- memmove(skb->data + pattrib->iv_len, |
808 |
+- skb->data, pattrib->hdrlen); |
809 |
+- skb_pull(skb, pattrib->iv_len); |
810 |
+- skb_trim(skb, skb->len - pattrib->icv_len); |
811 |
+- } |
812 |
+ } else { |
813 |
+ pattrib->encrypt = 0; |
814 |
+ pattrib->iv_len = 0; |
815 |
+@@ -1274,7 +1261,6 @@ static int validate_recv_frame(struct adapter *adapter, |
816 |
+ * Hence forward the frame to the monitor anyway to preserve the order |
817 |
+ * in which frames were received. |
818 |
+ */ |
819 |
+- |
820 |
+ rtl88eu_mon_recv_hook(adapter->pmondev, precv_frame); |
821 |
+ |
822 |
+ exit: |
823 |
+@@ -1296,8 +1282,11 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe) |
824 |
+ u8 *ptr = precvframe->pkt->data; |
825 |
+ struct rx_pkt_attrib *pattrib = &precvframe->attrib; |
826 |
+ |
827 |
+- psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen); |
828 |
+- psnap_type = ptr+pattrib->hdrlen + SNAP_SIZE; |
829 |
++ if (pattrib->encrypt) |
830 |
++ skb_trim(precvframe->pkt, precvframe->pkt->len - pattrib->icv_len); |
831 |
++ |
832 |
++ psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len); |
833 |
++ psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; |
834 |
+ /* convert hdr + possible LLC headers into Ethernet header */ |
835 |
+ if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && |
836 |
+ (!memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) && |
837 |
+@@ -1310,9 +1299,12 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe) |
838 |
+ bsnaphdr = false; |
839 |
+ } |
840 |
+ |
841 |
+- rmv_len = pattrib->hdrlen + (bsnaphdr ? SNAP_SIZE : 0); |
842 |
++ rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0); |
843 |
+ len = precvframe->pkt->len - rmv_len; |
844 |
+ |
845 |
++ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, |
846 |
++ ("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x===\n\n", pattrib->hdrlen, pattrib->iv_len)); |
847 |
++ |
848 |
+ memcpy(&be_tmp, ptr+rmv_len, 2); |
849 |
+ eth_type = ntohs(be_tmp); /* pattrib->ether_type */ |
850 |
+ pattrib->eth_type = eth_type; |
851 |
+@@ -1337,6 +1329,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, |
852 |
+ struct __queue *defrag_q) |
853 |
+ { |
854 |
+ struct list_head *plist, *phead; |
855 |
++ u8 wlanhdr_offset; |
856 |
+ u8 curfragnum; |
857 |
+ struct recv_frame *pfhdr, *pnfhdr; |
858 |
+ struct recv_frame *prframe, *pnextrframe; |
859 |
+@@ -1385,7 +1378,12 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, |
860 |
+ /* copy the 2nd~n fragment frame's payload to the first fragment */ |
861 |
+ /* get the 2nd~last fragment frame's payload */ |
862 |
+ |
863 |
+- skb_pull(pnextrframe->pkt, pnfhdr->attrib.hdrlen); |
864 |
++ wlanhdr_offset = pnfhdr->attrib.hdrlen + pnfhdr->attrib.iv_len; |
865 |
++ |
866 |
++ skb_pull(pnextrframe->pkt, wlanhdr_offset); |
867 |
++ |
868 |
++ /* append to first fragment frame's tail (if privacy frame, pull the ICV) */ |
869 |
++ skb_trim(prframe->pkt, prframe->pkt->len - pfhdr->attrib.icv_len); |
870 |
+ |
871 |
+ /* memcpy */ |
872 |
+ memcpy(skb_tail_pointer(pfhdr->pkt), pnfhdr->pkt->data, |
873 |
+@@ -1393,7 +1391,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, |
874 |
+ |
875 |
+ skb_put(prframe->pkt, pnfhdr->pkt->len); |
876 |
+ |
877 |
+- pfhdr->attrib.icv_len = 0; |
878 |
++ pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len; |
879 |
+ plist = plist->next; |
880 |
+ } |
881 |
+ |
882 |
+@@ -1519,6 +1517,11 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) |
883 |
+ nr_subframes = 0; |
884 |
+ pattrib = &prframe->attrib; |
885 |
+ |
886 |
++ skb_pull(prframe->pkt, prframe->attrib.hdrlen); |
887 |
++ |
888 |
++ if (prframe->attrib.iv_len > 0) |
889 |
++ skb_pull(prframe->pkt, prframe->attrib.iv_len); |
890 |
++ |
891 |
+ a_len = prframe->pkt->len; |
892 |
+ |
893 |
+ pdata = prframe->pkt->data; |
894 |
+@@ -1887,6 +1890,24 @@ static int process_recv_indicatepkts(struct adapter *padapter, |
895 |
+ return retval; |
896 |
+ } |
897 |
+ |
898 |
++static int recv_func_prehandle(struct adapter *padapter, |
899 |
++ struct recv_frame *rframe) |
900 |
++{ |
901 |
++ int ret = _SUCCESS; |
902 |
++ struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; |
903 |
++ |
904 |
++ /* check the frame crtl field and decache */ |
905 |
++ ret = validate_recv_frame(padapter, rframe); |
906 |
++ if (ret != _SUCCESS) { |
907 |
++ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n")); |
908 |
++ rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */ |
909 |
++ goto exit; |
910 |
++ } |
911 |
++ |
912 |
++exit: |
913 |
++ return ret; |
914 |
++} |
915 |
++ |
916 |
+ static int recv_func_posthandle(struct adapter *padapter, |
917 |
+ struct recv_frame *prframe) |
918 |
+ { |
919 |
+@@ -1939,7 +1960,6 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe) |
920 |
+ struct rx_pkt_attrib *prxattrib = &rframe->attrib; |
921 |
+ struct security_priv *psecuritypriv = &padapter->securitypriv; |
922 |
+ struct mlme_priv *mlmepriv = &padapter->mlmepriv; |
923 |
+- struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; |
924 |
+ |
925 |
+ /* check if need to handle uc_swdec_pending_queue*/ |
926 |
+ if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && psecuritypriv->busetkipkey) { |
927 |
+@@ -1951,12 +1971,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe) |
928 |
+ } |
929 |
+ } |
930 |
+ |
931 |
+- /* check the frame crtl field and decache */ |
932 |
+- ret = validate_recv_frame(padapter, rframe); |
933 |
+- if (ret != _SUCCESS) { |
934 |
+- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n")); |
935 |
+- rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */ |
936 |
+- } else { |
937 |
++ ret = recv_func_prehandle(padapter, rframe); |
938 |
++ |
939 |
++ if (ret == _SUCCESS) { |
940 |
+ /* check if need to enqueue into uc_swdec_pending_queue*/ |
941 |
+ if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && |
942 |
+ !IS_MCAST(prxattrib->ra) && prxattrib->encrypt > 0 && |
943 |
+diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c |
944 |
+index 37fd52d7364f..225c23fc69dc 100644 |
945 |
+--- a/drivers/staging/rtl8188eu/os_dep/mon.c |
946 |
++++ b/drivers/staging/rtl8188eu/os_dep/mon.c |
947 |
+@@ -66,34 +66,6 @@ static void mon_recv_decrypted(struct net_device *dev, const u8 *data, |
948 |
+ netif_rx(skb); |
949 |
+ } |
950 |
+ |
951 |
+-static void mon_recv_decrypted_recv(struct net_device *dev, const u8 *data, |
952 |
+- int data_len) |
953 |
+-{ |
954 |
+- struct sk_buff *skb; |
955 |
+- struct ieee80211_hdr *hdr; |
956 |
+- int hdr_len; |
957 |
+- |
958 |
+- skb = netdev_alloc_skb(dev, data_len); |
959 |
+- if (!skb) |
960 |
+- return; |
961 |
+- memcpy(skb_put(skb, data_len), data, data_len); |
962 |
+- |
963 |
+- /* |
964 |
+- * Frame data is not encrypted. Strip off protection so |
965 |
+- * userspace doesn't think that it is. |
966 |
+- */ |
967 |
+- |
968 |
+- hdr = (struct ieee80211_hdr *)skb->data; |
969 |
+- hdr_len = ieee80211_hdrlen(hdr->frame_control); |
970 |
+- |
971 |
+- if (ieee80211_has_protected(hdr->frame_control)) |
972 |
+- hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_PROTECTED); |
973 |
+- |
974 |
+- skb->ip_summed = CHECKSUM_UNNECESSARY; |
975 |
+- skb->protocol = eth_type_trans(skb, dev); |
976 |
+- netif_rx(skb); |
977 |
+-} |
978 |
+- |
979 |
+ static void mon_recv_encrypted(struct net_device *dev, const u8 *data, |
980 |
+ int data_len) |
981 |
+ { |
982 |
+@@ -110,6 +82,7 @@ static void mon_recv_encrypted(struct net_device *dev, const u8 *data, |
983 |
+ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) |
984 |
+ { |
985 |
+ struct rx_pkt_attrib *attr; |
986 |
++ int iv_len, icv_len; |
987 |
+ int data_len; |
988 |
+ u8 *data; |
989 |
+ |
990 |
+@@ -122,8 +95,11 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) |
991 |
+ data = frame->pkt->data; |
992 |
+ data_len = frame->pkt->len; |
993 |
+ |
994 |
++ /* Broadcast and multicast frames don't have attr->{iv,icv}_len set */ |
995 |
++ SET_ICE_IV_LEN(iv_len, icv_len, attr->encrypt); |
996 |
++ |
997 |
+ if (attr->bdecrypted) |
998 |
+- mon_recv_decrypted_recv(dev, data, data_len); |
999 |
++ mon_recv_decrypted(dev, data, data_len, iv_len, icv_len); |
1000 |
+ else |
1001 |
+ mon_recv_encrypted(dev, data, data_len); |
1002 |
+ } |
1003 |
+diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h |
1004 |
+index 09c223f815de..aee82fcaf669 100644 |
1005 |
+--- a/drivers/staging/sm750fb/ddk750_chip.h |
1006 |
++++ b/drivers/staging/sm750fb/ddk750_chip.h |
1007 |
+@@ -18,7 +18,7 @@ static inline u32 peek32(u32 addr) |
1008 |
+ return readl(addr + mmio750); |
1009 |
+ } |
1010 |
+ |
1011 |
+-static inline void poke32(u32 data, u32 addr) |
1012 |
++static inline void poke32(u32 addr, u32 data) |
1013 |
+ { |
1014 |
+ writel(data, addr + mmio750); |
1015 |
+ } |
1016 |
+diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h |
1017 |
+index 4b9302703b36..eeac4f0cb2c6 100644 |
1018 |
+--- a/drivers/staging/vboxvideo/vbox_drv.h |
1019 |
++++ b/drivers/staging/vboxvideo/vbox_drv.h |
1020 |
+@@ -137,8 +137,8 @@ struct vbox_connector { |
1021 |
+ char name[32]; |
1022 |
+ struct vbox_crtc *vbox_crtc; |
1023 |
+ struct { |
1024 |
+- u16 width; |
1025 |
+- u16 height; |
1026 |
++ u32 width; |
1027 |
++ u32 height; |
1028 |
+ bool disconnected; |
1029 |
+ } mode_hint; |
1030 |
+ }; |
1031 |
+@@ -150,8 +150,8 @@ struct vbox_crtc { |
1032 |
+ unsigned int crtc_id; |
1033 |
+ u32 fb_offset; |
1034 |
+ bool cursor_enabled; |
1035 |
+- u16 x_hint; |
1036 |
+- u16 y_hint; |
1037 |
++ u32 x_hint; |
1038 |
++ u32 y_hint; |
1039 |
+ }; |
1040 |
+ |
1041 |
+ struct vbox_encoder { |
1042 |
+diff --git a/drivers/staging/vboxvideo/vbox_irq.c b/drivers/staging/vboxvideo/vbox_irq.c |
1043 |
+index 3ca8bec62ac4..74abdf02d9fd 100644 |
1044 |
+--- a/drivers/staging/vboxvideo/vbox_irq.c |
1045 |
++++ b/drivers/staging/vboxvideo/vbox_irq.c |
1046 |
+@@ -150,8 +150,8 @@ static void vbox_update_mode_hints(struct vbox_private *vbox) |
1047 |
+ |
1048 |
+ disconnected = !(hints->enabled); |
1049 |
+ crtc_id = vbox_conn->vbox_crtc->crtc_id; |
1050 |
+- vbox_conn->mode_hint.width = hints->cx & 0x8fff; |
1051 |
+- vbox_conn->mode_hint.height = hints->cy & 0x8fff; |
1052 |
++ vbox_conn->mode_hint.width = hints->cx; |
1053 |
++ vbox_conn->mode_hint.height = hints->cy; |
1054 |
+ vbox_conn->vbox_crtc->x_hint = hints->dx; |
1055 |
+ vbox_conn->vbox_crtc->y_hint = hints->dy; |
1056 |
+ vbox_conn->mode_hint.disconnected = disconnected; |
1057 |
+diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c |
1058 |
+index 257a77830410..6f08dc966719 100644 |
1059 |
+--- a/drivers/staging/vboxvideo/vbox_mode.c |
1060 |
++++ b/drivers/staging/vboxvideo/vbox_mode.c |
1061 |
+@@ -553,12 +553,22 @@ static int vbox_get_modes(struct drm_connector *connector) |
1062 |
+ ++num_modes; |
1063 |
+ } |
1064 |
+ vbox_set_edid(connector, preferred_width, preferred_height); |
1065 |
+- drm_object_property_set_value( |
1066 |
+- &connector->base, vbox->dev->mode_config.suggested_x_property, |
1067 |
+- vbox_connector->vbox_crtc->x_hint); |
1068 |
+- drm_object_property_set_value( |
1069 |
+- &connector->base, vbox->dev->mode_config.suggested_y_property, |
1070 |
+- vbox_connector->vbox_crtc->y_hint); |
1071 |
++ |
1072 |
++ if (vbox_connector->vbox_crtc->x_hint != -1) |
1073 |
++ drm_object_property_set_value(&connector->base, |
1074 |
++ vbox->dev->mode_config.suggested_x_property, |
1075 |
++ vbox_connector->vbox_crtc->x_hint); |
1076 |
++ else |
1077 |
++ drm_object_property_set_value(&connector->base, |
1078 |
++ vbox->dev->mode_config.suggested_x_property, 0); |
1079 |
++ |
1080 |
++ if (vbox_connector->vbox_crtc->y_hint != -1) |
1081 |
++ drm_object_property_set_value(&connector->base, |
1082 |
++ vbox->dev->mode_config.suggested_y_property, |
1083 |
++ vbox_connector->vbox_crtc->y_hint); |
1084 |
++ else |
1085 |
++ drm_object_property_set_value(&connector->base, |
1086 |
++ vbox->dev->mode_config.suggested_y_property, 0); |
1087 |
+ |
1088 |
+ return num_modes; |
1089 |
+ } |
1090 |
+@@ -640,9 +650,9 @@ static int vbox_connector_init(struct drm_device *dev, |
1091 |
+ |
1092 |
+ drm_mode_create_suggested_offset_properties(dev); |
1093 |
+ drm_object_attach_property(&connector->base, |
1094 |
+- dev->mode_config.suggested_x_property, -1); |
1095 |
++ dev->mode_config.suggested_x_property, 0); |
1096 |
+ drm_object_attach_property(&connector->base, |
1097 |
+- dev->mode_config.suggested_y_property, -1); |
1098 |
++ dev->mode_config.suggested_y_property, 0); |
1099 |
+ drm_connector_register(connector); |
1100 |
+ |
1101 |
+ drm_mode_connector_attach_encoder(connector, encoder); |
1102 |
+diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c |
1103 |
+index 9addef1f1e12..f49dfa82f1b8 100644 |
1104 |
+--- a/drivers/staging/wilc1000/wilc_wlan.c |
1105 |
++++ b/drivers/staging/wilc1000/wilc_wlan.c |
1106 |
+@@ -714,7 +714,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) |
1107 |
+ char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid; |
1108 |
+ |
1109 |
+ buffer_offset = ETH_ETHERNET_HDR_OFFSET; |
1110 |
+- memcpy(&txb[offset + 4], bssid, 6); |
1111 |
++ memcpy(&txb[offset + 8], bssid, 6); |
1112 |
+ } else { |
1113 |
+ buffer_offset = HOST_HDR_OFFSET; |
1114 |
+ } |
1115 |
+diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
1116 |
+index e9326f31db8d..98c666ef9a57 100644 |
1117 |
+--- a/drivers/usb/core/devio.c |
1118 |
++++ b/drivers/usb/core/devio.c |
1119 |
+@@ -1833,6 +1833,18 @@ static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg) |
1120 |
+ return 0; |
1121 |
+ } |
1122 |
+ |
1123 |
++static void compute_isochronous_actual_length(struct urb *urb) |
1124 |
++{ |
1125 |
++ unsigned int i; |
1126 |
++ |
1127 |
++ if (urb->number_of_packets > 0) { |
1128 |
++ urb->actual_length = 0; |
1129 |
++ for (i = 0; i < urb->number_of_packets; i++) |
1130 |
++ urb->actual_length += |
1131 |
++ urb->iso_frame_desc[i].actual_length; |
1132 |
++ } |
1133 |
++} |
1134 |
++ |
1135 |
+ static int processcompl(struct async *as, void __user * __user *arg) |
1136 |
+ { |
1137 |
+ struct urb *urb = as->urb; |
1138 |
+@@ -1840,6 +1852,7 @@ static int processcompl(struct async *as, void __user * __user *arg) |
1139 |
+ void __user *addr = as->userurb; |
1140 |
+ unsigned int i; |
1141 |
+ |
1142 |
++ compute_isochronous_actual_length(urb); |
1143 |
+ if (as->userbuffer && urb->actual_length) { |
1144 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
1145 |
+ goto err_out; |
1146 |
+@@ -2008,6 +2021,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) |
1147 |
+ void __user *addr = as->userurb; |
1148 |
+ unsigned int i; |
1149 |
+ |
1150 |
++ compute_isochronous_actual_length(urb); |
1151 |
+ if (as->userbuffer && urb->actual_length) { |
1152 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
1153 |
+ return -EFAULT; |
1154 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1155 |
+index a6aaf2f193a4..37c418e581fb 100644 |
1156 |
+--- a/drivers/usb/core/quirks.c |
1157 |
++++ b/drivers/usb/core/quirks.c |
1158 |
+@@ -221,6 +221,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1159 |
+ /* Corsair Strafe RGB */ |
1160 |
+ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, |
1161 |
+ |
1162 |
++ /* Corsair K70 LUX */ |
1163 |
++ { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, |
1164 |
++ |
1165 |
+ /* MIDI keyboard WORLDE MINI */ |
1166 |
+ { USB_DEVICE(0x1c75, 0x0204), .driver_info = |
1167 |
+ USB_QUIRK_CONFIG_INTF_STRINGS }, |
1168 |
+diff --git a/drivers/usb/early/xhci-dbc.h b/drivers/usb/early/xhci-dbc.h |
1169 |
+index 2df0f6e613fe..a516cab0bf4a 100644 |
1170 |
+--- a/drivers/usb/early/xhci-dbc.h |
1171 |
++++ b/drivers/usb/early/xhci-dbc.h |
1172 |
+@@ -90,8 +90,8 @@ struct xdbc_context { |
1173 |
+ |
1174 |
+ #define XDBC_INFO_CONTEXT_SIZE 48 |
1175 |
+ #define XDBC_MAX_STRING_LENGTH 64 |
1176 |
+-#define XDBC_STRING_MANUFACTURER "Linux" |
1177 |
+-#define XDBC_STRING_PRODUCT "Remote GDB" |
1178 |
++#define XDBC_STRING_MANUFACTURER "Linux Foundation" |
1179 |
++#define XDBC_STRING_PRODUCT "Linux USB GDB Target" |
1180 |
+ #define XDBC_STRING_SERIAL "0001" |
1181 |
+ |
1182 |
+ struct xdbc_strings { |
1183 |
+@@ -103,7 +103,7 @@ struct xdbc_strings { |
1184 |
+ |
1185 |
+ #define XDBC_PROTOCOL 1 /* GNU Remote Debug Command Set */ |
1186 |
+ #define XDBC_VENDOR_ID 0x1d6b /* Linux Foundation 0x1d6b */ |
1187 |
+-#define XDBC_PRODUCT_ID 0x0004 /* __le16 idProduct; device 0004 */ |
1188 |
++#define XDBC_PRODUCT_ID 0x0011 /* __le16 idProduct; device 0011 */ |
1189 |
+ #define XDBC_DEVICE_REV 0x0010 /* 0.10 */ |
1190 |
+ |
1191 |
+ /* |
1192 |
+diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c |
1193 |
+index 8b342587f8ad..ef8f7d63a8f0 100644 |
1194 |
+--- a/drivers/usb/gadget/function/f_fs.c |
1195 |
++++ b/drivers/usb/gadget/function/f_fs.c |
1196 |
+@@ -3677,6 +3677,7 @@ static void ffs_closed(struct ffs_data *ffs) |
1197 |
+ goto done; |
1198 |
+ |
1199 |
+ ffs_obj->desc_ready = false; |
1200 |
++ ffs_obj->ffs_data = NULL; |
1201 |
+ |
1202 |
+ if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) && |
1203 |
+ ffs_obj->ffs_closed_callback) |
1204 |
+diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c |
1205 |
+index b2f2e87aed94..91e7e3a166a5 100644 |
1206 |
+--- a/drivers/usb/serial/garmin_gps.c |
1207 |
++++ b/drivers/usb/serial/garmin_gps.c |
1208 |
+@@ -138,6 +138,7 @@ struct garmin_data { |
1209 |
+ __u8 privpkt[4*6]; |
1210 |
+ spinlock_t lock; |
1211 |
+ struct list_head pktlist; |
1212 |
++ struct usb_anchor write_urbs; |
1213 |
+ }; |
1214 |
+ |
1215 |
+ |
1216 |
+@@ -905,13 +906,19 @@ static int garmin_init_session(struct usb_serial_port *port) |
1217 |
+ sizeof(GARMIN_START_SESSION_REQ), 0); |
1218 |
+ |
1219 |
+ if (status < 0) |
1220 |
+- break; |
1221 |
++ goto err_kill_urbs; |
1222 |
+ } |
1223 |
+ |
1224 |
+ if (status > 0) |
1225 |
+ status = 0; |
1226 |
+ } |
1227 |
+ |
1228 |
++ return status; |
1229 |
++ |
1230 |
++err_kill_urbs: |
1231 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1232 |
++ usb_kill_urb(port->interrupt_in_urb); |
1233 |
++ |
1234 |
+ return status; |
1235 |
+ } |
1236 |
+ |
1237 |
+@@ -930,7 +937,6 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port) |
1238 |
+ spin_unlock_irqrestore(&garmin_data_p->lock, flags); |
1239 |
+ |
1240 |
+ /* shutdown any bulk reads that might be going on */ |
1241 |
+- usb_kill_urb(port->write_urb); |
1242 |
+ usb_kill_urb(port->read_urb); |
1243 |
+ |
1244 |
+ if (garmin_data_p->state == STATE_RESET) |
1245 |
+@@ -953,7 +959,7 @@ static void garmin_close(struct usb_serial_port *port) |
1246 |
+ |
1247 |
+ /* shutdown our urbs */ |
1248 |
+ usb_kill_urb(port->read_urb); |
1249 |
+- usb_kill_urb(port->write_urb); |
1250 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1251 |
+ |
1252 |
+ /* keep reset state so we know that we must start a new session */ |
1253 |
+ if (garmin_data_p->state != STATE_RESET) |
1254 |
+@@ -1037,12 +1043,14 @@ static int garmin_write_bulk(struct usb_serial_port *port, |
1255 |
+ } |
1256 |
+ |
1257 |
+ /* send it down the pipe */ |
1258 |
++ usb_anchor_urb(urb, &garmin_data_p->write_urbs); |
1259 |
+ status = usb_submit_urb(urb, GFP_ATOMIC); |
1260 |
+ if (status) { |
1261 |
+ dev_err(&port->dev, |
1262 |
+ "%s - usb_submit_urb(write bulk) failed with status = %d\n", |
1263 |
+ __func__, status); |
1264 |
+ count = status; |
1265 |
++ usb_unanchor_urb(urb); |
1266 |
+ kfree(buffer); |
1267 |
+ } |
1268 |
+ |
1269 |
+@@ -1401,9 +1409,16 @@ static int garmin_port_probe(struct usb_serial_port *port) |
1270 |
+ garmin_data_p->state = 0; |
1271 |
+ garmin_data_p->flags = 0; |
1272 |
+ garmin_data_p->count = 0; |
1273 |
++ init_usb_anchor(&garmin_data_p->write_urbs); |
1274 |
+ usb_set_serial_port_data(port, garmin_data_p); |
1275 |
+ |
1276 |
+ status = garmin_init_session(port); |
1277 |
++ if (status) |
1278 |
++ goto err_free; |
1279 |
++ |
1280 |
++ return 0; |
1281 |
++err_free: |
1282 |
++ kfree(garmin_data_p); |
1283 |
+ |
1284 |
+ return status; |
1285 |
+ } |
1286 |
+@@ -1413,6 +1428,7 @@ static int garmin_port_remove(struct usb_serial_port *port) |
1287 |
+ { |
1288 |
+ struct garmin_data *garmin_data_p = usb_get_serial_port_data(port); |
1289 |
+ |
1290 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1291 |
+ usb_kill_urb(port->interrupt_in_urb); |
1292 |
+ del_timer_sync(&garmin_data_p->timer); |
1293 |
+ kfree(garmin_data_p); |
1294 |
+diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c |
1295 |
+index 14511d6a7d44..3950d44b80f1 100644 |
1296 |
+--- a/drivers/usb/serial/metro-usb.c |
1297 |
++++ b/drivers/usb/serial/metro-usb.c |
1298 |
+@@ -189,7 +189,7 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) |
1299 |
+ dev_err(&port->dev, |
1300 |
+ "%s - failed submitting interrupt in urb, error code=%d\n", |
1301 |
+ __func__, result); |
1302 |
+- goto exit; |
1303 |
++ return result; |
1304 |
+ } |
1305 |
+ |
1306 |
+ /* Send activate cmd to device */ |
1307 |
+@@ -198,9 +198,14 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) |
1308 |
+ dev_err(&port->dev, |
1309 |
+ "%s - failed to configure device, error code=%d\n", |
1310 |
+ __func__, result); |
1311 |
+- goto exit; |
1312 |
++ goto err_kill_urb; |
1313 |
+ } |
1314 |
+-exit: |
1315 |
++ |
1316 |
++ return 0; |
1317 |
++ |
1318 |
++err_kill_urb: |
1319 |
++ usb_kill_urb(port->interrupt_in_urb); |
1320 |
++ |
1321 |
+ return result; |
1322 |
+ } |
1323 |
+ |
1324 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
1325 |
+index eb9928963a53..9f9d3a904464 100644 |
1326 |
+--- a/drivers/usb/serial/qcserial.c |
1327 |
++++ b/drivers/usb/serial/qcserial.c |
1328 |
+@@ -148,6 +148,7 @@ static const struct usb_device_id id_table[] = { |
1329 |
+ {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ |
1330 |
+ {DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC7304/MC7354 */ |
1331 |
+ {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ |
1332 |
++ {DEVICE_SWI(0x1199, 0x901e)}, /* Sierra Wireless EM7355 QDL */ |
1333 |
+ {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ |
1334 |
+ {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ |
1335 |
+ {DEVICE_SWI(0x1199, 0x9041)}, /* Sierra Wireless MC7305/MC7355 */ |
1336 |
+diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c |
1337 |
+index 12f4c5a91e62..48f285a1ad00 100644 |
1338 |
+--- a/drivers/usb/serial/usb_debug.c |
1339 |
++++ b/drivers/usb/serial/usb_debug.c |
1340 |
+@@ -34,13 +34,13 @@ static const struct usb_device_id id_table[] = { |
1341 |
+ }; |
1342 |
+ |
1343 |
+ static const struct usb_device_id dbc_id_table[] = { |
1344 |
+- { USB_DEVICE(0x1d6b, 0x0004) }, |
1345 |
++ { USB_DEVICE(0x1d6b, 0x0011) }, |
1346 |
+ { }, |
1347 |
+ }; |
1348 |
+ |
1349 |
+ static const struct usb_device_id id_table_combined[] = { |
1350 |
+ { USB_DEVICE(0x0525, 0x127a) }, |
1351 |
+- { USB_DEVICE(0x1d6b, 0x0004) }, |
1352 |
++ { USB_DEVICE(0x1d6b, 0x0011) }, |
1353 |
+ { }, |
1354 |
+ }; |
1355 |
+ MODULE_DEVICE_TABLE(usb, id_table_combined); |
1356 |
+diff --git a/tools/testing/selftests/x86/protection_keys.c b/tools/testing/selftests/x86/protection_keys.c |
1357 |
+index 555e43ca846b..7a1cc0e56d2d 100644 |
1358 |
+--- a/tools/testing/selftests/x86/protection_keys.c |
1359 |
++++ b/tools/testing/selftests/x86/protection_keys.c |
1360 |
+@@ -189,17 +189,29 @@ void lots_o_noops_around_write(int *write_to_me) |
1361 |
+ #define u64 uint64_t |
1362 |
+ |
1363 |
+ #ifdef __i386__ |
1364 |
+-#define SYS_mprotect_key 380 |
1365 |
+-#define SYS_pkey_alloc 381 |
1366 |
+-#define SYS_pkey_free 382 |
1367 |
++ |
1368 |
++#ifndef SYS_mprotect_key |
1369 |
++# define SYS_mprotect_key 380 |
1370 |
++#endif |
1371 |
++#ifndef SYS_pkey_alloc |
1372 |
++# define SYS_pkey_alloc 381 |
1373 |
++# define SYS_pkey_free 382 |
1374 |
++#endif |
1375 |
+ #define REG_IP_IDX REG_EIP |
1376 |
+ #define si_pkey_offset 0x14 |
1377 |
++ |
1378 |
+ #else |
1379 |
+-#define SYS_mprotect_key 329 |
1380 |
+-#define SYS_pkey_alloc 330 |
1381 |
+-#define SYS_pkey_free 331 |
1382 |
++ |
1383 |
++#ifndef SYS_mprotect_key |
1384 |
++# define SYS_mprotect_key 329 |
1385 |
++#endif |
1386 |
++#ifndef SYS_pkey_alloc |
1387 |
++# define SYS_pkey_alloc 330 |
1388 |
++# define SYS_pkey_free 331 |
1389 |
++#endif |
1390 |
+ #define REG_IP_IDX REG_RIP |
1391 |
+ #define si_pkey_offset 0x20 |
1392 |
++ |
1393 |
+ #endif |
1394 |
+ |
1395 |
+ void dump_mem(void *dumpme, int len_bytes) |