Magellan Linux

Annotation of /trunk/kernel-magellan/patches-4.16/0100-4.16.1-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


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