Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.12 commit in: /
Date: Thu, 07 Sep 2017 22:45:10
Message-Id: 1504824299.b3689468077d82446d7542c21032fc93b7d30202.mpagano@gentoo
1 commit: b3689468077d82446d7542c21032fc93b7d30202
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 7 22:44:59 2017 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 7 22:44:59 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b3689468
7
8 Linux patch 4.12.11
9
10 0000_README | 4 +
11 1010_linux-4.12.11.patch | 1009 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1013 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index a64a189..dd06605 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -83,6 +83,10 @@ Patch: 1009_linux-4.12.10.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.12.10
21
22 +Patch: 1010_linux-4.12.11.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.12.11
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/1010_linux-4.12.11.patch b/1010_linux-4.12.11.patch
31 new file mode 100644
32 index 0000000..b43b160
33 --- /dev/null
34 +++ b/1010_linux-4.12.11.patch
35 @@ -0,0 +1,1009 @@
36 +diff --git a/Makefile b/Makefile
37 +index 6889ec6a091d..e7b2b54b032c 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 12
43 +-SUBLEVEL = 10
44 ++SUBLEVEL = 11
45 + EXTRAVERSION =
46 + NAME = Fearless Coyote
47 +
48 +diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h
49 +index 4cb4b6d3452c..0bc66e1d3a7e 100644
50 +--- a/arch/alpha/include/asm/types.h
51 ++++ b/arch/alpha/include/asm/types.h
52 +@@ -1,6 +1,6 @@
53 + #ifndef _ALPHA_TYPES_H
54 + #define _ALPHA_TYPES_H
55 +
56 +-#include <asm-generic/int-ll64.h>
57 ++#include <uapi/asm/types.h>
58 +
59 + #endif /* _ALPHA_TYPES_H */
60 +diff --git a/arch/alpha/include/uapi/asm/types.h b/arch/alpha/include/uapi/asm/types.h
61 +index 9fd3cd459777..8d1024d7be05 100644
62 +--- a/arch/alpha/include/uapi/asm/types.h
63 ++++ b/arch/alpha/include/uapi/asm/types.h
64 +@@ -9,8 +9,18 @@
65 + * need to be careful to avoid a name clashes.
66 + */
67 +
68 +-#ifndef __KERNEL__
69 ++/*
70 ++ * This is here because we used to use l64 for alpha
71 ++ * and we don't want to impact user mode with our change to ll64
72 ++ * in the kernel.
73 ++ *
74 ++ * However, some user programs are fine with this. They can
75 ++ * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
76 ++ */
77 ++#if !defined(__SANE_USERSPACE_TYPES__) && !defined(__KERNEL__)
78 + #include <asm-generic/int-l64.h>
79 ++#else
80 ++#include <asm-generic/int-ll64.h>
81 + #endif
82 +
83 + #endif /* _UAPI_ALPHA_TYPES_H */
84 +diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
85 +index 37b95dff0b07..3952d5ef8a7a 100644
86 +--- a/arch/arm64/mm/fault.c
87 ++++ b/arch/arm64/mm/fault.c
88 +@@ -397,8 +397,11 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
89 + * signal first. We do not need to release the mmap_sem because it
90 + * would already be released in __lock_page_or_retry in mm/filemap.c.
91 + */
92 +- if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
93 ++ if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) {
94 ++ if (!user_mode(regs))
95 ++ goto no_context;
96 + return 0;
97 ++ }
98 +
99 + /*
100 + * Major/minor page fault accounting is only done on the initial
101 +diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
102 +index 7afb0e2f07f4..48febf07e828 100644
103 +--- a/arch/x86/include/asm/io.h
104 ++++ b/arch/x86/include/asm/io.h
105 +@@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \
106 + static inline void outs##bwl(int port, const void *addr, unsigned long count) \
107 + { \
108 + asm volatile("rep; outs" #bwl \
109 +- : "+S"(addr), "+c"(count) : "d"(port)); \
110 ++ : "+S"(addr), "+c"(count) : "d"(port) : "memory"); \
111 + } \
112 + \
113 + static inline void ins##bwl(int port, void *addr, unsigned long count) \
114 + { \
115 + asm volatile("rep; ins" #bwl \
116 +- : "+D"(addr), "+c"(count) : "d"(port)); \
117 ++ : "+D"(addr), "+c"(count) : "d"(port) : "memory"); \
118 + }
119 +
120 + BUILDIO(b, b, char)
121 +diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
122 +index 43839b00fe6c..903605dbc1a5 100644
123 +--- a/crypto/algif_skcipher.c
124 ++++ b/crypto/algif_skcipher.c
125 +@@ -87,8 +87,13 @@ static void skcipher_free_async_sgls(struct skcipher_async_req *sreq)
126 + }
127 + sgl = sreq->tsg;
128 + n = sg_nents(sgl);
129 +- for_each_sg(sgl, sg, n, i)
130 +- put_page(sg_page(sg));
131 ++ for_each_sg(sgl, sg, n, i) {
132 ++ struct page *page = sg_page(sg);
133 ++
134 ++ /* some SGs may not have a page mapped */
135 ++ if (page && page_ref_count(page))
136 ++ put_page(page);
137 ++ }
138 +
139 + kfree(sreq->tsg);
140 + }
141 +diff --git a/crypto/chacha20_generic.c b/crypto/chacha20_generic.c
142 +index 8b3c04d625c3..4a45fa4890c0 100644
143 +--- a/crypto/chacha20_generic.c
144 ++++ b/crypto/chacha20_generic.c
145 +@@ -91,9 +91,14 @@ int crypto_chacha20_crypt(struct skcipher_request *req)
146 + crypto_chacha20_init(state, ctx, walk.iv);
147 +
148 + while (walk.nbytes > 0) {
149 ++ unsigned int nbytes = walk.nbytes;
150 ++
151 ++ if (nbytes < walk.total)
152 ++ nbytes = round_down(nbytes, walk.stride);
153 ++
154 + chacha20_docrypt(state, walk.dst.virt.addr, walk.src.virt.addr,
155 +- walk.nbytes);
156 +- err = skcipher_walk_done(&walk, 0);
157 ++ nbytes);
158 ++ err = skcipher_walk_done(&walk, walk.nbytes - nbytes);
159 + }
160 +
161 + return err;
162 +diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
163 +index f802bcd94457..de30a822ccab 100644
164 +--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
165 ++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
166 +@@ -1155,8 +1155,6 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
167 + return -ENODEV;
168 + if (WARN_ON(msg->size > 16))
169 + return -E2BIG;
170 +- if (msg->size == 0)
171 +- return msg->size;
172 +
173 + ret = nvkm_i2c_aux_acquire(aux);
174 + if (ret)
175 +diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
176 +index 06e564a9ccb2..70ab2eee9b04 100644
177 +--- a/drivers/gpu/drm/nouveau/nv50_display.c
178 ++++ b/drivers/gpu/drm/nouveau/nv50_display.c
179 +@@ -3618,15 +3618,24 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
180 + drm_mode_connector_attach_encoder(connector, encoder);
181 +
182 + if (dcbe->type == DCB_OUTPUT_DP) {
183 ++ struct nv50_disp *disp = nv50_disp(encoder->dev);
184 + struct nvkm_i2c_aux *aux =
185 + nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
186 + if (aux) {
187 +- nv_encoder->i2c = &nv_connector->aux.ddc;
188 ++ if (disp->disp->oclass < GF110_DISP) {
189 ++ /* HW has no support for address-only
190 ++ * transactions, so we're required to
191 ++ * use custom I2C-over-AUX code.
192 ++ */
193 ++ nv_encoder->i2c = &aux->i2c;
194 ++ } else {
195 ++ nv_encoder->i2c = &nv_connector->aux.ddc;
196 ++ }
197 + nv_encoder->aux = aux;
198 + }
199 +
200 + /*TODO: Use DP Info Table to check for support. */
201 +- if (nv50_disp(encoder->dev)->disp->oclass >= GF110_DISP) {
202 ++ if (disp->disp->oclass >= GF110_DISP) {
203 + ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
204 + nv_connector->base.base.id,
205 + &nv_encoder->dp.mstm);
206 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
207 +index 48f01e40b8fc..b768e66a472b 100644
208 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
209 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
210 +@@ -25,6 +25,7 @@ nvkm-y += nvkm/subdev/i2c/bit.o
211 +
212 + nvkm-y += nvkm/subdev/i2c/aux.o
213 + nvkm-y += nvkm/subdev/i2c/auxg94.o
214 ++nvkm-y += nvkm/subdev/i2c/auxgf119.o
215 + nvkm-y += nvkm/subdev/i2c/auxgm200.o
216 +
217 + nvkm-y += nvkm/subdev/i2c/anx9805.o
218 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
219 +index d172e42dd228..4c1f547da463 100644
220 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
221 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
222 +@@ -117,6 +117,10 @@ int
223 + nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type,
224 + u32 addr, u8 *data, u8 *size)
225 + {
226 ++ if (!*size && !aux->func->address_only) {
227 ++ AUX_ERR(aux, "address-only transaction dropped");
228 ++ return -ENOSYS;
229 ++ }
230 + return aux->func->xfer(aux, retry, type, addr, data, size);
231 + }
232 +
233 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
234 +index 27a4a39c87f0..9587ab456d9e 100644
235 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
236 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
237 +@@ -3,6 +3,7 @@
238 + #include "pad.h"
239 +
240 + struct nvkm_i2c_aux_func {
241 ++ bool address_only;
242 + int (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
243 + u32 addr, u8 *data, u8 *size);
244 + int (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw,
245 +@@ -17,7 +18,12 @@ void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
246 + int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
247 + u32 addr, u8 *data, u8 *size);
248 +
249 ++int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
250 ++ int, u8, struct nvkm_i2c_aux **);
251 ++
252 + int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
253 ++int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *);
254 ++int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
255 + int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
256 +
257 + #define AUX_MSG(b,l,f,a...) do { \
258 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
259 +index ab8cb196c34e..c8ab1b5741a3 100644
260 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
261 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
262 +@@ -72,7 +72,7 @@ g94_i2c_aux_init(struct g94_i2c_aux *aux)
263 + return 0;
264 + }
265 +
266 +-static int
267 ++int
268 + g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
269 + u8 type, u32 addr, u8 *data, u8 *size)
270 + {
271 +@@ -105,9 +105,9 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
272 + }
273 +
274 + ctrl = nvkm_rd32(device, 0x00e4e4 + base);
275 +- ctrl &= ~0x0001f0ff;
276 ++ ctrl &= ~0x0001f1ff;
277 + ctrl |= type << 12;
278 +- ctrl |= *size - 1;
279 ++ ctrl |= (*size ? (*size - 1) : 0x00000100);
280 + nvkm_wr32(device, 0x00e4e0 + base, addr);
281 +
282 + /* (maybe) retry transaction a number of times on failure... */
283 +@@ -160,14 +160,10 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
284 + return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
285 + }
286 +
287 +-static const struct nvkm_i2c_aux_func
288 +-g94_i2c_aux_func = {
289 +- .xfer = g94_i2c_aux_xfer,
290 +-};
291 +-
292 + int
293 +-g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
294 +- struct nvkm_i2c_aux **paux)
295 ++g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *func,
296 ++ struct nvkm_i2c_pad *pad, int index, u8 drive,
297 ++ struct nvkm_i2c_aux **paux)
298 + {
299 + struct g94_i2c_aux *aux;
300 +
301 +@@ -175,8 +171,20 @@ g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
302 + return -ENOMEM;
303 + *paux = &aux->base;
304 +
305 +- nvkm_i2c_aux_ctor(&g94_i2c_aux_func, pad, index, &aux->base);
306 ++ nvkm_i2c_aux_ctor(func, pad, index, &aux->base);
307 + aux->ch = drive;
308 + aux->base.intr = 1 << aux->ch;
309 + return 0;
310 + }
311 ++
312 ++static const struct nvkm_i2c_aux_func
313 ++g94_i2c_aux = {
314 ++ .xfer = g94_i2c_aux_xfer,
315 ++};
316 ++
317 ++int
318 ++g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
319 ++ struct nvkm_i2c_aux **paux)
320 ++{
321 ++ return g94_i2c_aux_new_(&g94_i2c_aux, pad, index, drive, paux);
322 ++}
323 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c
324 +new file mode 100644
325 +index 000000000000..dab40cd8fe3a
326 +--- /dev/null
327 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c
328 +@@ -0,0 +1,35 @@
329 ++/*
330 ++ * Copyright 2017 Red Hat Inc.
331 ++ *
332 ++ * Permission is hereby granted, free of charge, to any person obtaining a
333 ++ * copy of this software and associated documentation files (the "Software"),
334 ++ * to deal in the Software without restriction, including without limitation
335 ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
336 ++ * and/or sell copies of the Software, and to permit persons to whom the
337 ++ * Software is furnished to do so, subject to the following conditions:
338 ++ *
339 ++ * The above copyright notice and this permission notice shall be included in
340 ++ * all copies or substantial portions of the Software.
341 ++ *
342 ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
343 ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
344 ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
345 ++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
346 ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
347 ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
348 ++ * OTHER DEALINGS IN THE SOFTWARE.
349 ++ */
350 ++#include "aux.h"
351 ++
352 ++static const struct nvkm_i2c_aux_func
353 ++gf119_i2c_aux = {
354 ++ .address_only = true,
355 ++ .xfer = g94_i2c_aux_xfer,
356 ++};
357 ++
358 ++int
359 ++gf119_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
360 ++ struct nvkm_i2c_aux **paux)
361 ++{
362 ++ return g94_i2c_aux_new_(&gf119_i2c_aux, pad, index, drive, paux);
363 ++}
364 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
365 +index ee091fa79628..7ef60895f43a 100644
366 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
367 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
368 +@@ -105,9 +105,9 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
369 + }
370 +
371 + ctrl = nvkm_rd32(device, 0x00d954 + base);
372 +- ctrl &= ~0x0001f0ff;
373 ++ ctrl &= ~0x0001f1ff;
374 + ctrl |= type << 12;
375 +- ctrl |= *size - 1;
376 ++ ctrl |= (*size ? (*size - 1) : 0x00000100);
377 + nvkm_wr32(device, 0x00d950 + base, addr);
378 +
379 + /* (maybe) retry transaction a number of times on failure... */
380 +@@ -162,6 +162,7 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
381 +
382 + static const struct nvkm_i2c_aux_func
383 + gm200_i2c_aux_func = {
384 ++ .address_only = true,
385 + .xfer = gm200_i2c_aux_xfer,
386 + };
387 +
388 +diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
389 +index d53212f1aa52..3bc4d0310076 100644
390 +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
391 ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
392 +@@ -28,7 +28,7 @@
393 + static const struct nvkm_i2c_pad_func
394 + gf119_i2c_pad_s_func = {
395 + .bus_new_4 = gf119_i2c_bus_new,
396 +- .aux_new_6 = g94_i2c_aux_new,
397 ++ .aux_new_6 = gf119_i2c_aux_new,
398 + .mode = g94_i2c_pad_mode,
399 + };
400 +
401 +@@ -41,7 +41,7 @@ gf119_i2c_pad_s_new(struct nvkm_i2c *i2c, int id, struct nvkm_i2c_pad **ppad)
402 + static const struct nvkm_i2c_pad_func
403 + gf119_i2c_pad_x_func = {
404 + .bus_new_4 = gf119_i2c_bus_new,
405 +- .aux_new_6 = g94_i2c_aux_new,
406 ++ .aux_new_6 = gf119_i2c_aux_new,
407 + };
408 +
409 + int
410 +diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
411 +index eeddc1e48409..871599826773 100644
412 +--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
413 ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
414 +@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
415 + } else {
416 + pr_err("Failed to fill pool (%p)\n", pool);
417 + /* If we have any pages left put them to the pool. */
418 +- list_for_each_entry(p, &pool->list, lru) {
419 ++ list_for_each_entry(p, &new_pages, lru) {
420 + ++cpages;
421 + }
422 + list_splice(&new_pages, &pool->list);
423 +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
424 +index f8a977f86ec7..a17478028649 100644
425 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
426 ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
427 +@@ -1567,10 +1567,34 @@ vmw_kms_atomic_check_modeset(struct drm_device *dev,
428 + }
429 +
430 +
431 ++/**
432 ++ * vmw_kms_atomic_commit - Perform an atomic state commit
433 ++ *
434 ++ * @dev: DRM device
435 ++ * @state: the driver state object
436 ++ * @nonblock: Whether nonblocking behaviour is requested
437 ++ *
438 ++ * This is a simple wrapper around drm_atomic_helper_commit() for
439 ++ * us to clear the nonblocking value.
440 ++ *
441 ++ * Nonblocking commits currently cause synchronization issues
442 ++ * for vmwgfx.
443 ++ *
444 ++ * RETURNS
445 ++ * Zero for success or negative error code on failure.
446 ++ */
447 ++int vmw_kms_atomic_commit(struct drm_device *dev,
448 ++ struct drm_atomic_state *state,
449 ++ bool nonblock)
450 ++{
451 ++ return drm_atomic_helper_commit(dev, state, false);
452 ++}
453 ++
454 ++
455 + static const struct drm_mode_config_funcs vmw_kms_funcs = {
456 + .fb_create = vmw_kms_fb_create,
457 + .atomic_check = vmw_kms_atomic_check_modeset,
458 +- .atomic_commit = drm_atomic_helper_commit,
459 ++ .atomic_commit = vmw_kms_atomic_commit,
460 + };
461 +
462 + static int vmw_kms_generic_present(struct vmw_private *dev_priv,
463 +diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
464 +index e98e44e584a4..22ffcb73c185 100644
465 +--- a/drivers/i2c/busses/i2c-ismt.c
466 ++++ b/drivers/i2c/busses/i2c-ismt.c
467 +@@ -341,8 +341,10 @@ static int ismt_process_desc(const struct ismt_desc *desc,
468 + break;
469 + case I2C_SMBUS_BLOCK_DATA:
470 + case I2C_SMBUS_I2C_BLOCK_DATA:
471 +- memcpy(&data->block[1], dma_buffer, desc->rxbytes);
472 +- data->block[0] = desc->rxbytes;
473 ++ if (desc->rxbytes != dma_buffer[0] + 1)
474 ++ return -EMSGSIZE;
475 ++
476 ++ memcpy(data->block, dma_buffer, desc->rxbytes);
477 + break;
478 + }
479 + return 0;
480 +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
481 +index def96cd2479b..68894f7ccb54 100644
482 +--- a/drivers/input/joystick/xpad.c
483 ++++ b/drivers/input/joystick/xpad.c
484 +@@ -389,10 +389,21 @@ static const u8 xboxone_hori_init[] = {
485 + };
486 +
487 + /*
488 +- * A rumble packet is required for some PowerA pads to start
489 ++ * A specific rumble packet is required for some PowerA pads to start
490 + * sending input reports. One of those pads is (0x24c6:0x543a).
491 + */
492 +-static const u8 xboxone_zerorumble_init[] = {
493 ++static const u8 xboxone_rumblebegin_init[] = {
494 ++ 0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
495 ++ 0x1D, 0x1D, 0xFF, 0x00, 0x00
496 ++};
497 ++
498 ++/*
499 ++ * A rumble packet with zero FF intensity will immediately
500 ++ * terminate the rumbling required to init PowerA pads.
501 ++ * This should happen fast enough that the motors don't
502 ++ * spin up to enough speed to actually vibrate the gamepad.
503 ++ */
504 ++static const u8 xboxone_rumbleend_init[] = {
505 + 0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00,
506 + 0x00, 0x00, 0x00, 0x00, 0x00
507 + };
508 +@@ -407,9 +418,12 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
509 + XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
510 + XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
511 + XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
512 +- XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_zerorumble_init),
513 +- XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_zerorumble_init),
514 +- XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_zerorumble_init),
515 ++ XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
516 ++ XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
517 ++ XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
518 ++ XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumbleend_init),
519 ++ XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumbleend_init),
520 ++ XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumbleend_init),
521 + };
522 +
523 + struct xpad_output_packet {
524 +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
525 +index 16c30460ef04..5af0b7d200bc 100644
526 +--- a/drivers/input/mouse/synaptics.c
527 ++++ b/drivers/input/mouse/synaptics.c
528 +@@ -535,16 +535,17 @@ static void synaptics_apply_quirks(struct psmouse *psmouse,
529 + }
530 + }
531 +
532 ++static bool synaptics_has_agm(struct synaptics_data *priv)
533 ++{
534 ++ return (SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
535 ++ SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c));
536 ++}
537 ++
538 + static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
539 + {
540 + static u8 param = 0xc8;
541 +- struct synaptics_data *priv = psmouse->private;
542 + int error;
543 +
544 +- if (!(SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
545 +- SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)))
546 +- return 0;
547 +-
548 + error = psmouse_sliced_command(psmouse, SYN_QUE_MODEL);
549 + if (error)
550 + return error;
551 +@@ -553,9 +554,6 @@ static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
552 + if (error)
553 + return error;
554 +
555 +- /* Advanced gesture mode also sends multi finger data */
556 +- priv->info.capabilities |= BIT(1);
557 +-
558 + return 0;
559 + }
560 +
561 +@@ -578,7 +576,7 @@ static int synaptics_set_mode(struct psmouse *psmouse)
562 + if (error)
563 + return error;
564 +
565 +- if (priv->absolute_mode) {
566 ++ if (priv->absolute_mode && synaptics_has_agm(priv)) {
567 + error = synaptics_set_advanced_gesture_mode(psmouse);
568 + if (error) {
569 + psmouse_err(psmouse,
570 +@@ -766,9 +764,7 @@ static int synaptics_parse_hw_state(const u8 buf[],
571 + ((buf[0] & 0x04) >> 1) |
572 + ((buf[3] & 0x04) >> 2));
573 +
574 +- if ((SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) ||
575 +- SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)) &&
576 +- hw->w == 2) {
577 ++ if (synaptics_has_agm(priv) && hw->w == 2) {
578 + synaptics_parse_agm(buf, priv, hw);
579 + return 1;
580 + }
581 +@@ -1033,6 +1029,15 @@ static void synaptics_image_sensor_process(struct psmouse *psmouse,
582 + synaptics_report_mt_data(psmouse, sgm, num_fingers);
583 + }
584 +
585 ++static bool synaptics_has_multifinger(struct synaptics_data *priv)
586 ++{
587 ++ if (SYN_CAP_MULTIFINGER(priv->info.capabilities))
588 ++ return true;
589 ++
590 ++ /* Advanced gesture mode also sends multi finger data */
591 ++ return synaptics_has_agm(priv);
592 ++}
593 ++
594 + /*
595 + * called for each full received packet from the touchpad
596 + */
597 +@@ -1079,7 +1084,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
598 + if (SYN_CAP_EXTENDED(info->capabilities)) {
599 + switch (hw.w) {
600 + case 0 ... 1:
601 +- if (SYN_CAP_MULTIFINGER(info->capabilities))
602 ++ if (synaptics_has_multifinger(priv))
603 + num_fingers = hw.w + 2;
604 + break;
605 + case 2:
606 +@@ -1123,7 +1128,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
607 + input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
608 +
609 + input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
610 +- if (SYN_CAP_MULTIFINGER(info->capabilities)) {
611 ++ if (synaptics_has_multifinger(priv)) {
612 + input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
613 + input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
614 + }
615 +@@ -1283,7 +1288,7 @@ static void set_input_params(struct psmouse *psmouse,
616 + __set_bit(BTN_TOUCH, dev->keybit);
617 + __set_bit(BTN_TOOL_FINGER, dev->keybit);
618 +
619 +- if (SYN_CAP_MULTIFINGER(info->capabilities)) {
620 ++ if (synaptics_has_multifinger(priv)) {
621 + __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
622 + __set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
623 + }
624 +diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
625 +index 929f8558bf1c..90e74f9f5f9c 100644
626 +--- a/drivers/irqchip/irq-mips-gic.c
627 ++++ b/drivers/irqchip/irq-mips-gic.c
628 +@@ -1022,8 +1022,11 @@ static int __init gic_of_init(struct device_node *node,
629 + gic_len = resource_size(&res);
630 + }
631 +
632 +- if (mips_cm_present())
633 ++ if (mips_cm_present()) {
634 + write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK);
635 ++ /* Ensure GIC region is enabled before trying to access it */
636 ++ __sync();
637 ++ }
638 + gic_present = true;
639 +
640 + __gic_init(gic_base, gic_len, cpu_vec, 0, node);
641 +diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
642 +index 3df056b73b66..fa0df4a3e1be 100644
643 +--- a/drivers/md/dm-mpath.c
644 ++++ b/drivers/md/dm-mpath.c
645 +@@ -504,7 +504,6 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq,
646 + if (queue_dying) {
647 + atomic_inc(&m->pg_init_in_progress);
648 + activate_or_offline_path(pgpath);
649 +- return DM_MAPIO_REQUEUE;
650 + }
651 + return DM_MAPIO_DELAY_REQUEUE;
652 + }
653 +diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
654 +index bc1781bb070b..c580af05b033 100644
655 +--- a/drivers/mmc/host/sdhci-xenon.c
656 ++++ b/drivers/mmc/host/sdhci-xenon.c
657 +@@ -210,8 +210,27 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
658 + sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
659 + }
660 +
661 ++static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
662 ++ unsigned short vdd)
663 ++{
664 ++ struct mmc_host *mmc = host->mmc;
665 ++ u8 pwr = host->pwr;
666 ++
667 ++ sdhci_set_power_noreg(host, mode, vdd);
668 ++
669 ++ if (host->pwr == pwr)
670 ++ return;
671 ++
672 ++ if (host->pwr == 0)
673 ++ vdd = 0;
674 ++
675 ++ if (!IS_ERR(mmc->supply.vmmc))
676 ++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
677 ++}
678 ++
679 + static const struct sdhci_ops sdhci_xenon_ops = {
680 + .set_clock = sdhci_set_clock,
681 ++ .set_power = xenon_set_power,
682 + .set_bus_width = sdhci_set_bus_width,
683 + .reset = xenon_reset,
684 + .set_uhs_signaling = xenon_set_uhs_signaling,
685 +diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
686 +index bbf7604889b7..1c539c83e8cf 100644
687 +--- a/drivers/net/wireless/ti/wl1251/main.c
688 ++++ b/drivers/net/wireless/ti/wl1251/main.c
689 +@@ -1571,6 +1571,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
690 +
691 + wl->state = WL1251_STATE_OFF;
692 + mutex_init(&wl->mutex);
693 ++ spin_lock_init(&wl->wl_lock);
694 +
695 + wl->tx_mgmt_frm_rate = DEFAULT_HW_GEN_TX_RATE;
696 + wl->tx_mgmt_frm_mod = DEFAULT_HW_GEN_MODULATION_TYPE;
697 +diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
698 +index 1e71e6ca5ddf..8e03c9ae0bf0 100644
699 +--- a/fs/ceph/addr.c
700 ++++ b/fs/ceph/addr.c
701 +@@ -189,7 +189,7 @@ static int ceph_releasepage(struct page *page, gfp_t g)
702 + /*
703 + * read a single page, without unlocking it.
704 + */
705 +-static int readpage_nounlock(struct file *filp, struct page *page)
706 ++static int ceph_do_readpage(struct file *filp, struct page *page)
707 + {
708 + struct inode *inode = file_inode(filp);
709 + struct ceph_inode_info *ci = ceph_inode(inode);
710 +@@ -219,7 +219,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
711 +
712 + err = ceph_readpage_from_fscache(inode, page);
713 + if (err == 0)
714 +- goto out;
715 ++ return -EINPROGRESS;
716 +
717 + dout("readpage inode %p file %p page %p index %lu\n",
718 + inode, filp, page, page->index);
719 +@@ -249,8 +249,11 @@ static int readpage_nounlock(struct file *filp, struct page *page)
720 +
721 + static int ceph_readpage(struct file *filp, struct page *page)
722 + {
723 +- int r = readpage_nounlock(filp, page);
724 +- unlock_page(page);
725 ++ int r = ceph_do_readpage(filp, page);
726 ++ if (r != -EINPROGRESS)
727 ++ unlock_page(page);
728 ++ else
729 ++ r = 0;
730 + return r;
731 + }
732 +
733 +@@ -1240,7 +1243,7 @@ static int ceph_update_writeable_page(struct file *file,
734 + goto retry_locked;
735 + r = writepage_nounlock(page, NULL);
736 + if (r < 0)
737 +- goto fail_nosnap;
738 ++ goto fail_unlock;
739 + goto retry_locked;
740 + }
741 +
742 +@@ -1268,11 +1271,14 @@ static int ceph_update_writeable_page(struct file *file,
743 + }
744 +
745 + /* we need to read it. */
746 +- r = readpage_nounlock(file, page);
747 +- if (r < 0)
748 +- goto fail_nosnap;
749 ++ r = ceph_do_readpage(file, page);
750 ++ if (r < 0) {
751 ++ if (r == -EINPROGRESS)
752 ++ return -EAGAIN;
753 ++ goto fail_unlock;
754 ++ }
755 + goto retry_locked;
756 +-fail_nosnap:
757 ++fail_unlock:
758 + unlock_page(page);
759 + return r;
760 + }
761 +diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c
762 +index 4e7421caf380..bf56392ecec2 100644
763 +--- a/fs/ceph/cache.c
764 ++++ b/fs/ceph/cache.c
765 +@@ -240,13 +240,7 @@ void ceph_fscache_file_set_cookie(struct inode *inode, struct file *filp)
766 + }
767 + }
768 +
769 +-static void ceph_vfs_readpage_complete(struct page *page, void *data, int error)
770 +-{
771 +- if (!error)
772 +- SetPageUptodate(page);
773 +-}
774 +-
775 +-static void ceph_vfs_readpage_complete_unlock(struct page *page, void *data, int error)
776 ++static void ceph_readpage_from_fscache_complete(struct page *page, void *data, int error)
777 + {
778 + if (!error)
779 + SetPageUptodate(page);
780 +@@ -274,7 +268,7 @@ int ceph_readpage_from_fscache(struct inode *inode, struct page *page)
781 + return -ENOBUFS;
782 +
783 + ret = fscache_read_or_alloc_page(ci->fscache, page,
784 +- ceph_vfs_readpage_complete, NULL,
785 ++ ceph_readpage_from_fscache_complete, NULL,
786 + GFP_KERNEL);
787 +
788 + switch (ret) {
789 +@@ -303,7 +297,7 @@ int ceph_readpages_from_fscache(struct inode *inode,
790 + return -ENOBUFS;
791 +
792 + ret = fscache_read_or_alloc_pages(ci->fscache, mapping, pages, nr_pages,
793 +- ceph_vfs_readpage_complete_unlock,
794 ++ ceph_readpage_from_fscache_complete,
795 + NULL, mapping_gfp_mask(mapping));
796 +
797 + switch (ret) {
798 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
799 +index 569d3fb736be..e702d48bd023 100644
800 +--- a/fs/cifs/dir.c
801 ++++ b/fs/cifs/dir.c
802 +@@ -205,7 +205,7 @@ check_name(struct dentry *direntry, struct cifs_tcon *tcon)
803 + int i;
804 +
805 + if (unlikely(direntry->d_name.len >
806 +- tcon->fsAttrInfo.MaxPathNameComponentLength))
807 ++ le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength)))
808 + return -ENAMETOOLONG;
809 +
810 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
811 +diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
812 +index 18700fd25a0b..2826882c81d1 100644
813 +--- a/fs/cifs/smb2pdu.h
814 ++++ b/fs/cifs/smb2pdu.h
815 +@@ -84,8 +84,8 @@
816 +
817 + #define NUMBER_OF_SMB2_COMMANDS 0x0013
818 +
819 +-/* BB FIXME - analyze following length BB */
820 +-#define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */
821 ++/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
822 ++#define MAX_SMB2_HDR_SIZE 0x00b0
823 +
824 + #define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe)
825 + #define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd)
826 +diff --git a/fs/eventpoll.c b/fs/eventpoll.c
827 +index 5420767c9b68..2ca248425e5d 100644
828 +--- a/fs/eventpoll.c
829 ++++ b/fs/eventpoll.c
830 +@@ -600,8 +600,13 @@ static void ep_remove_wait_queue(struct eppoll_entry *pwq)
831 + wait_queue_head_t *whead;
832 +
833 + rcu_read_lock();
834 +- /* If it is cleared by POLLFREE, it should be rcu-safe */
835 +- whead = rcu_dereference(pwq->whead);
836 ++ /*
837 ++ * If it is cleared by POLLFREE, it should be rcu-safe.
838 ++ * If we read NULL we need a barrier paired with
839 ++ * smp_store_release() in ep_poll_callback(), otherwise
840 ++ * we rely on whead->lock.
841 ++ */
842 ++ whead = smp_load_acquire(&pwq->whead);
843 + if (whead)
844 + remove_wait_queue(whead, &pwq->wait);
845 + rcu_read_unlock();
846 +@@ -1086,17 +1091,6 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
847 + struct eventpoll *ep = epi->ep;
848 + int ewake = 0;
849 +
850 +- if ((unsigned long)key & POLLFREE) {
851 +- ep_pwq_from_wait(wait)->whead = NULL;
852 +- /*
853 +- * whead = NULL above can race with ep_remove_wait_queue()
854 +- * which can do another remove_wait_queue() after us, so we
855 +- * can't use __remove_wait_queue(). whead->lock is held by
856 +- * the caller.
857 +- */
858 +- list_del_init(&wait->task_list);
859 +- }
860 +-
861 + spin_lock_irqsave(&ep->lock, flags);
862 +
863 + ep_set_busy_poll_napi_id(epi);
864 +@@ -1180,10 +1174,26 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
865 + if (pwake)
866 + ep_poll_safewake(&ep->poll_wait);
867 +
868 +- if (epi->event.events & EPOLLEXCLUSIVE)
869 +- return ewake;
870 ++ if (!(epi->event.events & EPOLLEXCLUSIVE))
871 ++ ewake = 1;
872 ++
873 ++ if ((unsigned long)key & POLLFREE) {
874 ++ /*
875 ++ * If we race with ep_remove_wait_queue() it can miss
876 ++ * ->whead = NULL and do another remove_wait_queue() after
877 ++ * us, so we can't use __remove_wait_queue().
878 ++ */
879 ++ list_del_init(&wait->task_list);
880 ++ /*
881 ++ * ->whead != NULL protects us from the race with ep_free()
882 ++ * or ep_remove(), ep_remove_wait_queue() takes whead->lock
883 ++ * held by the caller. Once we nullify it, nothing protects
884 ++ * ep/epi or even wait.
885 ++ */
886 ++ smp_store_release(&ep_pwq_from_wait(wait)->whead, NULL);
887 ++ }
888 +
889 +- return 1;
890 ++ return ewake;
891 + }
892 +
893 + /*
894 +diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
895 +index fc824e2828f3..5d2add1a6c96 100644
896 +--- a/include/asm-generic/topology.h
897 ++++ b/include/asm-generic/topology.h
898 +@@ -48,7 +48,11 @@
899 + #define parent_node(node) ((void)(node),0)
900 + #endif
901 + #ifndef cpumask_of_node
902 +-#define cpumask_of_node(node) ((void)node, cpu_online_mask)
903 ++ #ifdef CONFIG_NEED_MULTIPLE_NODES
904 ++ #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)
905 ++ #else
906 ++ #define cpumask_of_node(node) ((void)node, cpu_online_mask)
907 ++ #endif
908 + #endif
909 + #ifndef pcibus_to_node
910 + #define pcibus_to_node(bus) ((void)(bus), -1)
911 +diff --git a/include/linux/nvme.h b/include/linux/nvme.h
912 +index b625bacf37ef..f4f9481a0c8a 100644
913 +--- a/include/linux/nvme.h
914 ++++ b/include/linux/nvme.h
915 +@@ -245,7 +245,7 @@ enum {
916 + NVME_CTRL_ONCS_WRITE_ZEROES = 1 << 3,
917 + NVME_CTRL_VWC_PRESENT = 1 << 0,
918 + NVME_CTRL_OACS_SEC_SUPP = 1 << 0,
919 +- NVME_CTRL_OACS_DBBUF_SUPP = 1 << 7,
920 ++ NVME_CTRL_OACS_DBBUF_SUPP = 1 << 8,
921 + };
922 +
923 + struct nvme_lbaf {
924 +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
925 +index 8f26927f16a1..0e2fe5eb6c30 100644
926 +--- a/kernel/cgroup/cpuset.c
927 ++++ b/kernel/cgroup/cpuset.c
928 +@@ -1907,6 +1907,7 @@ static struct cftype files[] = {
929 + {
930 + .name = "memory_pressure",
931 + .read_u64 = cpuset_read_u64,
932 ++ .private = FILE_MEMORY_PRESSURE,
933 + },
934 +
935 + {
936 +diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
937 +index 0e137f98a50c..267f6ef91d97 100644
938 +--- a/kernel/events/uprobes.c
939 ++++ b/kernel/events/uprobes.c
940 +@@ -1262,8 +1262,6 @@ void uprobe_end_dup_mmap(void)
941 +
942 + void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
943 + {
944 +- newmm->uprobes_state.xol_area = NULL;
945 +-
946 + if (test_bit(MMF_HAS_UPROBES, &oldmm->flags)) {
947 + set_bit(MMF_HAS_UPROBES, &newmm->flags);
948 + /* unconditionally, dup_mmap() skips VM_DONTCOPY vmas */
949 +diff --git a/kernel/fork.c b/kernel/fork.c
950 +index 9a2b4b4f13b4..31d2b97a792d 100644
951 +--- a/kernel/fork.c
952 ++++ b/kernel/fork.c
953 +@@ -781,6 +781,13 @@ static void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
954 + #endif
955 + }
956 +
957 ++static void mm_init_uprobes_state(struct mm_struct *mm)
958 ++{
959 ++#ifdef CONFIG_UPROBES
960 ++ mm->uprobes_state.xol_area = NULL;
961 ++#endif
962 ++}
963 ++
964 + static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
965 + struct user_namespace *user_ns)
966 + {
967 +@@ -808,6 +815,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
968 + #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
969 + mm->pmd_huge_pte = NULL;
970 + #endif
971 ++ mm_init_uprobes_state(mm);
972 +
973 + if (current->mm) {
974 + mm->flags = current->mm->flags & MMF_INIT_MASK;
975 +diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
976 +index 5a0f75a3bf01..eead4b339466 100644
977 +--- a/lib/mpi/mpicoder.c
978 ++++ b/lib/mpi/mpicoder.c
979 +@@ -364,11 +364,11 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
980 + }
981 +
982 + miter.consumed = lzeros;
983 +- sg_miter_stop(&miter);
984 +
985 + nbytes -= lzeros;
986 + nbits = nbytes * 8;
987 + if (nbits > MAX_EXTERN_MPI_BITS) {
988 ++ sg_miter_stop(&miter);
989 + pr_info("MPI: mpi too large (%u bits)\n", nbits);
990 + return NULL;
991 + }
992 +@@ -376,6 +376,8 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
993 + if (nbytes > 0)
994 + nbits -= count_leading_zeros(*buff) - (BITS_PER_LONG - 8);
995 +
996 ++ sg_miter_stop(&miter);
997 ++
998 + nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
999 + val = mpi_alloc(nlimbs);
1000 + if (!val)
1001 +diff --git a/mm/madvise.c b/mm/madvise.c
1002 +index fc6bfbe19a16..738066502ffa 100644
1003 +--- a/mm/madvise.c
1004 ++++ b/mm/madvise.c
1005 +@@ -610,6 +610,7 @@ static int madvise_inject_error(int behavior,
1006 + unsigned long start, unsigned long end)
1007 + {
1008 + struct page *page;
1009 ++ struct zone *zone;
1010 +
1011 + if (!capable(CAP_SYS_ADMIN))
1012 + return -EPERM;
1013 +@@ -643,6 +644,11 @@ static int madvise_inject_error(int behavior,
1014 + if (ret)
1015 + return ret;
1016 + }
1017 ++
1018 ++ /* Ensure that all poisoned pages are removed from per-cpu lists */
1019 ++ for_each_populated_zone(zone)
1020 ++ drain_all_pages(zone);
1021 ++
1022 + return 0;
1023 + }
1024 + #endif
1025 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
1026 +index 643a18f72032..4ba6513e21fc 100644
1027 +--- a/net/xfrm/xfrm_policy.c
1028 ++++ b/net/xfrm/xfrm_policy.c
1029 +@@ -3301,9 +3301,15 @@ int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1030 + struct xfrm_state *x_new[XFRM_MAX_DEPTH];
1031 + struct xfrm_migrate *mp;
1032 +
1033 ++ /* Stage 0 - sanity checks */
1034 + if ((err = xfrm_migrate_check(m, num_migrate)) < 0)
1035 + goto out;
1036 +
1037 ++ if (dir >= XFRM_POLICY_MAX) {
1038 ++ err = -EINVAL;
1039 ++ goto out;
1040 ++ }
1041 ++
1042 + /* Stage 1 - find policy */
1043 + if ((pol = xfrm_migrate_policy_find(sel, dir, type, net)) == NULL) {
1044 + err = -ENOENT;