Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
drivers/net/usb/qmi_wwan.c

Overlapping additions of new device IDs to qmi_wwan.c

Signed-off-by: David S. Miller <davem@davemloft.net>

+844 -789
+1
.mailmap
··· 17 17 Al Viro <viro@ftp.linux.org.uk> 18 18 Al Viro <viro@zenIV.linux.org.uk> 19 19 Andreas Herrmann <aherrman@de.ibm.com> 20 + Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> 20 21 Andrew Morton <akpm@linux-foundation.org> 21 22 Andrew Vasquez <andrew.vasquez@qlogic.com> 22 23 Andy Adamson <andros@citi.umich.edu>
+1
Documentation/devicetree/bindings/arm/cpus.txt
··· 199 199 "qcom,kpss-acc-v1" 200 200 "qcom,kpss-acc-v2" 201 201 "rockchip,rk3066-smp" 202 + "ste,dbx500-smp" 202 203 203 204 - cpu-release-addr 204 205 Usage: required for systems that have an "enable-method"
+9
MAINTAINERS
··· 3588 3588 F: drivers/gpu/drm/rockchip/ 3589 3589 F: Documentation/devicetree/bindings/video/rockchip* 3590 3590 3591 + DRM DRIVERS FOR STI 3592 + M: Benjamin Gaignard <benjamin.gaignard@linaro.org> 3593 + M: Vincent Abriou <vincent.abriou@st.com> 3594 + L: dri-devel@lists.freedesktop.org 3595 + T: git http://git.linaro.org/people/benjamin.gaignard/kernel.git 3596 + S: Maintained 3597 + F: drivers/gpu/drm/sti 3598 + F: Documentation/devicetree/bindings/gpu/st,stih4xx.txt 3599 + 3591 3600 DSBR100 USB FM RADIO DRIVER 3592 3601 M: Alexey Klimov <klimov.linux@gmail.com> 3593 3602 L: linux-media@vger.kernel.org
+1 -1
Makefile
··· 1 1 VERSION = 4 2 2 PATCHLEVEL = 2 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc6 4 + EXTRAVERSION = -rc7 5 5 NAME = Hurr durr I'ma sheep 6 6 7 7 # *DOCUMENTATION*
+1 -1
arch/arm/boot/dts/dra7.dtsi
··· 116 116 ranges = <0 0x2000 0x2000>; 117 117 118 118 scm_conf: scm_conf@0 { 119 - compatible = "syscon"; 119 + compatible = "syscon", "simple-bus"; 120 120 reg = <0x0 0x1400>; 121 121 #address-cells = <1>; 122 122 #size-cells = <1>;
+4 -4
arch/arm/boot/dts/imx6qdl.dtsi
··· 181 181 interrupt-names = "msi"; 182 182 #interrupt-cells = <1>; 183 183 interrupt-map-mask = <0 0 0 0x7>; 184 - interrupt-map = <0 0 0 1 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 185 - <0 0 0 2 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 186 - <0 0 0 3 &intc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 187 - <0 0 0 4 &intc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; 184 + interrupt-map = <0 0 0 1 &gpc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, 185 + <0 0 0 2 &gpc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, 186 + <0 0 0 3 &gpc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, 187 + <0 0 0 4 &gpc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; 188 188 clocks = <&clks IMX6QDL_CLK_PCIE_AXI>, 189 189 <&clks IMX6QDL_CLK_LVDS1_GATE>, 190 190 <&clks IMX6QDL_CLK_PCIE_REF_125M>;
+11 -4
arch/arm/boot/dts/k2e.dtsi
··· 131 131 <GIC_SPI 376 IRQ_TYPE_EDGE_RISING>; 132 132 }; 133 133 }; 134 + 135 + mdio: mdio@24200f00 { 136 + compatible = "ti,keystone_mdio", "ti,davinci_mdio"; 137 + #address-cells = <1>; 138 + #size-cells = <0>; 139 + reg = <0x24200f00 0x100>; 140 + status = "disabled"; 141 + clocks = <&clkcpgmac>; 142 + clock-names = "fck"; 143 + bus_freq = <2500000>; 144 + }; 134 145 /include/ "k2e-netcp.dtsi" 135 146 }; 136 - }; 137 - 138 - &mdio { 139 - reg = <0x24200f00 0x100>; 140 147 };
+11
arch/arm/boot/dts/k2hk.dtsi
··· 98 98 #gpio-cells = <2>; 99 99 gpio,syscon-dev = <&devctrl 0x25c>; 100 100 }; 101 + 102 + mdio: mdio@02090300 { 103 + compatible = "ti,keystone_mdio", "ti,davinci_mdio"; 104 + #address-cells = <1>; 105 + #size-cells = <0>; 106 + reg = <0x02090300 0x100>; 107 + status = "disabled"; 108 + clocks = <&clkcpgmac>; 109 + clock-names = "fck"; 110 + bus_freq = <2500000>; 111 + }; 101 112 /include/ "k2hk-netcp.dtsi" 102 113 }; 103 114 };
+11 -5
arch/arm/boot/dts/k2l.dtsi
··· 29 29 }; 30 30 31 31 soc { 32 - 33 32 /include/ "k2l-clocks.dtsi" 34 33 35 34 uart2: serial@02348400 { ··· 78 79 #gpio-cells = <2>; 79 80 gpio,syscon-dev = <&devctrl 0x24c>; 80 81 }; 82 + 83 + mdio: mdio@26200f00 { 84 + compatible = "ti,keystone_mdio", "ti,davinci_mdio"; 85 + #address-cells = <1>; 86 + #size-cells = <0>; 87 + reg = <0x26200f00 0x100>; 88 + status = "disabled"; 89 + clocks = <&clkcpgmac>; 90 + clock-names = "fck"; 91 + bus_freq = <2500000>; 92 + }; 81 93 /include/ "k2l-netcp.dtsi" 82 94 }; 83 95 }; ··· 105 95 ti,davinci-spi-num-cs = <5>; 106 96 /* Pin muxed. Enabled and configured by Bootloader */ 107 97 status = "disabled"; 108 - }; 109 - 110 - &mdio { 111 - reg = <0x26200f00 0x100>; 112 98 };
-11
arch/arm/boot/dts/keystone.dtsi
··· 267 267 1 0 0x21000A00 0x00000100>; 268 268 }; 269 269 270 - mdio: mdio@02090300 { 271 - compatible = "ti,keystone_mdio", "ti,davinci_mdio"; 272 - #address-cells = <1>; 273 - #size-cells = <0>; 274 - reg = <0x02090300 0x100>; 275 - status = "disabled"; 276 - clocks = <&clkpa>; 277 - clock-names = "fck"; 278 - bus_freq = <2500000>; 279 - }; 280 - 281 270 kirq0: keystone_irq@26202a0 { 282 271 compatible = "ti,keystone-irq"; 283 272 interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
+2 -1
arch/arm/boot/dts/omap2430.dtsi
··· 51 51 }; 52 52 53 53 scm_conf: scm_conf@270 { 54 - compatible = "syscon"; 54 + compatible = "syscon", 55 + "simple-bus"; 55 56 reg = <0x270 0x240>; 56 57 #address-cells = <1>; 57 58 #size-cells = <1>;
+2 -1
arch/arm/boot/dts/omap4.dtsi
··· 191 191 }; 192 192 193 193 omap4_padconf_global: omap4_padconf_global@5a0 { 194 - compatible = "syscon"; 194 + compatible = "syscon", 195 + "simple-bus"; 195 196 reg = <0x5a0 0x170>; 196 197 #address-cells = <1>; 197 198 #size-cells = <1>;
+2 -1
arch/arm/boot/dts/omap5.dtsi
··· 180 180 }; 181 181 182 182 omap5_padconf_global: omap5_padconf_global@5a0 { 183 - compatible = "syscon"; 183 + compatible = "syscon", 184 + "simple-bus"; 184 185 reg = <0x5a0 0xec>; 185 186 #address-cells = <1>; 186 187 #size-cells = <1>;
+27 -26
arch/arm/boot/dts/ste-dbx5x0.dtsi
··· 15 15 #include "skeleton.dtsi" 16 16 17 17 / { 18 + cpus { 19 + #address-cells = <1>; 20 + #size-cells = <0>; 21 + enable-method = "ste,dbx500-smp"; 22 + 23 + cpu-map { 24 + cluster0 { 25 + core0 { 26 + cpu = <&CPU0>; 27 + }; 28 + core1 { 29 + cpu = <&CPU1>; 30 + }; 31 + }; 32 + }; 33 + CPU0: cpu@300 { 34 + device_type = "cpu"; 35 + compatible = "arm,cortex-a9"; 36 + reg = <0x300>; 37 + }; 38 + CPU1: cpu@301 { 39 + device_type = "cpu"; 40 + compatible = "arm,cortex-a9"; 41 + reg = <0x301>; 42 + }; 43 + }; 44 + 18 45 soc { 19 46 #address-cells = <1>; 20 47 #size-cells = <1>; 21 48 compatible = "stericsson,db8500"; 22 49 interrupt-parent = <&intc>; 23 50 ranges; 24 - 25 - cpus { 26 - #address-cells = <1>; 27 - #size-cells = <0>; 28 - 29 - cpu-map { 30 - cluster0 { 31 - core0 { 32 - cpu = <&CPU0>; 33 - }; 34 - core1 { 35 - cpu = <&CPU1>; 36 - }; 37 - }; 38 - }; 39 - CPU0: cpu@0 { 40 - device_type = "cpu"; 41 - compatible = "arm,cortex-a9"; 42 - reg = <0>; 43 - }; 44 - CPU1: cpu@1 { 45 - device_type = "cpu"; 46 - compatible = "arm,cortex-a9"; 47 - reg = <1>; 48 - }; 49 - }; 50 51 51 52 ptm@801ae000 { 52 53 compatible = "arm,coresight-etm3x", "arm,primecell";
+1
arch/arm/kernel/entry-common.S
··· 61 61 movlt scno, #(__NR_restart_syscall - __NR_SYSCALL_BASE) 62 62 ldmia sp, {r0 - r6} @ have to reload r0 - r6 63 63 b local_restart @ ... and off we go 64 + ENDPROC(ret_fast_syscall) 64 65 65 66 /* 66 67 * "slow" syscall return path. "why" tells us if this was a real syscall.
+3
arch/arm/kernel/head.S
··· 399 399 sub lr, r4, r5 @ mmu has been enabled 400 400 add r3, r7, lr 401 401 ldrd r4, [r3, #0] @ get secondary_data.pgdir 402 + ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: 403 + ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps 404 + ARM_BE8(eor r4, r4, r5) @ without using a temp reg. 402 405 ldr r8, [r3, #8] @ get secondary_data.swapper_pg_dir 403 406 badr lr, __enable_mmu @ return address 404 407 mov r13, r12 @ __secondary_switched address
+3 -4
arch/arm/kernel/vdso.c
··· 296 296 */ 297 297 void update_vsyscall(struct timekeeper *tk) 298 298 { 299 - struct timespec xtime_coarse; 300 299 struct timespec64 *wtm = &tk->wall_to_monotonic; 301 300 302 301 if (!cntvct_ok) { ··· 307 308 308 309 vdso_write_begin(vdso_data); 309 310 310 - xtime_coarse = __current_kernel_time(); 311 311 vdso_data->tk_is_cntvct = tk_is_cntvct(tk); 312 - vdso_data->xtime_coarse_sec = xtime_coarse.tv_sec; 313 - vdso_data->xtime_coarse_nsec = xtime_coarse.tv_nsec; 312 + vdso_data->xtime_coarse_sec = tk->xtime_sec; 313 + vdso_data->xtime_coarse_nsec = (u32)(tk->tkr_mono.xtime_nsec >> 314 + tk->tkr_mono.shift); 314 315 vdso_data->wtm_clock_sec = wtm->tv_sec; 315 316 vdso_data->wtm_clock_nsec = wtm->tv_nsec; 316 317
+1 -2
arch/arm/mach-exynos/pm_domains.c
··· 146 146 pd->base = of_iomap(np, 0); 147 147 if (!pd->base) { 148 148 pr_warn("%s: failed to map memory\n", __func__); 149 - kfree(pd->pd.name); 149 + kfree_const(pd->pd.name); 150 150 kfree(pd); 151 - of_node_put(np); 152 151 continue; 153 152 } 154 153
+1 -1
arch/arm/vdso/Makefile
··· 14 14 VDSO_LDFLAGS += -nostdlib -shared 15 15 VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 16 16 VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--build-id) 17 - VDSO_LDFLAGS += $(call cc-option, -fuse-ld=bfd) 17 + VDSO_LDFLAGS += $(call cc-ldoption, -fuse-ld=bfd) 18 18 19 19 obj-$(CONFIG_VDSO) += vdso.o 20 20 extra-$(CONFIG_VDSO) += vdso.lds
+1 -1
arch/mips/kernel/scall64-64.S
··· 80 80 SAVE_STATIC 81 81 move s0, t2 82 82 move a0, sp 83 - daddiu a1, v0, __NR_64_Linux 83 + move a1, v0 84 84 jal syscall_trace_enter 85 85 86 86 bltz v0, 2f # seccomp failed? Skip syscall
+1 -1
arch/mips/kernel/scall64-n32.S
··· 72 72 SAVE_STATIC 73 73 move s0, t2 74 74 move a0, sp 75 - daddiu a1, v0, __NR_N32_Linux 75 + move a1, v0 76 76 jal syscall_trace_enter 77 77 78 78 bltz v0, 2f # seccomp failed? Skip syscall
+2 -1
arch/x86/entry/entry_64_compat.S
··· 140 140 */ 141 141 andl $~TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) 142 142 movl RIP(%rsp), %ecx /* User %eip */ 143 + movq RAX(%rsp), %rax 143 144 RESTORE_RSI_RDI 144 145 xorl %edx, %edx /* Do not leak kernel information */ 145 146 xorq %r8, %r8 ··· 220 219 1: setbe %al /* 1 if error, 0 if not */ 221 220 movzbl %al, %edi /* zero-extend that into %edi */ 222 221 call __audit_syscall_exit 223 - movq RAX(%rsp), %rax /* reload syscall return value */ 224 222 movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), %edi 225 223 DISABLE_INTERRUPTS(CLBR_NONE) 226 224 TRACE_IRQS_OFF ··· 368 368 RESTORE_RSI_RDI_RDX 369 369 movl RIP(%rsp), %ecx 370 370 movl EFLAGS(%rsp), %r11d 371 + movq RAX(%rsp), %rax 371 372 xorq %r10, %r10 372 373 xorq %r9, %r9 373 374 xorq %r8, %r8
+16 -7
arch/x86/kernel/cpu/perf_event_intel.c
··· 2534 2534 if (x86_pmu.extra_regs || x86_pmu.lbr_sel_map) { 2535 2535 cpuc->shared_regs = allocate_shared_regs(cpu); 2536 2536 if (!cpuc->shared_regs) 2537 - return NOTIFY_BAD; 2537 + goto err; 2538 2538 } 2539 2539 2540 2540 if (x86_pmu.flags & PMU_FL_EXCL_CNTRS) { ··· 2542 2542 2543 2543 cpuc->constraint_list = kzalloc(sz, GFP_KERNEL); 2544 2544 if (!cpuc->constraint_list) 2545 - return NOTIFY_BAD; 2545 + goto err_shared_regs; 2546 2546 2547 2547 cpuc->excl_cntrs = allocate_excl_cntrs(cpu); 2548 - if (!cpuc->excl_cntrs) { 2549 - kfree(cpuc->constraint_list); 2550 - kfree(cpuc->shared_regs); 2551 - return NOTIFY_BAD; 2552 - } 2548 + if (!cpuc->excl_cntrs) 2549 + goto err_constraint_list; 2550 + 2553 2551 cpuc->excl_thread_id = 0; 2554 2552 } 2555 2553 2556 2554 return NOTIFY_OK; 2555 + 2556 + err_constraint_list: 2557 + kfree(cpuc->constraint_list); 2558 + cpuc->constraint_list = NULL; 2559 + 2560 + err_shared_regs: 2561 + kfree(cpuc->shared_regs); 2562 + cpuc->shared_regs = NULL; 2563 + 2564 + err: 2565 + return NOTIFY_BAD; 2557 2566 } 2558 2567 2559 2568 static void intel_pmu_cpu_starting(int cpu)
+3 -5
arch/x86/kernel/cpu/perf_event_intel_cqm.c
··· 1255 1255 cpumask_set_cpu(cpu, &cqm_cpumask); 1256 1256 } 1257 1257 1258 - static void intel_cqm_cpu_prepare(unsigned int cpu) 1258 + static void intel_cqm_cpu_starting(unsigned int cpu) 1259 1259 { 1260 1260 struct intel_pqr_state *state = &per_cpu(pqr_state, cpu); 1261 1261 struct cpuinfo_x86 *c = &cpu_data(cpu); ··· 1296 1296 unsigned int cpu = (unsigned long)hcpu; 1297 1297 1298 1298 switch (action & ~CPU_TASKS_FROZEN) { 1299 - case CPU_UP_PREPARE: 1300 - intel_cqm_cpu_prepare(cpu); 1301 - break; 1302 1299 case CPU_DOWN_PREPARE: 1303 1300 intel_cqm_cpu_exit(cpu); 1304 1301 break; 1305 1302 case CPU_STARTING: 1303 + intel_cqm_cpu_starting(cpu); 1306 1304 cqm_pick_event_reader(cpu); 1307 1305 break; 1308 1306 } ··· 1371 1373 goto out; 1372 1374 1373 1375 for_each_online_cpu(i) { 1374 - intel_cqm_cpu_prepare(i); 1376 + intel_cqm_cpu_starting(i); 1375 1377 cqm_pick_event_reader(i); 1376 1378 } 1377 1379
+2 -2
arch/x86/kernel/step.c
··· 28 28 struct desc_struct *desc; 29 29 unsigned long base; 30 30 31 - seg &= ~7UL; 31 + seg >>= 3; 32 32 33 33 mutex_lock(&child->mm->context.lock); 34 34 if (unlikely(!child->mm->context.ldt || 35 - (seg >> 3) >= child->mm->context.ldt->size)) 35 + seg >= child->mm->context.ldt->size)) 36 36 addr = -1L; /* bogus selector, access would fault */ 37 37 else { 38 38 desc = &child->mm->context.ldt->entries[seg];
+6 -1
arch/x86/kvm/x86.c
··· 2105 2105 if (guest_cpuid_has_tsc_adjust(vcpu)) { 2106 2106 if (!msr_info->host_initiated) { 2107 2107 s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr; 2108 - kvm_x86_ops->adjust_tsc_offset(vcpu, adj, true); 2108 + adjust_tsc_offset_guest(vcpu, adj); 2109 2109 } 2110 2110 vcpu->arch.ia32_tsc_adjust_msr = data; 2111 2111 } ··· 6327 6327 static void process_smi(struct kvm_vcpu *vcpu) 6328 6328 { 6329 6329 struct kvm_segment cs, ds; 6330 + struct desc_ptr dt; 6330 6331 char buf[512]; 6331 6332 u32 cr0; 6332 6333 ··· 6359 6358 vcpu->arch.cr0 = cr0; 6360 6359 6361 6360 kvm_x86_ops->set_cr4(vcpu, 0); 6361 + 6362 + /* Undocumented: IDT limit is set to zero on entry to SMM. */ 6363 + dt.address = dt.size = 0; 6364 + kvm_x86_ops->set_idt(vcpu, &dt); 6362 6365 6363 6366 __kvm_set_dr(vcpu, 7, DR7_FIXED_1); 6364 6367
+1 -2
arch/x86/math-emu/fpu_entry.c
··· 29 29 30 30 #include <asm/uaccess.h> 31 31 #include <asm/traps.h> 32 - #include <asm/desc.h> 33 32 #include <asm/user.h> 34 33 #include <asm/fpu/internal.h> 35 34 ··· 180 181 math_abort(FPU_info, SIGILL); 181 182 } 182 183 183 - code_descriptor = LDT_DESCRIPTOR(FPU_CS); 184 + code_descriptor = FPU_get_ldt_descriptor(FPU_CS); 184 185 if (SEG_D_SIZE(code_descriptor)) { 185 186 /* The above test may be wrong, the book is not clear */ 186 187 /* Segmented 32 bit protected mode */
+18 -3
arch/x86/math-emu/fpu_system.h
··· 16 16 #include <linux/kernel.h> 17 17 #include <linux/mm.h> 18 18 19 - /* s is always from a cpu register, and the cpu does bounds checking 20 - * during register load --> no further bounds checks needed */ 21 - #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) 19 + #include <asm/desc.h> 20 + #include <asm/mmu_context.h> 21 + 22 + static inline struct desc_struct FPU_get_ldt_descriptor(unsigned seg) 23 + { 24 + static struct desc_struct zero_desc; 25 + struct desc_struct ret = zero_desc; 26 + 27 + #ifdef CONFIG_MODIFY_LDT_SYSCALL 28 + seg >>= 3; 29 + mutex_lock(&current->mm->context.lock); 30 + if (current->mm->context.ldt && seg < current->mm->context.ldt->size) 31 + ret = current->mm->context.ldt->entries[seg]; 32 + mutex_unlock(&current->mm->context.lock); 33 + #endif 34 + return ret; 35 + } 36 + 22 37 #define SEG_D_SIZE(x) ((x).b & (3 << 21)) 23 38 #define SEG_G_BIT(x) ((x).b & (1 << 23)) 24 39 #define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1)
+1 -2
arch/x86/math-emu/get_address.c
··· 20 20 #include <linux/stddef.h> 21 21 22 22 #include <asm/uaccess.h> 23 - #include <asm/desc.h> 24 23 25 24 #include "fpu_system.h" 26 25 #include "exception.h" ··· 157 158 addr->selector = PM_REG_(segment); 158 159 } 159 160 160 - descriptor = LDT_DESCRIPTOR(PM_REG_(segment)); 161 + descriptor = FPU_get_ldt_descriptor(addr->selector); 161 162 base_address = SEG_BASE_ADDR(descriptor); 162 163 address = base_address + offset; 163 164 limit = base_address
+2 -2
arch/x86/xen/Kconfig
··· 8 8 select PARAVIRT_CLOCK 9 9 select XEN_HAVE_PVMMU 10 10 depends on X86_64 || (X86_32 && X86_PAE) 11 - depends on X86_TSC 11 + depends on X86_LOCAL_APIC && X86_TSC 12 12 help 13 13 This is the Linux Xen port. Enabling this will allow the 14 14 kernel to boot in a paravirtualized environment under the ··· 17 17 config XEN_DOM0 18 18 def_bool y 19 19 depends on XEN && PCI_XEN && SWIOTLB_XEN 20 - depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI 20 + depends on X86_IO_APIC && ACPI && PCI 21 21 22 22 config XEN_PVHVM 23 23 def_bool y
+2 -2
block/blk-settings.c
··· 241 241 * Description: 242 242 * Enables a low level driver to set a hard upper limit, 243 243 * max_hw_sectors, on the size of requests. max_hw_sectors is set by 244 - * the device driver based upon the combined capabilities of I/O 245 - * controller and storage device. 244 + * the device driver based upon the capabilities of the I/O 245 + * controller. 246 246 * 247 247 * max_sectors is a soft limit imposed by the block layer for 248 248 * filesystem type requests. This value can be overridden on a
+12 -32
crypto/authencesn.c
··· 393 393 struct scatterlist *cipher = areq_ctx->cipher; 394 394 struct scatterlist *hsg = areq_ctx->hsg; 395 395 struct scatterlist *tsg = areq_ctx->tsg; 396 - struct scatterlist *assoc1; 397 - struct scatterlist *assoc2; 398 396 unsigned int ivsize = crypto_aead_ivsize(authenc_esn); 399 397 unsigned int cryptlen = req->cryptlen; 400 398 struct page *dstp; ··· 410 412 cryptlen += ivsize; 411 413 } 412 414 413 - if (sg_is_last(assoc)) 414 - return -EINVAL; 415 - 416 - assoc1 = assoc + 1; 417 - if (sg_is_last(assoc1)) 418 - return -EINVAL; 419 - 420 - assoc2 = assoc + 2; 421 - if (!sg_is_last(assoc2)) 415 + if (assoc->length < 12) 422 416 return -EINVAL; 423 417 424 418 sg_init_table(hsg, 2); 425 - sg_set_page(hsg, sg_page(assoc), assoc->length, assoc->offset); 426 - sg_set_page(hsg + 1, sg_page(assoc2), assoc2->length, assoc2->offset); 419 + sg_set_page(hsg, sg_page(assoc), 4, assoc->offset); 420 + sg_set_page(hsg + 1, sg_page(assoc), 4, assoc->offset + 8); 427 421 428 422 sg_init_table(tsg, 1); 429 - sg_set_page(tsg, sg_page(assoc1), assoc1->length, assoc1->offset); 423 + sg_set_page(tsg, sg_page(assoc), 4, assoc->offset + 4); 430 424 431 425 areq_ctx->cryptlen = cryptlen; 432 - areq_ctx->headlen = assoc->length + assoc2->length; 433 - areq_ctx->trailen = assoc1->length; 426 + areq_ctx->headlen = 8; 427 + areq_ctx->trailen = 4; 434 428 areq_ctx->sg = dst; 435 429 436 430 areq_ctx->complete = authenc_esn_geniv_ahash_done; ··· 553 563 struct scatterlist *cipher = areq_ctx->cipher; 554 564 struct scatterlist *hsg = areq_ctx->hsg; 555 565 struct scatterlist *tsg = areq_ctx->tsg; 556 - struct scatterlist *assoc1; 557 - struct scatterlist *assoc2; 558 566 unsigned int ivsize = crypto_aead_ivsize(authenc_esn); 559 567 struct page *srcp; 560 568 u8 *vsrc; ··· 568 580 cryptlen += ivsize; 569 581 } 570 582 571 - if (sg_is_last(assoc)) 572 - return -EINVAL; 573 - 574 - assoc1 = assoc + 1; 575 - if (sg_is_last(assoc1)) 576 - return -EINVAL; 577 - 578 - assoc2 = assoc + 2; 579 - if (!sg_is_last(assoc2)) 583 + if (assoc->length < 12) 580 584 return -EINVAL; 581 585 582 586 sg_init_table(hsg, 2); 583 - sg_set_page(hsg, sg_page(assoc), assoc->length, assoc->offset); 584 - sg_set_page(hsg + 1, sg_page(assoc2), assoc2->length, assoc2->offset); 587 + sg_set_page(hsg, sg_page(assoc), 4, assoc->offset); 588 + sg_set_page(hsg + 1, sg_page(assoc), 4, assoc->offset + 8); 585 589 586 590 sg_init_table(tsg, 1); 587 - sg_set_page(tsg, sg_page(assoc1), assoc1->length, assoc1->offset); 591 + sg_set_page(tsg, sg_page(assoc), 4, assoc->offset + 4); 588 592 589 593 areq_ctx->cryptlen = cryptlen; 590 - areq_ctx->headlen = assoc->length + assoc2->length; 591 - areq_ctx->trailen = assoc1->length; 594 + areq_ctx->headlen = 8; 595 + areq_ctx->trailen = 4; 592 596 areq_ctx->sg = src; 593 597 594 598 areq_ctx->complete = authenc_esn_verify_ahash_done;
+13 -3
drivers/acpi/video_detect.c
··· 32 32 #include <linux/module.h> 33 33 #include <linux/pci.h> 34 34 #include <linux/types.h> 35 + #include <linux/workqueue.h> 35 36 #include <acpi/video.h> 36 37 37 38 ACPI_MODULE_NAME("video"); ··· 42 41 43 42 static bool backlight_notifier_registered; 44 43 static struct notifier_block backlight_nb; 44 + static struct work_struct backlight_notify_work; 45 45 46 46 static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef; 47 47 static enum acpi_backlight_type acpi_backlight_dmi = acpi_backlight_undef; ··· 264 262 { }, 265 263 }; 266 264 265 + /* This uses a workqueue to avoid various locking ordering issues */ 266 + static void acpi_video_backlight_notify_work(struct work_struct *work) 267 + { 268 + if (acpi_video_get_backlight_type() != acpi_backlight_video) 269 + acpi_video_unregister_backlight(); 270 + } 271 + 267 272 static int acpi_video_backlight_notify(struct notifier_block *nb, 268 273 unsigned long val, void *bd) 269 274 { ··· 278 269 279 270 /* A raw bl registering may change video -> native */ 280 271 if (backlight->props.type == BACKLIGHT_RAW && 281 - val == BACKLIGHT_REGISTERED && 282 - acpi_video_get_backlight_type() != acpi_backlight_video) 283 - acpi_video_unregister_backlight(); 272 + val == BACKLIGHT_REGISTERED) 273 + schedule_work(&backlight_notify_work); 284 274 285 275 return NOTIFY_OK; 286 276 } ··· 312 304 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 313 305 ACPI_UINT32_MAX, find_video, NULL, 314 306 &video_caps, NULL); 307 + INIT_WORK(&backlight_notify_work, 308 + acpi_video_backlight_notify_work); 315 309 backlight_nb.notifier_call = acpi_video_backlight_notify; 316 310 backlight_nb.priority = 0; 317 311 if (backlight_register_notifier(&backlight_nb) == 0)
+4 -2
drivers/ata/ahci_brcmstb.c
··· 92 92 * Other architectures (e.g., ARM) either do not support big endian, or 93 93 * else leave I/O in little endian mode. 94 94 */ 95 - if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN)) 95 + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) 96 96 return __raw_readl(addr); 97 97 else 98 98 return readl_relaxed(addr); ··· 101 101 static inline void brcm_sata_writereg(u32 val, void __iomem *addr) 102 102 { 103 103 /* See brcm_sata_readreg() comments */ 104 - if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN)) 104 + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) 105 105 __raw_writel(val, addr); 106 106 else 107 107 writel_relaxed(val, addr); ··· 209 209 priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL); 210 210 } 211 211 212 + #ifdef CONFIG_PM_SLEEP 212 213 static int brcm_ahci_suspend(struct device *dev) 213 214 { 214 215 struct ata_host *host = dev_get_drvdata(dev); ··· 232 231 brcm_sata_phys_enable(priv); 233 232 return ahci_platform_resume(dev); 234 233 } 234 + #endif 235 235 236 236 static struct scsi_host_template ahci_platform_sht = { 237 237 AHCI_SHT(DRV_NAME),
+3 -21
drivers/ata/libata-core.c
··· 694 694 * RETURNS: 695 695 * Block address read from @tf. 696 696 */ 697 - u64 ata_tf_read_block(const struct ata_taskfile *tf, struct ata_device *dev) 697 + u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev) 698 698 { 699 699 u64 block = 0; 700 700 701 - if (!dev || tf->flags & ATA_TFLAG_LBA) { 701 + if (tf->flags & ATA_TFLAG_LBA) { 702 702 if (tf->flags & ATA_TFLAG_LBA48) { 703 703 block |= (u64)tf->hob_lbah << 40; 704 704 block |= (u64)tf->hob_lbam << 32; ··· 2147 2147 return 0; 2148 2148 } 2149 2149 2150 - static void ata_dev_config_sense_reporting(struct ata_device *dev) 2151 - { 2152 - unsigned int err_mask; 2153 - 2154 - if (!ata_id_has_sense_reporting(dev->id)) 2155 - return; 2156 - 2157 - if (ata_id_sense_reporting_enabled(dev->id)) 2158 - return; 2159 - 2160 - err_mask = ata_dev_set_feature(dev, SETFEATURE_SENSE_DATA, 0x1); 2161 - if (err_mask) { 2162 - ata_dev_dbg(dev, 2163 - "failed to enable Sense Data Reporting, Emask 0x%x\n", 2164 - err_mask); 2165 - } 2166 - } 2167 - 2168 2150 /** 2169 2151 * ata_dev_configure - Configure the specified ATA/ATAPI device 2170 2152 * @dev: Target device to configure ··· 2369 2387 dev->devslp_timing[i] = sata_setting[j]; 2370 2388 } 2371 2389 } 2372 - ata_dev_config_sense_reporting(dev); 2390 + 2373 2391 dev->cdb_len = 16; 2374 2392 } 2375 2393
+2 -103
drivers/ata/libata-eh.c
··· 1592 1592 tf->hob_lbah = buf[10]; 1593 1593 tf->nsect = buf[12]; 1594 1594 tf->hob_nsect = buf[13]; 1595 - if (ata_id_has_ncq_autosense(dev->id)) 1596 - tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16]; 1597 1595 1598 1596 return 0; 1599 1597 } ··· 1624 1626 err_mask = ata_exec_internal(dev, &tf, cdb, DMA_NONE, NULL, 0, 0); 1625 1627 if (err_mask == AC_ERR_DEV) 1626 1628 *r_sense_key = tf.feature >> 4; 1627 - return err_mask; 1628 - } 1629 - 1630 - /** 1631 - * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT 1632 - * @dev: device to perform REQUEST_SENSE_SENSE_DATA_EXT to 1633 - * @sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long) 1634 - * @dfl_sense_key: default sense key to use 1635 - * 1636 - * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK 1637 - * SENSE. This function is EH helper. 1638 - * 1639 - * LOCKING: 1640 - * Kernel thread context (may sleep). 1641 - * 1642 - * RETURNS: 1643 - * encoded sense data on success, 0 on failure or if sense data 1644 - * is not available. 1645 - */ 1646 - static u32 ata_eh_request_sense(struct ata_queued_cmd *qc, 1647 - struct scsi_cmnd *cmd) 1648 - { 1649 - struct ata_device *dev = qc->dev; 1650 - struct ata_taskfile tf; 1651 - unsigned int err_mask; 1652 - 1653 - if (!cmd) 1654 - return 0; 1655 - 1656 - DPRINTK("ATA request sense\n"); 1657 - ata_dev_warn(dev, "request sense\n"); 1658 - if (!ata_id_sense_reporting_enabled(dev->id)) { 1659 - ata_dev_warn(qc->dev, "sense data reporting disabled\n"); 1660 - return 0; 1661 - } 1662 - ata_tf_init(dev, &tf); 1663 - 1664 - tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; 1665 - tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48; 1666 - tf.command = ATA_CMD_REQ_SENSE_DATA; 1667 - tf.protocol = ATA_PROT_NODATA; 1668 - 1669 - err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 1670 - /* 1671 - * ACS-4 states: 1672 - * The device may set the SENSE DATA AVAILABLE bit to one in the 1673 - * STATUS field and clear the ERROR bit to zero in the STATUS field 1674 - * to indicate that the command returned completion without an error 1675 - * and the sense data described in table 306 is available. 1676 - * 1677 - * IOW the 'ATA_SENSE' bit might not be set even though valid 1678 - * sense data is available. 1679 - * So check for both. 1680 - */ 1681 - if ((tf.command & ATA_SENSE) || 1682 - tf.lbah != 0 || tf.lbam != 0 || tf.lbal != 0) { 1683 - ata_scsi_set_sense(cmd, tf.lbah, tf.lbam, tf.lbal); 1684 - qc->flags |= ATA_QCFLAG_SENSE_VALID; 1685 - ata_dev_warn(dev, "sense data %02x/%02x/%02x\n", 1686 - tf.lbah, tf.lbam, tf.lbal); 1687 - } else { 1688 - ata_dev_warn(dev, "request sense failed stat %02x emask %x\n", 1689 - tf.command, err_mask); 1690 - } 1691 1629 return err_mask; 1692 1630 } 1693 1631 ··· 1789 1855 memcpy(&qc->result_tf, &tf, sizeof(tf)); 1790 1856 qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48; 1791 1857 qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ; 1792 - if (qc->result_tf.auxiliary) { 1793 - char sense_key, asc, ascq; 1794 - 1795 - sense_key = (qc->result_tf.auxiliary >> 16) & 0xff; 1796 - asc = (qc->result_tf.auxiliary >> 8) & 0xff; 1797 - ascq = qc->result_tf.auxiliary & 0xff; 1798 - ata_dev_dbg(dev, "NCQ Autosense %02x/%02x/%02x\n", 1799 - sense_key, asc, ascq); 1800 - ata_scsi_set_sense(qc->scsicmd, sense_key, asc, ascq); 1801 - ata_scsi_set_sense_information(qc->scsicmd, &qc->result_tf); 1802 - qc->flags |= ATA_QCFLAG_SENSE_VALID; 1803 - } 1804 - 1805 1858 ehc->i.err_mask &= ~AC_ERR_DEV; 1806 1859 } 1807 1860 ··· 1817 1896 qc->err_mask |= AC_ERR_HSM; 1818 1897 return ATA_EH_RESET; 1819 1898 } 1820 - 1821 - /* 1822 - * Sense data reporting does not work if the 1823 - * device fault bit is set. 1824 - */ 1825 - if ((stat & ATA_SENSE) && !(stat & ATA_DF) && 1826 - !(qc->flags & ATA_QCFLAG_SENSE_VALID)) { 1827 - if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { 1828 - tmp = ata_eh_request_sense(qc, qc->scsicmd); 1829 - if (tmp) 1830 - qc->err_mask |= tmp; 1831 - else 1832 - ata_scsi_set_sense_information(qc->scsicmd, tf); 1833 - } else { 1834 - ata_dev_warn(qc->dev, "sense data available but port frozen\n"); 1835 - } 1836 - } 1837 - 1838 - /* Set by NCQ autosense or request sense above */ 1839 - if (qc->flags & ATA_QCFLAG_SENSE_VALID) 1840 - return 0; 1841 1899 1842 1900 if (stat & (ATA_ERR | ATA_DF)) 1843 1901 qc->err_mask |= AC_ERR_DEV; ··· 2561 2661 2562 2662 #ifdef CONFIG_ATA_VERBOSE_ERROR 2563 2663 if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | 2564 - ATA_SENSE | ATA_ERR)) { 2664 + ATA_ERR)) { 2565 2665 if (res->command & ATA_BUSY) 2566 2666 ata_dev_err(qc->dev, "status: { Busy }\n"); 2567 2667 else 2568 - ata_dev_err(qc->dev, "status: { %s%s%s%s%s}\n", 2668 + ata_dev_err(qc->dev, "status: { %s%s%s%s}\n", 2569 2669 res->command & ATA_DRDY ? "DRDY " : "", 2570 2670 res->command & ATA_DF ? "DF " : "", 2571 2671 res->command & ATA_DRQ ? "DRQ " : "", 2572 - res->command & ATA_SENSE ? "SENSE " : "", 2573 2672 res->command & ATA_ERR ? "ERR " : ""); 2574 2673 } 2575 2674
+2 -19
drivers/ata/libata-scsi.c
··· 270 270 ata_scsi_park_show, ata_scsi_park_store); 271 271 EXPORT_SYMBOL_GPL(dev_attr_unload_heads); 272 272 273 - void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq) 273 + static void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq) 274 274 { 275 - if (!cmd) 276 - return; 277 - 278 275 cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; 279 276 280 277 scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq); 281 - } 282 - 283 - void ata_scsi_set_sense_information(struct scsi_cmnd *cmd, 284 - const struct ata_taskfile *tf) 285 - { 286 - u64 information; 287 - 288 - if (!cmd) 289 - return; 290 - 291 - information = ata_tf_read_block(tf, NULL); 292 - scsi_set_sense_information(cmd->sense_buffer, information); 293 278 } 294 279 295 280 static ssize_t ··· 1777 1792 ((cdb[2] & 0x20) || need_sense)) { 1778 1793 ata_gen_passthru_sense(qc); 1779 1794 } else { 1780 - if (qc->flags & ATA_QCFLAG_SENSE_VALID) { 1781 - cmd->result = SAM_STAT_CHECK_CONDITION; 1782 - } else if (!need_sense) { 1795 + if (!need_sense) { 1783 1796 cmd->result = SAM_STAT_GOOD; 1784 1797 } else { 1785 1798 /* TODO: decide which descriptor format to use
+1 -5
drivers/ata/libata.h
··· 67 67 extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, 68 68 u64 block, u32 n_block, unsigned int tf_flags, 69 69 unsigned int tag); 70 - extern u64 ata_tf_read_block(const struct ata_taskfile *tf, 71 - struct ata_device *dev); 70 + extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev); 72 71 extern unsigned ata_exec_internal(struct ata_device *dev, 73 72 struct ata_taskfile *tf, const u8 *cdb, 74 73 int dma_dir, void *buf, unsigned int buflen, ··· 137 138 struct scsi_host_template *sht); 138 139 extern void ata_scsi_scan_host(struct ata_port *ap, int sync); 139 140 extern int ata_scsi_offline_dev(struct ata_device *dev); 140 - extern void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq); 141 - extern void ata_scsi_set_sense_information(struct scsi_cmnd *cmd, 142 - const struct ata_taskfile *tf); 143 141 extern void ata_scsi_media_change_notify(struct ata_device *dev); 144 142 extern void ata_scsi_hotplug(struct work_struct *work); 145 143 extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
+12 -4
drivers/ata/sata_sx4.c
··· 1238 1238 readl(mmio + PDC_SDRAM_CONTROL); 1239 1239 1240 1240 /* Turn on for ECC */ 1241 - pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS, 1242 - PDC_DIMM_SPD_TYPE, &spd0); 1241 + if (!pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS, 1242 + PDC_DIMM_SPD_TYPE, &spd0)) { 1243 + pr_err("Failed in i2c read: device=%#x, subaddr=%#x\n", 1244 + PDC_DIMM0_SPD_DEV_ADDRESS, PDC_DIMM_SPD_TYPE); 1245 + return 1; 1246 + } 1243 1247 if (spd0 == 0x02) { 1244 1248 data |= (0x01 << 16); 1245 1249 writel(data, mmio + PDC_SDRAM_CONTROL); ··· 1384 1380 1385 1381 /* ECC initiliazation. */ 1386 1382 1387 - pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS, 1388 - PDC_DIMM_SPD_TYPE, &spd0); 1383 + if (!pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS, 1384 + PDC_DIMM_SPD_TYPE, &spd0)) { 1385 + pr_err("Failed in i2c read: device=%#x, subaddr=%#x\n", 1386 + PDC_DIMM0_SPD_DEV_ADDRESS, PDC_DIMM_SPD_TYPE); 1387 + return 1; 1388 + } 1389 1389 if (spd0 == 0x02) { 1390 1390 void *buf; 1391 1391 VPRINTK("Start ECC initialization\n");
+2 -4
drivers/block/zram/zram_drv.c
··· 496 496 kfree(meta); 497 497 } 498 498 499 - static struct zram_meta *zram_meta_alloc(int device_id, u64 disksize) 499 + static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize) 500 500 { 501 501 size_t num_pages; 502 - char pool_name[8]; 503 502 struct zram_meta *meta = kmalloc(sizeof(*meta), GFP_KERNEL); 504 503 505 504 if (!meta) ··· 511 512 goto out_error; 512 513 } 513 514 514 - snprintf(pool_name, sizeof(pool_name), "zram%d", device_id); 515 515 meta->mem_pool = zs_create_pool(pool_name, GFP_NOIO | __GFP_HIGHMEM); 516 516 if (!meta->mem_pool) { 517 517 pr_err("Error creating memory pool\n"); ··· 1029 1031 return -EINVAL; 1030 1032 1031 1033 disksize = PAGE_ALIGN(disksize); 1032 - meta = zram_meta_alloc(zram->disk->first_minor, disksize); 1034 + meta = zram_meta_alloc(zram->disk->disk_name, disksize); 1033 1035 if (!meta) 1034 1036 return -ENOMEM; 1035 1037
+1 -1
drivers/clk/pxa/clk-pxa3xx.c
··· 126 126 PARENTS(pxa3xx_sbus) = { "ring_osc_60mhz", "system_bus" }; 127 127 PARENTS(pxa3xx_smemcbus) = { "ring_osc_60mhz", "smemc" }; 128 128 129 - #define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENA : &CKENB) 129 + #define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENB : &CKENA) 130 130 #define PXA3XX_CKEN(dev_id, con_id, parents, mult_lp, div_lp, mult_hp, \ 131 131 div_hp, bit, is_lp, flags) \ 132 132 PXA_CKEN(dev_id, con_id, bit, parents, mult_lp, div_lp, \
+6
drivers/clocksource/sh_cmt.c
··· 661 661 { 662 662 struct sh_cmt_channel *ch = cs_to_sh_cmt(cs); 663 663 664 + if (!ch->cs_enabled) 665 + return; 666 + 664 667 sh_cmt_stop(ch, FLAG_CLOCKSOURCE); 665 668 pm_genpd_syscore_poweroff(&ch->cmt->pdev->dev); 666 669 } ··· 671 668 static void sh_cmt_clocksource_resume(struct clocksource *cs) 672 669 { 673 670 struct sh_cmt_channel *ch = cs_to_sh_cmt(cs); 671 + 672 + if (!ch->cs_enabled) 673 + return; 674 674 675 675 pm_genpd_syscore_poweron(&ch->cmt->pdev->dev); 676 676 sh_cmt_start(ch, FLAG_CLOCKSOURCE);
+4 -2
drivers/cpufreq/exynos-cpufreq.c
··· 180 180 ret = exynos5250_cpufreq_init(exynos_info); 181 181 } else { 182 182 pr_err("%s: Unknown SoC type\n", __func__); 183 - return -ENODEV; 183 + ret = -ENODEV; 184 184 } 185 185 186 186 if (ret) ··· 188 188 189 189 if (exynos_info->set_freq == NULL) { 190 190 dev_err(&pdev->dev, "No set_freq function (ERR)\n"); 191 + ret = -EINVAL; 191 192 goto err_vdd_arm; 192 193 } 193 194 194 195 arm_regulator = regulator_get(NULL, "vdd_arm"); 195 196 if (IS_ERR(arm_regulator)) { 196 197 dev_err(&pdev->dev, "failed to get resource vdd_arm\n"); 198 + ret = -EINVAL; 197 199 goto err_vdd_arm; 198 200 } 199 201 ··· 227 225 regulator_put(arm_regulator); 228 226 err_vdd_arm: 229 227 kfree(exynos_info); 230 - return -EINVAL; 228 + return ret; 231 229 } 232 230 233 231 static struct platform_driver exynos_cpufreq_platdrv = {
+4 -3
drivers/crypto/caam/caamhash.c
··· 909 909 state->buflen_1; 910 910 u32 *sh_desc = ctx->sh_desc_fin, *desc; 911 911 dma_addr_t ptr = ctx->sh_desc_fin_dma; 912 - int sec4_sg_bytes; 912 + int sec4_sg_bytes, sec4_sg_src_index; 913 913 int digestsize = crypto_ahash_digestsize(ahash); 914 914 struct ahash_edesc *edesc; 915 915 int ret = 0; 916 916 int sh_len; 917 917 918 - sec4_sg_bytes = (1 + (buflen ? 1 : 0)) * sizeof(struct sec4_sg_entry); 918 + sec4_sg_src_index = 1 + (buflen ? 1 : 0); 919 + sec4_sg_bytes = sec4_sg_src_index * sizeof(struct sec4_sg_entry); 919 920 920 921 /* allocate space for base edesc and hw desc commands, link tables */ 921 922 edesc = kmalloc(sizeof(struct ahash_edesc) + DESC_JOB_IO_LEN + ··· 943 942 state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, 944 943 buf, state->buf_dma, buflen, 945 944 last_buflen); 946 - (edesc->sec4_sg + sec4_sg_bytes - 1)->len |= SEC4_SG_LEN_FIN; 945 + (edesc->sec4_sg + sec4_sg_src_index - 1)->len |= SEC4_SG_LEN_FIN; 947 946 948 947 edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, 949 948 sec4_sg_bytes, DMA_TO_DEVICE);
+16 -11
drivers/crypto/nx/nx-sha256.c
··· 71 71 struct sha256_state *sctx = shash_desc_ctx(desc); 72 72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); 73 73 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; 74 - struct nx_sg *in_sg; 75 74 struct nx_sg *out_sg; 76 75 u64 to_process = 0, leftover, total; 77 76 unsigned long irq_flags; ··· 96 97 NX_CPB_FDM(csbcpb) |= NX_FDM_INTERMEDIATE; 97 98 NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; 98 99 99 - in_sg = nx_ctx->in_sg; 100 100 max_sg_len = min_t(u64, nx_ctx->ap->sglen, 101 101 nx_driver.of.max_sg_len/sizeof(struct nx_sg)); 102 102 max_sg_len = min_t(u64, max_sg_len, ··· 112 114 } 113 115 114 116 do { 115 - /* 116 - * to_process: the SHA256_BLOCK_SIZE data chunk to process in 117 - * this update. This value is also restricted by the sg list 118 - * limits. 119 - */ 120 - to_process = total - to_process; 121 - to_process = to_process & ~(SHA256_BLOCK_SIZE - 1); 117 + int used_sgs = 0; 118 + struct nx_sg *in_sg = nx_ctx->in_sg; 122 119 123 120 if (buf_len) { 124 121 data_len = buf_len; 125 - in_sg = nx_build_sg_list(nx_ctx->in_sg, 122 + in_sg = nx_build_sg_list(in_sg, 126 123 (u8 *) sctx->buf, 127 124 &data_len, 128 125 max_sg_len); ··· 126 133 rc = -EINVAL; 127 134 goto out; 128 135 } 136 + used_sgs = in_sg - nx_ctx->in_sg; 129 137 } 138 + 139 + /* to_process: SHA256_BLOCK_SIZE aligned chunk to be 140 + * processed in this iteration. This value is restricted 141 + * by sg list limits and number of sgs we already used 142 + * for leftover data. (see above) 143 + * In ideal case, we could allow NX_PAGE_SIZE * max_sg_len, 144 + * but because data may not be aligned, we need to account 145 + * for that too. */ 146 + to_process = min_t(u64, total, 147 + (max_sg_len - 1 - used_sgs) * NX_PAGE_SIZE); 148 + to_process = to_process & ~(SHA256_BLOCK_SIZE - 1); 130 149 131 150 data_len = to_process - buf_len; 132 151 in_sg = nx_build_sg_list(in_sg, (u8 *) data, ··· 146 141 147 142 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); 148 143 149 - to_process = (data_len + buf_len); 144 + to_process = data_len + buf_len; 150 145 leftover = total - to_process; 151 146 152 147 /*
+16 -12
drivers/crypto/nx/nx-sha512.c
··· 71 71 struct sha512_state *sctx = shash_desc_ctx(desc); 72 72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); 73 73 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; 74 - struct nx_sg *in_sg; 75 74 struct nx_sg *out_sg; 76 75 u64 to_process, leftover = 0, total; 77 76 unsigned long irq_flags; ··· 96 97 NX_CPB_FDM(csbcpb) |= NX_FDM_INTERMEDIATE; 97 98 NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; 98 99 99 - in_sg = nx_ctx->in_sg; 100 100 max_sg_len = min_t(u64, nx_ctx->ap->sglen, 101 101 nx_driver.of.max_sg_len/sizeof(struct nx_sg)); 102 102 max_sg_len = min_t(u64, max_sg_len, ··· 112 114 } 113 115 114 116 do { 115 - /* 116 - * to_process: the SHA512_BLOCK_SIZE data chunk to process in 117 - * this update. This value is also restricted by the sg list 118 - * limits. 119 - */ 120 - to_process = total - leftover; 121 - to_process = to_process & ~(SHA512_BLOCK_SIZE - 1); 122 - leftover = total - to_process; 117 + int used_sgs = 0; 118 + struct nx_sg *in_sg = nx_ctx->in_sg; 123 119 124 120 if (buf_len) { 125 121 data_len = buf_len; 126 - in_sg = nx_build_sg_list(nx_ctx->in_sg, 122 + in_sg = nx_build_sg_list(in_sg, 127 123 (u8 *) sctx->buf, 128 124 &data_len, max_sg_len); 129 125 ··· 125 133 rc = -EINVAL; 126 134 goto out; 127 135 } 136 + used_sgs = in_sg - nx_ctx->in_sg; 128 137 } 138 + 139 + /* to_process: SHA512_BLOCK_SIZE aligned chunk to be 140 + * processed in this iteration. This value is restricted 141 + * by sg list limits and number of sgs we already used 142 + * for leftover data. (see above) 143 + * In ideal case, we could allow NX_PAGE_SIZE * max_sg_len, 144 + * but because data may not be aligned, we need to account 145 + * for that too. */ 146 + to_process = min_t(u64, total, 147 + (max_sg_len - 1 - used_sgs) * NX_PAGE_SIZE); 148 + to_process = to_process & ~(SHA512_BLOCK_SIZE - 1); 129 149 130 150 data_len = to_process - buf_len; 131 151 in_sg = nx_build_sg_list(in_sg, (u8 *) data, ··· 150 146 goto out; 151 147 } 152 148 153 - to_process = (data_len + buf_len); 149 + to_process = data_len + buf_len; 154 150 leftover = total - to_process; 155 151 156 152 /*
+4
drivers/dma/dmaengine.c
··· 689 689 struct dma_chan *ch = dma_request_slave_channel_reason(dev, name); 690 690 if (IS_ERR(ch)) 691 691 return NULL; 692 + 693 + dma_cap_set(DMA_PRIVATE, ch->device->cap_mask); 694 + ch->device->privatecnt++; 695 + 692 696 return ch; 693 697 } 694 698 EXPORT_SYMBOL_GPL(dma_request_slave_channel);
+13 -6
drivers/gpu/drm/drm_dp_mst_topology.c
··· 873 873 from an EDID retrieval */ 874 874 if (port->connector) { 875 875 mutex_lock(&mgr->destroy_connector_lock); 876 - list_add(&port->connector->destroy_list, &mgr->destroy_connector_list); 876 + list_add(&port->next, &mgr->destroy_connector_list); 877 877 mutex_unlock(&mgr->destroy_connector_lock); 878 878 schedule_work(&mgr->destroy_connector_work); 879 + return; 879 880 } 880 881 drm_dp_port_teardown_pdt(port, port->pdt); 881 882 ··· 2660 2659 static void drm_dp_destroy_connector_work(struct work_struct *work) 2661 2660 { 2662 2661 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, destroy_connector_work); 2663 - struct drm_connector *connector; 2662 + struct drm_dp_mst_port *port; 2664 2663 2665 2664 /* 2666 2665 * Not a regular list traverse as we have to drop the destroy ··· 2669 2668 */ 2670 2669 for (;;) { 2671 2670 mutex_lock(&mgr->destroy_connector_lock); 2672 - connector = list_first_entry_or_null(&mgr->destroy_connector_list, struct drm_connector, destroy_list); 2673 - if (!connector) { 2671 + port = list_first_entry_or_null(&mgr->destroy_connector_list, struct drm_dp_mst_port, next); 2672 + if (!port) { 2674 2673 mutex_unlock(&mgr->destroy_connector_lock); 2675 2674 break; 2676 2675 } 2677 - list_del(&connector->destroy_list); 2676 + list_del(&port->next); 2678 2677 mutex_unlock(&mgr->destroy_connector_lock); 2679 2678 2680 - mgr->cbs->destroy_connector(mgr, connector); 2679 + mgr->cbs->destroy_connector(mgr, port->connector); 2680 + 2681 + drm_dp_port_teardown_pdt(port, port->pdt); 2682 + 2683 + if (!port->input && port->vcpi.vcpi > 0) 2684 + drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi); 2685 + kfree(port); 2681 2686 } 2682 2687 } 2683 2688
-1
drivers/gpu/drm/exynos/exynos_drm_fimc.c
··· 1745 1745 spin_lock_init(&ctx->lock); 1746 1746 platform_set_drvdata(pdev, ctx); 1747 1747 1748 - pm_runtime_set_active(dev); 1749 1748 pm_runtime_enable(dev); 1750 1749 1751 1750 ret = exynos_drm_ippdrv_register(ippdrv);
+2 -4
drivers/gpu/drm/exynos/exynos_drm_gsc.c
··· 593 593 594 594 gsc_write(cfg, GSC_IN_CON); 595 595 596 - ctx->rotation = cfg & 597 - (GSC_IN_ROT_90 | GSC_IN_ROT_270) ? 1 : 0; 596 + ctx->rotation = (cfg & GSC_IN_ROT_90) ? 1 : 0; 598 597 *swap = ctx->rotation; 599 598 600 599 return 0; ··· 856 857 857 858 gsc_write(cfg, GSC_IN_CON); 858 859 859 - ctx->rotation = cfg & 860 - (GSC_IN_ROT_90 | GSC_IN_ROT_270) ? 1 : 0; 860 + ctx->rotation = (cfg & GSC_IN_ROT_90) ? 1 : 0; 861 861 *swap = ctx->rotation; 862 862 863 863 return 0;
+6 -1
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 1064 1064 { 1065 1065 struct hdmi_context *hdata = ctx_from_connector(connector); 1066 1066 struct edid *edid; 1067 + int ret; 1067 1068 1068 1069 if (!hdata->ddc_adpt) 1069 1070 return -ENODEV; ··· 1080 1079 1081 1080 drm_mode_connector_update_edid_property(connector, edid); 1082 1081 1083 - return drm_add_edid_modes(connector, edid); 1082 + ret = drm_add_edid_modes(connector, edid); 1083 + 1084 + kfree(edid); 1085 + 1086 + return ret; 1084 1087 } 1085 1088 1086 1089 static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
+14 -7
drivers/gpu/drm/exynos/exynos_mixer.c
··· 718 718 719 719 /* handling VSYNC */ 720 720 if (val & MXR_INT_STATUS_VSYNC) { 721 + /* vsync interrupt use different bit for read and clear */ 722 + val |= MXR_INT_CLEAR_VSYNC; 723 + val &= ~MXR_INT_STATUS_VSYNC; 724 + 721 725 /* interlace scan need to check shadow register */ 722 726 if (ctx->interlace) { 723 727 base = mixer_reg_read(res, MXR_GRAPHIC_BASE(0)); ··· 747 743 748 744 out: 749 745 /* clear interrupts */ 750 - if (~val & MXR_INT_EN_VSYNC) { 751 - /* vsync interrupt use different bit for read and clear */ 752 - val &= ~MXR_INT_EN_VSYNC; 753 - val |= MXR_INT_CLEAR_VSYNC; 754 - } 755 746 mixer_reg_write(res, MXR_INT_STATUS, val); 756 747 757 748 spin_unlock(&res->reg_slock); ··· 906 907 } 907 908 908 909 /* enable vsync interrupt */ 909 - mixer_reg_writemask(res, MXR_INT_EN, MXR_INT_EN_VSYNC, 910 - MXR_INT_EN_VSYNC); 910 + mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); 911 + mixer_reg_writemask(res, MXR_INT_EN, ~0, MXR_INT_EN_VSYNC); 911 912 912 913 return 0; 913 914 } ··· 917 918 struct mixer_context *mixer_ctx = crtc->ctx; 918 919 struct mixer_resources *res = &mixer_ctx->mixer_res; 919 920 921 + if (!mixer_ctx->powered) { 922 + mixer_ctx->int_en &= MXR_INT_EN_VSYNC; 923 + return; 924 + } 925 + 920 926 /* disable vsync interrupt */ 927 + mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); 921 928 mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); 922 929 } 923 930 ··· 1052 1047 1053 1048 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET); 1054 1049 1050 + if (ctx->int_en & MXR_INT_EN_VSYNC) 1051 + mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC); 1055 1052 mixer_reg_write(res, MXR_INT_EN, ctx->int_en); 1056 1053 mixer_win_reset(ctx); 1057 1054 }
+8 -37
drivers/gpu/drm/i915/intel_atomic.c
··· 129 129 struct drm_atomic_state *state, 130 130 bool async) 131 131 { 132 - int ret; 133 - int i; 132 + struct drm_crtc_state *crtc_state; 133 + struct drm_crtc *crtc; 134 + int ret, i; 134 135 135 136 if (async) { 136 137 DRM_DEBUG_KMS("i915 does not yet support async commit\n"); ··· 143 142 return ret; 144 143 145 144 /* Point of no return */ 146 - 147 - /* 148 - * FIXME: The proper sequence here will eventually be: 149 - * 150 - * drm_atomic_helper_swap_state(dev, state) 151 - * drm_atomic_helper_commit_modeset_disables(dev, state); 152 - * drm_atomic_helper_commit_planes(dev, state); 153 - * drm_atomic_helper_commit_modeset_enables(dev, state); 154 - * drm_atomic_helper_wait_for_vblanks(dev, state); 155 - * drm_atomic_helper_cleanup_planes(dev, state); 156 - * drm_atomic_state_free(state); 157 - * 158 - * once we have full atomic modeset. For now, just manually update 159 - * plane states to avoid clobbering good states with dummy states 160 - * while nuclear pageflipping. 161 - */ 162 - for (i = 0; i < dev->mode_config.num_total_plane; i++) { 163 - struct drm_plane *plane = state->planes[i]; 164 - 165 - if (!plane) 166 - continue; 167 - 168 - plane->state->state = state; 169 - swap(state->plane_states[i], plane->state); 170 - plane->state->state = NULL; 171 - } 145 + drm_atomic_helper_swap_state(dev, state); 172 146 173 147 /* swap crtc_scaler_state */ 174 - for (i = 0; i < dev->mode_config.num_crtc; i++) { 175 - struct drm_crtc *crtc = state->crtcs[i]; 176 - if (!crtc) { 177 - continue; 178 - } 179 - 180 - to_intel_crtc(crtc)->config->scaler_state = 181 - to_intel_crtc_state(state->crtc_states[i])->scaler_state; 148 + for_each_crtc_in_state(state, crtc, crtc_state, i) { 149 + to_intel_crtc(crtc)->config = to_intel_crtc_state(crtc->state); 182 150 183 151 if (INTEL_INFO(dev)->gen >= 9) 184 152 skl_detach_scalers(to_intel_crtc(crtc)); 153 + 154 + drm_atomic_helper_commit_planes_on_crtc(crtc_state); 185 155 } 186 156 187 - drm_atomic_helper_commit_planes(dev, state); 188 157 drm_atomic_helper_wait_for_vblanks(dev, state); 189 158 drm_atomic_helper_cleanup_planes(dev, state); 190 159 drm_atomic_state_free(state);
+15 -44
drivers/gpu/drm/i915/intel_display.c
··· 11826 11826 goto encoder_retry; 11827 11827 } 11828 11828 11829 - pipe_config->dither = pipe_config->pipe_bpp != base_bpp; 11829 + /* Dithering seems to not pass-through bits correctly when it should, so 11830 + * only enable it on 6bpc panels. */ 11831 + pipe_config->dither = pipe_config->pipe_bpp == 6*3; 11830 11832 DRM_DEBUG_KMS("plane bpp: %i, pipe bpp: %i, dithering: %i\n", 11831 11833 base_bpp, pipe_config->pipe_bpp, pipe_config->dither); 11832 11834 ··· 12626 12624 12627 12625 modeset_update_crtc_power_domains(state); 12628 12626 12629 - drm_atomic_helper_commit_planes(dev, state); 12630 - 12631 12627 /* Now enable the clocks, plane, pipe, and connectors that we set up. */ 12632 12628 for_each_crtc_in_state(state, crtc, crtc_state, i) { 12633 - if (!needs_modeset(crtc->state) || !crtc->state->enable) 12629 + if (!needs_modeset(crtc->state) || !crtc->state->enable) { 12630 + drm_atomic_helper_commit_planes_on_crtc(crtc_state); 12634 12631 continue; 12632 + } 12635 12633 12636 12634 update_scanline_offset(to_intel_crtc(crtc)); 12637 12635 12638 12636 dev_priv->display.crtc_enable(crtc); 12639 - intel_crtc_enable_planes(crtc); 12637 + drm_atomic_helper_commit_planes_on_crtc(crtc_state); 12640 12638 } 12641 12639 12642 12640 /* FIXME: add subpixel order */ ··· 12893 12891 return 0; 12894 12892 } 12895 12893 12896 - static bool primary_plane_visible(struct drm_crtc *crtc) 12897 - { 12898 - struct intel_plane_state *plane_state = 12899 - to_intel_plane_state(crtc->primary->state); 12900 - 12901 - return plane_state->visible; 12902 - } 12903 - 12904 12894 static int intel_crtc_set_config(struct drm_mode_set *set) 12905 12895 { 12906 12896 struct drm_device *dev; 12907 12897 struct drm_atomic_state *state = NULL; 12908 12898 struct intel_crtc_state *pipe_config; 12909 - bool primary_plane_was_visible; 12910 12899 int ret; 12911 12900 12912 12901 BUG_ON(!set); ··· 12936 12943 12937 12944 intel_update_pipe_size(to_intel_crtc(set->crtc)); 12938 12945 12939 - primary_plane_was_visible = primary_plane_visible(set->crtc); 12940 - 12941 12946 ret = intel_set_mode_with_config(set->crtc, pipe_config, true); 12942 - 12943 - if (ret == 0 && 12944 - pipe_config->base.enable && 12945 - pipe_config->base.planes_changed && 12946 - !needs_modeset(&pipe_config->base)) { 12947 - struct intel_crtc *intel_crtc = to_intel_crtc(set->crtc); 12948 - 12949 - /* 12950 - * We need to make sure the primary plane is re-enabled if it 12951 - * has previously been turned off. 12952 - */ 12953 - if (ret == 0 && !primary_plane_was_visible && 12954 - primary_plane_visible(set->crtc)) { 12955 - WARN_ON(!intel_crtc->active); 12956 - intel_post_enable_primary(set->crtc); 12957 - } 12958 - 12959 - /* 12960 - * In the fastboot case this may be our only check of the 12961 - * state after boot. It would be better to only do it on 12962 - * the first update, but we don't have a nice way of doing that 12963 - * (and really, set_config isn't used much for high freq page 12964 - * flipping, so increasing its cost here shouldn't be a big 12965 - * deal). 12966 - */ 12967 - if (i915.fastboot && ret == 0) 12968 - intel_modeset_check_state(set->crtc->dev); 12969 - } 12970 12947 12971 12948 if (ret) { 12972 12949 DRM_DEBUG_KMS("failed to set mode on [CRTC:%d], err = %d\n", ··· 13268 13305 */ 13269 13306 if (IS_BROADWELL(dev)) 13270 13307 intel_crtc->atomic.wait_vblank = true; 13308 + 13309 + if (crtc_state) 13310 + intel_crtc->atomic.post_enable_primary = true; 13271 13311 } 13272 13312 13273 13313 /* ··· 13282 13316 */ 13283 13317 if (!state->visible || !fb) 13284 13318 intel_crtc->atomic.disable_ips = true; 13319 + 13320 + if (!state->visible && old_state->visible && 13321 + crtc_state && !needs_modeset(&crtc_state->base)) 13322 + intel_crtc->atomic.pre_disable_primary = true; 13285 13323 13286 13324 intel_crtc->atomic.fb_bits |= 13287 13325 INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe); ··· 15004 15034 struct intel_plane_state *plane_state; 15005 15035 15006 15036 memset(crtc->config, 0, sizeof(*crtc->config)); 15037 + crtc->config->base.crtc = &crtc->base; 15007 15038 15008 15039 crtc->config->quirks |= PIPE_CONFIG_QUIRK_INHERITED_MODE; 15009 15040
+8 -21
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
··· 166 166 } 167 167 168 168 static int 169 - gk104_fifo_chan_kick(struct gk104_fifo_chan *chan) 170 - { 171 - struct nvkm_object *obj = (void *)chan; 172 - struct gk104_fifo_priv *priv = (void *)obj->engine; 173 - 174 - nv_wr32(priv, 0x002634, chan->base.chid); 175 - if (!nv_wait(priv, 0x002634, 0x100000, 0x000000)) { 176 - nv_error(priv, "channel %d [%s] kick timeout\n", 177 - chan->base.chid, nvkm_client_name(chan)); 178 - return -EBUSY; 179 - } 180 - 181 - return 0; 182 - } 183 - 184 - static int 185 169 gk104_fifo_context_detach(struct nvkm_object *parent, bool suspend, 186 170 struct nvkm_object *object) 187 171 { 188 172 struct nvkm_bar *bar = nvkm_bar(parent); 173 + struct gk104_fifo_priv *priv = (void *)parent->engine; 189 174 struct gk104_fifo_base *base = (void *)parent->parent; 190 175 struct gk104_fifo_chan *chan = (void *)parent; 191 176 u32 addr; 192 - int ret; 193 177 194 178 switch (nv_engidx(object->engine)) { 195 179 case NVDEV_ENGINE_SW : return 0; ··· 188 204 return -EINVAL; 189 205 } 190 206 191 - ret = gk104_fifo_chan_kick(chan); 192 - if (ret && suspend) 193 - return ret; 207 + nv_wr32(priv, 0x002634, chan->base.chid); 208 + if (!nv_wait(priv, 0x002634, 0xffffffff, chan->base.chid)) { 209 + nv_error(priv, "channel %d [%s] kick timeout\n", 210 + chan->base.chid, nvkm_client_name(chan)); 211 + if (suspend) 212 + return -EBUSY; 213 + } 194 214 195 215 if (addr) { 196 216 nv_wo32(base, addr + 0x00, 0x00000000); ··· 319 331 gk104_fifo_runlist_update(priv, chan->engine); 320 332 } 321 333 322 - gk104_fifo_chan_kick(chan); 323 334 nv_wr32(priv, 0x800000 + (chid * 8), 0x00000000); 324 335 return nvkm_fifo_channel_fini(&chan->base, suspend); 325 336 }
+2 -2
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 2492 2492 ret = ttm_eu_reserve_buffers(&ticket, &sw_context->validate_nodes, 2493 2493 true, NULL); 2494 2494 if (unlikely(ret != 0)) 2495 - goto out_err; 2495 + goto out_err_nores; 2496 2496 2497 2497 ret = vmw_validate_buffers(dev_priv, sw_context); 2498 2498 if (unlikely(ret != 0)) ··· 2536 2536 vmw_resource_relocations_free(&sw_context->res_relocations); 2537 2537 2538 2538 vmw_fifo_commit(dev_priv, command_size); 2539 + mutex_unlock(&dev_priv->binding_mutex); 2539 2540 2540 2541 vmw_query_bo_switch_commit(dev_priv, sw_context); 2541 2542 ret = vmw_execbuf_fence_commands(file_priv, dev_priv, ··· 2552 2551 DRM_ERROR("Fence submission error. Syncing.\n"); 2553 2552 2554 2553 vmw_resource_list_unreserve(&sw_context->resource_list, false); 2555 - mutex_unlock(&dev_priv->binding_mutex); 2556 2554 2557 2555 ttm_eu_fence_buffer_objects(&ticket, &sw_context->validate_nodes, 2558 2556 (void *) fence);
+1 -1
drivers/infiniband/hw/cxgb4/cq.c
··· 814 814 printk(KERN_ERR MOD 815 815 "Unexpected cqe_status 0x%x for QPID=0x%0x\n", 816 816 CQE_STATUS(&cqe), CQE_QPID(&cqe)); 817 - ret = -EINVAL; 817 + wc->status = IB_WC_FATAL_ERR; 818 818 } 819 819 } 820 820 out:
+6
drivers/memory/omap-gpmc.c
··· 2245 2245 { 2246 2246 int i; 2247 2247 2248 + if (!gpmc_base) 2249 + return; 2250 + 2248 2251 gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG); 2249 2252 gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE); 2250 2253 gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL); ··· 2279 2276 void omap3_gpmc_restore_context(void) 2280 2277 { 2281 2278 int i; 2279 + 2280 + if (!gpmc_base) 2281 + return; 2282 2282 2283 2283 gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig); 2284 2284 gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable);
+2 -2
drivers/net/ethernet/emulex/benet/be_main.c
··· 5173 5173 struct device *dev = &adapter->pdev->dev; 5174 5174 int status; 5175 5175 5176 - if (lancer_chip(adapter) || BEx_chip(adapter)) 5176 + if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter)) 5177 5177 return; 5178 5178 5179 5179 if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) { ··· 5220 5220 { 5221 5221 struct be_adapter *adapter = netdev_priv(netdev); 5222 5222 5223 - if (lancer_chip(adapter) || BEx_chip(adapter)) 5223 + if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter)) 5224 5224 return; 5225 5225 5226 5226 if (adapter->vxlan_port != port)
+5
drivers/net/ethernet/freescale/gianfar.c
··· 2067 2067 /* Start Rx/Tx DMA and enable the interrupts */ 2068 2068 gfar_start(priv); 2069 2069 2070 + /* force link state update after mac reset */ 2071 + priv->oldlink = 0; 2072 + priv->oldspeed = 0; 2073 + priv->oldduplex = -1; 2074 + 2070 2075 phy_start(priv->phydev); 2071 2076 2072 2077 enable_napi(priv);
+2 -3
drivers/net/ethernet/micrel/ks8842.c
··· 952 952 953 953 sg_dma_address(&tx_ctl->sg) = dma_map_single(adapter->dev, 954 954 tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE); 955 - err = dma_mapping_error(adapter->dev, 956 - sg_dma_address(&tx_ctl->sg)); 957 - if (err) { 955 + if (dma_mapping_error(adapter->dev, sg_dma_address(&tx_ctl->sg))) { 956 + err = -ENOMEM; 958 957 sg_dma_address(&tx_ctl->sg) = 0; 959 958 goto err; 960 959 }
+12 -4
drivers/net/phy/phy.c
··· 814 814 bool needs_aneg = false, do_suspend = false; 815 815 enum phy_state old_state; 816 816 int err = 0; 817 + int old_link; 817 818 818 819 mutex_lock(&phydev->lock); 819 820 ··· 900 899 phydev->adjust_link(phydev->attached_dev); 901 900 break; 902 901 case PHY_RUNNING: 903 - /* Only register a CHANGE if we are 904 - * polling or ignoring interrupts 902 + /* Only register a CHANGE if we are polling or ignoring 903 + * interrupts and link changed since latest checking. 905 904 */ 906 - if (!phy_interrupt_is_valid(phydev)) 907 - phydev->state = PHY_CHANGELINK; 905 + if (!phy_interrupt_is_valid(phydev)) { 906 + old_link = phydev->link; 907 + err = phy_read_status(phydev); 908 + if (err) 909 + break; 910 + 911 + if (old_link != phydev->link) 912 + phydev->state = PHY_CHANGELINK; 913 + } 908 914 break; 909 915 case PHY_CHANGELINK: 910 916 err = phy_read_status(phydev);
+19 -12
drivers/net/phy/smsc.c
··· 91 91 } 92 92 93 93 /* 94 - * The LAN8710/LAN8720 requires a minimum of 2 link pulses within 64ms of each 95 - * other in order to set the ENERGYON bit and exit EDPD mode. If a link partner 96 - * does send the pulses within this interval, the PHY will remained powered 97 - * down. 98 - * 99 - * This workaround will manually toggle the PHY on/off upon calls to read_status 100 - * in order to generate link test pulses if the link is down. If a link partner 101 - * is present, it will respond to the pulses, which will cause the ENERGYON bit 102 - * to be set and will cause the EDPD mode to be exited. 94 + * The LAN87xx suffers from rare absence of the ENERGYON-bit when Ethernet cable 95 + * plugs in while LAN87xx is in Energy Detect Power-Down mode. This leads to 96 + * unstable detection of plugging in Ethernet cable. 97 + * This workaround disables Energy Detect Power-Down mode and waiting for 98 + * response on link pulses to detect presence of plugged Ethernet cable. 99 + * The Energy Detect Power-Down mode is enabled again in the end of procedure to 100 + * save approximately 220 mW of power if cable is unplugged. 103 101 */ 104 102 static int lan87xx_read_status(struct phy_device *phydev) 105 103 { 106 104 int err = genphy_read_status(phydev); 105 + int i; 107 106 108 107 if (!phydev->link) { 109 108 /* Disable EDPD to wake up PHY */ ··· 115 116 if (rc < 0) 116 117 return rc; 117 118 118 - /* Sleep 64 ms to allow ~5 link test pulses to be sent */ 119 - msleep(64); 119 + /* Wait max 640 ms to detect energy */ 120 + for (i = 0; i < 64; i++) { 121 + /* Sleep to allow link test pulses to be sent */ 122 + msleep(10); 123 + rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); 124 + if (rc < 0) 125 + return rc; 126 + if (rc & MII_LAN83C185_ENERGYON) 127 + break; 128 + } 120 129 121 130 /* Re-enable EDPD */ 122 131 rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); ··· 198 191 199 192 /* basic functions */ 200 193 .config_aneg = genphy_config_aneg, 201 - .read_status = genphy_read_status, 194 + .read_status = lan87xx_read_status, 202 195 .config_init = smsc_phy_config_init, 203 196 .soft_reset = smsc_phy_reset, 204 197
+42 -36
drivers/net/ppp/ppp_generic.c
··· 269 269 static void ppp_ccp_closed(struct ppp *ppp); 270 270 static struct compressor *find_compressor(int type); 271 271 static void ppp_get_stats(struct ppp *ppp, struct ppp_stats *st); 272 - static struct ppp *ppp_create_interface(struct net *net, int unit, int *retp); 272 + static struct ppp *ppp_create_interface(struct net *net, int unit, 273 + struct file *file, int *retp); 273 274 static void init_ppp_file(struct ppp_file *pf, int kind); 274 - static void ppp_shutdown_interface(struct ppp *ppp); 275 275 static void ppp_destroy_interface(struct ppp *ppp); 276 276 static struct ppp *ppp_find_unit(struct ppp_net *pn, int unit); 277 277 static struct channel *ppp_find_channel(struct ppp_net *pn, int unit); ··· 392 392 file->private_data = NULL; 393 393 if (pf->kind == INTERFACE) { 394 394 ppp = PF_TO_PPP(pf); 395 + rtnl_lock(); 395 396 if (file == ppp->owner) 396 - ppp_shutdown_interface(ppp); 397 + unregister_netdevice(ppp->dev); 398 + rtnl_unlock(); 397 399 } 398 400 if (atomic_dec_and_test(&pf->refcnt)) { 399 401 switch (pf->kind) { ··· 595 593 mutex_lock(&ppp_mutex); 596 594 if (pf->kind == INTERFACE) { 597 595 ppp = PF_TO_PPP(pf); 596 + rtnl_lock(); 598 597 if (file == ppp->owner) 599 - ppp_shutdown_interface(ppp); 598 + unregister_netdevice(ppp->dev); 599 + rtnl_unlock(); 600 600 } 601 601 if (atomic_long_read(&file->f_count) < 2) { 602 602 ppp_release(NULL, file); ··· 842 838 /* Create a new ppp unit */ 843 839 if (get_user(unit, p)) 844 840 break; 845 - ppp = ppp_create_interface(net, unit, &err); 841 + ppp = ppp_create_interface(net, unit, file, &err); 846 842 if (!ppp) 847 843 break; 848 844 file->private_data = &ppp->file; 849 - ppp->owner = file; 850 845 err = -EFAULT; 851 846 if (put_user(ppp->file.index, p)) 852 847 break; ··· 919 916 static __net_exit void ppp_exit_net(struct net *net) 920 917 { 921 918 struct ppp_net *pn = net_generic(net, ppp_net_id); 919 + struct ppp *ppp; 920 + LIST_HEAD(list); 921 + int id; 922 + 923 + rtnl_lock(); 924 + idr_for_each_entry(&pn->units_idr, ppp, id) 925 + unregister_netdevice_queue(ppp->dev, &list); 926 + 927 + unregister_netdevice_many(&list); 928 + rtnl_unlock(); 922 929 923 930 idr_destroy(&pn->units_idr); 924 931 } ··· 1101 1088 return 0; 1102 1089 } 1103 1090 1091 + static void ppp_dev_uninit(struct net_device *dev) 1092 + { 1093 + struct ppp *ppp = netdev_priv(dev); 1094 + struct ppp_net *pn = ppp_pernet(ppp->ppp_net); 1095 + 1096 + ppp_lock(ppp); 1097 + ppp->closing = 1; 1098 + ppp_unlock(ppp); 1099 + 1100 + mutex_lock(&pn->all_ppp_mutex); 1101 + unit_put(&pn->units_idr, ppp->file.index); 1102 + mutex_unlock(&pn->all_ppp_mutex); 1103 + 1104 + ppp->owner = NULL; 1105 + 1106 + ppp->file.dead = 1; 1107 + wake_up_interruptible(&ppp->file.rwait); 1108 + } 1109 + 1104 1110 static const struct net_device_ops ppp_netdev_ops = { 1105 1111 .ndo_init = ppp_dev_init, 1112 + .ndo_uninit = ppp_dev_uninit, 1106 1113 .ndo_start_xmit = ppp_start_xmit, 1107 1114 .ndo_do_ioctl = ppp_net_ioctl, 1108 1115 .ndo_get_stats64 = ppp_get_stats64, ··· 2700 2667 * or if there is already a unit with the requested number. 2701 2668 * unit == -1 means allocate a new number. 2702 2669 */ 2703 - static struct ppp * 2704 - ppp_create_interface(struct net *net, int unit, int *retp) 2670 + static struct ppp *ppp_create_interface(struct net *net, int unit, 2671 + struct file *file, int *retp) 2705 2672 { 2706 2673 struct ppp *ppp; 2707 2674 struct ppp_net *pn; ··· 2721 2688 ppp->mru = PPP_MRU; 2722 2689 init_ppp_file(&ppp->file, INTERFACE); 2723 2690 ppp->file.hdrlen = PPP_HDRLEN - 2; /* don't count proto bytes */ 2691 + ppp->owner = file; 2724 2692 for (i = 0; i < NUM_NP; ++i) 2725 2693 ppp->npmode[i] = NPMODE_PASS; 2726 2694 INIT_LIST_HEAD(&ppp->channels); ··· 2807 2773 skb_queue_head_init(&pf->rq); 2808 2774 atomic_set(&pf->refcnt, 1); 2809 2775 init_waitqueue_head(&pf->rwait); 2810 - } 2811 - 2812 - /* 2813 - * Take down a ppp interface unit - called when the owning file 2814 - * (the one that created the unit) is closed or detached. 2815 - */ 2816 - static void ppp_shutdown_interface(struct ppp *ppp) 2817 - { 2818 - struct ppp_net *pn; 2819 - 2820 - pn = ppp_pernet(ppp->ppp_net); 2821 - mutex_lock(&pn->all_ppp_mutex); 2822 - 2823 - /* This will call dev_close() for us. */ 2824 - ppp_lock(ppp); 2825 - if (!ppp->closing) { 2826 - ppp->closing = 1; 2827 - ppp_unlock(ppp); 2828 - unregister_netdev(ppp->dev); 2829 - unit_put(&pn->units_idr, ppp->file.index); 2830 - } else 2831 - ppp_unlock(ppp); 2832 - 2833 - ppp->file.dead = 1; 2834 - ppp->owner = NULL; 2835 - wake_up_interruptible(&ppp->file.rwait); 2836 - 2837 - mutex_unlock(&pn->all_ppp_mutex); 2838 2776 } 2839 2777 2840 2778 /*
+1
drivers/net/usb/qmi_wwan.c
··· 786 786 {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */ 787 787 {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ 788 788 {QMI_FIXED_INTF(0x413c, 0x81b1, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */ 789 + {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ 789 790 {QMI_FIXED_INTF(0x03f0, 0x581d, 4)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */ 790 791 791 792 /* 4. Gobi 1000 devices */
+4 -4
drivers/scsi/libfc/fc_exch.c
··· 733 733 if (resp) { 734 734 resp(sp, fp, arg); 735 735 res = true; 736 - } else if (!IS_ERR(fp)) { 737 - fc_frame_free(fp); 738 736 } 739 737 740 738 spin_lock_bh(&ep->ex_lock); ··· 1594 1596 * If new exch resp handler is valid then call that 1595 1597 * first. 1596 1598 */ 1597 - fc_invoke_resp(ep, sp, fp); 1599 + if (!fc_invoke_resp(ep, sp, fp)) 1600 + fc_frame_free(fp); 1598 1601 1599 1602 fc_exch_release(ep); 1600 1603 return; ··· 1694 1695 fc_exch_hold(ep); 1695 1696 if (!rc) 1696 1697 fc_exch_delete(ep); 1697 - fc_invoke_resp(ep, sp, fp); 1698 + if (!fc_invoke_resp(ep, sp, fp)) 1699 + fc_frame_free(fp); 1698 1700 if (has_rec) 1699 1701 fc_exch_timer_set(ep, ep->r_a_tov); 1700 1702 fc_exch_release(ep);
+17 -2
drivers/scsi/libfc/fc_fcp.c
··· 1039 1039 fc_fcp_pkt_hold(fsp); 1040 1040 spin_unlock_irqrestore(&si->scsi_queue_lock, flags); 1041 1041 1042 - if (!fc_fcp_lock_pkt(fsp)) { 1042 + spin_lock_bh(&fsp->scsi_pkt_lock); 1043 + if (!(fsp->state & FC_SRB_COMPL)) { 1044 + fsp->state |= FC_SRB_COMPL; 1045 + /* 1046 + * TODO: dropping scsi_pkt_lock and then reacquiring 1047 + * again around fc_fcp_cleanup_cmd() is required, 1048 + * since fc_fcp_cleanup_cmd() calls into 1049 + * fc_seq_set_resp() and that func preempts cpu using 1050 + * schedule. May be schedule and related code should be 1051 + * removed instead of unlocking here to avoid scheduling 1052 + * while atomic bug. 1053 + */ 1054 + spin_unlock_bh(&fsp->scsi_pkt_lock); 1055 + 1043 1056 fc_fcp_cleanup_cmd(fsp, error); 1057 + 1058 + spin_lock_bh(&fsp->scsi_pkt_lock); 1044 1059 fc_io_compl(fsp); 1045 - fc_fcp_unlock_pkt(fsp); 1046 1060 } 1061 + spin_unlock_bh(&fsp->scsi_pkt_lock); 1047 1062 1048 1063 fc_fcp_pkt_release(fsp); 1049 1064 spin_lock_irqsave(&si->scsi_queue_lock, flags);
+2 -23
drivers/scsi/libiscsi.c
··· 2941 2941 { 2942 2942 struct iscsi_conn *conn = cls_conn->dd_data; 2943 2943 struct iscsi_session *session = conn->session; 2944 - unsigned long flags; 2945 2944 2946 2945 del_timer_sync(&conn->transport_timer); 2947 2946 2947 + mutex_lock(&session->eh_mutex); 2948 2948 spin_lock_bh(&session->frwd_lock); 2949 2949 conn->c_stage = ISCSI_CONN_CLEANUP_WAIT; 2950 2950 if (session->leadconn == conn) { ··· 2955 2955 wake_up(&conn->ehwait); 2956 2956 } 2957 2957 spin_unlock_bh(&session->frwd_lock); 2958 - 2959 - /* 2960 - * Block until all in-progress commands for this connection 2961 - * time out or fail. 2962 - */ 2963 - for (;;) { 2964 - spin_lock_irqsave(session->host->host_lock, flags); 2965 - if (!atomic_read(&session->host->host_busy)) { /* OK for ERL == 0 */ 2966 - spin_unlock_irqrestore(session->host->host_lock, flags); 2967 - break; 2968 - } 2969 - spin_unlock_irqrestore(session->host->host_lock, flags); 2970 - msleep_interruptible(500); 2971 - iscsi_conn_printk(KERN_INFO, conn, "iscsi conn_destroy(): " 2972 - "host_busy %d host_failed %d\n", 2973 - atomic_read(&session->host->host_busy), 2974 - session->host->host_failed); 2975 - /* 2976 - * force eh_abort() to unblock 2977 - */ 2978 - wake_up(&conn->ehwait); 2979 - } 2980 2958 2981 2959 /* flush queued up work because we free the connection below */ 2982 2960 iscsi_suspend_tx(conn); ··· 2972 2994 if (session->leadconn == conn) 2973 2995 session->leadconn = NULL; 2974 2996 spin_unlock_bh(&session->frwd_lock); 2997 + mutex_unlock(&session->eh_mutex); 2975 2998 2976 2999 iscsi_destroy_conn(cls_conn); 2977 3000 }
-31
drivers/scsi/scsi_error.c
··· 26 26 #include <linux/blkdev.h> 27 27 #include <linux/delay.h> 28 28 #include <linux/jiffies.h> 29 - #include <asm/unaligned.h> 30 29 31 30 #include <scsi/scsi.h> 32 31 #include <scsi/scsi_cmnd.h> ··· 2522 2523 } 2523 2524 } 2524 2525 EXPORT_SYMBOL(scsi_build_sense_buffer); 2525 - 2526 - /** 2527 - * scsi_set_sense_information - set the information field in a 2528 - * formatted sense data buffer 2529 - * @buf: Where to build sense data 2530 - * @info: 64-bit information value to be set 2531 - * 2532 - **/ 2533 - void scsi_set_sense_information(u8 *buf, u64 info) 2534 - { 2535 - if ((buf[0] & 0x7f) == 0x72) { 2536 - u8 *ucp, len; 2537 - 2538 - len = buf[7]; 2539 - ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0); 2540 - if (!ucp) { 2541 - buf[7] = len + 0xa; 2542 - ucp = buf + 8 + len; 2543 - } 2544 - ucp[0] = 0; 2545 - ucp[1] = 0xa; 2546 - ucp[2] = 0x80; /* Valid bit */ 2547 - ucp[3] = 0; 2548 - put_unaligned_be64(info, &ucp[4]); 2549 - } else if ((buf[0] & 0x7f) == 0x70) { 2550 - buf[0] |= 0x80; 2551 - put_unaligned_be64(info, &buf[3]); 2552 - } 2553 - } 2554 - EXPORT_SYMBOL(scsi_set_sense_information);
+3 -3
drivers/scsi/sd.c
··· 2770 2770 max_xfer = sdkp->max_xfer_blocks; 2771 2771 max_xfer <<= ilog2(sdp->sector_size) - 9; 2772 2772 2773 - max_xfer = min_not_zero(queue_max_hw_sectors(sdkp->disk->queue), 2774 - max_xfer); 2775 - blk_queue_max_hw_sectors(sdkp->disk->queue, max_xfer); 2773 + sdkp->disk->queue->limits.max_sectors = 2774 + min_not_zero(queue_max_hw_sectors(sdkp->disk->queue), max_xfer); 2775 + 2776 2776 set_capacity(disk, sdkp->capacity); 2777 2777 sd_config_write_same(sdkp); 2778 2778 kfree(buffer);
+2 -2
drivers/target/iscsi/iscsi_target.c
··· 968 968 cmd->cmd_flags |= ICF_NON_IMMEDIATE_UNSOLICITED_DATA; 969 969 970 970 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; 971 - if (hdr->flags & ISCSI_FLAG_CMD_READ) { 971 + if (hdr->flags & ISCSI_FLAG_CMD_READ) 972 972 cmd->targ_xfer_tag = session_get_next_ttt(conn->sess); 973 - } else if (hdr->flags & ISCSI_FLAG_CMD_WRITE) 973 + else 974 974 cmd->targ_xfer_tag = 0xFFFFFFFF; 975 975 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); 976 976 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn);
+8 -1
drivers/target/target_core_configfs.c
··· 457 457 if (!strcmp(t->tf_ops->name, fo->name)) { 458 458 BUG_ON(atomic_read(&t->tf_access_cnt)); 459 459 list_del(&t->tf_list); 460 + mutex_unlock(&g_tf_lock); 461 + /* 462 + * Wait for any outstanding fabric se_deve_entry->rcu_head 463 + * callbacks to complete post kfree_rcu(), before allowing 464 + * fabric driver unload of TFO->module to proceed. 465 + */ 466 + rcu_barrier(); 460 467 kfree(t); 461 - break; 468 + return; 462 469 } 463 470 } 464 471 mutex_unlock(&g_tf_lock);
+9 -1
drivers/target/target_core_hba.c
··· 84 84 list_for_each_entry(tb, &backend_list, list) { 85 85 if (tb->ops == ops) { 86 86 list_del(&tb->list); 87 + mutex_unlock(&backend_mutex); 88 + /* 89 + * Wait for any outstanding backend driver ->rcu_head 90 + * callbacks to complete post TBO->free_device() -> 91 + * call_rcu(), before allowing backend driver module 92 + * unload of target_backend_ops->owner to proceed. 93 + */ 94 + rcu_barrier(); 87 95 kfree(tb); 88 - break; 96 + return; 89 97 } 90 98 } 91 99 mutex_unlock(&backend_mutex);
+25 -19
drivers/target/target_core_spc.c
··· 1203 1203 struct se_dev_entry *deve; 1204 1204 struct se_session *sess = cmd->se_sess; 1205 1205 struct se_node_acl *nacl; 1206 + struct scsi_lun slun; 1206 1207 unsigned char *buf; 1207 1208 u32 lun_count = 0, offset = 8; 1208 - 1209 - if (cmd->data_length < 16) { 1210 - pr_warn("REPORT LUNS allocation length %u too small\n", 1211 - cmd->data_length); 1212 - return TCM_INVALID_CDB_FIELD; 1213 - } 1209 + __be32 len; 1214 1210 1215 1211 buf = transport_kmap_data_sg(cmd); 1216 - if (!buf) 1212 + if (cmd->data_length && !buf) 1217 1213 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 1218 1214 1219 1215 /* ··· 1217 1221 * coming via a target_core_mod PASSTHROUGH op, and not through 1218 1222 * a $FABRIC_MOD. In that case, report LUN=0 only. 1219 1223 */ 1220 - if (!sess) { 1221 - int_to_scsilun(0, (struct scsi_lun *)&buf[offset]); 1222 - lun_count = 1; 1224 + if (!sess) 1223 1225 goto done; 1224 - } 1226 + 1225 1227 nacl = sess->se_node_acl; 1226 1228 1227 1229 rcu_read_lock(); ··· 1230 1236 * See SPC2-R20 7.19. 1231 1237 */ 1232 1238 lun_count++; 1233 - if ((offset + 8) > cmd->data_length) 1239 + if (offset >= cmd->data_length) 1234 1240 continue; 1235 1241 1236 - int_to_scsilun(deve->mapped_lun, (struct scsi_lun *)&buf[offset]); 1242 + int_to_scsilun(deve->mapped_lun, &slun); 1243 + memcpy(buf + offset, &slun, 1244 + min(8u, cmd->data_length - offset)); 1237 1245 offset += 8; 1238 1246 } 1239 1247 rcu_read_unlock(); ··· 1244 1248 * See SPC3 r07, page 159. 1245 1249 */ 1246 1250 done: 1247 - lun_count *= 8; 1248 - buf[0] = ((lun_count >> 24) & 0xff); 1249 - buf[1] = ((lun_count >> 16) & 0xff); 1250 - buf[2] = ((lun_count >> 8) & 0xff); 1251 - buf[3] = (lun_count & 0xff); 1252 - transport_kunmap_data_sg(cmd); 1251 + /* 1252 + * If no LUNs are accessible, report virtual LUN 0. 1253 + */ 1254 + if (lun_count == 0) { 1255 + int_to_scsilun(0, &slun); 1256 + if (cmd->data_length > 8) 1257 + memcpy(buf + offset, &slun, 1258 + min(8u, cmd->data_length - offset)); 1259 + lun_count = 1; 1260 + } 1261 + 1262 + if (buf) { 1263 + len = cpu_to_be32(lun_count * 8); 1264 + memcpy(buf, &len, min_t(int, sizeof len, cmd->data_length)); 1265 + transport_kunmap_data_sg(cmd); 1266 + } 1253 1267 1254 1268 target_complete_cmd_with_length(cmd, GOOD, 8 + lun_count * 8); 1255 1269 return 0;
+47 -32
drivers/thermal/cpu_cooling.c
··· 68 68 * registered cooling device. 69 69 * @cpufreq_state: integer value representing the current state of cpufreq 70 70 * cooling devices. 71 - * @cpufreq_val: integer value representing the absolute value of the clipped 71 + * @clipped_freq: integer value representing the absolute value of the clipped 72 72 * frequency. 73 73 * @max_level: maximum cooling level. One less than total number of valid 74 74 * cpufreq frequencies. ··· 91 91 int id; 92 92 struct thermal_cooling_device *cool_dev; 93 93 unsigned int cpufreq_state; 94 - unsigned int cpufreq_val; 94 + unsigned int clipped_freq; 95 95 unsigned int max_level; 96 96 unsigned int *freq_table; /* In descending order */ 97 97 struct cpumask allowed_cpus; ··· 107 107 static DEFINE_IDR(cpufreq_idr); 108 108 static DEFINE_MUTEX(cooling_cpufreq_lock); 109 109 110 + static unsigned int cpufreq_dev_count; 111 + 112 + static DEFINE_MUTEX(cooling_list_lock); 110 113 static LIST_HEAD(cpufreq_dev_list); 111 114 112 115 /** ··· 188 185 { 189 186 struct cpufreq_cooling_device *cpufreq_dev; 190 187 191 - mutex_lock(&cooling_cpufreq_lock); 188 + mutex_lock(&cooling_list_lock); 192 189 list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { 193 190 if (cpumask_test_cpu(cpu, &cpufreq_dev->allowed_cpus)) { 194 - mutex_unlock(&cooling_cpufreq_lock); 191 + mutex_unlock(&cooling_list_lock); 195 192 return get_level(cpufreq_dev, freq); 196 193 } 197 194 } 198 - mutex_unlock(&cooling_cpufreq_lock); 195 + mutex_unlock(&cooling_list_lock); 199 196 200 197 pr_err("%s: cpu:%d not part of any cooling device\n", __func__, cpu); 201 198 return THERMAL_CSTATE_INVALID; ··· 218 215 unsigned long event, void *data) 219 216 { 220 217 struct cpufreq_policy *policy = data; 221 - unsigned long max_freq = 0; 218 + unsigned long clipped_freq; 222 219 struct cpufreq_cooling_device *cpufreq_dev; 223 220 224 - switch (event) { 225 - 226 - case CPUFREQ_ADJUST: 227 - mutex_lock(&cooling_cpufreq_lock); 228 - list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { 229 - if (!cpumask_test_cpu(policy->cpu, 230 - &cpufreq_dev->allowed_cpus)) 231 - continue; 232 - 233 - max_freq = cpufreq_dev->cpufreq_val; 234 - 235 - if (policy->max != max_freq) 236 - cpufreq_verify_within_limits(policy, 0, 237 - max_freq); 238 - } 239 - mutex_unlock(&cooling_cpufreq_lock); 240 - break; 241 - default: 221 + if (event != CPUFREQ_ADJUST) 242 222 return NOTIFY_DONE; 223 + 224 + mutex_lock(&cooling_list_lock); 225 + list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { 226 + if (!cpumask_test_cpu(policy->cpu, &cpufreq_dev->allowed_cpus)) 227 + continue; 228 + 229 + /* 230 + * policy->max is the maximum allowed frequency defined by user 231 + * and clipped_freq is the maximum that thermal constraints 232 + * allow. 233 + * 234 + * If clipped_freq is lower than policy->max, then we need to 235 + * readjust policy->max. 236 + * 237 + * But, if clipped_freq is greater than policy->max, we don't 238 + * need to do anything. 239 + */ 240 + clipped_freq = cpufreq_dev->clipped_freq; 241 + 242 + if (policy->max > clipped_freq) 243 + cpufreq_verify_within_limits(policy, 0, clipped_freq); 244 + break; 243 245 } 246 + mutex_unlock(&cooling_list_lock); 244 247 245 248 return NOTIFY_OK; 246 249 } ··· 528 519 529 520 clip_freq = cpufreq_device->freq_table[state]; 530 521 cpufreq_device->cpufreq_state = state; 531 - cpufreq_device->cpufreq_val = clip_freq; 522 + cpufreq_device->clipped_freq = clip_freq; 532 523 533 524 cpufreq_update_policy(cpu); 534 525 ··· 870 861 pr_debug("%s: freq:%u KHz\n", __func__, freq); 871 862 } 872 863 873 - cpufreq_dev->cpufreq_val = cpufreq_dev->freq_table[0]; 864 + cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0]; 874 865 cpufreq_dev->cool_dev = cool_dev; 875 866 876 867 mutex_lock(&cooling_cpufreq_lock); 877 868 869 + mutex_lock(&cooling_list_lock); 870 + list_add(&cpufreq_dev->node, &cpufreq_dev_list); 871 + mutex_unlock(&cooling_list_lock); 872 + 878 873 /* Register the notifier for first cpufreq cooling device */ 879 - if (list_empty(&cpufreq_dev_list)) 874 + if (!cpufreq_dev_count++) 880 875 cpufreq_register_notifier(&thermal_cpufreq_notifier_block, 881 876 CPUFREQ_POLICY_NOTIFIER); 882 - list_add(&cpufreq_dev->node, &cpufreq_dev_list); 883 - 884 877 mutex_unlock(&cooling_cpufreq_lock); 885 878 886 879 return cool_dev; ··· 1024 1013 return; 1025 1014 1026 1015 cpufreq_dev = cdev->devdata; 1027 - mutex_lock(&cooling_cpufreq_lock); 1028 - list_del(&cpufreq_dev->node); 1029 1016 1030 1017 /* Unregister the notifier for the last cpufreq cooling device */ 1031 - if (list_empty(&cpufreq_dev_list)) 1018 + mutex_lock(&cooling_cpufreq_lock); 1019 + if (!--cpufreq_dev_count) 1032 1020 cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block, 1033 1021 CPUFREQ_POLICY_NOTIFIER); 1022 + 1023 + mutex_lock(&cooling_list_lock); 1024 + list_del(&cpufreq_dev->node); 1025 + mutex_unlock(&cooling_list_lock); 1026 + 1034 1027 mutex_unlock(&cooling_cpufreq_lock); 1035 1028 1036 1029 thermal_cooling_device_unregister(cpufreq_dev->cool_dev);
+4 -4
drivers/thermal/power_allocator.c
··· 334 334 max_allocatable_power, current_temp, 335 335 (s32)control_temp - (s32)current_temp); 336 336 337 - devm_kfree(&tz->device, req_power); 337 + kfree(req_power); 338 338 unlock: 339 339 mutex_unlock(&tz->lock); 340 340 ··· 426 426 return -EINVAL; 427 427 } 428 428 429 - params = devm_kzalloc(&tz->device, sizeof(*params), GFP_KERNEL); 429 + params = kzalloc(sizeof(*params), GFP_KERNEL); 430 430 if (!params) 431 431 return -ENOMEM; 432 432 ··· 468 468 return 0; 469 469 470 470 free: 471 - devm_kfree(&tz->device, params); 471 + kfree(params); 472 472 return ret; 473 473 } 474 474 475 475 static void power_allocator_unbind(struct thermal_zone_device *tz) 476 476 { 477 477 dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id); 478 - devm_kfree(&tz->device, tz->governor_data); 478 + kfree(tz->governor_data); 479 479 tz->governor_data = NULL; 480 480 } 481 481
+9 -1
fs/fuse/dev.c
··· 2246 2246 2247 2247 err = -EINVAL; 2248 2248 if (old) { 2249 - struct fuse_dev *fud = fuse_get_dev(old); 2249 + struct fuse_dev *fud = NULL; 2250 + 2251 + /* 2252 + * Check against file->f_op because CUSE 2253 + * uses the same ioctl handler. 2254 + */ 2255 + if (old->f_op == file->f_op && 2256 + old->f_cred->user_ns == file->f_cred->user_ns) 2257 + fud = fuse_get_dev(old); 2250 2258 2251 2259 if (fud) { 2252 2260 mutex_lock(&fuse_mutex);
-2
include/drm/drm_crtc.h
··· 743 743 uint8_t num_h_tile, num_v_tile; 744 744 uint8_t tile_h_loc, tile_v_loc; 745 745 uint16_t tile_h_size, tile_v_size; 746 - 747 - struct list_head destroy_list; 748 746 }; 749 747 750 748 /**
-18
include/linux/ata.h
··· 385 385 SATA_SSP = 0x06, /* Software Settings Preservation */ 386 386 SATA_DEVSLP = 0x09, /* Device Sleep */ 387 387 388 - SETFEATURE_SENSE_DATA = 0xC3, /* Sense Data Reporting feature */ 389 - 390 388 /* feature values for SET_MAX */ 391 389 ATA_SET_MAX_ADDR = 0x00, 392 390 ATA_SET_MAX_PASSWD = 0x01, ··· 528 530 #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) 529 531 #define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) 530 532 #define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)) 531 - #define ata_id_has_ncq_autosense(id) \ 532 - ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7)) 533 533 534 534 static inline bool ata_id_has_hipm(const u16 *id) 535 535 { ··· 714 718 return true; 715 719 716 720 return false; 717 - } 718 - 719 - static inline bool ata_id_has_sense_reporting(const u16 *id) 720 - { 721 - if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15))) 722 - return false; 723 - return id[ATA_ID_COMMAND_SET_3] & (1 << 6); 724 - } 725 - 726 - static inline bool ata_id_sense_reporting_enabled(const u16 *id) 727 - { 728 - if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15))) 729 - return false; 730 - return id[ATA_ID_COMMAND_SET_4] & (1 << 6); 731 721 } 732 722 733 723 /**
-1
include/scsi/scsi_eh.h
··· 28 28 u64 * info_out); 29 29 30 30 extern void scsi_build_sense_buffer(int desc, u8 *buf, u8 key, u8 asc, u8 ascq); 31 - extern void scsi_set_sense_information(u8 *buf, u64 info); 32 31 33 32 extern int scsi_ioctl_reset(struct scsi_device *, int __user *); 34 33
+12
include/sound/soc-topology.h
··· 141 141 int io_ops_count; 142 142 }; 143 143 144 + #ifdef CONFIG_SND_SOC_TOPOLOGY 145 + 144 146 /* gets a pointer to data from the firmware block header */ 145 147 static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr) 146 148 { ··· 166 164 int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w, 167 165 const struct snd_soc_tplg_widget_events *events, int num_events, 168 166 u16 event_type); 167 + 168 + #else 169 + 170 + static inline int snd_soc_tplg_component_remove(struct snd_soc_component *comp, 171 + u32 index) 172 + { 173 + return 0; 174 + } 175 + 176 + #endif 169 177 170 178 #endif
+6
include/uapi/sound/asoc.h
··· 18 18 #include <linux/types.h> 19 19 #include <sound/asound.h> 20 20 21 + #ifndef __KERNEL__ 22 + #error This API is an early revision and not enabled in the current 23 + #error kernel release, it will be enabled in a future kernel version 24 + #error with incompatible changes to what is here. 25 + #endif 26 + 21 27 /* 22 28 * Maximum number of channels topology kcontrol can represent. 23 29 */
+36 -13
ipc/sem.c
··· 253 253 } 254 254 255 255 /* 256 + * spin_unlock_wait() and !spin_is_locked() are not memory barriers, they 257 + * are only control barriers. 258 + * The code must pair with spin_unlock(&sem->lock) or 259 + * spin_unlock(&sem_perm.lock), thus just the control barrier is insufficient. 260 + * 261 + * smp_rmb() is sufficient, as writes cannot pass the control barrier. 262 + */ 263 + #define ipc_smp_acquire__after_spin_is_unlocked() smp_rmb() 264 + 265 + /* 256 266 * Wait until all currently ongoing simple ops have completed. 257 267 * Caller must own sem_perm.lock. 258 268 * New simple ops cannot start, because simple ops first check ··· 285 275 sem = sma->sem_base + i; 286 276 spin_unlock_wait(&sem->lock); 287 277 } 278 + ipc_smp_acquire__after_spin_is_unlocked(); 288 279 } 289 280 290 281 /* ··· 338 327 /* Then check that the global lock is free */ 339 328 if (!spin_is_locked(&sma->sem_perm.lock)) { 340 329 /* 341 - * The ipc object lock check must be visible on all 342 - * cores before rechecking the complex count. Otherwise 343 - * we can race with another thread that does: 330 + * We need a memory barrier with acquire semantics, 331 + * otherwise we can race with another thread that does: 344 332 * complex_count++; 345 333 * spin_unlock(sem_perm.lock); 346 334 */ 347 - smp_rmb(); 335 + ipc_smp_acquire__after_spin_is_unlocked(); 348 336 349 337 /* 350 338 * Now repeat the test of complex_count: ··· 2084 2074 rcu_read_lock(); 2085 2075 un = list_entry_rcu(ulp->list_proc.next, 2086 2076 struct sem_undo, list_proc); 2087 - if (&un->list_proc == &ulp->list_proc) 2088 - semid = -1; 2089 - else 2090 - semid = un->semid; 2091 - 2092 - if (semid == -1) { 2077 + if (&un->list_proc == &ulp->list_proc) { 2078 + /* 2079 + * We must wait for freeary() before freeing this ulp, 2080 + * in case we raced with last sem_undo. There is a small 2081 + * possibility where we exit while freeary() didn't 2082 + * finish unlocking sem_undo_list. 2083 + */ 2084 + spin_unlock_wait(&ulp->lock); 2093 2085 rcu_read_unlock(); 2094 2086 break; 2095 2087 } 2088 + spin_lock(&ulp->lock); 2089 + semid = un->semid; 2090 + spin_unlock(&ulp->lock); 2096 2091 2097 - sma = sem_obtain_object_check(tsk->nsproxy->ipc_ns, un->semid); 2092 + /* exit_sem raced with IPC_RMID, nothing to do */ 2093 + if (semid == -1) { 2094 + rcu_read_unlock(); 2095 + continue; 2096 + } 2097 + 2098 + sma = sem_obtain_object_check(tsk->nsproxy->ipc_ns, semid); 2098 2099 /* exit_sem raced with IPC_RMID, nothing to do */ 2099 2100 if (IS_ERR(sma)) { 2100 2101 rcu_read_unlock(); ··· 2133 2112 ipc_assert_locked_object(&sma->sem_perm); 2134 2113 list_del(&un->list_id); 2135 2114 2136 - spin_lock(&ulp->lock); 2115 + /* we are the last process using this ulp, acquiring ulp->lock 2116 + * isn't required. Besides that, we are also protected against 2117 + * IPC_RMID as we hold sma->sem_perm lock now 2118 + */ 2137 2119 list_del_rcu(&un->list_proc); 2138 - spin_unlock(&ulp->lock); 2139 2120 2140 2121 /* perform adjustments registered in un */ 2141 2122 for (i = 0; i < sma->sem_nsems; i++) {
+1 -1
kernel/cpuset.c
··· 1223 1223 spin_unlock_irq(&callback_lock); 1224 1224 1225 1225 /* use trialcs->mems_allowed as a temp variable */ 1226 - update_nodemasks_hier(cs, &cs->mems_allowed); 1226 + update_nodemasks_hier(cs, &trialcs->mems_allowed); 1227 1227 done: 1228 1228 return retval; 1229 1229 }
+67 -24
kernel/events/core.c
··· 1868 1868 1869 1869 perf_pmu_disable(event->pmu); 1870 1870 1871 - event->tstamp_running += tstamp - event->tstamp_stopped; 1872 - 1873 1871 perf_set_shadow_time(event, ctx, tstamp); 1874 1872 1875 1873 perf_log_itrace_start(event); ··· 1878 1880 ret = -EAGAIN; 1879 1881 goto out; 1880 1882 } 1883 + 1884 + event->tstamp_running += tstamp - event->tstamp_stopped; 1881 1885 1882 1886 if (!is_software_event(event)) 1883 1887 cpuctx->active_oncpu++; ··· 4011 4011 perf_event_for_each_child(sibling, func); 4012 4012 } 4013 4013 4014 - static int perf_event_period(struct perf_event *event, u64 __user *arg) 4015 - { 4016 - struct perf_event_context *ctx = event->ctx; 4017 - int ret = 0, active; 4014 + struct period_event { 4015 + struct perf_event *event; 4018 4016 u64 value; 4017 + }; 4019 4018 4020 - if (!is_sampling_event(event)) 4021 - return -EINVAL; 4019 + static int __perf_event_period(void *info) 4020 + { 4021 + struct period_event *pe = info; 4022 + struct perf_event *event = pe->event; 4023 + struct perf_event_context *ctx = event->ctx; 4024 + u64 value = pe->value; 4025 + bool active; 4022 4026 4023 - if (copy_from_user(&value, arg, sizeof(value))) 4024 - return -EFAULT; 4025 - 4026 - if (!value) 4027 - return -EINVAL; 4028 - 4029 - raw_spin_lock_irq(&ctx->lock); 4027 + raw_spin_lock(&ctx->lock); 4030 4028 if (event->attr.freq) { 4031 - if (value > sysctl_perf_event_sample_rate) { 4032 - ret = -EINVAL; 4033 - goto unlock; 4034 - } 4035 - 4036 4029 event->attr.sample_freq = value; 4037 4030 } else { 4038 4031 event->attr.sample_period = value; ··· 4044 4051 event->pmu->start(event, PERF_EF_RELOAD); 4045 4052 perf_pmu_enable(ctx->pmu); 4046 4053 } 4054 + raw_spin_unlock(&ctx->lock); 4047 4055 4048 - unlock: 4056 + return 0; 4057 + } 4058 + 4059 + static int perf_event_period(struct perf_event *event, u64 __user *arg) 4060 + { 4061 + struct period_event pe = { .event = event, }; 4062 + struct perf_event_context *ctx = event->ctx; 4063 + struct task_struct *task; 4064 + u64 value; 4065 + 4066 + if (!is_sampling_event(event)) 4067 + return -EINVAL; 4068 + 4069 + if (copy_from_user(&value, arg, sizeof(value))) 4070 + return -EFAULT; 4071 + 4072 + if (!value) 4073 + return -EINVAL; 4074 + 4075 + if (event->attr.freq && value > sysctl_perf_event_sample_rate) 4076 + return -EINVAL; 4077 + 4078 + task = ctx->task; 4079 + pe.value = value; 4080 + 4081 + if (!task) { 4082 + cpu_function_call(event->cpu, __perf_event_period, &pe); 4083 + return 0; 4084 + } 4085 + 4086 + retry: 4087 + if (!task_function_call(task, __perf_event_period, &pe)) 4088 + return 0; 4089 + 4090 + raw_spin_lock_irq(&ctx->lock); 4091 + if (ctx->is_active) { 4092 + raw_spin_unlock_irq(&ctx->lock); 4093 + task = ctx->task; 4094 + goto retry; 4095 + } 4096 + 4097 + __perf_event_period(&pe); 4049 4098 raw_spin_unlock_irq(&ctx->lock); 4050 4099 4051 - return ret; 4100 + return 0; 4052 4101 } 4053 4102 4054 4103 static const struct file_operations perf_fops; ··· 4828 4793 * to user-space before waking everybody up. 4829 4794 */ 4830 4795 4796 + static inline struct fasync_struct **perf_event_fasync(struct perf_event *event) 4797 + { 4798 + /* only the parent has fasync state */ 4799 + if (event->parent) 4800 + event = event->parent; 4801 + return &event->fasync; 4802 + } 4803 + 4831 4804 void perf_event_wakeup(struct perf_event *event) 4832 4805 { 4833 4806 ring_buffer_wakeup(event); 4834 4807 4835 4808 if (event->pending_kill) { 4836 - kill_fasync(&event->fasync, SIGIO, event->pending_kill); 4809 + kill_fasync(perf_event_fasync(event), SIGIO, event->pending_kill); 4837 4810 event->pending_kill = 0; 4838 4811 } 4839 4812 } ··· 6220 6177 else 6221 6178 perf_event_output(event, data, regs); 6222 6179 6223 - if (event->fasync && event->pending_kill) { 6180 + if (*perf_event_fasync(event) && event->pending_kill) { 6224 6181 event->pending_wakeup = 1; 6225 6182 irq_work_queue(&event->pending); 6226 6183 }
+6 -4
kernel/events/ring_buffer.c
··· 559 559 rb->aux_priv = NULL; 560 560 } 561 561 562 - for (pg = 0; pg < rb->aux_nr_pages; pg++) 563 - rb_free_aux_page(rb, pg); 562 + if (rb->aux_nr_pages) { 563 + for (pg = 0; pg < rb->aux_nr_pages; pg++) 564 + rb_free_aux_page(rb, pg); 564 565 565 - kfree(rb->aux_pages); 566 - rb->aux_nr_pages = 0; 566 + kfree(rb->aux_pages); 567 + rb->aux_nr_pages = 0; 568 + } 567 569 } 568 570 569 571 void rb_free_aux(struct ring_buffer *rb)
+10 -1
kernel/locking/qspinlock_paravirt.h
··· 4 4 5 5 #include <linux/hash.h> 6 6 #include <linux/bootmem.h> 7 + #include <linux/debug_locks.h> 7 8 8 9 /* 9 10 * Implement paravirt qspinlocks; the general idea is to halt the vcpus instead ··· 287 286 { 288 287 struct __qspinlock *l = (void *)lock; 289 288 struct pv_node *node; 289 + u8 lockval = cmpxchg(&l->locked, _Q_LOCKED_VAL, 0); 290 290 291 291 /* 292 292 * We must not unlock if SLOW, because in that case we must first 293 293 * unhash. Otherwise it would be possible to have multiple @lock 294 294 * entries, which would be BAD. 295 295 */ 296 - if (likely(cmpxchg(&l->locked, _Q_LOCKED_VAL, 0) == _Q_LOCKED_VAL)) 296 + if (likely(lockval == _Q_LOCKED_VAL)) 297 297 return; 298 + 299 + if (unlikely(lockval != _Q_SLOW_VAL)) { 300 + if (debug_locks_silent) 301 + return; 302 + WARN(1, "pvqspinlock: lock %p has corrupted value 0x%x!\n", lock, atomic_read(&lock->val)); 303 + return; 304 + } 298 305 299 306 /* 300 307 * Since the above failed to release, this must be the SLOW path.
+1 -1
mm/cma.h
··· 16 16 extern struct cma cma_areas[MAX_CMA_AREAS]; 17 17 extern unsigned cma_area_count; 18 18 19 - static unsigned long cma_bitmap_maxno(struct cma *cma) 19 + static inline unsigned long cma_bitmap_maxno(struct cma *cma) 20 20 { 21 21 return cma->count >> cma->order_per_bit; 22 22 }
+1 -1
mm/kasan/kasan.c
··· 2 2 * This file contains shadow memory manipulation code. 3 3 * 4 4 * Copyright (c) 2014 Samsung Electronics Co., Ltd. 5 - * Author: Andrey Ryabinin <a.ryabinin@samsung.com> 5 + * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com> 6 6 * 7 7 * Some of code borrowed from https://github.com/xairy/linux by 8 8 * Andrey Konovalov <adech.fo@gmail.com>
+1 -1
mm/kasan/report.c
··· 2 2 * This file contains error reporting code. 3 3 * 4 4 * Copyright (c) 2014 Samsung Electronics Co., Ltd. 5 - * Author: Andrey Ryabinin <a.ryabinin@samsung.com> 5 + * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com> 6 6 * 7 7 * Some of code borrowed from https://github.com/xairy/linux by 8 8 * Andrey Konovalov <adech.fo@gmail.com>
+13 -9
mm/memory-failure.c
··· 1146 1146 } 1147 1147 1148 1148 if (!PageHuge(p) && PageTransHuge(hpage)) { 1149 - if (unlikely(split_huge_page(hpage))) { 1150 - pr_err("MCE: %#lx: thp split failed\n", pfn); 1149 + if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) { 1150 + if (!PageAnon(hpage)) 1151 + pr_err("MCE: %#lx: non anonymous thp\n", pfn); 1152 + else 1153 + pr_err("MCE: %#lx: thp split failed\n", pfn); 1151 1154 if (TestClearPageHWPoison(p)) 1152 1155 atomic_long_sub(nr_pages, &num_poisoned_pages); 1153 1156 put_page(p); ··· 1541 1538 */ 1542 1539 ret = __get_any_page(page, pfn, 0); 1543 1540 if (!PageLRU(page)) { 1541 + /* Drop page reference which is from __get_any_page() */ 1542 + put_page(page); 1544 1543 pr_info("soft_offline: %#lx: unknown non LRU page type %lx\n", 1545 1544 pfn, page->flags); 1546 1545 return -EIO; ··· 1572 1567 unlock_page(hpage); 1573 1568 1574 1569 ret = isolate_huge_page(hpage, &pagelist); 1575 - if (ret) { 1576 - /* 1577 - * get_any_page() and isolate_huge_page() takes a refcount each, 1578 - * so need to drop one here. 1579 - */ 1580 - put_page(hpage); 1581 - } else { 1570 + /* 1571 + * get_any_page() and isolate_huge_page() takes a refcount each, 1572 + * so need to drop one here. 1573 + */ 1574 + put_page(hpage); 1575 + if (!ret) { 1582 1576 pr_info("soft offline: %#lx hugepage failed to isolate\n", pfn); 1583 1577 return -EBUSY; 1584 1578 }
+3
mm/memory_hotplug.c
··· 1277 1277 1278 1278 /* create new memmap entry */ 1279 1279 firmware_map_add_hotplug(start, start + size, "System RAM"); 1280 + memblock_add_node(start, size, nid); 1280 1281 1281 1282 goto out; 1282 1283 ··· 2014 2013 2015 2014 /* remove memmap entry */ 2016 2015 firmware_map_remove(start, start + size, "System RAM"); 2016 + memblock_free(start, size); 2017 + memblock_remove(start, size); 2017 2018 2018 2019 arch_remove_memory(start, size); 2019 2020
+8
mm/page_alloc.c
··· 5060 5060 { 5061 5061 unsigned long zone_start_pfn, zone_end_pfn; 5062 5062 5063 + /* When hotadd a new node, the node should be empty */ 5064 + if (!node_start_pfn && !node_end_pfn) 5065 + return 0; 5066 + 5063 5067 /* Get the start and end of the zone */ 5064 5068 zone_start_pfn = arch_zone_lowest_possible_pfn[zone_type]; 5065 5069 zone_end_pfn = arch_zone_highest_possible_pfn[zone_type]; ··· 5126 5122 unsigned long zone_low = arch_zone_lowest_possible_pfn[zone_type]; 5127 5123 unsigned long zone_high = arch_zone_highest_possible_pfn[zone_type]; 5128 5124 unsigned long zone_start_pfn, zone_end_pfn; 5125 + 5126 + /* When hotadd a new node, the node should be empty */ 5127 + if (!node_start_pfn && !node_end_pfn) 5128 + return 0; 5129 5129 5130 5130 zone_start_pfn = clamp(node_start_pfn, zone_low, zone_high); 5131 5131 zone_end_pfn = clamp(node_end_pfn, zone_low, zone_high);
+4 -1
net/batman-adv/translation-table.c
··· 596 596 /* increase the refcounter of the related vlan */ 597 597 vlan = batadv_softif_vlan_get(bat_priv, vid); 598 598 if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d", 599 - addr, BATADV_PRINT_VID(vid))) 599 + addr, BATADV_PRINT_VID(vid))) { 600 + kfree(tt_local); 601 + tt_local = NULL; 600 602 goto out; 603 + } 601 604 602 605 batadv_dbg(BATADV_DBG_TT, bat_priv, 603 606 "Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n",
+2 -2
net/bridge/br_multicast.c
··· 1608 1608 break; 1609 1609 } 1610 1610 1611 - if (skb_trimmed) 1611 + if (skb_trimmed && skb_trimmed != skb) 1612 1612 kfree_skb(skb_trimmed); 1613 1613 1614 1614 return err; ··· 1653 1653 break; 1654 1654 } 1655 1655 1656 - if (skb_trimmed) 1656 + if (skb_trimmed && skb_trimmed != skb) 1657 1657 kfree_skb(skb_trimmed); 1658 1658 1659 1659 return err;
+18 -19
net/core/skbuff.c
··· 4022 4022 * Otherwise returns the provided skb. Returns NULL in error cases 4023 4023 * (e.g. transport_len exceeds skb length or out-of-memory). 4024 4024 * 4025 - * Caller needs to set the skb transport header and release the returned skb. 4026 - * Provided skb is consumed. 4025 + * Caller needs to set the skb transport header and free any returned skb if it 4026 + * differs from the provided skb. 4027 4027 */ 4028 4028 static struct sk_buff *skb_checksum_maybe_trim(struct sk_buff *skb, 4029 4029 unsigned int transport_len) ··· 4032 4032 unsigned int len = skb_transport_offset(skb) + transport_len; 4033 4033 int ret; 4034 4034 4035 - if (skb->len < len) { 4036 - kfree_skb(skb); 4035 + if (skb->len < len) 4037 4036 return NULL; 4038 - } else if (skb->len == len) { 4037 + else if (skb->len == len) 4039 4038 return skb; 4040 - } 4041 4039 4042 4040 skb_chk = skb_clone(skb, GFP_ATOMIC); 4043 - kfree_skb(skb); 4044 - 4045 4041 if (!skb_chk) 4046 4042 return NULL; 4047 4043 ··· 4062 4066 * If the skb has data beyond the given transport length, then a 4063 4067 * trimmed & cloned skb is checked and returned. 4064 4068 * 4065 - * Caller needs to set the skb transport header and release the returned skb. 4066 - * Provided skb is consumed. 4069 + * Caller needs to set the skb transport header and free any returned skb if it 4070 + * differs from the provided skb. 4067 4071 */ 4068 4072 struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, 4069 4073 unsigned int transport_len, ··· 4075 4079 4076 4080 skb_chk = skb_checksum_maybe_trim(skb, transport_len); 4077 4081 if (!skb_chk) 4078 - return NULL; 4082 + goto err; 4079 4083 4080 - if (!pskb_may_pull(skb_chk, offset)) { 4081 - kfree_skb(skb_chk); 4082 - return NULL; 4083 - } 4084 + if (!pskb_may_pull(skb_chk, offset)) 4085 + goto err; 4084 4086 4085 4087 __skb_pull(skb_chk, offset); 4086 4088 ret = skb_chkf(skb_chk); 4087 4089 __skb_push(skb_chk, offset); 4088 4090 4089 - if (ret) { 4090 - kfree_skb(skb_chk); 4091 - return NULL; 4092 - } 4091 + if (ret) 4092 + goto err; 4093 4093 4094 4094 return skb_chk; 4095 + 4096 + err: 4097 + if (skb_chk && skb_chk != skb) 4098 + kfree_skb(skb_chk); 4099 + 4100 + return NULL; 4101 + 4095 4102 } 4096 4103 EXPORT_SYMBOL(skb_checksum_trimmed); 4097 4104
+1 -1
net/ipv4/fib_trie.c
··· 2468 2468 key = l->key + 1; 2469 2469 iter->pos++; 2470 2470 2471 - if (pos-- <= 0) 2471 + if (--pos <= 0) 2472 2472 break; 2473 2473 2474 2474 l = NULL;
+18 -15
net/ipv4/igmp.c
··· 1435 1435 struct sk_buff *skb_chk; 1436 1436 unsigned int transport_len; 1437 1437 unsigned int len = skb_transport_offset(skb) + sizeof(struct igmphdr); 1438 - int ret; 1438 + int ret = -EINVAL; 1439 1439 1440 1440 transport_len = ntohs(ip_hdr(skb)->tot_len) - ip_hdrlen(skb); 1441 1441 1442 - skb_get(skb); 1443 1442 skb_chk = skb_checksum_trimmed(skb, transport_len, 1444 1443 ip_mc_validate_checksum); 1445 1444 if (!skb_chk) 1446 - return -EINVAL; 1445 + goto err; 1447 1446 1448 - if (!pskb_may_pull(skb_chk, len)) { 1449 - kfree_skb(skb_chk); 1450 - return -EINVAL; 1451 - } 1447 + if (!pskb_may_pull(skb_chk, len)) 1448 + goto err; 1452 1449 1453 1450 ret = ip_mc_check_igmp_msg(skb_chk); 1454 - if (ret) { 1455 - kfree_skb(skb_chk); 1456 - return ret; 1457 - } 1451 + if (ret) 1452 + goto err; 1458 1453 1459 1454 if (skb_trimmed) 1460 1455 *skb_trimmed = skb_chk; 1461 - else 1456 + /* free now unneeded clone */ 1457 + else if (skb_chk != skb) 1462 1458 kfree_skb(skb_chk); 1463 1459 1464 - return 0; 1460 + ret = 0; 1461 + 1462 + err: 1463 + if (ret && skb_chk && skb_chk != skb) 1464 + kfree_skb(skb_chk); 1465 + 1466 + return ret; 1465 1467 } 1466 1468 1467 1469 /** ··· 1472 1470 * @skb_trimmed: to store an skb pointer trimmed to IPv4 packet tail (optional) 1473 1471 * 1474 1472 * Checks whether an IPv4 packet is a valid IGMP packet. If so sets 1475 - * skb network and transport headers accordingly and returns zero. 1473 + * skb transport header accordingly and returns zero. 1476 1474 * 1477 1475 * -EINVAL: A broken packet was detected, i.e. it violates some internet 1478 1476 * standard ··· 1487 1485 * to leave the original skb and its full frame unchanged (which might be 1488 1486 * desirable for layer 2 frame jugglers). 1489 1487 * 1490 - * The caller needs to release a reference count from any returned skb_trimmed. 1488 + * Caller needs to set the skb network header and free any returned skb if it 1489 + * differs from the provided skb. 1491 1490 */ 1492 1491 int ip_mc_check_igmp(struct sk_buff *skb, struct sk_buff **skb_trimmed) 1493 1492 {
+1 -1
net/ipv4/inet_connection_sock.c
··· 593 593 } 594 594 595 595 spin_unlock(&queue->syn_wait_lock); 596 - if (del_timer_sync(&req->rsk_timer)) 596 + if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer)) 597 597 reqsk_put(req); 598 598 return found; 599 599 }
+4 -6
net/ipv4/sysctl_net_ipv4.c
··· 41 41 static int tcp_syn_retries_max = MAX_TCP_SYNCNT; 42 42 static int ip_ping_group_range_min[] = { 0, 0 }; 43 43 static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; 44 - static int min_sndbuf = SOCK_MIN_SNDBUF; 45 - static int min_rcvbuf = SOCK_MIN_RCVBUF; 46 44 47 45 /* Update system visible IP port range */ 48 46 static void set_local_port_range(struct net *net, int range[2]) ··· 528 530 .maxlen = sizeof(sysctl_tcp_wmem), 529 531 .mode = 0644, 530 532 .proc_handler = proc_dointvec_minmax, 531 - .extra1 = &min_sndbuf, 533 + .extra1 = &one, 532 534 }, 533 535 { 534 536 .procname = "tcp_notsent_lowat", ··· 543 545 .maxlen = sizeof(sysctl_tcp_rmem), 544 546 .mode = 0644, 545 547 .proc_handler = proc_dointvec_minmax, 546 - .extra1 = &min_rcvbuf, 548 + .extra1 = &one, 547 549 }, 548 550 { 549 551 .procname = "tcp_app_win", ··· 756 758 .maxlen = sizeof(sysctl_udp_rmem_min), 757 759 .mode = 0644, 758 760 .proc_handler = proc_dointvec_minmax, 759 - .extra1 = &min_rcvbuf, 761 + .extra1 = &one 760 762 }, 761 763 { 762 764 .procname = "udp_wmem_min", ··· 764 766 .maxlen = sizeof(sysctl_udp_wmem_min), 765 767 .mode = 0644, 766 768 .proc_handler = proc_dointvec_minmax, 767 - .extra1 = &min_sndbuf, 769 + .extra1 = &one 768 770 }, 769 771 { } 770 772 };
+2
net/ipv6/ip6_fib.c
··· 173 173 *ppcpu_rt = NULL; 174 174 } 175 175 } 176 + 177 + non_pcpu_rt->rt6i_pcpu = NULL; 176 178 } 177 179 178 180 static void rt6_release(struct rt6_info *rt)
+18 -15
net/ipv6/mcast_snoop.c
··· 143 143 struct sk_buff *skb_chk = NULL; 144 144 unsigned int transport_len; 145 145 unsigned int len = skb_transport_offset(skb) + sizeof(struct mld_msg); 146 - int ret; 146 + int ret = -EINVAL; 147 147 148 148 transport_len = ntohs(ipv6_hdr(skb)->payload_len); 149 149 transport_len -= skb_transport_offset(skb) - sizeof(struct ipv6hdr); 150 150 151 - skb_get(skb); 152 151 skb_chk = skb_checksum_trimmed(skb, transport_len, 153 152 ipv6_mc_validate_checksum); 154 153 if (!skb_chk) 155 - return -EINVAL; 154 + goto err; 156 155 157 - if (!pskb_may_pull(skb_chk, len)) { 158 - kfree_skb(skb_chk); 159 - return -EINVAL; 160 - } 156 + if (!pskb_may_pull(skb_chk, len)) 157 + goto err; 161 158 162 159 ret = ipv6_mc_check_mld_msg(skb_chk); 163 - if (ret) { 164 - kfree_skb(skb_chk); 165 - return ret; 166 - } 160 + if (ret) 161 + goto err; 167 162 168 163 if (skb_trimmed) 169 164 *skb_trimmed = skb_chk; 170 - else 165 + /* free now unneeded clone */ 166 + else if (skb_chk != skb) 171 167 kfree_skb(skb_chk); 172 168 173 - return 0; 169 + ret = 0; 170 + 171 + err: 172 + if (ret && skb_chk && skb_chk != skb) 173 + kfree_skb(skb_chk); 174 + 175 + return ret; 174 176 } 175 177 176 178 /** ··· 181 179 * @skb_trimmed: to store an skb pointer trimmed to IPv6 packet tail (optional) 182 180 * 183 181 * Checks whether an IPv6 packet is a valid MLD packet. If so sets 184 - * skb network and transport headers accordingly and returns zero. 182 + * skb transport header accordingly and returns zero. 185 183 * 186 184 * -EINVAL: A broken packet was detected, i.e. it violates some internet 187 185 * standard ··· 196 194 * to leave the original skb and its full frame unchanged (which might be 197 195 * desirable for layer 2 frame jugglers). 198 196 * 199 - * The caller needs to release a reference count from any returned skb_trimmed. 197 + * Caller needs to set the skb network header and free any returned skb if it 198 + * differs from the provided skb. 200 199 */ 201 200 int ipv6_mc_check_mld(struct sk_buff *skb, struct sk_buff **skb_trimmed) 202 201 {
+55 -24
net/ipv6/route.c
··· 321 321 /* allocate dst with ip6_dst_ops */ 322 322 static struct rt6_info *__ip6_dst_alloc(struct net *net, 323 323 struct net_device *dev, 324 - int flags, 325 - struct fib6_table *table) 324 + int flags) 326 325 { 327 326 struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, 328 327 0, DST_OBSOLETE_FORCE_CHK, flags); ··· 338 339 339 340 static struct rt6_info *ip6_dst_alloc(struct net *net, 340 341 struct net_device *dev, 341 - int flags, 342 - struct fib6_table *table) 342 + int flags) 343 343 { 344 - struct rt6_info *rt = __ip6_dst_alloc(net, dev, flags, table); 344 + struct rt6_info *rt = __ip6_dst_alloc(net, dev, flags); 345 345 346 346 if (rt) { 347 347 rt->rt6i_pcpu = alloc_percpu_gfp(struct rt6_info *, GFP_ATOMIC); ··· 957 959 if (ort->rt6i_flags & (RTF_CACHE | RTF_PCPU)) 958 960 ort = (struct rt6_info *)ort->dst.from; 959 961 960 - rt = __ip6_dst_alloc(dev_net(ort->dst.dev), ort->dst.dev, 961 - 0, ort->rt6i_table); 962 + rt = __ip6_dst_alloc(dev_net(ort->dst.dev), ort->dst.dev, 0); 962 963 963 964 if (!rt) 964 965 return NULL; ··· 989 992 struct rt6_info *pcpu_rt; 990 993 991 994 pcpu_rt = __ip6_dst_alloc(dev_net(rt->dst.dev), 992 - rt->dst.dev, rt->dst.flags, 993 - rt->rt6i_table); 995 + rt->dst.dev, rt->dst.flags); 994 996 995 997 if (!pcpu_rt) 996 998 return NULL; ··· 1002 1006 /* It should be called with read_lock_bh(&tb6_lock) acquired */ 1003 1007 static struct rt6_info *rt6_get_pcpu_route(struct rt6_info *rt) 1004 1008 { 1005 - struct rt6_info *pcpu_rt, *prev, **p; 1009 + struct rt6_info *pcpu_rt, **p; 1006 1010 1007 1011 p = this_cpu_ptr(rt->rt6i_pcpu); 1008 1012 pcpu_rt = *p; 1009 1013 1010 - if (pcpu_rt) 1011 - goto done; 1014 + if (pcpu_rt) { 1015 + dst_hold(&pcpu_rt->dst); 1016 + rt6_dst_from_metrics_check(pcpu_rt); 1017 + } 1018 + return pcpu_rt; 1019 + } 1020 + 1021 + static struct rt6_info *rt6_make_pcpu_route(struct rt6_info *rt) 1022 + { 1023 + struct fib6_table *table = rt->rt6i_table; 1024 + struct rt6_info *pcpu_rt, *prev, **p; 1012 1025 1013 1026 pcpu_rt = ip6_rt_pcpu_alloc(rt); 1014 1027 if (!pcpu_rt) { 1015 1028 struct net *net = dev_net(rt->dst.dev); 1016 1029 1017 - pcpu_rt = net->ipv6.ip6_null_entry; 1018 - goto done; 1030 + dst_hold(&net->ipv6.ip6_null_entry->dst); 1031 + return net->ipv6.ip6_null_entry; 1019 1032 } 1020 1033 1021 - prev = cmpxchg(p, NULL, pcpu_rt); 1022 - if (prev) { 1023 - /* If someone did it before us, return prev instead */ 1034 + read_lock_bh(&table->tb6_lock); 1035 + if (rt->rt6i_pcpu) { 1036 + p = this_cpu_ptr(rt->rt6i_pcpu); 1037 + prev = cmpxchg(p, NULL, pcpu_rt); 1038 + if (prev) { 1039 + /* If someone did it before us, return prev instead */ 1040 + dst_destroy(&pcpu_rt->dst); 1041 + pcpu_rt = prev; 1042 + } 1043 + } else { 1044 + /* rt has been removed from the fib6 tree 1045 + * before we have a chance to acquire the read_lock. 1046 + * In this case, don't brother to create a pcpu rt 1047 + * since rt is going away anyway. The next 1048 + * dst_check() will trigger a re-lookup. 1049 + */ 1024 1050 dst_destroy(&pcpu_rt->dst); 1025 - pcpu_rt = prev; 1051 + pcpu_rt = rt; 1026 1052 } 1027 - 1028 - done: 1029 1053 dst_hold(&pcpu_rt->dst); 1030 1054 rt6_dst_from_metrics_check(pcpu_rt); 1055 + read_unlock_bh(&table->tb6_lock); 1031 1056 return pcpu_rt; 1032 1057 } 1033 1058 ··· 1123 1106 rt->dst.lastuse = jiffies; 1124 1107 rt->dst.__use++; 1125 1108 pcpu_rt = rt6_get_pcpu_route(rt); 1126 - read_unlock_bh(&table->tb6_lock); 1109 + 1110 + if (pcpu_rt) { 1111 + read_unlock_bh(&table->tb6_lock); 1112 + } else { 1113 + /* We have to do the read_unlock first 1114 + * because rt6_make_pcpu_route() may trigger 1115 + * ip6_dst_gc() which will take the write_lock. 1116 + */ 1117 + dst_hold(&rt->dst); 1118 + read_unlock_bh(&table->tb6_lock); 1119 + pcpu_rt = rt6_make_pcpu_route(rt); 1120 + dst_release(&rt->dst); 1121 + } 1127 1122 1128 1123 return pcpu_rt; 1124 + 1129 1125 } 1130 1126 } 1131 1127 ··· 1599 1569 if (unlikely(!idev)) 1600 1570 return ERR_PTR(-ENODEV); 1601 1571 1602 - rt = ip6_dst_alloc(net, dev, 0, NULL); 1572 + rt = ip6_dst_alloc(net, dev, 0); 1603 1573 if (unlikely(!rt)) { 1604 1574 in6_dev_put(idev); 1605 1575 dst = ERR_PTR(-ENOMEM); ··· 1786 1756 if (!table) 1787 1757 goto out; 1788 1758 1789 - rt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table); 1759 + rt = ip6_dst_alloc(net, NULL, 1760 + (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT); 1790 1761 1791 1762 if (!rt) { 1792 1763 err = -ENOMEM; ··· 2463 2432 { 2464 2433 struct net *net = dev_net(idev->dev); 2465 2434 struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev, 2466 - DST_NOCOUNT, NULL); 2435 + DST_NOCOUNT); 2467 2436 if (!rt) 2468 2437 return ERR_PTR(-ENOMEM); 2469 2438
+6 -5
net/mac80211/rc80211_minstrel.c
··· 92 92 static inline void 93 93 minstrel_sort_best_tp_rates(struct minstrel_sta_info *mi, int i, u8 *tp_list) 94 94 { 95 - int j = MAX_THR_RATES; 96 - struct minstrel_rate_stats *tmp_mrs = &mi->r[j - 1].stats; 95 + int j; 96 + struct minstrel_rate_stats *tmp_mrs; 97 97 struct minstrel_rate_stats *cur_mrs = &mi->r[i].stats; 98 98 99 - while (j > 0 && (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) > 100 - minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma))) { 101 - j--; 99 + for (j = MAX_THR_RATES; j > 0; --j) { 102 100 tmp_mrs = &mi->r[tp_list[j - 1]].stats; 101 + if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) <= 102 + minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma)) 103 + break; 103 104 } 104 105 105 106 if (j < MAX_THR_RATES - 1)
+2
sound/pci/hda/patch_realtek.c
··· 5190 5190 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5191 5191 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5192 5192 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC292_FIXUP_DISABLE_AAMIX), 5193 + SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC292_FIXUP_DISABLE_AAMIX), 5193 5194 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5194 5195 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5195 5196 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), ··· 5292 5291 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), 5293 5292 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 5294 5293 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 5294 + SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), 5295 5295 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), 5296 5296 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), 5297 5297 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+3
sound/soc/Kconfig
··· 30 30 bool 31 31 select SND_DMAENGINE_PCM 32 32 33 + config SND_SOC_TOPOLOGY 34 + bool 35 + 33 36 # All the supported SoCs 34 37 source "sound/soc/adi/Kconfig" 35 38 source "sound/soc/atmel/Kconfig"
+3
sound/soc/Makefile
··· 1 1 snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o 2 2 snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o soc-devres.o soc-ops.o 3 + 4 + ifneq ($(CONFIG_SND_SOC_TOPOLOGY),) 3 5 snd-soc-core-objs += soc-topology.o 6 + endif 4 7 5 8 ifneq ($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),) 6 9 snd-soc-core-objs += soc-generic-dmaengine-pcm.o
+1 -1
sound/usb/card.c
··· 638 638 int err = -ENODEV; 639 639 640 640 down_read(&chip->shutdown_rwsem); 641 - if (chip->probing && chip->in_pm) 641 + if (chip->probing || chip->in_pm) 642 642 err = 0; 643 643 else if (!chip->shutdown) 644 644 err = usb_autopm_get_interface(chip->pm_intf);
+1 -1
tools/perf/config/Makefile
··· 638 638 prefix ?= $(HOME) 639 639 endif 640 640 bindir_relative = bin 641 - bindir = $(prefix)/$(bindir_relative) 641 + bindir = $(abspath $(prefix)/$(bindir_relative)) 642 642 mandir = share/man 643 643 infodir = share/info 644 644 perfexecdir = libexec/perf-core
+3 -5
tools/perf/util/stat-shadow.c
··· 85 85 else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) 86 86 update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); 87 87 else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) 88 - update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); 88 + update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]); 89 89 else if (perf_stat_evsel__is(counter, TRANSACTION_START)) 90 90 update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); 91 91 else if (perf_stat_evsel__is(counter, ELISION_START)) ··· 398 398 " # %5.2f%% aborted cycles ", 399 399 100.0 * ((total2-avg) / total)); 400 400 } else if (perf_stat_evsel__is(evsel, TRANSACTION_START) && 401 - avg > 0 && 402 401 runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { 403 402 total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); 404 403 405 - if (total) 404 + if (avg) 406 405 ratio = total / avg; 407 406 408 407 fprintf(out, " # %8.0f cycles / transaction ", ratio); 409 408 } else if (perf_stat_evsel__is(evsel, ELISION_START) && 410 - avg > 0 && 411 409 runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { 412 410 total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); 413 411 414 - if (total) 412 + if (avg) 415 413 ratio = total / avg; 416 414 417 415 fprintf(out, " # %8.0f cycles / elision ", ratio);