Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.16 commit in: /
Date: Sun, 08 Apr 2018 14:35:36
Message-Id: 1523197993.54a987e8d15fbef1c13b71b424ebf95aa5905d57.mpagano@gentoo
1 commit: 54a987e8d15fbef1c13b71b424ebf95aa5905d57
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 8 14:33:13 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 8 14:33:13 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=54a987e8
7
8 Linux patch 4.16.1
9
10 0000_README | 4 +
11 1000_linux-4.16.1.patch | 1197 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1201 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 01553d4..c464ac8 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.16.1.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.16.1
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1000_linux-4.16.1.patch b/1000_linux-4.16.1.patch
31 new file mode 100644
32 index 0000000..e02e1ee
33 --- /dev/null
34 +++ b/1000_linux-4.16.1.patch
35 @@ -0,0 +1,1197 @@
36 +diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
37 +index dad3b2ec66d4..aeb6db4e35c3 100644
38 +--- a/Documentation/devicetree/bindings/serial/8250.txt
39 ++++ b/Documentation/devicetree/bindings/serial/8250.txt
40 +@@ -24,6 +24,7 @@ Required properties:
41 + - "ti,da830-uart"
42 + - "aspeed,ast2400-vuart"
43 + - "aspeed,ast2500-vuart"
44 ++ - "nuvoton,npcm750-uart"
45 + - "serial" if the port type is unknown.
46 + - reg : offset and length of the register set for the device.
47 + - interrupts : should contain uart interrupt.
48 +diff --git a/Makefile b/Makefile
49 +index 363dd096e46e..1773c718074e 100644
50 +--- a/Makefile
51 ++++ b/Makefile
52 +@@ -1,7 +1,7 @@
53 + # SPDX-License-Identifier: GPL-2.0
54 + VERSION = 4
55 + PATCHLEVEL = 16
56 +-SUBLEVEL = 0
57 ++SUBLEVEL = 1
58 + EXTRAVERSION =
59 + NAME = Fearless Coyote
60 +
61 +diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile
62 +index 30ef8e291271..c9919c2b7ad1 100644
63 +--- a/arch/arm/crypto/Makefile
64 ++++ b/arch/arm/crypto/Makefile
65 +@@ -54,6 +54,7 @@ crct10dif-arm-ce-y := crct10dif-ce-core.o crct10dif-ce-glue.o
66 + crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o
67 + chacha20-neon-y := chacha20-neon-core.o chacha20-neon-glue.o
68 +
69 ++ifdef REGENERATE_ARM_CRYPTO
70 + quiet_cmd_perl = PERL $@
71 + cmd_perl = $(PERL) $(<) > $(@)
72 +
73 +@@ -62,5 +63,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha256-armv4.pl
74 +
75 + $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
76 + $(call cmd,perl)
77 ++endif
78 +
79 + .PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S
80 +diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile
81 +index cee9b8d9830b..dfe651bdf993 100644
82 +--- a/arch/arm64/crypto/Makefile
83 ++++ b/arch/arm64/crypto/Makefile
84 +@@ -67,6 +67,7 @@ CFLAGS_aes-glue-ce.o := -DUSE_V8_CRYPTO_EXTENSIONS
85 + $(obj)/aes-glue-%.o: $(src)/aes-glue.c FORCE
86 + $(call if_changed_rule,cc_o_c)
87 +
88 ++ifdef REGENERATE_ARM64_CRYPTO
89 + quiet_cmd_perlasm = PERLASM $@
90 + cmd_perlasm = $(PERL) $(<) void $(@)
91 +
92 +@@ -75,5 +76,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha512-armv8.pl
93 +
94 + $(src)/sha512-core.S_shipped: $(src)/sha512-armv8.pl
95 + $(call cmd,perlasm)
96 ++endif
97 +
98 + .PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S
99 +diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c
100 +index dbea6020ffe7..575292a33bdf 100644
101 +--- a/arch/x86/crypto/cast5_avx_glue.c
102 ++++ b/arch/x86/crypto/cast5_avx_glue.c
103 +@@ -66,8 +66,6 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,
104 + void (*fn)(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
105 + int err;
106 +
107 +- fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way;
108 +-
109 + err = blkcipher_walk_virt(desc, walk);
110 + desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
111 +
112 +@@ -79,6 +77,7 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,
113 +
114 + /* Process multi-block batch */
115 + if (nbytes >= bsize * CAST5_PARALLEL_BLOCKS) {
116 ++ fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way;
117 + do {
118 + fn(ctx, wdst, wsrc);
119 +
120 +diff --git a/block/bio.c b/block/bio.c
121 +index e1708db48258..53e0f0a1ed94 100644
122 +--- a/block/bio.c
123 ++++ b/block/bio.c
124 +@@ -43,9 +43,9 @@
125 + * break badly! cannot be bigger than what you can fit into an
126 + * unsigned short
127 + */
128 +-#define BV(x) { .nr_vecs = x, .name = "biovec-"__stringify(x) }
129 ++#define BV(x, n) { .nr_vecs = x, .name = "biovec-"#n }
130 + static struct biovec_slab bvec_slabs[BVEC_POOL_NR] __read_mostly = {
131 +- BV(1), BV(4), BV(16), BV(64), BV(128), BV(BIO_MAX_PAGES),
132 ++ BV(1, 1), BV(4, 4), BV(16, 16), BV(64, 64), BV(128, 128), BV(BIO_MAX_PAGES, max),
133 + };
134 + #undef BV
135 +
136 +diff --git a/crypto/ahash.c b/crypto/ahash.c
137 +index 266fc1d64f61..c03cc177870b 100644
138 +--- a/crypto/ahash.c
139 ++++ b/crypto/ahash.c
140 +@@ -92,13 +92,14 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
141 +
142 + if (nbytes && walk->offset & alignmask && !err) {
143 + walk->offset = ALIGN(walk->offset, alignmask + 1);
144 +- walk->data += walk->offset;
145 +-
146 + nbytes = min(nbytes,
147 + ((unsigned int)(PAGE_SIZE)) - walk->offset);
148 + walk->entrylen -= nbytes;
149 +
150 +- return nbytes;
151 ++ if (nbytes) {
152 ++ walk->data += walk->offset;
153 ++ return nbytes;
154 ++ }
155 + }
156 +
157 + if (walk->flags & CRYPTO_ALG_ASYNC)
158 +diff --git a/crypto/lrw.c b/crypto/lrw.c
159 +index cbbd7c50ad19..1d813a6d3fec 100644
160 +--- a/crypto/lrw.c
161 ++++ b/crypto/lrw.c
162 +@@ -313,7 +313,7 @@ static void exit_crypt(struct skcipher_request *req)
163 + rctx->left = 0;
164 +
165 + if (rctx->ext)
166 +- kfree(rctx->ext);
167 ++ kzfree(rctx->ext);
168 + }
169 +
170 + static int do_encrypt(struct skcipher_request *req, int err)
171 +diff --git a/crypto/testmgr.h b/crypto/testmgr.h
172 +index 6044f6906bd6..69fb51e7b6f1 100644
173 +--- a/crypto/testmgr.h
174 ++++ b/crypto/testmgr.h
175 +@@ -548,7 +548,7 @@ static const struct akcipher_testvec rsa_tv_template[] = {
176 + static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = {
177 + {
178 + .key =
179 +- "\x30\x82\x03\x1f\x02\x01\x10\x02\x82\x01\x01\x00\xd7\x1e\x77\x82"
180 ++ "\x30\x82\x03\x1f\x02\x01\x00\x02\x82\x01\x01\x00\xd7\x1e\x77\x82"
181 + "\x8c\x92\x31\xe7\x69\x02\xa2\xd5\x5c\x78\xde\xa2\x0c\x8f\xfe\x28"
182 + "\x59\x31\xdf\x40\x9c\x60\x61\x06\xb9\x2f\x62\x40\x80\x76\xcb\x67"
183 + "\x4a\xb5\x59\x56\x69\x17\x07\xfa\xf9\x4c\xbd\x6c\x37\x7a\x46\x7d"
184 +@@ -597,8 +597,8 @@ static const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = {
185 + "\xfe\xf8\x27\x1b\xd6\x55\x60\x5e\x48\xb7\x6d\x9a\xa8\x37\xf9\x7a"
186 + "\xde\x1b\xcd\x5d\x1a\x30\xd4\xe9\x9e\x5b\x3c\x15\xf8\x9c\x1f\xda"
187 + "\xd1\x86\x48\x55\xce\x83\xee\x8e\x51\xc7\xde\x32\x12\x47\x7d\x46"
188 +- "\xb8\x35\xdf\x41\x02\x01\x30\x02\x01\x30\x02\x01\x30\x02\x01\x30"
189 +- "\x02\x01\x30",
190 ++ "\xb8\x35\xdf\x41\x02\x01\x00\x02\x01\x00\x02\x01\x00\x02\x01\x00"
191 ++ "\x02\x01\x00",
192 + .key_len = 804,
193 + /*
194 + * m is SHA256 hash of following message:
195 +diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
196 +index 52ec5174bcb1..e7cb0c6ade81 100644
197 +--- a/drivers/base/arch_topology.c
198 ++++ b/drivers/base/arch_topology.c
199 +@@ -169,11 +169,11 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
200 + }
201 +
202 + #ifdef CONFIG_CPU_FREQ
203 +-static cpumask_var_t cpus_to_visit __initdata;
204 +-static void __init parsing_done_workfn(struct work_struct *work);
205 +-static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn);
206 ++static cpumask_var_t cpus_to_visit;
207 ++static void parsing_done_workfn(struct work_struct *work);
208 ++static DECLARE_WORK(parsing_done_work, parsing_done_workfn);
209 +
210 +-static int __init
211 ++static int
212 + init_cpu_capacity_callback(struct notifier_block *nb,
213 + unsigned long val,
214 + void *data)
215 +@@ -209,7 +209,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
216 + return 0;
217 + }
218 +
219 +-static struct notifier_block init_cpu_capacity_notifier __initdata = {
220 ++static struct notifier_block init_cpu_capacity_notifier = {
221 + .notifier_call = init_cpu_capacity_callback,
222 + };
223 +
224 +@@ -242,7 +242,7 @@ static int __init register_cpufreq_notifier(void)
225 + }
226 + core_initcall(register_cpufreq_notifier);
227 +
228 +-static void __init parsing_done_workfn(struct work_struct *work)
229 ++static void parsing_done_workfn(struct work_struct *work)
230 + {
231 + cpufreq_unregister_notifier(&init_cpu_capacity_notifier,
232 + CPUFREQ_POLICY_NOTIFIER);
233 +diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
234 +index 40b9fb247010..47a4127a6067 100644
235 +--- a/drivers/bluetooth/hci_bcm.c
236 ++++ b/drivers/bluetooth/hci_bcm.c
237 +@@ -1080,6 +1080,7 @@ static const struct hci_uart_proto bcm_proto = {
238 + #ifdef CONFIG_ACPI
239 + static const struct acpi_device_id bcm_acpi_match[] = {
240 + { "BCM2E1A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
241 ++ { "BCM2E38", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
242 + { "BCM2E39", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
243 + { "BCM2E3A", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
244 + { "BCM2E3D", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
245 +@@ -1092,12 +1093,17 @@ static const struct acpi_device_id bcm_acpi_match[] = {
246 + { "BCM2E67", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
247 + { "BCM2E71", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
248 + { "BCM2E72", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
249 ++ { "BCM2E74", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
250 + { "BCM2E7B", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
251 + { "BCM2E7C", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
252 + { "BCM2E7E", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
253 ++ { "BCM2E83", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
254 ++ { "BCM2E84", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
255 ++ { "BCM2E90", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
256 + { "BCM2E95", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
257 + { "BCM2E96", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
258 + { "BCM2EA4", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
259 ++ { "BCM2EAA", (kernel_ulong_t)&acpi_bcm_int_first_gpios },
260 + { },
261 + };
262 + MODULE_DEVICE_TABLE(acpi, bcm_acpi_match);
263 +diff --git a/drivers/char/mem.c b/drivers/char/mem.c
264 +index 052011bcf100..ffeb60d3434c 100644
265 +--- a/drivers/char/mem.c
266 ++++ b/drivers/char/mem.c
267 +@@ -137,7 +137,7 @@ static ssize_t read_mem(struct file *file, char __user *buf,
268 +
269 + while (count > 0) {
270 + unsigned long remaining;
271 +- int allowed;
272 ++ int allowed, probe;
273 +
274 + sz = size_inside_page(p, count);
275 +
276 +@@ -160,9 +160,9 @@ static ssize_t read_mem(struct file *file, char __user *buf,
277 + if (!ptr)
278 + goto failed;
279 +
280 +- err = probe_kernel_read(bounce, ptr, sz);
281 ++ probe = probe_kernel_read(bounce, ptr, sz);
282 + unxlate_dev_mem_ptr(p, ptr);
283 +- if (err)
284 ++ if (probe)
285 + goto failed;
286 +
287 + remaining = copy_to_user(buf, bounce, sz);
288 +diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
289 +index e843cf410373..361e750f9cba 100644
290 +--- a/drivers/crypto/caam/ctrl.c
291 ++++ b/drivers/crypto/caam/ctrl.c
292 +@@ -815,9 +815,6 @@ static int caam_probe(struct platform_device *pdev)
293 + return 0;
294 +
295 + caam_remove:
296 +-#ifdef CONFIG_DEBUG_FS
297 +- debugfs_remove_recursive(ctrlpriv->dfs_root);
298 +-#endif
299 + caam_remove(pdev);
300 + return ret;
301 +
302 +diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
303 +index 60fc0fa26fd3..26687f318de6 100644
304 +--- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
305 ++++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c
306 +@@ -46,7 +46,7 @@ static int ccp_aes_cmac_complete(struct crypto_async_request *async_req,
307 + }
308 +
309 + /* Update result area if supplied */
310 +- if (req->result)
311 ++ if (req->result && rctx->final)
312 + memcpy(req->result, rctx->iv, digest_size);
313 +
314 + e_free:
315 +diff --git a/drivers/crypto/ccp/ccp-crypto-rsa.c b/drivers/crypto/ccp/ccp-crypto-rsa.c
316 +index e6db8672d89c..05850dfd7940 100644
317 +--- a/drivers/crypto/ccp/ccp-crypto-rsa.c
318 ++++ b/drivers/crypto/ccp/ccp-crypto-rsa.c
319 +@@ -60,10 +60,9 @@ static int ccp_rsa_complete(struct crypto_async_request *async_req, int ret)
320 +
321 + static unsigned int ccp_rsa_maxsize(struct crypto_akcipher *tfm)
322 + {
323 +- if (ccp_version() > CCP_VERSION(3, 0))
324 +- return CCP5_RSA_MAXMOD;
325 +- else
326 +- return CCP_RSA_MAXMOD;
327 ++ struct ccp_ctx *ctx = akcipher_tfm_ctx(tfm);
328 ++
329 ++ return ctx->u.rsa.n_len;
330 + }
331 +
332 + static int ccp_rsa_crypt(struct akcipher_request *req, bool encrypt)
333 +diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c
334 +index 8b9b16d433f7..871c9628a2ee 100644
335 +--- a/drivers/crypto/ccp/ccp-crypto-sha.c
336 ++++ b/drivers/crypto/ccp/ccp-crypto-sha.c
337 +@@ -47,7 +47,7 @@ static int ccp_sha_complete(struct crypto_async_request *async_req, int ret)
338 + }
339 +
340 + /* Update result area if supplied */
341 +- if (req->result)
342 ++ if (req->result && rctx->final)
343 + memcpy(req->result, rctx->ctx, digest_size);
344 +
345 + e_free:
346 +diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
347 +index 225e74a7f724..0dd3a7ac1dd1 100644
348 +--- a/drivers/crypto/inside-secure/safexcel.c
349 ++++ b/drivers/crypto/inside-secure/safexcel.c
350 +@@ -894,7 +894,7 @@ static int safexcel_probe(struct platform_device *pdev)
351 + return PTR_ERR(priv->base);
352 + }
353 +
354 +- priv->clk = of_clk_get(dev->of_node, 0);
355 ++ priv->clk = devm_clk_get(&pdev->dev, NULL);
356 + if (!IS_ERR(priv->clk)) {
357 + ret = clk_prepare_enable(priv->clk);
358 + if (ret) {
359 +diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
360 +index 6882fa2f8bad..c805d0122c0b 100644
361 +--- a/drivers/crypto/talitos.c
362 ++++ b/drivers/crypto/talitos.c
363 +@@ -832,8 +832,6 @@ struct talitos_ctx {
364 + unsigned int keylen;
365 + unsigned int enckeylen;
366 + unsigned int authkeylen;
367 +- dma_addr_t dma_buf;
368 +- dma_addr_t dma_hw_context;
369 + };
370 +
371 + #define HASH_MAX_BLOCK_SIZE SHA512_BLOCK_SIZE
372 +@@ -1130,10 +1128,10 @@ static int sg_to_link_tbl_offset(struct scatterlist *sg, int sg_count,
373 + return count;
374 + }
375 +
376 +-static int talitos_sg_map(struct device *dev, struct scatterlist *src,
377 +- unsigned int len, struct talitos_edesc *edesc,
378 +- struct talitos_ptr *ptr,
379 +- int sg_count, unsigned int offset, int tbl_off)
380 ++static int talitos_sg_map_ext(struct device *dev, struct scatterlist *src,
381 ++ unsigned int len, struct talitos_edesc *edesc,
382 ++ struct talitos_ptr *ptr, int sg_count,
383 ++ unsigned int offset, int tbl_off, int elen)
384 + {
385 + struct talitos_private *priv = dev_get_drvdata(dev);
386 + bool is_sec1 = has_ftr_sec1(priv);
387 +@@ -1142,6 +1140,7 @@ static int talitos_sg_map(struct device *dev, struct scatterlist *src,
388 + to_talitos_ptr(ptr, 0, 0, is_sec1);
389 + return 1;
390 + }
391 ++ to_talitos_ptr_ext_set(ptr, elen, is_sec1);
392 + if (sg_count == 1) {
393 + to_talitos_ptr(ptr, sg_dma_address(src) + offset, len, is_sec1);
394 + return sg_count;
395 +@@ -1150,7 +1149,7 @@ static int talitos_sg_map(struct device *dev, struct scatterlist *src,
396 + to_talitos_ptr(ptr, edesc->dma_link_tbl + offset, len, is_sec1);
397 + return sg_count;
398 + }
399 +- sg_count = sg_to_link_tbl_offset(src, sg_count, offset, len,
400 ++ sg_count = sg_to_link_tbl_offset(src, sg_count, offset, len + elen,
401 + &edesc->link_tbl[tbl_off]);
402 + if (sg_count == 1) {
403 + /* Only one segment now, so no link tbl needed*/
404 +@@ -1164,6 +1163,15 @@ static int talitos_sg_map(struct device *dev, struct scatterlist *src,
405 + return sg_count;
406 + }
407 +
408 ++static int talitos_sg_map(struct device *dev, struct scatterlist *src,
409 ++ unsigned int len, struct talitos_edesc *edesc,
410 ++ struct talitos_ptr *ptr, int sg_count,
411 ++ unsigned int offset, int tbl_off)
412 ++{
413 ++ return talitos_sg_map_ext(dev, src, len, edesc, ptr, sg_count, offset,
414 ++ tbl_off, 0);
415 ++}
416 ++
417 + /*
418 + * fill in and submit ipsec_esp descriptor
419 + */
420 +@@ -1181,7 +1189,7 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq,
421 + unsigned int ivsize = crypto_aead_ivsize(aead);
422 + int tbl_off = 0;
423 + int sg_count, ret;
424 +- int sg_link_tbl_len;
425 ++ int elen = 0;
426 + bool sync_needed = false;
427 + struct talitos_private *priv = dev_get_drvdata(dev);
428 + bool is_sec1 = has_ftr_sec1(priv);
429 +@@ -1223,17 +1231,11 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq,
430 + * extent is bytes of HMAC postpended to ciphertext,
431 + * typically 12 for ipsec
432 + */
433 +- sg_link_tbl_len = cryptlen;
434 +-
435 +- if (is_ipsec_esp) {
436 +- to_talitos_ptr_ext_set(&desc->ptr[4], authsize, is_sec1);
437 +-
438 +- if (desc->hdr & DESC_HDR_MODE1_MDEU_CICV)
439 +- sg_link_tbl_len += authsize;
440 +- }
441 ++ if (is_ipsec_esp && (desc->hdr & DESC_HDR_MODE1_MDEU_CICV))
442 ++ elen = authsize;
443 +
444 +- ret = talitos_sg_map(dev, areq->src, sg_link_tbl_len, edesc,
445 +- &desc->ptr[4], sg_count, areq->assoclen, tbl_off);
446 ++ ret = talitos_sg_map_ext(dev, areq->src, cryptlen, edesc, &desc->ptr[4],
447 ++ sg_count, areq->assoclen, tbl_off, elen);
448 +
449 + if (ret > 1) {
450 + tbl_off += ret;
451 +@@ -1690,9 +1692,30 @@ static void common_nonsnoop_hash_unmap(struct device *dev,
452 + struct ahash_request *areq)
453 + {
454 + struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
455 ++ struct talitos_private *priv = dev_get_drvdata(dev);
456 ++ bool is_sec1 = has_ftr_sec1(priv);
457 ++ struct talitos_desc *desc = &edesc->desc;
458 ++ struct talitos_desc *desc2 = desc + 1;
459 ++
460 ++ unmap_single_talitos_ptr(dev, &edesc->desc.ptr[5], DMA_FROM_DEVICE);
461 ++ if (desc->next_desc &&
462 ++ desc->ptr[5].ptr != desc2->ptr[5].ptr)
463 ++ unmap_single_talitos_ptr(dev, &desc2->ptr[5], DMA_FROM_DEVICE);
464 +
465 + talitos_sg_unmap(dev, edesc, req_ctx->psrc, NULL, 0, 0);
466 +
467 ++ /* When using hashctx-in, must unmap it. */
468 ++ if (from_talitos_ptr_len(&edesc->desc.ptr[1], is_sec1))
469 ++ unmap_single_talitos_ptr(dev, &edesc->desc.ptr[1],
470 ++ DMA_TO_DEVICE);
471 ++ else if (desc->next_desc)
472 ++ unmap_single_talitos_ptr(dev, &desc2->ptr[1],
473 ++ DMA_TO_DEVICE);
474 ++
475 ++ if (is_sec1 && req_ctx->nbuf)
476 ++ unmap_single_talitos_ptr(dev, &desc->ptr[3],
477 ++ DMA_TO_DEVICE);
478 ++
479 + if (edesc->dma_len)
480 + dma_unmap_single(dev, edesc->dma_link_tbl, edesc->dma_len,
481 + DMA_BIDIRECTIONAL);
482 +@@ -1766,8 +1789,10 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
483 +
484 + /* hash context in */
485 + if (!req_ctx->first || req_ctx->swinit) {
486 +- to_talitos_ptr(&desc->ptr[1], ctx->dma_hw_context,
487 +- req_ctx->hw_context_size, is_sec1);
488 ++ map_single_talitos_ptr(dev, &desc->ptr[1],
489 ++ req_ctx->hw_context_size,
490 ++ (char *)req_ctx->hw_context,
491 ++ DMA_TO_DEVICE);
492 + req_ctx->swinit = 0;
493 + }
494 + /* Indicate next op is not the first. */
495 +@@ -1793,10 +1818,9 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
496 + * data in
497 + */
498 + if (is_sec1 && req_ctx->nbuf) {
499 +- dma_addr_t dma_buf = ctx->dma_buf + req_ctx->buf_idx *
500 +- HASH_MAX_BLOCK_SIZE;
501 +-
502 +- to_talitos_ptr(&desc->ptr[3], dma_buf, req_ctx->nbuf, is_sec1);
503 ++ map_single_talitos_ptr(dev, &desc->ptr[3], req_ctx->nbuf,
504 ++ req_ctx->buf[req_ctx->buf_idx],
505 ++ DMA_TO_DEVICE);
506 + } else {
507 + sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc,
508 + &desc->ptr[3], sg_count, offset, 0);
509 +@@ -1812,8 +1836,9 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
510 + crypto_ahash_digestsize(tfm),
511 + areq->result, DMA_FROM_DEVICE);
512 + else
513 +- to_talitos_ptr(&desc->ptr[5], ctx->dma_hw_context,
514 +- req_ctx->hw_context_size, is_sec1);
515 ++ map_single_talitos_ptr(dev, &desc->ptr[5],
516 ++ req_ctx->hw_context_size,
517 ++ req_ctx->hw_context, DMA_FROM_DEVICE);
518 +
519 + /* last DWORD empty */
520 +
521 +@@ -1832,9 +1857,14 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
522 + desc->hdr |= DESC_HDR_MODE0_MDEU_CONT;
523 + desc->hdr &= ~DESC_HDR_DONE_NOTIFY;
524 +
525 +- to_talitos_ptr(&desc2->ptr[1], ctx->dma_hw_context,
526 +- req_ctx->hw_context_size, is_sec1);
527 +-
528 ++ if (desc->ptr[1].ptr)
529 ++ copy_talitos_ptr(&desc2->ptr[1], &desc->ptr[1],
530 ++ is_sec1);
531 ++ else
532 ++ map_single_talitos_ptr(dev, &desc2->ptr[1],
533 ++ req_ctx->hw_context_size,
534 ++ req_ctx->hw_context,
535 ++ DMA_TO_DEVICE);
536 + copy_talitos_ptr(&desc2->ptr[2], &desc->ptr[2], is_sec1);
537 + sg_count = talitos_sg_map(dev, req_ctx->psrc, length, edesc,
538 + &desc2->ptr[3], sg_count, offset, 0);
539 +@@ -1842,8 +1872,10 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc,
540 + sync_needed = true;
541 + copy_talitos_ptr(&desc2->ptr[5], &desc->ptr[5], is_sec1);
542 + if (req_ctx->last)
543 +- to_talitos_ptr(&desc->ptr[5], ctx->dma_hw_context,
544 +- req_ctx->hw_context_size, is_sec1);
545 ++ map_single_talitos_ptr(dev, &desc->ptr[5],
546 ++ req_ctx->hw_context_size,
547 ++ req_ctx->hw_context,
548 ++ DMA_FROM_DEVICE);
549 +
550 + next_desc = dma_map_single(dev, &desc2->hdr1, TALITOS_DESC_SIZE,
551 + DMA_BIDIRECTIONAL);
552 +@@ -1881,12 +1913,8 @@ static struct talitos_edesc *ahash_edesc_alloc(struct ahash_request *areq,
553 + static int ahash_init(struct ahash_request *areq)
554 + {
555 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
556 +- struct talitos_ctx *ctx = crypto_ahash_ctx(tfm);
557 +- struct device *dev = ctx->dev;
558 + struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
559 + unsigned int size;
560 +- struct talitos_private *priv = dev_get_drvdata(dev);
561 +- bool is_sec1 = has_ftr_sec1(priv);
562 +
563 + /* Initialize the context */
564 + req_ctx->buf_idx = 0;
565 +@@ -1898,18 +1926,6 @@ static int ahash_init(struct ahash_request *areq)
566 + : TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512;
567 + req_ctx->hw_context_size = size;
568 +
569 +- if (ctx->dma_hw_context)
570 +- dma_unmap_single(dev, ctx->dma_hw_context, size,
571 +- DMA_BIDIRECTIONAL);
572 +- ctx->dma_hw_context = dma_map_single(dev, req_ctx->hw_context, size,
573 +- DMA_BIDIRECTIONAL);
574 +- if (ctx->dma_buf)
575 +- dma_unmap_single(dev, ctx->dma_buf, sizeof(req_ctx->buf),
576 +- DMA_TO_DEVICE);
577 +- if (is_sec1)
578 +- ctx->dma_buf = dma_map_single(dev, req_ctx->buf,
579 +- sizeof(req_ctx->buf),
580 +- DMA_TO_DEVICE);
581 + return 0;
582 + }
583 +
584 +@@ -1920,9 +1936,6 @@ static int ahash_init(struct ahash_request *areq)
585 + static int ahash_init_sha224_swinit(struct ahash_request *areq)
586 + {
587 + struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
588 +- struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
589 +- struct talitos_ctx *ctx = crypto_ahash_ctx(tfm);
590 +- struct device *dev = ctx->dev;
591 +
592 + ahash_init(areq);
593 + req_ctx->swinit = 1;/* prevent h/w initting context with sha256 values*/
594 +@@ -1940,9 +1953,6 @@ static int ahash_init_sha224_swinit(struct ahash_request *areq)
595 + req_ctx->hw_context[8] = 0;
596 + req_ctx->hw_context[9] = 0;
597 +
598 +- dma_sync_single_for_device(dev, ctx->dma_hw_context,
599 +- req_ctx->hw_context_size, DMA_TO_DEVICE);
600 +-
601 + return 0;
602 + }
603 +
604 +@@ -2046,13 +2056,6 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)
605 + /* request SEC to INIT hash. */
606 + if (req_ctx->first && !req_ctx->swinit)
607 + edesc->desc.hdr |= DESC_HDR_MODE0_MDEU_INIT;
608 +- if (is_sec1) {
609 +- dma_addr_t dma_buf = ctx->dma_buf + req_ctx->buf_idx *
610 +- HASH_MAX_BLOCK_SIZE;
611 +-
612 +- dma_sync_single_for_device(dev, dma_buf,
613 +- req_ctx->nbuf, DMA_TO_DEVICE);
614 +- }
615 +
616 + /* When the tfm context has a keylen, it's an HMAC.
617 + * A first or last (ie. not middle) descriptor must request HMAC.
618 +@@ -2106,12 +2109,7 @@ static int ahash_export(struct ahash_request *areq, void *out)
619 + {
620 + struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq);
621 + struct talitos_export_state *export = out;
622 +- struct crypto_ahash *ahash = crypto_ahash_reqtfm(areq);
623 +- struct talitos_ctx *ctx = crypto_ahash_ctx(ahash);
624 +- struct device *dev = ctx->dev;
625 +
626 +- dma_sync_single_for_cpu(dev, ctx->dma_hw_context,
627 +- req_ctx->hw_context_size, DMA_FROM_DEVICE);
628 + memcpy(export->hw_context, req_ctx->hw_context,
629 + req_ctx->hw_context_size);
630 + memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf);
631 +@@ -2130,31 +2128,14 @@ static int ahash_import(struct ahash_request *areq, const void *in)
632 + struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
633 + const struct talitos_export_state *export = in;
634 + unsigned int size;
635 +- struct talitos_ctx *ctx = crypto_ahash_ctx(tfm);
636 +- struct device *dev = ctx->dev;
637 +- struct talitos_private *priv = dev_get_drvdata(dev);
638 +- bool is_sec1 = has_ftr_sec1(priv);
639 +
640 + memset(req_ctx, 0, sizeof(*req_ctx));
641 + size = (crypto_ahash_digestsize(tfm) <= SHA256_DIGEST_SIZE)
642 + ? TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256
643 + : TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512;
644 + req_ctx->hw_context_size = size;
645 +- if (ctx->dma_hw_context)
646 +- dma_unmap_single(dev, ctx->dma_hw_context, size,
647 +- DMA_BIDIRECTIONAL);
648 +-
649 + memcpy(req_ctx->hw_context, export->hw_context, size);
650 +- ctx->dma_hw_context = dma_map_single(dev, req_ctx->hw_context, size,
651 +- DMA_BIDIRECTIONAL);
652 +- if (ctx->dma_buf)
653 +- dma_unmap_single(dev, ctx->dma_buf, sizeof(req_ctx->buf),
654 +- DMA_TO_DEVICE);
655 + memcpy(req_ctx->buf[0], export->buf, export->nbuf);
656 +- if (is_sec1)
657 +- ctx->dma_buf = dma_map_single(dev, req_ctx->buf,
658 +- sizeof(req_ctx->buf),
659 +- DMA_TO_DEVICE);
660 + req_ctx->swinit = export->swinit;
661 + req_ctx->first = export->first;
662 + req_ctx->last = export->last;
663 +@@ -3064,27 +3045,6 @@ static void talitos_cra_exit(struct crypto_tfm *tfm)
664 + dma_unmap_single(dev, ctx->dma_key, ctx->keylen, DMA_TO_DEVICE);
665 + }
666 +
667 +-static void talitos_cra_exit_ahash(struct crypto_tfm *tfm)
668 +-{
669 +- struct talitos_ctx *ctx = crypto_tfm_ctx(tfm);
670 +- struct device *dev = ctx->dev;
671 +- unsigned int size;
672 +-
673 +- talitos_cra_exit(tfm);
674 +-
675 +- size = (crypto_ahash_digestsize(__crypto_ahash_cast(tfm)) <=
676 +- SHA256_DIGEST_SIZE)
677 +- ? TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256
678 +- : TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512;
679 +-
680 +- if (ctx->dma_hw_context)
681 +- dma_unmap_single(dev, ctx->dma_hw_context, size,
682 +- DMA_BIDIRECTIONAL);
683 +- if (ctx->dma_buf)
684 +- dma_unmap_single(dev, ctx->dma_buf, HASH_MAX_BLOCK_SIZE * 2,
685 +- DMA_TO_DEVICE);
686 +-}
687 +-
688 + /*
689 + * given the alg's descriptor header template, determine whether descriptor
690 + * type and primary/secondary execution units required match the hw
691 +@@ -3183,7 +3143,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
692 + case CRYPTO_ALG_TYPE_AHASH:
693 + alg = &t_alg->algt.alg.hash.halg.base;
694 + alg->cra_init = talitos_cra_init_ahash;
695 +- alg->cra_exit = talitos_cra_exit_ahash;
696 ++ alg->cra_exit = talitos_cra_exit;
697 + alg->cra_type = &crypto_ahash_type;
698 + t_alg->algt.alg.hash.init = ahash_init;
699 + t_alg->algt.alg.hash.update = ahash_update;
700 +diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
701 +index dbe57da8c1a1..4a3bc168a4a7 100644
702 +--- a/drivers/input/mouse/alps.c
703 ++++ b/drivers/input/mouse/alps.c
704 +@@ -2544,13 +2544,31 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4],
705 + }
706 +
707 + static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],
708 +- struct alps_data *priv)
709 ++ struct alps_data *priv,
710 ++ struct psmouse *psmouse)
711 + {
712 + bool is_dual = false;
713 ++ int reg_val = 0;
714 ++ struct ps2dev *ps2dev = &psmouse->ps2dev;
715 +
716 +- if (IS_SS4PLUS_DEV(priv->dev_id))
717 ++ if (IS_SS4PLUS_DEV(priv->dev_id)) {
718 + is_dual = (otp[0][0] >> 4) & 0x01;
719 +
720 ++ if (!is_dual) {
721 ++ /* For support TrackStick of Thinkpad L/E series */
722 ++ if (alps_exit_command_mode(psmouse) == 0 &&
723 ++ alps_enter_command_mode(psmouse) == 0) {
724 ++ reg_val = alps_command_mode_read_reg(psmouse,
725 ++ 0xD7);
726 ++ }
727 ++ alps_exit_command_mode(psmouse);
728 ++ ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
729 ++
730 ++ if (reg_val == 0x0C || reg_val == 0x1D)
731 ++ is_dual = true;
732 ++ }
733 ++ }
734 ++
735 + if (is_dual)
736 + priv->flags |= ALPS_DUALPOINT |
737 + ALPS_DUALPOINT_WITH_PRESSURE;
738 +@@ -2573,7 +2591,7 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
739 +
740 + alps_update_btn_info_ss4_v2(otp, priv);
741 +
742 +- alps_update_dual_info_ss4_v2(otp, priv);
743 ++ alps_update_dual_info_ss4_v2(otp, priv, psmouse);
744 +
745 + return 0;
746 + }
747 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
748 +index 6cbbdc6e9687..b353d494ad40 100644
749 +--- a/drivers/input/serio/i8042-x86ia64io.h
750 ++++ b/drivers/input/serio/i8042-x86ia64io.h
751 +@@ -530,6 +530,20 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
752 + { }
753 + };
754 +
755 ++static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
756 ++ {
757 ++ /*
758 ++ * Sony Vaio VGN-CS series require MUX or the touch sensor
759 ++ * buttons will disturb touchpad operation
760 ++ */
761 ++ .matches = {
762 ++ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
763 ++ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
764 ++ },
765 ++ },
766 ++ { }
767 ++};
768 ++
769 + /*
770 + * On some Asus laptops, just running self tests cause problems.
771 + */
772 +@@ -620,6 +634,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
773 + DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
774 + },
775 + },
776 ++ {
777 ++ /* Lenovo ThinkPad L460 */
778 ++ .matches = {
779 ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
780 ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
781 ++ },
782 ++ },
783 + {
784 + /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
785 + .matches = {
786 +@@ -1163,6 +1184,9 @@ static int __init i8042_platform_init(void)
787 + if (dmi_check_system(i8042_dmi_nomux_table))
788 + i8042_nomux = true;
789 +
790 ++ if (dmi_check_system(i8042_dmi_forcemux_table))
791 ++ i8042_nomux = false;
792 ++
793 + if (dmi_check_system(i8042_dmi_notimeout_table))
794 + i8042_notimeout = true;
795 +
796 +diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
797 +index 127f8a0c098b..0c2e628e8723 100644
798 +--- a/drivers/media/usb/usbtv/usbtv-core.c
799 ++++ b/drivers/media/usb/usbtv/usbtv-core.c
800 +@@ -112,6 +112,8 @@ static int usbtv_probe(struct usb_interface *intf,
801 + return 0;
802 +
803 + usbtv_audio_fail:
804 ++ /* we must not free at this point */
805 ++ usb_get_dev(usbtv->udev);
806 + usbtv_video_free(usbtv);
807 +
808 + usbtv_video_fail:
809 +diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
810 +index 758dc73602d5..7bb013644aeb 100644
811 +--- a/drivers/misc/mei/main.c
812 ++++ b/drivers/misc/mei/main.c
813 +@@ -507,7 +507,6 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
814 + break;
815 +
816 + default:
817 +- dev_err(dev->dev, ": unsupported ioctl %d.\n", cmd);
818 + rets = -ENOIOCTLCMD;
819 + }
820 +
821 +diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
822 +index 489492b608cf..380916bff9e0 100644
823 +--- a/drivers/parport/parport_pc.c
824 ++++ b/drivers/parport/parport_pc.c
825 +@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
826 + netmos_9901,
827 + netmos_9865,
828 + quatech_sppxp100,
829 ++ wch_ch382l,
830 + };
831 +
832 +
833 +@@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
834 + /* netmos_9901 */ { 1, { { 0, -1 }, } },
835 + /* netmos_9865 */ { 1, { { 0, -1 }, } },
836 + /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
837 ++ /* wch_ch382l */ { 1, { { 2, -1 }, } },
838 + };
839 +
840 + static const struct pci_device_id parport_pc_pci_tbl[] = {
841 +@@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
842 + /* Quatech SPPXP-100 Parallel port PCI ExpressCard */
843 + { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
844 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
845 ++ /* WCH CH382L PCI-E single parallel port card */
846 ++ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l },
847 + { 0, } /* terminate list */
848 + };
849 + MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
850 +diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c
851 +index fdfcdea25867..16590dfaafa4 100644
852 +--- a/drivers/siox/siox-core.c
853 ++++ b/drivers/siox/siox-core.c
854 +@@ -594,7 +594,7 @@ static ssize_t device_add_store(struct device *dev,
855 + size_t inbytes = 0, outbytes = 0;
856 + u8 statustype = 0;
857 +
858 +- ret = sscanf(buf, "%20s %zu %zu %hhu", type, &inbytes,
859 ++ ret = sscanf(buf, "%19s %zu %zu %hhu", type, &inbytes,
860 + &outbytes, &statustype);
861 + if (ret != 3 && ret != 4)
862 + return -EINVAL;
863 +diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
864 +index 5d610af6799f..9753042b7e1f 100644
865 +--- a/drivers/staging/comedi/drivers/ni_mio_common.c
866 ++++ b/drivers/staging/comedi/drivers/ni_mio_common.c
867 +@@ -1275,6 +1275,8 @@ static void ack_a_interrupt(struct comedi_device *dev, unsigned short a_status)
868 + ack |= NISTC_INTA_ACK_AI_START;
869 + if (a_status & NISTC_AI_STATUS1_STOP)
870 + ack |= NISTC_INTA_ACK_AI_STOP;
871 ++ if (a_status & NISTC_AI_STATUS1_OVER)
872 ++ ack |= NISTC_INTA_ACK_AI_ERR;
873 + if (ack)
874 + ni_stc_writew(dev, ack, NISTC_INTA_ACK_REG);
875 + }
876 +diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
877 +index 160b8906d9b9..9835b1c1cbe1 100644
878 +--- a/drivers/tty/serial/8250/8250_of.c
879 ++++ b/drivers/tty/serial/8250/8250_of.c
880 +@@ -316,6 +316,7 @@ static const struct of_device_id of_platform_serial_table[] = {
881 + { .compatible = "mrvl,mmp-uart",
882 + .data = (void *)PORT_XSCALE, },
883 + { .compatible = "ti,da830-uart", .data = (void *)PORT_DA830, },
884 ++ { .compatible = "nuvoton,npcm750-uart", .data = (void *)PORT_NPCM, },
885 + { /* end of list */ },
886 + };
887 + MODULE_DEVICE_TABLE(of, of_platform_serial_table);
888 +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
889 +index 1328c7e70108..804c1af6fd33 100644
890 +--- a/drivers/tty/serial/8250/8250_port.c
891 ++++ b/drivers/tty/serial/8250/8250_port.c
892 +@@ -47,6 +47,10 @@
893 + #define UART_EXAR_SLEEP 0x8b /* Sleep mode */
894 + #define UART_EXAR_DVID 0x8d /* Device identification */
895 +
896 ++/* Nuvoton NPCM timeout register */
897 ++#define UART_NPCM_TOR 7
898 ++#define UART_NPCM_TOIE BIT(7) /* Timeout Interrupt Enable */
899 ++
900 + /*
901 + * Debugging.
902 + */
903 +@@ -293,6 +297,15 @@ static const struct serial8250_config uart_config[] = {
904 + UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
905 + .flags = UART_CAP_FIFO,
906 + },
907 ++ [PORT_NPCM] = {
908 ++ .name = "Nuvoton 16550",
909 ++ .fifo_size = 16,
910 ++ .tx_loadsz = 16,
911 ++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 |
912 ++ UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
913 ++ .rxtrig_bytes = {1, 4, 8, 14},
914 ++ .flags = UART_CAP_FIFO,
915 ++ },
916 + };
917 +
918 + /* Uart divisor latch read */
919 +@@ -2140,6 +2153,15 @@ int serial8250_do_startup(struct uart_port *port)
920 + UART_DA830_PWREMU_MGMT_FREE);
921 + }
922 +
923 ++ if (port->type == PORT_NPCM) {
924 ++ /*
925 ++ * Nuvoton calls the scratch register 'UART_TOR' (timeout
926 ++ * register). Enable it, and set TIOC (timeout interrupt
927 ++ * comparator) to be 0x20 for correct operation.
928 ++ */
929 ++ serial_port_out(port, UART_NPCM_TOR, UART_NPCM_TOIE | 0x20);
930 ++ }
931 ++
932 + #ifdef CONFIG_SERIAL_8250_RSA
933 + /*
934 + * If this is an RSA port, see if we can kick it up to the
935 +@@ -2462,6 +2484,15 @@ static unsigned int xr17v35x_get_divisor(struct uart_8250_port *up,
936 + return quot_16 >> 4;
937 + }
938 +
939 ++/* Nuvoton NPCM UARTs have a custom divisor calculation */
940 ++static unsigned int npcm_get_divisor(struct uart_8250_port *up,
941 ++ unsigned int baud)
942 ++{
943 ++ struct uart_port *port = &up->port;
944 ++
945 ++ return DIV_ROUND_CLOSEST(port->uartclk, 16 * baud + 2) - 2;
946 ++}
947 ++
948 + static unsigned int serial8250_get_divisor(struct uart_8250_port *up,
949 + unsigned int baud,
950 + unsigned int *frac)
951 +@@ -2482,6 +2513,8 @@ static unsigned int serial8250_get_divisor(struct uart_8250_port *up,
952 + quot = 0x8002;
953 + else if (up->port.type == PORT_XR17V35X)
954 + quot = xr17v35x_get_divisor(up, baud, frac);
955 ++ else if (up->port.type == PORT_NPCM)
956 ++ quot = npcm_get_divisor(up, baud);
957 + else
958 + quot = uart_get_divisor(port, baud);
959 +
960 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
961 +index b4e57c5a8bba..f97251f39c26 100644
962 +--- a/drivers/tty/vt/vt.c
963 ++++ b/drivers/tty/vt/vt.c
964 +@@ -1354,6 +1354,11 @@ static void csi_m(struct vc_data *vc)
965 + case 3:
966 + vc->vc_italic = 1;
967 + break;
968 ++ case 21:
969 ++ /*
970 ++ * No console drivers support double underline, so
971 ++ * convert it to a single underline.
972 ++ */
973 + case 4:
974 + vc->vc_underline = 1;
975 + break;
976 +@@ -1389,7 +1394,6 @@ static void csi_m(struct vc_data *vc)
977 + vc->vc_disp_ctrl = 1;
978 + vc->vc_toggle_meta = 1;
979 + break;
980 +- case 21:
981 + case 22:
982 + vc->vc_intensity = 1;
983 + break;
984 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
985 +index 06d502b3e913..de1e759dd512 100644
986 +--- a/drivers/usb/serial/cp210x.c
987 ++++ b/drivers/usb/serial/cp210x.c
988 +@@ -155,6 +155,7 @@ static const struct usb_device_id id_table[] = {
989 + { USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */
990 + { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
991 + { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
992 ++ { USB_DEVICE(0x155A, 0x1006) }, /* ELDAT Easywave RX09 */
993 + { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
994 + { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */
995 + { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
996 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
997 +index f58c4ff6b387..87202ad5a50d 100644
998 +--- a/drivers/usb/serial/ftdi_sio.c
999 ++++ b/drivers/usb/serial/ftdi_sio.c
1000 +@@ -769,6 +769,7 @@ static const struct usb_device_id id_table_combined[] = {
1001 + .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
1002 + { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
1003 + { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) },
1004 ++ { USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) },
1005 + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) },
1006 + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) },
1007 + { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) },
1008 +@@ -931,6 +932,7 @@ static const struct usb_device_id id_table_combined[] = {
1009 + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
1010 + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
1011 + { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) },
1012 ++ { USB_DEVICE(FTDI_VID, FTDI_FHE_PID) },
1013 + { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) },
1014 + { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID),
1015 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1016 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1017 +index 8b4ecd2bd297..975d02666c5a 100644
1018 +--- a/drivers/usb/serial/ftdi_sio_ids.h
1019 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
1020 +@@ -923,6 +923,9 @@
1021 + /*
1022 + * RT Systems programming cables for various ham radios
1023 + */
1024 ++/* This device uses the VID of FTDI */
1025 ++#define RTSYSTEMS_USB_VX8_PID 0x9e50 /* USB-VX8 USB to 7 pin modular plug for Yaesu VX-8 radio */
1026 ++
1027 + #define RTSYSTEMS_VID 0x2100 /* Vendor ID */
1028 + #define RTSYSTEMS_USB_S03_PID 0x9001 /* RTS-03 USB to Serial Adapter */
1029 + #define RTSYSTEMS_USB_59_PID 0x9e50 /* USB-59 USB to 8 pin plug */
1030 +@@ -1441,6 +1444,12 @@
1031 + */
1032 + #define FTDI_CINTERION_MC55I_PID 0xA951
1033 +
1034 ++/*
1035 ++ * Product: FirmwareHubEmulator
1036 ++ * Manufacturer: Harman Becker Automotive Systems
1037 ++ */
1038 ++#define FTDI_FHE_PID 0xA9A0
1039 ++
1040 + /*
1041 + * Product: Comet Caller ID decoder
1042 + * Manufacturer: Crucible Technologies
1043 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
1044 +index f53470112670..c7b75dd58fad 100644
1045 +--- a/fs/btrfs/inode.c
1046 ++++ b/fs/btrfs/inode.c
1047 +@@ -1262,6 +1262,8 @@ static noinline int csum_exist_in_range(struct btrfs_fs_info *fs_info,
1048 + list_del(&sums->list);
1049 + kfree(sums);
1050 + }
1051 ++ if (ret < 0)
1052 ++ return ret;
1053 + return 1;
1054 + }
1055 +
1056 +@@ -1394,10 +1396,23 @@ static noinline int run_delalloc_nocow(struct inode *inode,
1057 + goto out_check;
1058 + if (btrfs_extent_readonly(fs_info, disk_bytenr))
1059 + goto out_check;
1060 +- if (btrfs_cross_ref_exist(root, ino,
1061 +- found_key.offset -
1062 +- extent_offset, disk_bytenr))
1063 ++ ret = btrfs_cross_ref_exist(root, ino,
1064 ++ found_key.offset -
1065 ++ extent_offset, disk_bytenr);
1066 ++ if (ret) {
1067 ++ /*
1068 ++ * ret could be -EIO if the above fails to read
1069 ++ * metadata.
1070 ++ */
1071 ++ if (ret < 0) {
1072 ++ if (cow_start != (u64)-1)
1073 ++ cur_offset = cow_start;
1074 ++ goto error;
1075 ++ }
1076 ++
1077 ++ WARN_ON_ONCE(nolock);
1078 + goto out_check;
1079 ++ }
1080 + disk_bytenr += extent_offset;
1081 + disk_bytenr += cur_offset - found_key.offset;
1082 + num_bytes = min(end + 1, extent_end) - cur_offset;
1083 +@@ -1415,10 +1430,22 @@ static noinline int run_delalloc_nocow(struct inode *inode,
1084 + * this ensure that csum for a given extent are
1085 + * either valid or do not exist.
1086 + */
1087 +- if (csum_exist_in_range(fs_info, disk_bytenr,
1088 +- num_bytes)) {
1089 ++ ret = csum_exist_in_range(fs_info, disk_bytenr,
1090 ++ num_bytes);
1091 ++ if (ret) {
1092 + if (!nolock)
1093 + btrfs_end_write_no_snapshotting(root);
1094 ++
1095 ++ /*
1096 ++ * ret could be -EIO if the above fails to read
1097 ++ * metadata.
1098 ++ */
1099 ++ if (ret < 0) {
1100 ++ if (cow_start != (u64)-1)
1101 ++ cur_offset = cow_start;
1102 ++ goto error;
1103 ++ }
1104 ++ WARN_ON_ONCE(nolock);
1105 + goto out_check;
1106 + }
1107 + if (!btrfs_inc_nocow_writers(fs_info, disk_bytenr)) {
1108 +diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
1109 +index 5f11fbdc27f8..1ee46f492267 100644
1110 +--- a/include/linux/bitmap.h
1111 ++++ b/include/linux/bitmap.h
1112 +@@ -302,12 +302,20 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr
1113 + __bitmap_complement(dst, src, nbits);
1114 + }
1115 +
1116 ++#ifdef __LITTLE_ENDIAN
1117 ++#define BITMAP_MEM_ALIGNMENT 8
1118 ++#else
1119 ++#define BITMAP_MEM_ALIGNMENT (8 * sizeof(unsigned long))
1120 ++#endif
1121 ++#define BITMAP_MEM_MASK (BITMAP_MEM_ALIGNMENT - 1)
1122 ++
1123 + static inline int bitmap_equal(const unsigned long *src1,
1124 + const unsigned long *src2, unsigned int nbits)
1125 + {
1126 + if (small_const_nbits(nbits))
1127 + return !((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
1128 +- if (__builtin_constant_p(nbits & 7) && IS_ALIGNED(nbits, 8))
1129 ++ if (__builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
1130 ++ IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
1131 + return !memcmp(src1, src2, nbits / 8);
1132 + return __bitmap_equal(src1, src2, nbits);
1133 + }
1134 +@@ -358,8 +366,10 @@ static __always_inline void bitmap_set(unsigned long *map, unsigned int start,
1135 + {
1136 + if (__builtin_constant_p(nbits) && nbits == 1)
1137 + __set_bit(start, map);
1138 +- else if (__builtin_constant_p(start & 7) && IS_ALIGNED(start, 8) &&
1139 +- __builtin_constant_p(nbits & 7) && IS_ALIGNED(nbits, 8))
1140 ++ else if (__builtin_constant_p(start & BITMAP_MEM_MASK) &&
1141 ++ IS_ALIGNED(start, BITMAP_MEM_ALIGNMENT) &&
1142 ++ __builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
1143 ++ IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
1144 + memset((char *)map + start / 8, 0xff, nbits / 8);
1145 + else
1146 + __bitmap_set(map, start, nbits);
1147 +@@ -370,8 +380,10 @@ static __always_inline void bitmap_clear(unsigned long *map, unsigned int start,
1148 + {
1149 + if (__builtin_constant_p(nbits) && nbits == 1)
1150 + __clear_bit(start, map);
1151 +- else if (__builtin_constant_p(start & 7) && IS_ALIGNED(start, 8) &&
1152 +- __builtin_constant_p(nbits & 7) && IS_ALIGNED(nbits, 8))
1153 ++ else if (__builtin_constant_p(start & BITMAP_MEM_MASK) &&
1154 ++ IS_ALIGNED(start, BITMAP_MEM_ALIGNMENT) &&
1155 ++ __builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
1156 ++ IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
1157 + memset((char *)map + start / 8, 0, nbits / 8);
1158 + else
1159 + __bitmap_clear(map, start, nbits);
1160 +diff --git a/include/linux/compat.h b/include/linux/compat.h
1161 +index 16c3027074a2..6970e7922c69 100644
1162 +--- a/include/linux/compat.h
1163 ++++ b/include/linux/compat.h
1164 +@@ -222,6 +222,8 @@ typedef struct compat_siginfo {
1165 + #ifdef __ARCH_SI_TRAPNO
1166 + int _trapno; /* TRAP # which caused the signal */
1167 + #endif
1168 ++#define __COMPAT_ADDR_BND_PKEY_PAD (__alignof__(compat_uptr_t) < sizeof(short) ? \
1169 ++ sizeof(short) : __alignof__(compat_uptr_t))
1170 + union {
1171 + /*
1172 + * used when si_code=BUS_MCEERR_AR or
1173 +@@ -230,13 +232,13 @@ typedef struct compat_siginfo {
1174 + short int _addr_lsb; /* Valid LSB of the reported address. */
1175 + /* used when si_code=SEGV_BNDERR */
1176 + struct {
1177 +- compat_uptr_t _dummy_bnd;
1178 ++ char _dummy_bnd[__COMPAT_ADDR_BND_PKEY_PAD];
1179 + compat_uptr_t _lower;
1180 + compat_uptr_t _upper;
1181 + } _addr_bnd;
1182 + /* used when si_code=SEGV_PKUERR */
1183 + struct {
1184 +- compat_uptr_t _dummy_pkey;
1185 ++ char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD];
1186 + u32 _pkey;
1187 + } _addr_pkey;
1188 + };
1189 +diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h
1190 +index 99c902e460c2..65d405770b95 100644
1191 +--- a/include/uapi/asm-generic/siginfo.h
1192 ++++ b/include/uapi/asm-generic/siginfo.h
1193 +@@ -94,6 +94,9 @@ typedef struct siginfo {
1194 + unsigned int _flags; /* see ia64 si_flags */
1195 + unsigned long _isr; /* isr */
1196 + #endif
1197 ++
1198 ++#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
1199 ++ sizeof(short) : __alignof__(void *))
1200 + union {
1201 + /*
1202 + * used when si_code=BUS_MCEERR_AR or
1203 +@@ -102,13 +105,13 @@ typedef struct siginfo {
1204 + short _addr_lsb; /* LSB of the reported address */
1205 + /* used when si_code=SEGV_BNDERR */
1206 + struct {
1207 +- void *_dummy_bnd;
1208 ++ char _dummy_bnd[__ADDR_BND_PKEY_PAD];
1209 + void __user *_lower;
1210 + void __user *_upper;
1211 + } _addr_bnd;
1212 + /* used when si_code=SEGV_PKUERR */
1213 + struct {
1214 +- void *_dummy_pkey;
1215 ++ char _dummy_pkey[__ADDR_BND_PKEY_PAD];
1216 + __u32 _pkey;
1217 + } _addr_pkey;
1218 + };
1219 +diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
1220 +index 1c8413f93e3d..dce5f9dae121 100644
1221 +--- a/include/uapi/linux/serial_core.h
1222 ++++ b/include/uapi/linux/serial_core.h
1223 +@@ -76,6 +76,9 @@
1224 + #define PORT_SUNZILOG 38
1225 + #define PORT_SUNSAB 39
1226 +
1227 ++/* Nuvoton UART */
1228 ++#define PORT_NPCM 40
1229 ++
1230 + /* Intel EG20 */
1231 + #define PORT_PCH_8LINE 44
1232 + #define PORT_PCH_2LINE 45