Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Tue, 29 Oct 2019 11:16:12
Message-Id: 1572347749.f1a530020615354add614a97915754fed0a6ba7a.mpagano@gentoo
1 commit: f1a530020615354add614a97915754fed0a6ba7a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 29 11:15:49 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 29 11:15:49 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f1a53002
7
8 Linux patch 4.9.198
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1197_linux-4.9.198.patch | 1196 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1200 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index e071b11..56cc1cc 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -831,6 +831,10 @@ Patch: 1196_linux-4.9.197.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.9.197
23
24 +Patch: 1197_linux-4.9.198.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.9.198
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/1197_linux-4.9.198.patch b/1197_linux-4.9.198.patch
33 new file mode 100644
34 index 0000000..c2e3901
35 --- /dev/null
36 +++ b/1197_linux-4.9.198.patch
37 @@ -0,0 +1,1196 @@
38 +diff --git a/Makefile b/Makefile
39 +index e62456010d34..2f11058a0d06 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 9
45 +-SUBLEVEL = 197
46 ++SUBLEVEL = 198
47 + EXTRAVERSION =
48 + NAME = Roaring Lionus
49 +
50 +diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
51 +index c9c9a47446e8..56224aa5e83e 100644
52 +--- a/arch/arm/boot/dts/am4372.dtsi
53 ++++ b/arch/arm/boot/dts/am4372.dtsi
54 +@@ -1117,6 +1117,8 @@
55 + ti,hwmods = "dss_dispc";
56 + clocks = <&disp_clk>;
57 + clock-names = "fck";
58 ++
59 ++ max-memory-bandwidth = <230000000>;
60 + };
61 +
62 + rfbi: rfbi@4832a800 {
63 +diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
64 +index e2d84aa7f595..fa1c6707877a 100644
65 +--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
66 ++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
67 +@@ -939,7 +939,8 @@ static struct omap_hwmod_class_sysconfig am33xx_timer_sysc = {
68 + .rev_offs = 0x0000,
69 + .sysc_offs = 0x0010,
70 + .syss_offs = 0x0014,
71 +- .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
72 ++ .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
73 ++ SYSC_HAS_RESET_STATUS,
74 + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
75 + SIDLE_SMART_WKUP),
76 + .sysc_fields = &omap_hwmod_sysc_type2,
77 +diff --git a/arch/mips/boot/dts/qca/ar9331.dtsi b/arch/mips/boot/dts/qca/ar9331.dtsi
78 +index cf47ed4d8569..1fda24fc1860 100644
79 +--- a/arch/mips/boot/dts/qca/ar9331.dtsi
80 ++++ b/arch/mips/boot/dts/qca/ar9331.dtsi
81 +@@ -98,7 +98,7 @@
82 +
83 + miscintc: interrupt-controller@18060010 {
84 + compatible = "qca,ar7240-misc-intc";
85 +- reg = <0x18060010 0x4>;
86 ++ reg = <0x18060010 0x8>;
87 +
88 + interrupt-parent = <&cpuintc>;
89 + interrupts = <6>;
90 +diff --git a/arch/mips/loongson64/common/serial.c b/arch/mips/loongson64/common/serial.c
91 +index ffefc1cb2612..98c3a7feb10f 100644
92 +--- a/arch/mips/loongson64/common/serial.c
93 ++++ b/arch/mips/loongson64/common/serial.c
94 +@@ -110,7 +110,7 @@ static int __init serial_init(void)
95 + }
96 + module_init(serial_init);
97 +
98 +-static void __init serial_exit(void)
99 ++static void __exit serial_exit(void)
100 + {
101 + platform_device_unregister(&uart8250_device);
102 + }
103 +diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
104 +index 47d50197789b..f625fd20b21e 100644
105 +--- a/arch/mips/mm/tlbex.c
106 ++++ b/arch/mips/mm/tlbex.c
107 +@@ -661,6 +661,13 @@ static void build_restore_pagemask(u32 **p, struct uasm_reloc **r,
108 + int restore_scratch)
109 + {
110 + if (restore_scratch) {
111 ++ /*
112 ++ * Ensure the MFC0 below observes the value written to the
113 ++ * KScratch register by the prior MTC0.
114 ++ */
115 ++ if (scratch_reg >= 0)
116 ++ uasm_i_ehb(p);
117 ++
118 + /* Reset default page size */
119 + if (PM_DEFAULT_MASK >> 16) {
120 + uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
121 +@@ -675,12 +682,10 @@ static void build_restore_pagemask(u32 **p, struct uasm_reloc **r,
122 + uasm_i_mtc0(p, 0, C0_PAGEMASK);
123 + uasm_il_b(p, r, lid);
124 + }
125 +- if (scratch_reg >= 0) {
126 +- uasm_i_ehb(p);
127 ++ if (scratch_reg >= 0)
128 + UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
129 +- } else {
130 ++ else
131 + UASM_i_LW(p, 1, scratchpad_offset(0), 0);
132 +- }
133 + } else {
134 + /* Reset default page size */
135 + if (PM_DEFAULT_MASK >> 16) {
136 +@@ -922,6 +927,10 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
137 + }
138 + if (mode != not_refill && check_for_high_segbits) {
139 + uasm_l_large_segbits_fault(l, *p);
140 ++
141 ++ if (mode == refill_scratch && scratch_reg >= 0)
142 ++ uasm_i_ehb(p);
143 ++
144 + /*
145 + * We get here if we are an xsseg address, or if we are
146 + * an xuseg address above (PGDIR_SHIFT+PGDIR_BITS) boundary.
147 +@@ -938,12 +947,10 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
148 + uasm_i_jr(p, ptr);
149 +
150 + if (mode == refill_scratch) {
151 +- if (scratch_reg >= 0) {
152 +- uasm_i_ehb(p);
153 ++ if (scratch_reg >= 0)
154 + UASM_i_MFC0(p, 1, c0_kscratch(), scratch_reg);
155 +- } else {
156 ++ else
157 + UASM_i_LW(p, 1, scratchpad_offset(0), 0);
158 +- }
159 + } else {
160 + uasm_i_nop(p);
161 + }
162 +diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
163 +index 838d0259cd27..3741f91fc186 100644
164 +--- a/arch/parisc/mm/ioremap.c
165 ++++ b/arch/parisc/mm/ioremap.c
166 +@@ -2,7 +2,7 @@
167 + * arch/parisc/mm/ioremap.c
168 + *
169 + * (C) Copyright 1995 1996 Linus Torvalds
170 +- * (C) Copyright 2001-2006 Helge Deller <deller@×××.de>
171 ++ * (C) Copyright 2001-2019 Helge Deller <deller@×××.de>
172 + * (C) Copyright 2005 Kyle McMartin <kyle@××××××××××××.org>
173 + */
174 +
175 +@@ -83,7 +83,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
176 + addr = (void __iomem *) area->addr;
177 + if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
178 + phys_addr, pgprot)) {
179 +- vfree(addr);
180 ++ vunmap(addr);
181 + return NULL;
182 + }
183 +
184 +@@ -91,9 +91,11 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
185 + }
186 + EXPORT_SYMBOL(__ioremap);
187 +
188 +-void iounmap(const volatile void __iomem *addr)
189 ++void iounmap(const volatile void __iomem *io_addr)
190 + {
191 +- if (addr > high_memory)
192 +- return vfree((void *) (PAGE_MASK & (unsigned long __force) addr));
193 ++ unsigned long addr = (unsigned long)io_addr & PAGE_MASK;
194 ++
195 ++ if (is_vmalloc_addr((void *)addr))
196 ++ vunmap((void *)addr);
197 + }
198 + EXPORT_SYMBOL(iounmap);
199 +diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c
200 +index a71d2739fa82..9210b9cc4ec9 100644
201 +--- a/arch/xtensa/kernel/xtensa_ksyms.c
202 ++++ b/arch/xtensa/kernel/xtensa_ksyms.c
203 +@@ -114,13 +114,6 @@ EXPORT_SYMBOL(__invalidate_icache_range);
204 + // FIXME EXPORT_SYMBOL(screen_info);
205 + #endif
206 +
207 +-EXPORT_SYMBOL(outsb);
208 +-EXPORT_SYMBOL(outsw);
209 +-EXPORT_SYMBOL(outsl);
210 +-EXPORT_SYMBOL(insb);
211 +-EXPORT_SYMBOL(insw);
212 +-EXPORT_SYMBOL(insl);
213 +-
214 + extern long common_exception_return;
215 + EXPORT_SYMBOL(common_exception_return);
216 +
217 +diff --git a/drivers/base/core.c b/drivers/base/core.c
218 +index 3dc483f00060..69a71074dc65 100644
219 +--- a/drivers/base/core.c
220 ++++ b/drivers/base/core.c
221 +@@ -10,6 +10,7 @@
222 + *
223 + */
224 +
225 ++#include <linux/cpufreq.h>
226 + #include <linux/device.h>
227 + #include <linux/err.h>
228 + #include <linux/fwnode.h>
229 +@@ -2128,6 +2129,8 @@ void device_shutdown(void)
230 + wait_for_device_probe();
231 + device_block_probing();
232 +
233 ++ cpufreq_suspend();
234 ++
235 + spin_lock(&devices_kset->list_lock);
236 + /*
237 + * Walk the devices list backward, shutting down each in turn.
238 +diff --git a/drivers/block/loop.c b/drivers/block/loop.c
239 +index 9f840d9fdfcb..f236b7984b94 100644
240 +--- a/drivers/block/loop.c
241 ++++ b/drivers/block/loop.c
242 +@@ -1546,6 +1546,7 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
243 + arg = (unsigned long) compat_ptr(arg);
244 + case LOOP_SET_FD:
245 + case LOOP_CHANGE_FD:
246 ++ case LOOP_SET_DIRECT_IO:
247 + err = lo_ioctl(bdev, mode, cmd, arg);
248 + break;
249 + default:
250 +diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
251 +index e917521a3ef9..d43cd983a7ec 100644
252 +--- a/drivers/cpufreq/cpufreq.c
253 ++++ b/drivers/cpufreq/cpufreq.c
254 +@@ -2543,14 +2543,6 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
255 + }
256 + EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);
257 +
258 +-/*
259 +- * Stop cpufreq at shutdown to make sure it isn't holding any locks
260 +- * or mutexes when secondary CPUs are halted.
261 +- */
262 +-static struct syscore_ops cpufreq_syscore_ops = {
263 +- .shutdown = cpufreq_suspend,
264 +-};
265 +-
266 + struct kobject *cpufreq_global_kobject;
267 + EXPORT_SYMBOL(cpufreq_global_kobject);
268 +
269 +@@ -2562,8 +2554,6 @@ static int __init cpufreq_core_init(void)
270 + cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
271 + BUG_ON(!cpufreq_global_kobject);
272 +
273 +- register_syscore_ops(&cpufreq_syscore_ops);
274 +-
275 + return 0;
276 + }
277 + core_initcall(cpufreq_core_init);
278 +diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
279 +index c93dcfedc219..a9bf02ea0a3b 100644
280 +--- a/drivers/gpu/drm/drm_edid.c
281 ++++ b/drivers/gpu/drm/drm_edid.c
282 +@@ -160,6 +160,9 @@ static const struct edid_quirk {
283 + /* Medion MD 30217 PG */
284 + { "MED", 0x7b8, EDID_QUIRK_PREFER_LARGE_75 },
285 +
286 ++ /* Lenovo G50 */
287 ++ { "SDC", 18514, EDID_QUIRK_FORCE_6BPC },
288 ++
289 + /* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */
290 + { "SEC", 0xd033, EDID_QUIRK_FORCE_8BPC },
291 +
292 +diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
293 +index 3ccf5b28b326..30bd4a6a9d46 100644
294 +--- a/drivers/gpu/drm/radeon/radeon_drv.c
295 ++++ b/drivers/gpu/drm/radeon/radeon_drv.c
296 +@@ -366,19 +366,11 @@ radeon_pci_remove(struct pci_dev *pdev)
297 + static void
298 + radeon_pci_shutdown(struct pci_dev *pdev)
299 + {
300 +- struct drm_device *ddev = pci_get_drvdata(pdev);
301 +-
302 + /* if we are running in a VM, make sure the device
303 + * torn down properly on reboot/shutdown
304 + */
305 + if (radeon_device_is_virtual())
306 + radeon_pci_remove(pdev);
307 +-
308 +- /* Some adapters need to be suspended before a
309 +- * shutdown occurs in order to prevent an error
310 +- * during kexec.
311 +- */
312 +- radeon_suspend_kms(ddev, true, true, false);
313 + }
314 +
315 + static int radeon_pmops_suspend(struct device *dev)
316 +diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
317 +index 0c215353adb9..2b1dd60a29fa 100644
318 +--- a/drivers/infiniband/hw/cxgb4/mem.c
319 ++++ b/drivers/infiniband/hw/cxgb4/mem.c
320 +@@ -264,13 +264,17 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
321 + struct sk_buff *skb)
322 + {
323 + int err;
324 +- struct fw_ri_tpte tpt;
325 ++ struct fw_ri_tpte *tpt;
326 + u32 stag_idx;
327 + static atomic_t key;
328 +
329 + if (c4iw_fatal_error(rdev))
330 + return -EIO;
331 +
332 ++ tpt = kmalloc(sizeof(*tpt), GFP_KERNEL);
333 ++ if (!tpt)
334 ++ return -ENOMEM;
335 ++
336 + stag_state = stag_state > 0;
337 + stag_idx = (*stag) >> 8;
338 +
339 +@@ -280,6 +284,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
340 + mutex_lock(&rdev->stats.lock);
341 + rdev->stats.stag.fail++;
342 + mutex_unlock(&rdev->stats.lock);
343 ++ kfree(tpt);
344 + return -ENOMEM;
345 + }
346 + mutex_lock(&rdev->stats.lock);
347 +@@ -294,28 +299,28 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
348 +
349 + /* write TPT entry */
350 + if (reset_tpt_entry)
351 +- memset(&tpt, 0, sizeof(tpt));
352 ++ memset(tpt, 0, sizeof(*tpt));
353 + else {
354 +- tpt.valid_to_pdid = cpu_to_be32(FW_RI_TPTE_VALID_F |
355 ++ tpt->valid_to_pdid = cpu_to_be32(FW_RI_TPTE_VALID_F |
356 + FW_RI_TPTE_STAGKEY_V((*stag & FW_RI_TPTE_STAGKEY_M)) |
357 + FW_RI_TPTE_STAGSTATE_V(stag_state) |
358 + FW_RI_TPTE_STAGTYPE_V(type) | FW_RI_TPTE_PDID_V(pdid));
359 +- tpt.locread_to_qpid = cpu_to_be32(FW_RI_TPTE_PERM_V(perm) |
360 ++ tpt->locread_to_qpid = cpu_to_be32(FW_RI_TPTE_PERM_V(perm) |
361 + (bind_enabled ? FW_RI_TPTE_MWBINDEN_F : 0) |
362 + FW_RI_TPTE_ADDRTYPE_V((zbva ? FW_RI_ZERO_BASED_TO :
363 + FW_RI_VA_BASED_TO))|
364 + FW_RI_TPTE_PS_V(page_size));
365 +- tpt.nosnoop_pbladdr = !pbl_size ? 0 : cpu_to_be32(
366 ++ tpt->nosnoop_pbladdr = !pbl_size ? 0 : cpu_to_be32(
367 + FW_RI_TPTE_PBLADDR_V(PBL_OFF(rdev, pbl_addr)>>3));
368 +- tpt.len_lo = cpu_to_be32((u32)(len & 0xffffffffUL));
369 +- tpt.va_hi = cpu_to_be32((u32)(to >> 32));
370 +- tpt.va_lo_fbo = cpu_to_be32((u32)(to & 0xffffffffUL));
371 +- tpt.dca_mwbcnt_pstag = cpu_to_be32(0);
372 +- tpt.len_hi = cpu_to_be32((u32)(len >> 32));
373 ++ tpt->len_lo = cpu_to_be32((u32)(len & 0xffffffffUL));
374 ++ tpt->va_hi = cpu_to_be32((u32)(to >> 32));
375 ++ tpt->va_lo_fbo = cpu_to_be32((u32)(to & 0xffffffffUL));
376 ++ tpt->dca_mwbcnt_pstag = cpu_to_be32(0);
377 ++ tpt->len_hi = cpu_to_be32((u32)(len >> 32));
378 + }
379 + err = write_adapter_mem(rdev, stag_idx +
380 + (rdev->lldi.vr->stag.start >> 5),
381 +- sizeof(tpt), &tpt, skb);
382 ++ sizeof(*tpt), tpt, skb);
383 +
384 + if (reset_tpt_entry) {
385 + c4iw_put_resource(&rdev->resource.tpt_table, stag_idx);
386 +@@ -323,6 +328,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
387 + rdev->stats.stag.cur -= 32;
388 + mutex_unlock(&rdev->stats.lock);
389 + }
390 ++ kfree(tpt);
391 + return err;
392 + }
393 +
394 +diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c
395 +index bb863e062b03..eaf5ecc431c9 100644
396 +--- a/drivers/input/misc/da9063_onkey.c
397 ++++ b/drivers/input/misc/da9063_onkey.c
398 +@@ -247,10 +247,7 @@ static int da9063_onkey_probe(struct platform_device *pdev)
399 + onkey->input->phys = onkey->phys;
400 + onkey->input->dev.parent = &pdev->dev;
401 +
402 +- if (onkey->key_power)
403 +- input_set_capability(onkey->input, EV_KEY, KEY_POWER);
404 +-
405 +- input_set_capability(onkey->input, EV_KEY, KEY_SLEEP);
406 ++ input_set_capability(onkey->input, EV_KEY, KEY_POWER);
407 +
408 + INIT_DELAYED_WORK(&onkey->work, da9063_poll_on);
409 +
410 +diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
411 +index 48db922075e2..08fa6400d255 100644
412 +--- a/drivers/memstick/host/jmb38x_ms.c
413 ++++ b/drivers/memstick/host/jmb38x_ms.c
414 +@@ -947,7 +947,7 @@ static int jmb38x_ms_probe(struct pci_dev *pdev,
415 + if (!cnt) {
416 + rc = -ENODEV;
417 + pci_dev_busy = 1;
418 +- goto err_out;
419 ++ goto err_out_int;
420 + }
421 +
422 + jm = kzalloc(sizeof(struct jmb38x_ms)
423 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
424 +index 3f8858db12eb..dcf10ea60e7f 100644
425 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
426 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
427 +@@ -362,6 +362,7 @@ struct bcmgenet_mib_counters {
428 + #define EXT_ENERGY_DET_MASK (1 << 12)
429 +
430 + #define EXT_RGMII_OOB_CTRL 0x0C
431 ++#define RGMII_MODE_EN_V123 (1 << 0)
432 + #define RGMII_LINK (1 << 4)
433 + #define OOB_DISABLE (1 << 5)
434 + #define RGMII_MODE_EN (1 << 6)
435 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
436 +index 9bd90a7c4d40..b0b9feeb173b 100644
437 +--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
438 ++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
439 +@@ -328,7 +328,11 @@ int bcmgenet_mii_config(struct net_device *dev)
440 + */
441 + if (priv->ext_phy) {
442 + reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
443 +- reg |= RGMII_MODE_EN | id_mode_dis;
444 ++ reg |= id_mode_dis;
445 ++ if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
446 ++ reg |= RGMII_MODE_EN_V123;
447 ++ else
448 ++ reg |= RGMII_MODE_EN;
449 + bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
450 + }
451 +
452 +@@ -342,11 +346,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
453 + struct bcmgenet_priv *priv = netdev_priv(dev);
454 + struct device_node *dn = priv->pdev->dev.of_node;
455 + struct phy_device *phydev;
456 +- u32 phy_flags;
457 ++ u32 phy_flags = 0;
458 + int ret;
459 +
460 + /* Communicate the integrated PHY revision */
461 +- phy_flags = priv->gphy_rev;
462 ++ if (priv->internal_phy)
463 ++ phy_flags = priv->gphy_rev;
464 +
465 + /* Initialize link state variables that bcmgenet_mii_setup() uses */
466 + priv->old_link = -1;
467 +diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
468 +index de23a0ead5d7..d06efcd5f13b 100644
469 +--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
470 ++++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
471 +@@ -166,11 +166,15 @@ static int mdio_sc_cfg_reg_write(struct hns_mdio_device *mdio_dev,
472 + {
473 + u32 time_cnt;
474 + u32 reg_value;
475 ++ int ret;
476 +
477 + regmap_write(mdio_dev->subctrl_vbase, cfg_reg, set_val);
478 +
479 + for (time_cnt = MDIO_TIMEOUT; time_cnt; time_cnt--) {
480 +- regmap_read(mdio_dev->subctrl_vbase, st_reg, &reg_value);
481 ++ ret = regmap_read(mdio_dev->subctrl_vbase, st_reg, &reg_value);
482 ++ if (ret)
483 ++ return ret;
484 ++
485 + reg_value &= st_msk;
486 + if ((!!check_st) == (!!reg_value))
487 + break;
488 +diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
489 +index cae691486105..e1f47b6ea3b7 100644
490 +--- a/drivers/net/xen-netback/interface.c
491 ++++ b/drivers/net/xen-netback/interface.c
492 +@@ -706,7 +706,6 @@ err_unmap:
493 + xenvif_unmap_frontend_data_rings(queue);
494 + netif_napi_del(&queue->napi);
495 + err:
496 +- module_put(THIS_MODULE);
497 + return err;
498 + }
499 +
500 +diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
501 +index a07533702d26..e09653c73ab4 100644
502 +--- a/drivers/pci/pci.c
503 ++++ b/drivers/pci/pci.c
504 +@@ -753,19 +753,6 @@ void pci_update_current_state(struct pci_dev *dev, pci_power_t state)
505 + }
506 + }
507 +
508 +-/**
509 +- * pci_power_up - Put the given device into D0 forcibly
510 +- * @dev: PCI device to power up
511 +- */
512 +-void pci_power_up(struct pci_dev *dev)
513 +-{
514 +- if (platform_pci_power_manageable(dev))
515 +- platform_pci_set_power_state(dev, PCI_D0);
516 +-
517 +- pci_raw_set_power_state(dev, PCI_D0);
518 +- pci_update_current_state(dev, PCI_D0);
519 +-}
520 +-
521 + /**
522 + * pci_platform_power_transition - Use platform to change device power state
523 + * @dev: PCI device to handle.
524 +@@ -941,6 +928,17 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
525 + }
526 + EXPORT_SYMBOL(pci_set_power_state);
527 +
528 ++/**
529 ++ * pci_power_up - Put the given device into D0 forcibly
530 ++ * @dev: PCI device to power up
531 ++ */
532 ++void pci_power_up(struct pci_dev *dev)
533 ++{
534 ++ __pci_start_power_transition(dev, PCI_D0);
535 ++ pci_raw_set_power_state(dev, PCI_D0);
536 ++ pci_update_current_state(dev, PCI_D0);
537 ++}
538 ++
539 + /**
540 + * pci_choose_state - Choose the power state of a PCI device
541 + * @dev: PCI device to be suspended
542 +diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
543 +index 1964391db904..a3aaef4c53a3 100644
544 +--- a/drivers/s390/scsi/zfcp_fsf.c
545 ++++ b/drivers/s390/scsi/zfcp_fsf.c
546 +@@ -20,6 +20,11 @@
547 +
548 + struct kmem_cache *zfcp_fsf_qtcb_cache;
549 +
550 ++static bool ber_stop = true;
551 ++module_param(ber_stop, bool, 0600);
552 ++MODULE_PARM_DESC(ber_stop,
553 ++ "Shuts down FCP devices for FCP channels that report a bit-error count in excess of its threshold (default on)");
554 ++
555 + static void zfcp_fsf_request_timeout_handler(unsigned long data)
556 + {
557 + struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
558 +@@ -231,10 +236,15 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
559 + case FSF_STATUS_READ_SENSE_DATA_AVAIL:
560 + break;
561 + case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
562 +- dev_warn(&adapter->ccw_device->dev,
563 +- "The error threshold for checksum statistics "
564 +- "has been exceeded\n");
565 + zfcp_dbf_hba_bit_err("fssrh_3", req);
566 ++ if (ber_stop) {
567 ++ dev_warn(&adapter->ccw_device->dev,
568 ++ "All paths over this FCP device are disused because of excessive bit errors\n");
569 ++ zfcp_erp_adapter_shutdown(adapter, 0, "fssrh_b");
570 ++ } else {
571 ++ dev_warn(&adapter->ccw_device->dev,
572 ++ "The error threshold for checksum statistics has been exceeded\n");
573 ++ }
574 + break;
575 + case FSF_STATUS_READ_LINK_DOWN:
576 + zfcp_fsf_status_read_link_down(req);
577 +diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
578 +index 19bffe0b2cc0..2cbfec6a7466 100644
579 +--- a/drivers/scsi/megaraid.c
580 ++++ b/drivers/scsi/megaraid.c
581 +@@ -4219,11 +4219,11 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
582 + */
583 + if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
584 + pdev->subsystem_device == 0xC000)
585 +- return -ENODEV;
586 ++ goto out_disable_device;
587 + /* Now check the magic signature byte */
588 + pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
589 + if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
590 +- return -ENODEV;
591 ++ goto out_disable_device;
592 + /* Ok it is probably a megaraid */
593 + }
594 +
595 +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
596 +index 11f45cb99892..d13e91e16425 100644
597 +--- a/drivers/scsi/qla2xxx/qla_target.c
598 ++++ b/drivers/scsi/qla2xxx/qla_target.c
599 +@@ -572,6 +572,7 @@ static void qlt_free_session_done(struct work_struct *work)
600 +
601 + if (logout_started) {
602 + bool traced = false;
603 ++ u16 cnt = 0;
604 +
605 + while (!ACCESS_ONCE(sess->logout_completed)) {
606 + if (!traced) {
607 +@@ -581,6 +582,9 @@ static void qlt_free_session_done(struct work_struct *work)
608 + traced = true;
609 + }
610 + msleep(100);
611 ++ cnt++;
612 ++ if (cnt > 200)
613 ++ break;
614 + }
615 +
616 + ql_dbg(ql_dbg_tgt_mgt, vha, 0xf087,
617 +diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
618 +index 56b65b85b121..38830818bfb6 100644
619 +--- a/drivers/scsi/scsi_sysfs.c
620 ++++ b/drivers/scsi/scsi_sysfs.c
621 +@@ -710,6 +710,14 @@ sdev_store_delete(struct device *dev, struct device_attribute *attr,
622 + const char *buf, size_t count)
623 + {
624 + struct kernfs_node *kn;
625 ++ struct scsi_device *sdev = to_scsi_device(dev);
626 ++
627 ++ /*
628 ++ * We need to try to get module, avoiding the module been removed
629 ++ * during delete.
630 ++ */
631 ++ if (scsi_device_get(sdev))
632 ++ return -ENODEV;
633 +
634 + kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
635 + WARN_ON_ONCE(!kn);
636 +@@ -724,9 +732,10 @@ sdev_store_delete(struct device *dev, struct device_attribute *attr,
637 + * state into SDEV_DEL.
638 + */
639 + device_remove_file(dev, attr);
640 +- scsi_remove_device(to_scsi_device(dev));
641 ++ scsi_remove_device(sdev);
642 + if (kn)
643 + sysfs_unbreak_active_protection(kn);
644 ++ scsi_device_put(sdev);
645 + return count;
646 + };
647 + static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
648 +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
649 +index a9c172692f21..26f259fb6e3c 100644
650 +--- a/drivers/scsi/ufs/ufshcd.c
651 ++++ b/drivers/scsi/ufs/ufshcd.c
652 +@@ -6492,6 +6492,9 @@ int ufshcd_shutdown(struct ufs_hba *hba)
653 + {
654 + int ret = 0;
655 +
656 ++ if (!hba->is_powered)
657 ++ goto out;
658 ++
659 + if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba))
660 + goto out;
661 +
662 +diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
663 +index 182b2d564627..4c6384328615 100644
664 +--- a/drivers/staging/wlan-ng/cfg80211.c
665 ++++ b/drivers/staging/wlan-ng/cfg80211.c
666 +@@ -489,10 +489,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
667 + /* Set the encryption - we only support wep */
668 + if (is_wep) {
669 + if (sme->key) {
670 +- if (sme->key_idx >= NUM_WEPKEYS) {
671 +- err = -EINVAL;
672 +- goto exit;
673 +- }
674 ++ if (sme->key_idx >= NUM_WEPKEYS)
675 ++ return -EINVAL;
676 +
677 + result = prism2_domibset_uint32(wlandev,
678 + DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
679 +diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
680 +index 0669fbb0ec25..07c3c3449147 100644
681 +--- a/drivers/usb/class/usblp.c
682 ++++ b/drivers/usb/class/usblp.c
683 +@@ -458,6 +458,7 @@ static void usblp_cleanup(struct usblp *usblp)
684 + kfree(usblp->readbuf);
685 + kfree(usblp->device_id_string);
686 + kfree(usblp->statusbuf);
687 ++ usb_put_intf(usblp->intf);
688 + kfree(usblp);
689 + }
690 +
691 +@@ -1120,7 +1121,7 @@ static int usblp_probe(struct usb_interface *intf,
692 + init_waitqueue_head(&usblp->wwait);
693 + init_usb_anchor(&usblp->urbs);
694 + usblp->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
695 +- usblp->intf = intf;
696 ++ usblp->intf = usb_get_intf(intf);
697 +
698 + /* Malloc device ID string buffer to the largest expected length,
699 + * since we can re-query it on an ioctl and a dynamic string
700 +@@ -1209,6 +1210,7 @@ abort:
701 + kfree(usblp->readbuf);
702 + kfree(usblp->statusbuf);
703 + kfree(usblp->device_id_string);
704 ++ usb_put_intf(usblp->intf);
705 + kfree(usblp);
706 + abort_ret:
707 + return retval;
708 +diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
709 +index 6df1aded4503..ac2aa04ca657 100644
710 +--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
711 ++++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
712 +@@ -1178,11 +1178,11 @@ static void udc_pop_fifo(struct lpc32xx_udc *udc, u8 *data, u32 bytes)
713 + tmp = readl(USBD_RXDATA(udc->udp_baseaddr));
714 +
715 + bl = bytes - n;
716 +- if (bl > 3)
717 +- bl = 3;
718 ++ if (bl > 4)
719 ++ bl = 4;
720 +
721 + for (i = 0; i < bl; i++)
722 +- data[n + i] = (u8) ((tmp >> (n * 8)) & 0xFF);
723 ++ data[n + i] = (u8) ((tmp >> (i * 8)) & 0xFF);
724 + }
725 + break;
726 +
727 +diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
728 +index eee69c9e9a12..52e28b4913ad 100644
729 +--- a/drivers/usb/misc/ldusb.c
730 ++++ b/drivers/usb/misc/ldusb.c
731 +@@ -384,10 +384,7 @@ static int ld_usb_release(struct inode *inode, struct file *file)
732 + goto exit;
733 + }
734 +
735 +- if (mutex_lock_interruptible(&dev->mutex)) {
736 +- retval = -ERESTARTSYS;
737 +- goto exit;
738 +- }
739 ++ mutex_lock(&dev->mutex);
740 +
741 + if (dev->open_count != 1) {
742 + retval = -ENODEV;
743 +@@ -471,7 +468,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
744 +
745 + /* wait for data */
746 + spin_lock_irq(&dev->rbsl);
747 +- if (dev->ring_head == dev->ring_tail) {
748 ++ while (dev->ring_head == dev->ring_tail) {
749 + dev->interrupt_in_done = 0;
750 + spin_unlock_irq(&dev->rbsl);
751 + if (file->f_flags & O_NONBLOCK) {
752 +@@ -481,12 +478,17 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
753 + retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done);
754 + if (retval < 0)
755 + goto unlock_exit;
756 +- } else {
757 +- spin_unlock_irq(&dev->rbsl);
758 ++
759 ++ spin_lock_irq(&dev->rbsl);
760 + }
761 ++ spin_unlock_irq(&dev->rbsl);
762 +
763 + /* actual_buffer contains actual_length + interrupt_in_buffer */
764 + actual_buffer = (size_t*)(dev->ring_buffer + dev->ring_tail*(sizeof(size_t)+dev->interrupt_in_endpoint_size));
765 ++ if (*actual_buffer > dev->interrupt_in_endpoint_size) {
766 ++ retval = -EIO;
767 ++ goto unlock_exit;
768 ++ }
769 + bytes_to_read = min(count, *actual_buffer);
770 + if (bytes_to_read < *actual_buffer)
771 + dev_warn(&dev->intf->dev, "Read buffer overflow, %zd bytes dropped\n",
772 +@@ -702,7 +704,9 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
773 + dev_warn(&intf->dev, "Interrupt out endpoint not found (using control endpoint instead)\n");
774 +
775 + dev->interrupt_in_endpoint_size = usb_endpoint_maxp(dev->interrupt_in_endpoint);
776 +- dev->ring_buffer = kmalloc(ring_buffer_size*(sizeof(size_t)+dev->interrupt_in_endpoint_size), GFP_KERNEL);
777 ++ dev->ring_buffer = kcalloc(ring_buffer_size,
778 ++ sizeof(size_t) + dev->interrupt_in_endpoint_size,
779 ++ GFP_KERNEL);
780 + if (!dev->ring_buffer)
781 + goto error;
782 + dev->interrupt_in_buffer = kmalloc(dev->interrupt_in_endpoint_size, GFP_KERNEL);
783 +diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
784 +index 321756fc4d29..f56307059d48 100644
785 +--- a/drivers/usb/misc/legousbtower.c
786 ++++ b/drivers/usb/misc/legousbtower.c
787 +@@ -425,10 +425,7 @@ static int tower_release (struct inode *inode, struct file *file)
788 + goto exit;
789 + }
790 +
791 +- if (mutex_lock_interruptible(&dev->lock)) {
792 +- retval = -ERESTARTSYS;
793 +- goto exit;
794 +- }
795 ++ mutex_lock(&dev->lock);
796 +
797 + if (dev->open_count != 1) {
798 + dev_dbg(&dev->udev->dev, "%s: device not opened exactly once\n",
799 +diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
800 +index 836cb93ba49e..a7e41723c34c 100644
801 +--- a/drivers/usb/serial/ti_usb_3410_5052.c
802 ++++ b/drivers/usb/serial/ti_usb_3410_5052.c
803 +@@ -778,7 +778,6 @@ static void ti_close(struct usb_serial_port *port)
804 + struct ti_port *tport;
805 + int port_number;
806 + int status;
807 +- int do_unlock;
808 + unsigned long flags;
809 +
810 + tdev = usb_get_serial_data(port->serial);
811 +@@ -802,16 +801,13 @@ static void ti_close(struct usb_serial_port *port)
812 + "%s - cannot send close port command, %d\n"
813 + , __func__, status);
814 +
815 +- /* if mutex_lock is interrupted, continue anyway */
816 +- do_unlock = !mutex_lock_interruptible(&tdev->td_open_close_lock);
817 ++ mutex_lock(&tdev->td_open_close_lock);
818 + --tport->tp_tdev->td_open_port_count;
819 +- if (tport->tp_tdev->td_open_port_count <= 0) {
820 ++ if (tport->tp_tdev->td_open_port_count == 0) {
821 + /* last port is closed, shut down interrupt urb */
822 + usb_kill_urb(port->serial->port[0]->interrupt_in_urb);
823 +- tport->tp_tdev->td_open_port_count = 0;
824 + }
825 +- if (do_unlock)
826 +- mutex_unlock(&tdev->td_open_close_lock);
827 ++ mutex_unlock(&tdev->td_open_close_lock);
828 + }
829 +
830 +
831 +diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
832 +index f3a251234474..538f378eea52 100644
833 +--- a/fs/btrfs/extent-tree.c
834 ++++ b/fs/btrfs/extent-tree.c
835 +@@ -10325,6 +10325,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
836 + btrfs_err(info,
837 + "bg %llu is a mixed block group but filesystem hasn't enabled mixed block groups",
838 + cache->key.objectid);
839 ++ btrfs_put_block_group(cache);
840 + ret = -EINVAL;
841 + goto error;
842 + }
843 +diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
844 +index f7a9adab0b84..6f5d78b172ba 100644
845 +--- a/fs/cifs/smb1ops.c
846 ++++ b/fs/cifs/smb1ops.c
847 +@@ -180,6 +180,9 @@ cifs_get_next_mid(struct TCP_Server_Info *server)
848 + /* we do not want to loop forever */
849 + last_mid = cur_mid;
850 + cur_mid++;
851 ++ /* avoid 0xFFFF MID */
852 ++ if (cur_mid == 0xffff)
853 ++ cur_mid++;
854 +
855 + /*
856 + * This nested loop looks more expensive than it is.
857 +diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
858 +index fa947d36ae1d..a30f63623db7 100644
859 +--- a/fs/ocfs2/journal.c
860 ++++ b/fs/ocfs2/journal.c
861 +@@ -231,7 +231,8 @@ void ocfs2_recovery_exit(struct ocfs2_super *osb)
862 + /* At this point, we know that no more recovery threads can be
863 + * launched, so wait for any recovery completion work to
864 + * complete. */
865 +- flush_workqueue(osb->ocfs2_wq);
866 ++ if (osb->ocfs2_wq)
867 ++ flush_workqueue(osb->ocfs2_wq);
868 +
869 + /*
870 + * Now that recovery is shut down, and the osb is about to be
871 +diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
872 +index 5d53d0d63d19..ea38677daa06 100644
873 +--- a/fs/ocfs2/localalloc.c
874 ++++ b/fs/ocfs2/localalloc.c
875 +@@ -391,7 +391,8 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
876 + struct ocfs2_dinode *alloc = NULL;
877 +
878 + cancel_delayed_work(&osb->la_enable_wq);
879 +- flush_workqueue(osb->ocfs2_wq);
880 ++ if (osb->ocfs2_wq)
881 ++ flush_workqueue(osb->ocfs2_wq);
882 +
883 + if (osb->local_alloc_state == OCFS2_LA_UNUSED)
884 + goto out;
885 +diff --git a/mm/shmem.c b/mm/shmem.c
886 +index 944242491059..ac8a5fedc245 100644
887 +--- a/mm/shmem.c
888 ++++ b/mm/shmem.c
889 +@@ -2457,11 +2457,12 @@ static void shmem_tag_pins(struct address_space *mapping)
890 + void **slot;
891 + pgoff_t start;
892 + struct page *page;
893 ++ unsigned int tagged = 0;
894 +
895 + lru_add_drain();
896 + start = 0;
897 +- rcu_read_lock();
898 +
899 ++ spin_lock_irq(&mapping->tree_lock);
900 + radix_tree_for_each_slot(slot, &mapping->page_tree, &iter, start) {
901 + page = radix_tree_deref_slot(slot);
902 + if (!page || radix_tree_exception(page)) {
903 +@@ -2470,18 +2471,19 @@ static void shmem_tag_pins(struct address_space *mapping)
904 + continue;
905 + }
906 + } else if (page_count(page) - page_mapcount(page) > 1) {
907 +- spin_lock_irq(&mapping->tree_lock);
908 + radix_tree_tag_set(&mapping->page_tree, iter.index,
909 + SHMEM_TAG_PINNED);
910 +- spin_unlock_irq(&mapping->tree_lock);
911 + }
912 +
913 +- if (need_resched()) {
914 +- cond_resched_rcu();
915 +- slot = radix_tree_iter_next(&iter);
916 +- }
917 ++ if (++tagged % 1024)
918 ++ continue;
919 ++
920 ++ slot = radix_tree_iter_next(&iter);
921 ++ spin_unlock_irq(&mapping->tree_lock);
922 ++ cond_resched();
923 ++ spin_lock_irq(&mapping->tree_lock);
924 + }
925 +- rcu_read_unlock();
926 ++ spin_unlock_irq(&mapping->tree_lock);
927 + }
928 +
929 + /*
930 +diff --git a/mm/slub.c b/mm/slub.c
931 +index 131dee87a67c..fa6d62d559eb 100644
932 +--- a/mm/slub.c
933 ++++ b/mm/slub.c
934 +@@ -4718,7 +4718,17 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
935 + }
936 + }
937 +
938 +- get_online_mems();
939 ++ /*
940 ++ * It is impossible to take "mem_hotplug_lock" here with "kernfs_mutex"
941 ++ * already held which will conflict with an existing lock order:
942 ++ *
943 ++ * mem_hotplug_lock->slab_mutex->kernfs_mutex
944 ++ *
945 ++ * We don't really need mem_hotplug_lock (to hold off
946 ++ * slab_mem_going_offline_callback) here because slab's memory hot
947 ++ * unplug code doesn't destroy the kmem_cache->node[] data.
948 ++ */
949 ++
950 + #ifdef CONFIG_SLUB_DEBUG
951 + if (flags & SO_ALL) {
952 + struct kmem_cache_node *n;
953 +@@ -4759,7 +4769,6 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
954 + x += sprintf(buf + x, " N%d=%lu",
955 + node, nodes[node]);
956 + #endif
957 +- put_online_mems();
958 + kfree(nodes);
959 + return x + sprintf(buf + x, "\n");
960 + }
961 +diff --git a/net/ipv4/route.c b/net/ipv4/route.c
962 +index d1a302d321fa..6058dbc4e2c1 100644
963 +--- a/net/ipv4/route.c
964 ++++ b/net/ipv4/route.c
965 +@@ -2221,7 +2221,7 @@ struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
966 + struct fib_result res;
967 + struct rtable *rth;
968 + int orig_oif;
969 +- int err = -ENETUNREACH;
970 ++ int err;
971 +
972 + res.tclassid = 0;
973 + res.fi = NULL;
974 +@@ -2236,11 +2236,14 @@ struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
975 +
976 + rcu_read_lock();
977 + if (fl4->saddr) {
978 +- rth = ERR_PTR(-EINVAL);
979 + if (ipv4_is_multicast(fl4->saddr) ||
980 + ipv4_is_lbcast(fl4->saddr) ||
981 +- ipv4_is_zeronet(fl4->saddr))
982 ++ ipv4_is_zeronet(fl4->saddr)) {
983 ++ rth = ERR_PTR(-EINVAL);
984 + goto out;
985 ++ }
986 ++
987 ++ rth = ERR_PTR(-ENETUNREACH);
988 +
989 + /* I removed check for oif == dev_out->oif here.
990 + It was wrong for two reasons:
991 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
992 +index 47ca2a2f1cf8..16eba7b5f1a9 100644
993 +--- a/net/ipv6/sit.c
994 ++++ b/net/ipv6/sit.c
995 +@@ -1856,7 +1856,6 @@ static int __net_init sit_init_net(struct net *net)
996 +
997 + err_reg_dev:
998 + ipip6_dev_free(sitn->fb_tunnel_dev);
999 +- free_netdev(sitn->fb_tunnel_dev);
1000 + err_alloc_dev:
1001 + return err;
1002 + }
1003 +diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
1004 +index bcec1240f41d..9769db9818d2 100644
1005 +--- a/net/mac80211/debugfs_netdev.c
1006 ++++ b/net/mac80211/debugfs_netdev.c
1007 +@@ -490,9 +490,14 @@ static ssize_t ieee80211_if_fmt_aqm(
1008 + const struct ieee80211_sub_if_data *sdata, char *buf, int buflen)
1009 + {
1010 + struct ieee80211_local *local = sdata->local;
1011 +- struct txq_info *txqi = to_txq_info(sdata->vif.txq);
1012 ++ struct txq_info *txqi;
1013 + int len;
1014 +
1015 ++ if (!sdata->vif.txq)
1016 ++ return 0;
1017 ++
1018 ++ txqi = to_txq_info(sdata->vif.txq);
1019 ++
1020 + spin_lock_bh(&local->fq.lock);
1021 + rcu_read_lock();
1022 +
1023 +@@ -657,7 +662,9 @@ static void add_common_files(struct ieee80211_sub_if_data *sdata)
1024 + DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz);
1025 + DEBUGFS_ADD(hw_queues);
1026 +
1027 +- if (sdata->local->ops->wake_tx_queue)
1028 ++ if (sdata->local->ops->wake_tx_queue &&
1029 ++ sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
1030 ++ sdata->vif.type != NL80211_IFTYPE_NAN)
1031 + DEBUGFS_ADD(aqm);
1032 + }
1033 +
1034 +diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
1035 +index c75594a12c38..048389b5aa0f 100644
1036 +--- a/net/mac80211/mlme.c
1037 ++++ b/net/mac80211/mlme.c
1038 +@@ -2434,7 +2434,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
1039 +
1040 + rcu_read_lock();
1041 + ssid = ieee80211_bss_get_ie(cbss, WLAN_EID_SSID);
1042 +- if (WARN_ON_ONCE(ssid == NULL))
1043 ++ if (WARN_ONCE(!ssid || ssid[1] > IEEE80211_MAX_SSID_LEN,
1044 ++ "invalid SSID element (len=%d)", ssid ? ssid[1] : -1))
1045 + ssid_len = 0;
1046 + else
1047 + ssid_len = ssid[1];
1048 +@@ -4691,7 +4692,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
1049 +
1050 + rcu_read_lock();
1051 + ssidie = ieee80211_bss_get_ie(req->bss, WLAN_EID_SSID);
1052 +- if (!ssidie) {
1053 ++ if (!ssidie || ssidie[1] > sizeof(assoc_data->ssid)) {
1054 + rcu_read_unlock();
1055 + kfree(assoc_data);
1056 + return -EINVAL;
1057 +diff --git a/net/sched/act_api.c b/net/sched/act_api.c
1058 +index 67adb4ecded2..5b8f8b382a2e 100644
1059 +--- a/net/sched/act_api.c
1060 ++++ b/net/sched/act_api.c
1061 +@@ -948,10 +948,15 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
1062 + static int tcf_action_add(struct net *net, struct nlattr *nla,
1063 + struct nlmsghdr *n, u32 portid, int ovr)
1064 + {
1065 +- int ret = 0;
1066 ++ int loop, ret;
1067 + LIST_HEAD(actions);
1068 +
1069 +- ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
1070 ++ for (loop = 0; loop < 10; loop++) {
1071 ++ ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
1072 ++ if (ret != -EAGAIN)
1073 ++ break;
1074 ++ }
1075 ++
1076 + if (ret)
1077 + return ret;
1078 +
1079 +@@ -989,10 +994,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
1080 + */
1081 + if (n->nlmsg_flags & NLM_F_REPLACE)
1082 + ovr = 1;
1083 +-replay:
1084 + ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
1085 +- if (ret == -EAGAIN)
1086 +- goto replay;
1087 + break;
1088 + case RTM_DELACTION:
1089 + ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
1090 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
1091 +index 93e60068800b..574a6a2c48d7 100644
1092 +--- a/net/sctp/socket.c
1093 ++++ b/net/sctp/socket.c
1094 +@@ -7911,7 +7911,7 @@ struct proto sctp_prot = {
1095 + .backlog_rcv = sctp_backlog_rcv,
1096 + .hash = sctp_hash,
1097 + .unhash = sctp_unhash,
1098 +- .get_port = sctp_get_port,
1099 ++ .no_autobind = true,
1100 + .obj_size = sizeof(struct sctp_sock),
1101 + .sysctl_mem = sysctl_sctp_mem,
1102 + .sysctl_rmem = sysctl_sctp_rmem,
1103 +@@ -7950,7 +7950,7 @@ struct proto sctpv6_prot = {
1104 + .backlog_rcv = sctp_backlog_rcv,
1105 + .hash = sctp_hash,
1106 + .unhash = sctp_unhash,
1107 +- .get_port = sctp_get_port,
1108 ++ .no_autobind = true,
1109 + .obj_size = sizeof(struct sctp6_sock),
1110 + .sysctl_mem = sysctl_sctp_mem,
1111 + .sysctl_rmem = sysctl_sctp_rmem,
1112 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
1113 +index 7aa1ca7ec638..ac75e6d4eb82 100644
1114 +--- a/net/wireless/nl80211.c
1115 ++++ b/net/wireless/nl80211.c
1116 +@@ -5358,6 +5358,9 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
1117 + if (!rdev->ops->del_mpath)
1118 + return -EOPNOTSUPP;
1119 +
1120 ++ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT)
1121 ++ return -EOPNOTSUPP;
1122 ++
1123 + return rdev_del_mpath(rdev, dev, dst);
1124 + }
1125 +
1126 +diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
1127 +index 995163830a61..9e7846b7d953 100644
1128 +--- a/net/wireless/wext-sme.c
1129 ++++ b/net/wireless/wext-sme.c
1130 +@@ -224,6 +224,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
1131 + struct iw_point *data, char *ssid)
1132 + {
1133 + struct wireless_dev *wdev = dev->ieee80211_ptr;
1134 ++ int ret = 0;
1135 +
1136 + /* call only for station! */
1137 + if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
1138 +@@ -241,7 +242,10 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
1139 + if (ie) {
1140 + data->flags = 1;
1141 + data->length = ie[1];
1142 +- memcpy(ssid, ie + 2, data->length);
1143 ++ if (data->length > IW_ESSID_MAX_SIZE)
1144 ++ ret = -EINVAL;
1145 ++ else
1146 ++ memcpy(ssid, ie + 2, data->length);
1147 + }
1148 + rcu_read_unlock();
1149 + } else if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
1150 +@@ -251,7 +255,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
1151 + }
1152 + wdev_unlock(wdev);
1153 +
1154 +- return 0;
1155 ++ return ret;
1156 + }
1157 +
1158 + int cfg80211_mgd_wext_siwap(struct net_device *dev,
1159 +diff --git a/scripts/namespace.pl b/scripts/namespace.pl
1160 +index 9f3c9d47a4a5..4dddd4c01b62 100755
1161 +--- a/scripts/namespace.pl
1162 ++++ b/scripts/namespace.pl
1163 +@@ -65,13 +65,14 @@
1164 + require 5; # at least perl 5
1165 + use strict;
1166 + use File::Find;
1167 ++use File::Spec;
1168 +
1169 + my $nm = ($ENV{'NM'} || "nm") . " -p";
1170 + my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment";
1171 +-my $srctree = "";
1172 +-my $objtree = "";
1173 +-$srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'}));
1174 +-$objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'}));
1175 ++my $srctree = File::Spec->curdir();
1176 ++my $objtree = File::Spec->curdir();
1177 ++$srctree = File::Spec->rel2abs($ENV{'srctree'}) if (exists($ENV{'srctree'}));
1178 ++$objtree = File::Spec->rel2abs($ENV{'objtree'}) if (exists($ENV{'objtree'}));
1179 +
1180 + if ($#ARGV != -1) {
1181 + print STDERR "usage: $0 takes no parameters\n";
1182 +@@ -231,9 +232,9 @@ sub do_nm
1183 + }
1184 + ($source = $basename) =~ s/\.o$//;
1185 + if (-e "$source.c" || -e "$source.S") {
1186 +- $source = "$objtree$File::Find::dir/$source";
1187 ++ $source = File::Spec->catfile($objtree, $File::Find::dir, $source)
1188 + } else {
1189 +- $source = "$srctree$File::Find::dir/$source";
1190 ++ $source = File::Spec->catfile($srctree, $File::Find::dir, $source)
1191 + }
1192 + if (! -e "$source.c" && ! -e "$source.S") {
1193 + # No obvious source, exclude the object if it is conglomerate
1194 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1195 +index d45c85dcf9d9..a64612db1f15 100644
1196 +--- a/sound/pci/hda/patch_realtek.c
1197 ++++ b/sound/pci/hda/patch_realtek.c
1198 +@@ -353,6 +353,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
1199 + case 0x10ec0700:
1200 + case 0x10ec0701:
1201 + case 0x10ec0703:
1202 ++ case 0x10ec0711:
1203 + alc_update_coef_idx(codec, 0x10, 1<<15, 0);
1204 + break;
1205 + case 0x10ec0662:
1206 +@@ -6424,6 +6425,7 @@ static int patch_alc269(struct hda_codec *codec)
1207 + case 0x10ec0700:
1208 + case 0x10ec0701:
1209 + case 0x10ec0703:
1210 ++ case 0x10ec0711:
1211 + spec->codec_variant = ALC269_TYPE_ALC700;
1212 + spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
1213 + alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
1214 +@@ -7464,6 +7466,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
1215 + HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
1216 + HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
1217 + HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
1218 ++ HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
1219 + HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
1220 + HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
1221 + HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
1222 +diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
1223 +index 91b444db575e..5346b3cafc67 100644
1224 +--- a/sound/soc/sh/rcar/core.c
1225 ++++ b/sound/soc/sh/rcar/core.c
1226 +@@ -629,6 +629,7 @@ static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1227 + }
1228 +
1229 + /* set format */
1230 ++ rdai->bit_clk_inv = 0;
1231 + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
1232 + case SND_SOC_DAIFMT_I2S:
1233 + rdai->sys_delay = 0;