1 |
commit: 6dd097e14861a422f31161e9738304b9f8c46e42 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 10 14:14:56 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 10 14:14:56 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6dd097e1 |
7 |
|
8 |
Linux patch 4.13.1 |
9 |
|
10 |
0000_README | 5 + |
11 |
1000_linux-4.13.1.patch | 1735 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1740 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index b6b8110..6a8a687 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.13.1.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.13.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 |
@@ -78,3 +82,4 @@ Desc: Add Gentoo Linux support config settings and defaults. |
30 |
Patch: 5010_enable-additional-cpu-optimizations-for-gcc.patch |
31 |
From: https://github.com/graysky2/kernel_gcc_patch/ |
32 |
Desc: Kernel patch enables gcc >= v4.9 optimizations for additional CPUs. |
33 |
+ |
34 |
|
35 |
diff --git a/1000_linux-4.13.1.patch b/1000_linux-4.13.1.patch |
36 |
new file mode 100644 |
37 |
index 0000000..6c6a08e |
38 |
--- /dev/null |
39 |
+++ b/1000_linux-4.13.1.patch |
40 |
@@ -0,0 +1,1735 @@ |
41 |
+diff --git a/Makefile b/Makefile |
42 |
+index ed65d7278bb3..41a976854cad 100644 |
43 |
+--- a/Makefile |
44 |
++++ b/Makefile |
45 |
+@@ -1,6 +1,6 @@ |
46 |
+ VERSION = 4 |
47 |
+ PATCHLEVEL = 13 |
48 |
+-SUBLEVEL = 0 |
49 |
++SUBLEVEL = 1 |
50 |
+ EXTRAVERSION = |
51 |
+ NAME = Fearless Coyote |
52 |
+ |
53 |
+diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h |
54 |
+index 57057fb1cc07..65ab11d654e1 100644 |
55 |
+--- a/arch/s390/include/asm/pgtable.h |
56 |
++++ b/arch/s390/include/asm/pgtable.h |
57 |
+@@ -505,7 +505,7 @@ static inline int mm_alloc_pgste(struct mm_struct *mm) |
58 |
+ * In the case that a guest uses storage keys |
59 |
+ * faults should no longer be backed by zero pages |
60 |
+ */ |
61 |
+-#define mm_forbids_zeropage mm_use_skey |
62 |
++#define mm_forbids_zeropage mm_has_pgste |
63 |
+ static inline int mm_use_skey(struct mm_struct *mm) |
64 |
+ { |
65 |
+ #ifdef CONFIG_PGSTE |
66 |
+diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c |
67 |
+index 4fb3d3cdb370..ff84fb214bf9 100644 |
68 |
+--- a/arch/s390/mm/gmap.c |
69 |
++++ b/arch/s390/mm/gmap.c |
70 |
+@@ -2120,6 +2120,37 @@ static inline void thp_split_mm(struct mm_struct *mm) |
71 |
+ #endif |
72 |
+ } |
73 |
+ |
74 |
++/* |
75 |
++ * Remove all empty zero pages from the mapping for lazy refaulting |
76 |
++ * - This must be called after mm->context.has_pgste is set, to avoid |
77 |
++ * future creation of zero pages |
78 |
++ * - This must be called after THP was enabled |
79 |
++ */ |
80 |
++static int __zap_zero_pages(pmd_t *pmd, unsigned long start, |
81 |
++ unsigned long end, struct mm_walk *walk) |
82 |
++{ |
83 |
++ unsigned long addr; |
84 |
++ |
85 |
++ for (addr = start; addr != end; addr += PAGE_SIZE) { |
86 |
++ pte_t *ptep; |
87 |
++ spinlock_t *ptl; |
88 |
++ |
89 |
++ ptep = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); |
90 |
++ if (is_zero_pfn(pte_pfn(*ptep))) |
91 |
++ ptep_xchg_direct(walk->mm, addr, ptep, __pte(_PAGE_INVALID)); |
92 |
++ pte_unmap_unlock(ptep, ptl); |
93 |
++ } |
94 |
++ return 0; |
95 |
++} |
96 |
++ |
97 |
++static inline void zap_zero_pages(struct mm_struct *mm) |
98 |
++{ |
99 |
++ struct mm_walk walk = { .pmd_entry = __zap_zero_pages }; |
100 |
++ |
101 |
++ walk.mm = mm; |
102 |
++ walk_page_range(0, TASK_SIZE, &walk); |
103 |
++} |
104 |
++ |
105 |
+ /* |
106 |
+ * switch on pgstes for its userspace process (for kvm) |
107 |
+ */ |
108 |
+@@ -2137,6 +2168,7 @@ int s390_enable_sie(void) |
109 |
+ mm->context.has_pgste = 1; |
110 |
+ /* split thp mappings and disable thp for future mappings */ |
111 |
+ thp_split_mm(mm); |
112 |
++ zap_zero_pages(mm); |
113 |
+ up_write(&mm->mmap_sem); |
114 |
+ return 0; |
115 |
+ } |
116 |
+@@ -2149,13 +2181,6 @@ EXPORT_SYMBOL_GPL(s390_enable_sie); |
117 |
+ static int __s390_enable_skey(pte_t *pte, unsigned long addr, |
118 |
+ unsigned long next, struct mm_walk *walk) |
119 |
+ { |
120 |
+- /* |
121 |
+- * Remove all zero page mappings, |
122 |
+- * after establishing a policy to forbid zero page mappings |
123 |
+- * following faults for that page will get fresh anonymous pages |
124 |
+- */ |
125 |
+- if (is_zero_pfn(pte_pfn(*pte))) |
126 |
+- ptep_xchg_direct(walk->mm, addr, pte, __pte(_PAGE_INVALID)); |
127 |
+ /* Clear storage key */ |
128 |
+ ptep_zap_key(walk->mm, addr, pte); |
129 |
+ return 0; |
130 |
+diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig |
131 |
+index 832e885349b1..4d4cdc1a6e25 100644 |
132 |
+--- a/drivers/android/Kconfig |
133 |
++++ b/drivers/android/Kconfig |
134 |
+@@ -22,7 +22,7 @@ config ANDROID_BINDER_IPC |
135 |
+ config ANDROID_BINDER_DEVICES |
136 |
+ string "Android Binder devices" |
137 |
+ depends on ANDROID_BINDER_IPC |
138 |
+- default "binder,hwbinder" |
139 |
++ default "binder,hwbinder,vndbinder" |
140 |
+ ---help--- |
141 |
+ Default value for the binder.devices parameter. |
142 |
+ |
143 |
+diff --git a/drivers/android/binder.c b/drivers/android/binder.c |
144 |
+index 831cdd7d197d..3db96b79d122 100644 |
145 |
+--- a/drivers/android/binder.c |
146 |
++++ b/drivers/android/binder.c |
147 |
+@@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name) |
148 |
+ static int __init binder_init(void) |
149 |
+ { |
150 |
+ int ret; |
151 |
+- char *device_name, *device_names; |
152 |
++ char *device_name, *device_names, *device_tmp; |
153 |
+ struct binder_device *device; |
154 |
+ struct hlist_node *tmp; |
155 |
+ |
156 |
+@@ -4263,7 +4263,8 @@ static int __init binder_init(void) |
157 |
+ } |
158 |
+ strcpy(device_names, binder_devices_param); |
159 |
+ |
160 |
+- while ((device_name = strsep(&device_names, ","))) { |
161 |
++ device_tmp = device_names; |
162 |
++ while ((device_name = strsep(&device_tmp, ","))) { |
163 |
+ ret = init_binder_device(device_name); |
164 |
+ if (ret) |
165 |
+ goto err_init_binder_device_failed; |
166 |
+@@ -4277,6 +4278,9 @@ static int __init binder_init(void) |
167 |
+ hlist_del(&device->hlist); |
168 |
+ kfree(device); |
169 |
+ } |
170 |
++ |
171 |
++ kfree(device_names); |
172 |
++ |
173 |
+ err_alloc_device_names_failed: |
174 |
+ debugfs_remove_recursive(binder_debugfs_dir_entry_root); |
175 |
+ |
176 |
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
177 |
+index 5a5fd0b404eb..cb9b0e9090e3 100644 |
178 |
+--- a/drivers/ata/ahci.c |
179 |
++++ b/drivers/ata/ahci.c |
180 |
+@@ -1469,7 +1469,14 @@ static void ahci_remap_check(struct pci_dev *pdev, int bar, |
181 |
+ return; |
182 |
+ |
183 |
+ dev_warn(&pdev->dev, "Found %d remapped NVMe devices.\n", count); |
184 |
+- dev_warn(&pdev->dev, "Switch your BIOS from RAID to AHCI mode to use them.\n"); |
185 |
++ dev_warn(&pdev->dev, |
186 |
++ "Switch your BIOS from RAID to AHCI mode to use them.\n"); |
187 |
++ |
188 |
++ /* |
189 |
++ * Don't rely on the msi-x capability in the remap case, |
190 |
++ * share the legacy interrupt across ahci and remapped devices. |
191 |
++ */ |
192 |
++ hpriv->flags |= AHCI_HFLAG_NO_MSI; |
193 |
+ } |
194 |
+ |
195 |
+ static int ahci_get_irq_vector(struct ata_host *host, int port) |
196 |
+diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c |
197 |
+index 8d4d959a821c..8706533db57b 100644 |
198 |
+--- a/drivers/ata/pata_amd.c |
199 |
++++ b/drivers/ata/pata_amd.c |
200 |
+@@ -616,6 +616,7 @@ static const struct pci_device_id amd[] = { |
201 |
+ { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 8 }, |
202 |
+ { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 8 }, |
203 |
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 9 }, |
204 |
++ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_DEV_IDE), 9 }, |
205 |
+ |
206 |
+ { }, |
207 |
+ }; |
208 |
+diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c |
209 |
+index 6c15a554efbe..dc1255294628 100644 |
210 |
+--- a/drivers/ata/pata_cs5536.c |
211 |
++++ b/drivers/ata/pata_cs5536.c |
212 |
+@@ -289,6 +289,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
213 |
+ |
214 |
+ static const struct pci_device_id cs5536[] = { |
215 |
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), }, |
216 |
++ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_DEV_IDE), }, |
217 |
+ { }, |
218 |
+ }; |
219 |
+ |
220 |
+diff --git a/drivers/base/bus.c b/drivers/base/bus.c |
221 |
+index e162c9a789ba..22a64fd3309b 100644 |
222 |
+--- a/drivers/base/bus.c |
223 |
++++ b/drivers/base/bus.c |
224 |
+@@ -698,7 +698,7 @@ int bus_add_driver(struct device_driver *drv) |
225 |
+ |
226 |
+ out_unregister: |
227 |
+ kobject_put(&priv->kobj); |
228 |
+- kfree(drv->p); |
229 |
++ /* drv->p is freed in driver_release() */ |
230 |
+ drv->p = NULL; |
231 |
+ out_put_bus: |
232 |
+ bus_put(bus); |
233 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
234 |
+index fa24d693af24..e331e212f5fc 100644 |
235 |
+--- a/drivers/bluetooth/btusb.c |
236 |
++++ b/drivers/bluetooth/btusb.c |
237 |
+@@ -357,6 +357,7 @@ static const struct usb_device_id blacklist_table[] = { |
238 |
+ { USB_DEVICE(0x13d3, 0x3410), .driver_info = BTUSB_REALTEK }, |
239 |
+ { USB_DEVICE(0x13d3, 0x3416), .driver_info = BTUSB_REALTEK }, |
240 |
+ { USB_DEVICE(0x13d3, 0x3459), .driver_info = BTUSB_REALTEK }, |
241 |
++ { USB_DEVICE(0x13d3, 0x3494), .driver_info = BTUSB_REALTEK }, |
242 |
+ |
243 |
+ /* Additional Realtek 8821AE Bluetooth devices */ |
244 |
+ { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK }, |
245 |
+diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c |
246 |
+index 0488b7f81dcf..54f3b375a453 100644 |
247 |
+--- a/drivers/crypto/caam/caamalg.c |
248 |
++++ b/drivers/crypto/caam/caamalg.c |
249 |
+@@ -81,40 +81,6 @@ |
250 |
+ #define debug(format, arg...) |
251 |
+ #endif |
252 |
+ |
253 |
+-#ifdef DEBUG |
254 |
+-#include <linux/highmem.h> |
255 |
+- |
256 |
+-static void dbg_dump_sg(const char *level, const char *prefix_str, |
257 |
+- int prefix_type, int rowsize, int groupsize, |
258 |
+- struct scatterlist *sg, size_t tlen, bool ascii) |
259 |
+-{ |
260 |
+- struct scatterlist *it; |
261 |
+- void *it_page; |
262 |
+- size_t len; |
263 |
+- void *buf; |
264 |
+- |
265 |
+- for (it = sg; it != NULL && tlen > 0 ; it = sg_next(sg)) { |
266 |
+- /* |
267 |
+- * make sure the scatterlist's page |
268 |
+- * has a valid virtual memory mapping |
269 |
+- */ |
270 |
+- it_page = kmap_atomic(sg_page(it)); |
271 |
+- if (unlikely(!it_page)) { |
272 |
+- printk(KERN_ERR "dbg_dump_sg: kmap failed\n"); |
273 |
+- return; |
274 |
+- } |
275 |
+- |
276 |
+- buf = it_page + it->offset; |
277 |
+- len = min_t(size_t, tlen, it->length); |
278 |
+- print_hex_dump(level, prefix_str, prefix_type, rowsize, |
279 |
+- groupsize, buf, len, ascii); |
280 |
+- tlen -= len; |
281 |
+- |
282 |
+- kunmap_atomic(it_page); |
283 |
+- } |
284 |
+-} |
285 |
+-#endif |
286 |
+- |
287 |
+ static struct list_head alg_list; |
288 |
+ |
289 |
+ struct caam_alg_entry { |
290 |
+@@ -898,10 +864,10 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err, |
291 |
+ print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", |
292 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
293 |
+ edesc->src_nents > 1 ? 100 : ivsize, 1); |
294 |
+- dbg_dump_sg(KERN_ERR, "dst @"__stringify(__LINE__)": ", |
295 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
296 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
297 |
+ #endif |
298 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
299 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
300 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
301 |
+ |
302 |
+ ablkcipher_unmap(jrdev, edesc, req); |
303 |
+ |
304 |
+@@ -937,10 +903,10 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err, |
305 |
+ print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", |
306 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
307 |
+ ivsize, 1); |
308 |
+- dbg_dump_sg(KERN_ERR, "dst @"__stringify(__LINE__)": ", |
309 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
310 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
311 |
+ #endif |
312 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
313 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
314 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
315 |
+ |
316 |
+ ablkcipher_unmap(jrdev, edesc, req); |
317 |
+ |
318 |
+@@ -1107,10 +1073,10 @@ static void init_ablkcipher_job(u32 *sh_desc, dma_addr_t ptr, |
319 |
+ ivsize, 1); |
320 |
+ pr_err("asked=%d, nbytes%d\n", |
321 |
+ (int)edesc->src_nents > 1 ? 100 : req->nbytes, req->nbytes); |
322 |
+- dbg_dump_sg(KERN_ERR, "src @"__stringify(__LINE__)": ", |
323 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
324 |
+- edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
325 |
+ #endif |
326 |
++ caam_dump_sg(KERN_ERR, "src @" __stringify(__LINE__)": ", |
327 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
328 |
++ edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
329 |
+ |
330 |
+ len = desc_len(sh_desc); |
331 |
+ init_job_desc_shared(desc, ptr, len, HDR_SHARE_DEFER | HDR_REVERSE); |
332 |
+@@ -1164,10 +1130,10 @@ static void init_ablkcipher_giv_job(u32 *sh_desc, dma_addr_t ptr, |
333 |
+ print_hex_dump(KERN_ERR, "presciv@" __stringify(__LINE__) ": ", |
334 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
335 |
+ ivsize, 1); |
336 |
+- dbg_dump_sg(KERN_ERR, "src @" __stringify(__LINE__) ": ", |
337 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
338 |
+- edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
339 |
+ #endif |
340 |
++ caam_dump_sg(KERN_ERR, "src @" __stringify(__LINE__) ": ", |
341 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
342 |
++ edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
343 |
+ |
344 |
+ len = desc_len(sh_desc); |
345 |
+ init_job_desc_shared(desc, ptr, len, HDR_SHARE_DEFER | HDR_REVERSE); |
346 |
+@@ -1449,11 +1415,9 @@ static int aead_decrypt(struct aead_request *req) |
347 |
+ u32 *desc; |
348 |
+ int ret = 0; |
349 |
+ |
350 |
+-#ifdef DEBUG |
351 |
+- dbg_dump_sg(KERN_ERR, "dec src@"__stringify(__LINE__)": ", |
352 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
353 |
+- req->assoclen + req->cryptlen, 1); |
354 |
+-#endif |
355 |
++ caam_dump_sg(KERN_ERR, "dec src@" __stringify(__LINE__)": ", |
356 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
357 |
++ req->assoclen + req->cryptlen, 1); |
358 |
+ |
359 |
+ /* allocate extended descriptor */ |
360 |
+ edesc = aead_edesc_alloc(req, AUTHENC_DESC_JOB_IO_LEN, |
361 |
+diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c |
362 |
+index 78c4c0485c58..3425f2d9a2a1 100644 |
363 |
+--- a/drivers/crypto/caam/caamalg_qi.c |
364 |
++++ b/drivers/crypto/caam/caamalg_qi.c |
365 |
+@@ -791,9 +791,9 @@ static void ablkcipher_done(struct caam_drv_req *drv_req, u32 status) |
366 |
+ print_hex_dump(KERN_ERR, "dstiv @" __stringify(__LINE__)": ", |
367 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
368 |
+ edesc->src_nents > 1 ? 100 : ivsize, 1); |
369 |
+- dbg_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
370 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
371 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
372 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
373 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
374 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
375 |
+ #endif |
376 |
+ |
377 |
+ ablkcipher_unmap(qidev, edesc, req); |
378 |
+diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c |
379 |
+index 6f44ccb55c63..3d639f3b45aa 100644 |
380 |
+--- a/drivers/crypto/caam/error.c |
381 |
++++ b/drivers/crypto/caam/error.c |
382 |
+@@ -9,6 +9,46 @@ |
383 |
+ #include "desc.h" |
384 |
+ #include "error.h" |
385 |
+ |
386 |
++#ifdef DEBUG |
387 |
++#include <linux/highmem.h> |
388 |
++ |
389 |
++void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, |
390 |
++ int rowsize, int groupsize, struct scatterlist *sg, |
391 |
++ size_t tlen, bool ascii) |
392 |
++{ |
393 |
++ struct scatterlist *it; |
394 |
++ void *it_page; |
395 |
++ size_t len; |
396 |
++ void *buf; |
397 |
++ |
398 |
++ for (it = sg; it && tlen > 0 ; it = sg_next(sg)) { |
399 |
++ /* |
400 |
++ * make sure the scatterlist's page |
401 |
++ * has a valid virtual memory mapping |
402 |
++ */ |
403 |
++ it_page = kmap_atomic(sg_page(it)); |
404 |
++ if (unlikely(!it_page)) { |
405 |
++ pr_err("caam_dump_sg: kmap failed\n"); |
406 |
++ return; |
407 |
++ } |
408 |
++ |
409 |
++ buf = it_page + it->offset; |
410 |
++ len = min_t(size_t, tlen, it->length); |
411 |
++ print_hex_dump(level, prefix_str, prefix_type, rowsize, |
412 |
++ groupsize, buf, len, ascii); |
413 |
++ tlen -= len; |
414 |
++ |
415 |
++ kunmap_atomic(it_page); |
416 |
++ } |
417 |
++} |
418 |
++#else |
419 |
++void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, |
420 |
++ int rowsize, int groupsize, struct scatterlist *sg, |
421 |
++ size_t tlen, bool ascii) |
422 |
++{} |
423 |
++#endif /* DEBUG */ |
424 |
++EXPORT_SYMBOL(caam_dump_sg); |
425 |
++ |
426 |
+ static const struct { |
427 |
+ u8 value; |
428 |
+ const char *error_text; |
429 |
+diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h |
430 |
+index b6350b0d9153..250e1a21c473 100644 |
431 |
+--- a/drivers/crypto/caam/error.h |
432 |
++++ b/drivers/crypto/caam/error.h |
433 |
+@@ -8,4 +8,8 @@ |
434 |
+ #define CAAM_ERROR_H |
435 |
+ #define CAAM_ERROR_STR_MAX 302 |
436 |
+ void caam_jr_strstatus(struct device *jrdev, u32 status); |
437 |
++ |
438 |
++void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, |
439 |
++ int rowsize, int groupsize, struct scatterlist *sg, |
440 |
++ size_t tlen, bool ascii); |
441 |
+ #endif /* CAAM_ERROR_H */ |
442 |
+diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c |
443 |
+index 1990ed460c46..53aed5816416 100644 |
444 |
+--- a/drivers/crypto/caam/qi.c |
445 |
++++ b/drivers/crypto/caam/qi.c |
446 |
+@@ -55,6 +55,7 @@ struct caam_qi_pcpu_priv { |
447 |
+ } ____cacheline_aligned; |
448 |
+ |
449 |
+ static DEFINE_PER_CPU(struct caam_qi_pcpu_priv, pcpu_qipriv); |
450 |
++static DEFINE_PER_CPU(int, last_cpu); |
451 |
+ |
452 |
+ /* |
453 |
+ * caam_qi_priv - CAAM QI backend private params |
454 |
+@@ -392,7 +393,6 @@ struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev, |
455 |
+ dma_addr_t hwdesc; |
456 |
+ struct caam_drv_ctx *drv_ctx; |
457 |
+ const cpumask_t *cpus = qman_affine_cpus(); |
458 |
+- static DEFINE_PER_CPU(int, last_cpu); |
459 |
+ |
460 |
+ num_words = desc_len(sh_desc); |
461 |
+ if (num_words > MAX_SDLEN) { |
462 |
+diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c |
463 |
+index 3066b805f2d0..08c0ecb7d109 100644 |
464 |
+--- a/drivers/fpga/altera-hps2fpga.c |
465 |
++++ b/drivers/fpga/altera-hps2fpga.c |
466 |
+@@ -66,7 +66,7 @@ static int alt_hps2fpga_enable_show(struct fpga_bridge *bridge) |
467 |
+ |
468 |
+ /* The L3 REMAP register is write only, so keep a cached value. */ |
469 |
+ static unsigned int l3_remap_shadow; |
470 |
+-static spinlock_t l3_remap_lock; |
471 |
++static DEFINE_SPINLOCK(l3_remap_lock); |
472 |
+ |
473 |
+ static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv, |
474 |
+ bool enable) |
475 |
+@@ -171,8 +171,6 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev) |
476 |
+ return -EBUSY; |
477 |
+ } |
478 |
+ |
479 |
+- spin_lock_init(&l3_remap_lock); |
480 |
+- |
481 |
+ if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { |
482 |
+ if (enable > 1) { |
483 |
+ dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); |
484 |
+diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c |
485 |
+index ae5f06895562..da2745b3d0a7 100644 |
486 |
+--- a/drivers/gpu/drm/drm_dp_mst_topology.c |
487 |
++++ b/drivers/gpu/drm/drm_dp_mst_topology.c |
488 |
+@@ -2540,8 +2540,8 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, |
489 |
+ int req_slots; |
490 |
+ |
491 |
+ topology_state = drm_atomic_get_mst_topology_state(state, mgr); |
492 |
+- if (topology_state == NULL) |
493 |
+- return -ENOMEM; |
494 |
++ if (IS_ERR(topology_state)) |
495 |
++ return PTR_ERR(topology_state); |
496 |
+ |
497 |
+ port = drm_dp_get_validated_port_ref(mgr, port); |
498 |
+ if (port == NULL) |
499 |
+@@ -2580,8 +2580,8 @@ int drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state, |
500 |
+ struct drm_dp_mst_topology_state *topology_state; |
501 |
+ |
502 |
+ topology_state = drm_atomic_get_mst_topology_state(state, mgr); |
503 |
+- if (topology_state == NULL) |
504 |
+- return -ENOMEM; |
505 |
++ if (IS_ERR(topology_state)) |
506 |
++ return PTR_ERR(topology_state); |
507 |
+ |
508 |
+ /* We cannot rely on port->vcpi.num_slots to update |
509 |
+ * topology_state->avail_slots as the port may not exist if the parent |
510 |
+diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c |
511 |
+index 2bc0dc985214..3d35ea3e95db 100644 |
512 |
+--- a/drivers/gpu/drm/nouveau/nv50_display.c |
513 |
++++ b/drivers/gpu/drm/nouveau/nv50_display.c |
514 |
+@@ -4134,7 +4134,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
515 |
+ if (!nonblock) { |
516 |
+ ret = drm_atomic_helper_wait_for_fences(dev, state, true); |
517 |
+ if (ret) |
518 |
+- goto done; |
519 |
++ goto err_cleanup; |
520 |
+ } |
521 |
+ |
522 |
+ for_each_plane_in_state(state, plane, plane_state, i) { |
523 |
+@@ -4162,7 +4162,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
524 |
+ if (crtc->state->enable) { |
525 |
+ if (!drm->have_disp_power_ref) { |
526 |
+ drm->have_disp_power_ref = true; |
527 |
+- return ret; |
528 |
++ return 0; |
529 |
+ } |
530 |
+ active = true; |
531 |
+ break; |
532 |
+@@ -4174,6 +4174,9 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
533 |
+ drm->have_disp_power_ref = false; |
534 |
+ } |
535 |
+ |
536 |
++err_cleanup: |
537 |
++ if (ret) |
538 |
++ drm_atomic_helper_cleanup_planes(dev, state); |
539 |
+ done: |
540 |
+ pm_runtime_put_autosuspend(dev->dev); |
541 |
+ return ret; |
542 |
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
543 |
+index eb9b278198b2..a4cb82495cee 100644 |
544 |
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
545 |
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
546 |
+@@ -192,6 +192,10 @@ nvkm_pci_new_(const struct nvkm_pci_func *func, struct nvkm_device *device, |
547 |
+ } |
548 |
+ } |
549 |
+ |
550 |
++#ifdef __BIG_ENDIAN |
551 |
++ pci->msi = false; |
552 |
++#endif |
553 |
++ |
554 |
+ pci->msi = nvkm_boolopt(device->cfgopt, "NvMSI", pci->msi); |
555 |
+ if (pci->msi && func->msi_rearm) { |
556 |
+ pci->msi = pci_enable_msi(pci->pdev) == 0; |
557 |
+diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c |
558 |
+index eeddc1e48409..871599826773 100644 |
559 |
+--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c |
560 |
++++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c |
561 |
+@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool, |
562 |
+ } else { |
563 |
+ pr_err("Failed to fill pool (%p)\n", pool); |
564 |
+ /* If we have any pages left put them to the pool. */ |
565 |
+- list_for_each_entry(p, &pool->list, lru) { |
566 |
++ list_for_each_entry(p, &new_pages, lru) { |
567 |
+ ++cpages; |
568 |
+ } |
569 |
+ list_splice(&new_pages, &pool->list); |
570 |
+diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c |
571 |
+index 18f401b442c2..c938af8c40cf 100644 |
572 |
+--- a/drivers/gpu/drm/vgem/vgem_drv.c |
573 |
++++ b/drivers/gpu/drm/vgem/vgem_drv.c |
574 |
+@@ -52,6 +52,7 @@ static void vgem_gem_free_object(struct drm_gem_object *obj) |
575 |
+ struct drm_vgem_gem_object *vgem_obj = to_vgem_bo(obj); |
576 |
+ |
577 |
+ kvfree(vgem_obj->pages); |
578 |
++ mutex_destroy(&vgem_obj->pages_lock); |
579 |
+ |
580 |
+ if (obj->import_attach) |
581 |
+ drm_prime_gem_destroy(obj, vgem_obj->table); |
582 |
+@@ -76,11 +77,15 @@ static int vgem_gem_fault(struct vm_fault *vmf) |
583 |
+ if (page_offset > num_pages) |
584 |
+ return VM_FAULT_SIGBUS; |
585 |
+ |
586 |
++ ret = -ENOENT; |
587 |
++ mutex_lock(&obj->pages_lock); |
588 |
+ if (obj->pages) { |
589 |
+ get_page(obj->pages[page_offset]); |
590 |
+ vmf->page = obj->pages[page_offset]; |
591 |
+ ret = 0; |
592 |
+- } else { |
593 |
++ } |
594 |
++ mutex_unlock(&obj->pages_lock); |
595 |
++ if (ret) { |
596 |
+ struct page *page; |
597 |
+ |
598 |
+ page = shmem_read_mapping_page( |
599 |
+@@ -161,6 +166,8 @@ static struct drm_vgem_gem_object *__vgem_gem_create(struct drm_device *dev, |
600 |
+ return ERR_PTR(ret); |
601 |
+ } |
602 |
+ |
603 |
++ mutex_init(&obj->pages_lock); |
604 |
++ |
605 |
+ return obj; |
606 |
+ } |
607 |
+ |
608 |
+@@ -274,37 +281,66 @@ static const struct file_operations vgem_driver_fops = { |
609 |
+ .release = drm_release, |
610 |
+ }; |
611 |
+ |
612 |
++static struct page **vgem_pin_pages(struct drm_vgem_gem_object *bo) |
613 |
++{ |
614 |
++ mutex_lock(&bo->pages_lock); |
615 |
++ if (bo->pages_pin_count++ == 0) { |
616 |
++ struct page **pages; |
617 |
++ |
618 |
++ pages = drm_gem_get_pages(&bo->base); |
619 |
++ if (IS_ERR(pages)) { |
620 |
++ bo->pages_pin_count--; |
621 |
++ mutex_unlock(&bo->pages_lock); |
622 |
++ return pages; |
623 |
++ } |
624 |
++ |
625 |
++ bo->pages = pages; |
626 |
++ } |
627 |
++ mutex_unlock(&bo->pages_lock); |
628 |
++ |
629 |
++ return bo->pages; |
630 |
++} |
631 |
++ |
632 |
++static void vgem_unpin_pages(struct drm_vgem_gem_object *bo) |
633 |
++{ |
634 |
++ mutex_lock(&bo->pages_lock); |
635 |
++ if (--bo->pages_pin_count == 0) { |
636 |
++ drm_gem_put_pages(&bo->base, bo->pages, true, true); |
637 |
++ bo->pages = NULL; |
638 |
++ } |
639 |
++ mutex_unlock(&bo->pages_lock); |
640 |
++} |
641 |
++ |
642 |
+ static int vgem_prime_pin(struct drm_gem_object *obj) |
643 |
+ { |
644 |
++ struct drm_vgem_gem_object *bo = to_vgem_bo(obj); |
645 |
+ long n_pages = obj->size >> PAGE_SHIFT; |
646 |
+ struct page **pages; |
647 |
+ |
648 |
+- /* Flush the object from the CPU cache so that importers can rely |
649 |
+- * on coherent indirect access via the exported dma-address. |
650 |
+- */ |
651 |
+- pages = drm_gem_get_pages(obj); |
652 |
++ pages = vgem_pin_pages(bo); |
653 |
+ if (IS_ERR(pages)) |
654 |
+ return PTR_ERR(pages); |
655 |
+ |
656 |
++ /* Flush the object from the CPU cache so that importers can rely |
657 |
++ * on coherent indirect access via the exported dma-address. |
658 |
++ */ |
659 |
+ drm_clflush_pages(pages, n_pages); |
660 |
+- drm_gem_put_pages(obj, pages, true, false); |
661 |
+ |
662 |
+ return 0; |
663 |
+ } |
664 |
+ |
665 |
+-static struct sg_table *vgem_prime_get_sg_table(struct drm_gem_object *obj) |
666 |
++static void vgem_prime_unpin(struct drm_gem_object *obj) |
667 |
+ { |
668 |
+- struct sg_table *st; |
669 |
+- struct page **pages; |
670 |
++ struct drm_vgem_gem_object *bo = to_vgem_bo(obj); |
671 |
+ |
672 |
+- pages = drm_gem_get_pages(obj); |
673 |
+- if (IS_ERR(pages)) |
674 |
+- return ERR_CAST(pages); |
675 |
++ vgem_unpin_pages(bo); |
676 |
++} |
677 |
+ |
678 |
+- st = drm_prime_pages_to_sg(pages, obj->size >> PAGE_SHIFT); |
679 |
+- drm_gem_put_pages(obj, pages, false, false); |
680 |
++static struct sg_table *vgem_prime_get_sg_table(struct drm_gem_object *obj) |
681 |
++{ |
682 |
++ struct drm_vgem_gem_object *bo = to_vgem_bo(obj); |
683 |
+ |
684 |
+- return st; |
685 |
++ return drm_prime_pages_to_sg(bo->pages, bo->base.size >> PAGE_SHIFT); |
686 |
+ } |
687 |
+ |
688 |
+ static struct drm_gem_object* vgem_prime_import(struct drm_device *dev, |
689 |
+@@ -333,6 +369,8 @@ static struct drm_gem_object *vgem_prime_import_sg_table(struct drm_device *dev, |
690 |
+ __vgem_gem_destroy(obj); |
691 |
+ return ERR_PTR(-ENOMEM); |
692 |
+ } |
693 |
++ |
694 |
++ obj->pages_pin_count++; /* perma-pinned */ |
695 |
+ drm_prime_sg_to_page_addr_arrays(obj->table, obj->pages, NULL, |
696 |
+ npages); |
697 |
+ return &obj->base; |
698 |
+@@ -340,23 +378,23 @@ static struct drm_gem_object *vgem_prime_import_sg_table(struct drm_device *dev, |
699 |
+ |
700 |
+ static void *vgem_prime_vmap(struct drm_gem_object *obj) |
701 |
+ { |
702 |
++ struct drm_vgem_gem_object *bo = to_vgem_bo(obj); |
703 |
+ long n_pages = obj->size >> PAGE_SHIFT; |
704 |
+ struct page **pages; |
705 |
+- void *addr; |
706 |
+ |
707 |
+- pages = drm_gem_get_pages(obj); |
708 |
++ pages = vgem_pin_pages(bo); |
709 |
+ if (IS_ERR(pages)) |
710 |
+ return NULL; |
711 |
+ |
712 |
+- addr = vmap(pages, n_pages, 0, pgprot_writecombine(PAGE_KERNEL)); |
713 |
+- drm_gem_put_pages(obj, pages, false, false); |
714 |
+- |
715 |
+- return addr; |
716 |
++ return vmap(pages, n_pages, 0, pgprot_writecombine(PAGE_KERNEL)); |
717 |
+ } |
718 |
+ |
719 |
+ static void vgem_prime_vunmap(struct drm_gem_object *obj, void *vaddr) |
720 |
+ { |
721 |
++ struct drm_vgem_gem_object *bo = to_vgem_bo(obj); |
722 |
++ |
723 |
+ vunmap(vaddr); |
724 |
++ vgem_unpin_pages(bo); |
725 |
+ } |
726 |
+ |
727 |
+ static int vgem_prime_mmap(struct drm_gem_object *obj, |
728 |
+@@ -409,6 +447,7 @@ static struct drm_driver vgem_driver = { |
729 |
+ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
730 |
+ .prime_fd_to_handle = drm_gem_prime_fd_to_handle, |
731 |
+ .gem_prime_pin = vgem_prime_pin, |
732 |
++ .gem_prime_unpin = vgem_prime_unpin, |
733 |
+ .gem_prime_import = vgem_prime_import, |
734 |
+ .gem_prime_export = drm_gem_prime_export, |
735 |
+ .gem_prime_import_sg_table = vgem_prime_import_sg_table, |
736 |
+diff --git a/drivers/gpu/drm/vgem/vgem_drv.h b/drivers/gpu/drm/vgem/vgem_drv.h |
737 |
+index 1aae01419112..5c8f6d619ff3 100644 |
738 |
+--- a/drivers/gpu/drm/vgem/vgem_drv.h |
739 |
++++ b/drivers/gpu/drm/vgem/vgem_drv.h |
740 |
+@@ -43,7 +43,11 @@ struct vgem_file { |
741 |
+ #define to_vgem_bo(x) container_of(x, struct drm_vgem_gem_object, base) |
742 |
+ struct drm_vgem_gem_object { |
743 |
+ struct drm_gem_object base; |
744 |
++ |
745 |
+ struct page **pages; |
746 |
++ unsigned int pages_pin_count; |
747 |
++ struct mutex pages_lock; |
748 |
++ |
749 |
+ struct sg_table *table; |
750 |
+ }; |
751 |
+ |
752 |
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c |
753 |
+index 9f940293ede4..bb17d7bbefd3 100644 |
754 |
+--- a/drivers/hid/wacom_wac.c |
755 |
++++ b/drivers/hid/wacom_wac.c |
756 |
+@@ -1846,7 +1846,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, |
757 |
+ features->device_type |= WACOM_DEVICETYPE_PAD; |
758 |
+ break; |
759 |
+ case WACOM_HID_WD_TOUCHRINGSTATUS: |
760 |
+- wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0); |
761 |
++ /* |
762 |
++ * Only set up type/code association. Completely mapping |
763 |
++ * this usage may overwrite the axis resolution and range. |
764 |
++ */ |
765 |
++ usage->type = EV_ABS; |
766 |
++ usage->code = ABS_WHEEL; |
767 |
++ set_bit(EV_ABS, input->evbit); |
768 |
+ features->device_type |= WACOM_DEVICETYPE_PAD; |
769 |
+ break; |
770 |
+ case WACOM_HID_WD_BUTTONCONFIG: |
771 |
+diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c |
772 |
+index 590cf90dd21a..da40df2ff27d 100644 |
773 |
+--- a/drivers/hwtracing/intel_th/pci.c |
774 |
++++ b/drivers/hwtracing/intel_th/pci.c |
775 |
+@@ -95,6 +95,16 @@ static const struct pci_device_id intel_th_pci_id_table[] = { |
776 |
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e), |
777 |
+ .driver_data = (kernel_ulong_t)0, |
778 |
+ }, |
779 |
++ { |
780 |
++ /* Cannon Lake H */ |
781 |
++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326), |
782 |
++ .driver_data = (kernel_ulong_t)0, |
783 |
++ }, |
784 |
++ { |
785 |
++ /* Cannon Lake LP */ |
786 |
++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9da6), |
787 |
++ .driver_data = (kernel_ulong_t)0, |
788 |
++ }, |
789 |
+ { 0 }, |
790 |
+ }; |
791 |
+ |
792 |
+diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c |
793 |
+index 884b8e461b17..9c501e5042fb 100644 |
794 |
+--- a/drivers/iio/adc/ti-ads1015.c |
795 |
++++ b/drivers/iio/adc/ti-ads1015.c |
796 |
+@@ -81,18 +81,12 @@ static const unsigned int ads1115_data_rate[] = { |
797 |
+ 8, 16, 32, 64, 128, 250, 475, 860 |
798 |
+ }; |
799 |
+ |
800 |
+-static const struct { |
801 |
+- int scale; |
802 |
+- int uscale; |
803 |
+-} ads1015_scale[] = { |
804 |
+- {3, 0}, |
805 |
+- {2, 0}, |
806 |
+- {1, 0}, |
807 |
+- {0, 500000}, |
808 |
+- {0, 250000}, |
809 |
+- {0, 125000}, |
810 |
+- {0, 125000}, |
811 |
+- {0, 125000}, |
812 |
++/* |
813 |
++ * Translation from PGA bits to full-scale positive and negative input voltage |
814 |
++ * range in mV |
815 |
++ */ |
816 |
++static int ads1015_fullscale_range[] = { |
817 |
++ 6144, 4096, 2048, 1024, 512, 256, 256, 256 |
818 |
+ }; |
819 |
+ |
820 |
+ #define ADS1015_V_CHAN(_chan, _addr) { \ |
821 |
+@@ -183,6 +177,12 @@ struct ads1015_data { |
822 |
+ struct ads1015_channel_data channel_data[ADS1015_CHANNELS]; |
823 |
+ |
824 |
+ unsigned int *data_rate; |
825 |
++ /* |
826 |
++ * Set to true when the ADC is switched to the continuous-conversion |
827 |
++ * mode and exits from a power-down state. This flag is used to avoid |
828 |
++ * getting the stale result from the conversion register. |
829 |
++ */ |
830 |
++ bool conv_invalid; |
831 |
+ }; |
832 |
+ |
833 |
+ static bool ads1015_is_writeable_reg(struct device *dev, unsigned int reg) |
834 |
+@@ -235,33 +235,43 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on) |
835 |
+ ret = pm_runtime_put_autosuspend(dev); |
836 |
+ } |
837 |
+ |
838 |
+- return ret; |
839 |
++ return ret < 0 ? ret : 0; |
840 |
+ } |
841 |
+ |
842 |
+ static |
843 |
+ int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val) |
844 |
+ { |
845 |
+ int ret, pga, dr, conv_time; |
846 |
+- bool change; |
847 |
++ unsigned int old, mask, cfg; |
848 |
+ |
849 |
+ if (chan < 0 || chan >= ADS1015_CHANNELS) |
850 |
+ return -EINVAL; |
851 |
+ |
852 |
++ ret = regmap_read(data->regmap, ADS1015_CFG_REG, &old); |
853 |
++ if (ret) |
854 |
++ return ret; |
855 |
++ |
856 |
+ pga = data->channel_data[chan].pga; |
857 |
+ dr = data->channel_data[chan].data_rate; |
858 |
++ mask = ADS1015_CFG_MUX_MASK | ADS1015_CFG_PGA_MASK | |
859 |
++ ADS1015_CFG_DR_MASK; |
860 |
++ cfg = chan << ADS1015_CFG_MUX_SHIFT | pga << ADS1015_CFG_PGA_SHIFT | |
861 |
++ dr << ADS1015_CFG_DR_SHIFT; |
862 |
+ |
863 |
+- ret = regmap_update_bits_check(data->regmap, ADS1015_CFG_REG, |
864 |
+- ADS1015_CFG_MUX_MASK | |
865 |
+- ADS1015_CFG_PGA_MASK, |
866 |
+- chan << ADS1015_CFG_MUX_SHIFT | |
867 |
+- pga << ADS1015_CFG_PGA_SHIFT, |
868 |
+- &change); |
869 |
+- if (ret < 0) |
870 |
++ cfg = (old & ~mask) | (cfg & mask); |
871 |
++ |
872 |
++ ret = regmap_write(data->regmap, ADS1015_CFG_REG, cfg); |
873 |
++ if (ret) |
874 |
+ return ret; |
875 |
+ |
876 |
+- if (change) { |
877 |
+- conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]); |
878 |
++ if (old != cfg || data->conv_invalid) { |
879 |
++ int dr_old = (old & ADS1015_CFG_DR_MASK) >> |
880 |
++ ADS1015_CFG_DR_SHIFT; |
881 |
++ |
882 |
++ conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr_old]); |
883 |
++ conv_time += DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]); |
884 |
+ usleep_range(conv_time, conv_time + 1); |
885 |
++ data->conv_invalid = false; |
886 |
+ } |
887 |
+ |
888 |
+ return regmap_read(data->regmap, ADS1015_CONV_REG, val); |
889 |
+@@ -298,17 +308,20 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p) |
890 |
+ return IRQ_HANDLED; |
891 |
+ } |
892 |
+ |
893 |
+-static int ads1015_set_scale(struct ads1015_data *data, int chan, |
894 |
++static int ads1015_set_scale(struct ads1015_data *data, |
895 |
++ struct iio_chan_spec const *chan, |
896 |
+ int scale, int uscale) |
897 |
+ { |
898 |
+ int i, ret, rindex = -1; |
899 |
++ int fullscale = div_s64((scale * 1000000LL + uscale) << |
900 |
++ (chan->scan_type.realbits - 1), 1000000); |
901 |
+ |
902 |
+- for (i = 0; i < ARRAY_SIZE(ads1015_scale); i++) |
903 |
+- if (ads1015_scale[i].scale == scale && |
904 |
+- ads1015_scale[i].uscale == uscale) { |
905 |
++ for (i = 0; i < ARRAY_SIZE(ads1015_fullscale_range); i++) { |
906 |
++ if (ads1015_fullscale_range[i] == fullscale) { |
907 |
+ rindex = i; |
908 |
+ break; |
909 |
+ } |
910 |
++ } |
911 |
+ if (rindex < 0) |
912 |
+ return -EINVAL; |
913 |
+ |
914 |
+@@ -318,32 +331,23 @@ static int ads1015_set_scale(struct ads1015_data *data, int chan, |
915 |
+ if (ret < 0) |
916 |
+ return ret; |
917 |
+ |
918 |
+- data->channel_data[chan].pga = rindex; |
919 |
++ data->channel_data[chan->address].pga = rindex; |
920 |
+ |
921 |
+ return 0; |
922 |
+ } |
923 |
+ |
924 |
+ static int ads1015_set_data_rate(struct ads1015_data *data, int chan, int rate) |
925 |
+ { |
926 |
+- int i, ret, rindex = -1; |
927 |
++ int i; |
928 |
+ |
929 |
+- for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++) |
930 |
++ for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++) { |
931 |
+ if (data->data_rate[i] == rate) { |
932 |
+- rindex = i; |
933 |
+- break; |
934 |
++ data->channel_data[chan].data_rate = i; |
935 |
++ return 0; |
936 |
+ } |
937 |
+- if (rindex < 0) |
938 |
+- return -EINVAL; |
939 |
+- |
940 |
+- ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
941 |
+- ADS1015_CFG_DR_MASK, |
942 |
+- rindex << ADS1015_CFG_DR_SHIFT); |
943 |
+- if (ret < 0) |
944 |
+- return ret; |
945 |
+- |
946 |
+- data->channel_data[chan].data_rate = rindex; |
947 |
++ } |
948 |
+ |
949 |
+- return 0; |
950 |
++ return -EINVAL; |
951 |
+ } |
952 |
+ |
953 |
+ static int ads1015_read_raw(struct iio_dev *indio_dev, |
954 |
+@@ -385,9 +389,9 @@ static int ads1015_read_raw(struct iio_dev *indio_dev, |
955 |
+ } |
956 |
+ case IIO_CHAN_INFO_SCALE: |
957 |
+ idx = data->channel_data[chan->address].pga; |
958 |
+- *val = ads1015_scale[idx].scale; |
959 |
+- *val2 = ads1015_scale[idx].uscale; |
960 |
+- ret = IIO_VAL_INT_PLUS_MICRO; |
961 |
++ *val = ads1015_fullscale_range[idx]; |
962 |
++ *val2 = chan->scan_type.realbits - 1; |
963 |
++ ret = IIO_VAL_FRACTIONAL_LOG2; |
964 |
+ break; |
965 |
+ case IIO_CHAN_INFO_SAMP_FREQ: |
966 |
+ idx = data->channel_data[chan->address].data_rate; |
967 |
+@@ -414,7 +418,7 @@ static int ads1015_write_raw(struct iio_dev *indio_dev, |
968 |
+ mutex_lock(&data->lock); |
969 |
+ switch (mask) { |
970 |
+ case IIO_CHAN_INFO_SCALE: |
971 |
+- ret = ads1015_set_scale(data, chan->address, val, val2); |
972 |
++ ret = ads1015_set_scale(data, chan, val, val2); |
973 |
+ break; |
974 |
+ case IIO_CHAN_INFO_SAMP_FREQ: |
975 |
+ ret = ads1015_set_data_rate(data, chan->address, val); |
976 |
+@@ -446,7 +450,10 @@ static const struct iio_buffer_setup_ops ads1015_buffer_setup_ops = { |
977 |
+ .validate_scan_mask = &iio_validate_scan_mask_onehot, |
978 |
+ }; |
979 |
+ |
980 |
+-static IIO_CONST_ATTR(scale_available, "3 2 1 0.5 0.25 0.125"); |
981 |
++static IIO_CONST_ATTR_NAMED(ads1015_scale_available, scale_available, |
982 |
++ "3 2 1 0.5 0.25 0.125"); |
983 |
++static IIO_CONST_ATTR_NAMED(ads1115_scale_available, scale_available, |
984 |
++ "0.1875 0.125 0.0625 0.03125 0.015625 0.007813"); |
985 |
+ |
986 |
+ static IIO_CONST_ATTR_NAMED(ads1015_sampling_frequency_available, |
987 |
+ sampling_frequency_available, "128 250 490 920 1600 2400 3300"); |
988 |
+@@ -454,7 +461,7 @@ static IIO_CONST_ATTR_NAMED(ads1115_sampling_frequency_available, |
989 |
+ sampling_frequency_available, "8 16 32 64 128 250 475 860"); |
990 |
+ |
991 |
+ static struct attribute *ads1015_attributes[] = { |
992 |
+- &iio_const_attr_scale_available.dev_attr.attr, |
993 |
++ &iio_const_attr_ads1015_scale_available.dev_attr.attr, |
994 |
+ &iio_const_attr_ads1015_sampling_frequency_available.dev_attr.attr, |
995 |
+ NULL, |
996 |
+ }; |
997 |
+@@ -464,7 +471,7 @@ static const struct attribute_group ads1015_attribute_group = { |
998 |
+ }; |
999 |
+ |
1000 |
+ static struct attribute *ads1115_attributes[] = { |
1001 |
+- &iio_const_attr_scale_available.dev_attr.attr, |
1002 |
++ &iio_const_attr_ads1115_scale_available.dev_attr.attr, |
1003 |
+ &iio_const_attr_ads1115_sampling_frequency_available.dev_attr.attr, |
1004 |
+ NULL, |
1005 |
+ }; |
1006 |
+@@ -630,6 +637,15 @@ static int ads1015_probe(struct i2c_client *client, |
1007 |
+ dev_err(&client->dev, "iio triggered buffer setup failed\n"); |
1008 |
+ return ret; |
1009 |
+ } |
1010 |
++ |
1011 |
++ ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
1012 |
++ ADS1015_CFG_MOD_MASK, |
1013 |
++ ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT); |
1014 |
++ if (ret) |
1015 |
++ return ret; |
1016 |
++ |
1017 |
++ data->conv_invalid = true; |
1018 |
++ |
1019 |
+ ret = pm_runtime_set_active(&client->dev); |
1020 |
+ if (ret) |
1021 |
+ goto err_buffer_cleanup; |
1022 |
+@@ -685,10 +701,15 @@ static int ads1015_runtime_resume(struct device *dev) |
1023 |
+ { |
1024 |
+ struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
1025 |
+ struct ads1015_data *data = iio_priv(indio_dev); |
1026 |
++ int ret; |
1027 |
+ |
1028 |
+- return regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
1029 |
++ ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
1030 |
+ ADS1015_CFG_MOD_MASK, |
1031 |
+ ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT); |
1032 |
++ if (!ret) |
1033 |
++ data->conv_invalid = true; |
1034 |
++ |
1035 |
++ return ret; |
1036 |
+ } |
1037 |
+ #endif |
1038 |
+ |
1039 |
+diff --git a/drivers/mcb/mcb-lpc.c b/drivers/mcb/mcb-lpc.c |
1040 |
+index d072c088ce73..945091a88354 100644 |
1041 |
+--- a/drivers/mcb/mcb-lpc.c |
1042 |
++++ b/drivers/mcb/mcb-lpc.c |
1043 |
+@@ -114,6 +114,12 @@ static struct resource sc24_fpga_resource = { |
1044 |
+ .flags = IORESOURCE_MEM, |
1045 |
+ }; |
1046 |
+ |
1047 |
++static struct resource sc31_fpga_resource = { |
1048 |
++ .start = 0xf000e000, |
1049 |
++ .end = 0xf000e000 + CHAM_HEADER_SIZE, |
1050 |
++ .flags = IORESOURCE_MEM, |
1051 |
++}; |
1052 |
++ |
1053 |
+ static struct platform_driver mcb_lpc_driver = { |
1054 |
+ .driver = { |
1055 |
+ .name = "mcb-lpc", |
1056 |
+@@ -132,6 +138,15 @@ static const struct dmi_system_id mcb_lpc_dmi_table[] = { |
1057 |
+ .driver_data = (void *)&sc24_fpga_resource, |
1058 |
+ .callback = mcb_lpc_create_platform_device, |
1059 |
+ }, |
1060 |
++ { |
1061 |
++ .ident = "SC31", |
1062 |
++ .matches = { |
1063 |
++ DMI_MATCH(DMI_SYS_VENDOR, "MEN"), |
1064 |
++ DMI_MATCH(DMI_PRODUCT_VERSION, "14SC31"), |
1065 |
++ }, |
1066 |
++ .driver_data = (void *)&sc31_fpga_resource, |
1067 |
++ .callback = mcb_lpc_create_platform_device, |
1068 |
++ }, |
1069 |
+ {} |
1070 |
+ }; |
1071 |
+ MODULE_DEVICE_TABLE(dmi, mcb_lpc_dmi_table); |
1072 |
+diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c |
1073 |
+index 75c5c903c8a6..53fa5b7380ff 100644 |
1074 |
+--- a/drivers/net/wireless/ath/ath10k/core.c |
1075 |
++++ b/drivers/net/wireless/ath/ath10k/core.c |
1076 |
+@@ -2055,6 +2055,12 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, |
1077 |
+ goto err_wmi_detach; |
1078 |
+ } |
1079 |
+ |
1080 |
++ /* If firmware indicates Full Rx Reorder support it must be used in a |
1081 |
++ * slightly different manner. Let HTT code know. |
1082 |
++ */ |
1083 |
++ ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER, |
1084 |
++ ar->wmi.svc_map)); |
1085 |
++ |
1086 |
+ status = ath10k_htt_rx_alloc(&ar->htt); |
1087 |
+ if (status) { |
1088 |
+ ath10k_err(ar, "failed to alloc htt rx: %d\n", status); |
1089 |
+@@ -2167,12 +2173,6 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, |
1090 |
+ } |
1091 |
+ } |
1092 |
+ |
1093 |
+- /* If firmware indicates Full Rx Reorder support it must be used in a |
1094 |
+- * slightly different manner. Let HTT code know. |
1095 |
+- */ |
1096 |
+- ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER, |
1097 |
+- ar->wmi.svc_map)); |
1098 |
+- |
1099 |
+ status = ath10k_htt_rx_ring_refill(ar); |
1100 |
+ if (status) { |
1101 |
+ ath10k_err(ar, "failed to refill htt rx ring: %d\n", status); |
1102 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1103 |
+index 84f4ba01e14f..875374e4747d 100644 |
1104 |
+--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1105 |
++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1106 |
+@@ -430,6 +430,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = { |
1107 |
+ {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)}, |
1108 |
+ {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)}, |
1109 |
+ {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)}, |
1110 |
++ {IWL_PCI_DEVICE(0x095A, 0x9E10, iwl7265_2ac_cfg)}, |
1111 |
+ |
1112 |
+ /* 8000 Series */ |
1113 |
+ {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)}, |
1114 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
1115 |
+index 06ad2d50f9b0..fdfdf2371986 100644 |
1116 |
+--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
1117 |
++++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
1118 |
+@@ -4215,7 +4215,7 @@ int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter) |
1119 |
+ if (adapter->config_bands & BAND_A) |
1120 |
+ n_channels_a = mwifiex_band_5ghz.n_channels; |
1121 |
+ |
1122 |
+- adapter->num_in_chan_stats = max_t(u32, n_channels_bg, n_channels_a); |
1123 |
++ adapter->num_in_chan_stats = n_channels_bg + n_channels_a; |
1124 |
+ adapter->chan_stats = vmalloc(sizeof(*adapter->chan_stats) * |
1125 |
+ adapter->num_in_chan_stats); |
1126 |
+ |
1127 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c |
1128 |
+index ae9630b49342..9900855746ac 100644 |
1129 |
+--- a/drivers/net/wireless/marvell/mwifiex/scan.c |
1130 |
++++ b/drivers/net/wireless/marvell/mwifiex/scan.c |
1131 |
+@@ -2492,6 +2492,12 @@ mwifiex_update_chan_statistics(struct mwifiex_private *priv, |
1132 |
+ sizeof(struct mwifiex_chan_stats); |
1133 |
+ |
1134 |
+ for (i = 0 ; i < num_chan; i++) { |
1135 |
++ if (adapter->survey_idx >= adapter->num_in_chan_stats) { |
1136 |
++ mwifiex_dbg(adapter, WARN, |
1137 |
++ "FW reported too many channel results (max %d)\n", |
1138 |
++ adapter->num_in_chan_stats); |
1139 |
++ return; |
1140 |
++ } |
1141 |
+ chan_stats.chan_num = fw_chan_stats->chan_num; |
1142 |
+ chan_stats.bandcfg = fw_chan_stats->bandcfg; |
1143 |
+ chan_stats.flags = fw_chan_stats->flags; |
1144 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c |
1145 |
+index 032b6317690d..08dc8919ef60 100644 |
1146 |
+--- a/drivers/net/wireless/realtek/rtlwifi/pci.c |
1147 |
++++ b/drivers/net/wireless/realtek/rtlwifi/pci.c |
1148 |
+@@ -2257,7 +2257,7 @@ int rtl_pci_probe(struct pci_dev *pdev, |
1149 |
+ /* find adapter */ |
1150 |
+ if (!_rtl_pci_find_adapter(pdev, hw)) { |
1151 |
+ err = -ENODEV; |
1152 |
+- goto fail3; |
1153 |
++ goto fail2; |
1154 |
+ } |
1155 |
+ |
1156 |
+ /* Init IO handler */ |
1157 |
+@@ -2318,10 +2318,10 @@ int rtl_pci_probe(struct pci_dev *pdev, |
1158 |
+ pci_set_drvdata(pdev, NULL); |
1159 |
+ rtl_deinit_core(hw); |
1160 |
+ |
1161 |
++fail2: |
1162 |
+ if (rtlpriv->io.pci_mem_start != 0) |
1163 |
+ pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start); |
1164 |
+ |
1165 |
+-fail2: |
1166 |
+ pci_release_regions(pdev); |
1167 |
+ complete(&rtlpriv->firmware_loading_complete); |
1168 |
+ |
1169 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
1170 |
+index 774e72058d24..bddd5a5ebe52 100644 |
1171 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
1172 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
1173 |
+@@ -175,6 +175,8 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) |
1174 |
+ rtl_fw_cb); |
1175 |
+ if (err) { |
1176 |
+ pr_info("Failed to request firmware!\n"); |
1177 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1178 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1179 |
+ return 1; |
1180 |
+ } |
1181 |
+ |
1182 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
1183 |
+index bcbb0c60f1f1..38f85bfdf0c7 100644 |
1184 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
1185 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
1186 |
+@@ -176,6 +176,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) |
1187 |
+ rtl_fw_cb); |
1188 |
+ if (err) { |
1189 |
+ pr_err("Failed to request firmware!\n"); |
1190 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1191 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1192 |
+ return 1; |
1193 |
+ } |
1194 |
+ |
1195 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1196 |
+index 96c923b3feb4..e3eb850bb1de 100644 |
1197 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1198 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1199 |
+@@ -85,6 +85,10 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
1200 |
+ err = request_firmware_nowait(THIS_MODULE, 1, |
1201 |
+ fw_name, rtlpriv->io.dev, |
1202 |
+ GFP_KERNEL, hw, rtl_fw_cb); |
1203 |
++ if (err) { |
1204 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1205 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1206 |
++ } |
1207 |
+ return err; |
1208 |
+ } |
1209 |
+ |
1210 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1211 |
+index 16132c66e5e1..e38d6f7370aa 100644 |
1212 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1213 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1214 |
+@@ -183,6 +183,8 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) |
1215 |
+ rtl_fw_cb); |
1216 |
+ if (err) { |
1217 |
+ pr_err("Failed to request firmware!\n"); |
1218 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1219 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1220 |
+ return 1; |
1221 |
+ } |
1222 |
+ |
1223 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1224 |
+index eaa503b7c4b4..745e9c32655c 100644 |
1225 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1226 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1227 |
+@@ -177,6 +177,8 @@ int rtl92ee_init_sw_vars(struct ieee80211_hw *hw) |
1228 |
+ rtl_fw_cb); |
1229 |
+ if (err) { |
1230 |
+ pr_err("Failed to request firmware!\n"); |
1231 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1232 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1233 |
+ return 1; |
1234 |
+ } |
1235 |
+ |
1236 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1237 |
+index 2006b09ea74f..1ec20efb9ce1 100644 |
1238 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1239 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1240 |
+@@ -216,6 +216,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) |
1241 |
+ rtl92se_fw_cb); |
1242 |
+ if (err) { |
1243 |
+ pr_err("Failed to request firmware!\n"); |
1244 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1245 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1246 |
+ return 1; |
1247 |
+ } |
1248 |
+ |
1249 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1250 |
+index 7bf9f2557920..aab86667a7f3 100644 |
1251 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1252 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1253 |
+@@ -184,6 +184,8 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw) |
1254 |
+ rtl_fw_cb); |
1255 |
+ if (err) { |
1256 |
+ pr_err("Failed to request firmware!\n"); |
1257 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1258 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1259 |
+ return 1; |
1260 |
+ } |
1261 |
+ return 0; |
1262 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1263 |
+index f9d10f1e7cf8..f47d839f388d 100644 |
1264 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1265 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1266 |
+@@ -187,16 +187,10 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw) |
1267 |
+ rtlpriv->io.dev, GFP_KERNEL, hw, |
1268 |
+ rtl_fw_cb); |
1269 |
+ if (err) { |
1270 |
+- /* Failed to get firmware. Check if old version available */ |
1271 |
+- fw_name = "rtlwifi/rtl8723befw.bin"; |
1272 |
+- pr_info("Using firmware %s\n", fw_name); |
1273 |
+- err = request_firmware_nowait(THIS_MODULE, 1, fw_name, |
1274 |
+- rtlpriv->io.dev, GFP_KERNEL, hw, |
1275 |
+- rtl_fw_cb); |
1276 |
+- if (err) { |
1277 |
+- pr_err("Failed to request firmware!\n"); |
1278 |
+- return 1; |
1279 |
+- } |
1280 |
++ pr_err("Failed to request firmware!\n"); |
1281 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1282 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1283 |
++ return 1; |
1284 |
+ } |
1285 |
+ return 0; |
1286 |
+ } |
1287 |
+@@ -287,6 +281,7 @@ static const struct rtl_hal_cfg rtl8723be_hal_cfg = { |
1288 |
+ .bar_id = 2, |
1289 |
+ .write_readback = true, |
1290 |
+ .name = "rtl8723be_pci", |
1291 |
++ .alt_fw_name = "rtlwifi/rtl8723befw.bin", |
1292 |
+ .ops = &rtl8723be_hal_ops, |
1293 |
+ .mod_params = &rtl8723be_mod_params, |
1294 |
+ .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, |
1295 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1296 |
+index d71d2776ca03..5925edf7877f 100644 |
1297 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1298 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1299 |
+@@ -196,6 +196,8 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1300 |
+ rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000); |
1301 |
+ if (!rtlpriv->rtlhal.wowlan_firmware) { |
1302 |
+ pr_err("Can't alloc buffer for wowlan fw.\n"); |
1303 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1304 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1305 |
+ return 1; |
1306 |
+ } |
1307 |
+ |
1308 |
+@@ -214,16 +216,10 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1309 |
+ rtlpriv->io.dev, GFP_KERNEL, hw, |
1310 |
+ rtl_fw_cb); |
1311 |
+ if (err) { |
1312 |
+- /* Failed to get firmware. Check if old version available */ |
1313 |
+- fw_name = "rtlwifi/rtl8821aefw.bin"; |
1314 |
+- pr_info("Using firmware %s\n", fw_name); |
1315 |
+- err = request_firmware_nowait(THIS_MODULE, 1, fw_name, |
1316 |
+- rtlpriv->io.dev, GFP_KERNEL, hw, |
1317 |
+- rtl_fw_cb); |
1318 |
+- if (err) { |
1319 |
+- pr_err("Failed to request normal firmware!\n"); |
1320 |
+- return 1; |
1321 |
+- } |
1322 |
++ pr_err("Failed to request normal firmware!\n"); |
1323 |
++ vfree(rtlpriv->rtlhal.wowlan_firmware); |
1324 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1325 |
++ return 1; |
1326 |
+ } |
1327 |
+ /*load wowlan firmware*/ |
1328 |
+ pr_info("Using firmware %s\n", wowlan_fw_name); |
1329 |
+@@ -233,6 +229,8 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1330 |
+ rtl_wowlan_fw_cb); |
1331 |
+ if (err) { |
1332 |
+ pr_err("Failed to request wowlan firmware!\n"); |
1333 |
++ vfree(rtlpriv->rtlhal.wowlan_firmware); |
1334 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1335 |
+ return 1; |
1336 |
+ } |
1337 |
+ return 0; |
1338 |
+@@ -325,6 +323,7 @@ static const struct rtl_hal_cfg rtl8821ae_hal_cfg = { |
1339 |
+ .bar_id = 2, |
1340 |
+ .write_readback = true, |
1341 |
+ .name = "rtl8821ae_pci", |
1342 |
++ .alt_fw_name = "rtlwifi/rtl8821aefw.bin", |
1343 |
+ .ops = &rtl8821ae_hal_ops, |
1344 |
+ .mod_params = &rtl8821ae_mod_params, |
1345 |
+ .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, |
1346 |
+diff --git a/drivers/of/device.c b/drivers/of/device.c |
1347 |
+index e0a28ea341fe..eabfa36383ce 100644 |
1348 |
+--- a/drivers/of/device.c |
1349 |
++++ b/drivers/of/device.c |
1350 |
+@@ -274,6 +274,8 @@ ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len) |
1351 |
+ ssize_t sl = of_device_get_modalias(dev, str, len - 2); |
1352 |
+ if (sl < 0) |
1353 |
+ return sl; |
1354 |
++ if (sl > len - 2) |
1355 |
++ return -ENOMEM; |
1356 |
+ |
1357 |
+ str[sl++] = '\n'; |
1358 |
+ str[sl] = 0; |
1359 |
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c |
1360 |
+index 84e782d8e7c3..aad6ebb51735 100644 |
1361 |
+--- a/drivers/scsi/sg.c |
1362 |
++++ b/drivers/scsi/sg.c |
1363 |
+@@ -1233,6 +1233,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1364 |
+ unsigned long req_sz, len, sa; |
1365 |
+ Sg_scatter_hold *rsv_schp; |
1366 |
+ int k, length; |
1367 |
++ int ret = 0; |
1368 |
+ |
1369 |
+ if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) |
1370 |
+ return -ENXIO; |
1371 |
+@@ -1243,8 +1244,11 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1372 |
+ if (vma->vm_pgoff) |
1373 |
+ return -EINVAL; /* want no offset */ |
1374 |
+ rsv_schp = &sfp->reserve; |
1375 |
+- if (req_sz > rsv_schp->bufflen) |
1376 |
+- return -ENOMEM; /* cannot map more than reserved buffer */ |
1377 |
++ mutex_lock(&sfp->f_mutex); |
1378 |
++ if (req_sz > rsv_schp->bufflen) { |
1379 |
++ ret = -ENOMEM; /* cannot map more than reserved buffer */ |
1380 |
++ goto out; |
1381 |
++ } |
1382 |
+ |
1383 |
+ sa = vma->vm_start; |
1384 |
+ length = 1 << (PAGE_SHIFT + rsv_schp->page_order); |
1385 |
+@@ -1258,7 +1262,9 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1386 |
+ vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
1387 |
+ vma->vm_private_data = sfp; |
1388 |
+ vma->vm_ops = &sg_mmap_vm_ops; |
1389 |
+- return 0; |
1390 |
++out: |
1391 |
++ mutex_unlock(&sfp->f_mutex); |
1392 |
++ return ret; |
1393 |
+ } |
1394 |
+ |
1395 |
+ static void |
1396 |
+@@ -1735,9 +1741,12 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) |
1397 |
+ !sfp->res_in_use) { |
1398 |
+ sfp->res_in_use = 1; |
1399 |
+ sg_link_reserve(sfp, srp, dxfer_len); |
1400 |
+- } else if ((hp->flags & SG_FLAG_MMAP_IO) && sfp->res_in_use) { |
1401 |
++ } else if (hp->flags & SG_FLAG_MMAP_IO) { |
1402 |
++ res = -EBUSY; /* sfp->res_in_use == 1 */ |
1403 |
++ if (dxfer_len > rsv_schp->bufflen) |
1404 |
++ res = -ENOMEM; |
1405 |
+ mutex_unlock(&sfp->f_mutex); |
1406 |
+- return -EBUSY; |
1407 |
++ return res; |
1408 |
+ } else { |
1409 |
+ res = sg_build_indirect(req_schp, sfp, dxfer_len); |
1410 |
+ if (res) { |
1411 |
+diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c |
1412 |
+index cd2eafc04232..bdc68830389f 100644 |
1413 |
+--- a/drivers/staging/ccree/ssi_cipher.c |
1414 |
++++ b/drivers/staging/ccree/ssi_cipher.c |
1415 |
+@@ -23,6 +23,7 @@ |
1416 |
+ #include <crypto/aes.h> |
1417 |
+ #include <crypto/ctr.h> |
1418 |
+ #include <crypto/des.h> |
1419 |
++#include <crypto/scatterwalk.h> |
1420 |
+ |
1421 |
+ #include "ssi_config.h" |
1422 |
+ #include "ssi_driver.h" |
1423 |
+@@ -716,6 +717,7 @@ static int ssi_blkcipher_complete(struct device *dev, |
1424 |
+ { |
1425 |
+ int completion_error = 0; |
1426 |
+ u32 inflight_counter; |
1427 |
++ struct ablkcipher_request *req = (struct ablkcipher_request *)areq; |
1428 |
+ |
1429 |
+ ssi_buffer_mgr_unmap_blkcipher_request(dev, req_ctx, ivsize, src, dst); |
1430 |
+ |
1431 |
+@@ -726,6 +728,22 @@ static int ssi_blkcipher_complete(struct device *dev, |
1432 |
+ ctx_p->drvdata->inflight_counter--; |
1433 |
+ |
1434 |
+ if (areq) { |
1435 |
++ /* |
1436 |
++ * The crypto API expects us to set the req->info to the last |
1437 |
++ * ciphertext block. For encrypt, simply copy from the result. |
1438 |
++ * For decrypt, we must copy from a saved buffer since this |
1439 |
++ * could be an in-place decryption operation and the src is |
1440 |
++ * lost by this point. |
1441 |
++ */ |
1442 |
++ if (req_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) { |
1443 |
++ memcpy(req->info, req_ctx->backup_info, ivsize); |
1444 |
++ kfree(req_ctx->backup_info); |
1445 |
++ } else { |
1446 |
++ scatterwalk_map_and_copy(req->info, req->dst, |
1447 |
++ (req->nbytes - ivsize), |
1448 |
++ ivsize, 0); |
1449 |
++ } |
1450 |
++ |
1451 |
+ ablkcipher_request_complete(areq, completion_error); |
1452 |
+ return 0; |
1453 |
+ } |
1454 |
+@@ -759,11 +777,13 @@ static int ssi_blkcipher_process( |
1455 |
+ if (unlikely(validate_data_size(ctx_p, nbytes))) { |
1456 |
+ SSI_LOG_ERR("Unsupported data size %d.\n", nbytes); |
1457 |
+ crypto_tfm_set_flags(tfm, CRYPTO_TFM_RES_BAD_BLOCK_LEN); |
1458 |
+- return -EINVAL; |
1459 |
++ rc = -EINVAL; |
1460 |
++ goto exit_process; |
1461 |
+ } |
1462 |
+ if (nbytes == 0) { |
1463 |
+ /* No data to process is valid */ |
1464 |
+- return 0; |
1465 |
++ rc = 0; |
1466 |
++ goto exit_process; |
1467 |
+ } |
1468 |
+ /*For CTS in case of data size aligned to 16 use CBC mode*/ |
1469 |
+ if (((nbytes % AES_BLOCK_SIZE) == 0) && (ctx_p->cipher_mode == DRV_CIPHER_CBC_CTS)) { |
1470 |
+@@ -842,6 +862,9 @@ static int ssi_blkcipher_process( |
1471 |
+ if (cts_restore_flag != 0) |
1472 |
+ ctx_p->cipher_mode = DRV_CIPHER_CBC_CTS; |
1473 |
+ |
1474 |
++ if (rc != -EINPROGRESS) |
1475 |
++ kfree(req_ctx->backup_info); |
1476 |
++ |
1477 |
+ return rc; |
1478 |
+ } |
1479 |
+ |
1480 |
+@@ -884,7 +907,6 @@ static int ssi_ablkcipher_encrypt(struct ablkcipher_request *req) |
1481 |
+ struct blkcipher_req_ctx *req_ctx = ablkcipher_request_ctx(req); |
1482 |
+ unsigned int ivsize = crypto_ablkcipher_ivsize(ablk_tfm); |
1483 |
+ |
1484 |
+- req_ctx->backup_info = req->info; |
1485 |
+ req_ctx->is_giv = false; |
1486 |
+ |
1487 |
+ return ssi_blkcipher_process(tfm, req_ctx, req->dst, req->src, req->nbytes, req->info, ivsize, (void *)req, DRV_CRYPTO_DIRECTION_ENCRYPT); |
1488 |
+@@ -897,8 +919,18 @@ static int ssi_ablkcipher_decrypt(struct ablkcipher_request *req) |
1489 |
+ struct blkcipher_req_ctx *req_ctx = ablkcipher_request_ctx(req); |
1490 |
+ unsigned int ivsize = crypto_ablkcipher_ivsize(ablk_tfm); |
1491 |
+ |
1492 |
+- req_ctx->backup_info = req->info; |
1493 |
++ /* |
1494 |
++ * Allocate and save the last IV sized bytes of the source, which will |
1495 |
++ * be lost in case of in-place decryption and might be needed for CTS. |
1496 |
++ */ |
1497 |
++ req_ctx->backup_info = kmalloc(ivsize, GFP_KERNEL); |
1498 |
++ if (!req_ctx->backup_info) |
1499 |
++ return -ENOMEM; |
1500 |
++ |
1501 |
++ scatterwalk_map_and_copy(req_ctx->backup_info, req->src, |
1502 |
++ (req->nbytes - ivsize), ivsize, 0); |
1503 |
+ req_ctx->is_giv = false; |
1504 |
++ |
1505 |
+ return ssi_blkcipher_process(tfm, req_ctx, req->dst, req->src, req->nbytes, req->info, ivsize, (void *)req, DRV_CRYPTO_DIRECTION_DECRYPT); |
1506 |
+ } |
1507 |
+ |
1508 |
+diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |
1509 |
+index e6d28a249fc1..bfbabae1aad8 100644 |
1510 |
+--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |
1511 |
++++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |
1512 |
+@@ -123,8 +123,8 @@ struct dpaa2_eth_swa { |
1513 |
+ /* Error bits in FD CTRL */ |
1514 |
+ #define DPAA2_FD_CTRL_UFD 0x00000004 |
1515 |
+ #define DPAA2_FD_CTRL_SBE 0x00000008 |
1516 |
+-#define DPAA2_FD_CTRL_FSE 0x00000010 |
1517 |
+-#define DPAA2_FD_CTRL_FAERR 0x00000020 |
1518 |
++#define DPAA2_FD_CTRL_FSE 0x00000020 |
1519 |
++#define DPAA2_FD_CTRL_FAERR 0x00000040 |
1520 |
+ |
1521 |
+ #define DPAA2_FD_RX_ERR_MASK (DPAA2_FD_CTRL_SBE | \ |
1522 |
+ DPAA2_FD_CTRL_FAERR) |
1523 |
+diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c |
1524 |
+index 36b5a11f21d2..a401b13f5f5e 100644 |
1525 |
+--- a/drivers/staging/rts5208/rtsx_scsi.c |
1526 |
++++ b/drivers/staging/rts5208/rtsx_scsi.c |
1527 |
+@@ -414,7 +414,7 @@ void set_sense_data(struct rtsx_chip *chip, unsigned int lun, u8 err_code, |
1528 |
+ sense->ascq = ascq; |
1529 |
+ if (sns_key_info0 != 0) { |
1530 |
+ sense->sns_key_info[0] = SKSV | sns_key_info0; |
1531 |
+- sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 8; |
1532 |
++ sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 4; |
1533 |
+ sense->sns_key_info[2] = sns_key_info1 & 0x0f; |
1534 |
+ } |
1535 |
+ } |
1536 |
+diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c |
1537 |
+index 69c0232a22f8..fb40dd0588b9 100644 |
1538 |
+--- a/drivers/thunderbolt/ctl.c |
1539 |
++++ b/drivers/thunderbolt/ctl.c |
1540 |
+@@ -804,7 +804,7 @@ struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route, |
1541 |
+ req->request_type = TB_CFG_PKG_RESET; |
1542 |
+ req->response = &reply; |
1543 |
+ req->response_size = sizeof(reply); |
1544 |
+- req->response_type = sizeof(TB_CFG_PKG_RESET); |
1545 |
++ req->response_type = TB_CFG_PKG_RESET; |
1546 |
+ |
1547 |
+ res = tb_cfg_request_sync(ctl, req, timeout_msec); |
1548 |
+ |
1549 |
+diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
1550 |
+index ebe27595c4af..0ff0feddfd1f 100644 |
1551 |
+--- a/drivers/usb/core/devio.c |
1552 |
++++ b/drivers/usb/core/devio.c |
1553 |
+@@ -623,6 +623,8 @@ static void async_completed(struct urb *urb) |
1554 |
+ if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && |
1555 |
+ as->status != -ENOENT) |
1556 |
+ cancel_bulk_urbs(ps, as->bulk_addr); |
1557 |
++ |
1558 |
++ wake_up(&ps->wait); |
1559 |
+ spin_unlock(&ps->lock); |
1560 |
+ |
1561 |
+ if (signr) { |
1562 |
+@@ -630,8 +632,6 @@ static void async_completed(struct urb *urb) |
1563 |
+ put_pid(pid); |
1564 |
+ put_cred(cred); |
1565 |
+ } |
1566 |
+- |
1567 |
+- wake_up(&ps->wait); |
1568 |
+ } |
1569 |
+ |
1570 |
+ static void destroy_async(struct usb_dev_state *ps, struct list_head *list) |
1571 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1572 |
+index 574da2b4529c..82806e311202 100644 |
1573 |
+--- a/drivers/usb/core/quirks.c |
1574 |
++++ b/drivers/usb/core/quirks.c |
1575 |
+@@ -57,8 +57,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1576 |
+ /* Microsoft LifeCam-VX700 v2.0 */ |
1577 |
+ { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, |
1578 |
+ |
1579 |
+- /* Logitech HD Pro Webcams C920 and C930e */ |
1580 |
++ /* Logitech HD Pro Webcams C920, C920-C and C930e */ |
1581 |
+ { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, |
1582 |
++ { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, |
1583 |
+ { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, |
1584 |
+ |
1585 |
+ /* Logitech ConferenceCam CC3000e */ |
1586 |
+@@ -217,6 +218,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1587 |
+ { USB_DEVICE(0x1a0a, 0x0200), .driver_info = |
1588 |
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, |
1589 |
+ |
1590 |
++ /* Corsair Strafe RGB */ |
1591 |
++ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, |
1592 |
++ |
1593 |
+ /* Acer C120 LED Projector */ |
1594 |
+ { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM }, |
1595 |
+ |
1596 |
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c |
1597 |
+index c8f38649f749..658d9d1f9ea3 100644 |
1598 |
+--- a/drivers/usb/host/pci-quirks.c |
1599 |
++++ b/drivers/usb/host/pci-quirks.c |
1600 |
+@@ -142,29 +142,30 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) |
1601 |
+ pinfo->sb_type.gen = AMD_CHIPSET_SB700; |
1602 |
+ else if (rev >= 0x40 && rev <= 0x4f) |
1603 |
+ pinfo->sb_type.gen = AMD_CHIPSET_SB800; |
1604 |
+- } |
1605 |
+- pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1606 |
+- 0x145c, NULL); |
1607 |
+- if (pinfo->smbus_dev) { |
1608 |
+- pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; |
1609 |
+ } else { |
1610 |
+ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1611 |
+ PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); |
1612 |
+ |
1613 |
+- if (!pinfo->smbus_dev) { |
1614 |
+- pinfo->sb_type.gen = NOT_AMD_CHIPSET; |
1615 |
+- return 0; |
1616 |
++ if (pinfo->smbus_dev) { |
1617 |
++ rev = pinfo->smbus_dev->revision; |
1618 |
++ if (rev >= 0x11 && rev <= 0x14) |
1619 |
++ pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; |
1620 |
++ else if (rev >= 0x15 && rev <= 0x18) |
1621 |
++ pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; |
1622 |
++ else if (rev >= 0x39 && rev <= 0x3a) |
1623 |
++ pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; |
1624 |
++ } else { |
1625 |
++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1626 |
++ 0x145c, NULL); |
1627 |
++ if (pinfo->smbus_dev) { |
1628 |
++ rev = pinfo->smbus_dev->revision; |
1629 |
++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; |
1630 |
++ } else { |
1631 |
++ pinfo->sb_type.gen = NOT_AMD_CHIPSET; |
1632 |
++ return 0; |
1633 |
++ } |
1634 |
+ } |
1635 |
+- |
1636 |
+- rev = pinfo->smbus_dev->revision; |
1637 |
+- if (rev >= 0x11 && rev <= 0x14) |
1638 |
+- pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; |
1639 |
+- else if (rev >= 0x15 && rev <= 0x18) |
1640 |
+- pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; |
1641 |
+- else if (rev >= 0x39 && rev <= 0x3a) |
1642 |
+- pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; |
1643 |
+ } |
1644 |
+- |
1645 |
+ pinfo->sb_type.rev = rev; |
1646 |
+ return 1; |
1647 |
+ } |
1648 |
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c |
1649 |
+index 87cbd56cc761..b67692857daf 100644 |
1650 |
+--- a/drivers/usb/musb/musb_core.c |
1651 |
++++ b/drivers/usb/musb/musb_core.c |
1652 |
+@@ -2671,6 +2671,13 @@ static int musb_suspend(struct device *dev) |
1653 |
+ { |
1654 |
+ struct musb *musb = dev_to_musb(dev); |
1655 |
+ unsigned long flags; |
1656 |
++ int ret; |
1657 |
++ |
1658 |
++ ret = pm_runtime_get_sync(dev); |
1659 |
++ if (ret < 0) { |
1660 |
++ pm_runtime_put_noidle(dev); |
1661 |
++ return ret; |
1662 |
++ } |
1663 |
+ |
1664 |
+ musb_platform_disable(musb); |
1665 |
+ musb_disable_interrupts(musb); |
1666 |
+@@ -2721,14 +2728,6 @@ static int musb_resume(struct device *dev) |
1667 |
+ if ((devctl & mask) != (musb->context.devctl & mask)) |
1668 |
+ musb->port1_status = 0; |
1669 |
+ |
1670 |
+- /* |
1671 |
+- * The USB HUB code expects the device to be in RPM_ACTIVE once it came |
1672 |
+- * out of suspend |
1673 |
+- */ |
1674 |
+- pm_runtime_disable(dev); |
1675 |
+- pm_runtime_set_active(dev); |
1676 |
+- pm_runtime_enable(dev); |
1677 |
+- |
1678 |
+ musb_start(musb); |
1679 |
+ |
1680 |
+ spin_lock_irqsave(&musb->lock, flags); |
1681 |
+@@ -2738,6 +2737,9 @@ static int musb_resume(struct device *dev) |
1682 |
+ error); |
1683 |
+ spin_unlock_irqrestore(&musb->lock, flags); |
1684 |
+ |
1685 |
++ pm_runtime_mark_last_busy(dev); |
1686 |
++ pm_runtime_put_autosuspend(dev); |
1687 |
++ |
1688 |
+ return 0; |
1689 |
+ } |
1690 |
+ |
1691 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1692 |
+index fe123153b1a5..2a9944326210 100644 |
1693 |
+--- a/drivers/usb/serial/option.c |
1694 |
++++ b/drivers/usb/serial/option.c |
1695 |
+@@ -2023,6 +2023,7 @@ static const struct usb_device_id option_ids[] = { |
1696 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, |
1697 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, |
1698 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ |
1699 |
++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d0e, 0xff) }, /* D-Link DWM-157 C1 */ |
1700 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ |
1701 |
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1702 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ |
1703 |
+diff --git a/fs/dlm/user.c b/fs/dlm/user.c |
1704 |
+index 23488f559cf9..84199151b64b 100644 |
1705 |
+--- a/fs/dlm/user.c |
1706 |
++++ b/fs/dlm/user.c |
1707 |
+@@ -355,6 +355,10 @@ static int dlm_device_register(struct dlm_ls *ls, char *name) |
1708 |
+ error = misc_register(&ls->ls_device); |
1709 |
+ if (error) { |
1710 |
+ kfree(ls->ls_device.name); |
1711 |
++ /* this has to be set to NULL |
1712 |
++ * to avoid a double-free in dlm_device_deregister |
1713 |
++ */ |
1714 |
++ ls->ls_device.name = NULL; |
1715 |
+ } |
1716 |
+ fail: |
1717 |
+ return error; |
1718 |
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h |
1719 |
+index c71e532da458..4adf6161ec77 100644 |
1720 |
+--- a/include/linux/pci_ids.h |
1721 |
++++ b/include/linux/pci_ids.h |
1722 |
+@@ -576,6 +576,7 @@ |
1723 |
+ #define PCI_DEVICE_ID_AMD_CS5536_EHC 0x2095 |
1724 |
+ #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 |
1725 |
+ #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 |
1726 |
++#define PCI_DEVICE_ID_AMD_CS5536_DEV_IDE 0x2092 |
1727 |
+ #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A |
1728 |
+ #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 |
1729 |
+ #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 |
1730 |
+diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h |
1731 |
+index db6dc9dc0482..1c49431f3121 100644 |
1732 |
+--- a/include/linux/workqueue.h |
1733 |
++++ b/include/linux/workqueue.h |
1734 |
+@@ -323,8 +323,8 @@ enum { |
1735 |
+ |
1736 |
+ __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
1737 |
+ __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
1738 |
+- __WQ_ORDERED_EXPLICIT = 1 << 18, /* internal: alloc_ordered_workqueue() */ |
1739 |
+ __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */ |
1740 |
++ __WQ_ORDERED_EXPLICIT = 1 << 19, /* internal: alloc_ordered_workqueue() */ |
1741 |
+ |
1742 |
+ WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
1743 |
+ WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ |
1744 |
+diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h |
1745 |
+index 51f891fb1b18..7668b5791c91 100644 |
1746 |
+--- a/include/uapi/linux/android/binder.h |
1747 |
++++ b/include/uapi/linux/android/binder.h |
1748 |
+@@ -132,6 +132,7 @@ enum { |
1749 |
+ |
1750 |
+ /* struct binder_fd_array_object - object describing an array of fds in a buffer |
1751 |
+ * @hdr: common header structure |
1752 |
++ * @pad: padding to ensure correct alignment |
1753 |
+ * @num_fds: number of file descriptors in the buffer |
1754 |
+ * @parent: index in offset array to buffer holding the fd array |
1755 |
+ * @parent_offset: start offset of fd array in the buffer |
1756 |
+@@ -152,6 +153,7 @@ enum { |
1757 |
+ */ |
1758 |
+ struct binder_fd_array_object { |
1759 |
+ struct binder_object_header hdr; |
1760 |
++ __u32 pad; |
1761 |
+ binder_size_t num_fds; |
1762 |
+ binder_size_t parent; |
1763 |
+ binder_size_t parent_offset; |
1764 |
+diff --git a/kernel/configs/android-base.config b/kernel/configs/android-base.config |
1765 |
+index d70829033bb7..d3fd428f4b92 100644 |
1766 |
+--- a/kernel/configs/android-base.config |
1767 |
++++ b/kernel/configs/android-base.config |
1768 |
+@@ -10,6 +10,7 @@ |
1769 |
+ # CONFIG_USELIB is not set |
1770 |
+ CONFIG_ANDROID=y |
1771 |
+ CONFIG_ANDROID_BINDER_IPC=y |
1772 |
++CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder |
1773 |
+ CONFIG_ANDROID_LOW_MEMORY_KILLER=y |
1774 |
+ CONFIG_ARMV8_DEPRECATED=y |
1775 |
+ CONFIG_ASHMEM=y |