1 |
commit: e6019d54e7ac2d157f240768f137469e7e934f3f |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 10 14:37:39 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 10 14:37:39 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e6019d54 |
7 |
|
8 |
Linux patch 4.12.12 |
9 |
|
10 |
0000_README | 4 + |
11 |
1011_linux-4.12.12.patch | 1428 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1432 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index dd06605..c3ac518 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -87,6 +87,10 @@ Patch: 1010_linux-4.12.11.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.12.11 |
21 |
|
22 |
+Patch: 1011_linux-4.12.12.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.12.12 |
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/1011_linux-4.12.12.patch b/1011_linux-4.12.12.patch |
31 |
new file mode 100644 |
32 |
index 0000000..d3993f4 |
33 |
--- /dev/null |
34 |
+++ b/1011_linux-4.12.12.patch |
35 |
@@ -0,0 +1,1428 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index e7b2b54b032c..e96306381ee8 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 12 |
43 |
+-SUBLEVEL = 11 |
44 |
++SUBLEVEL = 12 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Fearless Coyote |
47 |
+ |
48 |
+diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h |
49 |
+index e6e3b887bee3..683560763238 100644 |
50 |
+--- a/arch/s390/include/asm/pgtable.h |
51 |
++++ b/arch/s390/include/asm/pgtable.h |
52 |
+@@ -502,7 +502,7 @@ static inline int mm_alloc_pgste(struct mm_struct *mm) |
53 |
+ * In the case that a guest uses storage keys |
54 |
+ * faults should no longer be backed by zero pages |
55 |
+ */ |
56 |
+-#define mm_forbids_zeropage mm_use_skey |
57 |
++#define mm_forbids_zeropage mm_has_pgste |
58 |
+ static inline int mm_use_skey(struct mm_struct *mm) |
59 |
+ { |
60 |
+ #ifdef CONFIG_PGSTE |
61 |
+diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c |
62 |
+index 7f6db1e6c048..3ce36f92ba93 100644 |
63 |
+--- a/arch/s390/mm/gmap.c |
64 |
++++ b/arch/s390/mm/gmap.c |
65 |
+@@ -2117,6 +2117,37 @@ static inline void thp_split_mm(struct mm_struct *mm) |
66 |
+ #endif |
67 |
+ } |
68 |
+ |
69 |
++/* |
70 |
++ * Remove all empty zero pages from the mapping for lazy refaulting |
71 |
++ * - This must be called after mm->context.has_pgste is set, to avoid |
72 |
++ * future creation of zero pages |
73 |
++ * - This must be called after THP was enabled |
74 |
++ */ |
75 |
++static int __zap_zero_pages(pmd_t *pmd, unsigned long start, |
76 |
++ unsigned long end, struct mm_walk *walk) |
77 |
++{ |
78 |
++ unsigned long addr; |
79 |
++ |
80 |
++ for (addr = start; addr != end; addr += PAGE_SIZE) { |
81 |
++ pte_t *ptep; |
82 |
++ spinlock_t *ptl; |
83 |
++ |
84 |
++ ptep = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); |
85 |
++ if (is_zero_pfn(pte_pfn(*ptep))) |
86 |
++ ptep_xchg_direct(walk->mm, addr, ptep, __pte(_PAGE_INVALID)); |
87 |
++ pte_unmap_unlock(ptep, ptl); |
88 |
++ } |
89 |
++ return 0; |
90 |
++} |
91 |
++ |
92 |
++static inline void zap_zero_pages(struct mm_struct *mm) |
93 |
++{ |
94 |
++ struct mm_walk walk = { .pmd_entry = __zap_zero_pages }; |
95 |
++ |
96 |
++ walk.mm = mm; |
97 |
++ walk_page_range(0, TASK_SIZE, &walk); |
98 |
++} |
99 |
++ |
100 |
+ /* |
101 |
+ * switch on pgstes for its userspace process (for kvm) |
102 |
+ */ |
103 |
+@@ -2134,6 +2165,7 @@ int s390_enable_sie(void) |
104 |
+ mm->context.has_pgste = 1; |
105 |
+ /* split thp mappings and disable thp for future mappings */ |
106 |
+ thp_split_mm(mm); |
107 |
++ zap_zero_pages(mm); |
108 |
+ up_write(&mm->mmap_sem); |
109 |
+ return 0; |
110 |
+ } |
111 |
+@@ -2146,13 +2178,6 @@ EXPORT_SYMBOL_GPL(s390_enable_sie); |
112 |
+ static int __s390_enable_skey(pte_t *pte, unsigned long addr, |
113 |
+ unsigned long next, struct mm_walk *walk) |
114 |
+ { |
115 |
+- /* |
116 |
+- * Remove all zero page mappings, |
117 |
+- * after establishing a policy to forbid zero page mappings |
118 |
+- * following faults for that page will get fresh anonymous pages |
119 |
+- */ |
120 |
+- if (is_zero_pfn(pte_pfn(*pte))) |
121 |
+- ptep_xchg_direct(walk->mm, addr, pte, __pte(_PAGE_INVALID)); |
122 |
+ /* Clear storage key */ |
123 |
+ ptep_zap_key(walk->mm, addr, pte); |
124 |
+ return 0; |
125 |
+diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c |
126 |
+index b854b1da281a..888bee99fe64 100644 |
127 |
+--- a/arch/s390/mm/mmap.c |
128 |
++++ b/arch/s390/mm/mmap.c |
129 |
+@@ -119,7 +119,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, |
130 |
+ return addr; |
131 |
+ |
132 |
+ check_asce_limit: |
133 |
+- if (addr + len > current->mm->context.asce_limit) { |
134 |
++ if (addr + len > current->mm->context.asce_limit && |
135 |
++ addr + len <= TASK_SIZE) { |
136 |
+ rc = crst_table_upgrade(mm); |
137 |
+ if (rc) |
138 |
+ return (unsigned long) rc; |
139 |
+@@ -183,7 +184,8 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, |
140 |
+ } |
141 |
+ |
142 |
+ check_asce_limit: |
143 |
+- if (addr + len > current->mm->context.asce_limit) { |
144 |
++ if (addr + len > current->mm->context.asce_limit && |
145 |
++ addr + len <= TASK_SIZE) { |
146 |
+ rc = crst_table_upgrade(mm); |
147 |
+ if (rc) |
148 |
+ return (unsigned long) rc; |
149 |
+diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig |
150 |
+index 832e885349b1..4d4cdc1a6e25 100644 |
151 |
+--- a/drivers/android/Kconfig |
152 |
++++ b/drivers/android/Kconfig |
153 |
+@@ -22,7 +22,7 @@ config ANDROID_BINDER_IPC |
154 |
+ config ANDROID_BINDER_DEVICES |
155 |
+ string "Android Binder devices" |
156 |
+ depends on ANDROID_BINDER_IPC |
157 |
+- default "binder,hwbinder" |
158 |
++ default "binder,hwbinder,vndbinder" |
159 |
+ ---help--- |
160 |
+ Default value for the binder.devices parameter. |
161 |
+ |
162 |
+diff --git a/drivers/android/binder.c b/drivers/android/binder.c |
163 |
+index 831cdd7d197d..3db96b79d122 100644 |
164 |
+--- a/drivers/android/binder.c |
165 |
++++ b/drivers/android/binder.c |
166 |
+@@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name) |
167 |
+ static int __init binder_init(void) |
168 |
+ { |
169 |
+ int ret; |
170 |
+- char *device_name, *device_names; |
171 |
++ char *device_name, *device_names, *device_tmp; |
172 |
+ struct binder_device *device; |
173 |
+ struct hlist_node *tmp; |
174 |
+ |
175 |
+@@ -4263,7 +4263,8 @@ static int __init binder_init(void) |
176 |
+ } |
177 |
+ strcpy(device_names, binder_devices_param); |
178 |
+ |
179 |
+- while ((device_name = strsep(&device_names, ","))) { |
180 |
++ device_tmp = device_names; |
181 |
++ while ((device_name = strsep(&device_tmp, ","))) { |
182 |
+ ret = init_binder_device(device_name); |
183 |
+ if (ret) |
184 |
+ goto err_init_binder_device_failed; |
185 |
+@@ -4277,6 +4278,9 @@ static int __init binder_init(void) |
186 |
+ hlist_del(&device->hlist); |
187 |
+ kfree(device); |
188 |
+ } |
189 |
++ |
190 |
++ kfree(device_names); |
191 |
++ |
192 |
+ err_alloc_device_names_failed: |
193 |
+ debugfs_remove_recursive(binder_debugfs_dir_entry_root); |
194 |
+ |
195 |
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
196 |
+index c69954023c2e..13080f1284e8 100644 |
197 |
+--- a/drivers/ata/ahci.c |
198 |
++++ b/drivers/ata/ahci.c |
199 |
+@@ -1467,7 +1467,14 @@ static void ahci_remap_check(struct pci_dev *pdev, int bar, |
200 |
+ return; |
201 |
+ |
202 |
+ dev_warn(&pdev->dev, "Found %d remapped NVMe devices.\n", count); |
203 |
+- dev_warn(&pdev->dev, "Switch your BIOS from RAID to AHCI mode to use them.\n"); |
204 |
++ dev_warn(&pdev->dev, |
205 |
++ "Switch your BIOS from RAID to AHCI mode to use them.\n"); |
206 |
++ |
207 |
++ /* |
208 |
++ * Don't rely on the msi-x capability in the remap case, |
209 |
++ * share the legacy interrupt across ahci and remapped devices. |
210 |
++ */ |
211 |
++ hpriv->flags |= AHCI_HFLAG_NO_MSI; |
212 |
+ } |
213 |
+ |
214 |
+ static int ahci_get_irq_vector(struct ata_host *host, int port) |
215 |
+diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c |
216 |
+index 8d4d959a821c..8706533db57b 100644 |
217 |
+--- a/drivers/ata/pata_amd.c |
218 |
++++ b/drivers/ata/pata_amd.c |
219 |
+@@ -616,6 +616,7 @@ static const struct pci_device_id amd[] = { |
220 |
+ { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 8 }, |
221 |
+ { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 8 }, |
222 |
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 9 }, |
223 |
++ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_DEV_IDE), 9 }, |
224 |
+ |
225 |
+ { }, |
226 |
+ }; |
227 |
+diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c |
228 |
+index 6c15a554efbe..dc1255294628 100644 |
229 |
+--- a/drivers/ata/pata_cs5536.c |
230 |
++++ b/drivers/ata/pata_cs5536.c |
231 |
+@@ -289,6 +289,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
232 |
+ |
233 |
+ static const struct pci_device_id cs5536[] = { |
234 |
+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), }, |
235 |
++ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_DEV_IDE), }, |
236 |
+ { }, |
237 |
+ }; |
238 |
+ |
239 |
+diff --git a/drivers/base/bus.c b/drivers/base/bus.c |
240 |
+index 6470eb8088f4..e32a74eb28a3 100644 |
241 |
+--- a/drivers/base/bus.c |
242 |
++++ b/drivers/base/bus.c |
243 |
+@@ -736,7 +736,7 @@ int bus_add_driver(struct device_driver *drv) |
244 |
+ |
245 |
+ out_unregister: |
246 |
+ kobject_put(&priv->kobj); |
247 |
+- kfree(drv->p); |
248 |
++ /* drv->p is freed in driver_release() */ |
249 |
+ drv->p = NULL; |
250 |
+ out_put_bus: |
251 |
+ bus_put(bus); |
252 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
253 |
+index 7fa373b428f8..ea1612f2b52f 100644 |
254 |
+--- a/drivers/bluetooth/btusb.c |
255 |
++++ b/drivers/bluetooth/btusb.c |
256 |
+@@ -355,6 +355,7 @@ static const struct usb_device_id blacklist_table[] = { |
257 |
+ { USB_DEVICE(0x13d3, 0x3410), .driver_info = BTUSB_REALTEK }, |
258 |
+ { USB_DEVICE(0x13d3, 0x3416), .driver_info = BTUSB_REALTEK }, |
259 |
+ { USB_DEVICE(0x13d3, 0x3459), .driver_info = BTUSB_REALTEK }, |
260 |
++ { USB_DEVICE(0x13d3, 0x3494), .driver_info = BTUSB_REALTEK }, |
261 |
+ |
262 |
+ /* Additional Realtek 8821AE Bluetooth devices */ |
263 |
+ { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK }, |
264 |
+diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c |
265 |
+index d4a716326f67..e7b9f8695ecb 100644 |
266 |
+--- a/drivers/crypto/caam/caamalg.c |
267 |
++++ b/drivers/crypto/caam/caamalg.c |
268 |
+@@ -81,40 +81,6 @@ |
269 |
+ #define debug(format, arg...) |
270 |
+ #endif |
271 |
+ |
272 |
+-#ifdef DEBUG |
273 |
+-#include <linux/highmem.h> |
274 |
+- |
275 |
+-static void dbg_dump_sg(const char *level, const char *prefix_str, |
276 |
+- int prefix_type, int rowsize, int groupsize, |
277 |
+- struct scatterlist *sg, size_t tlen, bool ascii) |
278 |
+-{ |
279 |
+- struct scatterlist *it; |
280 |
+- void *it_page; |
281 |
+- size_t len; |
282 |
+- void *buf; |
283 |
+- |
284 |
+- for (it = sg; it != NULL && tlen > 0 ; it = sg_next(sg)) { |
285 |
+- /* |
286 |
+- * make sure the scatterlist's page |
287 |
+- * has a valid virtual memory mapping |
288 |
+- */ |
289 |
+- it_page = kmap_atomic(sg_page(it)); |
290 |
+- if (unlikely(!it_page)) { |
291 |
+- printk(KERN_ERR "dbg_dump_sg: kmap failed\n"); |
292 |
+- return; |
293 |
+- } |
294 |
+- |
295 |
+- buf = it_page + it->offset; |
296 |
+- len = min_t(size_t, tlen, it->length); |
297 |
+- print_hex_dump(level, prefix_str, prefix_type, rowsize, |
298 |
+- groupsize, buf, len, ascii); |
299 |
+- tlen -= len; |
300 |
+- |
301 |
+- kunmap_atomic(it_page); |
302 |
+- } |
303 |
+-} |
304 |
+-#endif |
305 |
+- |
306 |
+ static struct list_head alg_list; |
307 |
+ |
308 |
+ struct caam_alg_entry { |
309 |
+@@ -898,10 +864,10 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err, |
310 |
+ print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", |
311 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
312 |
+ edesc->src_nents > 1 ? 100 : ivsize, 1); |
313 |
+- dbg_dump_sg(KERN_ERR, "dst @"__stringify(__LINE__)": ", |
314 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
315 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
316 |
+ #endif |
317 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
318 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
319 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
320 |
+ |
321 |
+ ablkcipher_unmap(jrdev, edesc, req); |
322 |
+ |
323 |
+@@ -937,10 +903,10 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err, |
324 |
+ print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", |
325 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
326 |
+ ivsize, 1); |
327 |
+- dbg_dump_sg(KERN_ERR, "dst @"__stringify(__LINE__)": ", |
328 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
329 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
330 |
+ #endif |
331 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
332 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
333 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
334 |
+ |
335 |
+ ablkcipher_unmap(jrdev, edesc, req); |
336 |
+ |
337 |
+@@ -1107,10 +1073,10 @@ static void init_ablkcipher_job(u32 *sh_desc, dma_addr_t ptr, |
338 |
+ ivsize, 1); |
339 |
+ pr_err("asked=%d, nbytes%d\n", |
340 |
+ (int)edesc->src_nents > 1 ? 100 : req->nbytes, req->nbytes); |
341 |
+- dbg_dump_sg(KERN_ERR, "src @"__stringify(__LINE__)": ", |
342 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
343 |
+- edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
344 |
+ #endif |
345 |
++ caam_dump_sg(KERN_ERR, "src @" __stringify(__LINE__)": ", |
346 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
347 |
++ edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
348 |
+ |
349 |
+ len = desc_len(sh_desc); |
350 |
+ init_job_desc_shared(desc, ptr, len, HDR_SHARE_DEFER | HDR_REVERSE); |
351 |
+@@ -1164,10 +1130,10 @@ static void init_ablkcipher_giv_job(u32 *sh_desc, dma_addr_t ptr, |
352 |
+ print_hex_dump(KERN_ERR, "presciv@" __stringify(__LINE__) ": ", |
353 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
354 |
+ ivsize, 1); |
355 |
+- dbg_dump_sg(KERN_ERR, "src @" __stringify(__LINE__) ": ", |
356 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
357 |
+- edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
358 |
+ #endif |
359 |
++ caam_dump_sg(KERN_ERR, "src @" __stringify(__LINE__) ": ", |
360 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
361 |
++ edesc->src_nents > 1 ? 100 : req->nbytes, 1); |
362 |
+ |
363 |
+ len = desc_len(sh_desc); |
364 |
+ init_job_desc_shared(desc, ptr, len, HDR_SHARE_DEFER | HDR_REVERSE); |
365 |
+@@ -1449,11 +1415,9 @@ static int aead_decrypt(struct aead_request *req) |
366 |
+ u32 *desc; |
367 |
+ int ret = 0; |
368 |
+ |
369 |
+-#ifdef DEBUG |
370 |
+- dbg_dump_sg(KERN_ERR, "dec src@"__stringify(__LINE__)": ", |
371 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
372 |
+- req->assoclen + req->cryptlen, 1); |
373 |
+-#endif |
374 |
++ caam_dump_sg(KERN_ERR, "dec src@" __stringify(__LINE__)": ", |
375 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->src, |
376 |
++ req->assoclen + req->cryptlen, 1); |
377 |
+ |
378 |
+ /* allocate extended descriptor */ |
379 |
+ edesc = aead_edesc_alloc(req, AUTHENC_DESC_JOB_IO_LEN, |
380 |
+diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c |
381 |
+index ea0e5b8b9171..5fe768065142 100644 |
382 |
+--- a/drivers/crypto/caam/caamalg_qi.c |
383 |
++++ b/drivers/crypto/caam/caamalg_qi.c |
384 |
+@@ -791,9 +791,9 @@ static void ablkcipher_done(struct caam_drv_req *drv_req, u32 status) |
385 |
+ print_hex_dump(KERN_ERR, "dstiv @" __stringify(__LINE__)": ", |
386 |
+ DUMP_PREFIX_ADDRESS, 16, 4, req->info, |
387 |
+ edesc->src_nents > 1 ? 100 : ivsize, 1); |
388 |
+- dbg_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
389 |
+- DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
390 |
+- edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
391 |
++ caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", |
392 |
++ DUMP_PREFIX_ADDRESS, 16, 4, req->dst, |
393 |
++ edesc->dst_nents > 1 ? 100 : req->nbytes, 1); |
394 |
+ #endif |
395 |
+ |
396 |
+ ablkcipher_unmap(qidev, edesc, req); |
397 |
+diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c |
398 |
+index 6f44ccb55c63..3d639f3b45aa 100644 |
399 |
+--- a/drivers/crypto/caam/error.c |
400 |
++++ b/drivers/crypto/caam/error.c |
401 |
+@@ -9,6 +9,46 @@ |
402 |
+ #include "desc.h" |
403 |
+ #include "error.h" |
404 |
+ |
405 |
++#ifdef DEBUG |
406 |
++#include <linux/highmem.h> |
407 |
++ |
408 |
++void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, |
409 |
++ int rowsize, int groupsize, struct scatterlist *sg, |
410 |
++ size_t tlen, bool ascii) |
411 |
++{ |
412 |
++ struct scatterlist *it; |
413 |
++ void *it_page; |
414 |
++ size_t len; |
415 |
++ void *buf; |
416 |
++ |
417 |
++ for (it = sg; it && tlen > 0 ; it = sg_next(sg)) { |
418 |
++ /* |
419 |
++ * make sure the scatterlist's page |
420 |
++ * has a valid virtual memory mapping |
421 |
++ */ |
422 |
++ it_page = kmap_atomic(sg_page(it)); |
423 |
++ if (unlikely(!it_page)) { |
424 |
++ pr_err("caam_dump_sg: kmap failed\n"); |
425 |
++ return; |
426 |
++ } |
427 |
++ |
428 |
++ buf = it_page + it->offset; |
429 |
++ len = min_t(size_t, tlen, it->length); |
430 |
++ print_hex_dump(level, prefix_str, prefix_type, rowsize, |
431 |
++ groupsize, buf, len, ascii); |
432 |
++ tlen -= len; |
433 |
++ |
434 |
++ kunmap_atomic(it_page); |
435 |
++ } |
436 |
++} |
437 |
++#else |
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 |
++{} |
442 |
++#endif /* DEBUG */ |
443 |
++EXPORT_SYMBOL(caam_dump_sg); |
444 |
++ |
445 |
+ static const struct { |
446 |
+ u8 value; |
447 |
+ const char *error_text; |
448 |
+diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h |
449 |
+index b6350b0d9153..250e1a21c473 100644 |
450 |
+--- a/drivers/crypto/caam/error.h |
451 |
++++ b/drivers/crypto/caam/error.h |
452 |
+@@ -8,4 +8,8 @@ |
453 |
+ #define CAAM_ERROR_H |
454 |
+ #define CAAM_ERROR_STR_MAX 302 |
455 |
+ void caam_jr_strstatus(struct device *jrdev, u32 status); |
456 |
++ |
457 |
++void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, |
458 |
++ int rowsize, int groupsize, struct scatterlist *sg, |
459 |
++ size_t tlen, bool ascii); |
460 |
+ #endif /* CAAM_ERROR_H */ |
461 |
+diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c |
462 |
+index 1990ed460c46..53aed5816416 100644 |
463 |
+--- a/drivers/crypto/caam/qi.c |
464 |
++++ b/drivers/crypto/caam/qi.c |
465 |
+@@ -55,6 +55,7 @@ struct caam_qi_pcpu_priv { |
466 |
+ } ____cacheline_aligned; |
467 |
+ |
468 |
+ static DEFINE_PER_CPU(struct caam_qi_pcpu_priv, pcpu_qipriv); |
469 |
++static DEFINE_PER_CPU(int, last_cpu); |
470 |
+ |
471 |
+ /* |
472 |
+ * caam_qi_priv - CAAM QI backend private params |
473 |
+@@ -392,7 +393,6 @@ struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev, |
474 |
+ dma_addr_t hwdesc; |
475 |
+ struct caam_drv_ctx *drv_ctx; |
476 |
+ const cpumask_t *cpus = qman_affine_cpus(); |
477 |
+- static DEFINE_PER_CPU(int, last_cpu); |
478 |
+ |
479 |
+ num_words = desc_len(sh_desc); |
480 |
+ if (num_words > MAX_SDLEN) { |
481 |
+diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c |
482 |
+index 3066b805f2d0..08c0ecb7d109 100644 |
483 |
+--- a/drivers/fpga/altera-hps2fpga.c |
484 |
++++ b/drivers/fpga/altera-hps2fpga.c |
485 |
+@@ -66,7 +66,7 @@ static int alt_hps2fpga_enable_show(struct fpga_bridge *bridge) |
486 |
+ |
487 |
+ /* The L3 REMAP register is write only, so keep a cached value. */ |
488 |
+ static unsigned int l3_remap_shadow; |
489 |
+-static spinlock_t l3_remap_lock; |
490 |
++static DEFINE_SPINLOCK(l3_remap_lock); |
491 |
+ |
492 |
+ static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv, |
493 |
+ bool enable) |
494 |
+@@ -171,8 +171,6 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev) |
495 |
+ return -EBUSY; |
496 |
+ } |
497 |
+ |
498 |
+- spin_lock_init(&l3_remap_lock); |
499 |
+- |
500 |
+ if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) { |
501 |
+ if (enable > 1) { |
502 |
+ dev_warn(dev, "invalid bridge-enable %u > 1\n", enable); |
503 |
+diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c |
504 |
+index 70ab2eee9b04..0b6e1a1d1398 100644 |
505 |
+--- a/drivers/gpu/drm/nouveau/nv50_display.c |
506 |
++++ b/drivers/gpu/drm/nouveau/nv50_display.c |
507 |
+@@ -4091,7 +4091,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
508 |
+ if (!nonblock) { |
509 |
+ ret = drm_atomic_helper_wait_for_fences(dev, state, true); |
510 |
+ if (ret) |
511 |
+- goto done; |
512 |
++ goto err_cleanup; |
513 |
+ } |
514 |
+ |
515 |
+ for_each_plane_in_state(state, plane, plane_state, i) { |
516 |
+@@ -4119,7 +4119,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
517 |
+ if (crtc->state->enable) { |
518 |
+ if (!drm->have_disp_power_ref) { |
519 |
+ drm->have_disp_power_ref = true; |
520 |
+- return ret; |
521 |
++ return 0; |
522 |
+ } |
523 |
+ active = true; |
524 |
+ break; |
525 |
+@@ -4131,6 +4131,9 @@ nv50_disp_atomic_commit(struct drm_device *dev, |
526 |
+ drm->have_disp_power_ref = false; |
527 |
+ } |
528 |
+ |
529 |
++err_cleanup: |
530 |
++ if (ret) |
531 |
++ drm_atomic_helper_cleanup_planes(dev, state); |
532 |
+ done: |
533 |
+ pm_runtime_put_autosuspend(dev->dev); |
534 |
+ return ret; |
535 |
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
536 |
+index eb9b278198b2..a4cb82495cee 100644 |
537 |
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
538 |
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |
539 |
+@@ -192,6 +192,10 @@ nvkm_pci_new_(const struct nvkm_pci_func *func, struct nvkm_device *device, |
540 |
+ } |
541 |
+ } |
542 |
+ |
543 |
++#ifdef __BIG_ENDIAN |
544 |
++ pci->msi = false; |
545 |
++#endif |
546 |
++ |
547 |
+ pci->msi = nvkm_boolopt(device->cfgopt, "NvMSI", pci->msi); |
548 |
+ if (pci->msi && func->msi_rearm) { |
549 |
+ pci->msi = pci_enable_msi(pci->pdev) == 0; |
550 |
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c |
551 |
+index e274c9dc32f3..b7f920b35ecd 100644 |
552 |
+--- a/drivers/hid/wacom_wac.c |
553 |
++++ b/drivers/hid/wacom_wac.c |
554 |
+@@ -1767,7 +1767,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, |
555 |
+ features->device_type |= WACOM_DEVICETYPE_PAD; |
556 |
+ break; |
557 |
+ case WACOM_HID_WD_TOUCHRINGSTATUS: |
558 |
+- wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0); |
559 |
++ /* |
560 |
++ * Only set up type/code association. Completely mapping |
561 |
++ * this usage may overwrite the axis resolution and range. |
562 |
++ */ |
563 |
++ usage->type = EV_ABS; |
564 |
++ usage->code = ABS_WHEEL; |
565 |
++ set_bit(EV_ABS, input->evbit); |
566 |
+ features->device_type |= WACOM_DEVICETYPE_PAD; |
567 |
+ break; |
568 |
+ case WACOM_HID_WD_BUTTONCONFIG: |
569 |
+diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c |
570 |
+index 590cf90dd21a..da40df2ff27d 100644 |
571 |
+--- a/drivers/hwtracing/intel_th/pci.c |
572 |
++++ b/drivers/hwtracing/intel_th/pci.c |
573 |
+@@ -95,6 +95,16 @@ static const struct pci_device_id intel_th_pci_id_table[] = { |
574 |
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e), |
575 |
+ .driver_data = (kernel_ulong_t)0, |
576 |
+ }, |
577 |
++ { |
578 |
++ /* Cannon Lake H */ |
579 |
++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326), |
580 |
++ .driver_data = (kernel_ulong_t)0, |
581 |
++ }, |
582 |
++ { |
583 |
++ /* Cannon Lake LP */ |
584 |
++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9da6), |
585 |
++ .driver_data = (kernel_ulong_t)0, |
586 |
++ }, |
587 |
+ { 0 }, |
588 |
+ }; |
589 |
+ |
590 |
+diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c |
591 |
+index f76d979fb7e8..cc8e0b55a12e 100644 |
592 |
+--- a/drivers/iio/adc/ti-ads1015.c |
593 |
++++ b/drivers/iio/adc/ti-ads1015.c |
594 |
+@@ -81,18 +81,12 @@ static const unsigned int ads1115_data_rate[] = { |
595 |
+ 8, 16, 32, 64, 128, 250, 475, 860 |
596 |
+ }; |
597 |
+ |
598 |
+-static const struct { |
599 |
+- int scale; |
600 |
+- int uscale; |
601 |
+-} ads1015_scale[] = { |
602 |
+- {3, 0}, |
603 |
+- {2, 0}, |
604 |
+- {1, 0}, |
605 |
+- {0, 500000}, |
606 |
+- {0, 250000}, |
607 |
+- {0, 125000}, |
608 |
+- {0, 125000}, |
609 |
+- {0, 125000}, |
610 |
++/* |
611 |
++ * Translation from PGA bits to full-scale positive and negative input voltage |
612 |
++ * range in mV |
613 |
++ */ |
614 |
++static int ads1015_fullscale_range[] = { |
615 |
++ 6144, 4096, 2048, 1024, 512, 256, 256, 256 |
616 |
+ }; |
617 |
+ |
618 |
+ #define ADS1015_V_CHAN(_chan, _addr) { \ |
619 |
+@@ -183,6 +177,12 @@ struct ads1015_data { |
620 |
+ struct ads1015_channel_data channel_data[ADS1015_CHANNELS]; |
621 |
+ |
622 |
+ unsigned int *data_rate; |
623 |
++ /* |
624 |
++ * Set to true when the ADC is switched to the continuous-conversion |
625 |
++ * mode and exits from a power-down state. This flag is used to avoid |
626 |
++ * getting the stale result from the conversion register. |
627 |
++ */ |
628 |
++ bool conv_invalid; |
629 |
+ }; |
630 |
+ |
631 |
+ static bool ads1015_is_writeable_reg(struct device *dev, unsigned int reg) |
632 |
+@@ -235,33 +235,43 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on) |
633 |
+ ret = pm_runtime_put_autosuspend(dev); |
634 |
+ } |
635 |
+ |
636 |
+- return ret; |
637 |
++ return ret < 0 ? ret : 0; |
638 |
+ } |
639 |
+ |
640 |
+ static |
641 |
+ int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val) |
642 |
+ { |
643 |
+ int ret, pga, dr, conv_time; |
644 |
+- bool change; |
645 |
++ unsigned int old, mask, cfg; |
646 |
+ |
647 |
+ if (chan < 0 || chan >= ADS1015_CHANNELS) |
648 |
+ return -EINVAL; |
649 |
+ |
650 |
++ ret = regmap_read(data->regmap, ADS1015_CFG_REG, &old); |
651 |
++ if (ret) |
652 |
++ return ret; |
653 |
++ |
654 |
+ pga = data->channel_data[chan].pga; |
655 |
+ dr = data->channel_data[chan].data_rate; |
656 |
++ mask = ADS1015_CFG_MUX_MASK | ADS1015_CFG_PGA_MASK | |
657 |
++ ADS1015_CFG_DR_MASK; |
658 |
++ cfg = chan << ADS1015_CFG_MUX_SHIFT | pga << ADS1015_CFG_PGA_SHIFT | |
659 |
++ dr << ADS1015_CFG_DR_SHIFT; |
660 |
+ |
661 |
+- ret = regmap_update_bits_check(data->regmap, ADS1015_CFG_REG, |
662 |
+- ADS1015_CFG_MUX_MASK | |
663 |
+- ADS1015_CFG_PGA_MASK, |
664 |
+- chan << ADS1015_CFG_MUX_SHIFT | |
665 |
+- pga << ADS1015_CFG_PGA_SHIFT, |
666 |
+- &change); |
667 |
+- if (ret < 0) |
668 |
++ cfg = (old & ~mask) | (cfg & mask); |
669 |
++ |
670 |
++ ret = regmap_write(data->regmap, ADS1015_CFG_REG, cfg); |
671 |
++ if (ret) |
672 |
+ return ret; |
673 |
+ |
674 |
+- if (change) { |
675 |
+- conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]); |
676 |
++ if (old != cfg || data->conv_invalid) { |
677 |
++ int dr_old = (old & ADS1015_CFG_DR_MASK) >> |
678 |
++ ADS1015_CFG_DR_SHIFT; |
679 |
++ |
680 |
++ conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr_old]); |
681 |
++ conv_time += DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]); |
682 |
+ usleep_range(conv_time, conv_time + 1); |
683 |
++ data->conv_invalid = false; |
684 |
+ } |
685 |
+ |
686 |
+ return regmap_read(data->regmap, ADS1015_CONV_REG, val); |
687 |
+@@ -298,17 +308,20 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p) |
688 |
+ return IRQ_HANDLED; |
689 |
+ } |
690 |
+ |
691 |
+-static int ads1015_set_scale(struct ads1015_data *data, int chan, |
692 |
++static int ads1015_set_scale(struct ads1015_data *data, |
693 |
++ struct iio_chan_spec const *chan, |
694 |
+ int scale, int uscale) |
695 |
+ { |
696 |
+ int i, ret, rindex = -1; |
697 |
++ int fullscale = div_s64((scale * 1000000LL + uscale) << |
698 |
++ (chan->scan_type.realbits - 1), 1000000); |
699 |
+ |
700 |
+- for (i = 0; i < ARRAY_SIZE(ads1015_scale); i++) |
701 |
+- if (ads1015_scale[i].scale == scale && |
702 |
+- ads1015_scale[i].uscale == uscale) { |
703 |
++ for (i = 0; i < ARRAY_SIZE(ads1015_fullscale_range); i++) { |
704 |
++ if (ads1015_fullscale_range[i] == fullscale) { |
705 |
+ rindex = i; |
706 |
+ break; |
707 |
+ } |
708 |
++ } |
709 |
+ if (rindex < 0) |
710 |
+ return -EINVAL; |
711 |
+ |
712 |
+@@ -318,32 +331,23 @@ static int ads1015_set_scale(struct ads1015_data *data, int chan, |
713 |
+ if (ret < 0) |
714 |
+ return ret; |
715 |
+ |
716 |
+- data->channel_data[chan].pga = rindex; |
717 |
++ data->channel_data[chan->address].pga = rindex; |
718 |
+ |
719 |
+ return 0; |
720 |
+ } |
721 |
+ |
722 |
+ static int ads1015_set_data_rate(struct ads1015_data *data, int chan, int rate) |
723 |
+ { |
724 |
+- int i, ret, rindex = -1; |
725 |
++ int i; |
726 |
+ |
727 |
+- for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++) |
728 |
++ for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++) { |
729 |
+ if (data->data_rate[i] == rate) { |
730 |
+- rindex = i; |
731 |
+- break; |
732 |
++ data->channel_data[chan].data_rate = i; |
733 |
++ return 0; |
734 |
+ } |
735 |
+- if (rindex < 0) |
736 |
+- return -EINVAL; |
737 |
+- |
738 |
+- ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
739 |
+- ADS1015_CFG_DR_MASK, |
740 |
+- rindex << ADS1015_CFG_DR_SHIFT); |
741 |
+- if (ret < 0) |
742 |
+- return ret; |
743 |
+- |
744 |
+- data->channel_data[chan].data_rate = rindex; |
745 |
++ } |
746 |
+ |
747 |
+- return 0; |
748 |
++ return -EINVAL; |
749 |
+ } |
750 |
+ |
751 |
+ static int ads1015_read_raw(struct iio_dev *indio_dev, |
752 |
+@@ -385,9 +389,9 @@ static int ads1015_read_raw(struct iio_dev *indio_dev, |
753 |
+ } |
754 |
+ case IIO_CHAN_INFO_SCALE: |
755 |
+ idx = data->channel_data[chan->address].pga; |
756 |
+- *val = ads1015_scale[idx].scale; |
757 |
+- *val2 = ads1015_scale[idx].uscale; |
758 |
+- ret = IIO_VAL_INT_PLUS_MICRO; |
759 |
++ *val = ads1015_fullscale_range[idx]; |
760 |
++ *val2 = chan->scan_type.realbits - 1; |
761 |
++ ret = IIO_VAL_FRACTIONAL_LOG2; |
762 |
+ break; |
763 |
+ case IIO_CHAN_INFO_SAMP_FREQ: |
764 |
+ idx = data->channel_data[chan->address].data_rate; |
765 |
+@@ -414,7 +418,7 @@ static int ads1015_write_raw(struct iio_dev *indio_dev, |
766 |
+ mutex_lock(&data->lock); |
767 |
+ switch (mask) { |
768 |
+ case IIO_CHAN_INFO_SCALE: |
769 |
+- ret = ads1015_set_scale(data, chan->address, val, val2); |
770 |
++ ret = ads1015_set_scale(data, chan, val, val2); |
771 |
+ break; |
772 |
+ case IIO_CHAN_INFO_SAMP_FREQ: |
773 |
+ ret = ads1015_set_data_rate(data, chan->address, val); |
774 |
+@@ -446,7 +450,10 @@ static const struct iio_buffer_setup_ops ads1015_buffer_setup_ops = { |
775 |
+ .validate_scan_mask = &iio_validate_scan_mask_onehot, |
776 |
+ }; |
777 |
+ |
778 |
+-static IIO_CONST_ATTR(scale_available, "3 2 1 0.5 0.25 0.125"); |
779 |
++static IIO_CONST_ATTR_NAMED(ads1015_scale_available, scale_available, |
780 |
++ "3 2 1 0.5 0.25 0.125"); |
781 |
++static IIO_CONST_ATTR_NAMED(ads1115_scale_available, scale_available, |
782 |
++ "0.1875 0.125 0.0625 0.03125 0.015625 0.007813"); |
783 |
+ |
784 |
+ static IIO_CONST_ATTR_NAMED(ads1015_sampling_frequency_available, |
785 |
+ sampling_frequency_available, "128 250 490 920 1600 2400 3300"); |
786 |
+@@ -454,7 +461,7 @@ static IIO_CONST_ATTR_NAMED(ads1115_sampling_frequency_available, |
787 |
+ sampling_frequency_available, "8 16 32 64 128 250 475 860"); |
788 |
+ |
789 |
+ static struct attribute *ads1015_attributes[] = { |
790 |
+- &iio_const_attr_scale_available.dev_attr.attr, |
791 |
++ &iio_const_attr_ads1015_scale_available.dev_attr.attr, |
792 |
+ &iio_const_attr_ads1015_sampling_frequency_available.dev_attr.attr, |
793 |
+ NULL, |
794 |
+ }; |
795 |
+@@ -464,7 +471,7 @@ static const struct attribute_group ads1015_attribute_group = { |
796 |
+ }; |
797 |
+ |
798 |
+ static struct attribute *ads1115_attributes[] = { |
799 |
+- &iio_const_attr_scale_available.dev_attr.attr, |
800 |
++ &iio_const_attr_ads1115_scale_available.dev_attr.attr, |
801 |
+ &iio_const_attr_ads1115_sampling_frequency_available.dev_attr.attr, |
802 |
+ NULL, |
803 |
+ }; |
804 |
+@@ -630,6 +637,15 @@ static int ads1015_probe(struct i2c_client *client, |
805 |
+ dev_err(&client->dev, "iio triggered buffer setup failed\n"); |
806 |
+ return ret; |
807 |
+ } |
808 |
++ |
809 |
++ ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
810 |
++ ADS1015_CFG_MOD_MASK, |
811 |
++ ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT); |
812 |
++ if (ret) |
813 |
++ return ret; |
814 |
++ |
815 |
++ data->conv_invalid = true; |
816 |
++ |
817 |
+ ret = pm_runtime_set_active(&client->dev); |
818 |
+ if (ret) |
819 |
+ goto err_buffer_cleanup; |
820 |
+@@ -685,10 +701,15 @@ static int ads1015_runtime_resume(struct device *dev) |
821 |
+ { |
822 |
+ struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
823 |
+ struct ads1015_data *data = iio_priv(indio_dev); |
824 |
++ int ret; |
825 |
+ |
826 |
+- return regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
827 |
++ ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG, |
828 |
+ ADS1015_CFG_MOD_MASK, |
829 |
+ ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT); |
830 |
++ if (!ret) |
831 |
++ data->conv_invalid = true; |
832 |
++ |
833 |
++ return ret; |
834 |
+ } |
835 |
+ #endif |
836 |
+ |
837 |
+diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c |
838 |
+index fb3810d35c44..0871010f18d5 100644 |
839 |
+--- a/drivers/input/mouse/trackpoint.c |
840 |
++++ b/drivers/input/mouse/trackpoint.c |
841 |
+@@ -381,8 +381,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) |
842 |
+ return 0; |
843 |
+ |
844 |
+ if (trackpoint_read(ps2dev, TP_EXT_BTN, &button_info)) { |
845 |
+- psmouse_warn(psmouse, "failed to get extended button data\n"); |
846 |
+- button_info = 0; |
847 |
++ psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n"); |
848 |
++ button_info = 0x33; |
849 |
+ } |
850 |
+ |
851 |
+ psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); |
852 |
+diff --git a/drivers/mcb/mcb-lpc.c b/drivers/mcb/mcb-lpc.c |
853 |
+index d072c088ce73..945091a88354 100644 |
854 |
+--- a/drivers/mcb/mcb-lpc.c |
855 |
++++ b/drivers/mcb/mcb-lpc.c |
856 |
+@@ -114,6 +114,12 @@ static struct resource sc24_fpga_resource = { |
857 |
+ .flags = IORESOURCE_MEM, |
858 |
+ }; |
859 |
+ |
860 |
++static struct resource sc31_fpga_resource = { |
861 |
++ .start = 0xf000e000, |
862 |
++ .end = 0xf000e000 + CHAM_HEADER_SIZE, |
863 |
++ .flags = IORESOURCE_MEM, |
864 |
++}; |
865 |
++ |
866 |
+ static struct platform_driver mcb_lpc_driver = { |
867 |
+ .driver = { |
868 |
+ .name = "mcb-lpc", |
869 |
+@@ -132,6 +138,15 @@ static const struct dmi_system_id mcb_lpc_dmi_table[] = { |
870 |
+ .driver_data = (void *)&sc24_fpga_resource, |
871 |
+ .callback = mcb_lpc_create_platform_device, |
872 |
+ }, |
873 |
++ { |
874 |
++ .ident = "SC31", |
875 |
++ .matches = { |
876 |
++ DMI_MATCH(DMI_SYS_VENDOR, "MEN"), |
877 |
++ DMI_MATCH(DMI_PRODUCT_VERSION, "14SC31"), |
878 |
++ }, |
879 |
++ .driver_data = (void *)&sc31_fpga_resource, |
880 |
++ .callback = mcb_lpc_create_platform_device, |
881 |
++ }, |
882 |
+ {} |
883 |
+ }; |
884 |
+ MODULE_DEVICE_TABLE(dmi, mcb_lpc_dmi_table); |
885 |
+diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c |
886 |
+index 5a0638915874..4e1b30c29751 100644 |
887 |
+--- a/drivers/net/wireless/ath/ath10k/core.c |
888 |
++++ b/drivers/net/wireless/ath/ath10k/core.c |
889 |
+@@ -1984,6 +1984,12 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, |
890 |
+ goto err_wmi_detach; |
891 |
+ } |
892 |
+ |
893 |
++ /* If firmware indicates Full Rx Reorder support it must be used in a |
894 |
++ * slightly different manner. Let HTT code know. |
895 |
++ */ |
896 |
++ ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER, |
897 |
++ ar->wmi.svc_map)); |
898 |
++ |
899 |
+ status = ath10k_htt_rx_alloc(&ar->htt); |
900 |
+ if (status) { |
901 |
+ ath10k_err(ar, "failed to alloc htt rx: %d\n", status); |
902 |
+@@ -2096,12 +2102,6 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, |
903 |
+ } |
904 |
+ } |
905 |
+ |
906 |
+- /* If firmware indicates Full Rx Reorder support it must be used in a |
907 |
+- * slightly different manner. Let HTT code know. |
908 |
+- */ |
909 |
+- ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER, |
910 |
+- ar->wmi.svc_map)); |
911 |
+- |
912 |
+ status = ath10k_htt_rx_ring_refill(ar); |
913 |
+ if (status) { |
914 |
+ ath10k_err(ar, "failed to refill htt rx ring: %d\n", status); |
915 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
916 |
+index e51760e752d4..93e2fb667633 100644 |
917 |
+--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
918 |
++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
919 |
+@@ -429,6 +429,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = { |
920 |
+ {IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)}, |
921 |
+ {IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)}, |
922 |
+ {IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)}, |
923 |
++ {IWL_PCI_DEVICE(0x095A, 0x9E10, iwl7265_2ac_cfg)}, |
924 |
+ |
925 |
+ /* 8000 Series */ |
926 |
+ {IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)}, |
927 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
928 |
+index 025bc06a19d6..9e6b55b9bfc4 100644 |
929 |
+--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
930 |
++++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c |
931 |
+@@ -4221,7 +4221,7 @@ int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter) |
932 |
+ if (adapter->config_bands & BAND_A) |
933 |
+ n_channels_a = mwifiex_band_5ghz.n_channels; |
934 |
+ |
935 |
+- adapter->num_in_chan_stats = max_t(u32, n_channels_bg, n_channels_a); |
936 |
++ adapter->num_in_chan_stats = n_channels_bg + n_channels_a; |
937 |
+ adapter->chan_stats = vmalloc(sizeof(*adapter->chan_stats) * |
938 |
+ adapter->num_in_chan_stats); |
939 |
+ |
940 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c |
941 |
+index ce6936d0c5c0..abd156db08fb 100644 |
942 |
+--- a/drivers/net/wireless/marvell/mwifiex/scan.c |
943 |
++++ b/drivers/net/wireless/marvell/mwifiex/scan.c |
944 |
+@@ -2492,6 +2492,12 @@ mwifiex_update_chan_statistics(struct mwifiex_private *priv, |
945 |
+ sizeof(struct mwifiex_chan_stats); |
946 |
+ |
947 |
+ for (i = 0 ; i < num_chan; i++) { |
948 |
++ if (adapter->survey_idx >= adapter->num_in_chan_stats) { |
949 |
++ mwifiex_dbg(adapter, WARN, |
950 |
++ "FW reported too many channel results (max %d)\n", |
951 |
++ adapter->num_in_chan_stats); |
952 |
++ return; |
953 |
++ } |
954 |
+ chan_stats.chan_num = fw_chan_stats->chan_num; |
955 |
+ chan_stats.bandcfg = fw_chan_stats->bandcfg; |
956 |
+ chan_stats.flags = fw_chan_stats->flags; |
957 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c |
958 |
+index 2e6b888bd417..264dae5129ab 100644 |
959 |
+--- a/drivers/net/wireless/realtek/rtlwifi/pci.c |
960 |
++++ b/drivers/net/wireless/realtek/rtlwifi/pci.c |
961 |
+@@ -2255,7 +2255,7 @@ int rtl_pci_probe(struct pci_dev *pdev, |
962 |
+ /* find adapter */ |
963 |
+ if (!_rtl_pci_find_adapter(pdev, hw)) { |
964 |
+ err = -ENODEV; |
965 |
+- goto fail3; |
966 |
++ goto fail2; |
967 |
+ } |
968 |
+ |
969 |
+ /* Init IO handler */ |
970 |
+@@ -2316,10 +2316,10 @@ int rtl_pci_probe(struct pci_dev *pdev, |
971 |
+ pci_set_drvdata(pdev, NULL); |
972 |
+ rtl_deinit_core(hw); |
973 |
+ |
974 |
++fail2: |
975 |
+ if (rtlpriv->io.pci_mem_start != 0) |
976 |
+ pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start); |
977 |
+ |
978 |
+-fail2: |
979 |
+ pci_release_regions(pdev); |
980 |
+ complete(&rtlpriv->firmware_loading_complete); |
981 |
+ |
982 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
983 |
+index 7661cfa53032..37489b43bb23 100644 |
984 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
985 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c |
986 |
+@@ -175,6 +175,8 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) |
987 |
+ rtl_fw_cb); |
988 |
+ if (err) { |
989 |
+ pr_info("Failed to request firmware!\n"); |
990 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
991 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
992 |
+ return 1; |
993 |
+ } |
994 |
+ |
995 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
996 |
+index bcbb0c60f1f1..38f85bfdf0c7 100644 |
997 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
998 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c |
999 |
+@@ -176,6 +176,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) |
1000 |
+ rtl_fw_cb); |
1001 |
+ if (err) { |
1002 |
+ pr_err("Failed to request firmware!\n"); |
1003 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1004 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1005 |
+ return 1; |
1006 |
+ } |
1007 |
+ |
1008 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1009 |
+index 96c923b3feb4..e3eb850bb1de 100644 |
1010 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1011 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c |
1012 |
+@@ -85,6 +85,10 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
1013 |
+ err = request_firmware_nowait(THIS_MODULE, 1, |
1014 |
+ fw_name, rtlpriv->io.dev, |
1015 |
+ GFP_KERNEL, hw, rtl_fw_cb); |
1016 |
++ if (err) { |
1017 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1018 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1019 |
++ } |
1020 |
+ return err; |
1021 |
+ } |
1022 |
+ |
1023 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1024 |
+index 16132c66e5e1..e38d6f7370aa 100644 |
1025 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1026 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c |
1027 |
+@@ -183,6 +183,8 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) |
1028 |
+ rtl_fw_cb); |
1029 |
+ if (err) { |
1030 |
+ pr_err("Failed to request firmware!\n"); |
1031 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1032 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1033 |
+ return 1; |
1034 |
+ } |
1035 |
+ |
1036 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1037 |
+index 48820bc497d8..6f2d1f053ecd 100644 |
1038 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1039 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c |
1040 |
+@@ -177,6 +177,8 @@ int rtl92ee_init_sw_vars(struct ieee80211_hw *hw) |
1041 |
+ rtl_fw_cb); |
1042 |
+ if (err) { |
1043 |
+ pr_err("Failed to request firmware!\n"); |
1044 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1045 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1046 |
+ return 1; |
1047 |
+ } |
1048 |
+ |
1049 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1050 |
+index 2006b09ea74f..1ec20efb9ce1 100644 |
1051 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1052 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c |
1053 |
+@@ -216,6 +216,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) |
1054 |
+ rtl92se_fw_cb); |
1055 |
+ if (err) { |
1056 |
+ pr_err("Failed to request firmware!\n"); |
1057 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1058 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1059 |
+ return 1; |
1060 |
+ } |
1061 |
+ |
1062 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1063 |
+index 7bf9f2557920..aab86667a7f3 100644 |
1064 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1065 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c |
1066 |
+@@ -184,6 +184,8 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw) |
1067 |
+ rtl_fw_cb); |
1068 |
+ if (err) { |
1069 |
+ pr_err("Failed to request firmware!\n"); |
1070 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1071 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1072 |
+ return 1; |
1073 |
+ } |
1074 |
+ return 0; |
1075 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1076 |
+index 8c0ac96b5430..81ef1b312491 100644 |
1077 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1078 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c |
1079 |
+@@ -187,16 +187,10 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw) |
1080 |
+ rtlpriv->io.dev, GFP_KERNEL, hw, |
1081 |
+ rtl_fw_cb); |
1082 |
+ if (err) { |
1083 |
+- /* Failed to get firmware. Check if old version available */ |
1084 |
+- fw_name = "rtlwifi/rtl8723befw.bin"; |
1085 |
+- pr_info("Using firmware %s\n", fw_name); |
1086 |
+- err = request_firmware_nowait(THIS_MODULE, 1, fw_name, |
1087 |
+- rtlpriv->io.dev, GFP_KERNEL, hw, |
1088 |
+- rtl_fw_cb); |
1089 |
+- if (err) { |
1090 |
+- pr_err("Failed to request firmware!\n"); |
1091 |
+- return 1; |
1092 |
+- } |
1093 |
++ pr_err("Failed to request firmware!\n"); |
1094 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1095 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1096 |
++ return 1; |
1097 |
+ } |
1098 |
+ return 0; |
1099 |
+ } |
1100 |
+@@ -287,6 +281,7 @@ static const struct rtl_hal_cfg rtl8723be_hal_cfg = { |
1101 |
+ .bar_id = 2, |
1102 |
+ .write_readback = true, |
1103 |
+ .name = "rtl8723be_pci", |
1104 |
++ .alt_fw_name = "rtlwifi/rtl8723befw.bin", |
1105 |
+ .ops = &rtl8723be_hal_ops, |
1106 |
+ .mod_params = &rtl8723be_mod_params, |
1107 |
+ .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, |
1108 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1109 |
+index abaf34cb1433..227d27bed5f6 100644 |
1110 |
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1111 |
++++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c |
1112 |
+@@ -196,6 +196,8 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1113 |
+ rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000); |
1114 |
+ if (!rtlpriv->rtlhal.wowlan_firmware) { |
1115 |
+ pr_err("Can't alloc buffer for wowlan fw.\n"); |
1116 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1117 |
++ rtlpriv->rtlhal.pfirmware = NULL; |
1118 |
+ return 1; |
1119 |
+ } |
1120 |
+ |
1121 |
+@@ -214,16 +216,10 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1122 |
+ rtlpriv->io.dev, GFP_KERNEL, hw, |
1123 |
+ rtl_fw_cb); |
1124 |
+ if (err) { |
1125 |
+- /* Failed to get firmware. Check if old version available */ |
1126 |
+- fw_name = "rtlwifi/rtl8821aefw.bin"; |
1127 |
+- pr_info("Using firmware %s\n", fw_name); |
1128 |
+- err = request_firmware_nowait(THIS_MODULE, 1, fw_name, |
1129 |
+- rtlpriv->io.dev, GFP_KERNEL, hw, |
1130 |
+- rtl_fw_cb); |
1131 |
+- if (err) { |
1132 |
+- pr_err("Failed to request normal firmware!\n"); |
1133 |
+- return 1; |
1134 |
+- } |
1135 |
++ pr_err("Failed to request normal firmware!\n"); |
1136 |
++ vfree(rtlpriv->rtlhal.wowlan_firmware); |
1137 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1138 |
++ return 1; |
1139 |
+ } |
1140 |
+ /*load wowlan firmware*/ |
1141 |
+ pr_info("Using firmware %s\n", wowlan_fw_name); |
1142 |
+@@ -233,6 +229,8 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) |
1143 |
+ rtl_wowlan_fw_cb); |
1144 |
+ if (err) { |
1145 |
+ pr_err("Failed to request wowlan firmware!\n"); |
1146 |
++ vfree(rtlpriv->rtlhal.wowlan_firmware); |
1147 |
++ vfree(rtlpriv->rtlhal.pfirmware); |
1148 |
+ return 1; |
1149 |
+ } |
1150 |
+ return 0; |
1151 |
+@@ -325,6 +323,7 @@ static const struct rtl_hal_cfg rtl8821ae_hal_cfg = { |
1152 |
+ .bar_id = 2, |
1153 |
+ .write_readback = true, |
1154 |
+ .name = "rtl8821ae_pci", |
1155 |
++ .alt_fw_name = "rtlwifi/rtl8821aefw.bin", |
1156 |
+ .ops = &rtl8821ae_hal_ops, |
1157 |
+ .mod_params = &rtl8821ae_mod_params, |
1158 |
+ .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, |
1159 |
+diff --git a/drivers/of/device.c b/drivers/of/device.c |
1160 |
+index 28c38c756f92..9af44f6dc17b 100644 |
1161 |
+--- a/drivers/of/device.c |
1162 |
++++ b/drivers/of/device.c |
1163 |
+@@ -274,6 +274,8 @@ ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len) |
1164 |
+ ssize_t sl = of_device_get_modalias(dev, str, len - 2); |
1165 |
+ if (sl < 0) |
1166 |
+ return sl; |
1167 |
++ if (sl > len - 2) |
1168 |
++ return -ENOMEM; |
1169 |
+ |
1170 |
+ str[sl++] = '\n'; |
1171 |
+ str[sl] = 0; |
1172 |
+diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c |
1173 |
+index aa6f1debeaa7..f0804d5a6db7 100644 |
1174 |
+--- a/drivers/scsi/sg.c |
1175 |
++++ b/drivers/scsi/sg.c |
1176 |
+@@ -1233,6 +1233,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1177 |
+ unsigned long req_sz, len, sa; |
1178 |
+ Sg_scatter_hold *rsv_schp; |
1179 |
+ int k, length; |
1180 |
++ int ret = 0; |
1181 |
+ |
1182 |
+ if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) |
1183 |
+ return -ENXIO; |
1184 |
+@@ -1243,8 +1244,11 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1185 |
+ if (vma->vm_pgoff) |
1186 |
+ return -EINVAL; /* want no offset */ |
1187 |
+ rsv_schp = &sfp->reserve; |
1188 |
+- if (req_sz > rsv_schp->bufflen) |
1189 |
+- return -ENOMEM; /* cannot map more than reserved buffer */ |
1190 |
++ mutex_lock(&sfp->f_mutex); |
1191 |
++ if (req_sz > rsv_schp->bufflen) { |
1192 |
++ ret = -ENOMEM; /* cannot map more than reserved buffer */ |
1193 |
++ goto out; |
1194 |
++ } |
1195 |
+ |
1196 |
+ sa = vma->vm_start; |
1197 |
+ length = 1 << (PAGE_SHIFT + rsv_schp->page_order); |
1198 |
+@@ -1258,7 +1262,9 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) |
1199 |
+ vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
1200 |
+ vma->vm_private_data = sfp; |
1201 |
+ vma->vm_ops = &sg_mmap_vm_ops; |
1202 |
+- return 0; |
1203 |
++out: |
1204 |
++ mutex_unlock(&sfp->f_mutex); |
1205 |
++ return ret; |
1206 |
+ } |
1207 |
+ |
1208 |
+ static void |
1209 |
+@@ -1737,9 +1743,12 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) |
1210 |
+ !sfp->res_in_use) { |
1211 |
+ sfp->res_in_use = 1; |
1212 |
+ sg_link_reserve(sfp, srp, dxfer_len); |
1213 |
+- } else if ((hp->flags & SG_FLAG_MMAP_IO) && sfp->res_in_use) { |
1214 |
++ } else if (hp->flags & SG_FLAG_MMAP_IO) { |
1215 |
++ res = -EBUSY; /* sfp->res_in_use == 1 */ |
1216 |
++ if (dxfer_len > rsv_schp->bufflen) |
1217 |
++ res = -ENOMEM; |
1218 |
+ mutex_unlock(&sfp->f_mutex); |
1219 |
+- return -EBUSY; |
1220 |
++ return res; |
1221 |
+ } else { |
1222 |
+ res = sg_build_indirect(req_schp, sfp, dxfer_len); |
1223 |
+ if (res) { |
1224 |
+diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c |
1225 |
+index a95c5de1aa00..d9a98f0c327f 100644 |
1226 |
+--- a/drivers/staging/rts5208/rtsx_scsi.c |
1227 |
++++ b/drivers/staging/rts5208/rtsx_scsi.c |
1228 |
+@@ -414,7 +414,7 @@ void set_sense_data(struct rtsx_chip *chip, unsigned int lun, u8 err_code, |
1229 |
+ sense->ascq = ascq; |
1230 |
+ if (sns_key_info0 != 0) { |
1231 |
+ sense->sns_key_info[0] = SKSV | sns_key_info0; |
1232 |
+- sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 8; |
1233 |
++ sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 4; |
1234 |
+ sense->sns_key_info[2] = sns_key_info1 & 0x0f; |
1235 |
+ } |
1236 |
+ } |
1237 |
+diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
1238 |
+index 8e6ef671be9b..a76e45219f16 100644 |
1239 |
+--- a/drivers/usb/core/devio.c |
1240 |
++++ b/drivers/usb/core/devio.c |
1241 |
+@@ -623,6 +623,8 @@ static void async_completed(struct urb *urb) |
1242 |
+ if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && |
1243 |
+ as->status != -ENOENT) |
1244 |
+ cancel_bulk_urbs(ps, as->bulk_addr); |
1245 |
++ |
1246 |
++ wake_up(&ps->wait); |
1247 |
+ spin_unlock(&ps->lock); |
1248 |
+ |
1249 |
+ if (signr) { |
1250 |
+@@ -630,8 +632,6 @@ static void async_completed(struct urb *urb) |
1251 |
+ put_pid(pid); |
1252 |
+ put_cred(cred); |
1253 |
+ } |
1254 |
+- |
1255 |
+- wake_up(&ps->wait); |
1256 |
+ } |
1257 |
+ |
1258 |
+ static void destroy_async(struct usb_dev_state *ps, struct list_head *list) |
1259 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1260 |
+index 574da2b4529c..82806e311202 100644 |
1261 |
+--- a/drivers/usb/core/quirks.c |
1262 |
++++ b/drivers/usb/core/quirks.c |
1263 |
+@@ -57,8 +57,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1264 |
+ /* Microsoft LifeCam-VX700 v2.0 */ |
1265 |
+ { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, |
1266 |
+ |
1267 |
+- /* Logitech HD Pro Webcams C920 and C930e */ |
1268 |
++ /* Logitech HD Pro Webcams C920, C920-C and C930e */ |
1269 |
+ { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, |
1270 |
++ { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, |
1271 |
+ { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, |
1272 |
+ |
1273 |
+ /* Logitech ConferenceCam CC3000e */ |
1274 |
+@@ -217,6 +218,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1275 |
+ { USB_DEVICE(0x1a0a, 0x0200), .driver_info = |
1276 |
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, |
1277 |
+ |
1278 |
++ /* Corsair Strafe RGB */ |
1279 |
++ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, |
1280 |
++ |
1281 |
+ /* Acer C120 LED Projector */ |
1282 |
+ { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM }, |
1283 |
+ |
1284 |
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c |
1285 |
+index c8f38649f749..658d9d1f9ea3 100644 |
1286 |
+--- a/drivers/usb/host/pci-quirks.c |
1287 |
++++ b/drivers/usb/host/pci-quirks.c |
1288 |
+@@ -142,29 +142,30 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) |
1289 |
+ pinfo->sb_type.gen = AMD_CHIPSET_SB700; |
1290 |
+ else if (rev >= 0x40 && rev <= 0x4f) |
1291 |
+ pinfo->sb_type.gen = AMD_CHIPSET_SB800; |
1292 |
+- } |
1293 |
+- pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1294 |
+- 0x145c, NULL); |
1295 |
+- if (pinfo->smbus_dev) { |
1296 |
+- pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; |
1297 |
+ } else { |
1298 |
+ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1299 |
+ PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); |
1300 |
+ |
1301 |
+- if (!pinfo->smbus_dev) { |
1302 |
+- pinfo->sb_type.gen = NOT_AMD_CHIPSET; |
1303 |
+- return 0; |
1304 |
++ if (pinfo->smbus_dev) { |
1305 |
++ rev = pinfo->smbus_dev->revision; |
1306 |
++ if (rev >= 0x11 && rev <= 0x14) |
1307 |
++ pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; |
1308 |
++ else if (rev >= 0x15 && rev <= 0x18) |
1309 |
++ pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; |
1310 |
++ else if (rev >= 0x39 && rev <= 0x3a) |
1311 |
++ pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; |
1312 |
++ } else { |
1313 |
++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, |
1314 |
++ 0x145c, NULL); |
1315 |
++ if (pinfo->smbus_dev) { |
1316 |
++ rev = pinfo->smbus_dev->revision; |
1317 |
++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; |
1318 |
++ } else { |
1319 |
++ pinfo->sb_type.gen = NOT_AMD_CHIPSET; |
1320 |
++ return 0; |
1321 |
++ } |
1322 |
+ } |
1323 |
+- |
1324 |
+- rev = pinfo->smbus_dev->revision; |
1325 |
+- if (rev >= 0x11 && rev <= 0x14) |
1326 |
+- pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; |
1327 |
+- else if (rev >= 0x15 && rev <= 0x18) |
1328 |
+- pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; |
1329 |
+- else if (rev >= 0x39 && rev <= 0x3a) |
1330 |
+- pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; |
1331 |
+ } |
1332 |
+- |
1333 |
+ pinfo->sb_type.rev = rev; |
1334 |
+ return 1; |
1335 |
+ } |
1336 |
+diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c |
1337 |
+index 870da18f5077..6aae19d8de7b 100644 |
1338 |
+--- a/drivers/usb/musb/musb_core.c |
1339 |
++++ b/drivers/usb/musb/musb_core.c |
1340 |
+@@ -2668,6 +2668,13 @@ static int musb_suspend(struct device *dev) |
1341 |
+ { |
1342 |
+ struct musb *musb = dev_to_musb(dev); |
1343 |
+ unsigned long flags; |
1344 |
++ int ret; |
1345 |
++ |
1346 |
++ ret = pm_runtime_get_sync(dev); |
1347 |
++ if (ret < 0) { |
1348 |
++ pm_runtime_put_noidle(dev); |
1349 |
++ return ret; |
1350 |
++ } |
1351 |
+ |
1352 |
+ musb_platform_disable(musb); |
1353 |
+ musb_disable_interrupts(musb); |
1354 |
+@@ -2718,14 +2725,6 @@ static int musb_resume(struct device *dev) |
1355 |
+ if ((devctl & mask) != (musb->context.devctl & mask)) |
1356 |
+ musb->port1_status = 0; |
1357 |
+ |
1358 |
+- /* |
1359 |
+- * The USB HUB code expects the device to be in RPM_ACTIVE once it came |
1360 |
+- * out of suspend |
1361 |
+- */ |
1362 |
+- pm_runtime_disable(dev); |
1363 |
+- pm_runtime_set_active(dev); |
1364 |
+- pm_runtime_enable(dev); |
1365 |
+- |
1366 |
+ musb_start(musb); |
1367 |
+ |
1368 |
+ spin_lock_irqsave(&musb->lock, flags); |
1369 |
+@@ -2735,6 +2734,9 @@ static int musb_resume(struct device *dev) |
1370 |
+ error); |
1371 |
+ spin_unlock_irqrestore(&musb->lock, flags); |
1372 |
+ |
1373 |
++ pm_runtime_mark_last_busy(dev); |
1374 |
++ pm_runtime_put_autosuspend(dev); |
1375 |
++ |
1376 |
+ return 0; |
1377 |
+ } |
1378 |
+ |
1379 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1380 |
+index fe123153b1a5..2a9944326210 100644 |
1381 |
+--- a/drivers/usb/serial/option.c |
1382 |
++++ b/drivers/usb/serial/option.c |
1383 |
+@@ -2023,6 +2023,7 @@ static const struct usb_device_id option_ids[] = { |
1384 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, |
1385 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, |
1386 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ |
1387 |
++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d0e, 0xff) }, /* D-Link DWM-157 C1 */ |
1388 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ |
1389 |
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1390 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ |
1391 |
+diff --git a/fs/dlm/user.c b/fs/dlm/user.c |
1392 |
+index 23488f559cf9..84199151b64b 100644 |
1393 |
+--- a/fs/dlm/user.c |
1394 |
++++ b/fs/dlm/user.c |
1395 |
+@@ -355,6 +355,10 @@ static int dlm_device_register(struct dlm_ls *ls, char *name) |
1396 |
+ error = misc_register(&ls->ls_device); |
1397 |
+ if (error) { |
1398 |
+ kfree(ls->ls_device.name); |
1399 |
++ /* this has to be set to NULL |
1400 |
++ * to avoid a double-free in dlm_device_deregister |
1401 |
++ */ |
1402 |
++ ls->ls_device.name = NULL; |
1403 |
+ } |
1404 |
+ fail: |
1405 |
+ return error; |
1406 |
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h |
1407 |
+index 5f6b71d15393..73605fe53097 100644 |
1408 |
+--- a/include/linux/pci_ids.h |
1409 |
++++ b/include/linux/pci_ids.h |
1410 |
+@@ -576,6 +576,7 @@ |
1411 |
+ #define PCI_DEVICE_ID_AMD_CS5536_EHC 0x2095 |
1412 |
+ #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 |
1413 |
+ #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 |
1414 |
++#define PCI_DEVICE_ID_AMD_CS5536_DEV_IDE 0x2092 |
1415 |
+ #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A |
1416 |
+ #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 |
1417 |
+ #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 |
1418 |
+diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h |
1419 |
+index db6dc9dc0482..1c49431f3121 100644 |
1420 |
+--- a/include/linux/workqueue.h |
1421 |
++++ b/include/linux/workqueue.h |
1422 |
+@@ -323,8 +323,8 @@ enum { |
1423 |
+ |
1424 |
+ __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
1425 |
+ __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
1426 |
+- __WQ_ORDERED_EXPLICIT = 1 << 18, /* internal: alloc_ordered_workqueue() */ |
1427 |
+ __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */ |
1428 |
++ __WQ_ORDERED_EXPLICIT = 1 << 19, /* internal: alloc_ordered_workqueue() */ |
1429 |
+ |
1430 |
+ WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
1431 |
+ WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ |
1432 |
+diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h |
1433 |
+index 51f891fb1b18..7668b5791c91 100644 |
1434 |
+--- a/include/uapi/linux/android/binder.h |
1435 |
++++ b/include/uapi/linux/android/binder.h |
1436 |
+@@ -132,6 +132,7 @@ enum { |
1437 |
+ |
1438 |
+ /* struct binder_fd_array_object - object describing an array of fds in a buffer |
1439 |
+ * @hdr: common header structure |
1440 |
++ * @pad: padding to ensure correct alignment |
1441 |
+ * @num_fds: number of file descriptors in the buffer |
1442 |
+ * @parent: index in offset array to buffer holding the fd array |
1443 |
+ * @parent_offset: start offset of fd array in the buffer |
1444 |
+@@ -152,6 +153,7 @@ enum { |
1445 |
+ */ |
1446 |
+ struct binder_fd_array_object { |
1447 |
+ struct binder_object_header hdr; |
1448 |
++ __u32 pad; |
1449 |
+ binder_size_t num_fds; |
1450 |
+ binder_size_t parent; |
1451 |
+ binder_size_t parent_offset; |
1452 |
+diff --git a/kernel/configs/android-base.config b/kernel/configs/android-base.config |
1453 |
+index 26a06e09a5bd..0b8ba343b478 100644 |
1454 |
+--- a/kernel/configs/android-base.config |
1455 |
++++ b/kernel/configs/android-base.config |
1456 |
+@@ -7,6 +7,7 @@ |
1457 |
+ # CONFIG_SYSVIPC is not set |
1458 |
+ CONFIG_ANDROID=y |
1459 |
+ CONFIG_ANDROID_BINDER_IPC=y |
1460 |
++CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder |
1461 |
+ CONFIG_ANDROID_LOW_MEMORY_KILLER=y |
1462 |
+ CONFIG_ARMV8_DEPRECATED=y |
1463 |
+ CONFIG_ASHMEM=y |