Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Sun, 26 Sep 2021 14:14:00
Message-Id: 1632665626.639a49e4ef9f0716154d7524de784a0c0e055f41.mpagano@gentoo
1 commit: 639a49e4ef9f0716154d7524de784a0c0e055f41
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 26 14:13:46 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 26 14:13:46 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=639a49e4
7
8 Linux patch 4.19.208
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1207_linux-4.19.208.patch | 855 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 859 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 6a76482..e4a501b 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -867,6 +867,10 @@ Patch: 1206_linux-4.19.207.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.207
23
24 +Patch: 1207_linux-4.19.208.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.208
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1207_linux-4.19.208.patch b/1207_linux-4.19.208.patch
33 new file mode 100644
34 index 0000000..fa55a73
35 --- /dev/null
36 +++ b/1207_linux-4.19.208.patch
37 @@ -0,0 +1,855 @@
38 +diff --git a/Makefile b/Makefile
39 +index 77dd62aa0bbe5..a4c2526409831 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 207
47 ++SUBLEVEL = 208
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c
52 +index 0bf0a835122f8..d17414cbb89a8 100644
53 +--- a/arch/arm64/kernel/cacheinfo.c
54 ++++ b/arch/arm64/kernel/cacheinfo.c
55 +@@ -45,7 +45,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
56 + this_leaf->type = type;
57 + }
58 +
59 +-static int __init_cache_level(unsigned int cpu)
60 ++int init_cache_level(unsigned int cpu)
61 + {
62 + unsigned int ctype, level, leaves, fw_level;
63 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
64 +@@ -80,7 +80,7 @@ static int __init_cache_level(unsigned int cpu)
65 + return 0;
66 + }
67 +
68 +-static int __populate_cache_leaves(unsigned int cpu)
69 ++int populate_cache_leaves(unsigned int cpu)
70 + {
71 + unsigned int level, idx;
72 + enum cache_type type;
73 +@@ -99,6 +99,3 @@ static int __populate_cache_leaves(unsigned int cpu)
74 + }
75 + return 0;
76 + }
77 +-
78 +-DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
79 +-DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
80 +diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
81 +index 3ea95568ece49..1c19a06983089 100644
82 +--- a/arch/mips/kernel/cacheinfo.c
83 ++++ b/arch/mips/kernel/cacheinfo.c
84 +@@ -28,7 +28,7 @@ do { \
85 + leaf++; \
86 + } while (0)
87 +
88 +-static int __init_cache_level(unsigned int cpu)
89 ++int init_cache_level(unsigned int cpu)
90 + {
91 + struct cpuinfo_mips *c = &current_cpu_data;
92 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
93 +@@ -80,7 +80,7 @@ static void fill_cpumask_cluster(int cpu, cpumask_t *cpu_map)
94 + cpumask_set_cpu(cpu1, cpu_map);
95 + }
96 +
97 +-static int __populate_cache_leaves(unsigned int cpu)
98 ++int populate_cache_leaves(unsigned int cpu)
99 + {
100 + struct cpuinfo_mips *c = &current_cpu_data;
101 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
102 +@@ -109,6 +109,3 @@ static int __populate_cache_leaves(unsigned int cpu)
103 +
104 + return 0;
105 + }
106 +-
107 +-DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
108 +-DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
109 +diff --git a/arch/riscv/kernel/cacheinfo.c b/arch/riscv/kernel/cacheinfo.c
110 +index 0bc86e5f8f3fb..9d46c8575a61a 100644
111 +--- a/arch/riscv/kernel/cacheinfo.c
112 ++++ b/arch/riscv/kernel/cacheinfo.c
113 +@@ -31,7 +31,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
114 + | CACHE_WRITE_ALLOCATE;
115 + }
116 +
117 +-static int __init_cache_level(unsigned int cpu)
118 ++int init_cache_level(unsigned int cpu)
119 + {
120 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
121 + struct device_node *np = of_cpu_device_node_get(cpu);
122 +@@ -67,7 +67,7 @@ static int __init_cache_level(unsigned int cpu)
123 + return 0;
124 + }
125 +
126 +-static int __populate_cache_leaves(unsigned int cpu)
127 ++int populate_cache_leaves(unsigned int cpu)
128 + {
129 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
130 + struct cacheinfo *this_leaf = this_cpu_ci->info_list;
131 +@@ -99,6 +99,3 @@ static int __populate_cache_leaves(unsigned int cpu)
132 +
133 + return 0;
134 + }
135 +-
136 +-DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
137 +-DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
138 +diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
139 +index 8508c2c0e2a3a..bdc33d0e3ffcb 100644
140 +--- a/arch/s390/net/bpf_jit_comp.c
141 ++++ b/arch/s390/net/bpf_jit_comp.c
142 +@@ -561,10 +561,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
143 + EMIT4(0xb9080000, dst_reg, src_reg);
144 + break;
145 + case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */
146 +- if (!imm)
147 +- break;
148 +- /* alfi %dst,imm */
149 +- EMIT6_IMM(0xc20b0000, dst_reg, imm);
150 ++ if (imm != 0) {
151 ++ /* alfi %dst,imm */
152 ++ EMIT6_IMM(0xc20b0000, dst_reg, imm);
153 ++ }
154 + EMIT_ZERO(dst_reg);
155 + break;
156 + case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */
157 +@@ -586,10 +586,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
158 + EMIT4(0xb9090000, dst_reg, src_reg);
159 + break;
160 + case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */
161 +- if (!imm)
162 +- break;
163 +- /* alfi %dst,-imm */
164 +- EMIT6_IMM(0xc20b0000, dst_reg, -imm);
165 ++ if (imm != 0) {
166 ++ /* alfi %dst,-imm */
167 ++ EMIT6_IMM(0xc20b0000, dst_reg, -imm);
168 ++ }
169 + EMIT_ZERO(dst_reg);
170 + break;
171 + case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */
172 +@@ -616,10 +616,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
173 + EMIT4(0xb90c0000, dst_reg, src_reg);
174 + break;
175 + case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */
176 +- if (imm == 1)
177 +- break;
178 +- /* msfi %r5,imm */
179 +- EMIT6_IMM(0xc2010000, dst_reg, imm);
180 ++ if (imm != 1) {
181 ++ /* msfi %r5,imm */
182 ++ EMIT6_IMM(0xc2010000, dst_reg, imm);
183 ++ }
184 + EMIT_ZERO(dst_reg);
185 + break;
186 + case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */
187 +@@ -670,6 +670,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
188 + if (BPF_OP(insn->code) == BPF_MOD)
189 + /* lhgi %dst,0 */
190 + EMIT4_IMM(0xa7090000, dst_reg, 0);
191 ++ else
192 ++ EMIT_ZERO(dst_reg);
193 + break;
194 + }
195 + /* lhi %w0,0 */
196 +@@ -762,10 +764,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
197 + EMIT4(0xb9820000, dst_reg, src_reg);
198 + break;
199 + case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */
200 +- if (!imm)
201 +- break;
202 +- /* xilf %dst,imm */
203 +- EMIT6_IMM(0xc0070000, dst_reg, imm);
204 ++ if (imm != 0) {
205 ++ /* xilf %dst,imm */
206 ++ EMIT6_IMM(0xc0070000, dst_reg, imm);
207 ++ }
208 + EMIT_ZERO(dst_reg);
209 + break;
210 + case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */
211 +@@ -786,10 +788,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
212 + EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0);
213 + break;
214 + case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */
215 +- if (imm == 0)
216 +- break;
217 +- /* sll %dst,imm(%r0) */
218 +- EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
219 ++ if (imm != 0) {
220 ++ /* sll %dst,imm(%r0) */
221 ++ EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
222 ++ }
223 + EMIT_ZERO(dst_reg);
224 + break;
225 + case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */
226 +@@ -811,10 +813,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
227 + EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0);
228 + break;
229 + case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */
230 +- if (imm == 0)
231 +- break;
232 +- /* srl %dst,imm(%r0) */
233 +- EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
234 ++ if (imm != 0) {
235 ++ /* srl %dst,imm(%r0) */
236 ++ EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
237 ++ }
238 + EMIT_ZERO(dst_reg);
239 + break;
240 + case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */
241 +diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
242 +index 9d863e8f9b3f2..4a393023f5ac3 100644
243 +--- a/arch/x86/kernel/cpu/cacheinfo.c
244 ++++ b/arch/x86/kernel/cpu/cacheinfo.c
245 +@@ -956,7 +956,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
246 + this_leaf->priv = base->nb;
247 + }
248 +
249 +-static int __init_cache_level(unsigned int cpu)
250 ++int init_cache_level(unsigned int cpu)
251 + {
252 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
253 +
254 +@@ -985,7 +985,7 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs)
255 + id4_regs->id = c->apicid >> index_msb;
256 + }
257 +
258 +-static int __populate_cache_leaves(unsigned int cpu)
259 ++int populate_cache_leaves(unsigned int cpu)
260 + {
261 + unsigned int idx, ret;
262 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
263 +@@ -1004,6 +1004,3 @@ static int __populate_cache_leaves(unsigned int cpu)
264 +
265 + return 0;
266 + }
267 +-
268 +-DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
269 +-DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
270 +diff --git a/block/blk-throttle.c b/block/blk-throttle.c
271 +index caee658609d73..853b1770df367 100644
272 +--- a/block/blk-throttle.c
273 ++++ b/block/blk-throttle.c
274 +@@ -2437,6 +2437,7 @@ int blk_throtl_init(struct request_queue *q)
275 + void blk_throtl_exit(struct request_queue *q)
276 + {
277 + BUG_ON(!q->td);
278 ++ del_timer_sync(&q->td->service_queue.pending_timer);
279 + throtl_shutdown_wq(q);
280 + blkcg_deactivate_policy(q, &blkcg_policy_throtl);
281 + free_percpu(q->td->latency_buckets[READ]);
282 +diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
283 +index 07e1a286ee431..78b4f0f172ae5 100644
284 +--- a/drivers/crypto/talitos.c
285 ++++ b/drivers/crypto/talitos.c
286 +@@ -853,7 +853,7 @@ static void talitos_unregister_rng(struct device *dev)
287 + * HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP
288 + */
289 + #define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1)
290 +-#ifdef CONFIG_CRYPTO_DEV_TALITOS_SEC2
291 ++#ifdef CONFIG_CRYPTO_DEV_TALITOS2
292 + #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)
293 + #else
294 + #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE)
295 +diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
296 +index 52dd4bd7c2098..e5f31af65aabf 100644
297 +--- a/drivers/dma/Kconfig
298 ++++ b/drivers/dma/Kconfig
299 +@@ -266,7 +266,7 @@ config INTEL_IDMA64
300 +
301 + config INTEL_IOATDMA
302 + tristate "Intel I/OAT DMA support"
303 +- depends on PCI && X86_64
304 ++ depends on PCI && X86_64 && !UML
305 + select DMA_ENGINE
306 + select DMA_ENGINE_RAID
307 + select DCA
308 +diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
309 +index 8d99c84361cbb..22ec10c71d813 100644
310 +--- a/drivers/dma/acpi-dma.c
311 ++++ b/drivers/dma/acpi-dma.c
312 +@@ -72,10 +72,14 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
313 +
314 + si = (const struct acpi_csrt_shared_info *)&grp[1];
315 +
316 +- /* Match device by MMIO and IRQ */
317 ++ /* Match device by MMIO */
318 + if (si->mmio_base_low != lower_32_bits(mem) ||
319 +- si->mmio_base_high != upper_32_bits(mem) ||
320 +- si->gsi_interrupt != irq)
321 ++ si->mmio_base_high != upper_32_bits(mem))
322 ++ return 0;
323 ++
324 ++ /* Match device by Linux vIRQ */
325 ++ ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
326 ++ if (ret != irq)
327 + return 0;
328 +
329 + dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",
330 +diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
331 +index 9e8ce56a83d8a..0fadf6a084943 100644
332 +--- a/drivers/dma/sprd-dma.c
333 ++++ b/drivers/dma/sprd-dma.c
334 +@@ -1016,6 +1016,7 @@ static const struct of_device_id sprd_dma_match[] = {
335 + { .compatible = "sprd,sc9860-dma", },
336 + {},
337 + };
338 ++MODULE_DEVICE_TABLE(of, sprd_dma_match);
339 +
340 + static int __maybe_unused sprd_dma_runtime_suspend(struct device *dev)
341 + {
342 +diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
343 +index d891ec05bc48b..3f38df6b51f2a 100644
344 +--- a/drivers/dma/xilinx/xilinx_dma.c
345 ++++ b/drivers/dma/xilinx/xilinx_dma.c
346 +@@ -2674,7 +2674,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
347 + xdev->ext_addr = false;
348 +
349 + /* Set the dma mask bits */
350 +- dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width));
351 ++ dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
352 +
353 + /* Initialize the DMA engine */
354 + xdev->common.dev = &pdev->dev;
355 +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
356 +index b0ece71aefdee..ce774579c89d1 100644
357 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
358 ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
359 +@@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
360 + args->v0.count = 0;
361 + args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
362 + args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
363 +- args->v0.pwrsrc = -ENOSYS;
364 ++ args->v0.pwrsrc = -ENODEV;
365 + args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
366 + }
367 +
368 +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
369 +index 29df6ab29e95c..2b60535a9c7bf 100644
370 +--- a/drivers/parisc/dino.c
371 ++++ b/drivers/parisc/dino.c
372 +@@ -160,15 +160,6 @@ struct dino_device
373 + (struct dino_device *)__pdata; })
374 +
375 +
376 +-/* Check if PCI device is behind a Card-mode Dino. */
377 +-static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
378 +-{
379 +- struct dino_device *dino_dev;
380 +-
381 +- dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
382 +- return is_card_dino(&dino_dev->hba.dev->id);
383 +-}
384 +-
385 + /*
386 + * Dino Configuration Space Accessor Functions
387 + */
388 +@@ -452,6 +443,15 @@ static void quirk_cirrus_cardbus(struct pci_dev *dev)
389 + DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus );
390 +
391 + #ifdef CONFIG_TULIP
392 ++/* Check if PCI device is behind a Card-mode Dino. */
393 ++static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
394 ++{
395 ++ struct dino_device *dino_dev;
396 ++
397 ++ dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
398 ++ return is_card_dino(&dino_dev->hba.dev->id);
399 ++}
400 ++
401 + static void pci_fixup_tulip(struct pci_dev *dev)
402 + {
403 + if (!pci_dev_is_behind_card_dino(dev))
404 +diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c
405 +index 3b0a097ce2abd..6111e8848b076 100644
406 +--- a/drivers/pwm/pwm-img.c
407 ++++ b/drivers/pwm/pwm-img.c
408 +@@ -332,23 +332,7 @@ err_pm_disable:
409 + static int img_pwm_remove(struct platform_device *pdev)
410 + {
411 + struct img_pwm_chip *pwm_chip = platform_get_drvdata(pdev);
412 +- u32 val;
413 +- unsigned int i;
414 +- int ret;
415 +-
416 +- ret = pm_runtime_get_sync(&pdev->dev);
417 +- if (ret < 0) {
418 +- pm_runtime_put(&pdev->dev);
419 +- return ret;
420 +- }
421 +-
422 +- for (i = 0; i < pwm_chip->chip.npwm; i++) {
423 +- val = img_pwm_readl(pwm_chip, PWM_CTRL_CFG);
424 +- val &= ~BIT(i);
425 +- img_pwm_writel(pwm_chip, PWM_CTRL_CFG, val);
426 +- }
427 +
428 +- pm_runtime_put(&pdev->dev);
429 + pm_runtime_disable(&pdev->dev);
430 + if (!pm_runtime_status_suspended(&pdev->dev))
431 + img_pwm_runtime_suspend(&pdev->dev);
432 +diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c
433 +index a9b3cff96aaca..ed8e9406b4af2 100644
434 +--- a/drivers/pwm/pwm-lpc32xx.c
435 ++++ b/drivers/pwm/pwm-lpc32xx.c
436 +@@ -124,17 +124,17 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
437 + lpc32xx->chip.npwm = 1;
438 + lpc32xx->chip.base = -1;
439 +
440 ++ /* If PWM is disabled, configure the output to the default value */
441 ++ val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
442 ++ val &= ~PWM_PIN_LEVEL;
443 ++ writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
444 ++
445 + ret = pwmchip_add(&lpc32xx->chip);
446 + if (ret < 0) {
447 + dev_err(&pdev->dev, "failed to add PWM chip, error %d\n", ret);
448 + return ret;
449 + }
450 +
451 +- /* When PWM is disable, configure the output to the default value */
452 +- val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
453 +- val &= ~PWM_PIN_LEVEL;
454 +- writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
455 +-
456 + platform_set_drvdata(pdev, lpc32xx);
457 +
458 + return 0;
459 +diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
460 +index 48bcc853d57a7..cf34fb00c0547 100644
461 +--- a/drivers/pwm/pwm-rockchip.c
462 ++++ b/drivers/pwm/pwm-rockchip.c
463 +@@ -392,20 +392,6 @@ static int rockchip_pwm_remove(struct platform_device *pdev)
464 + {
465 + struct rockchip_pwm_chip *pc = platform_get_drvdata(pdev);
466 +
467 +- /*
468 +- * Disable the PWM clk before unpreparing it if the PWM device is still
469 +- * running. This should only happen when the last PWM user left it
470 +- * enabled, or when nobody requested a PWM that was previously enabled
471 +- * by the bootloader.
472 +- *
473 +- * FIXME: Maybe the core should disable all PWM devices in
474 +- * pwmchip_remove(). In this case we'd only have to call
475 +- * clk_unprepare() after pwmchip_remove().
476 +- *
477 +- */
478 +- if (pwm_is_enabled(pc->chip.pwms))
479 +- clk_disable(pc->clk);
480 +-
481 + clk_unprepare(pc->pclk);
482 + clk_unprepare(pc->clk);
483 +
484 +diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
485 +index 28e1f64134763..e92a140074221 100644
486 +--- a/drivers/pwm/pwm-stm32-lp.c
487 ++++ b/drivers/pwm/pwm-stm32-lp.c
488 +@@ -224,8 +224,6 @@ static int stm32_pwm_lp_remove(struct platform_device *pdev)
489 + {
490 + struct stm32_pwm_lp *priv = platform_get_drvdata(pdev);
491 +
492 +- pwm_disable(&priv->chip.pwms[0]);
493 +-
494 + return pwmchip_remove(&priv->chip);
495 + }
496 +
497 +diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
498 +index fc9399d9c0820..3376be6863cd8 100644
499 +--- a/drivers/thermal/samsung/exynos_tmu.c
500 ++++ b/drivers/thermal/samsung/exynos_tmu.c
501 +@@ -1084,6 +1084,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
502 + data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk");
503 + if (IS_ERR(data->sclk)) {
504 + dev_err(&pdev->dev, "Failed to get sclk\n");
505 ++ ret = PTR_ERR(data->sclk);
506 + goto err_clk;
507 + } else {
508 + ret = clk_prepare_enable(data->sclk);
509 +diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
510 +index 918781c51f0ba..6443ba1e60eb4 100644
511 +--- a/fs/ceph/caps.c
512 ++++ b/fs/ceph/caps.c
513 +@@ -1774,6 +1774,8 @@ static int __mark_caps_flushing(struct inode *inode,
514 + * try to invalidate mapping pages without blocking.
515 + */
516 + static int try_nonblocking_invalidate(struct inode *inode)
517 ++ __releases(ci->i_ceph_lock)
518 ++ __acquires(ci->i_ceph_lock)
519 + {
520 + struct ceph_inode_info *ci = ceph_inode(inode);
521 + u32 invalidating_gen = ci->i_rdcache_gen;
522 +diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c
523 +index c6c8a33c81d5e..28a2db3b1787f 100644
524 +--- a/fs/nilfs2/sysfs.c
525 ++++ b/fs/nilfs2/sysfs.c
526 +@@ -64,11 +64,9 @@ static const struct sysfs_ops nilfs_##name##_attr_ops = { \
527 + #define NILFS_DEV_INT_GROUP_TYPE(name, parent_name) \
528 + static void nilfs_##name##_attr_release(struct kobject *kobj) \
529 + { \
530 +- struct nilfs_sysfs_##parent_name##_subgroups *subgroups; \
531 +- struct the_nilfs *nilfs = container_of(kobj->parent, \
532 +- struct the_nilfs, \
533 +- ns_##parent_name##_kobj); \
534 +- subgroups = nilfs->ns_##parent_name##_subgroups; \
535 ++ struct nilfs_sysfs_##parent_name##_subgroups *subgroups = container_of(kobj, \
536 ++ struct nilfs_sysfs_##parent_name##_subgroups, \
537 ++ sg_##name##_kobj); \
538 + complete(&subgroups->sg_##name##_kobj_unregister); \
539 + } \
540 + static struct kobj_type nilfs_##name##_ktype = { \
541 +@@ -94,12 +92,12 @@ static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
542 + err = kobject_init_and_add(kobj, &nilfs_##name##_ktype, parent, \
543 + #name); \
544 + if (err) \
545 +- return err; \
546 +- return 0; \
547 ++ kobject_put(kobj); \
548 ++ return err; \
549 + } \
550 + static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
551 + { \
552 +- kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
553 ++ kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
554 + }
555 +
556 + /************************************************************************
557 +@@ -210,14 +208,14 @@ int nilfs_sysfs_create_snapshot_group(struct nilfs_root *root)
558 + }
559 +
560 + if (err)
561 +- return err;
562 ++ kobject_put(&root->snapshot_kobj);
563 +
564 +- return 0;
565 ++ return err;
566 + }
567 +
568 + void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root)
569 + {
570 +- kobject_del(&root->snapshot_kobj);
571 ++ kobject_put(&root->snapshot_kobj);
572 + }
573 +
574 + /************************************************************************
575 +@@ -1000,7 +998,7 @@ int nilfs_sysfs_create_device_group(struct super_block *sb)
576 + err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL,
577 + "%s", sb->s_id);
578 + if (err)
579 +- goto free_dev_subgroups;
580 ++ goto cleanup_dev_kobject;
581 +
582 + err = nilfs_sysfs_create_mounted_snapshots_group(nilfs);
583 + if (err)
584 +@@ -1037,9 +1035,7 @@ delete_mounted_snapshots_group:
585 + nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
586 +
587 + cleanup_dev_kobject:
588 +- kobject_del(&nilfs->ns_dev_kobj);
589 +-
590 +-free_dev_subgroups:
591 ++ kobject_put(&nilfs->ns_dev_kobj);
592 + kfree(nilfs->ns_dev_subgroups);
593 +
594 + failed_create_device_group:
595 +diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
596 +index 484785cdf96e2..931870768556c 100644
597 +--- a/fs/nilfs2/the_nilfs.c
598 ++++ b/fs/nilfs2/the_nilfs.c
599 +@@ -797,14 +797,13 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno)
600 +
601 + void nilfs_put_root(struct nilfs_root *root)
602 + {
603 +- if (refcount_dec_and_test(&root->count)) {
604 +- struct the_nilfs *nilfs = root->nilfs;
605 ++ struct the_nilfs *nilfs = root->nilfs;
606 +
607 +- nilfs_sysfs_delete_snapshot_group(root);
608 +-
609 +- spin_lock(&nilfs->ns_cptree_lock);
610 ++ if (refcount_dec_and_lock(&root->count, &nilfs->ns_cptree_lock)) {
611 + rb_erase(&root->rb_node, &nilfs->ns_cptree);
612 + spin_unlock(&nilfs->ns_cptree_lock);
613 ++
614 ++ nilfs_sysfs_delete_snapshot_group(root);
615 + iput(root->ifile);
616 +
617 + kfree(root);
618 +diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
619 +index 70e19bc6cc9fc..66654e6f96054 100644
620 +--- a/include/linux/cacheinfo.h
621 ++++ b/include/linux/cacheinfo.h
622 +@@ -76,24 +76,6 @@ struct cpu_cacheinfo {
623 + bool cpu_map_populated;
624 + };
625 +
626 +-/*
627 +- * Helpers to make sure "func" is executed on the cpu whose cache
628 +- * attributes are being detected
629 +- */
630 +-#define DEFINE_SMP_CALL_CACHE_FUNCTION(func) \
631 +-static inline void _##func(void *ret) \
632 +-{ \
633 +- int cpu = smp_processor_id(); \
634 +- *(int *)ret = __##func(cpu); \
635 +-} \
636 +- \
637 +-int func(unsigned int cpu) \
638 +-{ \
639 +- int ret; \
640 +- smp_call_function_single(cpu, _##func, &ret, true); \
641 +- return ret; \
642 +-}
643 +-
644 + struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
645 + int init_cache_level(unsigned int cpu);
646 + int populate_cache_leaves(unsigned int cpu);
647 +diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
648 +index 8dd4ebb58e973..827f70ce0b497 100644
649 +--- a/include/linux/kvm_host.h
650 ++++ b/include/linux/kvm_host.h
651 +@@ -248,7 +248,8 @@ struct kvm_vcpu {
652 + struct preempt_notifier preempt_notifier;
653 + #endif
654 + int cpu;
655 +- int vcpu_id;
656 ++ int vcpu_id; /* id given by userspace at creation */
657 ++ int vcpu_idx; /* index in kvm->vcpus array */
658 + int srcu_idx;
659 + int mode;
660 + u64 requests;
661 +@@ -551,13 +552,7 @@ static inline struct kvm_vcpu *kvm_get_vcpu_by_id(struct kvm *kvm, int id)
662 +
663 + static inline int kvm_vcpu_get_idx(struct kvm_vcpu *vcpu)
664 + {
665 +- struct kvm_vcpu *tmp;
666 +- int idx;
667 +-
668 +- kvm_for_each_vcpu(idx, tmp, vcpu->kvm)
669 +- if (tmp == vcpu)
670 +- return idx;
671 +- BUG();
672 ++ return vcpu->vcpu_idx;
673 + }
674 +
675 + #define kvm_for_each_memslot(memslot, slots) \
676 +diff --git a/kernel/profile.c b/kernel/profile.c
677 +index 9aa2a4445b0d2..efa58f63dc1bf 100644
678 +--- a/kernel/profile.c
679 ++++ b/kernel/profile.c
680 +@@ -40,7 +40,8 @@ struct profile_hit {
681 + #define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
682 +
683 + static atomic_t *prof_buffer;
684 +-static unsigned long prof_len, prof_shift;
685 ++static unsigned long prof_len;
686 ++static unsigned short int prof_shift;
687 +
688 + int prof_on __read_mostly;
689 + EXPORT_SYMBOL_GPL(prof_on);
690 +@@ -66,8 +67,8 @@ int profile_setup(char *str)
691 + if (str[strlen(sleepstr)] == ',')
692 + str += strlen(sleepstr) + 1;
693 + if (get_option(&str, &par))
694 +- prof_shift = par;
695 +- pr_info("kernel sleep profiling enabled (shift: %ld)\n",
696 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
697 ++ pr_info("kernel sleep profiling enabled (shift: %u)\n",
698 + prof_shift);
699 + #else
700 + pr_warn("kernel sleep profiling requires CONFIG_SCHEDSTATS\n");
701 +@@ -77,21 +78,21 @@ int profile_setup(char *str)
702 + if (str[strlen(schedstr)] == ',')
703 + str += strlen(schedstr) + 1;
704 + if (get_option(&str, &par))
705 +- prof_shift = par;
706 +- pr_info("kernel schedule profiling enabled (shift: %ld)\n",
707 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
708 ++ pr_info("kernel schedule profiling enabled (shift: %u)\n",
709 + prof_shift);
710 + } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
711 + prof_on = KVM_PROFILING;
712 + if (str[strlen(kvmstr)] == ',')
713 + str += strlen(kvmstr) + 1;
714 + if (get_option(&str, &par))
715 +- prof_shift = par;
716 +- pr_info("kernel KVM profiling enabled (shift: %ld)\n",
717 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
718 ++ pr_info("kernel KVM profiling enabled (shift: %u)\n",
719 + prof_shift);
720 + } else if (get_option(&str, &par)) {
721 +- prof_shift = par;
722 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
723 + prof_on = CPU_PROFILING;
724 +- pr_info("kernel profiling enabled (shift: %ld)\n",
725 ++ pr_info("kernel profiling enabled (shift: %u)\n",
726 + prof_shift);
727 + }
728 + return 1;
729 +@@ -467,7 +468,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
730 + unsigned long p = *ppos;
731 + ssize_t read;
732 + char *pnt;
733 +- unsigned int sample_step = 1 << prof_shift;
734 ++ unsigned long sample_step = 1UL << prof_shift;
735 +
736 + profile_flip_buffers();
737 + if (p >= (prof_len+1)*sizeof(unsigned int))
738 +diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
739 +index 0b2c2ad69629c..72770a551c24d 100644
740 +--- a/kernel/rcu/tree_exp.h
741 ++++ b/kernel/rcu/tree_exp.h
742 +@@ -613,7 +613,7 @@ static void rcu_exp_wait_wake(struct rcu_state *rsp, unsigned long s)
743 + spin_unlock(&rnp->exp_lock);
744 + }
745 + smp_mb(); /* All above changes before wakeup. */
746 +- wake_up_all(&rnp->exp_wq[rcu_seq_ctr(rsp->expedited_sequence) & 0x3]);
747 ++ wake_up_all(&rnp->exp_wq[rcu_seq_ctr(s) & 0x3]);
748 + }
749 + trace_rcu_exp_grace_period(rsp->name, s, TPS("endwake"));
750 + mutex_unlock(&rsp->exp_wake_mutex);
751 +diff --git a/kernel/sys.c b/kernel/sys.c
752 +index baf60a3aa34b7..d0663f8e6fb80 100644
753 +--- a/kernel/sys.c
754 ++++ b/kernel/sys.c
755 +@@ -1931,13 +1931,6 @@ static int validate_prctl_map(struct prctl_mm_map *prctl_map)
756 +
757 + error = -EINVAL;
758 +
759 +- /*
760 +- * @brk should be after @end_data in traditional maps.
761 +- */
762 +- if (prctl_map->start_brk <= prctl_map->end_data ||
763 +- prctl_map->brk <= prctl_map->end_data)
764 +- goto out;
765 +-
766 + /*
767 + * Neither we should allow to override limits if they set.
768 + */
769 +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
770 +index 61eff45653f57..36dfea29d5fa0 100644
771 +--- a/kernel/trace/trace_kprobe.c
772 ++++ b/kernel/trace/trace_kprobe.c
773 +@@ -836,8 +836,9 @@ static int create_trace_kprobe(int argc, char **argv)
774 + pr_info("Failed to parse either an address or a symbol.\n");
775 + return ret;
776 + }
777 ++ /* Defer the ENOENT case until register kprobe */
778 + if (offset && is_return &&
779 +- !kprobe_on_func_entry(NULL, symbol, offset)) {
780 ++ kprobe_on_func_entry(NULL, symbol, offset) == -EINVAL) {
781 + pr_info("Given offset is not valid for return probe.\n");
782 + return -EINVAL;
783 + }
784 +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
785 +index 46a910acce3f0..6970759f296c5 100644
786 +--- a/lib/Kconfig.debug
787 ++++ b/lib/Kconfig.debug
788 +@@ -853,7 +853,6 @@ config HARDLOCKUP_DETECTOR
789 + depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_ARCH
790 + select LOCKUP_DETECTOR
791 + select HARDLOCKUP_DETECTOR_PERF if HAVE_HARDLOCKUP_DETECTOR_PERF
792 +- select HARDLOCKUP_DETECTOR_ARCH if HAVE_HARDLOCKUP_DETECTOR_ARCH
793 + help
794 + Say Y here to enable the kernel to act as a watchdog to detect
795 + hard lockups.
796 +diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
797 +index 849336211c79b..f7cd8e018bde0 100644
798 +--- a/net/9p/trans_virtio.c
799 ++++ b/net/9p/trans_virtio.c
800 +@@ -620,7 +620,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
801 + chan->vc_wq = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL);
802 + if (!chan->vc_wq) {
803 + err = -ENOMEM;
804 +- goto out_free_tag;
805 ++ goto out_remove_file;
806 + }
807 + init_waitqueue_head(chan->vc_wq);
808 + chan->ring_bufs_avail = 1;
809 +@@ -638,6 +638,8 @@ static int p9_virtio_probe(struct virtio_device *vdev)
810 +
811 + return 0;
812 +
813 ++out_remove_file:
814 ++ sysfs_remove_file(&vdev->dev.kobj, &dev_attr_mount_tag.attr);
815 + out_free_tag:
816 + kfree(tag);
817 + out_free_vq:
818 +diff --git a/net/sctp/input.c b/net/sctp/input.c
819 +index 23c4f14bec256..8b7c07fc66d4b 100644
820 +--- a/net/sctp/input.c
821 ++++ b/net/sctp/input.c
822 +@@ -1125,6 +1125,9 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
823 + union sctp_addr_param *param;
824 + union sctp_addr paddr;
825 +
826 ++ if (ntohs(ch->length) < sizeof(*asconf) + sizeof(struct sctp_paramhdr))
827 ++ return NULL;
828 ++
829 + /* Skip over the ADDIP header and find the Address parameter */
830 + param = (union sctp_addr_param *)(asconf + 1);
831 +
832 +diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
833 +index a1ca070e36b0a..0789109c2d093 100644
834 +--- a/net/sctp/sm_make_chunk.c
835 ++++ b/net/sctp/sm_make_chunk.c
836 +@@ -2172,9 +2172,16 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
837 + break;
838 +
839 + case SCTP_PARAM_SET_PRIMARY:
840 +- if (net->sctp.addip_enable)
841 +- break;
842 +- goto fallthrough;
843 ++ if (!net->sctp.addip_enable)
844 ++ goto fallthrough;
845 ++
846 ++ if (ntohs(param.p->length) < sizeof(struct sctp_addip_param) +
847 ++ sizeof(struct sctp_paramhdr)) {
848 ++ sctp_process_inv_paramlength(asoc, param.p,
849 ++ chunk, err_chunk);
850 ++ retval = SCTP_IERROR_ABORT;
851 ++ }
852 ++ break;
853 +
854 + case SCTP_PARAM_HOST_NAME_ADDRESS:
855 + /* Tell the peer, we won't support this param. */
856 +diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
857 +index 1ec1e928cc09c..900c865b9e5ff 100644
858 +--- a/security/apparmor/apparmorfs.c
859 ++++ b/security/apparmor/apparmorfs.c
860 +@@ -1960,9 +1960,6 @@ fail2:
861 + return error;
862 + }
863 +
864 +-
865 +-#define list_entry_is_head(pos, head, member) (&pos->member == (head))
866 +-
867 + /**
868 + * __next_ns - find the next namespace to list
869 + * @root: root namespace to stop search at (NOT NULL)
870 +diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
871 +index a3d82113ae1ce..86ef740763b50 100644
872 +--- a/virt/kvm/kvm_main.c
873 ++++ b/virt/kvm/kvm_main.c
874 +@@ -2751,7 +2751,8 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
875 + goto unlock_vcpu_destroy;
876 + }
877 +
878 +- BUG_ON(kvm->vcpus[atomic_read(&kvm->online_vcpus)]);
879 ++ vcpu->vcpu_idx = atomic_read(&kvm->online_vcpus);
880 ++ BUG_ON(kvm->vcpus[vcpu->vcpu_idx]);
881 +
882 + /* Now it's all set up, let userspace reach it */
883 + kvm_get_kvm(kvm);
884 +@@ -2761,7 +2762,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
885 + goto unlock_vcpu_destroy;
886 + }
887 +
888 +- kvm->vcpus[atomic_read(&kvm->online_vcpus)] = vcpu;
889 ++ kvm->vcpus[vcpu->vcpu_idx] = vcpu;
890 +
891 + /*
892 + * Pairs with smp_rmb() in kvm_get_vcpu. Write kvm->vcpus