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: Mon, 31 Oct 2016 14:09:34
Message-Id: 1477922949.d6a4da5187587a116e915544681b066c4479c457.alicef@gentoo
1 commit: d6a4da5187587a116e915544681b066c4479c457
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 31 14:09:09 2016 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 14:09:09 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d6a4da51
7
8 Linux patch 4.4.29
9
10 0000_README | 4 +
11 1028_linux-4.4.29.patch | 2368 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 2372 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 356c33e..de6d5fd 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -155,6 +155,10 @@ Patch: 1027_linux-4.4.28.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.28
21
22 +Patch: 1028_linux-4.4.29.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.29
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/1028_linux-4.4.29.patch b/1028_linux-4.4.29.patch
31 new file mode 100644
32 index 0000000..0bcb39c
33 --- /dev/null
34 +++ b/1028_linux-4.4.29.patch
35 @@ -0,0 +1,2368 @@
36 +diff --git a/Documentation/x86/exception-tables.txt b/Documentation/x86/exception-tables.txt
37 +index 32901aa36f0a..e396bcd8d830 100644
38 +--- a/Documentation/x86/exception-tables.txt
39 ++++ b/Documentation/x86/exception-tables.txt
40 +@@ -290,3 +290,38 @@ Due to the way that the exception table is built and needs to be ordered,
41 + only use exceptions for code in the .text section. Any other section
42 + will cause the exception table to not be sorted correctly, and the
43 + exceptions will fail.
44 ++
45 ++Things changed when 64-bit support was added to x86 Linux. Rather than
46 ++double the size of the exception table by expanding the two entries
47 ++from 32-bits to 64 bits, a clever trick was used to store addresses
48 ++as relative offsets from the table itself. The assembly code changed
49 ++from:
50 ++ .long 1b,3b
51 ++to:
52 ++ .long (from) - .
53 ++ .long (to) - .
54 ++
55 ++and the C-code that uses these values converts back to absolute addresses
56 ++like this:
57 ++
58 ++ ex_insn_addr(const struct exception_table_entry *x)
59 ++ {
60 ++ return (unsigned long)&x->insn + x->insn;
61 ++ }
62 ++
63 ++In v4.6 the exception table entry was expanded with a new field "handler".
64 ++This is also 32-bits wide and contains a third relative function
65 ++pointer which points to one of:
66 ++
67 ++1) int ex_handler_default(const struct exception_table_entry *fixup)
68 ++ This is legacy case that just jumps to the fixup code
69 ++2) int ex_handler_fault(const struct exception_table_entry *fixup)
70 ++ This case provides the fault number of the trap that occurred at
71 ++ entry->insn. It is used to distinguish page faults from machine
72 ++ check.
73 ++3) int ex_handler_ext(const struct exception_table_entry *fixup)
74 ++ This case is used for uaccess_err ... we need to set a flag
75 ++ in the task structure. Before the handler functions existed this
76 ++ case was handled by adding a large offset to the fixup to tag
77 ++ it as special.
78 ++More functions can easily be added.
79 +diff --git a/Makefile b/Makefile
80 +index 391294301aaf..19d7d9f68e35 100644
81 +--- a/Makefile
82 ++++ b/Makefile
83 +@@ -1,6 +1,6 @@
84 + VERSION = 4
85 + PATCHLEVEL = 4
86 +-SUBLEVEL = 28
87 ++SUBLEVEL = 29
88 + EXTRAVERSION =
89 + NAME = Blurry Fish Butt
90 +
91 +diff --git a/arch/arm/crypto/ghash-ce-glue.c b/arch/arm/crypto/ghash-ce-glue.c
92 +index 03a39fe29246..9d9ba9acdddc 100644
93 +--- a/arch/arm/crypto/ghash-ce-glue.c
94 ++++ b/arch/arm/crypto/ghash-ce-glue.c
95 +@@ -226,6 +226,27 @@ static int ghash_async_digest(struct ahash_request *req)
96 + }
97 + }
98 +
99 ++static int ghash_async_import(struct ahash_request *req, const void *in)
100 ++{
101 ++ struct ahash_request *cryptd_req = ahash_request_ctx(req);
102 ++ struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
103 ++ struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
104 ++ struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
105 ++
106 ++ desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm);
107 ++ desc->flags = req->base.flags;
108 ++
109 ++ return crypto_shash_import(desc, in);
110 ++}
111 ++
112 ++static int ghash_async_export(struct ahash_request *req, void *out)
113 ++{
114 ++ struct ahash_request *cryptd_req = ahash_request_ctx(req);
115 ++ struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
116 ++
117 ++ return crypto_shash_export(desc, out);
118 ++}
119 ++
120 + static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key,
121 + unsigned int keylen)
122 + {
123 +@@ -274,7 +295,10 @@ static struct ahash_alg ghash_async_alg = {
124 + .final = ghash_async_final,
125 + .setkey = ghash_async_setkey,
126 + .digest = ghash_async_digest,
127 ++ .import = ghash_async_import,
128 ++ .export = ghash_async_export,
129 + .halg.digestsize = GHASH_DIGEST_SIZE,
130 ++ .halg.statesize = sizeof(struct ghash_desc_ctx),
131 + .halg.base = {
132 + .cra_name = "ghash",
133 + .cra_driver_name = "ghash-ce",
134 +diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c
135 +index 2385052b0ce1..e362f865fcd2 100644
136 +--- a/arch/arm/mach-pxa/pxa_cplds_irqs.c
137 ++++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c
138 +@@ -41,30 +41,35 @@ static irqreturn_t cplds_irq_handler(int in_irq, void *d)
139 + unsigned long pending;
140 + unsigned int bit;
141 +
142 +- pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask;
143 +- for_each_set_bit(bit, &pending, CPLDS_NB_IRQ)
144 +- generic_handle_irq(irq_find_mapping(fpga->irqdomain, bit));
145 ++ do {
146 ++ pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask;
147 ++ for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) {
148 ++ generic_handle_irq(irq_find_mapping(fpga->irqdomain,
149 ++ bit));
150 ++ }
151 ++ } while (pending);
152 +
153 + return IRQ_HANDLED;
154 + }
155 +
156 +-static void cplds_irq_mask_ack(struct irq_data *d)
157 ++static void cplds_irq_mask(struct irq_data *d)
158 + {
159 + struct cplds *fpga = irq_data_get_irq_chip_data(d);
160 + unsigned int cplds_irq = irqd_to_hwirq(d);
161 +- unsigned int set, bit = BIT(cplds_irq);
162 ++ unsigned int bit = BIT(cplds_irq);
163 +
164 + fpga->irq_mask &= ~bit;
165 + writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
166 +- set = readl(fpga->base + FPGA_IRQ_SET_CLR);
167 +- writel(set & ~bit, fpga->base + FPGA_IRQ_SET_CLR);
168 + }
169 +
170 + static void cplds_irq_unmask(struct irq_data *d)
171 + {
172 + struct cplds *fpga = irq_data_get_irq_chip_data(d);
173 + unsigned int cplds_irq = irqd_to_hwirq(d);
174 +- unsigned int bit = BIT(cplds_irq);
175 ++ unsigned int set, bit = BIT(cplds_irq);
176 ++
177 ++ set = readl(fpga->base + FPGA_IRQ_SET_CLR);
178 ++ writel(set & ~bit, fpga->base + FPGA_IRQ_SET_CLR);
179 +
180 + fpga->irq_mask |= bit;
181 + writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
182 +@@ -72,7 +77,8 @@ static void cplds_irq_unmask(struct irq_data *d)
183 +
184 + static struct irq_chip cplds_irq_chip = {
185 + .name = "pxa_cplds",
186 +- .irq_mask_ack = cplds_irq_mask_ack,
187 ++ .irq_ack = cplds_irq_mask,
188 ++ .irq_mask = cplds_irq_mask,
189 + .irq_unmask = cplds_irq_unmask,
190 + .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE,
191 + };
192 +diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
193 +index 247a0dc012f1..c07bfb52275e 100644
194 +--- a/arch/powerpc/kernel/eeh_driver.c
195 ++++ b/arch/powerpc/kernel/eeh_driver.c
196 +@@ -909,6 +909,14 @@ static void eeh_handle_special_event(void)
197 + /* Notify all devices to be down */
198 + eeh_pe_state_clear(pe, EEH_PE_PRI_BUS);
199 + bus = eeh_pe_bus_get(phb_pe);
200 ++ if (!bus) {
201 ++ pr_err("%s: Cannot find PCI bus for "
202 ++ "PHB#%d-PE#%x\n",
203 ++ __func__,
204 ++ pe->phb->global_number,
205 ++ pe->addr);
206 ++ break;
207 ++ }
208 + eeh_pe_dev_traverse(pe,
209 + eeh_report_failure, NULL);
210 + pcibios_remove_pci_devices(bus);
211 +diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
212 +index 32e26526f7e4..1eb698f653b4 100644
213 +--- a/arch/powerpc/kernel/nvram_64.c
214 ++++ b/arch/powerpc/kernel/nvram_64.c
215 +@@ -969,7 +969,7 @@ int __init nvram_remove_partition(const char *name, int sig,
216 +
217 + /* Make partition a free partition */
218 + part->header.signature = NVRAM_SIG_FREE;
219 +- strncpy(part->header.name, "wwwwwwwwwwww", 12);
220 ++ memset(part->header.name, 'w', 12);
221 + part->header.checksum = nvram_checksum(&part->header);
222 + rc = nvram_write_header(part);
223 + if (rc <= 0) {
224 +@@ -987,8 +987,8 @@ int __init nvram_remove_partition(const char *name, int sig,
225 + }
226 + if (prev) {
227 + prev->header.length += part->header.length;
228 +- prev->header.checksum = nvram_checksum(&part->header);
229 +- rc = nvram_write_header(part);
230 ++ prev->header.checksum = nvram_checksum(&prev->header);
231 ++ rc = nvram_write_header(prev);
232 + if (rc <= 0) {
233 + printk(KERN_ERR "nvram_remove_partition: nvram_write failed (%d)\n", rc);
234 + return rc;
235 +diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
236 +index ba0cae69a396..92736851c795 100644
237 +--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
238 ++++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
239 +@@ -956,6 +956,11 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option)
240 + }
241 +
242 + bus = eeh_pe_bus_get(pe);
243 ++ if (!bus) {
244 ++ pr_err("%s: Cannot find PCI bus for PHB#%d-PE#%x\n",
245 ++ __func__, pe->phb->global_number, pe->addr);
246 ++ return -EIO;
247 ++ }
248 + if (pci_is_root_bus(bus) ||
249 + pci_is_root_bus(bus->parent))
250 + ret = pnv_eeh_root_reset(hose, option);
251 +diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
252 +index 189679aba703..f5063b6659eb 100644
253 +--- a/arch/x86/include/asm/asm.h
254 ++++ b/arch/x86/include/asm/asm.h
255 +@@ -44,19 +44,22 @@
256 +
257 + /* Exception table entry */
258 + #ifdef __ASSEMBLY__
259 +-# define _ASM_EXTABLE(from,to) \
260 ++# define _ASM_EXTABLE_HANDLE(from, to, handler) \
261 + .pushsection "__ex_table","a" ; \
262 +- .balign 8 ; \
263 ++ .balign 4 ; \
264 + .long (from) - . ; \
265 + .long (to) - . ; \
266 ++ .long (handler) - . ; \
267 + .popsection
268 +
269 +-# define _ASM_EXTABLE_EX(from,to) \
270 +- .pushsection "__ex_table","a" ; \
271 +- .balign 8 ; \
272 +- .long (from) - . ; \
273 +- .long (to) - . + 0x7ffffff0 ; \
274 +- .popsection
275 ++# define _ASM_EXTABLE(from, to) \
276 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
277 ++
278 ++# define _ASM_EXTABLE_FAULT(from, to) \
279 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
280 ++
281 ++# define _ASM_EXTABLE_EX(from, to) \
282 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext)
283 +
284 + # define _ASM_NOKPROBE(entry) \
285 + .pushsection "_kprobe_blacklist","aw" ; \
286 +@@ -89,19 +92,24 @@
287 + .endm
288 +
289 + #else
290 +-# define _ASM_EXTABLE(from,to) \
291 ++# define _EXPAND_EXTABLE_HANDLE(x) #x
292 ++# define _ASM_EXTABLE_HANDLE(from, to, handler) \
293 + " .pushsection \"__ex_table\",\"a\"\n" \
294 +- " .balign 8\n" \
295 ++ " .balign 4\n" \
296 + " .long (" #from ") - .\n" \
297 + " .long (" #to ") - .\n" \
298 ++ " .long (" _EXPAND_EXTABLE_HANDLE(handler) ") - .\n" \
299 + " .popsection\n"
300 +
301 +-# define _ASM_EXTABLE_EX(from,to) \
302 +- " .pushsection \"__ex_table\",\"a\"\n" \
303 +- " .balign 8\n" \
304 +- " .long (" #from ") - .\n" \
305 +- " .long (" #to ") - . + 0x7ffffff0\n" \
306 +- " .popsection\n"
307 ++# define _ASM_EXTABLE(from, to) \
308 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
309 ++
310 ++# define _ASM_EXTABLE_FAULT(from, to) \
311 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
312 ++
313 ++# define _ASM_EXTABLE_EX(from, to) \
314 ++ _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext)
315 ++
316 + /* For C file, we already have NOKPROBE_SYMBOL macro */
317 + #endif
318 +
319 +diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
320 +index d42252ce9b4d..3794c7331cfc 100644
321 +--- a/arch/x86/include/asm/uaccess.h
322 ++++ b/arch/x86/include/asm/uaccess.h
323 +@@ -90,12 +90,11 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
324 + likely(!__range_not_ok(addr, size, user_addr_max()))
325 +
326 + /*
327 +- * The exception table consists of pairs of addresses relative to the
328 +- * exception table enty itself: the first is the address of an
329 +- * instruction that is allowed to fault, and the second is the address
330 +- * at which the program should continue. No registers are modified,
331 +- * so it is entirely up to the continuation code to figure out what to
332 +- * do.
333 ++ * The exception table consists of triples of addresses relative to the
334 ++ * exception table entry itself. The first address is of an instruction
335 ++ * that is allowed to fault, the second is the target at which the program
336 ++ * should continue. The third is a handler function to deal with the fault
337 ++ * caused by the instruction in the first field.
338 + *
339 + * All the routines below use bits of fixup code that are out of line
340 + * with the main instruction path. This means when everything is well,
341 +@@ -104,13 +103,14 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
342 + */
343 +
344 + struct exception_table_entry {
345 +- int insn, fixup;
346 ++ int insn, fixup, handler;
347 + };
348 + /* This is not the generic standard exception_table_entry format */
349 + #define ARCH_HAS_SORT_EXTABLE
350 + #define ARCH_HAS_SEARCH_EXTABLE
351 +
352 +-extern int fixup_exception(struct pt_regs *regs);
353 ++extern int fixup_exception(struct pt_regs *regs, int trapnr);
354 ++extern bool ex_has_fault_handler(unsigned long ip);
355 + extern int early_fixup_exception(unsigned long *ip);
356 +
357 + /*
358 +diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
359 +index 9fdf1d330727..a257d6077d1b 100644
360 +--- a/arch/x86/kernel/early-quirks.c
361 ++++ b/arch/x86/kernel/early-quirks.c
362 +@@ -331,12 +331,11 @@ static u32 __init i85x_stolen_base(int num, int slot, int func, size_t stolen_si
363 +
364 + static u32 __init i865_stolen_base(int num, int slot, int func, size_t stolen_size)
365 + {
366 +- /*
367 +- * FIXME is the graphics stolen memory region
368 +- * always at TOUD? Ie. is it always the last
369 +- * one to be allocated by the BIOS?
370 +- */
371 +- return read_pci_config_16(0, 0, 0, I865_TOUD) << 16;
372 ++ u16 toud = 0;
373 ++
374 ++ toud = read_pci_config_16(0, 0, 0, I865_TOUD);
375 ++
376 ++ return (phys_addr_t)(toud << 16) + i845_tseg_size();
377 + }
378 +
379 + static size_t __init i830_stolen_size(int num, int slot, int func)
380 +diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
381 +index 023c442c33bb..e1d1f6cbaf11 100644
382 +--- a/arch/x86/kernel/kprobes/core.c
383 ++++ b/arch/x86/kernel/kprobes/core.c
384 +@@ -1000,7 +1000,7 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
385 + * In case the user-specified fault handler returned
386 + * zero, try to fix up.
387 + */
388 +- if (fixup_exception(regs))
389 ++ if (fixup_exception(regs, trapnr))
390 + return 1;
391 +
392 + /*
393 +diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
394 +index 679302c312f8..5621f882645e 100644
395 +--- a/arch/x86/kernel/traps.c
396 ++++ b/arch/x86/kernel/traps.c
397 +@@ -199,7 +199,7 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
398 + }
399 +
400 + if (!user_mode(regs)) {
401 +- if (!fixup_exception(regs)) {
402 ++ if (!fixup_exception(regs, trapnr)) {
403 + tsk->thread.error_code = error_code;
404 + tsk->thread.trap_nr = trapnr;
405 + die(str, regs, error_code);
406 +@@ -453,7 +453,7 @@ do_general_protection(struct pt_regs *regs, long error_code)
407 +
408 + tsk = current;
409 + if (!user_mode(regs)) {
410 +- if (fixup_exception(regs))
411 ++ if (fixup_exception(regs, X86_TRAP_GP))
412 + return;
413 +
414 + tsk->thread.error_code = error_code;
415 +@@ -699,7 +699,7 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr)
416 + conditional_sti(regs);
417 +
418 + if (!user_mode(regs)) {
419 +- if (!fixup_exception(regs)) {
420 ++ if (!fixup_exception(regs, trapnr)) {
421 + task->thread.error_code = error_code;
422 + task->thread.trap_nr = trapnr;
423 + die(str, regs, error_code);
424 +diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
425 +index 903ec1e9c326..9dd7e4b7fcde 100644
426 +--- a/arch/x86/mm/extable.c
427 ++++ b/arch/x86/mm/extable.c
428 +@@ -3,6 +3,9 @@
429 + #include <linux/sort.h>
430 + #include <asm/uaccess.h>
431 +
432 ++typedef bool (*ex_handler_t)(const struct exception_table_entry *,
433 ++ struct pt_regs *, int);
434 ++
435 + static inline unsigned long
436 + ex_insn_addr(const struct exception_table_entry *x)
437 + {
438 +@@ -13,11 +16,56 @@ ex_fixup_addr(const struct exception_table_entry *x)
439 + {
440 + return (unsigned long)&x->fixup + x->fixup;
441 + }
442 ++static inline ex_handler_t
443 ++ex_fixup_handler(const struct exception_table_entry *x)
444 ++{
445 ++ return (ex_handler_t)((unsigned long)&x->handler + x->handler);
446 ++}
447 +
448 +-int fixup_exception(struct pt_regs *regs)
449 ++bool ex_handler_default(const struct exception_table_entry *fixup,
450 ++ struct pt_regs *regs, int trapnr)
451 + {
452 +- const struct exception_table_entry *fixup;
453 +- unsigned long new_ip;
454 ++ regs->ip = ex_fixup_addr(fixup);
455 ++ return true;
456 ++}
457 ++EXPORT_SYMBOL(ex_handler_default);
458 ++
459 ++bool ex_handler_fault(const struct exception_table_entry *fixup,
460 ++ struct pt_regs *regs, int trapnr)
461 ++{
462 ++ regs->ip = ex_fixup_addr(fixup);
463 ++ regs->ax = trapnr;
464 ++ return true;
465 ++}
466 ++EXPORT_SYMBOL_GPL(ex_handler_fault);
467 ++
468 ++bool ex_handler_ext(const struct exception_table_entry *fixup,
469 ++ struct pt_regs *regs, int trapnr)
470 ++{
471 ++ /* Special hack for uaccess_err */
472 ++ current_thread_info()->uaccess_err = 1;
473 ++ regs->ip = ex_fixup_addr(fixup);
474 ++ return true;
475 ++}
476 ++EXPORT_SYMBOL(ex_handler_ext);
477 ++
478 ++bool ex_has_fault_handler(unsigned long ip)
479 ++{
480 ++ const struct exception_table_entry *e;
481 ++ ex_handler_t handler;
482 ++
483 ++ e = search_exception_tables(ip);
484 ++ if (!e)
485 ++ return false;
486 ++ handler = ex_fixup_handler(e);
487 ++
488 ++ return handler == ex_handler_fault;
489 ++}
490 ++
491 ++int fixup_exception(struct pt_regs *regs, int trapnr)
492 ++{
493 ++ const struct exception_table_entry *e;
494 ++ ex_handler_t handler;
495 +
496 + #ifdef CONFIG_PNPBIOS
497 + if (unlikely(SEGMENT_IS_PNP_CODE(regs->cs))) {
498 +@@ -33,42 +81,34 @@ int fixup_exception(struct pt_regs *regs)
499 + }
500 + #endif
501 +
502 +- fixup = search_exception_tables(regs->ip);
503 +- if (fixup) {
504 +- new_ip = ex_fixup_addr(fixup);
505 +-
506 +- if (fixup->fixup - fixup->insn >= 0x7ffffff0 - 4) {
507 +- /* Special hack for uaccess_err */
508 +- current_thread_info()->uaccess_err = 1;
509 +- new_ip -= 0x7ffffff0;
510 +- }
511 +- regs->ip = new_ip;
512 +- return 1;
513 +- }
514 ++ e = search_exception_tables(regs->ip);
515 ++ if (!e)
516 ++ return 0;
517 +
518 +- return 0;
519 ++ handler = ex_fixup_handler(e);
520 ++ return handler(e, regs, trapnr);
521 + }
522 +
523 + /* Restricted version used during very early boot */
524 + int __init early_fixup_exception(unsigned long *ip)
525 + {
526 +- const struct exception_table_entry *fixup;
527 ++ const struct exception_table_entry *e;
528 + unsigned long new_ip;
529 ++ ex_handler_t handler;
530 +
531 +- fixup = search_exception_tables(*ip);
532 +- if (fixup) {
533 +- new_ip = ex_fixup_addr(fixup);
534 ++ e = search_exception_tables(*ip);
535 ++ if (!e)
536 ++ return 0;
537 +
538 +- if (fixup->fixup - fixup->insn >= 0x7ffffff0 - 4) {
539 +- /* uaccess handling not supported during early boot */
540 +- return 0;
541 +- }
542 ++ new_ip = ex_fixup_addr(e);
543 ++ handler = ex_fixup_handler(e);
544 +
545 +- *ip = new_ip;
546 +- return 1;
547 +- }
548 ++ /* special handling not supported during early boot */
549 ++ if (handler != ex_handler_default)
550 ++ return 0;
551 +
552 +- return 0;
553 ++ *ip = new_ip;
554 ++ return 1;
555 + }
556 +
557 + /*
558 +@@ -133,6 +173,8 @@ void sort_extable(struct exception_table_entry *start,
559 + i += 4;
560 + p->fixup += i;
561 + i += 4;
562 ++ p->handler += i;
563 ++ i += 4;
564 + }
565 +
566 + sort(start, finish - start, sizeof(struct exception_table_entry),
567 +@@ -145,6 +187,8 @@ void sort_extable(struct exception_table_entry *start,
568 + i += 4;
569 + p->fixup -= i;
570 + i += 4;
571 ++ p->handler -= i;
572 ++ i += 4;
573 + }
574 + }
575 +
576 +diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
577 +index e830c71a1323..03898aea6e0f 100644
578 +--- a/arch/x86/mm/fault.c
579 ++++ b/arch/x86/mm/fault.c
580 +@@ -663,7 +663,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
581 + int sig;
582 +
583 + /* Are we prepared to handle this kernel fault? */
584 +- if (fixup_exception(regs)) {
585 ++ if (fixup_exception(regs, X86_TRAP_PF)) {
586 + /*
587 + * Any interrupt that takes a fault gets the fixup. This makes
588 + * the below recursive fault logic only apply to a faults from
589 +diff --git a/crypto/gcm.c b/crypto/gcm.c
590 +index d9ea5f9c0574..1238b3c5a321 100644
591 +--- a/crypto/gcm.c
592 ++++ b/crypto/gcm.c
593 +@@ -117,7 +117,7 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,
594 + struct crypto_ablkcipher *ctr = ctx->ctr;
595 + struct {
596 + be128 hash;
597 +- u8 iv[8];
598 ++ u8 iv[16];
599 +
600 + struct crypto_gcm_setkey_result result;
601 +
602 +diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
603 +index 01d4be2c354b..f5c26a5f6875 100644
604 +--- a/drivers/char/hw_random/omap-rng.c
605 ++++ b/drivers/char/hw_random/omap-rng.c
606 +@@ -385,7 +385,7 @@ static int omap_rng_probe(struct platform_device *pdev)
607 +
608 + pm_runtime_enable(&pdev->dev);
609 + ret = pm_runtime_get_sync(&pdev->dev);
610 +- if (ret) {
611 ++ if (ret < 0) {
612 + dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
613 + pm_runtime_put_noidle(&pdev->dev);
614 + goto err_ioremap;
615 +@@ -443,7 +443,7 @@ static int __maybe_unused omap_rng_resume(struct device *dev)
616 + int ret;
617 +
618 + ret = pm_runtime_get_sync(dev);
619 +- if (ret) {
620 ++ if (ret < 0) {
621 + dev_err(dev, "Failed to runtime_get device: %d\n", ret);
622 + pm_runtime_put_noidle(dev);
623 + return ret;
624 +diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
625 +index bbf206e3da0d..ac9582de64a5 100644
626 +--- a/drivers/clk/clk-divider.c
627 ++++ b/drivers/clk/clk-divider.c
628 +@@ -354,7 +354,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
629 +
630 + /* if read only, just return current value */
631 + if (divider->flags & CLK_DIVIDER_READ_ONLY) {
632 +- bestdiv = readl(divider->reg) >> divider->shift;
633 ++ bestdiv = clk_readl(divider->reg) >> divider->shift;
634 + bestdiv &= div_mask(divider->width);
635 + bestdiv = _get_div(divider->table, bestdiv, divider->flags,
636 + divider->width);
637 +diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
638 +index 7bc1c4527ae4..8b77abb6bc22 100644
639 +--- a/drivers/clk/clk-qoriq.c
640 ++++ b/drivers/clk/clk-qoriq.c
641 +@@ -766,7 +766,11 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx)
642 + if (!hwc)
643 + return NULL;
644 +
645 +- hwc->reg = cg->regs + 0x20 * idx;
646 ++ if (cg->info.flags & CG_VER3)
647 ++ hwc->reg = cg->regs + 0x70000 + 0x20 * idx;
648 ++ else
649 ++ hwc->reg = cg->regs + 0x20 * idx;
650 ++
651 + hwc->info = cg->info.cmux_groups[cg->info.cmux_to_group[idx]];
652 +
653 + /*
654 +diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c
655 +index b0978d3b83e2..d302ed3b8225 100644
656 +--- a/drivers/clk/imx/clk-imx35.c
657 ++++ b/drivers/clk/imx/clk-imx35.c
658 +@@ -115,7 +115,7 @@ static void __init _mx35_clocks_init(void)
659 + }
660 +
661 + clk[ckih] = imx_clk_fixed("ckih", 24000000);
662 +- clk[ckil] = imx_clk_fixed("ckih", 32768);
663 ++ clk[ckil] = imx_clk_fixed("ckil", 32768);
664 + clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "mpll", "ckih", base + MX35_CCM_MPCTL);
665 + clk[ppll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "ppll", "ckih", base + MX35_CCM_PPCTL);
666 +
667 +diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
668 +index 2bf37e68ad0f..dd184b50e5b4 100644
669 +--- a/drivers/dma/ipu/ipu_irq.c
670 ++++ b/drivers/dma/ipu/ipu_irq.c
671 +@@ -286,22 +286,21 @@ static void ipu_irq_handler(struct irq_desc *desc)
672 + raw_spin_unlock(&bank_lock);
673 + while ((line = ffs(status))) {
674 + struct ipu_irq_map *map;
675 +- unsigned int irq = NO_IRQ;
676 ++ unsigned int irq;
677 +
678 + line--;
679 + status &= ~(1UL << line);
680 +
681 + raw_spin_lock(&bank_lock);
682 + map = src2map(32 * i + line);
683 +- if (map)
684 +- irq = map->irq;
685 +- raw_spin_unlock(&bank_lock);
686 +-
687 + if (!map) {
688 ++ raw_spin_unlock(&bank_lock);
689 + pr_err("IPU: Interrupt on unmapped source %u bank %d\n",
690 + line, i);
691 + continue;
692 + }
693 ++ irq = map->irq;
694 ++ raw_spin_unlock(&bank_lock);
695 + generic_handle_irq(irq);
696 + }
697 + }
698 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
699 +index fe36caf1b7d7..14f57d9915e3 100644
700 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
701 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
702 +@@ -113,24 +113,26 @@ void amdgpu_dpm_print_ps_status(struct amdgpu_device *adev,
703 + printk("\n");
704 + }
705 +
706 ++
707 + u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev)
708 + {
709 + struct drm_device *dev = adev->ddev;
710 + struct drm_crtc *crtc;
711 + struct amdgpu_crtc *amdgpu_crtc;
712 +- u32 line_time_us, vblank_lines;
713 ++ u32 vblank_in_pixels;
714 + u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
715 +
716 + if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
717 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
718 + amdgpu_crtc = to_amdgpu_crtc(crtc);
719 + if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
720 +- line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal * 1000) /
721 +- amdgpu_crtc->hw_mode.clock;
722 +- vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end -
723 ++ vblank_in_pixels =
724 ++ amdgpu_crtc->hw_mode.crtc_htotal *
725 ++ (amdgpu_crtc->hw_mode.crtc_vblank_end -
726 + amdgpu_crtc->hw_mode.crtc_vdisplay +
727 +- (amdgpu_crtc->v_border * 2);
728 +- vblank_time_us = vblank_lines * line_time_us;
729 ++ (amdgpu_crtc->v_border * 2));
730 ++
731 ++ vblank_time_us = vblank_in_pixels * 1000 / amdgpu_crtc->hw_mode.clock;
732 + break;
733 + }
734 + }
735 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
736 +index 4488e82f87b0..a5c824078472 100644
737 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
738 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
739 +@@ -227,7 +227,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
740 + type = AMD_IP_BLOCK_TYPE_UVD;
741 + ring_mask = adev->uvd.ring.ready ? 1 : 0;
742 + ib_start_alignment = AMDGPU_GPU_PAGE_SIZE;
743 +- ib_size_alignment = 8;
744 ++ ib_size_alignment = 16;
745 + break;
746 + case AMDGPU_HW_IP_VCE:
747 + type = AMD_IP_BLOCK_TYPE_VCE;
748 +diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
749 +index 4dcc8fba5792..5b261adb4b69 100644
750 +--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
751 ++++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
752 +@@ -419,16 +419,6 @@ static void dce_v10_0_hpd_init(struct amdgpu_device *adev)
753 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
754 + struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
755 +
756 +- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
757 +- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
758 +- /* don't try to enable hpd on eDP or LVDS avoid breaking the
759 +- * aux dp channel on imac and help (but not completely fix)
760 +- * https://bugzilla.redhat.com/show_bug.cgi?id=726143
761 +- * also avoid interrupt storms during dpms.
762 +- */
763 +- continue;
764 +- }
765 +-
766 + switch (amdgpu_connector->hpd.hpd) {
767 + case AMDGPU_HPD_1:
768 + idx = 0;
769 +@@ -452,6 +442,19 @@ static void dce_v10_0_hpd_init(struct amdgpu_device *adev)
770 + continue;
771 + }
772 +
773 ++ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
774 ++ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
775 ++ /* don't try to enable hpd on eDP or LVDS avoid breaking the
776 ++ * aux dp channel on imac and help (but not completely fix)
777 ++ * https://bugzilla.redhat.com/show_bug.cgi?id=726143
778 ++ * also avoid interrupt storms during dpms.
779 ++ */
780 ++ tmp = RREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx]);
781 ++ tmp = REG_SET_FIELD(tmp, DC_HPD_INT_CONTROL, DC_HPD_INT_EN, 0);
782 ++ WREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp);
783 ++ continue;
784 ++ }
785 ++
786 + tmp = RREG32(mmDC_HPD_CONTROL + hpd_offsets[idx]);
787 + tmp = REG_SET_FIELD(tmp, DC_HPD_CONTROL, DC_HPD_EN, 1);
788 + WREG32(mmDC_HPD_CONTROL + hpd_offsets[idx], tmp);
789 +diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
790 +index 8f1e51128b33..c161eeda417b 100644
791 +--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
792 ++++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
793 +@@ -409,16 +409,6 @@ static void dce_v11_0_hpd_init(struct amdgpu_device *adev)
794 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
795 + struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
796 +
797 +- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
798 +- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
799 +- /* don't try to enable hpd on eDP or LVDS avoid breaking the
800 +- * aux dp channel on imac and help (but not completely fix)
801 +- * https://bugzilla.redhat.com/show_bug.cgi?id=726143
802 +- * also avoid interrupt storms during dpms.
803 +- */
804 +- continue;
805 +- }
806 +-
807 + switch (amdgpu_connector->hpd.hpd) {
808 + case AMDGPU_HPD_1:
809 + idx = 0;
810 +@@ -442,6 +432,19 @@ static void dce_v11_0_hpd_init(struct amdgpu_device *adev)
811 + continue;
812 + }
813 +
814 ++ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
815 ++ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
816 ++ /* don't try to enable hpd on eDP or LVDS avoid breaking the
817 ++ * aux dp channel on imac and help (but not completely fix)
818 ++ * https://bugzilla.redhat.com/show_bug.cgi?id=726143
819 ++ * also avoid interrupt storms during dpms.
820 ++ */
821 ++ tmp = RREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx]);
822 ++ tmp = REG_SET_FIELD(tmp, DC_HPD_INT_CONTROL, DC_HPD_INT_EN, 0);
823 ++ WREG32(mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp);
824 ++ continue;
825 ++ }
826 ++
827 + tmp = RREG32(mmDC_HPD_CONTROL + hpd_offsets[idx]);
828 + tmp = REG_SET_FIELD(tmp, DC_HPD_CONTROL, DC_HPD_EN, 1);
829 + WREG32(mmDC_HPD_CONTROL + hpd_offsets[idx], tmp);
830 +@@ -3030,6 +3033,7 @@ static int dce_v11_0_sw_fini(void *handle)
831 +
832 + dce_v11_0_afmt_fini(adev);
833 +
834 ++ drm_mode_config_cleanup(adev->ddev);
835 + adev->mode_info.mode_config_initialized = false;
836 +
837 + return 0;
838 +diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
839 +index 42d954dc436d..9b4dcf76ce6c 100644
840 +--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
841 ++++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
842 +@@ -392,15 +392,6 @@ static void dce_v8_0_hpd_init(struct amdgpu_device *adev)
843 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
844 + struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
845 +
846 +- if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
847 +- connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
848 +- /* don't try to enable hpd on eDP or LVDS avoid breaking the
849 +- * aux dp channel on imac and help (but not completely fix)
850 +- * https://bugzilla.redhat.com/show_bug.cgi?id=726143
851 +- * also avoid interrupt storms during dpms.
852 +- */
853 +- continue;
854 +- }
855 + switch (amdgpu_connector->hpd.hpd) {
856 + case AMDGPU_HPD_1:
857 + WREG32(mmDC_HPD1_CONTROL, tmp);
858 +@@ -423,6 +414,45 @@ static void dce_v8_0_hpd_init(struct amdgpu_device *adev)
859 + default:
860 + break;
861 + }
862 ++
863 ++ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP ||
864 ++ connector->connector_type == DRM_MODE_CONNECTOR_LVDS) {
865 ++ /* don't try to enable hpd on eDP or LVDS avoid breaking the
866 ++ * aux dp channel on imac and help (but not completely fix)
867 ++ * https://bugzilla.redhat.com/show_bug.cgi?id=726143
868 ++ * also avoid interrupt storms during dpms.
869 ++ */
870 ++ u32 dc_hpd_int_cntl_reg, dc_hpd_int_cntl;
871 ++
872 ++ switch (amdgpu_connector->hpd.hpd) {
873 ++ case AMDGPU_HPD_1:
874 ++ dc_hpd_int_cntl_reg = mmDC_HPD1_INT_CONTROL;
875 ++ break;
876 ++ case AMDGPU_HPD_2:
877 ++ dc_hpd_int_cntl_reg = mmDC_HPD2_INT_CONTROL;
878 ++ break;
879 ++ case AMDGPU_HPD_3:
880 ++ dc_hpd_int_cntl_reg = mmDC_HPD3_INT_CONTROL;
881 ++ break;
882 ++ case AMDGPU_HPD_4:
883 ++ dc_hpd_int_cntl_reg = mmDC_HPD4_INT_CONTROL;
884 ++ break;
885 ++ case AMDGPU_HPD_5:
886 ++ dc_hpd_int_cntl_reg = mmDC_HPD5_INT_CONTROL;
887 ++ break;
888 ++ case AMDGPU_HPD_6:
889 ++ dc_hpd_int_cntl_reg = mmDC_HPD6_INT_CONTROL;
890 ++ break;
891 ++ default:
892 ++ continue;
893 ++ }
894 ++
895 ++ dc_hpd_int_cntl = RREG32(dc_hpd_int_cntl_reg);
896 ++ dc_hpd_int_cntl &= ~DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK;
897 ++ WREG32(dc_hpd_int_cntl_reg, dc_hpd_int_cntl);
898 ++ continue;
899 ++ }
900 ++
901 + dce_v8_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd);
902 + amdgpu_irq_get(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
903 + }
904 +diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
905 +index 9f935f55d74c..968b31f39884 100644
906 +--- a/drivers/gpu/drm/drm_prime.c
907 ++++ b/drivers/gpu/drm/drm_prime.c
908 +@@ -339,14 +339,17 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = {
909 + * using the PRIME helpers.
910 + */
911 + struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
912 +- struct drm_gem_object *obj, int flags)
913 ++ struct drm_gem_object *obj,
914 ++ int flags)
915 + {
916 +- DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
917 +-
918 +- exp_info.ops = &drm_gem_prime_dmabuf_ops;
919 +- exp_info.size = obj->size;
920 +- exp_info.flags = flags;
921 +- exp_info.priv = obj;
922 ++ struct dma_buf_export_info exp_info = {
923 ++ .exp_name = KBUILD_MODNAME, /* white lie for debug */
924 ++ .owner = dev->driver->fops->owner,
925 ++ .ops = &drm_gem_prime_dmabuf_ops,
926 ++ .size = obj->size,
927 ++ .flags = flags,
928 ++ .priv = obj,
929 ++ };
930 +
931 + if (dev->driver->gem_prime_res_obj)
932 + exp_info.resv = dev->driver->gem_prime_res_obj(obj);
933 +diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
934 +index d400d6773bbb..fb9f647bb5cd 100644
935 +--- a/drivers/gpu/drm/i915/i915_drv.h
936 ++++ b/drivers/gpu/drm/i915/i915_drv.h
937 +@@ -2150,21 +2150,19 @@ struct drm_i915_gem_object {
938 + /** Record of address bit 17 of each page at last unbind. */
939 + unsigned long *bit_17;
940 +
941 +- union {
942 +- /** for phy allocated objects */
943 +- struct drm_dma_handle *phys_handle;
944 +-
945 +- struct i915_gem_userptr {
946 +- uintptr_t ptr;
947 +- unsigned read_only :1;
948 +- unsigned workers :4;
949 ++ struct i915_gem_userptr {
950 ++ uintptr_t ptr;
951 ++ unsigned read_only :1;
952 ++ unsigned workers :4;
953 + #define I915_GEM_USERPTR_MAX_WORKERS 15
954 +
955 +- struct i915_mm_struct *mm;
956 +- struct i915_mmu_object *mmu_object;
957 +- struct work_struct *work;
958 +- } userptr;
959 +- };
960 ++ struct i915_mm_struct *mm;
961 ++ struct i915_mmu_object *mmu_object;
962 ++ struct work_struct *work;
963 ++ } userptr;
964 ++
965 ++ /** for phys allocated objects */
966 ++ struct drm_dma_handle *phys_handle;
967 + };
968 + #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
969 +
970 +diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
971 +index 87e919a06b27..5d2323a40c25 100644
972 +--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
973 ++++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
974 +@@ -108,17 +108,28 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
975 + pci_read_config_dword(dev->pdev, 0x5c, &base);
976 + base &= ~((1<<20) - 1);
977 + } else if (IS_I865G(dev)) {
978 ++ u32 tseg_size = 0;
979 + u16 toud = 0;
980 ++ u8 tmp;
981 ++
982 ++ pci_bus_read_config_byte(dev->pdev->bus, PCI_DEVFN(0, 0),
983 ++ I845_ESMRAMC, &tmp);
984 ++
985 ++ if (tmp & TSEG_ENABLE) {
986 ++ switch (tmp & I845_TSEG_SIZE_MASK) {
987 ++ case I845_TSEG_SIZE_512K:
988 ++ tseg_size = KB(512);
989 ++ break;
990 ++ case I845_TSEG_SIZE_1M:
991 ++ tseg_size = MB(1);
992 ++ break;
993 ++ }
994 ++ }
995 +
996 +- /*
997 +- * FIXME is the graphics stolen memory region
998 +- * always at TOUD? Ie. is it always the last
999 +- * one to be allocated by the BIOS?
1000 +- */
1001 + pci_bus_read_config_word(dev->pdev->bus, PCI_DEVFN(0, 0),
1002 + I865_TOUD, &toud);
1003 +
1004 +- base = toud << 16;
1005 ++ base = (toud << 16) + tseg_size;
1006 + } else if (IS_I85X(dev)) {
1007 + u32 tseg_size = 0;
1008 + u32 tom;
1009 +diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
1010 +index ebbd23407a80..0f8367da0663 100644
1011 +--- a/drivers/gpu/drm/i915/intel_dp.c
1012 ++++ b/drivers/gpu/drm/i915/intel_dp.c
1013 +@@ -4648,7 +4648,7 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv,
1014 + *
1015 + * Return %true if @port is connected, %false otherwise.
1016 + */
1017 +-bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
1018 ++static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
1019 + struct intel_digital_port *port)
1020 + {
1021 + if (HAS_PCH_IBX(dev_priv))
1022 +diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
1023 +index 41442e619595..722aa159cd28 100644
1024 +--- a/drivers/gpu/drm/i915/intel_drv.h
1025 ++++ b/drivers/gpu/drm/i915/intel_drv.h
1026 +@@ -1231,8 +1231,6 @@ void intel_edp_drrs_disable(struct intel_dp *intel_dp);
1027 + void intel_edp_drrs_invalidate(struct drm_device *dev,
1028 + unsigned frontbuffer_bits);
1029 + void intel_edp_drrs_flush(struct drm_device *dev, unsigned frontbuffer_bits);
1030 +-bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
1031 +- struct intel_digital_port *port);
1032 + void hsw_dp_set_ddi_pll_sel(struct intel_crtc_state *pipe_config);
1033 +
1034 + /* intel_dp_mst.c */
1035 +diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
1036 +index dff69fef47e0..3b92cad8bef2 100644
1037 +--- a/drivers/gpu/drm/i915/intel_hdmi.c
1038 ++++ b/drivers/gpu/drm/i915/intel_hdmi.c
1039 +@@ -1331,19 +1331,18 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
1040 + }
1041 +
1042 + static bool
1043 +-intel_hdmi_set_edid(struct drm_connector *connector, bool force)
1044 ++intel_hdmi_set_edid(struct drm_connector *connector)
1045 + {
1046 + struct drm_i915_private *dev_priv = to_i915(connector->dev);
1047 + struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
1048 +- struct edid *edid = NULL;
1049 ++ struct edid *edid;
1050 + bool connected = false;
1051 +
1052 + intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
1053 +
1054 +- if (force)
1055 +- edid = drm_get_edid(connector,
1056 +- intel_gmbus_get_adapter(dev_priv,
1057 +- intel_hdmi->ddc_bus));
1058 ++ edid = drm_get_edid(connector,
1059 ++ intel_gmbus_get_adapter(dev_priv,
1060 ++ intel_hdmi->ddc_bus));
1061 +
1062 + intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
1063 +
1064 +@@ -1371,37 +1370,16 @@ static enum drm_connector_status
1065 + intel_hdmi_detect(struct drm_connector *connector, bool force)
1066 + {
1067 + enum drm_connector_status status;
1068 +- struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
1069 + struct drm_i915_private *dev_priv = to_i915(connector->dev);
1070 +- bool live_status = false;
1071 +- unsigned int try;
1072 +
1073 + DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
1074 + connector->base.id, connector->name);
1075 +
1076 + intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
1077 +
1078 +- for (try = 0; !live_status && try < 9; try++) {
1079 +- if (try)
1080 +- msleep(10);
1081 +- live_status = intel_digital_port_connected(dev_priv,
1082 +- hdmi_to_dig_port(intel_hdmi));
1083 +- }
1084 +-
1085 +- if (!live_status) {
1086 +- DRM_DEBUG_KMS("HDMI live status down\n");
1087 +- /*
1088 +- * Live status register is not reliable on all intel platforms.
1089 +- * So consider live_status only for certain platforms, for
1090 +- * others, read EDID to determine presence of sink.
1091 +- */
1092 +- if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv))
1093 +- live_status = true;
1094 +- }
1095 +-
1096 + intel_hdmi_unset_edid(connector);
1097 +
1098 +- if (intel_hdmi_set_edid(connector, live_status)) {
1099 ++ if (intel_hdmi_set_edid(connector)) {
1100 + struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
1101 +
1102 + hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI;
1103 +@@ -1427,7 +1405,7 @@ intel_hdmi_force(struct drm_connector *connector)
1104 + if (connector->status != connector_status_connected)
1105 + return;
1106 +
1107 +- intel_hdmi_set_edid(connector, true);
1108 ++ intel_hdmi_set_edid(connector);
1109 + hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI;
1110 + }
1111 +
1112 +diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
1113 +index 1e851e037c29..3f802163f7d4 100644
1114 +--- a/drivers/gpu/drm/i915/intel_pm.c
1115 ++++ b/drivers/gpu/drm/i915/intel_pm.c
1116 +@@ -2097,32 +2097,34 @@ static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[8])
1117 + GEN9_MEM_LATENCY_LEVEL_MASK;
1118 +
1119 + /*
1120 ++ * If a level n (n > 1) has a 0us latency, all levels m (m >= n)
1121 ++ * need to be disabled. We make sure to sanitize the values out
1122 ++ * of the punit to satisfy this requirement.
1123 ++ */
1124 ++ for (level = 1; level <= max_level; level++) {
1125 ++ if (wm[level] == 0) {
1126 ++ for (i = level + 1; i <= max_level; i++)
1127 ++ wm[i] = 0;
1128 ++ break;
1129 ++ }
1130 ++ }
1131 ++
1132 ++ /*
1133 + * WaWmMemoryReadLatency:skl
1134 + *
1135 + * punit doesn't take into account the read latency so we need
1136 +- * to add 2us to the various latency levels we retrieve from
1137 +- * the punit.
1138 +- * - W0 is a bit special in that it's the only level that
1139 +- * can't be disabled if we want to have display working, so
1140 +- * we always add 2us there.
1141 +- * - For levels >=1, punit returns 0us latency when they are
1142 +- * disabled, so we respect that and don't add 2us then
1143 +- *
1144 +- * Additionally, if a level n (n > 1) has a 0us latency, all
1145 +- * levels m (m >= n) need to be disabled. We make sure to
1146 +- * sanitize the values out of the punit to satisfy this
1147 +- * requirement.
1148 ++ * to add 2us to the various latency levels we retrieve from the
1149 ++ * punit when level 0 response data us 0us.
1150 + */
1151 +- wm[0] += 2;
1152 +- for (level = 1; level <= max_level; level++)
1153 +- if (wm[level] != 0)
1154 ++ if (wm[0] == 0) {
1155 ++ wm[0] += 2;
1156 ++ for (level = 1; level <= max_level; level++) {
1157 ++ if (wm[level] == 0)
1158 ++ break;
1159 + wm[level] += 2;
1160 +- else {
1161 +- for (i = level + 1; i <= max_level; i++)
1162 +- wm[i] = 0;
1163 +-
1164 +- break;
1165 + }
1166 ++ }
1167 ++
1168 + } else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
1169 + uint64_t sskpd = I915_READ64(MCH_SSKPD);
1170 +
1171 +diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
1172 +index fa2154493cf1..470af4aa4a6a 100644
1173 +--- a/drivers/gpu/drm/radeon/r600_dpm.c
1174 ++++ b/drivers/gpu/drm/radeon/r600_dpm.c
1175 +@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev)
1176 + struct drm_device *dev = rdev->ddev;
1177 + struct drm_crtc *crtc;
1178 + struct radeon_crtc *radeon_crtc;
1179 +- u32 line_time_us, vblank_lines;
1180 ++ u32 vblank_in_pixels;
1181 + u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
1182 +
1183 + if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
1184 + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
1185 + radeon_crtc = to_radeon_crtc(crtc);
1186 + if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
1187 +- line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
1188 +- radeon_crtc->hw_mode.clock;
1189 +- vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
1190 +- radeon_crtc->hw_mode.crtc_vdisplay +
1191 +- (radeon_crtc->v_border * 2);
1192 +- vblank_time_us = vblank_lines * line_time_us;
1193 ++ vblank_in_pixels =
1194 ++ radeon_crtc->hw_mode.crtc_htotal *
1195 ++ (radeon_crtc->hw_mode.crtc_vblank_end -
1196 ++ radeon_crtc->hw_mode.crtc_vdisplay +
1197 ++ (radeon_crtc->v_border * 2));
1198 ++
1199 ++ vblank_time_us = vblank_in_pixels * 1000 / radeon_crtc->hw_mode.clock;
1200 + break;
1201 + }
1202 + }
1203 +diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
1204 +index e2dd5d19c32c..4aa2cbe4c85f 100644
1205 +--- a/drivers/gpu/drm/radeon/radeon_device.c
1206 ++++ b/drivers/gpu/drm/radeon/radeon_device.c
1207 +@@ -660,8 +660,9 @@ bool radeon_card_posted(struct radeon_device *rdev)
1208 + {
1209 + uint32_t reg;
1210 +
1211 +- /* for pass through, always force asic_init */
1212 +- if (radeon_device_is_virtual())
1213 ++ /* for pass through, always force asic_init for CI */
1214 ++ if (rdev->family >= CHIP_BONAIRE &&
1215 ++ radeon_device_is_virtual())
1216 + return false;
1217 +
1218 + /* required for EFI mode on macbook2,1 which uses an r5xx asic */
1219 +diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
1220 +index 3aaa07dafc00..472e0771832e 100644
1221 +--- a/drivers/gpu/drm/radeon/si_dpm.c
1222 ++++ b/drivers/gpu/drm/radeon/si_dpm.c
1223 +@@ -4112,7 +4112,7 @@ static int si_populate_smc_voltage_tables(struct radeon_device *rdev,
1224 + &rdev->pm.dpm.dyn_state.phase_shedding_limits_table)) {
1225 + si_populate_smc_voltage_table(rdev, &si_pi->vddc_phase_shed_table, table);
1226 +
1227 +- table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC] =
1228 ++ table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING] =
1229 + cpu_to_be32(si_pi->vddc_phase_shed_table.mask_low);
1230 +
1231 + si_write_smc_soft_register(rdev, SI_SMC_SOFT_REGISTER_phase_shedding_delay,
1232 +diff --git a/drivers/gpu/drm/radeon/sislands_smc.h b/drivers/gpu/drm/radeon/sislands_smc.h
1233 +index 3c779838d9ab..966e3a556011 100644
1234 +--- a/drivers/gpu/drm/radeon/sislands_smc.h
1235 ++++ b/drivers/gpu/drm/radeon/sislands_smc.h
1236 +@@ -194,6 +194,7 @@ typedef struct SISLANDS_SMC_SWSTATE SISLANDS_SMC_SWSTATE;
1237 + #define SISLANDS_SMC_VOLTAGEMASK_VDDC 0
1238 + #define SISLANDS_SMC_VOLTAGEMASK_MVDD 1
1239 + #define SISLANDS_SMC_VOLTAGEMASK_VDDCI 2
1240 ++#define SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING 3
1241 + #define SISLANDS_SMC_VOLTAGEMASK_MAX 4
1242 +
1243 + struct SISLANDS_SMC_VOLTAGEMASKTABLE
1244 +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1245 +index 4948c1529836..ecf15cf0c3fd 100644
1246 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1247 ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1248 +@@ -3830,14 +3830,14 @@ static void *vmw_execbuf_cmdbuf(struct vmw_private *dev_priv,
1249 + int ret;
1250 +
1251 + *header = NULL;
1252 +- if (!dev_priv->cman || kernel_commands)
1253 +- return kernel_commands;
1254 +-
1255 + if (command_size > SVGA_CB_MAX_SIZE) {
1256 + DRM_ERROR("Command buffer is too large.\n");
1257 + return ERR_PTR(-EINVAL);
1258 + }
1259 +
1260 ++ if (!dev_priv->cman || kernel_commands)
1261 ++ return kernel_commands;
1262 ++
1263 + /* If possible, add a little space for fencing. */
1264 + cmdbuf_size = command_size + 512;
1265 + cmdbuf_size = min_t(size_t, cmdbuf_size, SVGA_CB_MAX_SIZE);
1266 +diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
1267 +index 71493d2af912..70a6985334d5 100644
1268 +--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
1269 ++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
1270 +@@ -4102,7 +4102,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
1271 + (u8 *)&settings->beacon.head[ie_offset],
1272 + settings->beacon.head_len - ie_offset,
1273 + WLAN_EID_SSID);
1274 +- if (!ssid_ie)
1275 ++ if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)
1276 + return -EINVAL;
1277 +
1278 + memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len);
1279 +diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
1280 +index 3cda1f956f0b..6378dfd3b4e8 100644
1281 +--- a/drivers/net/wireless/mwifiex/join.c
1282 ++++ b/drivers/net/wireless/mwifiex/join.c
1283 +@@ -661,9 +661,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
1284 + priv->assoc_rsp_size = min(le16_to_cpu(resp->size) - S_DS_GEN,
1285 + sizeof(priv->assoc_rsp_buf));
1286 +
1287 +- memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size);
1288 +-
1289 + assoc_rsp->a_id = cpu_to_le16(aid);
1290 ++ memcpy(priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size);
1291 +
1292 + if (status_code) {
1293 + priv->adapter->dbg.num_cmd_assoc_failure++;
1294 +diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c
1295 +index 1fea2c7ef97f..6fc31bdc639b 100644
1296 +--- a/drivers/power/bq24257_charger.c
1297 ++++ b/drivers/power/bq24257_charger.c
1298 +@@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_client *client,
1299 + return ret;
1300 + }
1301 +
1302 ++ ret = bq24257_power_supply_init(bq);
1303 ++ if (ret < 0) {
1304 ++ dev_err(dev, "Failed to register power supply\n");
1305 ++ return ret;
1306 ++ }
1307 ++
1308 + ret = devm_request_threaded_irq(dev, client->irq, NULL,
1309 + bq24257_irq_handler_thread,
1310 + IRQF_TRIGGER_FALLING |
1311 +@@ -1078,12 +1084,6 @@ static int bq24257_probe(struct i2c_client *client,
1312 + return ret;
1313 + }
1314 +
1315 +- ret = bq24257_power_supply_init(bq);
1316 +- if (ret < 0) {
1317 +- dev_err(dev, "Failed to register power supply\n");
1318 +- return ret;
1319 +- }
1320 +-
1321 + ret = sysfs_create_group(&bq->charger->dev.kobj, &bq24257_attr_group);
1322 + if (ret < 0) {
1323 + dev_err(dev, "Can't create sysfs entries\n");
1324 +diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
1325 +index 7c511add5aa7..bae98521c808 100644
1326 +--- a/drivers/s390/char/con3270.c
1327 ++++ b/drivers/s390/char/con3270.c
1328 +@@ -124,7 +124,12 @@ con3270_create_status(struct con3270 *cp)
1329 + static void
1330 + con3270_update_string(struct con3270 *cp, struct string *s, int nr)
1331 + {
1332 +- if (s->len >= cp->view.cols - 5)
1333 ++ if (s->len < 4) {
1334 ++ /* This indicates a bug, but printing a warning would
1335 ++ * cause a deadlock. */
1336 ++ return;
1337 ++ }
1338 ++ if (s->string[s->len - 4] != TO_RA)
1339 + return;
1340 + raw3270_buffer_address(cp->view.dev, s->string + s->len - 3,
1341 + cp->view.cols * (nr + 1));
1342 +@@ -461,11 +466,11 @@ con3270_cline_end(struct con3270 *cp)
1343 + cp->cline->len + 4 : cp->view.cols;
1344 + s = con3270_alloc_string(cp, size);
1345 + memcpy(s->string, cp->cline->string, cp->cline->len);
1346 +- if (s->len < cp->view.cols - 5) {
1347 ++ if (cp->cline->len < cp->view.cols - 5) {
1348 + s->string[s->len - 4] = TO_RA;
1349 + s->string[s->len - 1] = 0;
1350 + } else {
1351 +- while (--size > cp->cline->len)
1352 ++ while (--size >= cp->cline->len)
1353 + s->string[size] = cp->view.ascebc[' '];
1354 + }
1355 + /* Replace cline with allocated line s and reset cline. */
1356 +diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
1357 +index c424c0c7367e..1e16331891a9 100644
1358 +--- a/drivers/s390/cio/chsc.c
1359 ++++ b/drivers/s390/cio/chsc.c
1360 +@@ -95,12 +95,13 @@ struct chsc_ssd_area {
1361 + int chsc_get_ssd_info(struct subchannel_id schid, struct chsc_ssd_info *ssd)
1362 + {
1363 + struct chsc_ssd_area *ssd_area;
1364 ++ unsigned long flags;
1365 + int ccode;
1366 + int ret;
1367 + int i;
1368 + int mask;
1369 +
1370 +- spin_lock_irq(&chsc_page_lock);
1371 ++ spin_lock_irqsave(&chsc_page_lock, flags);
1372 + memset(chsc_page, 0, PAGE_SIZE);
1373 + ssd_area = chsc_page;
1374 + ssd_area->request.length = 0x0010;
1375 +@@ -144,7 +145,7 @@ int chsc_get_ssd_info(struct subchannel_id schid, struct chsc_ssd_info *ssd)
1376 + ssd->fla[i] = ssd_area->fla[i];
1377 + }
1378 + out:
1379 +- spin_unlock_irq(&chsc_page_lock);
1380 ++ spin_unlock_irqrestore(&chsc_page_lock, flags);
1381 + return ret;
1382 + }
1383 +
1384 +@@ -832,9 +833,10 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable)
1385 + u32 fmt : 4;
1386 + u32 : 16;
1387 + } __attribute__ ((packed)) *secm_area;
1388 ++ unsigned long flags;
1389 + int ret, ccode;
1390 +
1391 +- spin_lock_irq(&chsc_page_lock);
1392 ++ spin_lock_irqsave(&chsc_page_lock, flags);
1393 + memset(chsc_page, 0, PAGE_SIZE);
1394 + secm_area = chsc_page;
1395 + secm_area->request.length = 0x0050;
1396 +@@ -864,7 +866,7 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable)
1397 + CIO_CRW_EVENT(2, "chsc: secm failed (rc=%04x)\n",
1398 + secm_area->response.code);
1399 + out:
1400 +- spin_unlock_irq(&chsc_page_lock);
1401 ++ spin_unlock_irqrestore(&chsc_page_lock, flags);
1402 + return ret;
1403 + }
1404 +
1405 +@@ -993,6 +995,7 @@ chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv,
1406 +
1407 + int chsc_get_channel_measurement_chars(struct channel_path *chp)
1408 + {
1409 ++ unsigned long flags;
1410 + int ccode, ret;
1411 +
1412 + struct {
1413 +@@ -1022,7 +1025,7 @@ int chsc_get_channel_measurement_chars(struct channel_path *chp)
1414 + if (!css_chsc_characteristics.scmc || !css_chsc_characteristics.secm)
1415 + return 0;
1416 +
1417 +- spin_lock_irq(&chsc_page_lock);
1418 ++ spin_lock_irqsave(&chsc_page_lock, flags);
1419 + memset(chsc_page, 0, PAGE_SIZE);
1420 + scmc_area = chsc_page;
1421 + scmc_area->request.length = 0x0010;
1422 +@@ -1054,7 +1057,7 @@ int chsc_get_channel_measurement_chars(struct channel_path *chp)
1423 + chsc_initialize_cmg_chars(chp, scmc_area->cmcv,
1424 + (struct cmg_chars *) &scmc_area->data);
1425 + out:
1426 +- spin_unlock_irq(&chsc_page_lock);
1427 ++ spin_unlock_irqrestore(&chsc_page_lock, flags);
1428 + return ret;
1429 + }
1430 +
1431 +@@ -1135,6 +1138,7 @@ struct css_chsc_char css_chsc_characteristics;
1432 + int __init
1433 + chsc_determine_css_characteristics(void)
1434 + {
1435 ++ unsigned long flags;
1436 + int result;
1437 + struct {
1438 + struct chsc_header request;
1439 +@@ -1147,7 +1151,7 @@ chsc_determine_css_characteristics(void)
1440 + u32 chsc_char[508];
1441 + } __attribute__ ((packed)) *scsc_area;
1442 +
1443 +- spin_lock_irq(&chsc_page_lock);
1444 ++ spin_lock_irqsave(&chsc_page_lock, flags);
1445 + memset(chsc_page, 0, PAGE_SIZE);
1446 + scsc_area = chsc_page;
1447 + scsc_area->request.length = 0x0010;
1448 +@@ -1169,7 +1173,7 @@ chsc_determine_css_characteristics(void)
1449 + CIO_CRW_EVENT(2, "chsc: scsc failed (rc=%04x)\n",
1450 + scsc_area->response.code);
1451 + exit:
1452 +- spin_unlock_irq(&chsc_page_lock);
1453 ++ spin_unlock_irqrestore(&chsc_page_lock, flags);
1454 + return result;
1455 + }
1456 +
1457 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1458 +index 6180f7970bbf..0969cea1089a 100644
1459 +--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1460 ++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1461 +@@ -4510,7 +4510,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
1462 + le16_to_cpu(mpi_reply->DevHandle));
1463 + mpt3sas_trigger_scsi(ioc, data.skey, data.asc, data.ascq);
1464 +
1465 +- if (!(ioc->logging_level & MPT_DEBUG_REPLY) &&
1466 ++ if ((ioc->logging_level & MPT_DEBUG_REPLY) &&
1467 + ((scmd->sense_buffer[2] == UNIT_ATTENTION) ||
1468 + (scmd->sense_buffer[2] == MEDIUM_ERROR) ||
1469 + (scmd->sense_buffer[2] == HARDWARE_ERROR)))
1470 +diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
1471 +index 39412c9097c6..a3965cac1b34 100644
1472 +--- a/drivers/spi/spi-fsl-dspi.c
1473 ++++ b/drivers/spi/spi-fsl-dspi.c
1474 +@@ -753,7 +753,6 @@ static int dspi_remove(struct platform_device *pdev)
1475 + /* Disconnect from the SPI framework */
1476 + clk_disable_unprepare(dspi->clk);
1477 + spi_unregister_master(dspi->master);
1478 +- spi_master_put(dspi->master);
1479 +
1480 + return 0;
1481 + }
1482 +diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
1483 +index 9b7026e7d55b..45d0a87f55d2 100644
1484 +--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
1485 ++++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
1486 +@@ -718,13 +718,13 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
1487 + u8 res = _SUCCESS;
1488 +
1489 +
1490 +- ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
1491 ++ ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
1492 + if (ph2c == NULL) {
1493 + res = _FAIL;
1494 + goto exit;
1495 + }
1496 +
1497 +- paddbareq_parm = kzalloc(sizeof(struct addBaReq_parm), GFP_KERNEL);
1498 ++ paddbareq_parm = kzalloc(sizeof(struct addBaReq_parm), GFP_ATOMIC);
1499 + if (paddbareq_parm == NULL) {
1500 + kfree(ph2c);
1501 + res = _FAIL;
1502 +diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
1503 +index 915facbf552e..e1134a4d97f3 100644
1504 +--- a/drivers/uio/uio_dmem_genirq.c
1505 ++++ b/drivers/uio/uio_dmem_genirq.c
1506 +@@ -229,7 +229,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
1507 + ++uiomem;
1508 + }
1509 +
1510 +- priv->dmem_region_start = i;
1511 ++ priv->dmem_region_start = uiomem - &uioinfo->mem[0];
1512 + priv->num_dmem_regions = pdata->num_dynamic_regions;
1513 +
1514 + for (i = 0; i < pdata->num_dynamic_regions; ++i) {
1515 +diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
1516 +index 531e76474983..0e0eb10f82a0 100644
1517 +--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
1518 ++++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
1519 +@@ -316,7 +316,7 @@ static int xenbus_write_transaction(unsigned msg_type,
1520 + rc = -ENOMEM;
1521 + goto out;
1522 + }
1523 +- } else {
1524 ++ } else if (msg_type == XS_TRANSACTION_END) {
1525 + list_for_each_entry(trans, &u->transactions, list)
1526 + if (trans->handle.id == u->u.msg.tx_id)
1527 + break;
1528 +diff --git a/fs/9p/acl.c b/fs/9p/acl.c
1529 +index a7e28890f5ef..929b618da43b 100644
1530 +--- a/fs/9p/acl.c
1531 ++++ b/fs/9p/acl.c
1532 +@@ -282,32 +282,26 @@ static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
1533 + switch (handler->flags) {
1534 + case ACL_TYPE_ACCESS:
1535 + if (acl) {
1536 +- umode_t mode = inode->i_mode;
1537 +- retval = posix_acl_equiv_mode(acl, &mode);
1538 +- if (retval < 0)
1539 ++ struct iattr iattr;
1540 ++
1541 ++ retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
1542 ++ if (retval)
1543 + goto err_out;
1544 +- else {
1545 +- struct iattr iattr;
1546 +- if (retval == 0) {
1547 +- /*
1548 +- * ACL can be represented
1549 +- * by the mode bits. So don't
1550 +- * update ACL.
1551 +- */
1552 +- acl = NULL;
1553 +- value = NULL;
1554 +- size = 0;
1555 +- }
1556 +- /* Updte the mode bits */
1557 +- iattr.ia_mode = ((mode & S_IALLUGO) |
1558 +- (inode->i_mode & ~S_IALLUGO));
1559 +- iattr.ia_valid = ATTR_MODE;
1560 +- /* FIXME should we update ctime ?
1561 +- * What is the following setxattr update the
1562 +- * mode ?
1563 ++ if (!acl) {
1564 ++ /*
1565 ++ * ACL can be represented
1566 ++ * by the mode bits. So don't
1567 ++ * update ACL.
1568 + */
1569 +- v9fs_vfs_setattr_dotl(dentry, &iattr);
1570 ++ value = NULL;
1571 ++ size = 0;
1572 + }
1573 ++ iattr.ia_valid = ATTR_MODE;
1574 ++ /* FIXME should we update ctime ?
1575 ++ * What is the following setxattr update the
1576 ++ * mode ?
1577 ++ */
1578 ++ v9fs_vfs_setattr_dotl(dentry, &iattr);
1579 + }
1580 + break;
1581 + case ACL_TYPE_DEFAULT:
1582 +diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
1583 +index 9a0124a95851..fb3e64d37cb4 100644
1584 +--- a/fs/btrfs/acl.c
1585 ++++ b/fs/btrfs/acl.c
1586 +@@ -83,11 +83,9 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans,
1587 + case ACL_TYPE_ACCESS:
1588 + name = POSIX_ACL_XATTR_ACCESS;
1589 + if (acl) {
1590 +- ret = posix_acl_equiv_mode(acl, &inode->i_mode);
1591 +- if (ret < 0)
1592 ++ ret = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1593 ++ if (ret)
1594 + return ret;
1595 +- if (ret == 0)
1596 +- acl = NULL;
1597 + }
1598 + ret = 0;
1599 + break;
1600 +diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c
1601 +index 8f84646f10e9..4d8caeb94a11 100644
1602 +--- a/fs/ceph/acl.c
1603 ++++ b/fs/ceph/acl.c
1604 +@@ -94,11 +94,9 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1605 + case ACL_TYPE_ACCESS:
1606 + name = POSIX_ACL_XATTR_ACCESS;
1607 + if (acl) {
1608 +- ret = posix_acl_equiv_mode(acl, &new_mode);
1609 +- if (ret < 0)
1610 ++ ret = posix_acl_update_mode(inode, &new_mode, &acl);
1611 ++ if (ret)
1612 + goto out;
1613 +- if (ret == 0)
1614 +- acl = NULL;
1615 + }
1616 + break;
1617 + case ACL_TYPE_DEFAULT:
1618 +diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
1619 +index 27695e6f4e46..d6aeb84e90b6 100644
1620 +--- a/fs/ext2/acl.c
1621 ++++ b/fs/ext2/acl.c
1622 +@@ -193,15 +193,11 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1623 + case ACL_TYPE_ACCESS:
1624 + name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
1625 + if (acl) {
1626 +- error = posix_acl_equiv_mode(acl, &inode->i_mode);
1627 +- if (error < 0)
1628 ++ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1629 ++ if (error)
1630 + return error;
1631 +- else {
1632 +- inode->i_ctime = CURRENT_TIME_SEC;
1633 +- mark_inode_dirty(inode);
1634 +- if (error == 0)
1635 +- acl = NULL;
1636 +- }
1637 ++ inode->i_ctime = CURRENT_TIME_SEC;
1638 ++ mark_inode_dirty(inode);
1639 + }
1640 + break;
1641 +
1642 +diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
1643 +index 69b1e73026a5..c3fe1e323951 100644
1644 +--- a/fs/ext4/acl.c
1645 ++++ b/fs/ext4/acl.c
1646 +@@ -196,15 +196,11 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type,
1647 + case ACL_TYPE_ACCESS:
1648 + name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
1649 + if (acl) {
1650 +- error = posix_acl_equiv_mode(acl, &inode->i_mode);
1651 +- if (error < 0)
1652 ++ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1653 ++ if (error)
1654 + return error;
1655 +- else {
1656 +- inode->i_ctime = ext4_current_time(inode);
1657 +- ext4_mark_inode_dirty(handle, inode);
1658 +- if (error == 0)
1659 +- acl = NULL;
1660 +- }
1661 ++ inode->i_ctime = ext4_current_time(inode);
1662 ++ ext4_mark_inode_dirty(handle, inode);
1663 + }
1664 + break;
1665 +
1666 +diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
1667 +index c8f25f7241f0..e9a8d676c6bc 100644
1668 +--- a/fs/f2fs/acl.c
1669 ++++ b/fs/f2fs/acl.c
1670 +@@ -214,12 +214,10 @@ static int __f2fs_set_acl(struct inode *inode, int type,
1671 + case ACL_TYPE_ACCESS:
1672 + name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
1673 + if (acl) {
1674 +- error = posix_acl_equiv_mode(acl, &inode->i_mode);
1675 +- if (error < 0)
1676 ++ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1677 ++ if (error)
1678 + return error;
1679 + set_acl_inode(fi, inode->i_mode);
1680 +- if (error == 0)
1681 +- acl = NULL;
1682 + }
1683 + break;
1684 +
1685 +diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
1686 +index 1be3b061c05c..ff0ac96a8e7b 100644
1687 +--- a/fs/gfs2/acl.c
1688 ++++ b/fs/gfs2/acl.c
1689 +@@ -79,17 +79,11 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1690 + if (type == ACL_TYPE_ACCESS) {
1691 + umode_t mode = inode->i_mode;
1692 +
1693 +- error = posix_acl_equiv_mode(acl, &mode);
1694 +- if (error < 0)
1695 ++ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1696 ++ if (error)
1697 + return error;
1698 +-
1699 +- if (error == 0)
1700 +- acl = NULL;
1701 +-
1702 +- if (mode != inode->i_mode) {
1703 +- inode->i_mode = mode;
1704 ++ if (mode != inode->i_mode)
1705 + mark_inode_dirty(inode);
1706 +- }
1707 + }
1708 +
1709 + if (acl) {
1710 +diff --git a/fs/hfsplus/posix_acl.c b/fs/hfsplus/posix_acl.c
1711 +index df0c9af68d05..71b3087b7e32 100644
1712 +--- a/fs/hfsplus/posix_acl.c
1713 ++++ b/fs/hfsplus/posix_acl.c
1714 +@@ -68,8 +68,8 @@ int hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl,
1715 + case ACL_TYPE_ACCESS:
1716 + xattr_name = POSIX_ACL_XATTR_ACCESS;
1717 + if (acl) {
1718 +- err = posix_acl_equiv_mode(acl, &inode->i_mode);
1719 +- if (err < 0)
1720 ++ err = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1721 ++ if (err)
1722 + return err;
1723 + }
1724 + err = 0;
1725 +diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
1726 +index 2f7a3c090489..f9f86f87d32b 100644
1727 +--- a/fs/jffs2/acl.c
1728 ++++ b/fs/jffs2/acl.c
1729 +@@ -235,9 +235,10 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1730 + case ACL_TYPE_ACCESS:
1731 + xprefix = JFFS2_XPREFIX_ACL_ACCESS;
1732 + if (acl) {
1733 +- umode_t mode = inode->i_mode;
1734 +- rc = posix_acl_equiv_mode(acl, &mode);
1735 +- if (rc < 0)
1736 ++ umode_t mode;
1737 ++
1738 ++ rc = posix_acl_update_mode(inode, &mode, &acl);
1739 ++ if (rc)
1740 + return rc;
1741 + if (inode->i_mode != mode) {
1742 + struct iattr attr;
1743 +@@ -249,8 +250,6 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1744 + if (rc < 0)
1745 + return rc;
1746 + }
1747 +- if (rc == 0)
1748 +- acl = NULL;
1749 + }
1750 + break;
1751 + case ACL_TYPE_DEFAULT:
1752 +diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
1753 +index 0c8ca830b113..9fad9f4fe883 100644
1754 +--- a/fs/jfs/acl.c
1755 ++++ b/fs/jfs/acl.c
1756 +@@ -84,13 +84,11 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
1757 + case ACL_TYPE_ACCESS:
1758 + ea_name = POSIX_ACL_XATTR_ACCESS;
1759 + if (acl) {
1760 +- rc = posix_acl_equiv_mode(acl, &inode->i_mode);
1761 +- if (rc < 0)
1762 ++ rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1763 ++ if (rc)
1764 + return rc;
1765 + inode->i_ctime = CURRENT_TIME;
1766 + mark_inode_dirty(inode);
1767 +- if (rc == 0)
1768 +- acl = NULL;
1769 + }
1770 + break;
1771 + case ACL_TYPE_DEFAULT:
1772 +diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
1773 +index 2162434728c0..164307b99405 100644
1774 +--- a/fs/ocfs2/acl.c
1775 ++++ b/fs/ocfs2/acl.c
1776 +@@ -241,13 +241,11 @@ int ocfs2_set_acl(handle_t *handle,
1777 + case ACL_TYPE_ACCESS:
1778 + name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS;
1779 + if (acl) {
1780 +- umode_t mode = inode->i_mode;
1781 +- ret = posix_acl_equiv_mode(acl, &mode);
1782 +- if (ret < 0)
1783 +- return ret;
1784 ++ umode_t mode;
1785 +
1786 +- if (ret == 0)
1787 +- acl = NULL;
1788 ++ ret = posix_acl_update_mode(inode, &mode, &acl);
1789 ++ if (ret)
1790 ++ return ret;
1791 +
1792 + ret = ocfs2_acl_set_mode(inode, di_bh,
1793 + handle, mode);
1794 +diff --git a/fs/posix_acl.c b/fs/posix_acl.c
1795 +index 34bd1bd354e6..a60d3cc5b55d 100644
1796 +--- a/fs/posix_acl.c
1797 ++++ b/fs/posix_acl.c
1798 +@@ -592,6 +592,37 @@ no_mem:
1799 + }
1800 + EXPORT_SYMBOL_GPL(posix_acl_create);
1801 +
1802 ++/**
1803 ++ * posix_acl_update_mode - update mode in set_acl
1804 ++ *
1805 ++ * Update the file mode when setting an ACL: compute the new file permission
1806 ++ * bits based on the ACL. In addition, if the ACL is equivalent to the new
1807 ++ * file mode, set *acl to NULL to indicate that no ACL should be set.
1808 ++ *
1809 ++ * As with chmod, clear the setgit bit if the caller is not in the owning group
1810 ++ * or capable of CAP_FSETID (see inode_change_ok).
1811 ++ *
1812 ++ * Called from set_acl inode operations.
1813 ++ */
1814 ++int posix_acl_update_mode(struct inode *inode, umode_t *mode_p,
1815 ++ struct posix_acl **acl)
1816 ++{
1817 ++ umode_t mode = inode->i_mode;
1818 ++ int error;
1819 ++
1820 ++ error = posix_acl_equiv_mode(*acl, &mode);
1821 ++ if (error < 0)
1822 ++ return error;
1823 ++ if (error == 0)
1824 ++ *acl = NULL;
1825 ++ if (!in_group_p(inode->i_gid) &&
1826 ++ !capable_wrt_inode_uidgid(inode, CAP_FSETID))
1827 ++ mode &= ~S_ISGID;
1828 ++ *mode_p = mode;
1829 ++ return 0;
1830 ++}
1831 ++EXPORT_SYMBOL(posix_acl_update_mode);
1832 ++
1833 + /*
1834 + * Fix up the uids and gids in posix acl extended attributes in place.
1835 + */
1836 +diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
1837 +index 4b34b9dc03dd..9b1824f35501 100644
1838 +--- a/fs/reiserfs/xattr_acl.c
1839 ++++ b/fs/reiserfs/xattr_acl.c
1840 +@@ -246,13 +246,9 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
1841 + case ACL_TYPE_ACCESS:
1842 + name = POSIX_ACL_XATTR_ACCESS;
1843 + if (acl) {
1844 +- error = posix_acl_equiv_mode(acl, &inode->i_mode);
1845 +- if (error < 0)
1846 ++ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
1847 ++ if (error)
1848 + return error;
1849 +- else {
1850 +- if (error == 0)
1851 +- acl = NULL;
1852 +- }
1853 + }
1854 + break;
1855 + case ACL_TYPE_DEFAULT:
1856 +diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
1857 +index 6bb470fbb8e8..c5101a3295d8 100644
1858 +--- a/fs/xfs/xfs_acl.c
1859 ++++ b/fs/xfs/xfs_acl.c
1860 +@@ -288,16 +288,11 @@ xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
1861 + return error;
1862 +
1863 + if (type == ACL_TYPE_ACCESS) {
1864 +- umode_t mode = inode->i_mode;
1865 +- error = posix_acl_equiv_mode(acl, &mode);
1866 +-
1867 +- if (error <= 0) {
1868 +- acl = NULL;
1869 +-
1870 +- if (error < 0)
1871 +- return error;
1872 +- }
1873 ++ umode_t mode;
1874 +
1875 ++ error = posix_acl_update_mode(inode, &mode, &acl);
1876 ++ if (error)
1877 ++ return error;
1878 + error = xfs_set_mode(inode, mode);
1879 + if (error)
1880 + return error;
1881 +diff --git a/include/drm/drmP.h b/include/drm/drmP.h
1882 +index 0a271ca1f7c7..a31976c860f6 100644
1883 +--- a/include/drm/drmP.h
1884 ++++ b/include/drm/drmP.h
1885 +@@ -1029,7 +1029,8 @@ static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
1886 + #endif
1887 +
1888 + extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
1889 +- struct drm_gem_object *obj, int flags);
1890 ++ struct drm_gem_object *obj,
1891 ++ int flags);
1892 + extern int drm_gem_prime_handle_to_fd(struct drm_device *dev,
1893 + struct drm_file *file_priv, uint32_t handle, uint32_t flags,
1894 + int *prime_fd);
1895 +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
1896 +index 4e9c75226f07..12b4d54a8ffa 100644
1897 +--- a/include/linux/netdevice.h
1898 ++++ b/include/linux/netdevice.h
1899 +@@ -1986,8 +1986,8 @@ struct napi_gro_cb {
1900 + /* This is non-zero if the packet may be of the same flow. */
1901 + u8 same_flow:1;
1902 +
1903 +- /* Used in udp_gro_receive */
1904 +- u8 udp_mark:1;
1905 ++ /* Used in tunnel GRO receive */
1906 ++ u8 encap_mark:1;
1907 +
1908 + /* GRO checksum is valid */
1909 + u8 csum_valid:1;
1910 +diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
1911 +index 3e96a6a76103..d1a8ad7e5ae4 100644
1912 +--- a/include/linux/posix_acl.h
1913 ++++ b/include/linux/posix_acl.h
1914 +@@ -95,6 +95,7 @@ extern int set_posix_acl(struct inode *, int, struct posix_acl *);
1915 + extern int posix_acl_chmod(struct inode *, umode_t);
1916 + extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
1917 + struct posix_acl **);
1918 ++extern int posix_acl_update_mode(struct inode *, umode_t *, struct posix_acl **);
1919 +
1920 + extern int simple_set_acl(struct inode *, struct posix_acl *, int);
1921 + extern int simple_acl_create(struct inode *, struct inode *);
1922 +diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
1923 +index af40bc586a1b..86a7bdd61d1a 100644
1924 +--- a/include/net/ip_tunnels.h
1925 ++++ b/include/net/ip_tunnels.h
1926 +@@ -283,6 +283,22 @@ struct metadata_dst *iptunnel_metadata_reply(struct metadata_dst *md,
1927 + struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
1928 + int gso_type_mask);
1929 +
1930 ++static inline int iptunnel_pull_offloads(struct sk_buff *skb)
1931 ++{
1932 ++ if (skb_is_gso(skb)) {
1933 ++ int err;
1934 ++
1935 ++ err = skb_unclone(skb, GFP_ATOMIC);
1936 ++ if (unlikely(err))
1937 ++ return err;
1938 ++ skb_shinfo(skb)->gso_type &= ~(NETIF_F_GSO_ENCAP_ALL >>
1939 ++ NETIF_F_GSO_SHIFT);
1940 ++ }
1941 ++
1942 ++ skb->encapsulation = 0;
1943 ++ return 0;
1944 ++}
1945 ++
1946 + static inline void iptunnel_xmit_stats(int err,
1947 + struct net_device_stats *err_stats,
1948 + struct pcpu_sw_netstats __percpu *stats)
1949 +diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
1950 +index abd286afbd27..a4775f3451b9 100644
1951 +--- a/kernel/irq/generic-chip.c
1952 ++++ b/kernel/irq/generic-chip.c
1953 +@@ -411,8 +411,29 @@ int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
1954 + }
1955 + EXPORT_SYMBOL_GPL(irq_map_generic_chip);
1956 +
1957 ++static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
1958 ++{
1959 ++ struct irq_data *data = irq_domain_get_irq_data(d, virq);
1960 ++ struct irq_domain_chip_generic *dgc = d->gc;
1961 ++ unsigned int hw_irq = data->hwirq;
1962 ++ struct irq_chip_generic *gc;
1963 ++ int irq_idx;
1964 ++
1965 ++ gc = irq_get_domain_generic_chip(d, hw_irq);
1966 ++ if (!gc)
1967 ++ return;
1968 ++
1969 ++ irq_idx = hw_irq % dgc->irqs_per_chip;
1970 ++
1971 ++ clear_bit(irq_idx, &gc->installed);
1972 ++ irq_domain_set_info(d, virq, hw_irq, &no_irq_chip, NULL, NULL, NULL,
1973 ++ NULL);
1974 ++
1975 ++}
1976 ++
1977 + struct irq_domain_ops irq_generic_chip_ops = {
1978 + .map = irq_map_generic_chip,
1979 ++ .unmap = irq_unmap_generic_chip,
1980 + .xlate = irq_domain_xlate_onetwocell,
1981 + };
1982 + EXPORT_SYMBOL_GPL(irq_generic_chip_ops);
1983 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1984 +index 125c7dd55322..4434cdd4cd9a 100644
1985 +--- a/mm/hugetlb.c
1986 ++++ b/mm/hugetlb.c
1987 +@@ -1416,12 +1416,13 @@ static void dissolve_free_huge_page(struct page *page)
1988 + {
1989 + spin_lock(&hugetlb_lock);
1990 + if (PageHuge(page) && !page_count(page)) {
1991 +- struct hstate *h = page_hstate(page);
1992 +- int nid = page_to_nid(page);
1993 +- list_del(&page->lru);
1994 ++ struct page *head = compound_head(page);
1995 ++ struct hstate *h = page_hstate(head);
1996 ++ int nid = page_to_nid(head);
1997 ++ list_del(&head->lru);
1998 + h->free_huge_pages--;
1999 + h->free_huge_pages_node[nid]--;
2000 +- update_and_free_page(h, page);
2001 ++ update_and_free_page(h, head);
2002 + }
2003 + spin_unlock(&hugetlb_lock);
2004 + }
2005 +@@ -1429,7 +1430,8 @@ static void dissolve_free_huge_page(struct page *page)
2006 + /*
2007 + * Dissolve free hugepages in a given pfn range. Used by memory hotplug to
2008 + * make specified memory blocks removable from the system.
2009 +- * Note that start_pfn should aligned with (minimum) hugepage size.
2010 ++ * Note that this will dissolve a free gigantic hugepage completely, if any
2011 ++ * part of it lies within the given range.
2012 + */
2013 + void dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
2014 + {
2015 +@@ -1438,7 +1440,6 @@ void dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
2016 + if (!hugepages_supported())
2017 + return;
2018 +
2019 +- VM_BUG_ON(!IS_ALIGNED(start_pfn, 1 << minimum_order));
2020 + for (pfn = start_pfn; pfn < end_pfn; pfn += 1 << minimum_order)
2021 + dissolve_free_huge_page(pfn_to_page(pfn));
2022 + }
2023 +diff --git a/net/core/dev.c b/net/core/dev.c
2024 +index de4ed2b5a221..0989fea88c44 100644
2025 +--- a/net/core/dev.c
2026 ++++ b/net/core/dev.c
2027 +@@ -4239,7 +4239,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
2028 + NAPI_GRO_CB(skb)->same_flow = 0;
2029 + NAPI_GRO_CB(skb)->flush = 0;
2030 + NAPI_GRO_CB(skb)->free = 0;
2031 +- NAPI_GRO_CB(skb)->udp_mark = 0;
2032 ++ NAPI_GRO_CB(skb)->encap_mark = 0;
2033 + NAPI_GRO_CB(skb)->gro_remcsum_start = 0;
2034 +
2035 + /* Setup for GRO checksum validation */
2036 +diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
2037 +index 5c5db6636704..1a5c1ca3ad3c 100644
2038 +--- a/net/ipv4/af_inet.c
2039 ++++ b/net/ipv4/af_inet.c
2040 +@@ -1383,6 +1383,19 @@ out:
2041 + return pp;
2042 + }
2043 +
2044 ++static struct sk_buff **ipip_gro_receive(struct sk_buff **head,
2045 ++ struct sk_buff *skb)
2046 ++{
2047 ++ if (NAPI_GRO_CB(skb)->encap_mark) {
2048 ++ NAPI_GRO_CB(skb)->flush = 1;
2049 ++ return NULL;
2050 ++ }
2051 ++
2052 ++ NAPI_GRO_CB(skb)->encap_mark = 1;
2053 ++
2054 ++ return inet_gro_receive(head, skb);
2055 ++}
2056 ++
2057 + int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
2058 + {
2059 + if (sk->sk_family == AF_INET)
2060 +@@ -1425,6 +1438,13 @@ out_unlock:
2061 + return err;
2062 + }
2063 +
2064 ++static int ipip_gro_complete(struct sk_buff *skb, int nhoff)
2065 ++{
2066 ++ skb->encapsulation = 1;
2067 ++ skb_shinfo(skb)->gso_type |= SKB_GSO_IPIP;
2068 ++ return inet_gro_complete(skb, nhoff);
2069 ++}
2070 ++
2071 + int inet_ctl_sock_create(struct sock **sk, unsigned short family,
2072 + unsigned short type, unsigned char protocol,
2073 + struct net *net)
2074 +@@ -1652,8 +1672,8 @@ static struct packet_offload ip_packet_offload __read_mostly = {
2075 + static const struct net_offload ipip_offload = {
2076 + .callbacks = {
2077 + .gso_segment = inet_gso_segment,
2078 +- .gro_receive = inet_gro_receive,
2079 +- .gro_complete = inet_gro_complete,
2080 ++ .gro_receive = ipip_gro_receive,
2081 ++ .gro_complete = ipip_gro_complete,
2082 + },
2083 + };
2084 +
2085 +diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
2086 +index bd903fe0f750..08d7de55e57e 100644
2087 +--- a/net/ipv4/fou.c
2088 ++++ b/net/ipv4/fou.c
2089 +@@ -48,7 +48,7 @@ static inline struct fou *fou_from_sock(struct sock *sk)
2090 + return sk->sk_user_data;
2091 + }
2092 +
2093 +-static void fou_recv_pull(struct sk_buff *skb, size_t len)
2094 ++static int fou_recv_pull(struct sk_buff *skb, size_t len)
2095 + {
2096 + struct iphdr *iph = ip_hdr(skb);
2097 +
2098 +@@ -59,6 +59,7 @@ static void fou_recv_pull(struct sk_buff *skb, size_t len)
2099 + __skb_pull(skb, len);
2100 + skb_postpull_rcsum(skb, udp_hdr(skb), len);
2101 + skb_reset_transport_header(skb);
2102 ++ return iptunnel_pull_offloads(skb);
2103 + }
2104 +
2105 + static int fou_udp_recv(struct sock *sk, struct sk_buff *skb)
2106 +@@ -68,9 +69,14 @@ static int fou_udp_recv(struct sock *sk, struct sk_buff *skb)
2107 + if (!fou)
2108 + return 1;
2109 +
2110 +- fou_recv_pull(skb, sizeof(struct udphdr));
2111 ++ if (fou_recv_pull(skb, sizeof(struct udphdr)))
2112 ++ goto drop;
2113 +
2114 + return -fou->protocol;
2115 ++
2116 ++drop:
2117 ++ kfree_skb(skb);
2118 ++ return 0;
2119 + }
2120 +
2121 + static struct guehdr *gue_remcsum(struct sk_buff *skb, struct guehdr *guehdr,
2122 +@@ -170,6 +176,9 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)
2123 + __skb_pull(skb, sizeof(struct udphdr) + hdrlen);
2124 + skb_reset_transport_header(skb);
2125 +
2126 ++ if (iptunnel_pull_offloads(skb))
2127 ++ goto drop;
2128 ++
2129 + return -guehdr->proto_ctype;
2130 +
2131 + drop:
2132 +diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
2133 +index 5a8ee3282550..e603004c1af8 100644
2134 +--- a/net/ipv4/gre_offload.c
2135 ++++ b/net/ipv4/gre_offload.c
2136 +@@ -128,6 +128,11 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head,
2137 + struct packet_offload *ptype;
2138 + __be16 type;
2139 +
2140 ++ if (NAPI_GRO_CB(skb)->encap_mark)
2141 ++ goto out;
2142 ++
2143 ++ NAPI_GRO_CB(skb)->encap_mark = 1;
2144 ++
2145 + off = skb_gro_offset(skb);
2146 + hlen = off + sizeof(*greh);
2147 + greh = skb_gro_header_fast(skb, off);
2148 +diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
2149 +index 6cb9009c3d96..dbda0565781c 100644
2150 +--- a/net/ipv4/ip_tunnel_core.c
2151 ++++ b/net/ipv4/ip_tunnel_core.c
2152 +@@ -116,7 +116,8 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
2153 + skb->vlan_tci = 0;
2154 + skb_set_queue_mapping(skb, 0);
2155 + skb->pkt_type = PACKET_HOST;
2156 +- return 0;
2157 ++
2158 ++ return iptunnel_pull_offloads(skb);
2159 + }
2160 + EXPORT_SYMBOL_GPL(iptunnel_pull_header);
2161 +
2162 +diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
2163 +index f9386160cbee..0e36e56dfd22 100644
2164 +--- a/net/ipv4/udp_offload.c
2165 ++++ b/net/ipv4/udp_offload.c
2166 +@@ -299,14 +299,14 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
2167 + unsigned int off = skb_gro_offset(skb);
2168 + int flush = 1;
2169 +
2170 +- if (NAPI_GRO_CB(skb)->udp_mark ||
2171 ++ if (NAPI_GRO_CB(skb)->encap_mark ||
2172 + (skb->ip_summed != CHECKSUM_PARTIAL &&
2173 + NAPI_GRO_CB(skb)->csum_cnt == 0 &&
2174 + !NAPI_GRO_CB(skb)->csum_valid))
2175 + goto out;
2176 +
2177 +- /* mark that this skb passed once through the udp gro layer */
2178 +- NAPI_GRO_CB(skb)->udp_mark = 1;
2179 ++ /* mark that this skb passed once through the tunnel gro layer */
2180 ++ NAPI_GRO_CB(skb)->encap_mark = 1;
2181 +
2182 + rcu_read_lock();
2183 + uo_priv = rcu_dereference(udp_offload_base);
2184 +diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
2185 +index eeca943f12dc..82e9f3076028 100644
2186 +--- a/net/ipv6/ip6_offload.c
2187 ++++ b/net/ipv6/ip6_offload.c
2188 +@@ -258,6 +258,19 @@ out:
2189 + return pp;
2190 + }
2191 +
2192 ++static struct sk_buff **sit_gro_receive(struct sk_buff **head,
2193 ++ struct sk_buff *skb)
2194 ++{
2195 ++ if (NAPI_GRO_CB(skb)->encap_mark) {
2196 ++ NAPI_GRO_CB(skb)->flush = 1;
2197 ++ return NULL;
2198 ++ }
2199 ++
2200 ++ NAPI_GRO_CB(skb)->encap_mark = 1;
2201 ++
2202 ++ return ipv6_gro_receive(head, skb);
2203 ++}
2204 ++
2205 + static int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
2206 + {
2207 + const struct net_offload *ops;
2208 +@@ -302,7 +315,7 @@ static struct packet_offload ipv6_packet_offload __read_mostly = {
2209 + static const struct net_offload sit_offload = {
2210 + .callbacks = {
2211 + .gso_segment = ipv6_gso_segment,
2212 +- .gro_receive = ipv6_gro_receive,
2213 ++ .gro_receive = sit_gro_receive,
2214 + .gro_complete = sit_gro_complete,
2215 + },
2216 + };
2217 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
2218 +index ba3d2f3d66d2..3da2b16356eb 100644
2219 +--- a/net/ipv6/sit.c
2220 ++++ b/net/ipv6/sit.c
2221 +@@ -681,14 +681,15 @@ static int ipip6_rcv(struct sk_buff *skb)
2222 + skb->mac_header = skb->network_header;
2223 + skb_reset_network_header(skb);
2224 + IPCB(skb)->flags = 0;
2225 +- skb->protocol = htons(ETH_P_IPV6);
2226 ++ skb->dev = tunnel->dev;
2227 +
2228 + if (packet_is_spoofed(skb, iph, tunnel)) {
2229 + tunnel->dev->stats.rx_errors++;
2230 + goto out;
2231 + }
2232 +
2233 +- __skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
2234 ++ if (iptunnel_pull_header(skb, 0, htons(ETH_P_IPV6)))
2235 ++ goto out;
2236 +
2237 + err = IP_ECN_decapsulate(iph, skb);
2238 + if (unlikely(err)) {
2239 +diff --git a/scripts/sortextable.c b/scripts/sortextable.c
2240 +index c2423d913b46..7b29fb14f870 100644
2241 +--- a/scripts/sortextable.c
2242 ++++ b/scripts/sortextable.c
2243 +@@ -209,6 +209,35 @@ static int compare_relative_table(const void *a, const void *b)
2244 + return 0;
2245 + }
2246 +
2247 ++static void x86_sort_relative_table(char *extab_image, int image_size)
2248 ++{
2249 ++ int i;
2250 ++
2251 ++ i = 0;
2252 ++ while (i < image_size) {
2253 ++ uint32_t *loc = (uint32_t *)(extab_image + i);
2254 ++
2255 ++ w(r(loc) + i, loc);
2256 ++ w(r(loc + 1) + i + 4, loc + 1);
2257 ++ w(r(loc + 2) + i + 8, loc + 2);
2258 ++
2259 ++ i += sizeof(uint32_t) * 3;
2260 ++ }
2261 ++
2262 ++ qsort(extab_image, image_size / 12, 12, compare_relative_table);
2263 ++
2264 ++ i = 0;
2265 ++ while (i < image_size) {
2266 ++ uint32_t *loc = (uint32_t *)(extab_image + i);
2267 ++
2268 ++ w(r(loc) - i, loc);
2269 ++ w(r(loc + 1) - (i + 4), loc + 1);
2270 ++ w(r(loc + 2) - (i + 8), loc + 2);
2271 ++
2272 ++ i += sizeof(uint32_t) * 3;
2273 ++ }
2274 ++}
2275 ++
2276 + static void sort_relative_table(char *extab_image, int image_size)
2277 + {
2278 + int i;
2279 +@@ -281,6 +310,9 @@ do_file(char const *const fname)
2280 + break;
2281 + case EM_386:
2282 + case EM_X86_64:
2283 ++ custom_sort = x86_sort_relative_table;
2284 ++ break;
2285 ++
2286 + case EM_S390:
2287 + custom_sort = sort_relative_table;
2288 + break;
2289 +diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
2290 +index afb70a5d4fd3..b8a256dfed7e 100644
2291 +--- a/sound/soc/soc-dapm.c
2292 ++++ b/sound/soc/soc-dapm.c
2293 +@@ -823,6 +823,7 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
2294 + case snd_soc_dapm_switch:
2295 + case snd_soc_dapm_mixer:
2296 + case snd_soc_dapm_pga:
2297 ++ case snd_soc_dapm_out_drv:
2298 + wname_in_long_name = true;
2299 + kcname_in_long_name = true;
2300 + break;
2301 +@@ -3015,6 +3016,9 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
2302 + }
2303 + mutex_unlock(&card->dapm_mutex);
2304 +
2305 ++ if (ret)
2306 ++ return ret;
2307 ++
2308 + if (invert)
2309 + ucontrol->value.integer.value[0] = max - val;
2310 + else
2311 +@@ -3166,7 +3170,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
2312 + if (e->shift_l != e->shift_r) {
2313 + if (item[1] > e->items)
2314 + return -EINVAL;
2315 +- val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_l;
2316 ++ val |= snd_soc_enum_item_to_val(e, item[1]) << e->shift_r;
2317 + mask |= e->mask << e->shift_r;
2318 + }
2319 +
2320 +diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
2321 +index 6963ba20991c..70396d3f6472 100644
2322 +--- a/sound/soc/soc-topology.c
2323 ++++ b/sound/soc/soc-topology.c
2324 +@@ -1484,6 +1484,7 @@ widget:
2325 + if (widget == NULL) {
2326 + dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n",
2327 + w->name);
2328 ++ ret = -ENOMEM;
2329 + goto hdr_err;
2330 + }
2331 +
2332 +diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
2333 +index 3900386a3629..d802938644b5 100644
2334 +--- a/tools/perf/ui/browsers/hists.c
2335 ++++ b/tools/perf/ui/browsers/hists.c
2336 +@@ -684,7 +684,6 @@ static int __hpp__slsmg_color_printf(struct perf_hpp *hpp, const char *fmt, ...)
2337 + ret = scnprintf(hpp->buf, hpp->size, fmt, len, percent);
2338 + ui_browser__printf(arg->b, "%s", hpp->buf);
2339 +
2340 +- advance_hpp(hpp, ret);
2341 + return ret;
2342 + }
2343 +
2344 +diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
2345 +index 4a3a72cb5805..6ce624cb7001 100644
2346 +--- a/tools/perf/util/stat.c
2347 ++++ b/tools/perf/util/stat.c
2348 +@@ -311,6 +311,16 @@ int perf_stat_process_counter(struct perf_stat_config *config,
2349 +
2350 + aggr->val = aggr->ena = aggr->run = 0;
2351 +
2352 ++ /*
2353 ++ * We calculate counter's data every interval,
2354 ++ * and the display code shows ps->res_stats
2355 ++ * avg value. We need to zero the stats for
2356 ++ * interval mode, otherwise overall avg running
2357 ++ * averages will be shown for each interval.
2358 ++ */
2359 ++ if (config->interval)
2360 ++ init_stats(ps->res_stats);
2361 ++
2362 + if (counter->per_pkg)
2363 + zero_per_pkg(counter);
2364 +
2365 +diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
2366 +index 475d88d0a1c9..27ae382feb2d 100644
2367 +--- a/tools/perf/util/symbol-elf.c
2368 ++++ b/tools/perf/util/symbol-elf.c
2369 +@@ -1091,9 +1091,8 @@ new_symbol:
2370 + * For misannotated, zeroed, ASM function sizes.
2371 + */
2372 + if (nr > 0) {
2373 +- if (!symbol_conf.allow_aliases)
2374 +- symbols__fixup_duplicate(&dso->symbols[map->type]);
2375 + symbols__fixup_end(&dso->symbols[map->type]);
2376 ++ symbols__fixup_duplicate(&dso->symbols[map->type]);
2377 + if (kmap) {
2378 + /*
2379 + * We need to fixup this here too because we create new
2380 +diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
2381 +index cd08027a6d2c..520a32a12f8a 100644
2382 +--- a/tools/perf/util/symbol.c
2383 ++++ b/tools/perf/util/symbol.c
2384 +@@ -151,6 +151,9 @@ void symbols__fixup_duplicate(struct rb_root *symbols)
2385 + struct rb_node *nd;
2386 + struct symbol *curr, *next;
2387 +
2388 ++ if (symbol_conf.allow_aliases)
2389 ++ return;
2390 ++
2391 + nd = rb_first(symbols);
2392 +
2393 + while (nd) {
2394 +@@ -1275,8 +1278,8 @@ int dso__load_kallsyms(struct dso *dso, const char *filename,
2395 + if (kallsyms__delta(map, filename, &delta))
2396 + return -1;
2397 +
2398 +- symbols__fixup_duplicate(&dso->symbols[map->type]);
2399 + symbols__fixup_end(&dso->symbols[map->type]);
2400 ++ symbols__fixup_duplicate(&dso->symbols[map->type]);
2401 +
2402 + if (dso->kernel == DSO_TYPE_GUEST_KERNEL)
2403 + dso->symtab_type = DSO_BINARY_TYPE__GUEST_KALLSYMS;