···11== Amlogic Meson pinmux controller ==2233Required properties for the root node:44- - compatible: "amlogic,meson8-pinctrl" or "amlogic,meson8b-pinctrl"44+ - compatible: one of "amlogic,meson8-cbus-pinctrl"55+ "amlogic,meson8b-cbus-pinctrl"66+ "amlogic,meson8-aobus-pinctrl"77+ "amlogic,meson8b-aobus-pinctrl"58 - reg: address and size of registers controlling irq functionality69710=== GPIO sub-nodes ===81199-The 2 power domains of the controller (regular and always-on) are1010-represented as sub-nodes and each of them acts as a GPIO controller.1212+The GPIO bank for the controller is represented as a sub-node and it acts as a1313+GPIO controller.11141215Required properties for sub-nodes are:1316 - reg: should contain address and size for mux, pull-enable, pull and···2017 when it is missing the "pull" registers are used instead2118 - gpio-controller: identifies the node as a gpio controller2219 - #gpio-cells: must be 22323-2424-Valid sub-node names are:2525- - "banks" for the regular domain2626- - "ao-bank" for the always-on domain27202821=== Other sub-nodes ===2922···4445=== Example ===45464647 pinctrl: pinctrl@c1109880 {4747- compatible = "amlogic,meson8-pinctrl";4848+ compatible = "amlogic,meson8-cbus-pinctrl";4849 reg = <0xc1109880 0x10>;4950 #address-cells = <1>;5051 #size-cells = <1>;···6061 #gpio-cells = <2>;6162 };62636363- gpio_ao: ao-bank@c1108030 {6464- reg = <0xc8100014 0x4>,6565- <0xc810002c 0x4>,6666- <0xc8100024 0x8>;6767- reg-names = "mux", "pull", "gpio";6868- gpio-controller;6969- #gpio-cells = <2>;7070- };7171-7264 nand {7365 mux {7466 groups = "nand_io", "nand_io_ce0", "nand_io_ce1",···6777 "nand_wen_clk", "nand_ren_clk", "nand_dqs",6878 "nand_ce2", "nand_ce3";6979 function = "nand";7070- };7171- };7272-7373- uart_ao_a {7474- mux {7575- groups = "uart_tx_ao_a", "uart_rx_ao_a",7676- "uart_cts_ao_a", "uart_rts_ao_a";7777- function = "uart_ao";7878- };7979-8080- conf {8181- pins = "GPIOAO_0", "GPIOAO_1",8282- "GPIOAO_2", "GPIOAO_3";8383- bias-disable;8480 };8581 };8682 };
+2
Documentation/kernel-parameters.txt
···40774077 sector if the number is odd);40784078 i = IGNORE_DEVICE (don't bind to this40794079 device);40804080+ j = NO_REPORT_LUNS (don't use report luns40814081+ command, uas only);40804082 l = NOT_LOCKABLE (don't try to lock and40814083 unlock ejectable media);40824084 m = MAX_SECTORS_64 (don't transfer more
+1-1
Documentation/usb/gadget_multi.txt
···4343First of all, Windows need to detect the gadget as an USB composite4444gadget which on its own have some conditions[4]. If they are met,4545Windows lets USB Generic Parent Driver[5] handle the device which then4646-tries to much drivers for each individual interface (sort of, don't4646+tries to match drivers for each individual interface (sort of, don't4747get into too many details).48484949The good news is: you do not have to worry about most of the
+27
Documentation/x86/protection-keys.txt
···11+Memory Protection Keys for Userspace (PKU aka PKEYs) is a CPU feature22+which will be found on future Intel CPUs.33+44+Memory Protection Keys provides a mechanism for enforcing page-based55+protections, but without requiring modification of the page tables66+when an application changes protection domains. It works by77+dedicating 4 previously ignored bits in each page table entry to a88+"protection key", giving 16 possible keys.99+1010+There is also a new user-accessible register (PKRU) with two separate1111+bits (Access Disable and Write Disable) for each key. Being a CPU1212+register, PKRU is inherently thread-local, potentially giving each1313+thread a different set of protections from every other thread.1414+1515+There are two new instructions (RDPKRU/WRPKRU) for reading and writing1616+to the new register. The feature is only available in 64-bit mode,1717+even though there is theoretically space in the PAE PTEs. These1818+permissions are enforced on data access only and have no effect on1919+instruction fetches.2020+2121+=========================== Config Option ===========================2222+2323+This config option adds approximately 1.5kb of text. and 50 bytes of2424+data to the executable. A workload which does large O_DIRECT reads2525+of holes in XFS files was run to exercise get_user_pages_fast(). No2626+performance delta was observed with the config option2727+enabled or disabled.
···6363CONFIG_TOUCHSCREEN_BU21013=y6464CONFIG_INPUT_MISC=y6565CONFIG_INPUT_AB8500_PONKEY=y6666+CONFIG_RMI4_CORE=y6767+CONFIG_RMI4_I2C=y6868+CONFIG_RMI4_F11=y6669# CONFIG_SERIO is not set6770CONFIG_VT_HW_CONSOLE_BINDING=y6871# CONFIG_LEGACY_PTYS is not set
···669669 case 0:670670 omap_revision = DRA722_REV_ES1_0;671671 break;672672+ case 1:672673 default:673673- /* If we have no new revisions */674674- omap_revision = DRA722_REV_ES1_0;674674+ omap_revision = DRA722_REV_ES2_0;675675 break;676676 }677677 break;
···14161416 (sf & SYSC_HAS_CLOCKACTIVITY))14171417 _set_clockactivity(oh, oh->class->sysc->clockact, &v);1418141814191419- /* If the cached value is the same as the new value, skip the write */14201420- if (oh->_sysc_cache != v)14211421- _write_sysconfig(v, oh);14191419+ _write_sysconfig(v, oh);1422142014231421 /*14241422 * Set the autoidle bit only after setting the smartidle bit···14791481 _set_master_standbymode(oh, idlemode, &v);14801482 }1481148314821482- _write_sysconfig(v, oh);14841484+ /* If the cached value is the same as the new value, skip the write */14851485+ if (oh->_sysc_cache != v)14861486+ _write_sysconfig(v, oh);14831487}1484148814851489/**
+2
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
···582582 .user = OCP_USER_MPU,583583};584584585585+/* USB needs udelay 1 after reset at least on hp t410, use 2 for margin */585586static struct omap_hwmod_class_sysconfig dm81xx_usbhsotg_sysc = {586587 .rev_offs = 0x0,587588 .sysc_offs = 0x10,589589+ .srst_udelay = 2,588590 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |589591 SYSC_HAS_SOFTRESET,590592 .idlemodes = SIDLE_SMART | MSTANDBY_FORCE | MSTANDBY_SMART,
···6161 select MFD_IPAQ_MICRO6262 help6363 Say Y here if you intend to run this kernel on the Compaq iPAQ6464- H3100 handheld computer. Information about this machine and the6565- Linux port to this machine can be found at:6666-6767- <http://www.handhelds.org/Compaq/index.html#iPAQ_H3100>6464+ H3100 handheld computer.68656966config SA1100_H36007067 bool "Compaq iPAQ H3600/H3700"···7073 select MFD_IPAQ_MICRO7174 help7275 Say Y here if you intend to run this kernel on the Compaq iPAQ7373- H3600 handheld computer. Information about this machine and the7474- Linux port to this machine can be found at:7575-7676- <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600>7676+ H3600 and H3700 handheld computers.77777878config SA1100_BADGE47979 bool "HP Labs BadgePAD 4"
+1-1
arch/arm/mach-uniphier/platsmp.c
···120120 if (ret)121121 return ret;122122123123- uniphier_smp_rom_boot_rsv2 = ioremap(rom_rsv2_phys, sizeof(SZ_4));123123+ uniphier_smp_rom_boot_rsv2 = ioremap(rom_rsv2_phys, SZ_4);124124 if (!uniphier_smp_rom_boot_rsv2) {125125 pr_err("failed to map ROM_BOOT_RSV2 register\n");126126 return -ENOMEM;
···2020#include <asm/kvm_asm.h>2121#include <asm/kvm_hyp.h>22222323-void __hyp_text __init_stage2_translation(void)2323+u32 __hyp_text __init_stage2_translation(void)2424{2525 u64 val = VTCR_EL2_FLAGS;2626+ u64 parange;2627 u64 tmp;27282829 /*···3130 * bits in VTCR_EL2. Amusingly, the PARange is 4 bits, while3231 * PS is only 3. Fortunately, bit 19 is RES0 in VTCR_EL2...3332 */3434- val |= (read_sysreg(id_aa64mmfr0_el1) & 7) << 16;3333+ parange = read_sysreg(id_aa64mmfr0_el1) & 7;3434+ val |= parange << 16;3535+3636+ /* Compute the actual PARange... */3737+ switch (parange) {3838+ case 0:3939+ parange = 32;4040+ break;4141+ case 1:4242+ parange = 36;4343+ break;4444+ case 2:4545+ parange = 40;4646+ break;4747+ case 3:4848+ parange = 42;4949+ break;5050+ case 4:5151+ parange = 44;5252+ break;5353+ case 5:5454+ default:5555+ parange = 48;5656+ break;5757+ }5858+5959+ /*6060+ * ... and clamp it to 40 bits, unless we have some braindead6161+ * HW that implements less than that. In all cases, we'll6262+ * return that value for the rest of the kernel to decide what6363+ * to do.6464+ */6565+ val |= 64 - (parange > 40 ? 40 : parange);35663667 /*3768 * Read the VMIDBits bits from ID_AA64MMFR1_EL1 and set the VS···7542 VTCR_EL2_VS_8BIT;76437744 write_sysreg(val, vtcr_el2);4545+4646+ return parange;7847}
···2233source "lib/Kconfig.debug"4455+config TRACE_IRQFLAGS_SUPPORT66+ def_bool y77+58config DEBUG_RODATA69 bool "Write protect kernel read-only data structures"710 depends on DEBUG_KERNEL1111+ default y812 help913 Mark the kernel read-only data as write-protected in the pagetables,1014 in order to catch accidental (and incorrect) writes to such const
+1-3
arch/parisc/Makefile
···62626363# Without this, "ld -r" results in .text sections that are too big6464# (> 0x40000) for branches to reach stubs.6565-ifndef CONFIG_FUNCTION_TRACER6666- cflags-y += -ffunction-sections6767-endif6565+cflags-y += -ffunction-sections68666967# Use long jumps instead of long branches (needed if your linker fails to7068# link a too big vmlinux executable). Not enabled for building modules.
+1-17
arch/parisc/include/asm/ftrace.h
···44#ifndef __ASSEMBLY__55extern void mcount(void);6677-/*88- * Stack of return addresses for functions of a thread.99- * Used in struct thread_info1010- */1111-struct ftrace_ret_stack {1212- unsigned long ret;1313- unsigned long func;1414- unsigned long long calltime;1515-};1616-1717-/*1818- * Primary handler of a function return.1919- * It relays on ftrace_return_to_handler.2020- * Defined in entry.S2121- */2222-extern void return_to_handler(void);2323-77+#define MCOUNT_INSN_SIZE 4248259extern unsigned long return_address(unsigned int);2610
-4
arch/parisc/kernel/Makefile
···1515# Do not profile debug and lowlevel utilities1616CFLAGS_REMOVE_ftrace.o = -pg1717CFLAGS_REMOVE_cache.o = -pg1818-CFLAGS_REMOVE_irq.o = -pg1919-CFLAGS_REMOVE_pacache.o = -pg2018CFLAGS_REMOVE_perf.o = -pg2121-CFLAGS_REMOVE_traps.o = -pg2222-CFLAGS_REMOVE_unaligned.o = -pg2319CFLAGS_REMOVE_unwind.o = -pg2420endif2521
+76-21
arch/parisc/kernel/entry.S
···19701970 b intr_restore19711971 copy %r25,%r161972197219731973- .import schedule,code19741973syscall_do_resched:19751975- BL schedule,%r219741974+ load32 syscall_check_resched,%r2 /* if resched, we start over again */19751975+ load32 schedule,%r1919761976+ bv %r0(%r19) /* jumps to schedule() */19761977#ifdef CONFIG_64BIT19771978 ldo -16(%r30),%r29 /* Reference param save area */19781979#else19791980 nop19801981#endif19811981- b syscall_check_resched /* if resched, we start over again */19821982- nop19831982ENDPROC(syscall_exit)198419831985198419861985#ifdef CONFIG_FUNCTION_TRACER19861986+19871987 .import ftrace_function_trampoline,code19881988-ENTRY(_mcount)19891989- copy %r3, %arg219881988+ .align L1_CACHE_BYTES19891989+ .globl mcount19901990+ .type mcount, @function19911991+ENTRY(mcount)19921992+_mcount:19931993+ .export _mcount,data19941994+ .proc19951995+ .callinfo caller,frame=019961996+ .entry19971997+ /*19981998+ * The 64bit mcount() function pointer needs 4 dwords, of which the19991999+ * first two are free. We optimize it here and put 2 instructions for20002000+ * calling mcount(), and 2 instructions for ftrace_stub(). That way we20012001+ * have all on one L1 cacheline.20022002+ */19902003 b ftrace_function_trampoline19911991- nop19921992-ENDPROC(_mcount)19931993-19941994-ENTRY(return_to_handler)19951995- load32 return_trampoline, %rp19961996- copy %ret0, %arg019971997- copy %ret1, %arg119981998- b ftrace_return_to_handler19991999- nop20002000-return_trampoline:20012001- copy %ret0, %rp20022002- copy %r23, %ret020032003- copy %r24, %ret120042004-20052005-.globl ftrace_stub20042004+ copy %r3, %arg2 /* caller original %sp */20062005ftrace_stub:20062006+ .globl ftrace_stub20072007+ .type ftrace_stub, @function20082008+#ifdef CONFIG_64BIT20092009+ bve (%rp)20102010+#else20072011 bv %r0(%rp)20122012+#endif20082013 nop20142014+#ifdef CONFIG_64BIT20152015+ .dword mcount20162016+ .dword 0 /* code in head.S puts value of global gp here */20172017+#endif20182018+ .exit20192019+ .procend20202020+ENDPROC(mcount)20212021+20222022+ .align 820232023+ .globl return_to_handler20242024+ .type return_to_handler, @function20252025+ENTRY(return_to_handler)20262026+ .proc20272027+ .callinfo caller,frame=FRAME_SIZE20282028+ .entry20292029+ .export parisc_return_to_handler,data20302030+parisc_return_to_handler:20312031+ copy %r3,%r120322032+ STREG %r0,-RP_OFFSET(%sp) /* store 0 as %rp */20332033+ copy %sp,%r320342034+ STREGM %r1,FRAME_SIZE(%sp)20352035+ STREG %ret0,8(%r3)20362036+ STREG %ret1,16(%r3)20372037+20382038+#ifdef CONFIG_64BIT20392039+ loadgp20402040+#endif20412041+20422042+ /* call ftrace_return_to_handler(0) */20432043+#ifdef CONFIG_64BIT20442044+ ldo -16(%sp),%ret1 /* Reference param save area */20452045+#endif20462046+ BL ftrace_return_to_handler,%r220472047+ ldi 0,%r2620482048+ copy %ret0,%rp20492049+20502050+ /* restore original return values */20512051+ LDREG 8(%r3),%ret020522052+ LDREG 16(%r3),%ret120532053+20542054+ /* return from function */20552055+#ifdef CONFIG_64BIT20562056+ bve (%rp)20572057+#else20582058+ bv %r0(%rp)20592059+#endif20602060+ LDREGM -FRAME_SIZE(%sp),%r320612061+ .exit20622062+ .procend20092063ENDPROC(return_to_handler)20642064+20102065#endif /* CONFIG_FUNCTION_TRACER */2011206620122067#ifdef CONFIG_IRQSTACKS
+24-124
arch/parisc/kernel/ftrace.c
···11/*22 * Code for tracing calls in Linux kernel.33- * Copyright (C) 2009 Helge Deller <deller@gmx.de>33+ * Copyright (C) 2009-2016 Helge Deller <deller@gmx.de>44 *55 * based on code for x86 which is:66 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>···1313#include <linux/init.h>1414#include <linux/ftrace.h>15151616+#include <asm/assembly.h>1617#include <asm/sections.h>1718#include <asm/ftrace.h>181919202020-2121#ifdef CONFIG_FUNCTION_GRAPH_TRACER2222-2323-/* Add a function return address to the trace stack on thread info.*/2424-static int push_return_trace(unsigned long ret, unsigned long long time,2525- unsigned long func, int *depth)2626-{2727- int index;2828-2929- if (!current->ret_stack)3030- return -EBUSY;3131-3232- /* The return trace stack is full */3333- if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) {3434- atomic_inc(¤t->trace_overrun);3535- return -EBUSY;3636- }3737-3838- index = ++current->curr_ret_stack;3939- barrier();4040- current->ret_stack[index].ret = ret;4141- current->ret_stack[index].func = func;4242- current->ret_stack[index].calltime = time;4343- *depth = index;4444-4545- return 0;4646-}4747-4848-/* Retrieve a function return address to the trace stack on thread info.*/4949-static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret)5050-{5151- int index;5252-5353- index = current->curr_ret_stack;5454-5555- if (unlikely(index < 0)) {5656- ftrace_graph_stop();5757- WARN_ON(1);5858- /* Might as well panic, otherwise we have no where to go */5959- *ret = (unsigned long)6060- dereference_function_descriptor(&panic);6161- return;6262- }6363-6464- *ret = current->ret_stack[index].ret;6565- trace->func = current->ret_stack[index].func;6666- trace->calltime = current->ret_stack[index].calltime;6767- trace->overrun = atomic_read(¤t->trace_overrun);6868- trace->depth = index;6969- barrier();7070- current->curr_ret_stack--;7171-7272-}7373-7474-/*7575- * Send the trace to the ring-buffer.7676- * @return the original return address.7777- */7878-unsigned long ftrace_return_to_handler(unsigned long retval0,7979- unsigned long retval1)8080-{8181- struct ftrace_graph_ret trace;8282- unsigned long ret;8383-8484- pop_return_trace(&trace, &ret);8585- trace.rettime = local_clock();8686- ftrace_graph_return(&trace);8787-8888- if (unlikely(!ret)) {8989- ftrace_graph_stop();9090- WARN_ON(1);9191- /* Might as well panic. What else to do? */9292- ret = (unsigned long)9393- dereference_function_descriptor(&panic);9494- }9595-9696- /* HACK: we hand over the old functions' return values9797- in %r23 and %r24. Assembly in entry.S will take care9898- and move those to their final registers %ret0 and %ret1 */9999- asm( "copy %0, %%r23 \n\t"100100- "copy %1, %%r24 \n" : : "r" (retval0), "r" (retval1) );101101-102102- return ret;103103-}104104-10522/*10623 * Hook the return address and push it in the stack of return addrs10724 * in current thread info.10825 */109109-void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)2626+static void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)11027{11128 unsigned long old;112112- unsigned long long calltime;11329 struct ftrace_graph_ent trace;3030+ extern int parisc_return_to_handler;1143111532 if (unlikely(ftrace_graph_is_dead()))11633 return;···36119 return;3712038121 old = *parent;3939- *parent = (unsigned long)4040- dereference_function_descriptor(&return_to_handler);4141-4242- if (unlikely(!__kernel_text_address(old))) {4343- ftrace_graph_stop();4444- *parent = old;4545- WARN_ON(1);4646- return;4747- }4848-4949- calltime = local_clock();5050-5151- if (push_return_trace(old, calltime,5252- self_addr, &trace.depth) == -EBUSY) {5353- *parent = old;5454- return;5555- }5612257123 trace.func = self_addr;124124+ trace.depth = current->curr_ret_stack + 1;5812559126 /* Only trace if the calling function expects to */6060- if (!ftrace_graph_entry(&trace)) {6161- current->curr_ret_stack--;6262- *parent = old;6363- }6464-}127127+ if (!ftrace_graph_entry(&trace))128128+ return;65129130130+ if (ftrace_push_return_trace(old, self_addr, &trace.depth,131131+ 0 ) == -EBUSY)132132+ return;133133+134134+ /* activate parisc_return_to_handler() as return point */135135+ *parent = (unsigned long) &parisc_return_to_handler;136136+}66137#endif /* CONFIG_FUNCTION_GRAPH_TRACER */671386868-6969-void ftrace_function_trampoline(unsigned long parent,139139+void notrace ftrace_function_trampoline(unsigned long parent,70140 unsigned long self_addr,71141 unsigned long org_sp_gr3)72142{7373- extern ftrace_func_t ftrace_trace_function;143143+ extern ftrace_func_t ftrace_trace_function; /* depends on CONFIG_DYNAMIC_FTRACE */144144+ extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace);7414575146 if (ftrace_trace_function != ftrace_stub) {7676- ftrace_trace_function(parent, self_addr);147147+ /* struct ftrace_ops *op, struct pt_regs *regs); */148148+ ftrace_trace_function(parent, self_addr, NULL, NULL);77149 return;78150 }151151+79152#ifdef CONFIG_FUNCTION_GRAPH_TRACER8080- if (ftrace_graph_entry && ftrace_graph_return) {8181- unsigned long sp;153153+ if (ftrace_graph_return != (trace_func_graph_ret_t) ftrace_stub ||154154+ ftrace_graph_entry != ftrace_graph_entry_stub) {82155 unsigned long *parent_rp;831568484- asm volatile ("copy %%r30, %0" : "=r"(sp));8585- /* sanity check: is stack pointer which we got from8686- assembler function in entry.S in a reasonable8787- range compared to current stack pointer? */8888- if ((sp - org_sp_gr3) > 0x400)8989- return;9090-91157 /* calculate pointer to %rp in stack */9292- parent_rp = (unsigned long *) org_sp_gr3 - 0x10;158158+ parent_rp = (unsigned long *) (org_sp_gr3 - RP_OFFSET);93159 /* sanity check: parent_rp should hold parent */94160 if (*parent_rp != parent)95161 return;9696-162162+97163 prepare_ftrace_return(parent_rp, self_addr);98164 return;99165 }
+9
arch/parisc/kernel/head.S
···129129 /* And the stack pointer too */130130 ldo THREAD_SZ_ALGN(%r6),%sp131131132132+#if defined(CONFIG_64BIT) && defined(CONFIG_FUNCTION_TRACER)133133+ .import _mcount,data134134+ /* initialize mcount FPTR */135135+ /* Get the global data pointer */136136+ loadgp137137+ load32 PA(_mcount), %r10138138+ std %dp,0x18(%r10)139139+#endif140140+132141#ifdef CONFIG_SMP133142 /* Set the smp rendezvous address into page zero.134143 ** It would be safer to do this in init_smp_config() but
-5
arch/sh/include/asm/smp.h
···3434DECLARE_PER_CPU(int, cpu_state);35353636void smp_message_recv(unsigned int msg);3737-void smp_timer_broadcast(const struct cpumask *mask);3838-3939-void local_timer_interrupt(void);4040-void local_timer_setup(unsigned int cpu);4141-void local_timer_stop(unsigned int cpu);42374338void arch_send_call_function_single_ipi(int cpu);4439void arch_send_call_function_ipi_mask(const struct cpumask *mask);
···7373{7474 int i;75757676- local_timer_setup(0);7777-7876 BUILD_BUG_ON(SMP_MSG_NR >= 8);79778078 for (i = 0; i < SMP_MSG_NR; i++)
+2-2
arch/sh/kernel/topology.c
···2121cpumask_t cpu_core_map[NR_CPUS];2222EXPORT_SYMBOL(cpu_core_map);23232424-static cpumask_t cpu_coregroup_map(unsigned int cpu)2424+static cpumask_t cpu_coregroup_map(int cpu)2525{2626 /*2727 * Presently all SH-X3 SMP cores are multi-cores, so just keep it···3030 return *cpu_possible_mask;3131}32323333-const struct cpumask *cpu_coregroup_mask(unsigned int cpu)3333+const struct cpumask *cpu_coregroup_mask(int cpu)3434{3535 return &cpu_core_map[cpu];3636}
+13-1
arch/x86/boot/compressed/Makefile
···2626 vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz427272828KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O22929-KBUILD_CFLAGS += -fno-strict-aliasing -fPIC2929+KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)3030KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING3131cflags-$(CONFIG_X86_32) := -march=i3863232cflags-$(CONFIG_X86_64) := -mcmodel=small···4040UBSAN_SANITIZE :=n41414242LDFLAGS := -m elf_$(UTS_MACHINE)4343+ifeq ($(CONFIG_RELOCATABLE),y)4444+# If kernel is relocatable, build compressed kernel as PIE.4545+ifeq ($(CONFIG_X86_32),y)4646+LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)4747+else4848+# To build 64-bit compressed kernel as PIE, we disable relocation4949+# overflow check to avoid relocation overflow error with a new linker5050+# command-line option, -z noreloc-overflow.5151+LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \5252+ && echo "-z noreloc-overflow -pie --no-dynamic-linker")5353+endif5454+endif4355LDFLAGS_vmlinux := -T44564557hostprogs-y := mkpiggy
+28
arch/x86/boot/compressed/head_32.S
···3131#include <asm/asm-offsets.h>3232#include <asm/bootparam.h>33333434+/*3535+ * The 32-bit x86 assembler in binutils 2.26 will generate R_386_GOT32X3636+ * relocation to get the symbol address in PIC. When the compressed x863737+ * kernel isn't built as PIC, the linker optimizes R_386_GOT32X3838+ * relocations to their fixed symbol addresses. However, when the3939+ * compressed x86 kernel is loaded at a different address, it leads4040+ * to the following load failure:4141+ *4242+ * Failed to allocate space for phdrs4343+ *4444+ * during the decompression stage.4545+ *4646+ * If the compressed x86 kernel is relocatable at run-time, it should be4747+ * compiled with -fPIE, instead of -fPIC, if possible and should be built as4848+ * Position Independent Executable (PIE) so that linker won't optimize4949+ * R_386_GOT32X relocation to its fixed symbol address. Older5050+ * linkers generate R_386_32 relocations against locally defined symbols,5151+ * _bss, _ebss, _got and _egot, in PIE. It isn't wrong, just less5252+ * optimal than R_386_RELATIVE. But the x86 kernel fails to properly handle5353+ * R_386_32 relocations when relocating the kernel. To generate5454+ * R_386_RELATIVE relocations, we mark _bss, _ebss, _got and _egot as5555+ * hidden:5656+ */5757+ .hidden _bss5858+ .hidden _ebss5959+ .hidden _got6060+ .hidden _egot6161+3462 __HEAD3563ENTRY(startup_32)3664#ifdef CONFIG_EFI_STUB
+8
arch/x86/boot/compressed/head_64.S
···3333#include <asm/asm-offsets.h>3434#include <asm/bootparam.h>35353636+/*3737+ * Locally defined symbols should be marked hidden:3838+ */3939+ .hidden _bss4040+ .hidden _ebss4141+ .hidden _got4242+ .hidden _egot4343+3644 __HEAD3745 .code323846ENTRY(startup_32)
···700700 if ((xcr0 & XFEATURE_MASK_AVX512) != XFEATURE_MASK_AVX512)701701 return 1;702702 }703703- kvm_put_guest_xcr0(vcpu);704703 vcpu->arch.xcr0 = xcr0;705704706705 if ((xcr0 ^ old_xcr0) & XFEATURE_MASK_EXTEND)···65896590 kvm_x86_ops->prepare_guest_switch(vcpu);65906591 if (vcpu->fpu_active)65916592 kvm_load_guest_fpu(vcpu);65926592- kvm_load_guest_xcr0(vcpu);65936593-65946593 vcpu->mode = IN_GUEST_MODE;6595659465966595 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);···66146617 r = 1;66156618 goto cancel_injection;66166619 }66206620+66216621+ kvm_load_guest_xcr0(vcpu);6617662266186623 if (req_immediate_exit)66196624 smp_send_reschedule(vcpu->cpu);···6665666666666667 vcpu->mode = OUTSIDE_GUEST_MODE;66676668 smp_wmb();66696669+66706670+ kvm_put_guest_xcr0(vcpu);6668667166696672 /* Interrupt is enabled by handle_external_intr() */66706673 kvm_x86_ops->handle_external_intr(vcpu);···73157314 * and assume host would use all available bits.73167315 * Guest xcr0 would be loaded later.73177316 */73187318- kvm_put_guest_xcr0(vcpu);73197317 vcpu->guest_fpu_loaded = 1;73207318 __kernel_fpu_begin();73217319 __copy_kernel_to_fpregs(&vcpu->arch.guest_fpu.state);···7323732373247324void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)73257325{73267326- kvm_put_guest_xcr0(vcpu);73277327-73287326 if (!vcpu->guest_fpu_loaded) {73297327 vcpu->fpu_counter = 0;73307328 return;
+10-3
block/partition-generic.c
···361361 goto out_del;362362 }363363364364+ err = hd_ref_init(p);365365+ if (err) {366366+ if (flags & ADDPART_FLAG_WHOLEDISK)367367+ goto out_remove_file;368368+ goto out_del;369369+ }370370+364371 /* everything is up and running, commence */365372 rcu_assign_pointer(ptbl->part[partno], p);366373367374 /* suppress uevent if the disk suppresses it */368375 if (!dev_get_uevent_suppress(ddev))369376 kobject_uevent(&pdev->kobj, KOBJ_ADD);370370-371371- if (!hd_ref_init(p))372372- return p;377377+ return p;373378374379out_free_info:375380 free_part_info(p);···383378out_free:384379 kfree(p);385380 return ERR_PTR(err);381381+out_remove_file:382382+ device_remove_file(pdev, &dev_attr_whole_disk);386383out_del:387384 kobject_put(p->holder_dir);388385 device_del(pdev);
+6
drivers/block/loop.c
···488488 bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter);489489 iov_iter_bvec(&iter, ITER_BVEC | rw, bvec,490490 bio_segments(bio), blk_rq_bytes(cmd->rq));491491+ /*492492+ * This bio may be started from the middle of the 'bvec'493493+ * because of bio splitting, so offset from the bvec must494494+ * be passed to iov iterator495495+ */496496+ iter.iov_offset = bio->bi_iter.bi_bvec_done;491497492498 cmd->iocb.ki_pos = pos;493499 cmd->iocb.ki_filp = file;
+1-1
drivers/bus/mvebu-mbus.c
···972972 }973973 }974974975975- pr_err("invalid dram address 0x%x\n", phyaddr);975975+ pr_err("invalid dram address %pa\n", &phyaddr);976976 return -EINVAL;977977}978978EXPORT_SYMBOL_GPL(mvebu_mbus_get_dram_win_info);
+1-1
drivers/bus/uniphier-system-bus.c
···108108109109 for (i = 0; i < ARRAY_SIZE(priv->bank); i++) {110110 for (j = i + 1; j < ARRAY_SIZE(priv->bank); j++) {111111- if (priv->bank[i].end > priv->bank[j].base ||111111+ if (priv->bank[i].end > priv->bank[j].base &&112112 priv->bank[i].base < priv->bank[j].end) {113113 dev_err(priv->dev,114114 "region overlap between bank%d and bank%d\n",
···130130static void dwc_initialize(struct dw_dma_chan *dwc)131131{132132 struct dw_dma *dw = to_dw_dma(dwc->chan.device);133133- struct dw_dma_slave *dws = dwc->chan.private;134133 u32 cfghi = DWC_CFGH_FIFO_MODE;135134 u32 cfglo = DWC_CFGL_CH_PRIOR(dwc->priority);136135137136 if (dwc->initialized == true)138137 return;139138140140- if (dws) {141141- /*142142- * We need controller-specific data to set up slave143143- * transfers.144144- */145145- BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev);146146-147147- cfghi |= DWC_CFGH_DST_PER(dws->dst_id);148148- cfghi |= DWC_CFGH_SRC_PER(dws->src_id);149149- } else {150150- cfghi |= DWC_CFGH_DST_PER(dwc->dst_id);151151- cfghi |= DWC_CFGH_SRC_PER(dwc->src_id);152152- }139139+ cfghi |= DWC_CFGH_DST_PER(dwc->dst_id);140140+ cfghi |= DWC_CFGH_SRC_PER(dwc->src_id);153141154142 channel_writel(dwc, CFG_LO, cfglo);155143 channel_writel(dwc, CFG_HI, cfghi);···929941 struct dw_dma_chan *dwc = to_dw_dma_chan(chan);930942 struct dw_dma_slave *dws = param;931943932932- if (!dws || dws->dma_dev != chan->device->dev)944944+ if (dws->dma_dev != chan->device->dev)933945 return false;934946935947 /* We have to copy data since dws can be temporary storage */···11531165 * doesn't mean what you think it means), and status writeback.11541166 */1155116711681168+ /*11691169+ * We need controller-specific data to set up slave transfers.11701170+ */11711171+ if (chan->private && !dw_dma_filter(chan, chan->private)) {11721172+ dev_warn(chan2dev(chan), "Wrong controller-specific data\n");11731173+ return -EINVAL;11741174+ }11751175+11561176 /* Enable controller here if needed */11571177 if (!dw->in_use)11581178 dw_dma_on(dw);···12221226 spin_lock_irqsave(&dwc->lock, flags);12231227 list_splice_init(&dwc->free_list, &list);12241228 dwc->descs_allocated = 0;12291229+12301230+ /* Clear custom channel configuration */12311231+ dwc->src_id = 0;12321232+ dwc->dst_id = 0;12331233+12341234+ dwc->src_master = 0;12351235+ dwc->dst_master = 0;12361236+12251237 dwc->initialized = false;1226123812271239 /* Disable interrupts */
+25-38
drivers/dma/edma.c
···12381238 struct edma_desc *edesc;12391239 dma_addr_t src_addr, dst_addr;12401240 enum dma_slave_buswidth dev_width;12411241+ bool use_intermediate = false;12411242 u32 burst;12421243 int i, ret, nslots;12431244···12801279 * but the synchronization is difficult to achieve with Cyclic and12811280 * cannot be guaranteed, so we error out early.12821281 */12831283- if (nslots > MAX_NR_SG)12841284- return NULL;12821282+ if (nslots > MAX_NR_SG) {12831283+ /*12841284+ * If the burst and period sizes are the same, we can put12851285+ * the full buffer into a single period and activate12861286+ * intermediate interrupts. This will produce interrupts12871287+ * after each burst, which is also after each desired period.12881288+ */12891289+ if (burst == period_len) {12901290+ period_len = buf_len;12911291+ nslots = 2;12921292+ use_intermediate = true;12931293+ } else {12941294+ return NULL;12951295+ }12961296+ }1285129712861298 edesc = kzalloc(sizeof(*edesc) + nslots * sizeof(edesc->pset[0]),12871299 GFP_ATOMIC);···13721358 /*13731359 * Enable period interrupt only if it is requested13741360 */13751375- if (tx_flags & DMA_PREP_INTERRUPT)13611361+ if (tx_flags & DMA_PREP_INTERRUPT) {13761362 edesc->pset[i].param.opt |= TCINTEN;13631363+13641364+ /* Also enable intermediate interrupts if necessary */13651365+ if (use_intermediate)13661366+ edesc->pset[i].param.opt |= ITCINTEN;13671367+ }13771368 }1378136913791370 /* Place the cyclic channel to highest priority queue */···15891570 return IRQ_HANDLED;15901571}1591157215921592-static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)15931593-{15941594- struct platform_device *tc_pdev;15951595- int ret;15961596-15971597- if (!IS_ENABLED(CONFIG_OF) || !tc)15981598- return;15991599-16001600- tc_pdev = of_find_device_by_node(tc->node);16011601- if (!tc_pdev) {16021602- pr_err("%s: TPTC device is not found\n", __func__);16031603- return;16041604- }16051605- if (!pm_runtime_enabled(&tc_pdev->dev))16061606- pm_runtime_enable(&tc_pdev->dev);16071607-16081608- if (enable)16091609- ret = pm_runtime_get_sync(&tc_pdev->dev);16101610- else16111611- ret = pm_runtime_put_sync(&tc_pdev->dev);16121612-16131613- if (ret < 0)16141614- pr_err("%s: pm_runtime_%s_sync() failed for %s\n", __func__,16151615- enable ? "get" : "put", dev_name(&tc_pdev->dev));16161616-}16171617-16181573/* Alloc channel resources */16191574static int edma_alloc_chan_resources(struct dma_chan *chan)16201575{···16241631 dev_dbg(dev, "Got eDMA channel %d for virt channel %d (%s trigger)\n",16251632 EDMA_CHAN_SLOT(echan->ch_num), chan->chan_id,16261633 echan->hw_triggered ? "HW" : "SW");16271627-16281628- edma_tc_set_pm_state(echan->tc, true);1629163416301635 return 0;16311636···16611670 echan->alloced = false;16621671 }1663167216641664- edma_tc_set_pm_state(echan->tc, false);16651673 echan->tc = NULL;16661674 echan->hw_triggered = false;16671675···24072417 int i;2408241824092419 for (i = 0; i < ecc->num_channels; i++) {24102410- if (echan[i].alloced) {24202420+ if (echan[i].alloced)24112421 edma_setup_interrupt(&echan[i], false);24122412- edma_tc_set_pm_state(echan[i].tc, false);24132413- }24142422 }2415242324162424 return 0;···2438245024392451 /* Set up channel -> slot mapping for the entry slot */24402452 edma_set_chmap(&echan[i], echan[i].slot[0]);24412441-24422442- edma_tc_set_pm_state(echan[i].tc, true);24432453 }24442454 }24452455···2461247524622476static int edma_tptc_probe(struct platform_device *pdev)24632477{24642464- return 0;24782478+ pm_runtime_enable(&pdev->dev);24792479+ return pm_runtime_get_sync(&pdev->dev);24652480}2466248124672482static struct platform_driver edma_tptc_driver = {
+8-5
drivers/dma/hsu/hsu.c
···64646565 if (hsuc->direction == DMA_MEM_TO_DEV) {6666 bsr = config->dst_maxburst;6767- mtsr = config->dst_addr_width;6767+ mtsr = config->src_addr_width;6868 } else if (hsuc->direction == DMA_DEV_TO_MEM) {6969 bsr = config->src_maxburst;7070- mtsr = config->src_addr_width;7070+ mtsr = config->dst_addr_width;7171 }72727373 hsu_chan_disable(hsuc);···135135 sr = hsu_chan_readl(hsuc, HSU_CH_SR);136136 spin_unlock_irqrestore(&hsuc->vchan.lock, flags);137137138138- return sr;138138+ return sr & ~(HSU_CH_SR_DESCE_ANY | HSU_CH_SR_CDESC_ANY);139139}140140141141irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip, unsigned short nr)···254254static size_t hsu_dma_active_desc_size(struct hsu_dma_chan *hsuc)255255{256256 struct hsu_dma_desc *desc = hsuc->desc;257257- size_t bytes = desc->length;257257+ size_t bytes = 0;258258 int i;259259260260- i = desc->active % HSU_DMA_CHAN_NR_DESC;260260+ for (i = desc->active; i < desc->nents; i++)261261+ bytes += desc->sg[i].len;262262+263263+ i = HSU_DMA_CHAN_NR_DESC - 1;261264 do {262265 bytes += hsu_chan_readl(hsuc, HSU_CH_DxTSR(i));263266 } while (--i >= 0);
···203203204204 reserve_regions();205205 early_memunmap(memmap.map, params.mmap_size);206206- memblock_mark_nomap(params.mmap & PAGE_MASK,207207- PAGE_ALIGN(params.mmap_size +208208- (params.mmap & ~PAGE_MASK)));206206+207207+ if (IS_ENABLED(CONFIG_ARM)) {208208+ /*209209+ * ARM currently does not allow ioremap_cache() to be called on210210+ * memory regions that are covered by struct page. So remove the211211+ * UEFI memory map from the linear mapping.212212+ */213213+ memblock_mark_nomap(params.mmap & PAGE_MASK,214214+ PAGE_ALIGN(params.mmap_size +215215+ (params.mmap & ~PAGE_MASK)));216216+ } else {217217+ memblock_reserve(params.mmap & PAGE_MASK,218218+ PAGE_ALIGN(params.mmap_size +219219+ (params.mmap & ~PAGE_MASK)));220220+ }209221}
···94949595config DRM_EXYNOS_G2D9696 bool "G2D"9797- depends on !VIDEO_SAMSUNG_S5P_G2D9797+ depends on VIDEO_SAMSUNG_S5P_G2D=n9898 select FRAME_VECTOR9999 help100100 Choose this option if you want to use Exynos G2D for DRM.
+3-3
drivers/gpu/drm/exynos/Makefile
···22# Makefile for the drm device driver. This driver provides support for the33# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.4455-exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fbdev.o \66- exynos_drm_fb.o exynos_drm_gem.o exynos_drm_core.o \77- exynos_drm_plane.o55+exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \66+ exynos_drm_gem.o exynos_drm_core.o exynos_drm_plane.o8788+exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o99exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o1010exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o1111exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o
···888888 * clock. On these SoCs the bootloader may enable it but any889889 * power domain off/on will reset it to disable state.890890 */891891- if (ctx->driver_data != &exynos5_fimd_driver_data ||891891+ if (ctx->driver_data != &exynos5_fimd_driver_data &&892892 ctx->driver_data != &exynos5420_fimd_driver_data)893893 return;894894
+2-1
drivers/gpu/drm/exynos/exynos_drm_mic.c
···129129 } else130130 val &= ~(MIC0_RGB_MUX | MIC0_I80_MUX | MIC0_ON_MUX);131131132132- regmap_write(mic->sysreg, DSD_CFG_MUX, val);132132+ ret = regmap_write(mic->sysreg, DSD_CFG_MUX, val);133133 if (ret)134134 DRM_ERROR("mic: Failed to read system register\n");135135}···457457 "samsung,disp-syscon");458458 if (IS_ERR(mic->sysreg)) {459459 DRM_ERROR("mic: Failed to get system register.\n");460460+ ret = PTR_ERR(mic->sysreg);460461 goto err;461462 }462463
···758758 dev_priv->display.hpd_irq_setup(dev);759759 spin_unlock_irq(&dev_priv->irq_lock);760760761761- intel_display_resume(dev);762762-763761 intel_dp_mst_resume(dev);762762+763763+ intel_display_resume(dev);764764765765 /*766766 * ... but also need to make sure that hotplug processing
+2-2
drivers/gpu/drm/i915/i915_irq.c
···18291829 /* IRQs are synced during runtime_suspend, we don't require a wakeref */18301830 disable_rpm_wakeref_asserts(dev_priv);1831183118321832- for (;;) {18321832+ do {18331833 master_ctl = I915_READ(GEN8_MASTER_IRQ) & ~GEN8_MASTER_IRQ_CONTROL;18341834 iir = I915_READ(VLV_IIR);18351835···1857185718581858 I915_WRITE(GEN8_MASTER_IRQ, DE_MASTER_IRQ_CONTROL);18591859 POSTING_READ(GEN8_MASTER_IRQ);18601860- }18601860+ } while (0);1861186118621862 enable_rpm_wakeref_asserts(dev_priv);18631863
+2-4
drivers/gpu/drm/i915/intel_dp_mst.c
···506506 struct intel_connector *intel_connector = to_intel_connector(connector);507507 struct drm_device *dev = connector->dev;508508509509+ intel_connector->unregister(intel_connector);510510+509511 /* need to nuke the connector */510512 drm_modeset_lock_all(dev);511513 if (connector->state->crtc) {···521519522520 WARN(ret, "Disabling mst crtc failed with %i\n", ret);523521 }524524- drm_modeset_unlock_all(dev);525522526526- intel_connector->unregister(intel_connector);527527-528528- drm_modeset_lock_all(dev);529523 intel_connector_remove_from_fbdev(intel_connector);530524 drm_connector_cleanup(connector);531525 drm_modeset_unlock_all(dev);
+1-4
drivers/gpu/drm/i915/intel_lvds.c
···478478 * and as part of the cleanup in the hw state restore we also redisable479479 * the vga plane.480480 */481481- if (!HAS_PCH_SPLIT(dev)) {482482- drm_modeset_lock_all(dev);481481+ if (!HAS_PCH_SPLIT(dev))483482 intel_display_resume(dev);484484- drm_modeset_unlock_all(dev);485485- }486483487484 dev_priv->modeset_restore = MODESET_DONE;488485
···8989 WREG32(NI_DP_MSE_SAT_UPDATE + primary->offset, 1);90909191 do {9292+ unsigned value1, value2;9393+ udelay(10);9294 temp = RREG32(NI_DP_MSE_SAT_UPDATE + primary->offset);9393- } while ((temp & 0x1) && retries++ < 10000);9595+9696+ value1 = temp & NI_DP_MSE_SAT_UPDATE_MASK;9797+ value2 = temp & NI_DP_MSE_16_MTP_KEEPOUT;9898+9999+ if (!value1 && !value2)100100+ break;101101+ } while (retries++ < 50);9410295103 if (retries == 10000)96104 DRM_ERROR("timed out waitin for SAT update %d\n", primary->offset);···158150 return 0;159151}160152161161-static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, uint32_t x, uint32_t y)153153+static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, s64 avg_time_slots_per_mtp)162154{163155 struct drm_device *dev = mst->base.dev;164156 struct radeon_device *rdev = dev->dev_private;···166158 uint32_t val, temp;167159 uint32_t offset = radeon_atom_set_enc_offset(mst_enc->fe);168160 int retries = 0;161161+ uint32_t x = drm_fixp2int(avg_time_slots_per_mtp);162162+ uint32_t y = drm_fixp2int_ceil((avg_time_slots_per_mtp - x) << 26);169163170164 val = NI_DP_MSE_RATE_X(x) | NI_DP_MSE_RATE_Y(y);171165···175165176166 do {177167 temp = RREG32(NI_DP_MSE_RATE_UPDATE + offset);168168+ udelay(10);178169 } while ((temp & 0x1) && (retries++ < 10000));179170180171 if (retries >= 10000)···257246 kfree(radeon_connector);258247}259248260260-static int radeon_connector_dpms(struct drm_connector *connector, int mode)261261-{262262- DRM_DEBUG_KMS("\n");263263- return 0;264264-}265265-266249static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = {267267- .dpms = radeon_connector_dpms,250250+ .dpms = drm_helper_connector_dpms,268251 .detect = radeon_dp_mst_detect,269252 .fill_modes = drm_helper_probe_single_connector_modes,270253 .destroy = radeon_dp_mst_connector_destroy,···399394 struct drm_crtc *crtc;400395 struct radeon_crtc *radeon_crtc;401396 int ret, slots;402402-397397+ s64 fixed_pbn, fixed_pbn_per_slot, avg_time_slots_per_mtp;403398 if (!ASIC_IS_DCE5(rdev)) {404399 DRM_ERROR("got mst dpms on non-DCE5\n");405400 return;···461456462457 mst_enc->enc_active = true;463458 radeon_dp_mst_update_stream_attribs(radeon_connector->mst_port, primary);464464- radeon_dp_mst_set_vcp_size(radeon_encoder, slots, 0);459459+460460+ fixed_pbn = drm_int2fixp(mst_enc->pbn);461461+ fixed_pbn_per_slot = drm_int2fixp(radeon_connector->mst_port->mst_mgr.pbn_div);462462+ avg_time_slots_per_mtp = drm_fixp_div(fixed_pbn, fixed_pbn_per_slot);463463+ radeon_dp_mst_set_vcp_size(radeon_encoder, avg_time_slots_per_mtp);465464466465 atombios_dig_encoder_setup2(&primary->base, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0,467466 mst_enc->fe);
+5-1
drivers/lguest/interrupts_and_traps.c
···331331 * Actually now I think of it, it's possible that Ron *is* half the Plan 9332332 * userbase. Oh well.333333 */334334-static bool could_be_syscall(unsigned int num)334334+bool could_be_syscall(unsigned int num)335335{336336 /* Normal Linux IA32_SYSCALL_VECTOR or reserved vector? */337337 return num == IA32_SYSCALL_VECTOR || num == syscall_vector;···416416 *417417 * This routine indicates if a particular trap number could be delivered418418 * directly.419419+ *420420+ * Unfortunately, Linux 4.6 started using an interrupt gate instead of a421421+ * trap gate for syscalls, so this trick is ineffective. See Mastery for422422+ * how we could do this anyway...419423 */420424static bool direct_trap(unsigned int num)421425{
···429429 return;430430 break;431431 case 32 ... 255:432432+ /* This might be a syscall. */433433+ if (could_be_syscall(cpu->regs->trapnum))434434+ break;435435+432436 /*433433- * These values mean a real interrupt occurred, in which case437437+ * Other values mean a real interrupt occurred, in which case434438 * the Host handler has already been run. We just do a435439 * friendly check if another process should now be run, then436440 * return to run the Guest again.
+9-7
drivers/mailbox/mailbox-test.c
···4646 size_t count, loff_t *ppos)4747{4848 struct mbox_test_device *tdev = filp->private_data;4949- int ret;50495150 if (!tdev->tx_channel) {5251 dev_err(tdev->dev, "Channel cannot do Tx\n");···5960 return -EINVAL;6061 }61626262- tdev->signal = kzalloc(MBOX_MAX_SIG_LEN, GFP_KERNEL);6363- if (!tdev->signal)6464- return -ENOMEM;6363+ /* Only allocate memory if we need to */6464+ if (!tdev->signal) {6565+ tdev->signal = kzalloc(MBOX_MAX_SIG_LEN, GFP_KERNEL);6666+ if (!tdev->signal)6767+ return -ENOMEM;6868+ }65696666- ret = copy_from_user(tdev->signal, userbuf, count);6767- if (ret) {7070+ if (copy_from_user(tdev->signal, userbuf, count)) {6871 kfree(tdev->signal);7272+ tdev->signal = NULL;6973 return -EFAULT;7074 }71757272- return ret < 0 ? ret : count;7676+ return count;7377}74787579static const struct file_operations mbox_test_signal_ops = {
+2-2
drivers/mailbox/mailbox-xgene-slimpro.c
···189189 int i;190190191191 ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL);192192- if (IS_ERR(ctx))193193- return PTR_ERR(ctx);192192+ if (!ctx)193193+ return -ENOMEM;194194195195 platform_set_drvdata(pdev, ctx);196196
+2-2
drivers/mailbox/mailbox.c
···375375376376 if (!np) {377377 dev_err(cl->dev, "%s() currently only supports DT\n", __func__);378378- return ERR_PTR(-ENOSYS);378378+ return ERR_PTR(-EINVAL);379379 }380380381381 if (!of_get_property(np, "mbox-names", NULL)) {382382 dev_err(cl->dev,383383 "%s() requires an \"mbox-names\" property\n", __func__);384384- return ERR_PTR(-ENOSYS);384384+ return ERR_PTR(-EINVAL);385385 }386386387387 of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
···86868787/* TODO: Replace these with struct ida */8888static DECLARE_BITMAP(dev_use, MAX_DEVICES);8989-static DECLARE_BITMAP(name_use, MAX_DEVICES);90899190/*9291 * There is one mmc_blk_data per slot.···104105 unsigned int usage;105106 unsigned int read_only;106107 unsigned int part_type;107107- unsigned int name_idx;108108 unsigned int reset_done;109109#define MMC_BLK_READ BIT(0)110110#define MMC_BLK_WRITE BIT(1)···22002202 goto out;22012203 }2202220422032203- /*22042204- * !subname implies we are creating main mmc_blk_data that will be22052205- * associated with mmc_card with dev_set_drvdata. Due to device22062206- * partitions, devidx will not coincide with a per-physical card22072207- * index anymore so we keep track of a name index.22082208- */22092209- if (!subname) {22102210- md->name_idx = find_first_zero_bit(name_use, max_devices);22112211- __set_bit(md->name_idx, name_use);22122212- } else22132213- md->name_idx = ((struct mmc_blk_data *)22142214- dev_to_disk(parent)->private_data)->name_idx;22152215-22162205 md->area_type = area_type;2217220622182207 /*···22492264 */2250226522512266 snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),22522252- "mmcblk%u%s", md->name_idx, subname ? subname : "");22672267+ "mmcblk%u%s", card->host->index, subname ? subname : "");2253226822542269 if (mmc_card_mmc(card))22552270 blk_queue_logical_block_size(md->queue.queue,···24032418 struct list_head *pos, *q;24042419 struct mmc_blk_data *part_md;2405242024062406- __clear_bit(md->name_idx, name_use);24072421 list_for_each_safe(pos, q, &md->part) {24082422 part_md = list_entry(pos, struct mmc_blk_data, part);24092423 list_del(pos);
···40094009 * This is the first phase of the normal nand_scan() function. It reads the40104010 * flash ID and sets up MTD fields accordingly.40114011 *40124012- * The mtd->owner field must be set to the module of the caller.40134012 */40144013int nand_scan_ident(struct mtd_info *mtd, int maxchips,40154014 struct nand_flash_dev *table)···44284429 *44294430 * This fills out all the uninitialized function pointers with the defaults.44304431 * The flash ID is read and the mtd/chip structures are filled with the44314431- * appropriate values. The mtd->owner field must be set to the module of the44324432- * caller.44324432+ * appropriate values.44334433 */44344434int nand_scan(struct mtd_info *mtd, int maxchips)44354435{44364436 int ret;44374437-44384438- /* Many callers got this wrong, so check for it for a while... */44394439- if (!mtd->owner && caller_is_module()) {44404440- pr_crit("%s called with NULL mtd->owner!\n", __func__);44414441- BUG();44424442- }4443443744444438 ret = nand_scan_ident(mtd, maxchips, NULL);44454439 if (!ret)
+14
drivers/nvdimm/pmem.c
···103103 flush_dcache_page(page);104104 }105105 } else {106106+ /*107107+ * Note that we write the data both before and after108108+ * clearing poison. The write before clear poison109109+ * handles situations where the latest written data is110110+ * preserved and the clear poison operation simply marks111111+ * the address range as valid without changing the data.112112+ * In this case application software can assume that an113113+ * interrupted write will either return the new good114114+ * data or an error.115115+ *116116+ * However, if pmem_clear_poison() leaves the data in an117117+ * indeterminate state we need to perform the write118118+ * after clear poison.119119+ */106120 flush_dcache_page(page);107121 memcpy_to_pmem(pmem_addr, mem + off, len);108122 if (unlikely(bad_pmem)) {
+19-12
drivers/nvme/host/pci.c
···14781478 if (result > 0) {14791479 dev_err(dev->ctrl.device,14801480 "Could not set queue count (%d)\n", result);14811481- nr_io_queues = 0;14821482- result = 0;14811481+ return 0;14831482 }1484148314851484 if (dev->cmb && NVME_CMB_SQS(dev->cmbsz)) {···15121513 * If we enable msix early due to not intx, disable it again before15131514 * setting up the full range we need.15141515 */15151515- if (!pdev->irq)15161516+ if (pdev->msi_enabled)15171517+ pci_disable_msi(pdev);15181518+ else if (pdev->msix_enabled)15161519 pci_disable_msix(pdev);1517152015181521 for (i = 0; i < nr_io_queues; i++)···16971696 if (pci_enable_device_mem(pdev))16981697 return result;1699169817001700- dev->entry[0].vector = pdev->irq;17011699 pci_set_master(pdev);1702170017031701 if (dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64)) &&···17091709 }1710171017111711 /*17121712- * Some devices don't advertse INTx interrupts, pre-enable a single17131713- * MSIX vec for setup. We'll adjust this later.17121712+ * Some devices and/or platforms don't advertise or work with INTx17131713+ * interrupts. Pre-enable a single MSIX or MSI vec for setup. We'll17141714+ * adjust this later.17141715 */17151715- if (!pdev->irq) {17161716- result = pci_enable_msix(pdev, dev->entry, 1);17171717- if (result < 0)17181718- goto disable;17161716+ if (pci_enable_msix(pdev, dev->entry, 1)) {17171717+ pci_enable_msi(pdev);17181718+ dev->entry[0].vector = pdev->irq;17191719+ }17201720+17211721+ if (!dev->entry[0].vector) {17221722+ result = -ENODEV;17231723+ goto disable;17191724 }1720172517211726 cap = lo_hi_readq(dev->bar + NVME_REG_CAP);···18631858 */18641859 if (dev->ctrl.ctrl_config & NVME_CC_ENABLE)18651860 nvme_dev_disable(dev, false);18611861+18621862+ if (test_bit(NVME_CTRL_REMOVING, &dev->flags))18631863+ goto out;1866186418671865 set_bit(NVME_CTRL_RESETTING, &dev->flags);18681866···20862078{20872079 struct nvme_dev *dev = pci_get_drvdata(pdev);2088208020892089- del_timer_sync(&dev->watchdog_timer);20902090-20912081 set_bit(NVME_CTRL_REMOVING, &dev->flags);20922082 pci_set_drvdata(pdev, NULL);20932083 flush_work(&dev->async_work);20842084+ flush_work(&dev->reset_work);20942085 flush_work(&dev->scan_work);20952086 nvme_remove_namespaces(&dev->ctrl);20962087 nvme_uninit_ctrl(&dev->ctrl);
+1-1
drivers/pci/pci-sysfs.c
···636636 u8 *data = (u8 *) buf;637637638638 /* Several chips lock up trying to read undefined config space */639639- if (security_capable(filp->f_cred, &init_user_ns, CAP_SYS_ADMIN) == 0)639639+ if (file_ns_capable(filp, &init_user_ns, CAP_SYS_ADMIN))640640 size = dev->cfg_size;641641 else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)642642 size = 128;
···39394040static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)4141{4242+ struct usb_hcd *hcd = xhci_to_hcd(xhci);4343+4244 /*4345 * As of now platform drivers don't provide MSI support so we ensure4446 * here that the generic code does not try to make a pci_dev from our4547 * dev struct in order to setup MSI4648 */4749 xhci->quirks |= XHCI_PLAT;5050+5151+ /*5252+ * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set5353+ * to 1. However, these SoCs don't support 64-bit address memory5454+ * pointers. So, this driver clears the AC64 bit of xhci->hcc_params5555+ * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in5656+ * xhci_gen_setup().5757+ */5858+ if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||5959+ xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3))6060+ xhci->quirks |= XHCI_NO_64BIT_SUPPORT;4861}49625063/* called during probe() after chip reset completes */
···40044004 int reserved_trbs = xhci->cmd_ring_reserved_trbs;40054005 int ret;4006400640074007- if (xhci->xhc_state) {40074007+ if ((xhci->xhc_state & XHCI_STATE_DYING) ||40084008+ (xhci->xhc_state & XHCI_STATE_HALTED)) {40084009 xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n");40094010 return -ESHUTDOWN;40104011 }
+18-6
drivers/usb/host/xhci.c
···147147 "waited %u microseconds.\n",148148 XHCI_MAX_HALT_USEC);149149 if (!ret)150150- xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING);150150+ /* clear state flags. Including dying, halted or removing */151151+ xhci->xhc_state = 0;151152152153 return ret;153154}···11091108 /* Resume root hubs only when have pending events. */11101109 status = readl(&xhci->op_regs->status);11111110 if (status & STS_EINT) {11121112- usb_hcd_resume_root_hub(hcd);11131111 usb_hcd_resume_root_hub(xhci->shared_hcd);11121112+ usb_hcd_resume_root_hub(hcd);11141113 }11151114 }11161115···1125112411261125 /* Re-enable port polling. */11271126 xhci_dbg(xhci, "%s: starting port polling.\n", __func__);11281128- set_bit(HCD_FLAG_POLL_RH, &hcd->flags);11291129- usb_hcd_poll_rh_status(hcd);11301127 set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);11311128 usb_hcd_poll_rh_status(xhci->shared_hcd);11291129+ set_bit(HCD_FLAG_POLL_RH, &hcd->flags);11301130+ usb_hcd_poll_rh_status(hcd);1132113111331132 return retval;11341133}···27742773 if (ret <= 0)27752774 return ret;27762775 xhci = hcd_to_xhci(hcd);27772777- if (xhci->xhc_state & XHCI_STATE_DYING)27762776+ if ((xhci->xhc_state & XHCI_STATE_DYING) ||27772777+ (xhci->xhc_state & XHCI_STATE_REMOVING))27782778 return -ENODEV;2779277927802780 xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev);···3822382038233821 mutex_lock(&xhci->mutex);3824382238253825- if (xhci->xhc_state) /* dying or halted */38233823+ if (xhci->xhc_state) /* dying, removing or halted */38263824 goto out;3827382538283826 if (!udev->slot_id) {···49494947 if (retval)49504948 return retval;49514949 xhci_dbg(xhci, "Reset complete\n");49504950+49514951+ /*49524952+ * On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0)49534953+ * of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit49544954+ * address memory pointers actually. So, this driver clears the AC6449554955+ * bit of xhci->hcc_params to call dma_set_coherent_mask(dev,49564956+ * DMA_BIT_MASK(32)) in this xhci_gen_setup().49574957+ */49584958+ if (xhci->quirks & XHCI_NO_64BIT_SUPPORT)49594959+ xhci->hcc_params &= ~BIT(0);4952496049534961 /* Set dma_mask and coherent_dma_mask to 64-bits,49544962 * if xHC supports 64-bit addressing */
+2
drivers/usb/host/xhci.h
···16051605 */16061606#define XHCI_STATE_DYING (1 << 0)16071607#define XHCI_STATE_HALTED (1 << 1)16081608+#define XHCI_STATE_REMOVING (1 << 2)16081609 /* Statistics */16091610 int error_bitmask;16101611 unsigned int quirks;···16421641#define XHCI_PME_STUCK_QUIRK (1 << 20)16431642#define XHCI_MTK_HOST (1 << 21)16441643#define XHCI_SSIC_PORT_UNUSED (1 << 22)16441644+#define XHCI_NO_64BIT_SUPPORT (1 << 23)16451645 unsigned int num_active_eps;16461646 unsigned int limit_active_eps;16471647 /* There are two roothubs to keep track of bus suspend info for */
+19-2
drivers/usb/storage/uas.c
···22 * USB Attached SCSI33 * Note that this is not the same as the USB Mass Storage driver44 *55- * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 201455+ * Copyright Hans de Goede <hdegoede@redhat.com> for Red Hat, Inc. 2013 - 201666 * Copyright Matthew Wilcox for Intel Corp, 201077 * Copyright Sarah Sharp for Intel Corp, 201088 *···781781 return SUCCESS;782782}783783784784+static int uas_target_alloc(struct scsi_target *starget)785785+{786786+ struct uas_dev_info *devinfo = (struct uas_dev_info *)787787+ dev_to_shost(starget->dev.parent)->hostdata;788788+789789+ if (devinfo->flags & US_FL_NO_REPORT_LUNS)790790+ starget->no_report_luns = 1;791791+792792+ return 0;793793+}794794+784795static int uas_slave_alloc(struct scsi_device *sdev)785796{786797 struct uas_dev_info *devinfo =···835824 if (devinfo->flags & US_FL_BROKEN_FUA)836825 sdev->broken_fua = 1;837826838838- scsi_change_queue_depth(sdev, devinfo->qdepth - 2);839827 return 0;840828}841829···842832 .module = THIS_MODULE,843833 .name = "uas",844834 .queuecommand = uas_queuecommand,835835+ .target_alloc = uas_target_alloc,845836 .slave_alloc = uas_slave_alloc,846837 .slave_configure = uas_slave_configure,847838 .eh_abort_handler = uas_eh_abort_handler,···966955 result = uas_configure_endpoints(devinfo);967956 if (result)968957 goto set_alt0;958958+959959+ /*960960+ * 1 tag is reserved for untagged commands +961961+ * 1 tag to avoid off by one errors in some bridge firmwares962962+ */963963+ shost->can_queue = devinfo->qdepth - 2;969964970965 usb_set_intfdata(intf, shost);971966 result = scsi_add_host(shost, &intf->dev);
+7
drivers/usb/storage/unusual_uas.h
···6464 USB_SC_DEVICE, USB_PR_DEVICE, NULL,6565 US_FL_NO_ATA_1X),66666767+/* Reported-by: David Webb <djw@noc.ac.uk> */6868+UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999,6969+ "Seagate",7070+ "Expansion Desk",7171+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,7272+ US_FL_NO_REPORT_LUNS),7373+6774/* Reported-by: Hans de Goede <hdegoede@redhat.com> */6875UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999,6976 "Seagate",
+4-1
drivers/usb/storage/usb.c
···482482 US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |483483 US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE |484484 US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES |485485- US_FL_MAX_SECTORS_240);485485+ US_FL_MAX_SECTORS_240 | US_FL_NO_REPORT_LUNS);486486487487 p = quirks;488488 while (*p) {···531531 break;532532 case 'i':533533 f |= US_FL_IGNORE_DEVICE;534534+ break;535535+ case 'j':536536+ f |= US_FL_NO_REPORT_LUNS;534537 break;535538 case 'l':536539 f |= US_FL_NOT_LOCKABLE;
+33-20
fs/crypto/crypto.c
···2626#include <linux/ratelimit.h>2727#include <linux/bio.h>2828#include <linux/dcache.h>2929+#include <linux/namei.h>2930#include <linux/fscrypto.h>3031#include <linux/ecryptfs.h>3132···8281/**8382 * fscrypt_get_ctx() - Gets an encryption context8483 * @inode: The inode for which we are doing the crypto8484+ * @gfp_flags: The gfp flag for memory allocation8585 *8686 * Allocates and initializes an encryption context.8787 *8888 * Return: An allocated and initialized encryption context on success; error8989 * value or NULL otherwise.9090 */9191-struct fscrypt_ctx *fscrypt_get_ctx(struct inode *inode)9191+struct fscrypt_ctx *fscrypt_get_ctx(struct inode *inode, gfp_t gfp_flags)9292{9393 struct fscrypt_ctx *ctx = NULL;9494 struct fscrypt_info *ci = inode->i_crypt_info;···115113 list_del(&ctx->free_list);116114 spin_unlock_irqrestore(&fscrypt_ctx_lock, flags);117115 if (!ctx) {118118- ctx = kmem_cache_zalloc(fscrypt_ctx_cachep, GFP_NOFS);116116+ ctx = kmem_cache_zalloc(fscrypt_ctx_cachep, gfp_flags);119117 if (!ctx)120118 return ERR_PTR(-ENOMEM);121119 ctx->flags |= FS_CTX_REQUIRES_FREE_ENCRYPT_FL;···149147150148static int do_page_crypto(struct inode *inode,151149 fscrypt_direction_t rw, pgoff_t index,152152- struct page *src_page, struct page *dest_page)150150+ struct page *src_page, struct page *dest_page,151151+ gfp_t gfp_flags)153152{154153 u8 xts_tweak[FS_XTS_TWEAK_SIZE];155154 struct skcipher_request *req = NULL;···160157 struct crypto_skcipher *tfm = ci->ci_ctfm;161158 int res = 0;162159163163- req = skcipher_request_alloc(tfm, GFP_NOFS);160160+ req = skcipher_request_alloc(tfm, gfp_flags);164161 if (!req) {165162 printk_ratelimited(KERN_ERR166163 "%s: crypto_request_alloc() failed\n",···202199 return 0;203200}204201205205-static struct page *alloc_bounce_page(struct fscrypt_ctx *ctx)202202+static struct page *alloc_bounce_page(struct fscrypt_ctx *ctx, gfp_t gfp_flags)206203{207207- ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool,208208- GFP_NOWAIT);204204+ ctx->w.bounce_page = mempool_alloc(fscrypt_bounce_page_pool, gfp_flags);209205 if (ctx->w.bounce_page == NULL)210206 return ERR_PTR(-ENOMEM);211207 ctx->flags |= FS_WRITE_PATH_FL;···215213 * fscypt_encrypt_page() - Encrypts a page216214 * @inode: The inode for which the encryption should take place217215 * @plaintext_page: The page to encrypt. Must be locked.216216+ * @gfp_flags: The gfp flag for memory allocation218217 *219218 * Allocates a ciphertext page and encrypts plaintext_page into it using the ctx220219 * encryption context.···228225 * error value or NULL.229226 */230227struct page *fscrypt_encrypt_page(struct inode *inode,231231- struct page *plaintext_page)228228+ struct page *plaintext_page, gfp_t gfp_flags)232229{233230 struct fscrypt_ctx *ctx;234231 struct page *ciphertext_page = NULL;···236233237234 BUG_ON(!PageLocked(plaintext_page));238235239239- ctx = fscrypt_get_ctx(inode);236236+ ctx = fscrypt_get_ctx(inode, gfp_flags);240237 if (IS_ERR(ctx))241238 return (struct page *)ctx;242239243240 /* The encryption operation will require a bounce page. */244244- ciphertext_page = alloc_bounce_page(ctx);241241+ ciphertext_page = alloc_bounce_page(ctx, gfp_flags);245242 if (IS_ERR(ciphertext_page))246243 goto errout;247244248245 ctx->w.control_page = plaintext_page;249246 err = do_page_crypto(inode, FS_ENCRYPT, plaintext_page->index,250250- plaintext_page, ciphertext_page);247247+ plaintext_page, ciphertext_page,248248+ gfp_flags);251249 if (err) {252250 ciphertext_page = ERR_PTR(err);253251 goto errout;···279275 BUG_ON(!PageLocked(page));280276281277 return do_page_crypto(page->mapping->host,282282- FS_DECRYPT, page->index, page, page);278278+ FS_DECRYPT, page->index, page, page, GFP_NOFS);283279}284280EXPORT_SYMBOL(fscrypt_decrypt_page);285281···293289294290 BUG_ON(inode->i_sb->s_blocksize != PAGE_SIZE);295291296296- ctx = fscrypt_get_ctx(inode);292292+ ctx = fscrypt_get_ctx(inode, GFP_NOFS);297293 if (IS_ERR(ctx))298294 return PTR_ERR(ctx);299295300300- ciphertext_page = alloc_bounce_page(ctx);296296+ ciphertext_page = alloc_bounce_page(ctx, GFP_NOWAIT);301297 if (IS_ERR(ciphertext_page)) {302298 err = PTR_ERR(ciphertext_page);303299 goto errout;···305301306302 while (len--) {307303 err = do_page_crypto(inode, FS_ENCRYPT, lblk,308308- ZERO_PAGE(0), ciphertext_page);304304+ ZERO_PAGE(0), ciphertext_page,305305+ GFP_NOFS);309306 if (err)310307 goto errout;311308312312- bio = bio_alloc(GFP_KERNEL, 1);309309+ bio = bio_alloc(GFP_NOWAIT, 1);313310 if (!bio) {314311 err = -ENOMEM;315312 goto errout;···350345 */351346static int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags)352347{353353- struct inode *dir = d_inode(dentry->d_parent);354354- struct fscrypt_info *ci = dir->i_crypt_info;348348+ struct dentry *dir;349349+ struct fscrypt_info *ci;355350 int dir_has_key, cached_with_key;356351357357- if (!dir->i_sb->s_cop->is_encrypted(dir))358358- return 0;352352+ if (flags & LOOKUP_RCU)353353+ return -ECHILD;359354355355+ dir = dget_parent(dentry);356356+ if (!d_inode(dir)->i_sb->s_cop->is_encrypted(d_inode(dir))) {357357+ dput(dir);358358+ return 0;359359+ }360360+361361+ ci = d_inode(dir)->i_crypt_info;360362 if (ci && ci->ci_keyring_key &&361363 (ci->ci_keyring_key->flags & ((1 << KEY_FLAG_INVALIDATED) |362364 (1 << KEY_FLAG_REVOKED) |···375363 cached_with_key = dentry->d_flags & DCACHE_ENCRYPTED_WITH_KEY;376364 spin_unlock(&dentry->d_lock);377365 dir_has_key = (ci != NULL);366366+ dput(dir);378367379368 /*380369 * If the dentry was cached without the key, and it is a
···3232#include <linux/random.h>3333#include <linux/scatterlist.h>3434#include <linux/spinlock_types.h>3535+#include <linux/namei.h>35363637#include "ext4_extents.h"3738#include "xattr.h"···482481 struct dentry *dir;483482 struct ext4_crypt_info *ci;484483 int dir_has_key, cached_with_key;484484+485485+ if (flags & LOOKUP_RCU)486486+ return -ECHILD;485487486488 dir = dget_parent(dentry);487489 if (!ext4_encrypted_inode(d_inode(dir))) {
+13-3
fs/f2fs/data.c
···992992 if (f2fs_encrypted_inode(inode) &&993993 S_ISREG(inode->i_mode)) {994994995995- ctx = fscrypt_get_ctx(inode);995995+ ctx = fscrypt_get_ctx(inode, GFP_NOFS);996996 if (IS_ERR(ctx))997997 goto set_error_page;998998···10921092 }1093109310941094 if (f2fs_encrypted_inode(inode) && S_ISREG(inode->i_mode)) {10951095+ gfp_t gfp_flags = GFP_NOFS;1095109610961097 /* wait for GCed encrypted page writeback */10971098 f2fs_wait_on_encrypted_page_writeback(F2FS_I_SB(inode),10981099 fio->old_blkaddr);10991099-11001100- fio->encrypted_page = fscrypt_encrypt_page(inode, fio->page);11001100+retry_encrypt:11011101+ fio->encrypted_page = fscrypt_encrypt_page(inode, fio->page,11021102+ gfp_flags);11011103 if (IS_ERR(fio->encrypted_page)) {11021104 err = PTR_ERR(fio->encrypted_page);11051105+ if (err == -ENOMEM) {11061106+ /* flush pending ios and wait for a while */11071107+ f2fs_flush_merged_bios(F2FS_I_SB(inode));11081108+ congestion_wait(BLK_RW_ASYNC, HZ/50);11091109+ gfp_flags |= __GFP_NOFAIL;11101110+ err = 0;11111111+ goto retry_encrypt;11121112+ }11031113 goto out_writepage;11041114 }11051115 }
+7-3
fs/f2fs/file.c
···441441static int f2fs_file_open(struct inode *inode, struct file *filp)442442{443443 int ret = generic_file_open(inode, filp);444444- struct inode *dir = filp->f_path.dentry->d_parent->d_inode;444444+ struct dentry *dir;445445446446 if (!ret && f2fs_encrypted_inode(inode)) {447447 ret = fscrypt_get_encryption_info(inode);···450450 if (!fscrypt_has_encryption_key(inode))451451 return -ENOKEY;452452 }453453- if (f2fs_encrypted_inode(dir) &&454454- !fscrypt_has_permitted_context(dir, inode))453453+ dir = dget_parent(file_dentry(filp));454454+ if (f2fs_encrypted_inode(d_inode(dir)) &&455455+ !fscrypt_has_permitted_context(d_inode(dir), inode)) {456456+ dput(dir);455457 return -EPERM;458458+ }459459+ dput(dir);456460 return ret;457461}458462
+4-3
fs/seq_file.c
···72727373 mutex_init(&p->lock);7474 p->op = op;7575-#ifdef CONFIG_USER_NS7676- p->user_ns = file->f_cred->user_ns;7777-#endif7575+7676+ // No refcounting: the lifetime of 'p' is constrained7777+ // to the lifetime of the file.7878+ p->file = file;78797980 /*8081 * Wrappers around seq_open(e.g. swaps_open) need to be
···12501250 unsigned long start, unsigned long nr_pages,12511251 int write, int force, struct page **pages,12521252 struct vm_area_struct **vmas);12531253-long get_user_pages6(unsigned long start, unsigned long nr_pages,12531253+long get_user_pages(unsigned long start, unsigned long nr_pages,12541254 int write, int force, struct page **pages,12551255 struct vm_area_struct **vmas);12561256-long get_user_pages_locked6(unsigned long start, unsigned long nr_pages,12561256+long get_user_pages_locked(unsigned long start, unsigned long nr_pages,12571257 int write, int force, struct page **pages, int *locked);12581258long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,12591259 unsigned long start, unsigned long nr_pages,12601260 int write, int force, struct page **pages,12611261 unsigned int gup_flags);12621262-long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages,12621262+long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,12631263 int write, int force, struct page **pages);12641264int get_user_pages_fast(unsigned long start, int nr_pages, int write,12651265 struct page **pages);12661266-12671267-/* suppress warnings from use in EXPORT_SYMBOL() */12681268-#ifndef __DISABLE_GUP_DEPRECATED12691269-#define __gup_deprecated __deprecated12701270-#else12711271-#define __gup_deprecated12721272-#endif12731273-/*12741274- * These macros provide backward-compatibility with the old12751275- * get_user_pages() variants which took tsk/mm. These12761276- * functions/macros provide both compile-time __deprecated so we12771277- * can catch old-style use and not break the build. The actual12781278- * functions also have WARN_ON()s to let us know at runtime if12791279- * the get_user_pages() should have been the "remote" variant.12801280- *12811281- * These are hideous, but temporary.12821282- *12831283- * If you run into one of these __deprecated warnings, look12841284- * at how you are calling get_user_pages(). If you are calling12851285- * it with current/current->mm as the first two arguments,12861286- * simply remove those arguments. The behavior will be the same12871287- * as it is now. If you are calling it on another task, use12881288- * get_user_pages_remote() instead.12891289- *12901290- * Any questions? Ask Dave Hansen <dave@sr71.net>12911291- */12921292-long12931293-__gup_deprecated12941294-get_user_pages8(struct task_struct *tsk, struct mm_struct *mm,12951295- unsigned long start, unsigned long nr_pages,12961296- int write, int force, struct page **pages,12971297- struct vm_area_struct **vmas);12981298-#define GUP_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages, ...) \12991299- get_user_pages13001300-#define get_user_pages(...) GUP_MACRO(__VA_ARGS__, \13011301- get_user_pages8, x, \13021302- get_user_pages6, x, x, x, x, x)(__VA_ARGS__)13031303-13041304-__gup_deprecated13051305-long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm,13061306- unsigned long start, unsigned long nr_pages,13071307- int write, int force, struct page **pages,13081308- int *locked);13091309-#define GUPL_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages_locked, ...) \13101310- get_user_pages_locked13111311-#define get_user_pages_locked(...) GUPL_MACRO(__VA_ARGS__, \13121312- get_user_pages_locked8, x, \13131313- get_user_pages_locked6, x, x, x, x)(__VA_ARGS__)13141314-13151315-__gup_deprecated13161316-long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm,13171317- unsigned long start, unsigned long nr_pages,13181318- int write, int force, struct page **pages);13191319-#define GUPU_MACRO(_1, _2, _3, _4, _5, _6, _7, get_user_pages_unlocked, ...) \13201320- get_user_pages_unlocked13211321-#define get_user_pages_unlocked(...) GUPU_MACRO(__VA_ARGS__, \13221322- get_user_pages_unlocked7, x, \13231323- get_user_pages_unlocked5, x, x, x, x)(__VA_ARGS__)1324126613251267/* Container for pinned pfns / pages */13261268struct frame_vector {
···898898void clear_wb_congested(struct bdi_writeback_congested *congested, int sync)899899{900900 wait_queue_head_t *wqh = &congestion_wqh[sync];901901- enum wb_state bit;901901+ enum wb_congested_state bit;902902903903 bit = sync ? WB_sync_congested : WB_async_congested;904904 if (test_and_clear_bit(bit, &congested->state))···911911912912void set_wb_congested(struct bdi_writeback_congested *congested, int sync)913913{914914- enum wb_state bit;914914+ enum wb_congested_state bit;915915916916 bit = sync ? WB_sync_congested : WB_async_congested;917917 if (!test_and_set_bit(bit, &congested->state))
+7-45
mm/gup.c
···11-#define __DISABLE_GUP_DEPRECATED 121#include <linux/kernel.h>32#include <linux/errno.h>43#include <linux/err.h>···838839 * if (locked)839840 * up_read(&mm->mmap_sem);840841 */841841-long get_user_pages_locked6(unsigned long start, unsigned long nr_pages,842842+long get_user_pages_locked(unsigned long start, unsigned long nr_pages,842843 int write, int force, struct page **pages,843844 int *locked)844845{···846847 write, force, pages, NULL, locked, true,847848 FOLL_TOUCH);848849}849849-EXPORT_SYMBOL(get_user_pages_locked6);850850+EXPORT_SYMBOL(get_user_pages_locked);850851851852/*852853 * Same as get_user_pages_unlocked(...., FOLL_TOUCH) but it allows to···891892 * or if "force" shall be set to 1 (get_user_pages_fast misses the892893 * "force" parameter).893894 */894894-long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages,895895+long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,895896 int write, int force, struct page **pages)896897{897898 return __get_user_pages_unlocked(current, current->mm, start, nr_pages,898899 write, force, pages, FOLL_TOUCH);899900}900900-EXPORT_SYMBOL(get_user_pages_unlocked5);901901+EXPORT_SYMBOL(get_user_pages_unlocked);901902902903/*903904 * get_user_pages_remote() - pin user pages in memory···971972 * and mm being operated on are the current task's. We also972973 * obviously don't pass FOLL_REMOTE in here.973974 */974974-long get_user_pages6(unsigned long start, unsigned long nr_pages,975975+long get_user_pages(unsigned long start, unsigned long nr_pages,975976 int write, int force, struct page **pages,976977 struct vm_area_struct **vmas)977978{···979980 write, force, pages, vmas, NULL, false,980981 FOLL_TOUCH);981982}982982-EXPORT_SYMBOL(get_user_pages6);983983+EXPORT_SYMBOL(get_user_pages);983984984985/**985986 * populate_vma_page_range() - populate a range of pages in the vma.···14901491int get_user_pages_fast(unsigned long start, int nr_pages, int write,14911492 struct page **pages)14921493{14931493- struct mm_struct *mm = current->mm;14941494 int nr, ret;1495149514961496 start &= PAGE_MASK;···15011503 start += nr << PAGE_SHIFT;15021504 pages += nr;1503150515041504- ret = get_user_pages_unlocked(current, mm, start,15051505- nr_pages - nr, write, 0, pages);15061506+ ret = get_user_pages_unlocked(start, nr_pages - nr, write, 0, pages);1506150715071508 /* Have to be a bit careful with return values */15081509 if (nr > 0) {···15161519}1517152015181521#endif /* CONFIG_HAVE_GENERIC_RCU_GUP */15191519-15201520-long get_user_pages8(struct task_struct *tsk, struct mm_struct *mm,15211521- unsigned long start, unsigned long nr_pages,15221522- int write, int force, struct page **pages,15231523- struct vm_area_struct **vmas)15241524-{15251525- WARN_ONCE(tsk != current, "get_user_pages() called on remote task");15261526- WARN_ONCE(mm != current->mm, "get_user_pages() called on remote mm");15271527-15281528- return get_user_pages6(start, nr_pages, write, force, pages, vmas);15291529-}15301530-EXPORT_SYMBOL(get_user_pages8);15311531-15321532-long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm,15331533- unsigned long start, unsigned long nr_pages,15341534- int write, int force, struct page **pages, int *locked)15351535-{15361536- WARN_ONCE(tsk != current, "get_user_pages_locked() called on remote task");15371537- WARN_ONCE(mm != current->mm, "get_user_pages_locked() called on remote mm");15381538-15391539- return get_user_pages_locked6(start, nr_pages, write, force, pages, locked);15401540-}15411541-EXPORT_SYMBOL(get_user_pages_locked8);15421542-15431543-long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm,15441544- unsigned long start, unsigned long nr_pages,15451545- int write, int force, struct page **pages)15461546-{15471547- WARN_ONCE(tsk != current, "get_user_pages_unlocked() called on remote task");15481548- WARN_ONCE(mm != current->mm, "get_user_pages_unlocked() called on remote mm");15491549-15501550- return get_user_pages_unlocked5(start, nr_pages, write, force, pages);15511551-}15521552-EXPORT_SYMBOL(get_user_pages_unlocked7);15531553-
+7-37
mm/nommu.c
···15151616#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt17171818-#define __DISABLE_GUP_DEPRECATED1919-2018#include <linux/export.h>2119#include <linux/mm.h>2220#include <linux/vmacache.h>···159161 * slab page or a secondary page from a compound page160162 * - don't permit access to VMAs that don't support it, such as I/O mappings161163 */162162-long get_user_pages6(unsigned long start, unsigned long nr_pages,164164+long get_user_pages(unsigned long start, unsigned long nr_pages,163165 int write, int force, struct page **pages,164166 struct vm_area_struct **vmas)165167{···173175 return __get_user_pages(current, current->mm, start, nr_pages, flags,174176 pages, vmas, NULL);175177}176176-EXPORT_SYMBOL(get_user_pages6);178178+EXPORT_SYMBOL(get_user_pages);177179178178-long get_user_pages_locked6(unsigned long start, unsigned long nr_pages,180180+long get_user_pages_locked(unsigned long start, unsigned long nr_pages,179181 int write, int force, struct page **pages,180182 int *locked)181183{182182- return get_user_pages6(start, nr_pages, write, force, pages, NULL);184184+ return get_user_pages(start, nr_pages, write, force, pages, NULL);183185}184184-EXPORT_SYMBOL(get_user_pages_locked6);186186+EXPORT_SYMBOL(get_user_pages_locked);185187186188long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,187189 unsigned long start, unsigned long nr_pages,···197199}198200EXPORT_SYMBOL(__get_user_pages_unlocked);199201200200-long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages,202202+long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,201203 int write, int force, struct page **pages)202204{203205 return __get_user_pages_unlocked(current, current->mm, start, nr_pages,204206 write, force, pages, 0);205207}206206-EXPORT_SYMBOL(get_user_pages_unlocked5);208208+EXPORT_SYMBOL(get_user_pages_unlocked);207209208210/**209211 * follow_pfn - look up PFN at a user virtual address···19871989 return 0;19881990}19891991subsys_initcall(init_admin_reserve);19901990-19911991-long get_user_pages8(struct task_struct *tsk, struct mm_struct *mm,19921992- unsigned long start, unsigned long nr_pages,19931993- int write, int force, struct page **pages,19941994- struct vm_area_struct **vmas)19951995-{19961996- return get_user_pages6(start, nr_pages, write, force, pages, vmas);19971997-}19981998-EXPORT_SYMBOL(get_user_pages8);19991999-20002000-long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm,20012001- unsigned long start, unsigned long nr_pages,20022002- int write, int force, struct page **pages,20032003- int *locked)20042004-{20052005- return get_user_pages_locked6(start, nr_pages, write,20062006- force, pages, locked);20072007-}20082008-EXPORT_SYMBOL(get_user_pages_locked8);20092009-20102010-long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm,20112011- unsigned long start, unsigned long nr_pages,20122012- int write, int force, struct page **pages)20132013-{20142014- return get_user_pages_unlocked5(start, nr_pages, write, force, pages);20152015-}20162016-EXPORT_SYMBOL(get_user_pages_unlocked7);20172017-
···349349};350350351351/*352352+ * Dell usb dock with ALC4020 codec had a firmware problem where it got353353+ * screwed up when zero volume is passed; just skip it as a workaround354354+ */355355+static const struct usbmix_name_map dell_alc4020_map[] = {356356+ { 16, NULL },357357+ { 19, NULL },358358+ { 0 }359359+};360360+361361+/*352362 * Control map entries353363 */354364···439429 {440430 .id = USB_ID(0x0ccd, 0x0028),441431 .map = aureon_51_2_map,432432+ },433433+ {434434+ .id = USB_ID(0x0bda, 0x4014),435435+ .map = dell_alc4020_map,442436 },443437 {444438 .id = USB_ID(0x0dba, 0x1000),
+2
sound/usb/quirks.c
···11341134 case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */11351135 case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */11361136 case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */11371137+ case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */11371138 case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */11381139 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */11391140 case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */11411141+ case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */11401142 case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */11411143 return true;11421144 }
+39-10
virt/kvm/arm/arch_timer.c
···9191 vcpu = container_of(work, struct kvm_vcpu, arch.timer_cpu.expired);9292 vcpu->arch.timer_cpu.armed = false;93939494+ WARN_ON(!kvm_timer_should_fire(vcpu));9595+9496 /*9597 * If the vcpu is blocked we want to wake it up so that it will see9698 * the timer has expired when entering the guest.···10098 kvm_vcpu_kick(vcpu);10199}102100101101+static u64 kvm_timer_compute_delta(struct kvm_vcpu *vcpu)102102+{103103+ cycle_t cval, now;104104+105105+ cval = vcpu->arch.timer_cpu.cntv_cval;106106+ now = kvm_phys_timer_read() - vcpu->kvm->arch.timer.cntvoff;107107+108108+ if (now < cval) {109109+ u64 ns;110110+111111+ ns = cyclecounter_cyc2ns(timecounter->cc,112112+ cval - now,113113+ timecounter->mask,114114+ &timecounter->frac);115115+ return ns;116116+ }117117+118118+ return 0;119119+}120120+103121static enum hrtimer_restart kvm_timer_expire(struct hrtimer *hrt)104122{105123 struct arch_timer_cpu *timer;124124+ struct kvm_vcpu *vcpu;125125+ u64 ns;126126+106127 timer = container_of(hrt, struct arch_timer_cpu, timer);128128+ vcpu = container_of(timer, struct kvm_vcpu, arch.timer_cpu);129129+130130+ /*131131+ * Check that the timer has really expired from the guest's132132+ * PoV (NTP on the host may have forced it to expire133133+ * early). If we should have slept longer, restart it.134134+ */135135+ ns = kvm_timer_compute_delta(vcpu);136136+ if (unlikely(ns)) {137137+ hrtimer_forward_now(hrt, ns_to_ktime(ns));138138+ return HRTIMER_RESTART;139139+ }140140+107141 queue_work(wqueue, &timer->expired);108142 return HRTIMER_NORESTART;109143}···214176void kvm_timer_schedule(struct kvm_vcpu *vcpu)215177{216178 struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;217217- u64 ns;218218- cycle_t cval, now;219179220180 BUG_ON(timer_is_armed(timer));221181···233197 return;234198235199 /* The timer has not yet expired, schedule a background timer */236236- cval = timer->cntv_cval;237237- now = kvm_phys_timer_read() - vcpu->kvm->arch.timer.cntvoff;238238-239239- ns = cyclecounter_cyc2ns(timecounter->cc,240240- cval - now,241241- timecounter->mask,242242- &timecounter->frac);243243- timer_arm(timer, ns);200200+ timer_arm(timer, kvm_timer_compute_delta(vcpu));244201}245202246203void kvm_timer_unschedule(struct kvm_vcpu *vcpu)