diff options
54 files changed, 321 insertions, 245 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 3 | 1 | VERSION = 3 |
| 2 | PATCHLEVEL = 19 | 2 | PATCHLEVEL = 19 |
| 3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
| 4 | EXTRAVERSION = -rc2 | 4 | EXTRAVERSION = -rc3 |
| 5 | NAME = Diseased Newt | 5 | NAME = Diseased Newt |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index f3b51b57740a..95c39b95e97e 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | #define NR_syscalls 318 /* length of syscall table */ | 14 | #define NR_syscalls 319 /* length of syscall table */ |
| 15 | 15 | ||
| 16 | /* | 16 | /* |
| 17 | * The following defines stop scripts/checksyscalls.sh from complaining about | 17 | * The following defines stop scripts/checksyscalls.sh from complaining about |
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 4c2240c1b0cb..461079560c78 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h | |||
| @@ -331,5 +331,6 @@ | |||
| 331 | #define __NR_getrandom 1339 | 331 | #define __NR_getrandom 1339 |
| 332 | #define __NR_memfd_create 1340 | 332 | #define __NR_memfd_create 1340 |
| 333 | #define __NR_bpf 1341 | 333 | #define __NR_bpf 1341 |
| 334 | #define __NR_execveat 1342 | ||
| 334 | 335 | ||
| 335 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ | 336 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index f5e96dffc63c..fcf8b8cbca0b 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
| @@ -1779,6 +1779,7 @@ sys_call_table: | |||
| 1779 | data8 sys_getrandom | 1779 | data8 sys_getrandom |
| 1780 | data8 sys_memfd_create // 1340 | 1780 | data8 sys_memfd_create // 1340 |
| 1781 | data8 sys_bpf | 1781 | data8 sys_bpf |
| 1782 | data8 sys_execveat | ||
| 1782 | 1783 | ||
| 1783 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1784 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
| 1784 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ | 1785 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 19c36cba37c4..a46f5f45570c 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
| @@ -86,6 +86,11 @@ extern int overlaps_crashkernel(unsigned long start, unsigned long size); | |||
| 86 | extern void reserve_crashkernel(void); | 86 | extern void reserve_crashkernel(void); |
| 87 | extern void machine_kexec_mask_interrupts(void); | 87 | extern void machine_kexec_mask_interrupts(void); |
| 88 | 88 | ||
| 89 | static inline bool kdump_in_progress(void) | ||
| 90 | { | ||
| 91 | return crashing_cpu >= 0; | ||
| 92 | } | ||
| 93 | |||
| 89 | #else /* !CONFIG_KEXEC */ | 94 | #else /* !CONFIG_KEXEC */ |
| 90 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } | 95 | static inline void crash_kexec_secondary(struct pt_regs *regs) { } |
| 91 | 96 | ||
| @@ -106,6 +111,11 @@ static inline int crash_shutdown_unregister(crash_shutdown_t handler) | |||
| 106 | return 0; | 111 | return 0; |
| 107 | } | 112 | } |
| 108 | 113 | ||
| 114 | static inline bool kdump_in_progress(void) | ||
| 115 | { | ||
| 116 | return false; | ||
| 117 | } | ||
| 118 | |||
| 109 | #endif /* CONFIG_KEXEC */ | 119 | #endif /* CONFIG_KEXEC */ |
| 110 | #endif /* ! __ASSEMBLY__ */ | 120 | #endif /* ! __ASSEMBLY__ */ |
| 111 | #endif /* __KERNEL__ */ | 121 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index ce9577d693be..91062eef582f 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
| @@ -366,3 +366,4 @@ SYSCALL_SPU(seccomp) | |||
| 366 | SYSCALL_SPU(getrandom) | 366 | SYSCALL_SPU(getrandom) |
| 367 | SYSCALL_SPU(memfd_create) | 367 | SYSCALL_SPU(memfd_create) |
| 368 | SYSCALL_SPU(bpf) | 368 | SYSCALL_SPU(bpf) |
| 369 | COMPAT_SYS(execveat) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index e0da021caa00..36b79c31eedd 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | #define __NR_syscalls 362 | 15 | #define __NR_syscalls 363 |
| 16 | 16 | ||
| 17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
| 18 | #define NR_syscalls __NR_syscalls | 18 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index f55351f2e66e..ef5b5b1f3123 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
| @@ -384,5 +384,6 @@ | |||
| 384 | #define __NR_getrandom 359 | 384 | #define __NR_getrandom 359 |
| 385 | #define __NR_memfd_create 360 | 385 | #define __NR_memfd_create 360 |
| 386 | #define __NR_bpf 361 | 386 | #define __NR_bpf 361 |
| 387 | #define __NR_execveat 362 | ||
| 387 | 388 | ||
| 388 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 389 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 879b3aacac32..f96d1ec24189 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
| @@ -330,7 +330,7 @@ void default_machine_kexec(struct kimage *image) | |||
| 330 | * using debugger IPI. | 330 | * using debugger IPI. |
| 331 | */ | 331 | */ |
| 332 | 332 | ||
| 333 | if (crashing_cpu == -1) | 333 | if (!kdump_in_progress()) |
| 334 | kexec_prepare_cpus(); | 334 | kexec_prepare_cpus(); |
| 335 | 335 | ||
| 336 | pr_debug("kexec: Starting switchover sequence.\n"); | 336 | pr_debug("kexec: Starting switchover sequence.\n"); |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 8ec017cb4446..8b2d2dc8ef10 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
| @@ -700,6 +700,7 @@ void start_secondary(void *unused) | |||
| 700 | smp_store_cpu_info(cpu); | 700 | smp_store_cpu_info(cpu); |
| 701 | set_dec(tb_ticks_per_jiffy); | 701 | set_dec(tb_ticks_per_jiffy); |
| 702 | preempt_disable(); | 702 | preempt_disable(); |
| 703 | cpu_callin_map[cpu] = 1; | ||
| 703 | 704 | ||
| 704 | if (smp_ops->setup_cpu) | 705 | if (smp_ops->setup_cpu) |
| 705 | smp_ops->setup_cpu(cpu); | 706 | smp_ops->setup_cpu(cpu); |
| @@ -738,14 +739,6 @@ void start_secondary(void *unused) | |||
| 738 | notify_cpu_starting(cpu); | 739 | notify_cpu_starting(cpu); |
| 739 | set_cpu_online(cpu, true); | 740 | set_cpu_online(cpu, true); |
| 740 | 741 | ||
| 741 | /* | ||
| 742 | * CPU must be marked active and online before we signal back to the | ||
| 743 | * master, because the scheduler needs to see the cpu_online and | ||
| 744 | * cpu_active bits set. | ||
| 745 | */ | ||
| 746 | smp_wmb(); | ||
| 747 | cpu_callin_map[cpu] = 1; | ||
| 748 | |||
| 749 | local_irq_enable(); | 742 | local_irq_enable(); |
| 750 | 743 | ||
| 751 | cpu_startup_entry(CPUHP_ONLINE); | 744 | cpu_startup_entry(CPUHP_ONLINE); |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 469751d92004..b5682fd6c984 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <asm/trace.h> | 43 | #include <asm/trace.h> |
| 44 | #include <asm/firmware.h> | 44 | #include <asm/firmware.h> |
| 45 | #include <asm/plpar_wrappers.h> | 45 | #include <asm/plpar_wrappers.h> |
| 46 | #include <asm/kexec.h> | ||
| 46 | #include <asm/fadump.h> | 47 | #include <asm/fadump.h> |
| 47 | 48 | ||
| 48 | #include "pseries.h" | 49 | #include "pseries.h" |
| @@ -267,8 +268,13 @@ static void pSeries_lpar_hptab_clear(void) | |||
| 267 | * out to the user, but at least this will stop us from | 268 | * out to the user, but at least this will stop us from |
| 268 | * continuing on further and creating an even more | 269 | * continuing on further and creating an even more |
| 269 | * difficult to debug situation. | 270 | * difficult to debug situation. |
| 271 | * | ||
| 272 | * There is a known problem when kdump'ing, if cpus are offline | ||
| 273 | * the above call will fail. Rather than panicking again, keep | ||
| 274 | * going and hope the kdump kernel is also little endian, which | ||
| 275 | * it usually is. | ||
| 270 | */ | 276 | */ |
| 271 | if (rc) | 277 | if (rc && !kdump_in_progress()) |
| 272 | panic("Could not enable big endian exceptions"); | 278 | panic("Could not enable big endian exceptions"); |
| 273 | } | 279 | } |
| 274 | #endif | 280 | #endif |
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile index fd0f848938cc..5a4a089e8b1f 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile | |||
| @@ -26,7 +26,6 @@ obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o | |||
| 26 | 26 | ||
| 27 | obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o | 27 | obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o |
| 28 | obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o | 28 | obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o |
| 29 | obj-$(CONFIG_CRYPTO_SHA1_MB) += sha-mb/ | ||
| 30 | obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o | 29 | obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o |
| 31 | obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o | 30 | obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o |
| 32 | obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o | 31 | obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o |
| @@ -46,6 +45,7 @@ endif | |||
| 46 | ifeq ($(avx2_supported),yes) | 45 | ifeq ($(avx2_supported),yes) |
| 47 | obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o | 46 | obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o |
| 48 | obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o | 47 | obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o |
| 48 | obj-$(CONFIG_CRYPTO_SHA1_MB) += sha-mb/ | ||
| 49 | endif | 49 | endif |
| 50 | 50 | ||
| 51 | aes-i586-y := aes-i586-asm_32.o aes_glue.o | 51 | aes-i586-y := aes-i586-asm_32.o aes_glue.o |
diff --git a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S index 2df2a0298f5a..a916c4a61165 100644 --- a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S +++ b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S | |||
| @@ -208,7 +208,7 @@ ddq_add_8: | |||
| 208 | 208 | ||
| 209 | .if (klen == KEY_128) | 209 | .if (klen == KEY_128) |
| 210 | .if (load_keys) | 210 | .if (load_keys) |
| 211 | vmovdqa 3*16(p_keys), xkeyA | 211 | vmovdqa 3*16(p_keys), xkey4 |
| 212 | .endif | 212 | .endif |
| 213 | .else | 213 | .else |
| 214 | vmovdqa 3*16(p_keys), xkeyA | 214 | vmovdqa 3*16(p_keys), xkeyA |
| @@ -224,7 +224,7 @@ ddq_add_8: | |||
| 224 | add $(16*by), p_in | 224 | add $(16*by), p_in |
| 225 | 225 | ||
| 226 | .if (klen == KEY_128) | 226 | .if (klen == KEY_128) |
| 227 | vmovdqa 4*16(p_keys), xkey4 | 227 | vmovdqa 4*16(p_keys), xkeyB |
| 228 | .else | 228 | .else |
| 229 | .if (load_keys) | 229 | .if (load_keys) |
| 230 | vmovdqa 4*16(p_keys), xkey4 | 230 | vmovdqa 4*16(p_keys), xkey4 |
| @@ -234,7 +234,12 @@ ddq_add_8: | |||
| 234 | .set i, 0 | 234 | .set i, 0 |
| 235 | .rept by | 235 | .rept by |
| 236 | club XDATA, i | 236 | club XDATA, i |
| 237 | vaesenc xkeyA, var_xdata, var_xdata /* key 3 */ | 237 | /* key 3 */ |
| 238 | .if (klen == KEY_128) | ||
| 239 | vaesenc xkey4, var_xdata, var_xdata | ||
| 240 | .else | ||
| 241 | vaesenc xkeyA, var_xdata, var_xdata | ||
| 242 | .endif | ||
| 238 | .set i, (i +1) | 243 | .set i, (i +1) |
| 239 | .endr | 244 | .endr |
| 240 | 245 | ||
| @@ -243,13 +248,18 @@ ddq_add_8: | |||
| 243 | .set i, 0 | 248 | .set i, 0 |
| 244 | .rept by | 249 | .rept by |
| 245 | club XDATA, i | 250 | club XDATA, i |
| 246 | vaesenc xkey4, var_xdata, var_xdata /* key 4 */ | 251 | /* key 4 */ |
| 252 | .if (klen == KEY_128) | ||
| 253 | vaesenc xkeyB, var_xdata, var_xdata | ||
| 254 | .else | ||
| 255 | vaesenc xkey4, var_xdata, var_xdata | ||
| 256 | .endif | ||
| 247 | .set i, (i +1) | 257 | .set i, (i +1) |
| 248 | .endr | 258 | .endr |
| 249 | 259 | ||
| 250 | .if (klen == KEY_128) | 260 | .if (klen == KEY_128) |
| 251 | .if (load_keys) | 261 | .if (load_keys) |
| 252 | vmovdqa 6*16(p_keys), xkeyB | 262 | vmovdqa 6*16(p_keys), xkey8 |
| 253 | .endif | 263 | .endif |
| 254 | .else | 264 | .else |
| 255 | vmovdqa 6*16(p_keys), xkeyB | 265 | vmovdqa 6*16(p_keys), xkeyB |
| @@ -267,12 +277,17 @@ ddq_add_8: | |||
| 267 | .set i, 0 | 277 | .set i, 0 |
| 268 | .rept by | 278 | .rept by |
| 269 | club XDATA, i | 279 | club XDATA, i |
| 270 | vaesenc xkeyB, var_xdata, var_xdata /* key 6 */ | 280 | /* key 6 */ |
| 281 | .if (klen == KEY_128) | ||
| 282 | vaesenc xkey8, var_xdata, var_xdata | ||
| 283 | .else | ||
| 284 | vaesenc xkeyB, var_xdata, var_xdata | ||
| 285 | .endif | ||
| 271 | .set i, (i +1) | 286 | .set i, (i +1) |
| 272 | .endr | 287 | .endr |
| 273 | 288 | ||
| 274 | .if (klen == KEY_128) | 289 | .if (klen == KEY_128) |
| 275 | vmovdqa 8*16(p_keys), xkey8 | 290 | vmovdqa 8*16(p_keys), xkeyB |
| 276 | .else | 291 | .else |
| 277 | .if (load_keys) | 292 | .if (load_keys) |
| 278 | vmovdqa 8*16(p_keys), xkey8 | 293 | vmovdqa 8*16(p_keys), xkey8 |
| @@ -288,7 +303,7 @@ ddq_add_8: | |||
| 288 | 303 | ||
| 289 | .if (klen == KEY_128) | 304 | .if (klen == KEY_128) |
| 290 | .if (load_keys) | 305 | .if (load_keys) |
| 291 | vmovdqa 9*16(p_keys), xkeyA | 306 | vmovdqa 9*16(p_keys), xkey12 |
| 292 | .endif | 307 | .endif |
| 293 | .else | 308 | .else |
| 294 | vmovdqa 9*16(p_keys), xkeyA | 309 | vmovdqa 9*16(p_keys), xkeyA |
| @@ -297,7 +312,12 @@ ddq_add_8: | |||
| 297 | .set i, 0 | 312 | .set i, 0 |
| 298 | .rept by | 313 | .rept by |
| 299 | club XDATA, i | 314 | club XDATA, i |
| 300 | vaesenc xkey8, var_xdata, var_xdata /* key 8 */ | 315 | /* key 8 */ |
| 316 | .if (klen == KEY_128) | ||
| 317 | vaesenc xkeyB, var_xdata, var_xdata | ||
| 318 | .else | ||
| 319 | vaesenc xkey8, var_xdata, var_xdata | ||
| 320 | .endif | ||
| 301 | .set i, (i +1) | 321 | .set i, (i +1) |
| 302 | .endr | 322 | .endr |
| 303 | 323 | ||
| @@ -306,7 +326,12 @@ ddq_add_8: | |||
| 306 | .set i, 0 | 326 | .set i, 0 |
| 307 | .rept by | 327 | .rept by |
| 308 | club XDATA, i | 328 | club XDATA, i |
| 309 | vaesenc xkeyA, var_xdata, var_xdata /* key 9 */ | 329 | /* key 9 */ |
| 330 | .if (klen == KEY_128) | ||
| 331 | vaesenc xkey12, var_xdata, var_xdata | ||
| 332 | .else | ||
| 333 | vaesenc xkeyA, var_xdata, var_xdata | ||
| 334 | .endif | ||
| 310 | .set i, (i +1) | 335 | .set i, (i +1) |
| 311 | .endr | 336 | .endr |
| 312 | 337 | ||
| @@ -412,7 +437,6 @@ ddq_add_8: | |||
| 412 | /* main body of aes ctr load */ | 437 | /* main body of aes ctr load */ |
| 413 | 438 | ||
| 414 | .macro do_aes_ctrmain key_len | 439 | .macro do_aes_ctrmain key_len |
| 415 | |||
| 416 | cmp $16, num_bytes | 440 | cmp $16, num_bytes |
| 417 | jb .Ldo_return2\key_len | 441 | jb .Ldo_return2\key_len |
| 418 | 442 | ||
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index fd5a5e85d7dc..982b96323f82 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c | |||
| @@ -969,7 +969,8 @@ static void sender(void *send_info, | |||
| 969 | 969 | ||
| 970 | do_gettimeofday(&t); | 970 | do_gettimeofday(&t); |
| 971 | pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n", | 971 | pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n", |
| 972 | msg->data[0], msg->data[1], t.tv_sec, t.tv_usec); | 972 | msg->data[0], msg->data[1], |
| 973 | (long) t.tv_sec, (long) t.tv_usec); | ||
| 973 | } | 974 | } |
| 974 | } | 975 | } |
| 975 | 976 | ||
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 1232336b960e..40dfbc0444c0 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
| @@ -4029,14 +4029,6 @@ static int device_notifier(struct notifier_block *nb, | |||
| 4029 | if (action != BUS_NOTIFY_REMOVED_DEVICE) | 4029 | if (action != BUS_NOTIFY_REMOVED_DEVICE) |
| 4030 | return 0; | 4030 | return 0; |
| 4031 | 4031 | ||
| 4032 | /* | ||
| 4033 | * If the device is still attached to a device driver we can't | ||
| 4034 | * tear down the domain yet as DMA mappings may still be in use. | ||
| 4035 | * Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that. | ||
| 4036 | */ | ||
| 4037 | if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL) | ||
| 4038 | return 0; | ||
| 4039 | |||
| 4040 | domain = find_domain(dev); | 4032 | domain = find_domain(dev); |
| 4041 | if (!domain) | 4033 | if (!domain) |
| 4042 | return 0; | 4034 | return 0; |
| @@ -4428,6 +4420,10 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, | |||
| 4428 | domain_remove_one_dev_info(old_domain, dev); | 4420 | domain_remove_one_dev_info(old_domain, dev); |
| 4429 | else | 4421 | else |
| 4430 | domain_remove_dev_info(old_domain); | 4422 | domain_remove_dev_info(old_domain); |
| 4423 | |||
| 4424 | if (!domain_type_is_vm_or_si(old_domain) && | ||
| 4425 | list_empty(&old_domain->devices)) | ||
| 4426 | domain_exit(old_domain); | ||
| 4431 | } | 4427 | } |
| 4432 | } | 4428 | } |
| 4433 | 4429 | ||
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 68dfb0fd5ee9..748693192c20 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c | |||
| @@ -558,7 +558,7 @@ static pmd_t *ipmmu_alloc_pmd(struct ipmmu_vmsa_device *mmu, pgd_t *pgd, | |||
| 558 | 558 | ||
| 559 | static u64 ipmmu_page_prot(unsigned int prot, u64 type) | 559 | static u64 ipmmu_page_prot(unsigned int prot, u64 type) |
| 560 | { | 560 | { |
| 561 | u64 pgprot = ARM_VMSA_PTE_XN | ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF | 561 | u64 pgprot = ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF |
| 562 | | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV | 562 | | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV |
| 563 | | ARM_VMSA_PTE_NS | type; | 563 | | ARM_VMSA_PTE_NS | type; |
| 564 | 564 | ||
| @@ -568,8 +568,8 @@ static u64 ipmmu_page_prot(unsigned int prot, u64 type) | |||
| 568 | if (prot & IOMMU_CACHE) | 568 | if (prot & IOMMU_CACHE) |
| 569 | pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT; | 569 | pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT; |
| 570 | 570 | ||
| 571 | if (prot & IOMMU_EXEC) | 571 | if (prot & IOMMU_NOEXEC) |
| 572 | pgprot &= ~ARM_VMSA_PTE_XN; | 572 | pgprot |= ARM_VMSA_PTE_XN; |
| 573 | else if (!(prot & (IOMMU_READ | IOMMU_WRITE))) | 573 | else if (!(prot & (IOMMU_READ | IOMMU_WRITE))) |
| 574 | /* If no access create a faulting entry to avoid TLB fills. */ | 574 | /* If no access create a faulting entry to avoid TLB fills. */ |
| 575 | pgprot &= ~ARM_VMSA_PTE_PAGE; | 575 | pgprot &= ~ARM_VMSA_PTE_PAGE; |
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index b2023af384b9..6a8b1ec4a48a 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
| @@ -1009,7 +1009,6 @@ static struct platform_driver rk_iommu_driver = { | |||
| 1009 | .remove = rk_iommu_remove, | 1009 | .remove = rk_iommu_remove, |
| 1010 | .driver = { | 1010 | .driver = { |
| 1011 | .name = "rk_iommu", | 1011 | .name = "rk_iommu", |
| 1012 | .owner = THIS_MODULE, | ||
| 1013 | .of_match_table = of_match_ptr(rk_iommu_dt_ids), | 1012 | .of_match_table = of_match_ptr(rk_iommu_dt_ids), |
| 1014 | }, | 1013 | }, |
| 1015 | }; | 1014 | }; |
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 1fcd5568a352..f3470d96837a 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c | |||
| @@ -850,8 +850,10 @@ static int emac_probe(struct platform_device *pdev) | |||
| 850 | } | 850 | } |
| 851 | 851 | ||
| 852 | db->clk = devm_clk_get(&pdev->dev, NULL); | 852 | db->clk = devm_clk_get(&pdev->dev, NULL); |
| 853 | if (IS_ERR(db->clk)) | 853 | if (IS_ERR(db->clk)) { |
| 854 | ret = PTR_ERR(db->clk); | ||
| 854 | goto out; | 855 | goto out; |
| 856 | } | ||
| 855 | 857 | ||
| 856 | clk_prepare_enable(db->clk); | 858 | clk_prepare_enable(db->clk); |
| 857 | 859 | ||
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 3498760dc22a..760c72c6e2ac 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c | |||
| @@ -1170,10 +1170,6 @@ tx_request_irq_error: | |||
| 1170 | init_error: | 1170 | init_error: |
| 1171 | free_skbufs(dev); | 1171 | free_skbufs(dev); |
| 1172 | alloc_skbuf_error: | 1172 | alloc_skbuf_error: |
| 1173 | if (priv->phydev) { | ||
| 1174 | phy_disconnect(priv->phydev); | ||
| 1175 | priv->phydev = NULL; | ||
| 1176 | } | ||
| 1177 | phy_error: | 1173 | phy_error: |
| 1178 | return ret; | 1174 | return ret; |
| 1179 | } | 1175 | } |
| @@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev) | |||
| 1186 | int ret; | 1182 | int ret; |
| 1187 | unsigned long int flags; | 1183 | unsigned long int flags; |
| 1188 | 1184 | ||
| 1189 | /* Stop and disconnect the PHY */ | 1185 | /* Stop the PHY */ |
| 1190 | if (priv->phydev) { | 1186 | if (priv->phydev) |
| 1191 | phy_stop(priv->phydev); | 1187 | phy_stop(priv->phydev); |
| 1192 | phy_disconnect(priv->phydev); | ||
| 1193 | priv->phydev = NULL; | ||
| 1194 | } | ||
| 1195 | 1188 | ||
| 1196 | netif_stop_queue(dev); | 1189 | netif_stop_queue(dev); |
| 1197 | napi_disable(&priv->napi); | 1190 | napi_disable(&priv->napi); |
| @@ -1525,6 +1518,10 @@ err_free_netdev: | |||
| 1525 | static int altera_tse_remove(struct platform_device *pdev) | 1518 | static int altera_tse_remove(struct platform_device *pdev) |
| 1526 | { | 1519 | { |
| 1527 | struct net_device *ndev = platform_get_drvdata(pdev); | 1520 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 1521 | struct altera_tse_private *priv = netdev_priv(ndev); | ||
| 1522 | |||
| 1523 | if (priv->phydev) | ||
| 1524 | phy_disconnect(priv->phydev); | ||
| 1528 | 1525 | ||
| 1529 | platform_set_drvdata(pdev, NULL); | 1526 | platform_set_drvdata(pdev, NULL); |
| 1530 | altera_tse_mdio_destroy(ndev); | 1527 | altera_tse_mdio_destroy(ndev); |
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 705f334ebb85..b29e027c476e 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
| @@ -1616,7 +1616,7 @@ static int enic_open(struct net_device *netdev) | |||
| 1616 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { | 1616 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { |
| 1617 | netdev_err(netdev, "Unable to alloc receive buffers\n"); | 1617 | netdev_err(netdev, "Unable to alloc receive buffers\n"); |
| 1618 | err = -ENOMEM; | 1618 | err = -ENOMEM; |
| 1619 | goto err_out_notify_unset; | 1619 | goto err_out_free_rq; |
| 1620 | } | 1620 | } |
| 1621 | } | 1621 | } |
| 1622 | 1622 | ||
| @@ -1649,7 +1649,9 @@ static int enic_open(struct net_device *netdev) | |||
| 1649 | 1649 | ||
| 1650 | return 0; | 1650 | return 0; |
| 1651 | 1651 | ||
| 1652 | err_out_notify_unset: | 1652 | err_out_free_rq: |
| 1653 | for (i = 0; i < enic->rq_count; i++) | ||
| 1654 | vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); | ||
| 1653 | enic_dev_notify_unset(enic); | 1655 | enic_dev_notify_unset(enic); |
| 1654 | err_out_free_intr: | 1656 | err_out_free_intr: |
| 1655 | enic_free_intr(enic); | 1657 | enic_free_intr(enic); |
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 781065eb5431..e9c3a87e5b11 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
| @@ -1543,7 +1543,7 @@ static int e100_phy_init(struct nic *nic) | |||
| 1543 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); | 1543 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); |
| 1544 | } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && | 1544 | } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && |
| 1545 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && | 1545 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && |
| 1546 | !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { | 1546 | (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { |
| 1547 | /* enable/disable MDI/MDI-X auto-switching. */ | 1547 | /* enable/disable MDI/MDI-X auto-switching. */ |
| 1548 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, | 1548 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, |
| 1549 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); | 1549 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 433a55886ad2..cb0de455683e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c | |||
| @@ -829,7 +829,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, | |||
| 829 | if (desc_n >= ring->count || desc_n < 0) { | 829 | if (desc_n >= ring->count || desc_n < 0) { |
| 830 | dev_info(&pf->pdev->dev, | 830 | dev_info(&pf->pdev->dev, |
| 831 | "descriptor %d not found\n", desc_n); | 831 | "descriptor %d not found\n", desc_n); |
| 832 | return; | 832 | goto out; |
| 833 | } | 833 | } |
| 834 | if (!is_rx_ring) { | 834 | if (!is_rx_ring) { |
| 835 | txd = I40E_TX_DESC(ring, desc_n); | 835 | txd = I40E_TX_DESC(ring, desc_n); |
| @@ -855,6 +855,8 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, | |||
| 855 | } else { | 855 | } else { |
| 856 | dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); | 856 | dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
| 857 | } | 857 | } |
| 858 | |||
| 859 | out: | ||
| 858 | kfree(ring); | 860 | kfree(ring); |
| 859 | } | 861 | } |
| 860 | 862 | ||
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 051ea94bdcd3..0f69ef81751a 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c | |||
| @@ -1125,7 +1125,7 @@ static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask) | |||
| 1125 | u32 swmask = mask; | 1125 | u32 swmask = mask; |
| 1126 | u32 fwmask = mask << 16; | 1126 | u32 fwmask = mask << 16; |
| 1127 | s32 ret_val = 0; | 1127 | s32 ret_val = 0; |
| 1128 | s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ | 1128 | s32 i = 0, timeout = 200; |
| 1129 | 1129 | ||
| 1130 | while (i < timeout) { | 1130 | while (i < timeout) { |
| 1131 | if (igb_get_hw_semaphore(hw)) { | 1131 | if (igb_get_hw_semaphore(hw)) { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 943cbd47d832..03e9eb0dc761 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
| @@ -1829,7 +1829,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1829 | err = mlx4_dev_cap(dev, &dev_cap); | 1829 | err = mlx4_dev_cap(dev, &dev_cap); |
| 1830 | if (err) { | 1830 | if (err) { |
| 1831 | mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); | 1831 | mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); |
| 1832 | goto err_stop_fw; | 1832 | return err; |
| 1833 | } | 1833 | } |
| 1834 | 1834 | ||
| 1835 | choose_steering_mode(dev, &dev_cap); | 1835 | choose_steering_mode(dev, &dev_cap); |
| @@ -1860,7 +1860,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1860 | &init_hca); | 1860 | &init_hca); |
| 1861 | if ((long long) icm_size < 0) { | 1861 | if ((long long) icm_size < 0) { |
| 1862 | err = icm_size; | 1862 | err = icm_size; |
| 1863 | goto err_stop_fw; | 1863 | return err; |
| 1864 | } | 1864 | } |
| 1865 | 1865 | ||
| 1866 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; | 1866 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; |
| @@ -1874,7 +1874,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1874 | 1874 | ||
| 1875 | err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); | 1875 | err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); |
| 1876 | if (err) | 1876 | if (err) |
| 1877 | goto err_stop_fw; | 1877 | return err; |
| 1878 | 1878 | ||
| 1879 | err = mlx4_INIT_HCA(dev, &init_hca); | 1879 | err = mlx4_INIT_HCA(dev, &init_hca); |
| 1880 | if (err) { | 1880 | if (err) { |
| @@ -1886,7 +1886,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
| 1886 | err = mlx4_query_func(dev, &dev_cap); | 1886 | err = mlx4_query_func(dev, &dev_cap); |
| 1887 | if (err < 0) { | 1887 | if (err < 0) { |
| 1888 | mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); | 1888 | mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); |
| 1889 | goto err_stop_fw; | 1889 | goto err_close; |
| 1890 | } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { | 1890 | } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { |
| 1891 | dev->caps.num_eqs = dev_cap.max_eqs; | 1891 | dev->caps.num_eqs = dev_cap.max_eqs; |
| 1892 | dev->caps.reserved_eqs = dev_cap.reserved_eqs; | 1892 | dev->caps.reserved_eqs = dev_cap.reserved_eqs; |
| @@ -2006,11 +2006,6 @@ err_free_icm: | |||
| 2006 | if (!mlx4_is_slave(dev)) | 2006 | if (!mlx4_is_slave(dev)) |
| 2007 | mlx4_free_icms(dev); | 2007 | mlx4_free_icms(dev); |
| 2008 | 2008 | ||
| 2009 | err_stop_fw: | ||
| 2010 | if (!mlx4_is_slave(dev)) { | ||
| 2011 | mlx4_UNMAP_FA(dev); | ||
| 2012 | mlx4_free_icm(dev, priv->fw.fw_icm, 0); | ||
| 2013 | } | ||
| 2014 | return err; | 2009 | return err; |
| 2015 | } | 2010 | } |
| 2016 | 2011 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index d6f549685c0f..7094a9c70fd5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
| @@ -584,6 +584,7 @@ EXPORT_SYMBOL_GPL(mlx4_mr_free); | |||
| 584 | void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) | 584 | void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) |
| 585 | { | 585 | { |
| 586 | mlx4_mtt_cleanup(dev, &mr->mtt); | 586 | mlx4_mtt_cleanup(dev, &mr->mtt); |
| 587 | mr->mtt.order = -1; | ||
| 587 | } | 588 | } |
| 588 | EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); | 589 | EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); |
| 589 | 590 | ||
| @@ -593,14 +594,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, | |||
| 593 | { | 594 | { |
| 594 | int err; | 595 | int err; |
| 595 | 596 | ||
| 596 | mpt_entry->start = cpu_to_be64(iova); | ||
| 597 | mpt_entry->length = cpu_to_be64(size); | ||
| 598 | mpt_entry->entity_size = cpu_to_be32(page_shift); | ||
| 599 | |||
| 600 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); | 597 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); |
| 601 | if (err) | 598 | if (err) |
| 602 | return err; | 599 | return err; |
| 603 | 600 | ||
| 601 | mpt_entry->start = cpu_to_be64(mr->iova); | ||
| 602 | mpt_entry->length = cpu_to_be64(mr->size); | ||
| 603 | mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); | ||
| 604 | |||
| 604 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | | 605 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | |
| 605 | MLX4_MPT_PD_FLAG_EN_INV); | 606 | MLX4_MPT_PD_FLAG_EN_INV); |
| 606 | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | | 607 | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | |
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index af099057f0e9..71af98bb72cb 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c | |||
| @@ -4033,8 +4033,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 4033 | (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 4033 | (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
| 4034 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), | 4034 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
| 4035 | &mgp->cmd_bus, GFP_KERNEL); | 4035 | &mgp->cmd_bus, GFP_KERNEL); |
| 4036 | if (mgp->cmd == NULL) | 4036 | if (!mgp->cmd) { |
| 4037 | status = -ENOMEM; | ||
| 4037 | goto abort_with_enabled; | 4038 | goto abort_with_enabled; |
| 4039 | } | ||
| 4038 | 4040 | ||
| 4039 | mgp->board_span = pci_resource_len(pdev, 0); | 4041 | mgp->board_span = pci_resource_len(pdev, 0); |
| 4040 | mgp->iomem_base = pci_resource_start(pdev, 0); | 4042 | mgp->iomem_base = pci_resource_start(pdev, 0); |
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index c2f09af5c25b..4847713211ca 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c | |||
| @@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev) | |||
| 146 | { | 146 | { |
| 147 | int i = 0; | 147 | int i = 0; |
| 148 | 148 | ||
| 149 | while (i < 10) { | 149 | do { |
| 150 | if (i) | ||
| 151 | ssleep(1); | ||
| 152 | |||
| 153 | if (ql_sem_lock(qdev, | 150 | if (ql_sem_lock(qdev, |
| 154 | QL_DRVR_SEM_MASK, | 151 | QL_DRVR_SEM_MASK, |
| 155 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) | 152 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) |
| @@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev) | |||
| 158 | "driver lock acquired\n"); | 155 | "driver lock acquired\n"); |
| 159 | return 1; | 156 | return 1; |
| 160 | } | 157 | } |
| 161 | } | 158 | ssleep(1); |
| 159 | } while (++i < 10); | ||
| 162 | 160 | ||
| 163 | netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); | 161 | netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); |
| 164 | return 0; | 162 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 9929b97cfb36..2528c3fb6b90 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
| @@ -2605,6 +2605,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 2605 | } else { | 2605 | } else { |
| 2606 | dev_err(&pdev->dev, | 2606 | dev_err(&pdev->dev, |
| 2607 | "%s: failed. Please Reboot\n", __func__); | 2607 | "%s: failed. Please Reboot\n", __func__); |
| 2608 | err = -ENODEV; | ||
| 2608 | goto err_out_free_hw; | 2609 | goto err_out_free_hw; |
| 2609 | } | 2610 | } |
| 2610 | 2611 | ||
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c560f9aeb55d..e61ee8351272 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
| @@ -757,6 +757,14 @@ requeue: | |||
| 757 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) | 757 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) |
| 758 | { | 758 | { |
| 759 | struct cpsw_priv *priv = dev_id; | 759 | struct cpsw_priv *priv = dev_id; |
| 760 | int value = irq - priv->irqs_table[0]; | ||
| 761 | |||
| 762 | /* NOTICE: Ending IRQ here. The trick with the 'value' variable above | ||
| 763 | * is to make sure we will always write the correct value to the EOI | ||
| 764 | * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2 | ||
| 765 | * for TX Interrupt and 3 for MISC Interrupt. | ||
| 766 | */ | ||
| 767 | cpdma_ctlr_eoi(priv->dma, value); | ||
| 760 | 768 | ||
| 761 | cpsw_intr_disable(priv); | 769 | cpsw_intr_disable(priv); |
| 762 | if (priv->irq_enabled == true) { | 770 | if (priv->irq_enabled == true) { |
| @@ -786,8 +794,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget) | |||
| 786 | int num_tx, num_rx; | 794 | int num_tx, num_rx; |
| 787 | 795 | ||
| 788 | num_tx = cpdma_chan_process(priv->txch, 128); | 796 | num_tx = cpdma_chan_process(priv->txch, 128); |
| 789 | if (num_tx) | ||
| 790 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
| 791 | 797 | ||
| 792 | num_rx = cpdma_chan_process(priv->rxch, budget); | 798 | num_rx = cpdma_chan_process(priv->rxch, budget); |
| 793 | if (num_rx < budget) { | 799 | if (num_rx < budget) { |
| @@ -795,7 +801,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget) | |||
| 795 | 801 | ||
| 796 | napi_complete(napi); | 802 | napi_complete(napi); |
| 797 | cpsw_intr_enable(priv); | 803 | cpsw_intr_enable(priv); |
| 798 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
| 799 | prim_cpsw = cpsw_get_slave_priv(priv, 0); | 804 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
| 800 | if (prim_cpsw->irq_enabled == false) { | 805 | if (prim_cpsw->irq_enabled == false) { |
| 801 | prim_cpsw->irq_enabled = true; | 806 | prim_cpsw->irq_enabled = true; |
| @@ -1310,8 +1315,6 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
| 1310 | napi_enable(&priv->napi); | 1315 | napi_enable(&priv->napi); |
| 1311 | cpdma_ctlr_start(priv->dma); | 1316 | cpdma_ctlr_start(priv->dma); |
| 1312 | cpsw_intr_enable(priv); | 1317 | cpsw_intr_enable(priv); |
| 1313 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
| 1314 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
| 1315 | 1318 | ||
| 1316 | prim_cpsw = cpsw_get_slave_priv(priv, 0); | 1319 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
| 1317 | if (prim_cpsw->irq_enabled == false) { | 1320 | if (prim_cpsw->irq_enabled == false) { |
| @@ -1578,9 +1581,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev) | |||
| 1578 | cpdma_chan_start(priv->txch); | 1581 | cpdma_chan_start(priv->txch); |
| 1579 | cpdma_ctlr_int_ctrl(priv->dma, true); | 1582 | cpdma_ctlr_int_ctrl(priv->dma, true); |
| 1580 | cpsw_intr_enable(priv); | 1583 | cpsw_intr_enable(priv); |
| 1581 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
| 1582 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
| 1583 | |||
| 1584 | } | 1584 | } |
| 1585 | 1585 | ||
| 1586 | static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) | 1586 | static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) |
| @@ -1620,9 +1620,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev) | |||
| 1620 | cpsw_interrupt(ndev->irq, priv); | 1620 | cpsw_interrupt(ndev->irq, priv); |
| 1621 | cpdma_ctlr_int_ctrl(priv->dma, true); | 1621 | cpdma_ctlr_int_ctrl(priv->dma, true); |
| 1622 | cpsw_intr_enable(priv); | 1622 | cpsw_intr_enable(priv); |
| 1623 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
| 1624 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
| 1625 | |||
| 1626 | } | 1623 | } |
| 1627 | #endif | 1624 | #endif |
| 1628 | 1625 | ||
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 9c2d91ea0af4..dbcbf0c5bcfa 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c | |||
| @@ -1043,6 +1043,7 @@ static int temac_of_probe(struct platform_device *op) | |||
| 1043 | lp->regs = of_iomap(op->dev.of_node, 0); | 1043 | lp->regs = of_iomap(op->dev.of_node, 0); |
| 1044 | if (!lp->regs) { | 1044 | if (!lp->regs) { |
| 1045 | dev_err(&op->dev, "could not map temac regs.\n"); | 1045 | dev_err(&op->dev, "could not map temac regs.\n"); |
| 1046 | rc = -ENOMEM; | ||
| 1046 | goto nodev; | 1047 | goto nodev; |
| 1047 | } | 1048 | } |
| 1048 | 1049 | ||
| @@ -1062,6 +1063,7 @@ static int temac_of_probe(struct platform_device *op) | |||
| 1062 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); | 1063 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
| 1063 | if (!np) { | 1064 | if (!np) { |
| 1064 | dev_err(&op->dev, "could not find DMA node\n"); | 1065 | dev_err(&op->dev, "could not find DMA node\n"); |
| 1066 | rc = -ENODEV; | ||
| 1065 | goto err_iounmap; | 1067 | goto err_iounmap; |
| 1066 | } | 1068 | } |
| 1067 | 1069 | ||
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index c18a0c637c44..a6d2860b712c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c | |||
| @@ -1501,6 +1501,7 @@ static int axienet_of_probe(struct platform_device *op) | |||
| 1501 | lp->regs = of_iomap(op->dev.of_node, 0); | 1501 | lp->regs = of_iomap(op->dev.of_node, 0); |
| 1502 | if (!lp->regs) { | 1502 | if (!lp->regs) { |
| 1503 | dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); | 1503 | dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); |
| 1504 | ret = -ENOMEM; | ||
| 1504 | goto nodev; | 1505 | goto nodev; |
| 1505 | } | 1506 | } |
| 1506 | /* Setup checksum offload, but default to off if not specified */ | 1507 | /* Setup checksum offload, but default to off if not specified */ |
| @@ -1563,6 +1564,7 @@ static int axienet_of_probe(struct platform_device *op) | |||
| 1563 | np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); | 1564 | np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); |
| 1564 | if (!np) { | 1565 | if (!np) { |
| 1565 | dev_err(&op->dev, "could not find DMA node\n"); | 1566 | dev_err(&op->dev, "could not find DMA node\n"); |
| 1567 | ret = -ENODEV; | ||
| 1566 | goto err_iounmap; | 1568 | goto err_iounmap; |
| 1567 | } | 1569 | } |
| 1568 | lp->dma_regs = of_iomap(np, 0); | 1570 | lp->dma_regs = of_iomap(np, 0); |
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 24858799c204..9d4ce388510a 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c | |||
| @@ -1109,6 +1109,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev) | |||
| 1109 | res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); | 1109 | res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); |
| 1110 | if (!res) { | 1110 | if (!res) { |
| 1111 | dev_err(dev, "no IRQ found\n"); | 1111 | dev_err(dev, "no IRQ found\n"); |
| 1112 | rc = -ENXIO; | ||
| 1112 | goto error; | 1113 | goto error; |
| 1113 | } | 1114 | } |
| 1114 | 1115 | ||
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b8a82b86f909..602dc6668c3a 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -56,6 +56,8 @@ struct qmi_wwan_state { | |||
| 56 | /* default ethernet address used by the modem */ | 56 | /* default ethernet address used by the modem */ |
| 57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; | 57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; |
| 58 | 58 | ||
| 59 | static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; | ||
| 60 | |||
| 59 | /* Make up an ethernet header if the packet doesn't have one. | 61 | /* Make up an ethernet header if the packet doesn't have one. |
| 60 | * | 62 | * |
| 61 | * A firmware bug common among several devices cause them to send raw | 63 | * A firmware bug common among several devices cause them to send raw |
| @@ -332,10 +334,12 @@ next_desc: | |||
| 332 | usb_driver_release_interface(driver, info->data); | 334 | usb_driver_release_interface(driver, info->data); |
| 333 | } | 335 | } |
| 334 | 336 | ||
| 335 | /* Never use the same address on both ends of the link, even | 337 | /* Never use the same address on both ends of the link, even if the |
| 336 | * if the buggy firmware told us to. | 338 | * buggy firmware told us to. Or, if device is assigned the well-known |
| 339 | * buggy firmware MAC address, replace it with a random address, | ||
| 337 | */ | 340 | */ |
| 338 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) | 341 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) || |
| 342 | ether_addr_equal(dev->net->dev_addr, buggy_fw_addr)) | ||
| 339 | eth_hw_addr_random(dev->net); | 343 | eth_hw_addr_random(dev->net); |
| 340 | 344 | ||
| 341 | /* make MAC addr easily distinguishable from an IP header */ | 345 | /* make MAC addr easily distinguishable from an IP header */ |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2d1c77e81836..57ec23e8ccfa 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
| @@ -1897,6 +1897,22 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev) | |||
| 1897 | netif_wake_queue(netdev); | 1897 | netif_wake_queue(netdev); |
| 1898 | } | 1898 | } |
| 1899 | 1899 | ||
| 1900 | static netdev_features_t | ||
| 1901 | rtl8152_features_check(struct sk_buff *skb, struct net_device *dev, | ||
| 1902 | netdev_features_t features) | ||
| 1903 | { | ||
| 1904 | u32 mss = skb_shinfo(skb)->gso_size; | ||
| 1905 | int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX; | ||
| 1906 | int offset = skb_transport_offset(skb); | ||
| 1907 | |||
| 1908 | if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset) | ||
| 1909 | features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
| 1910 | else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz) | ||
| 1911 | features &= ~NETIF_F_GSO_MASK; | ||
| 1912 | |||
| 1913 | return features; | ||
| 1914 | } | ||
| 1915 | |||
| 1900 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, | 1916 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, |
| 1901 | struct net_device *netdev) | 1917 | struct net_device *netdev) |
| 1902 | { | 1918 | { |
| @@ -3706,6 +3722,7 @@ static const struct net_device_ops rtl8152_netdev_ops = { | |||
| 3706 | .ndo_set_mac_address = rtl8152_set_mac_address, | 3722 | .ndo_set_mac_address = rtl8152_set_mac_address, |
| 3707 | .ndo_change_mtu = rtl8152_change_mtu, | 3723 | .ndo_change_mtu = rtl8152_change_mtu, |
| 3708 | .ndo_validate_addr = eth_validate_addr, | 3724 | .ndo_validate_addr = eth_validate_addr, |
| 3725 | .ndo_features_check = rtl8152_features_check, | ||
| 3709 | }; | 3726 | }; |
| 3710 | 3727 | ||
| 3711 | static void r8152b_get_version(struct r8152 *tp) | 3728 | static void r8152b_get_version(struct r8152 *tp) |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index efbaf2ae1999..794204e34fba 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
| @@ -737,6 +737,7 @@ static void connect(struct backend_info *be) | |||
| 737 | } | 737 | } |
| 738 | 738 | ||
| 739 | queue->remaining_credit = credit_bytes; | 739 | queue->remaining_credit = credit_bytes; |
| 740 | queue->credit_usec = credit_usec; | ||
| 740 | 741 | ||
| 741 | err = connect_rings(be, queue); | 742 | err = connect_rings(be, queue); |
| 742 | if (err) { | 743 | if (err) { |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 14419a8ccbb6..d415d69dc237 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
| @@ -538,7 +538,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, | |||
| 538 | ++headcount; | 538 | ++headcount; |
| 539 | seg += in; | 539 | seg += in; |
| 540 | } | 540 | } |
| 541 | heads[headcount - 1].len = cpu_to_vhost32(vq, len - datalen); | 541 | heads[headcount - 1].len = cpu_to_vhost32(vq, len + datalen); |
| 542 | *iovcount = seg; | 542 | *iovcount = seg; |
| 543 | if (unlikely(log)) | 543 | if (unlikely(log)) |
| 544 | *log_num = nlogs; | 544 | *log_num = nlogs; |
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 2ef9529809d8..9756f21b809e 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c | |||
| @@ -282,6 +282,7 @@ void vp_del_vqs(struct virtio_device *vdev) | |||
| 282 | 282 | ||
| 283 | vp_free_vectors(vdev); | 283 | vp_free_vectors(vdev); |
| 284 | kfree(vp_dev->vqs); | 284 | kfree(vp_dev->vqs); |
| 285 | vp_dev->vqs = NULL; | ||
| 285 | } | 286 | } |
| 286 | 287 | ||
| 287 | static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 288 | static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
| @@ -421,15 +422,6 @@ int vp_set_vq_affinity(struct virtqueue *vq, int cpu) | |||
| 421 | return 0; | 422 | return 0; |
| 422 | } | 423 | } |
| 423 | 424 | ||
| 424 | void virtio_pci_release_dev(struct device *_d) | ||
| 425 | { | ||
| 426 | /* | ||
| 427 | * No need for a release method as we allocate/free | ||
| 428 | * all devices together with the pci devices. | ||
| 429 | * Provide an empty one to avoid getting a warning from core. | ||
| 430 | */ | ||
| 431 | } | ||
| 432 | |||
| 433 | #ifdef CONFIG_PM_SLEEP | 425 | #ifdef CONFIG_PM_SLEEP |
| 434 | static int virtio_pci_freeze(struct device *dev) | 426 | static int virtio_pci_freeze(struct device *dev) |
| 435 | { | 427 | { |
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h index adddb647b21d..5a497289b7e9 100644 --- a/drivers/virtio/virtio_pci_common.h +++ b/drivers/virtio/virtio_pci_common.h | |||
| @@ -126,7 +126,6 @@ const char *vp_bus_name(struct virtio_device *vdev); | |||
| 126 | * - ignore the affinity request if we're using INTX | 126 | * - ignore the affinity request if we're using INTX |
| 127 | */ | 127 | */ |
| 128 | int vp_set_vq_affinity(struct virtqueue *vq, int cpu); | 128 | int vp_set_vq_affinity(struct virtqueue *vq, int cpu); |
| 129 | void virtio_pci_release_dev(struct device *); | ||
| 130 | 129 | ||
| 131 | int virtio_pci_legacy_probe(struct pci_dev *pci_dev, | 130 | int virtio_pci_legacy_probe(struct pci_dev *pci_dev, |
| 132 | const struct pci_device_id *id); | 131 | const struct pci_device_id *id); |
diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c index 6c76f0f5658c..a5486e65e04b 100644 --- a/drivers/virtio/virtio_pci_legacy.c +++ b/drivers/virtio/virtio_pci_legacy.c | |||
| @@ -211,6 +211,17 @@ static const struct virtio_config_ops virtio_pci_config_ops = { | |||
| 211 | .set_vq_affinity = vp_set_vq_affinity, | 211 | .set_vq_affinity = vp_set_vq_affinity, |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | static void virtio_pci_release_dev(struct device *_d) | ||
| 215 | { | ||
| 216 | struct virtio_device *vdev = dev_to_virtio(_d); | ||
| 217 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | ||
| 218 | |||
| 219 | /* As struct device is a kobject, it's not safe to | ||
| 220 | * free the memory (including the reference counter itself) | ||
| 221 | * until it's release callback. */ | ||
| 222 | kfree(vp_dev); | ||
| 223 | } | ||
| 224 | |||
| 214 | /* the PCI probing function */ | 225 | /* the PCI probing function */ |
| 215 | int virtio_pci_legacy_probe(struct pci_dev *pci_dev, | 226 | int virtio_pci_legacy_probe(struct pci_dev *pci_dev, |
| 216 | const struct pci_device_id *id) | 227 | const struct pci_device_id *id) |
| @@ -302,5 +313,4 @@ void virtio_pci_legacy_remove(struct pci_dev *pci_dev) | |||
| 302 | pci_iounmap(pci_dev, vp_dev->ioaddr); | 313 | pci_iounmap(pci_dev, vp_dev->ioaddr); |
| 303 | pci_release_regions(pci_dev); | 314 | pci_release_regions(pci_dev); |
| 304 | pci_disable_device(pci_dev); | 315 | pci_disable_device(pci_dev); |
| 305 | kfree(vp_dev); | ||
| 306 | } | 316 | } |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e5d3eadf47b1..bed43081720f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
| @@ -5166,8 +5166,8 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 5166 | 5166 | ||
| 5167 | /* fallback to generic here if not in extents fmt */ | 5167 | /* fallback to generic here if not in extents fmt */ |
| 5168 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) | 5168 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
| 5169 | return __generic_block_fiemap(inode, fieinfo, start, len, | 5169 | return generic_block_fiemap(inode, fieinfo, start, len, |
| 5170 | ext4_get_block); | 5170 | ext4_get_block); |
| 5171 | 5171 | ||
| 5172 | if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS)) | 5172 | if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS)) |
| 5173 | return -EBADR; | 5173 | return -EBADR; |
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 513c12cf444c..8131be8c0af3 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
| @@ -273,19 +273,24 @@ static int ext4_file_open(struct inode * inode, struct file * filp) | |||
| 273 | * we determine this extent as a data or a hole according to whether the | 273 | * we determine this extent as a data or a hole according to whether the |
| 274 | * page cache has data or not. | 274 | * page cache has data or not. |
| 275 | */ | 275 | */ |
| 276 | static int ext4_find_unwritten_pgoff(struct inode *inode, int whence, | 276 | static int ext4_find_unwritten_pgoff(struct inode *inode, |
| 277 | loff_t endoff, loff_t *offset) | 277 | int whence, |
| 278 | struct ext4_map_blocks *map, | ||
| 279 | loff_t *offset) | ||
| 278 | { | 280 | { |
| 279 | struct pagevec pvec; | 281 | struct pagevec pvec; |
| 282 | unsigned int blkbits; | ||
| 280 | pgoff_t index; | 283 | pgoff_t index; |
| 281 | pgoff_t end; | 284 | pgoff_t end; |
| 285 | loff_t endoff; | ||
| 282 | loff_t startoff; | 286 | loff_t startoff; |
| 283 | loff_t lastoff; | 287 | loff_t lastoff; |
| 284 | int found = 0; | 288 | int found = 0; |
| 285 | 289 | ||
| 290 | blkbits = inode->i_sb->s_blocksize_bits; | ||
| 286 | startoff = *offset; | 291 | startoff = *offset; |
| 287 | lastoff = startoff; | 292 | lastoff = startoff; |
| 288 | 293 | endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits; | |
| 289 | 294 | ||
| 290 | index = startoff >> PAGE_CACHE_SHIFT; | 295 | index = startoff >> PAGE_CACHE_SHIFT; |
| 291 | end = endoff >> PAGE_CACHE_SHIFT; | 296 | end = endoff >> PAGE_CACHE_SHIFT; |
| @@ -403,144 +408,147 @@ out: | |||
| 403 | static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) | 408 | static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) |
| 404 | { | 409 | { |
| 405 | struct inode *inode = file->f_mapping->host; | 410 | struct inode *inode = file->f_mapping->host; |
| 406 | struct fiemap_extent_info fie; | 411 | struct ext4_map_blocks map; |
| 407 | struct fiemap_extent ext[2]; | 412 | struct extent_status es; |
| 408 | loff_t next; | 413 | ext4_lblk_t start, last, end; |
| 409 | int i, ret = 0; | 414 | loff_t dataoff, isize; |
| 415 | int blkbits; | ||
| 416 | int ret = 0; | ||
| 410 | 417 | ||
| 411 | mutex_lock(&inode->i_mutex); | 418 | mutex_lock(&inode->i_mutex); |
| 412 | if (offset >= inode->i_size) { | 419 | |
| 420 | isize = i_size_read(inode); | ||
| 421 | if (offset >= isize) { | ||
| 413 | mutex_unlock(&inode->i_mutex); | 422 | mutex_unlock(&inode->i_mutex); |
| 414 | return -ENXIO; | 423 | return -ENXIO; |
| 415 | } | 424 | } |
| 416 | fie.fi_flags = 0; | 425 | |
| 417 | fie.fi_extents_max = 2; | 426 | blkbits = inode->i_sb->s_blocksize_bits; |
| 418 | fie.fi_extents_start = (struct fiemap_extent __user *) &ext; | 427 | start = offset >> blkbits; |
| 419 | while (1) { | 428 | last = start; |
| 420 | mm_segment_t old_fs = get_fs(); | 429 | end = isize >> blkbits; |
| 421 | 430 | dataoff = offset; | |
| 422 | fie.fi_extents_mapped = 0; | 431 | |
| 423 | memset(ext, 0, sizeof(*ext) * fie.fi_extents_max); | 432 | do { |
| 424 | 433 | map.m_lblk = last; | |
| 425 | set_fs(get_ds()); | 434 | map.m_len = end - last + 1; |
| 426 | ret = ext4_fiemap(inode, &fie, offset, maxsize - offset); | 435 | ret = ext4_map_blocks(NULL, inode, &map, 0); |
| 427 | set_fs(old_fs); | 436 | if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { |
| 428 | if (ret) | 437 | if (last != start) |
| 438 | dataoff = (loff_t)last << blkbits; | ||
| 429 | break; | 439 | break; |
| 440 | } | ||
| 430 | 441 | ||
| 431 | /* No extents found, EOF */ | 442 | /* |
| 432 | if (!fie.fi_extents_mapped) { | 443 | * If there is a delay extent at this offset, |
| 433 | ret = -ENXIO; | 444 | * it will be as a data. |
| 445 | */ | ||
| 446 | ext4_es_find_delayed_extent_range(inode, last, last, &es); | ||
| 447 | if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { | ||
| 448 | if (last != start) | ||
| 449 | dataoff = (loff_t)last << blkbits; | ||
| 434 | break; | 450 | break; |
| 435 | } | 451 | } |
| 436 | for (i = 0; i < fie.fi_extents_mapped; i++) { | ||
| 437 | next = (loff_t)(ext[i].fe_length + ext[i].fe_logical); | ||
| 438 | 452 | ||
| 439 | if (offset < (loff_t)ext[i].fe_logical) | 453 | /* |
| 440 | offset = (loff_t)ext[i].fe_logical; | 454 | * If there is a unwritten extent at this offset, |
| 441 | /* | 455 | * it will be as a data or a hole according to page |
| 442 | * If extent is not unwritten, then it contains valid | 456 | * cache that has data or not. |
| 443 | * data, mapped or delayed. | 457 | */ |
| 444 | */ | 458 | if (map.m_flags & EXT4_MAP_UNWRITTEN) { |
| 445 | if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) | 459 | int unwritten; |
| 446 | goto out; | 460 | unwritten = ext4_find_unwritten_pgoff(inode, SEEK_DATA, |
| 461 | &map, &dataoff); | ||
| 462 | if (unwritten) | ||
| 463 | break; | ||
| 464 | } | ||
| 447 | 465 | ||
| 448 | /* | 466 | last++; |
| 449 | * If there is a unwritten extent at this offset, | 467 | dataoff = (loff_t)last << blkbits; |
| 450 | * it will be as a data or a hole according to page | 468 | } while (last <= end); |
| 451 | * cache that has data or not. | ||
| 452 | */ | ||
| 453 | if (ext4_find_unwritten_pgoff(inode, SEEK_DATA, | ||
| 454 | next, &offset)) | ||
| 455 | goto out; | ||
| 456 | 469 | ||
| 457 | if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) { | ||
| 458 | ret = -ENXIO; | ||
| 459 | goto out; | ||
| 460 | } | ||
| 461 | offset = next; | ||
| 462 | } | ||
| 463 | } | ||
| 464 | if (offset > inode->i_size) | ||
| 465 | offset = inode->i_size; | ||
| 466 | out: | ||
| 467 | mutex_unlock(&inode->i_mutex); | 470 | mutex_unlock(&inode->i_mutex); |
| 468 | if (ret) | ||
| 469 | return ret; | ||
| 470 | 471 | ||
| 471 | return vfs_setpos(file, offset, maxsize); | 472 | if (dataoff > isize) |
| 473 | return -ENXIO; | ||
| 474 | |||
| 475 | return vfs_setpos(file, dataoff, maxsize); | ||
| 472 | } | 476 | } |
| 473 | 477 | ||
| 474 | /* | 478 | /* |
| 475 | * ext4_seek_hole() retrieves the offset for SEEK_HOLE | 479 | * ext4_seek_hole() retrieves the offset for SEEK_HOLE. |
| 476 | */ | 480 | */ |
| 477 | static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) | 481 | static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) |
| 478 | { | 482 | { |
| 479 | struct inode *inode = file->f_mapping->host; | 483 | struct inode *inode = file->f_mapping->host; |
| 480 | struct fiemap_extent_info fie; | 484 | struct ext4_map_blocks map; |
| 481 | struct fiemap_extent ext[2]; | 485 | struct extent_status es; |
| 482 | loff_t next; | 486 | ext4_lblk_t start, last, end; |
| 483 | int i, ret = 0; | 487 | loff_t holeoff, isize; |
| 488 | int blkbits; | ||
| 489 | int ret = 0; | ||
| 484 | 490 | ||
| 485 | mutex_lock(&inode->i_mutex); | 491 | mutex_lock(&inode->i_mutex); |
| 486 | if (offset >= inode->i_size) { | 492 | |
| 493 | isize = i_size_read(inode); | ||
| 494 | if (offset >= isize) { | ||
| 487 | mutex_unlock(&inode->i_mutex); | 495 | mutex_unlock(&inode->i_mutex); |
| 488 | return -ENXIO; | 496 | return -ENXIO; |
| 489 | } | 497 | } |
| 490 | 498 | ||
| 491 | fie.fi_flags = 0; | 499 | blkbits = inode->i_sb->s_blocksize_bits; |
| 492 | fie.fi_extents_max = 2; | 500 | start = offset >> blkbits; |
| 493 | fie.fi_extents_start = (struct fiemap_extent __user *)&ext; | 501 | last = start; |
| 494 | while (1) { | 502 | end = isize >> blkbits; |
| 495 | mm_segment_t old_fs = get_fs(); | 503 | holeoff = offset; |
| 496 | |||
| 497 | fie.fi_extents_mapped = 0; | ||
| 498 | memset(ext, 0, sizeof(*ext)); | ||
| 499 | 504 | ||
| 500 | set_fs(get_ds()); | 505 | do { |
| 501 | ret = ext4_fiemap(inode, &fie, offset, maxsize - offset); | 506 | map.m_lblk = last; |
| 502 | set_fs(old_fs); | 507 | map.m_len = end - last + 1; |
| 503 | if (ret) | 508 | ret = ext4_map_blocks(NULL, inode, &map, 0); |
| 504 | break; | 509 | if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { |
| 510 | last += ret; | ||
| 511 | holeoff = (loff_t)last << blkbits; | ||
| 512 | continue; | ||
| 513 | } | ||
| 505 | 514 | ||
| 506 | /* No extents found */ | 515 | /* |
| 507 | if (!fie.fi_extents_mapped) | 516 | * If there is a delay extent at this offset, |
| 508 | break; | 517 | * we will skip this extent. |
| 518 | */ | ||
| 519 | ext4_es_find_delayed_extent_range(inode, last, last, &es); | ||
| 520 | if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { | ||
| 521 | last = es.es_lblk + es.es_len; | ||
| 522 | holeoff = (loff_t)last << blkbits; | ||
| 523 | continue; | ||
| 524 | } | ||
| 509 | 525 | ||
| 510 | for (i = 0; i < fie.fi_extents_mapped; i++) { | 526 | /* |
| 511 | next = (loff_t)(ext[i].fe_logical + ext[i].fe_length); | 527 | * If there is a unwritten extent at this offset, |
| 512 | /* | 528 | * it will be as a data or a hole according to page |
| 513 | * If extent is not unwritten, then it contains valid | 529 | * cache that has data or not. |
| 514 | * data, mapped or delayed. | 530 | */ |
| 515 | */ | 531 | if (map.m_flags & EXT4_MAP_UNWRITTEN) { |
| 516 | if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) { | 532 | int unwritten; |
| 517 | if (offset < (loff_t)ext[i].fe_logical) | 533 | unwritten = ext4_find_unwritten_pgoff(inode, SEEK_HOLE, |
| 518 | goto out; | 534 | &map, &holeoff); |
| 519 | offset = next; | 535 | if (!unwritten) { |
| 536 | last += ret; | ||
| 537 | holeoff = (loff_t)last << blkbits; | ||
| 520 | continue; | 538 | continue; |
| 521 | } | 539 | } |
| 522 | /* | ||
| 523 | * If there is a unwritten extent at this offset, | ||
| 524 | * it will be as a data or a hole according to page | ||
| 525 | * cache that has data or not. | ||
| 526 | */ | ||
| 527 | if (ext4_find_unwritten_pgoff(inode, SEEK_HOLE, | ||
| 528 | next, &offset)) | ||
| 529 | goto out; | ||
| 530 | |||
| 531 | offset = next; | ||
| 532 | if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) | ||
| 533 | goto out; | ||
| 534 | } | 540 | } |
| 535 | } | 541 | |
| 536 | if (offset > inode->i_size) | 542 | /* find a hole */ |
| 537 | offset = inode->i_size; | 543 | break; |
| 538 | out: | 544 | } while (last <= end); |
| 545 | |||
| 539 | mutex_unlock(&inode->i_mutex); | 546 | mutex_unlock(&inode->i_mutex); |
| 540 | if (ret) | ||
| 541 | return ret; | ||
| 542 | 547 | ||
| 543 | return vfs_setpos(file, offset, maxsize); | 548 | if (holeoff > isize) |
| 549 | holeoff = isize; | ||
| 550 | |||
| 551 | return vfs_setpos(file, holeoff, maxsize); | ||
| 544 | } | 552 | } |
| 545 | 553 | ||
| 546 | /* | 554 | /* |
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index bf76f405a5f9..8a8ec6293b19 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
| @@ -24,6 +24,18 @@ int ext4_resize_begin(struct super_block *sb) | |||
| 24 | return -EPERM; | 24 | return -EPERM; |
| 25 | 25 | ||
| 26 | /* | 26 | /* |
| 27 | * If we are not using the primary superblock/GDT copy don't resize, | ||
| 28 | * because the user tools have no way of handling this. Probably a | ||
| 29 | * bad time to do it anyways. | ||
| 30 | */ | ||
| 31 | if (EXT4_SB(sb)->s_sbh->b_blocknr != | ||
| 32 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { | ||
| 33 | ext4_warning(sb, "won't resize using backup superblock at %llu", | ||
| 34 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); | ||
| 35 | return -EPERM; | ||
| 36 | } | ||
| 37 | |||
| 38 | /* | ||
| 27 | * We are not allowed to do online-resizing on a filesystem mounted | 39 | * We are not allowed to do online-resizing on a filesystem mounted |
| 28 | * with error, because it can destroy the filesystem easily. | 40 | * with error, because it can destroy the filesystem easily. |
| 29 | */ | 41 | */ |
| @@ -758,18 +770,6 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, | |||
| 758 | "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", | 770 | "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", |
| 759 | gdb_num); | 771 | gdb_num); |
| 760 | 772 | ||
| 761 | /* | ||
| 762 | * If we are not using the primary superblock/GDT copy don't resize, | ||
| 763 | * because the user tools have no way of handling this. Probably a | ||
| 764 | * bad time to do it anyways. | ||
| 765 | */ | ||
| 766 | if (EXT4_SB(sb)->s_sbh->b_blocknr != | ||
| 767 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { | ||
| 768 | ext4_warning(sb, "won't resize using backup superblock at %llu", | ||
| 769 | (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); | ||
| 770 | return -EPERM; | ||
| 771 | } | ||
| 772 | |||
| 773 | gdb_bh = sb_bread(sb, gdblock); | 773 | gdb_bh = sb_bread(sb, gdblock); |
| 774 | if (!gdb_bh) | 774 | if (!gdb_bh) |
| 775 | return -EIO; | 775 | return -EIO; |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 43c92b1685cb..74c5f53595fb 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -3482,7 +3482,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3482 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, | 3482 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, |
| 3483 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) && | 3483 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) && |
| 3484 | EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) | 3484 | EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) |
| 3485 | ext4_warning(sb, KERN_INFO "metadata_csum and uninit_bg are " | 3485 | ext4_warning(sb, "metadata_csum and uninit_bg are " |
| 3486 | "redundant flags; please run fsck."); | 3486 | "redundant flags; please run fsck."); |
| 3487 | 3487 | ||
| 3488 | /* Check for a known checksum algorithm */ | 3488 | /* Check for a known checksum algorithm */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index f80d0194c9bc..80fc92a49649 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1952,7 +1952,7 @@ extern int expand_downwards(struct vm_area_struct *vma, | |||
| 1952 | #if VM_GROWSUP | 1952 | #if VM_GROWSUP |
| 1953 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1953 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
| 1954 | #else | 1954 | #else |
| 1955 | #define expand_upwards(vma, address) do { } while (0) | 1955 | #define expand_upwards(vma, address) (0) |
| 1956 | #endif | 1956 | #endif |
| 1957 | 1957 | ||
| 1958 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1958 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 58d719ddaa60..29c7be8808d5 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -1270,8 +1270,7 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | |||
| 1270 | * | 1270 | * |
| 1271 | * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the | 1271 | * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the |
| 1272 | * driver to indicate that it requires IV generation for this | 1272 | * driver to indicate that it requires IV generation for this |
| 1273 | * particular key. Setting this flag does not necessarily mean that SKBs | 1273 | * particular key. |
| 1274 | * will have sufficient tailroom for ICV or MIC. | ||
| 1275 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by | 1274 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by |
| 1276 | * the driver for a TKIP key if it requires Michael MIC | 1275 | * the driver for a TKIP key if it requires Michael MIC |
| 1277 | * generation in software. | 1276 | * generation in software. |
| @@ -1283,9 +1282,7 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | |||
| 1283 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver | 1282 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver |
| 1284 | * if space should be prepared for the IV, but the IV | 1283 | * if space should be prepared for the IV, but the IV |
| 1285 | * itself should not be generated. Do not set together with | 1284 | * itself should not be generated. Do not set together with |
| 1286 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does | 1285 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. |
| 1287 | * not necessarily mean that SKBs will have sufficient tailroom for ICV or | ||
| 1288 | * MIC. | ||
| 1289 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received | 1286 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received |
| 1290 | * management frames. The flag can help drivers that have a hardware | 1287 | * management frames. The flag can help drivers that have a hardware |
| 1291 | * crypto implementation that doesn't deal with management frames | 1288 | * crypto implementation that doesn't deal with management frames |
diff --git a/mm/memory.c b/mm/memory.c index ca920d1fd314..d7e497e98f46 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -2593,7 +2593,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
| 2593 | if (prev && prev->vm_end == address) | 2593 | if (prev && prev->vm_end == address) |
| 2594 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; | 2594 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; |
| 2595 | 2595 | ||
| 2596 | expand_downwards(vma, address - PAGE_SIZE); | 2596 | return expand_downwards(vma, address - PAGE_SIZE); |
| 2597 | } | 2597 | } |
| 2598 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { | 2598 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { |
| 2599 | struct vm_area_struct *next = vma->vm_next; | 2599 | struct vm_area_struct *next = vma->vm_next; |
| @@ -2602,7 +2602,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
| 2602 | if (next && next->vm_start == address + PAGE_SIZE) | 2602 | if (next && next->vm_start == address + PAGE_SIZE) |
| 2603 | return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; | 2603 | return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; |
| 2604 | 2604 | ||
| 2605 | expand_upwards(vma, address + PAGE_SIZE); | 2605 | return expand_upwards(vma, address + PAGE_SIZE); |
| 2606 | } | 2606 | } |
| 2607 | return 0; | 2607 | return 0; |
| 2608 | } | 2608 | } |
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c index ab6bb2af1d45..b24e4bb64fb5 100644 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c | |||
| @@ -685,11 +685,13 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, | |||
| 685 | if (orig_initialized) | 685 | if (orig_initialized) |
| 686 | atomic_dec(&bat_priv->mcast.num_disabled); | 686 | atomic_dec(&bat_priv->mcast.num_disabled); |
| 687 | orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; | 687 | orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; |
| 688 | /* If mcast support is being switched off increase the disabled | 688 | /* If mcast support is being switched off or if this is an initial |
| 689 | * mcast node counter. | 689 | * OGM without mcast support then increase the disabled mcast |
| 690 | * node counter. | ||
| 690 | */ | 691 | */ |
| 691 | } else if (!orig_mcast_enabled && | 692 | } else if (!orig_mcast_enabled && |
| 692 | orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) { | 693 | (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST || |
| 694 | !orig_initialized)) { | ||
| 693 | atomic_inc(&bat_priv->mcast.num_disabled); | 695 | atomic_inc(&bat_priv->mcast.num_disabled); |
| 694 | orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; | 696 | orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; |
| 695 | } | 697 | } |
| @@ -738,7 +740,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig) | |||
| 738 | { | 740 | { |
| 739 | struct batadv_priv *bat_priv = orig->bat_priv; | 741 | struct batadv_priv *bat_priv = orig->bat_priv; |
| 740 | 742 | ||
| 741 | if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST)) | 743 | if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) && |
| 744 | orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST) | ||
| 742 | atomic_dec(&bat_priv->mcast.num_disabled); | 745 | atomic_dec(&bat_priv->mcast.num_disabled); |
| 743 | 746 | ||
| 744 | batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); | 747 | batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); |
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index 8d04d174669e..fab47f1f3ef9 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c | |||
| @@ -133,7 +133,7 @@ int batadv_nc_mesh_init(struct batadv_priv *bat_priv) | |||
| 133 | if (!bat_priv->nc.decoding_hash) | 133 | if (!bat_priv->nc.decoding_hash) |
| 134 | goto err; | 134 | goto err; |
| 135 | 135 | ||
| 136 | batadv_hash_set_lock_class(bat_priv->nc.coding_hash, | 136 | batadv_hash_set_lock_class(bat_priv->nc.decoding_hash, |
| 137 | &batadv_nc_decoding_hash_lock_class_key); | 137 | &batadv_nc_decoding_hash_lock_class_key); |
| 138 | 138 | ||
| 139 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); | 139 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 6a484514cd3e..bea8198d0198 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
| @@ -570,9 +570,6 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu) | |||
| 570 | 570 | ||
| 571 | batadv_frag_purge_orig(orig_node, NULL); | 571 | batadv_frag_purge_orig(orig_node, NULL); |
| 572 | 572 | ||
| 573 | batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, -1, | ||
| 574 | "originator timed out"); | ||
| 575 | |||
| 576 | if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) | 573 | if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) |
| 577 | orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); | 574 | orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); |
| 578 | 575 | ||
| @@ -678,6 +675,7 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv, | |||
| 678 | atomic_set(&orig_node->last_ttvn, 0); | 675 | atomic_set(&orig_node->last_ttvn, 0); |
| 679 | orig_node->tt_buff = NULL; | 676 | orig_node->tt_buff = NULL; |
| 680 | orig_node->tt_buff_len = 0; | 677 | orig_node->tt_buff_len = 0; |
| 678 | orig_node->last_seen = jiffies; | ||
| 681 | reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); | 679 | reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); |
| 682 | orig_node->bcast_seqno_reset = reset_time; | 680 | orig_node->bcast_seqno_reset = reset_time; |
| 683 | #ifdef CONFIG_BATMAN_ADV_MCAST | 681 | #ifdef CONFIG_BATMAN_ADV_MCAST |
| @@ -977,6 +975,9 @@ static void _batadv_purge_orig(struct batadv_priv *bat_priv) | |||
| 977 | if (batadv_purge_orig_node(bat_priv, orig_node)) { | 975 | if (batadv_purge_orig_node(bat_priv, orig_node)) { |
| 978 | batadv_gw_node_delete(bat_priv, orig_node); | 976 | batadv_gw_node_delete(bat_priv, orig_node); |
| 979 | hlist_del_rcu(&orig_node->hash_entry); | 977 | hlist_del_rcu(&orig_node->hash_entry); |
| 978 | batadv_tt_global_del_orig(orig_node->bat_priv, | ||
| 979 | orig_node, -1, | ||
| 980 | "originator timed out"); | ||
| 980 | batadv_orig_node_free_ref(orig_node); | 981 | batadv_orig_node_free_ref(orig_node); |
| 981 | continue; | 982 | continue; |
| 982 | } | 983 | } |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 35f76f2f7824..6648f321864d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
| @@ -443,11 +443,13 @@ batadv_find_router(struct batadv_priv *bat_priv, | |||
| 443 | 443 | ||
| 444 | router = batadv_orig_router_get(orig_node, recv_if); | 444 | router = batadv_orig_router_get(orig_node, recv_if); |
| 445 | 445 | ||
| 446 | if (!router) | ||
| 447 | return router; | ||
| 448 | |||
| 446 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) | 449 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) |
| 447 | * and if activated. | 450 | * and if activated. |
| 448 | */ | 451 | */ |
| 449 | if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || | 452 | if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) |
| 450 | !router) | ||
| 451 | return router; | 453 | return router; |
| 452 | 454 | ||
| 453 | /* bonding: loop through the list of possible routers found | 455 | /* bonding: loop through the list of possible routers found |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7f18262e2326..65caf8b95e17 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -2019,7 +2019,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | |||
| 2019 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) | 2019 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) |
| 2020 | break; | 2020 | break; |
| 2021 | 2021 | ||
| 2022 | if (tso_segs == 1) { | 2022 | if (tso_segs == 1 || !max_segs) { |
| 2023 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, | 2023 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, |
| 2024 | (tcp_skb_is_last(sk, skb) ? | 2024 | (tcp_skb_is_last(sk, skb) ? |
| 2025 | nonagle : TCP_NAGLE_PUSH)))) | 2025 | nonagle : TCP_NAGLE_PUSH)))) |
| @@ -2032,7 +2032,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | |||
| 2032 | } | 2032 | } |
| 2033 | 2033 | ||
| 2034 | limit = mss_now; | 2034 | limit = mss_now; |
| 2035 | if (tso_segs > 1 && !tcp_urg_mode(tp)) | 2035 | if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp)) |
| 2036 | limit = tcp_mss_split_point(sk, skb, mss_now, | 2036 | limit = tcp_mss_split_point(sk, skb, mss_now, |
| 2037 | min_t(unsigned int, | 2037 | min_t(unsigned int, |
| 2038 | cwnd_quota, | 2038 | cwnd_quota, |
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 0bb7038121ac..bd4e46ec32bd 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
| @@ -140,7 +140,9 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) | |||
| 140 | if (!ret) { | 140 | if (!ret) { |
| 141 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; | 141 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
| 142 | 142 | ||
| 143 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 143 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
| 144 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
| 145 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
| 144 | sdata->crypto_tx_tailroom_needed_cnt--; | 146 | sdata->crypto_tx_tailroom_needed_cnt--; |
| 145 | 147 | ||
| 146 | WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && | 148 | WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && |
| @@ -188,7 +190,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
| 188 | sta = key->sta; | 190 | sta = key->sta; |
| 189 | sdata = key->sdata; | 191 | sdata = key->sdata; |
| 190 | 192 | ||
| 191 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 193 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
| 194 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
| 195 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
| 192 | increment_tailroom_need_count(sdata); | 196 | increment_tailroom_need_count(sdata); |
| 193 | 197 | ||
| 194 | ret = drv_set_key(key->local, DISABLE_KEY, sdata, | 198 | ret = drv_set_key(key->local, DISABLE_KEY, sdata, |
| @@ -884,7 +888,9 @@ void ieee80211_remove_key(struct ieee80211_key_conf *keyconf) | |||
| 884 | if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { | 888 | if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { |
| 885 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; | 889 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
| 886 | 890 | ||
| 887 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 891 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
| 892 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
| 893 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
| 888 | increment_tailroom_need_count(key->sdata); | 894 | increment_tailroom_need_count(key->sdata); |
| 889 | } | 895 | } |
| 890 | 896 | ||
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 70bef2ab7f2b..da2fae0873a5 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
| @@ -70,6 +70,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
| 70 | { | 70 | { |
| 71 | struct flow_stats *stats; | 71 | struct flow_stats *stats; |
| 72 | int node = numa_node_id(); | 72 | int node = numa_node_id(); |
| 73 | int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); | ||
| 73 | 74 | ||
| 74 | stats = rcu_dereference(flow->stats[node]); | 75 | stats = rcu_dereference(flow->stats[node]); |
| 75 | 76 | ||
| @@ -105,7 +106,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
| 105 | if (likely(new_stats)) { | 106 | if (likely(new_stats)) { |
| 106 | new_stats->used = jiffies; | 107 | new_stats->used = jiffies; |
| 107 | new_stats->packet_count = 1; | 108 | new_stats->packet_count = 1; |
| 108 | new_stats->byte_count = skb->len; | 109 | new_stats->byte_count = len; |
| 109 | new_stats->tcp_flags = tcp_flags; | 110 | new_stats->tcp_flags = tcp_flags; |
| 110 | spin_lock_init(&new_stats->lock); | 111 | spin_lock_init(&new_stats->lock); |
| 111 | 112 | ||
| @@ -120,7 +121,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
| 120 | 121 | ||
| 121 | stats->used = jiffies; | 122 | stats->used = jiffies; |
| 122 | stats->packet_count++; | 123 | stats->packet_count++; |
| 123 | stats->byte_count += skb->len; | 124 | stats->byte_count += len; |
| 124 | stats->tcp_flags |= tcp_flags; | 125 | stats->tcp_flags |= tcp_flags; |
| 125 | unlock: | 126 | unlock: |
| 126 | spin_unlock(&stats->lock); | 127 | spin_unlock(&stats->lock); |
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 53f3ebbfceab..2034c6d9cb5a 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c | |||
| @@ -480,7 +480,7 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb, | |||
| 480 | stats = this_cpu_ptr(vport->percpu_stats); | 480 | stats = this_cpu_ptr(vport->percpu_stats); |
| 481 | u64_stats_update_begin(&stats->syncp); | 481 | u64_stats_update_begin(&stats->syncp); |
| 482 | stats->rx_packets++; | 482 | stats->rx_packets++; |
| 483 | stats->rx_bytes += skb->len; | 483 | stats->rx_bytes += skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); |
| 484 | u64_stats_update_end(&stats->syncp); | 484 | u64_stats_update_end(&stats->syncp); |
| 485 | 485 | ||
| 486 | OVS_CB(skb)->input_vport = vport; | 486 | OVS_CB(skb)->input_vport = vport; |
