Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Thu, 09 Feb 2017 08:05:36
Message-Id: 1486627501.4fc2f0ccf7c416e755b61c424534f034c190ae92.alicef@gentoo
1 commit: 4fc2f0ccf7c416e755b61c424534f034c190ae92
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 9 08:05:01 2017 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 9 08:05:01 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=4fc2f0cc
7
8 Linux patch 4.4.48
9
10 0000_README | 4 +
11 1047_linux-4.4.48.patch | 1022 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1026 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 4286b42..44fe826 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -231,6 +231,10 @@ Patch: 1046_linux-4.4.47.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.47
21
22 +Patch: 1047_linux-4.4.48.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.48
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/1047_linux-4.4.48.patch b/1047_linux-4.4.48.patch
31 new file mode 100644
32 index 0000000..baf0a00
33 --- /dev/null
34 +++ b/1047_linux-4.4.48.patch
35 @@ -0,0 +1,1022 @@
36 +diff --git a/Makefile b/Makefile
37 +index 7b233ac7f86c..0793cd412656 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 4
43 +-SUBLEVEL = 47
44 ++SUBLEVEL = 48
45 + EXTRAVERSION =
46 + NAME = Blurry Fish Butt
47 +
48 +diff --git a/arch/arm64/crypto/aes-modes.S b/arch/arm64/crypto/aes-modes.S
49 +index c53dbeae79f2..838dad5c209f 100644
50 +--- a/arch/arm64/crypto/aes-modes.S
51 ++++ b/arch/arm64/crypto/aes-modes.S
52 +@@ -193,15 +193,16 @@ AES_ENTRY(aes_cbc_encrypt)
53 + cbz w6, .Lcbcencloop
54 +
55 + ld1 {v0.16b}, [x5] /* get iv */
56 +- enc_prepare w3, x2, x5
57 ++ enc_prepare w3, x2, x6
58 +
59 + .Lcbcencloop:
60 + ld1 {v1.16b}, [x1], #16 /* get next pt block */
61 + eor v0.16b, v0.16b, v1.16b /* ..and xor with iv */
62 +- encrypt_block v0, w3, x2, x5, w6
63 ++ encrypt_block v0, w3, x2, x6, w7
64 + st1 {v0.16b}, [x0], #16
65 + subs w4, w4, #1
66 + bne .Lcbcencloop
67 ++ st1 {v0.16b}, [x5] /* return iv */
68 + ret
69 + AES_ENDPROC(aes_cbc_encrypt)
70 +
71 +@@ -211,7 +212,7 @@ AES_ENTRY(aes_cbc_decrypt)
72 + cbz w6, .LcbcdecloopNx
73 +
74 + ld1 {v7.16b}, [x5] /* get iv */
75 +- dec_prepare w3, x2, x5
76 ++ dec_prepare w3, x2, x6
77 +
78 + .LcbcdecloopNx:
79 + #if INTERLEAVE >= 2
80 +@@ -248,7 +249,7 @@ AES_ENTRY(aes_cbc_decrypt)
81 + .Lcbcdecloop:
82 + ld1 {v1.16b}, [x1], #16 /* get next ct block */
83 + mov v0.16b, v1.16b /* ...and copy to v0 */
84 +- decrypt_block v0, w3, x2, x5, w6
85 ++ decrypt_block v0, w3, x2, x6, w7
86 + eor v0.16b, v0.16b, v7.16b /* xor with iv => pt */
87 + mov v7.16b, v1.16b /* ct is next iv */
88 + st1 {v0.16b}, [x0], #16
89 +@@ -256,6 +257,7 @@ AES_ENTRY(aes_cbc_decrypt)
90 + bne .Lcbcdecloop
91 + .Lcbcdecout:
92 + FRAME_POP
93 ++ st1 {v7.16b}, [x5] /* return iv */
94 + ret
95 + AES_ENDPROC(aes_cbc_decrypt)
96 +
97 +@@ -267,24 +269,15 @@ AES_ENDPROC(aes_cbc_decrypt)
98 +
99 + AES_ENTRY(aes_ctr_encrypt)
100 + FRAME_PUSH
101 +- cbnz w6, .Lctrfirst /* 1st time around? */
102 +- umov x5, v4.d[1] /* keep swabbed ctr in reg */
103 +- rev x5, x5
104 +-#if INTERLEAVE >= 2
105 +- cmn w5, w4 /* 32 bit overflow? */
106 +- bcs .Lctrinc
107 +- add x5, x5, #1 /* increment BE ctr */
108 +- b .LctrincNx
109 +-#else
110 +- b .Lctrinc
111 +-#endif
112 +-.Lctrfirst:
113 ++ cbz w6, .Lctrnotfirst /* 1st time around? */
114 + enc_prepare w3, x2, x6
115 + ld1 {v4.16b}, [x5]
116 +- umov x5, v4.d[1] /* keep swabbed ctr in reg */
117 +- rev x5, x5
118 ++
119 ++.Lctrnotfirst:
120 ++ umov x8, v4.d[1] /* keep swabbed ctr in reg */
121 ++ rev x8, x8
122 + #if INTERLEAVE >= 2
123 +- cmn w5, w4 /* 32 bit overflow? */
124 ++ cmn w8, w4 /* 32 bit overflow? */
125 + bcs .Lctrloop
126 + .LctrloopNx:
127 + subs w4, w4, #INTERLEAVE
128 +@@ -292,11 +285,11 @@ AES_ENTRY(aes_ctr_encrypt)
129 + #if INTERLEAVE == 2
130 + mov v0.8b, v4.8b
131 + mov v1.8b, v4.8b
132 +- rev x7, x5
133 +- add x5, x5, #1
134 ++ rev x7, x8
135 ++ add x8, x8, #1
136 + ins v0.d[1], x7
137 +- rev x7, x5
138 +- add x5, x5, #1
139 ++ rev x7, x8
140 ++ add x8, x8, #1
141 + ins v1.d[1], x7
142 + ld1 {v2.16b-v3.16b}, [x1], #32 /* get 2 input blocks */
143 + do_encrypt_block2x
144 +@@ -305,7 +298,7 @@ AES_ENTRY(aes_ctr_encrypt)
145 + st1 {v0.16b-v1.16b}, [x0], #32
146 + #else
147 + ldr q8, =0x30000000200000001 /* addends 1,2,3[,0] */
148 +- dup v7.4s, w5
149 ++ dup v7.4s, w8
150 + mov v0.16b, v4.16b
151 + add v7.4s, v7.4s, v8.4s
152 + mov v1.16b, v4.16b
153 +@@ -323,18 +316,12 @@ AES_ENTRY(aes_ctr_encrypt)
154 + eor v2.16b, v7.16b, v2.16b
155 + eor v3.16b, v5.16b, v3.16b
156 + st1 {v0.16b-v3.16b}, [x0], #64
157 +- add x5, x5, #INTERLEAVE
158 ++ add x8, x8, #INTERLEAVE
159 + #endif
160 +- cbz w4, .LctroutNx
161 +-.LctrincNx:
162 +- rev x7, x5
163 ++ rev x7, x8
164 + ins v4.d[1], x7
165 ++ cbz w4, .Lctrout
166 + b .LctrloopNx
167 +-.LctroutNx:
168 +- sub x5, x5, #1
169 +- rev x7, x5
170 +- ins v4.d[1], x7
171 +- b .Lctrout
172 + .Lctr1x:
173 + adds w4, w4, #INTERLEAVE
174 + beq .Lctrout
175 +@@ -342,30 +329,39 @@ AES_ENTRY(aes_ctr_encrypt)
176 + .Lctrloop:
177 + mov v0.16b, v4.16b
178 + encrypt_block v0, w3, x2, x6, w7
179 ++
180 ++ adds x8, x8, #1 /* increment BE ctr */
181 ++ rev x7, x8
182 ++ ins v4.d[1], x7
183 ++ bcs .Lctrcarry /* overflow? */
184 ++
185 ++.Lctrcarrydone:
186 + subs w4, w4, #1
187 + bmi .Lctrhalfblock /* blocks < 0 means 1/2 block */
188 + ld1 {v3.16b}, [x1], #16
189 + eor v3.16b, v0.16b, v3.16b
190 + st1 {v3.16b}, [x0], #16
191 +- beq .Lctrout
192 +-.Lctrinc:
193 +- adds x5, x5, #1 /* increment BE ctr */
194 +- rev x7, x5
195 +- ins v4.d[1], x7
196 +- bcc .Lctrloop /* no overflow? */
197 +- umov x7, v4.d[0] /* load upper word of ctr */
198 +- rev x7, x7 /* ... to handle the carry */
199 +- add x7, x7, #1
200 +- rev x7, x7
201 +- ins v4.d[0], x7
202 +- b .Lctrloop
203 ++ bne .Lctrloop
204 ++
205 ++.Lctrout:
206 ++ st1 {v4.16b}, [x5] /* return next CTR value */
207 ++ FRAME_POP
208 ++ ret
209 ++
210 + .Lctrhalfblock:
211 + ld1 {v3.8b}, [x1]
212 + eor v3.8b, v0.8b, v3.8b
213 + st1 {v3.8b}, [x0]
214 +-.Lctrout:
215 + FRAME_POP
216 + ret
217 ++
218 ++.Lctrcarry:
219 ++ umov x7, v4.d[0] /* load upper word of ctr */
220 ++ rev x7, x7 /* ... to handle the carry */
221 ++ add x7, x7, #1
222 ++ rev x7, x7
223 ++ ins v4.d[0], x7
224 ++ b .Lctrcarrydone
225 + AES_ENDPROC(aes_ctr_encrypt)
226 + .ltorg
227 +
228 +diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
229 +index 300382e5a2cc..c314db8b798c 100644
230 +--- a/arch/powerpc/kernel/eeh_driver.c
231 ++++ b/arch/powerpc/kernel/eeh_driver.c
232 +@@ -485,7 +485,7 @@ static void *eeh_pe_detach_dev(void *data, void *userdata)
233 + static void *__eeh_clear_pe_frozen_state(void *data, void *flag)
234 + {
235 + struct eeh_pe *pe = (struct eeh_pe *)data;
236 +- bool *clear_sw_state = flag;
237 ++ bool clear_sw_state = *(bool *)flag;
238 + int i, rc = 1;
239 +
240 + for (i = 0; rc && i < 3; i++)
241 +diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
242 +index 7b89e7b305e6..3139533640fc 100644
243 +--- a/arch/powerpc/kernel/prom_init.c
244 ++++ b/arch/powerpc/kernel/prom_init.c
245 +@@ -2664,6 +2664,9 @@ static void __init prom_find_boot_cpu(void)
246 +
247 + cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
248 +
249 ++ if (!PHANDLE_VALID(cpu_pkg))
250 ++ return;
251 ++
252 + prom_getprop(cpu_pkg, "reg", &rval, sizeof(rval));
253 + prom.cpu = be32_to_cpu(rval);
254 +
255 +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
256 +index aaacbd667212..1e5d2f07416b 100644
257 +--- a/arch/x86/kernel/apic/io_apic.c
258 ++++ b/arch/x86/kernel/apic/io_apic.c
259 +@@ -2117,6 +2117,7 @@ static inline void __init check_timer(void)
260 + if (idx != -1 && irq_trigger(idx))
261 + unmask_ioapic_irq(irq_get_chip_data(0));
262 + }
263 ++ irq_domain_deactivate_irq(irq_data);
264 + irq_domain_activate_irq(irq_data);
265 + if (timer_irq_works()) {
266 + if (disable_timer_pin_1 > 0)
267 +@@ -2138,6 +2139,7 @@ static inline void __init check_timer(void)
268 + * legacy devices should be connected to IO APIC #0
269 + */
270 + replace_pin_at_irq_node(data, node, apic1, pin1, apic2, pin2);
271 ++ irq_domain_deactivate_irq(irq_data);
272 + irq_domain_activate_irq(irq_data);
273 + legacy_pic->unmask(0);
274 + if (timer_irq_works()) {
275 +diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
276 +index b8e6ff5cd5d0..acc9b8f19ca8 100644
277 +--- a/arch/x86/kernel/hpet.c
278 ++++ b/arch/x86/kernel/hpet.c
279 +@@ -351,6 +351,7 @@ static int hpet_resume(struct clock_event_device *evt, int timer)
280 + } else {
281 + struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
282 +
283 ++ irq_domain_deactivate_irq(irq_get_irq_data(hdev->irq));
284 + irq_domain_activate_irq(irq_get_irq_data(hdev->irq));
285 + disable_irq(hdev->irq);
286 + irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu));
287 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
288 +index 25a6efcfdf7f..e75095fa414e 100644
289 +--- a/arch/x86/kvm/x86.c
290 ++++ b/arch/x86/kvm/x86.c
291 +@@ -3057,6 +3057,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
292 + memcpy(dest, xsave, XSAVE_HDR_OFFSET);
293 +
294 + /* Set XSTATE_BV */
295 ++ xstate_bv &= vcpu->arch.guest_supported_xcr0 | XFEATURE_MASK_FPSSE;
296 + *(u64 *)(dest + XSAVE_HDR_OFFSET) = xstate_bv;
297 +
298 + /*
299 +diff --git a/crypto/algapi.c b/crypto/algapi.c
300 +index 59bf491fe3d8..43f5bdb6b570 100644
301 +--- a/crypto/algapi.c
302 ++++ b/crypto/algapi.c
303 +@@ -357,6 +357,7 @@ int crypto_register_alg(struct crypto_alg *alg)
304 + struct crypto_larval *larval;
305 + int err;
306 +
307 ++ alg->cra_flags &= ~CRYPTO_ALG_DEAD;
308 + err = crypto_check_alg(alg);
309 + if (err)
310 + return err;
311 +diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
312 +index bd370c98f77d..b0b77b61c40c 100644
313 +--- a/drivers/ata/libata-core.c
314 ++++ b/drivers/ata/libata-core.c
315 +@@ -4139,10 +4139,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
316 + { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 },
317 +
318 + /*
319 +- * Device times out with higher max sects.
320 ++ * These devices time out with higher max sects.
321 + * https://bugzilla.kernel.org/show_bug.cgi?id=121671
322 + */
323 +- { "LITEON CX1-JB256-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 },
324 ++ { "LITEON CX1-JB*-HP", NULL, ATA_HORKAGE_MAX_SEC_1024 },
325 +
326 + /* Devices we expect to fail diagnostics */
327 +
328 +diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
329 +index bd74ee555278..729f26322095 100644
330 +--- a/drivers/ata/sata_mv.c
331 ++++ b/drivers/ata/sata_mv.c
332 +@@ -4121,6 +4121,9 @@ static int mv_platform_probe(struct platform_device *pdev)
333 + host->iomap = NULL;
334 + hpriv->base = devm_ioremap(&pdev->dev, res->start,
335 + resource_size(res));
336 ++ if (!hpriv->base)
337 ++ return -ENOMEM;
338 ++
339 + hpriv->base -= SATAHC0_REG_BASE;
340 +
341 + hpriv->clk = clk_get(&pdev->dev, NULL);
342 +diff --git a/drivers/base/memory.c b/drivers/base/memory.c
343 +index 25425d3f2575..48c0a1d0dd3a 100644
344 +--- a/drivers/base/memory.c
345 ++++ b/drivers/base/memory.c
346 +@@ -388,30 +388,29 @@ static ssize_t show_valid_zones(struct device *dev,
347 + {
348 + struct memory_block *mem = to_memory_block(dev);
349 + unsigned long start_pfn, end_pfn;
350 ++ unsigned long valid_start, valid_end;
351 + unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
352 +- struct page *first_page;
353 + struct zone *zone;
354 +
355 + start_pfn = section_nr_to_pfn(mem->start_section_nr);
356 + end_pfn = start_pfn + nr_pages;
357 +- first_page = pfn_to_page(start_pfn);
358 +
359 + /* The block contains more than one zone can not be offlined. */
360 +- if (!test_pages_in_a_zone(start_pfn, end_pfn))
361 ++ if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start, &valid_end))
362 + return sprintf(buf, "none\n");
363 +
364 +- zone = page_zone(first_page);
365 ++ zone = page_zone(pfn_to_page(valid_start));
366 +
367 + if (zone_idx(zone) == ZONE_MOVABLE - 1) {
368 + /*The mem block is the last memoryblock of this zone.*/
369 +- if (end_pfn == zone_end_pfn(zone))
370 ++ if (valid_end == zone_end_pfn(zone))
371 + return sprintf(buf, "%s %s\n",
372 + zone->name, (zone + 1)->name);
373 + }
374 +
375 + if (zone_idx(zone) == ZONE_MOVABLE) {
376 + /*The mem block is the first memoryblock of ZONE_MOVABLE.*/
377 +- if (start_pfn == zone->zone_start_pfn)
378 ++ if (valid_start == zone->zone_start_pfn)
379 + return sprintf(buf, "%s %s\n",
380 + zone->name, (zone - 1)->name);
381 + }
382 +diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
383 +index 956a833b8200..57c7389feee4 100644
384 +--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
385 ++++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
386 +@@ -222,6 +222,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
387 + uint32_t mpllP;
388 +
389 + pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
390 ++ mpllP = (mpllP >> 8) & 0xf;
391 + if (!mpllP)
392 + mpllP = 4;
393 +
394 +@@ -232,7 +233,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
395 + uint32_t clock;
396 +
397 + pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
398 +- return clock;
399 ++ return clock / 1000;
400 + }
401 +
402 + ret = nouveau_hw_get_pllvals(dev, plltype, &pllvals);
403 +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
404 +index c1590b746f13..eb58cd7bfbc9 100644
405 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
406 ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagt215.c
407 +@@ -59,7 +59,7 @@ gt215_hda_eld(NV50_DISP_MTHD_V1)
408 + );
409 + }
410 + for (i = 0; i < size; i++)
411 +- nvkm_wr32(device, 0x61c440 + soff, (i << 8) | args->v0.data[0]);
412 ++ nvkm_wr32(device, 0x61c440 + soff, (i << 8) | args->v0.data[i]);
413 + for (; i < 0x60; i++)
414 + nvkm_wr32(device, 0x61c440 + soff, (i << 8));
415 + nvkm_mask(device, 0x61c448 + soff, 0x80000003, 0x80000003);
416 +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
417 +index 5c02d7bbc7f2..35e3fd9fadf6 100644
418 +--- a/drivers/hid/wacom_wac.c
419 ++++ b/drivers/hid/wacom_wac.c
420 +@@ -148,19 +148,21 @@ static int wacom_pl_irq(struct wacom_wac *wacom)
421 + wacom->id[0] = STYLUS_DEVICE_ID;
422 + }
423 +
424 +- pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));
425 +- if (features->pressure_max > 255)
426 +- pressure = (pressure << 1) | ((data[4] >> 6) & 1);
427 +- pressure += (features->pressure_max + 1) / 2;
428 +-
429 +- input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));
430 +- input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));
431 +- input_report_abs(input, ABS_PRESSURE, pressure);
432 +-
433 +- input_report_key(input, BTN_TOUCH, data[4] & 0x08);
434 +- input_report_key(input, BTN_STYLUS, data[4] & 0x10);
435 +- /* Only allow the stylus2 button to be reported for the pen tool. */
436 +- input_report_key(input, BTN_STYLUS2, (wacom->tool[0] == BTN_TOOL_PEN) && (data[4] & 0x20));
437 ++ if (prox) {
438 ++ pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));
439 ++ if (features->pressure_max > 255)
440 ++ pressure = (pressure << 1) | ((data[4] >> 6) & 1);
441 ++ pressure += (features->pressure_max + 1) / 2;
442 ++
443 ++ input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));
444 ++ input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));
445 ++ input_report_abs(input, ABS_PRESSURE, pressure);
446 ++
447 ++ input_report_key(input, BTN_TOUCH, data[4] & 0x08);
448 ++ input_report_key(input, BTN_STYLUS, data[4] & 0x10);
449 ++ /* Only allow the stylus2 button to be reported for the pen tool. */
450 ++ input_report_key(input, BTN_STYLUS2, (wacom->tool[0] == BTN_TOOL_PEN) && (data[4] & 0x20));
451 ++ }
452 +
453 + if (!prox)
454 + wacom->id[0] = 0;
455 +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
456 +index 7277dfd7338f..bda164089904 100644
457 +--- a/drivers/mmc/host/sdhci.c
458 ++++ b/drivers/mmc/host/sdhci.c
459 +@@ -2629,7 +2629,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
460 + pr_err("%s: Card is consuming too much power!\n",
461 + mmc_hostname(host->mmc));
462 +
463 +- if (intmask & SDHCI_INT_CARD_INT) {
464 ++ if ((intmask & SDHCI_INT_CARD_INT) &&
465 ++ (host->ier & SDHCI_INT_CARD_INT)) {
466 + sdhci_enable_sdio_irq_nolock(host, false);
467 + host->thread_isr |= SDHCI_INT_CARD_INT;
468 + result = IRQ_WAKE_THREAD;
469 +diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
470 +index 317e3558a35e..c6a012b5ba39 100644
471 +--- a/drivers/pci/pcie/aspm.c
472 ++++ b/drivers/pci/pcie/aspm.c
473 +@@ -518,25 +518,32 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev)
474 + link = kzalloc(sizeof(*link), GFP_KERNEL);
475 + if (!link)
476 + return NULL;
477 ++
478 + INIT_LIST_HEAD(&link->sibling);
479 + INIT_LIST_HEAD(&link->children);
480 + INIT_LIST_HEAD(&link->link);
481 + link->pdev = pdev;
482 +- if (pci_pcie_type(pdev) != PCI_EXP_TYPE_ROOT_PORT) {
483 ++
484 ++ /*
485 ++ * Root Ports and PCI/PCI-X to PCIe Bridges are roots of PCIe
486 ++ * hierarchies.
487 ++ */
488 ++ if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT ||
489 ++ pci_pcie_type(pdev) == PCI_EXP_TYPE_PCIE_BRIDGE) {
490 ++ link->root = link;
491 ++ } else {
492 + struct pcie_link_state *parent;
493 ++
494 + parent = pdev->bus->parent->self->link_state;
495 + if (!parent) {
496 + kfree(link);
497 + return NULL;
498 + }
499 ++
500 + link->parent = parent;
501 ++ link->root = link->parent->root;
502 + list_add(&link->link, &parent->children);
503 + }
504 +- /* Setup a pointer to the root port link */
505 +- if (!link->parent)
506 +- link->root = link;
507 +- else
508 +- link->root = link->parent->root;
509 +
510 + list_add(&link->sibling, &link_list);
511 + pdev->link_state = link;
512 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
513 +index d2e50a27140c..24f9f98968a5 100644
514 +--- a/drivers/usb/core/quirks.c
515 ++++ b/drivers/usb/core/quirks.c
516 +@@ -37,6 +37,10 @@ static const struct usb_device_id usb_quirk_list[] = {
517 + /* CBM - Flash disk */
518 + { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
519 +
520 ++ /* WORLDE easy key (easykey.25) MIDI controller */
521 ++ { USB_DEVICE(0x0218, 0x0401), .driver_info =
522 ++ USB_QUIRK_CONFIG_INTF_STRINGS },
523 ++
524 + /* HP 5300/5370C scanner */
525 + { USB_DEVICE(0x03f0, 0x0701), .driver_info =
526 + USB_QUIRK_STRING_FETCH_255 },
527 +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
528 +index 803c503a2e3d..cfda1a1c0ab6 100644
529 +--- a/drivers/usb/gadget/function/f_fs.c
530 ++++ b/drivers/usb/gadget/function/f_fs.c
531 +@@ -2079,6 +2079,8 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
532 + if (len < sizeof(*d) || h->interface >= ffs->interfaces_count)
533 + return -EINVAL;
534 + length = le32_to_cpu(d->dwSize);
535 ++ if (len < length)
536 ++ return -EINVAL;
537 + type = le32_to_cpu(d->dwPropertyDataType);
538 + if (type < USB_EXT_PROP_UNICODE ||
539 + type > USB_EXT_PROP_UNICODE_MULTI) {
540 +@@ -2087,6 +2089,11 @@ static int __ffs_data_do_os_desc(enum ffs_os_desc_type type,
541 + return -EINVAL;
542 + }
543 + pnl = le16_to_cpu(d->wPropertyNameLength);
544 ++ if (length < 14 + pnl) {
545 ++ pr_vdebug("invalid os descriptor length: %d pnl:%d (descriptor %d)\n",
546 ++ length, pnl, type);
547 ++ return -EINVAL;
548 ++ }
549 + pdl = le32_to_cpu(*(u32 *)((u8 *)data + 10 + pnl));
550 + if (length != 14 + pnl + pdl) {
551 + pr_vdebug("invalid os descriptor length: %d pnl:%d pdl:%d (descriptor %d)\n",
552 +@@ -2171,6 +2178,9 @@ static int __ffs_data_got_descs(struct ffs_data *ffs,
553 + }
554 + }
555 + if (flags & (1 << i)) {
556 ++ if (len < 4) {
557 ++ goto error;
558 ++ }
559 + os_descs_count = get_unaligned_le32(data);
560 + data += 4;
561 + len -= 4;
562 +@@ -2243,7 +2253,8 @@ static int __ffs_data_got_strings(struct ffs_data *ffs,
563 +
564 + ENTER();
565 +
566 +- if (unlikely(get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC ||
567 ++ if (unlikely(len < 16 ||
568 ++ get_unaligned_le32(data) != FUNCTIONFS_STRINGS_MAGIC ||
569 + get_unaligned_le32(data + 4) != len))
570 + goto error;
571 + str_count = get_unaligned_le32(data + 8);
572 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
573 +index 7ce31a4c7e7f..42cc72e54c05 100644
574 +--- a/drivers/usb/serial/option.c
575 ++++ b/drivers/usb/serial/option.c
576 +@@ -2007,6 +2007,7 @@ static const struct usb_device_id option_ids[] = {
577 + { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD200, 0xff, 0xff, 0xff) },
578 + { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_6802, 0xff, 0xff, 0xff) },
579 + { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD300, 0xff, 0xff, 0xff) },
580 ++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */
581 + { } /* Terminating entry */
582 + };
583 + MODULE_DEVICE_TABLE(usb, option_ids);
584 +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
585 +index 46fca6b75846..1db4b61bdf7b 100644
586 +--- a/drivers/usb/serial/pl2303.c
587 ++++ b/drivers/usb/serial/pl2303.c
588 +@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = {
589 + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
590 + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
591 + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
592 ++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) },
593 + { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) },
594 + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
595 + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID_UCSGT) },
596 +diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
597 +index e3b7af8adfb7..09d9be88209e 100644
598 +--- a/drivers/usb/serial/pl2303.h
599 ++++ b/drivers/usb/serial/pl2303.h
600 +@@ -27,6 +27,7 @@
601 + #define ATEN_VENDOR_ID 0x0557
602 + #define ATEN_VENDOR_ID2 0x0547
603 + #define ATEN_PRODUCT_ID 0x2008
604 ++#define ATEN_PRODUCT_ID2 0x2118
605 +
606 + #define IODATA_VENDOR_ID 0x04bb
607 + #define IODATA_PRODUCT_ID 0x0a03
608 +diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
609 +index 1bc6089b9008..696458db7e3c 100644
610 +--- a/drivers/usb/serial/qcserial.c
611 ++++ b/drivers/usb/serial/qcserial.c
612 +@@ -124,6 +124,7 @@ static const struct usb_device_id id_table[] = {
613 + {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */
614 + {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */
615 + {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
616 ++ {USB_DEVICE(0x413c, 0x81a6)}, /* Dell DW5570 QDL (MC8805) */
617 + {USB_DEVICE(0x1199, 0x68a4)}, /* Sierra Wireless QDL */
618 + {USB_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
619 + {USB_DEVICE(0x1199, 0x68a8)}, /* Sierra Wireless QDL */
620 +diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
621 +index 833e5844a2db..97d1a15873c5 100644
622 +--- a/fs/cifs/readdir.c
623 ++++ b/fs/cifs/readdir.c
624 +@@ -282,6 +282,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file)
625 + rc = -ENOMEM;
626 + goto error_exit;
627 + }
628 ++ spin_lock_init(&cifsFile->file_info_lock);
629 + file->private_data = cifsFile;
630 + cifsFile->tlink = cifs_get_tlink(tlink);
631 + tcon = tlink_tcon(tlink);
632 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
633 +index 68640e6f95c5..b405a7b74ce0 100644
634 +--- a/fs/ext4/super.c
635 ++++ b/fs/ext4/super.c
636 +@@ -3663,6 +3663,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
637 + (EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb)));
638 + db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
639 + EXT4_DESC_PER_BLOCK(sb);
640 ++ if (ext4_has_feature_meta_bg(sb)) {
641 ++ if (le32_to_cpu(es->s_first_meta_bg) >= db_count) {
642 ++ ext4_msg(sb, KERN_WARNING,
643 ++ "first meta block group too large: %u "
644 ++ "(group descriptor block count %u)",
645 ++ le32_to_cpu(es->s_first_meta_bg), db_count);
646 ++ goto failed_mount;
647 ++ }
648 ++ }
649 + sbi->s_group_desc = ext4_kvmalloc(db_count *
650 + sizeof(struct buffer_head *),
651 + GFP_KERNEL);
652 +diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
653 +index c9d6c715c0fb..9eed219f57a5 100644
654 +--- a/fs/nfsd/nfs4layouts.c
655 ++++ b/fs/nfsd/nfs4layouts.c
656 +@@ -189,10 +189,11 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
657 + struct nfs4_layout_stateid *ls;
658 + struct nfs4_stid *stp;
659 +
660 +- stp = nfs4_alloc_stid(cstate->clp, nfs4_layout_stateid_cache);
661 ++ stp = nfs4_alloc_stid(cstate->clp, nfs4_layout_stateid_cache,
662 ++ nfsd4_free_layout_stateid);
663 + if (!stp)
664 + return NULL;
665 +- stp->sc_free = nfsd4_free_layout_stateid;
666 ++
667 + get_nfs4_file(fp);
668 + stp->sc_file = fp;
669 +
670 +diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
671 +index 55638110cb06..c7f1ce41442a 100644
672 +--- a/fs/nfsd/nfs4state.c
673 ++++ b/fs/nfsd/nfs4state.c
674 +@@ -553,8 +553,8 @@ out:
675 + return co;
676 + }
677 +
678 +-struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl,
679 +- struct kmem_cache *slab)
680 ++struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl, struct kmem_cache *slab,
681 ++ void (*sc_free)(struct nfs4_stid *))
682 + {
683 + struct nfs4_stid *stid;
684 + int new_id;
685 +@@ -570,6 +570,8 @@ struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl,
686 + idr_preload_end();
687 + if (new_id < 0)
688 + goto out_free;
689 ++
690 ++ stid->sc_free = sc_free;
691 + stid->sc_client = cl;
692 + stid->sc_stateid.si_opaque.so_id = new_id;
693 + stid->sc_stateid.si_opaque.so_clid = cl->cl_clientid;
694 +@@ -595,15 +597,12 @@ out_free:
695 + static struct nfs4_ol_stateid * nfs4_alloc_open_stateid(struct nfs4_client *clp)
696 + {
697 + struct nfs4_stid *stid;
698 +- struct nfs4_ol_stateid *stp;
699 +
700 +- stid = nfs4_alloc_stid(clp, stateid_slab);
701 ++ stid = nfs4_alloc_stid(clp, stateid_slab, nfs4_free_ol_stateid);
702 + if (!stid)
703 + return NULL;
704 +
705 +- stp = openlockstateid(stid);
706 +- stp->st_stid.sc_free = nfs4_free_ol_stateid;
707 +- return stp;
708 ++ return openlockstateid(stid);
709 + }
710 +
711 + static void nfs4_free_deleg(struct nfs4_stid *stid)
712 +@@ -701,11 +700,10 @@ alloc_init_deleg(struct nfs4_client *clp, struct svc_fh *current_fh,
713 + goto out_dec;
714 + if (delegation_blocked(&current_fh->fh_handle))
715 + goto out_dec;
716 +- dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab));
717 ++ dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab, nfs4_free_deleg));
718 + if (dp == NULL)
719 + goto out_dec;
720 +
721 +- dp->dl_stid.sc_free = nfs4_free_deleg;
722 + /*
723 + * delegation seqid's are never incremented. The 4.1 special
724 + * meaning of seqid 0 isn't meaningful, really, but let's avoid
725 +@@ -5396,7 +5394,6 @@ init_lock_stateid(struct nfs4_ol_stateid *stp, struct nfs4_lockowner *lo,
726 + stp->st_stateowner = nfs4_get_stateowner(&lo->lo_owner);
727 + get_nfs4_file(fp);
728 + stp->st_stid.sc_file = fp;
729 +- stp->st_stid.sc_free = nfs4_free_lock_stateid;
730 + stp->st_access_bmap = 0;
731 + stp->st_deny_bmap = open_stp->st_deny_bmap;
732 + stp->st_openstp = open_stp;
733 +@@ -5439,7 +5436,7 @@ find_or_create_lock_stateid(struct nfs4_lockowner *lo, struct nfs4_file *fi,
734 + lst = find_lock_stateid(lo, fi);
735 + if (lst == NULL) {
736 + spin_unlock(&clp->cl_lock);
737 +- ns = nfs4_alloc_stid(clp, stateid_slab);
738 ++ ns = nfs4_alloc_stid(clp, stateid_slab, nfs4_free_lock_stateid);
739 + if (ns == NULL)
740 + return NULL;
741 +
742 +diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
743 +index 77860b75da9d..5134eedcb16c 100644
744 +--- a/fs/nfsd/state.h
745 ++++ b/fs/nfsd/state.h
746 +@@ -583,8 +583,8 @@ extern __be32 nfs4_preprocess_stateid_op(struct svc_rqst *rqstp,
747 + __be32 nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
748 + stateid_t *stateid, unsigned char typemask,
749 + struct nfs4_stid **s, struct nfsd_net *nn);
750 +-struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl,
751 +- struct kmem_cache *slab);
752 ++struct nfs4_stid *nfs4_alloc_stid(struct nfs4_client *cl, struct kmem_cache *slab,
753 ++ void (*sc_free)(struct nfs4_stid *));
754 + void nfs4_unhash_stid(struct nfs4_stid *s);
755 + void nfs4_put_stid(struct nfs4_stid *s);
756 + void nfs4_inc_and_copy_stateid(stateid_t *dst, struct nfs4_stid *stid);
757 +diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
758 +index 2ea574ff9714..538488bd1d3d 100644
759 +--- a/include/linux/memory_hotplug.h
760 ++++ b/include/linux/memory_hotplug.h
761 +@@ -85,7 +85,8 @@ extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
762 + extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
763 + /* VM interface that may be used by firmware interface */
764 + extern int online_pages(unsigned long, unsigned long, int);
765 +-extern int test_pages_in_a_zone(unsigned long, unsigned long);
766 ++extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
767 ++ unsigned long *valid_start, unsigned long *valid_end);
768 + extern void __offline_isolated_pages(unsigned long, unsigned long);
769 +
770 + typedef void (*online_page_callback_t)(struct page *page);
771 +diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
772 +index 12c9b485beb7..abd7c01c84db 100644
773 +--- a/include/linux/percpu-refcount.h
774 ++++ b/include/linux/percpu-refcount.h
775 +@@ -206,7 +206,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref)
776 + static inline bool percpu_ref_tryget(struct percpu_ref *ref)
777 + {
778 + unsigned long __percpu *percpu_count;
779 +- int ret;
780 ++ bool ret;
781 +
782 + rcu_read_lock_sched();
783 +
784 +@@ -240,7 +240,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref *ref)
785 + static inline bool percpu_ref_tryget_live(struct percpu_ref *ref)
786 + {
787 + unsigned long __percpu *percpu_count;
788 +- int ret = false;
789 ++ bool ret = false;
790 +
791 + rcu_read_lock_sched();
792 +
793 +diff --git a/kernel/events/core.c b/kernel/events/core.c
794 +index bc6371b0e4fb..9bbe9ac23cf2 100644
795 +--- a/kernel/events/core.c
796 ++++ b/kernel/events/core.c
797 +@@ -6039,6 +6039,27 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
798 + char *buf = NULL;
799 + char *name;
800 +
801 ++ if (vma->vm_flags & VM_READ)
802 ++ prot |= PROT_READ;
803 ++ if (vma->vm_flags & VM_WRITE)
804 ++ prot |= PROT_WRITE;
805 ++ if (vma->vm_flags & VM_EXEC)
806 ++ prot |= PROT_EXEC;
807 ++
808 ++ if (vma->vm_flags & VM_MAYSHARE)
809 ++ flags = MAP_SHARED;
810 ++ else
811 ++ flags = MAP_PRIVATE;
812 ++
813 ++ if (vma->vm_flags & VM_DENYWRITE)
814 ++ flags |= MAP_DENYWRITE;
815 ++ if (vma->vm_flags & VM_MAYEXEC)
816 ++ flags |= MAP_EXECUTABLE;
817 ++ if (vma->vm_flags & VM_LOCKED)
818 ++ flags |= MAP_LOCKED;
819 ++ if (vma->vm_flags & VM_HUGETLB)
820 ++ flags |= MAP_HUGETLB;
821 ++
822 + if (file) {
823 + struct inode *inode;
824 + dev_t dev;
825 +@@ -6065,27 +6086,6 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
826 + maj = MAJOR(dev);
827 + min = MINOR(dev);
828 +
829 +- if (vma->vm_flags & VM_READ)
830 +- prot |= PROT_READ;
831 +- if (vma->vm_flags & VM_WRITE)
832 +- prot |= PROT_WRITE;
833 +- if (vma->vm_flags & VM_EXEC)
834 +- prot |= PROT_EXEC;
835 +-
836 +- if (vma->vm_flags & VM_MAYSHARE)
837 +- flags = MAP_SHARED;
838 +- else
839 +- flags = MAP_PRIVATE;
840 +-
841 +- if (vma->vm_flags & VM_DENYWRITE)
842 +- flags |= MAP_DENYWRITE;
843 +- if (vma->vm_flags & VM_MAYEXEC)
844 +- flags |= MAP_EXECUTABLE;
845 +- if (vma->vm_flags & VM_LOCKED)
846 +- flags |= MAP_LOCKED;
847 +- if (vma->vm_flags & VM_HUGETLB)
848 +- flags |= MAP_HUGETLB;
849 +-
850 + goto got_name;
851 + } else {
852 + if (vma->vm_ops && vma->vm_ops->name) {
853 +diff --git a/mm/filemap.c b/mm/filemap.c
854 +index c588d1222b2a..c33c31d75a2b 100644
855 +--- a/mm/filemap.c
856 ++++ b/mm/filemap.c
857 +@@ -1559,6 +1559,11 @@ static ssize_t do_generic_file_read(struct file *filp, loff_t *ppos,
858 +
859 + cond_resched();
860 + find_page:
861 ++ if (fatal_signal_pending(current)) {
862 ++ error = -EINTR;
863 ++ goto out;
864 ++ }
865 ++
866 + page = find_get_page(mapping, index);
867 + if (!page) {
868 + page_cache_sync_readahead(mapping,
869 +diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
870 +index a042a9d537bb..a18923e4359d 100644
871 +--- a/mm/memory_hotplug.c
872 ++++ b/mm/memory_hotplug.c
873 +@@ -1371,17 +1371,20 @@ int is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)
874 + }
875 +
876 + /*
877 +- * Confirm all pages in a range [start, end) is belongs to the same zone.
878 ++ * Confirm all pages in a range [start, end) belong to the same zone.
879 ++ * When true, return its valid [start, end).
880 + */
881 +-int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
882 ++int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
883 ++ unsigned long *valid_start, unsigned long *valid_end)
884 + {
885 + unsigned long pfn, sec_end_pfn;
886 ++ unsigned long start, end;
887 + struct zone *zone = NULL;
888 + struct page *page;
889 + int i;
890 +- for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn);
891 ++ for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn + 1);
892 + pfn < end_pfn;
893 +- pfn = sec_end_pfn + 1, sec_end_pfn += PAGES_PER_SECTION) {
894 ++ pfn = sec_end_pfn, sec_end_pfn += PAGES_PER_SECTION) {
895 + /* Make sure the memory section is present first */
896 + if (!present_section_nr(pfn_to_section_nr(pfn)))
897 + continue;
898 +@@ -1397,10 +1400,20 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
899 + page = pfn_to_page(pfn + i);
900 + if (zone && page_zone(page) != zone)
901 + return 0;
902 ++ if (!zone)
903 ++ start = pfn + i;
904 + zone = page_zone(page);
905 ++ end = pfn + MAX_ORDER_NR_PAGES;
906 + }
907 + }
908 +- return 1;
909 ++
910 ++ if (zone) {
911 ++ *valid_start = start;
912 ++ *valid_end = end;
913 ++ return 1;
914 ++ } else {
915 ++ return 0;
916 ++ }
917 + }
918 +
919 + /*
920 +@@ -1718,6 +1731,7 @@ static int __ref __offline_pages(unsigned long start_pfn,
921 + long offlined_pages;
922 + int ret, drain, retry_max, node;
923 + unsigned long flags;
924 ++ unsigned long valid_start, valid_end;
925 + struct zone *zone;
926 + struct memory_notify arg;
927 +
928 +@@ -1728,10 +1742,10 @@ static int __ref __offline_pages(unsigned long start_pfn,
929 + return -EINVAL;
930 + /* This makes hotplug much easier...and readable.
931 + we assume this for now. .*/
932 +- if (!test_pages_in_a_zone(start_pfn, end_pfn))
933 ++ if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start, &valid_end))
934 + return -EINVAL;
935 +
936 +- zone = page_zone(pfn_to_page(start_pfn));
937 ++ zone = page_zone(pfn_to_page(valid_start));
938 + node = zone_to_nid(zone);
939 + nr_pages = end_pfn - start_pfn;
940 +
941 +diff --git a/mm/zswap.c b/mm/zswap.c
942 +index 340261946fda..45476f429789 100644
943 +--- a/mm/zswap.c
944 ++++ b/mm/zswap.c
945 +@@ -78,7 +78,13 @@ static u64 zswap_duplicate_entry;
946 +
947 + /* Enable/disable zswap (disabled by default) */
948 + static bool zswap_enabled;
949 +-module_param_named(enabled, zswap_enabled, bool, 0644);
950 ++static int zswap_enabled_param_set(const char *,
951 ++ const struct kernel_param *);
952 ++static struct kernel_param_ops zswap_enabled_param_ops = {
953 ++ .set = zswap_enabled_param_set,
954 ++ .get = param_get_bool,
955 ++};
956 ++module_param_cb(enabled, &zswap_enabled_param_ops, &zswap_enabled, 0644);
957 +
958 + /* Crypto compressor to use */
959 + #define ZSWAP_COMPRESSOR_DEFAULT "lzo"
960 +@@ -176,6 +182,9 @@ static atomic_t zswap_pools_count = ATOMIC_INIT(0);
961 + /* used by param callback function */
962 + static bool zswap_init_started;
963 +
964 ++/* fatal error during init */
965 ++static bool zswap_init_failed;
966 ++
967 + /*********************************
968 + * helpers and fwd declarations
969 + **********************************/
970 +@@ -702,6 +711,11 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp,
971 + char *s = strstrip((char *)val);
972 + int ret;
973 +
974 ++ if (zswap_init_failed) {
975 ++ pr_err("can't set param, initialization failed\n");
976 ++ return -ENODEV;
977 ++ }
978 ++
979 + /* no change required */
980 + if (!strcmp(s, *(char **)kp->arg))
981 + return 0;
982 +@@ -781,6 +795,17 @@ static int zswap_zpool_param_set(const char *val,
983 + return __zswap_param_set(val, kp, NULL, zswap_compressor);
984 + }
985 +
986 ++static int zswap_enabled_param_set(const char *val,
987 ++ const struct kernel_param *kp)
988 ++{
989 ++ if (zswap_init_failed) {
990 ++ pr_err("can't enable, initialization failed\n");
991 ++ return -ENODEV;
992 ++ }
993 ++
994 ++ return param_set_bool(val, kp);
995 ++}
996 ++
997 + /*********************************
998 + * writeback code
999 + **********************************/
1000 +@@ -1267,6 +1292,9 @@ pool_fail:
1001 + dstmem_fail:
1002 + zswap_entry_cache_destroy();
1003 + cache_fail:
1004 ++ /* if built-in, we aren't unloaded on failure; don't allow use */
1005 ++ zswap_init_failed = true;
1006 ++ zswap_enabled = false;
1007 + return -ENOMEM;
1008 + }
1009 + /* must be late so crypto has time to come up */
1010 +diff --git a/net/can/bcm.c b/net/can/bcm.c
1011 +index 8ef1afacad82..24d66c1cc0cd 100644
1012 +--- a/net/can/bcm.c
1013 ++++ b/net/can/bcm.c
1014 +@@ -710,14 +710,23 @@ static struct bcm_op *bcm_find_op(struct list_head *ops, canid_t can_id,
1015 +
1016 + static void bcm_remove_op(struct bcm_op *op)
1017 + {
1018 +- hrtimer_cancel(&op->timer);
1019 +- hrtimer_cancel(&op->thrtimer);
1020 +-
1021 +- if (op->tsklet.func)
1022 +- tasklet_kill(&op->tsklet);
1023 ++ if (op->tsklet.func) {
1024 ++ while (test_bit(TASKLET_STATE_SCHED, &op->tsklet.state) ||
1025 ++ test_bit(TASKLET_STATE_RUN, &op->tsklet.state) ||
1026 ++ hrtimer_active(&op->timer)) {
1027 ++ hrtimer_cancel(&op->timer);
1028 ++ tasklet_kill(&op->tsklet);
1029 ++ }
1030 ++ }
1031 +
1032 +- if (op->thrtsklet.func)
1033 +- tasklet_kill(&op->thrtsklet);
1034 ++ if (op->thrtsklet.func) {
1035 ++ while (test_bit(TASKLET_STATE_SCHED, &op->thrtsklet.state) ||
1036 ++ test_bit(TASKLET_STATE_RUN, &op->thrtsklet.state) ||
1037 ++ hrtimer_active(&op->thrtimer)) {
1038 ++ hrtimer_cancel(&op->thrtimer);
1039 ++ tasklet_kill(&op->thrtsklet);
1040 ++ }
1041 ++ }
1042 +
1043 + if ((op->frames) && (op->frames != &op->sframe))
1044 + kfree(op->frames);
1045 +diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c
1046 +index eeeba5adee6d..2410d557ae39 100644
1047 +--- a/net/sunrpc/auth_gss/gss_rpc_xdr.c
1048 ++++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c
1049 +@@ -260,7 +260,7 @@ static int gssx_dec_option_array(struct xdr_stream *xdr,
1050 + if (!oa->data)
1051 + return -ENOMEM;
1052 +
1053 +- creds = kmalloc(sizeof(struct svc_cred), GFP_KERNEL);
1054 ++ creds = kzalloc(sizeof(struct svc_cred), GFP_KERNEL);
1055 + if (!creds) {
1056 + kfree(oa->data);
1057 + return -ENOMEM;