···3030 Example:3131 interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;32323333-A device node may contain either "interrupts" or "interrupts-extended", but not3434-both. If both properties are present, then the operating system should log an3535-error and use only the data in "interrupts".3636-37332) Interrupt controller nodes3834-----------------------------3935
+11
Documentation/devicetree/bindings/pci/pci.txt
···7788Open Firmware Recommended Practice: Interrupt Mapping99http://www.openfirmware.org/1275/practice/imap/imap0_9d.pdf1010+1111+Additionally to the properties specified in the above standards a host bridge1212+driver implementation may support the following properties:1313+1414+- linux,pci-domain:1515+ If present this property assigns a fixed PCI domain number to a host bridge,1616+ otherwise an unstable (across boots) unique number will be assigned.1717+ It is required to either not set this property at all or set it for all1818+ host bridges in the system, otherwise potentially conflicting domain numbers1919+ may be assigned to root buses behind different host bridges. The domain2020+ number for each host bridge in the system must be unique.
···99common pinctrl bindings used by client devices, including the meaning of the1010phrase "pin configuration node".11111212-TZ1090-PDC's pin configuration nodes act as a container for an abitrary number1212+TZ1090-PDC's pin configuration nodes act as a container for an arbitrary number1313of subnodes. Each of these subnodes represents some desired configuration for a1414pin, a group, or a list of pins or groups. This configuration can include the1515mux function to select on those pin(s)/group(s), and various pin configuration
···99common pinctrl bindings used by client devices, including the meaning of the1010phrase "pin configuration node".11111212-TZ1090's pin configuration nodes act as a container for an abitrary number of1212+TZ1090's pin configuration nodes act as a container for an arbitrary number of1313subnodes. Each of these subnodes represents some desired configuration for a1414pin, a group, or a list of pins or groups. This configuration can include the1515mux function to select on those pin(s)/group(s), and various pin configuration
···99common pinctrl bindings used by client devices, including the meaning of the1010phrase "pin configuration node".11111212-Lantiq's pin configuration nodes act as a container for an abitrary number of1212+Lantiq's pin configuration nodes act as a container for an arbitrary number of1313subnodes. Each of these subnodes represents some desired configuration for a1414pin, a group, or a list of pins or groups. This configuration can include the1515mux function to select on those group(s), and two pin configuration parameters:
···99common pinctrl bindings used by client devices, including the meaning of the1010phrase "pin configuration node".11111212-Lantiq's pin configuration nodes act as a container for an abitrary number of1212+Lantiq's pin configuration nodes act as a container for an arbitrary number of1313subnodes. Each of these subnodes represents some desired configuration for a1414pin, a group, or a list of pins or groups. This configuration can include the1515mux function to select on those group(s), and two pin configuration parameters:
···99common pinctrl bindings used by client devices, including the meaning of the1010phrase "pin configuration node".11111212-Tegra's pin configuration nodes act as a container for an abitrary number of1212+Tegra's pin configuration nodes act as a container for an arbitrary number of1313subnodes. Each of these subnodes represents some desired configuration for a1414pin, a group, or a list of pins or groups. This configuration can include the1515mux function to select on those pin(s)/group(s), and various pin configuration
···1313Please refer to pinctrl-bindings.txt in this directory for details of the common1414pinctrl bindings used by client devices.15151616-SiRFprimaII's pinmux nodes act as a container for an abitrary number of subnodes.1616+SiRFprimaII's pinmux nodes act as a container for an arbitrary number of subnodes.1717Each of these subnodes represents some desired configuration for a group of pins.18181919Required subnode-properties:
···3232Please refer to pinctrl-bindings.txt in this directory for details of the common3333pinctrl bindings used by client devices.34343535-SPEAr's pinmux nodes act as a container for an abitrary number of subnodes. Each3535+SPEAr's pinmux nodes act as a container for an arbitrary number of subnodes. Each3636of these subnodes represents muxing for a pin, a group, or a list of pins or3737groups.3838
···1818common pinctrl bindings used by client devices, including the meaning of the1919phrase "pin configuration node".20202121-Qualcomm's pin configuration nodes act as a container for an abitrary number of2121+Qualcomm's pin configuration nodes act as a container for an arbitrary number of2222subnodes. Each of these subnodes represents some desired configuration for a2323pin, a group, or a list of pins or groups. This configuration can include the2424mux function to select on those pin(s)/group(s), and various pin configuration
···4747common pinctrl bindings used by client devices, including the meaning of the4848phrase "pin configuration node".49495050-The pin configuration nodes act as a container for an abitrary number of5050+The pin configuration nodes act as a container for an arbitrary number of5151subnodes. Each of these subnodes represents some desired configuration for a5252pin, a group, or a list of pins or groups. This configuration can include the5353mux function to select on those pin(s)/group(s), and various pin configuration
···1818common pinctrl bindings used by client devices, including the meaning of the1919phrase "pin configuration node".20202121-Qualcomm's pin configuration nodes act as a container for an abitrary number of2121+Qualcomm's pin configuration nodes act as a container for an arbitrary number of2222subnodes. Each of these subnodes represents some desired configuration for a2323pin, a group, or a list of pins or groups. This configuration can include the2424mux function to select on those pin(s)/group(s), and various pin configuration
···4747common pinctrl bindings used by client devices, including the meaning of the4848phrase "pin configuration node".49495050-The pin configuration nodes act as a container for an abitrary number of5050+The pin configuration nodes act as a container for an arbitrary number of5151subnodes. Each of these subnodes represents some desired configuration for a5252pin, a group, or a list of pins or groups. This configuration can include the5353mux function to select on those pin(s)/group(s), and various pin configuration
···1818common pinctrl bindings used by client devices, including the meaning of the1919phrase "pin configuration node".20202121-Qualcomm's pin configuration nodes act as a container for an abitrary number of2121+Qualcomm's pin configuration nodes act as a container for an arbitrary number of2222subnodes. Each of these subnodes represents some desired configuration for a2323pin, a group, or a list of pins or groups. This configuration can include the2424mux function to select on those pin(s)/group(s), and various pin configuration
···6464At mount time, the two directories given as mount options "lowerdir" and6565"upperdir" are combined into a merged directory:66666767- mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper,\6767+ mount -t overlay overlay -olowerdir=/lower,upperdir=/upper,\6868workdir=/work /merged69697070The "workdir" needs to be an empty directory on the same filesystem
+1-1
Documentation/networking/timestamping.txt
···136136137137 This option is implemented only for transmit timestamps. There, the138138 timestamp is always looped along with a struct sock_extended_err.139139- The option modifies field ee_info to pass an id that is unique139139+ The option modifies field ee_data to pass an id that is unique140140 among all possibly concurrently outstanding timestamp requests for141141 that socket. In practice, it is a monotonically increasing u32142142 (that wraps).
···1563156315641564 for (i = 0; i < npages; i++) {15651565 pfn = gfn_to_pfn(kvm, base_gfn + i);15661566- if (!kvm_is_mmio_pfn(pfn)) {15661566+ if (!kvm_is_reserved_pfn(pfn)) {15671567 kvm_set_pmt_entry(kvm, base_gfn + i,15681568 pfn << PAGE_SHIFT,15691569 _PAGE_AR_RWX | _PAGE_MA_WB);
+12-2
arch/mips/Kconfig
···21012101config ARCH_PHYS_ADDR_T_64BIT21022102 def_bool 64BIT_PHYS_ADDR2103210321042104+choice21052105+ prompt "SmartMIPS or microMIPS ASE support"21062106+21072107+config CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS21082108+ bool "None"21092109+ help21102110+ Select this if you want neither microMIPS nor SmartMIPS support21112111+21042112config CPU_HAS_SMARTMIPS21052113 depends on SYS_SUPPORTS_SMARTMIPS21062106- bool "Support for the SmartMIPS ASE"21142114+ bool "SmartMIPS"21072115 help21082116 SmartMIPS is a extension of the MIPS32 architecture aimed at21092117 increased security at both hardware and software level for···2123211521242116config CPU_MICROMIPS21252117 depends on SYS_SUPPORTS_MICROMIPS21262126- bool "Build kernel using microMIPS ISA"21182118+ bool "microMIPS"21272119 help21282120 When this option is enabled the kernel will be built using the21292121 microMIPS ISA21222122+21232123+endchoice2130212421312125config CPU_HAS_MSA21322126 bool "Support for the MIPS SIMD Architecture (EXPERIMENTAL)"
···257257 */258258static inline void protected_writeback_dcache_line(unsigned long addr)259259{260260+#ifdef CONFIG_EVA261261+ protected_cachee_op(Hit_Writeback_Inv_D, addr);262262+#else260263 protected_cache_op(Hit_Writeback_Inv_D, addr);264264+#endif261265}262266263267static inline void protected_writeback_scache_line(unsigned long addr)
+10-8
arch/mips/include/asm/uaccess.h
···301301 __get_kernel_common((x), size, __gu_ptr); \302302 else \303303 __get_user_common((x), size, __gu_ptr); \304304- } \304304+ } else \305305+ (x) = 0; \305306 \306307 __gu_err; \307308})···317316 " .insn \n" \318317 " .section .fixup,\"ax\" \n" \319318 "3: li %0, %4 \n" \319319+ " move %1, $0 \n" \320320 " j 2b \n" \321321 " .previous \n" \322322 " .section __ex_table,\"a\" \n" \···632630 " .insn \n" \633631 " .section .fixup,\"ax\" \n" \634632 "3: li %0, %4 \n" \633633+ " move %1, $0 \n" \635634 " j 2b \n" \636635 " .previous \n" \637636 " .section __ex_table,\"a\" \n" \···776773 "jal\t" #destination "\n\t"777774#endif778775779779-#ifndef CONFIG_CPU_DADDI_WORKAROUNDS780780-#define DADDI_SCRATCH "$0"781781-#else776776+#if defined(CONFIG_CPU_DADDI_WORKAROUNDS) || (defined(CONFIG_EVA) && \777777+ defined(CONFIG_CPU_HAS_PREFETCH))782778#define DADDI_SCRATCH "$3"779779+#else780780+#define DADDI_SCRATCH "$0"783781#endif784782785783extern size_t __copy_user(void *__to, const void *__from, size_t __n);···14221418}1423141914241420/*14251425- * strlen_user: - Get the size of a string in user space.14211421+ * strnlen_user: - Get the size of a string in user space.14261422 * @str: The string to measure.14271423 *14281424 * Context: User context only. This function may sleep.···14311427 *14321428 * Returns the size of the string INCLUDING the terminating NUL.14331429 * On exception, returns 0.14341434- *14351435- * If there is a limit on the length of a valid string, you may wish to14361436- * consider using strnlen_user() instead.14301430+ * If the string is too long, returns a value greater than @n.14371431 */14381432static inline long strnlen_user(const char __user *s, long n)14391433{
+1-1
arch/mips/include/uapi/asm/unistd.h
···10451045#define __NR_seccomp (__NR_Linux + 316)10461046#define __NR_getrandom (__NR_Linux + 317)10471047#define __NR_memfd_create (__NR_Linux + 318)10481048-#define __NR_memfd_create (__NR_Linux + 319)10481048+#define __NR_bpf (__NR_Linux + 319)1049104910501050/*10511051 * Offset of the last N32 flavoured syscall
-3
arch/mips/kernel/bmips_vec.S
···208208END(bmips_reset_nmi_vec)209209210210 .set pop211211- .previous212211213212/***********************************************************************214213 * CPU1 warm restart vector (used for second and subsequent boots).···280281 jr ra281282282283END(bmips_enable_xks01)283283-284284- .previous
···193193static char unknown_isa[] = KERN_ERR \194194 "Unsupported ISA type, c0.config0: %d.";195195196196+static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c)197197+{198198+199199+ unsigned int probability = c->tlbsize / c->tlbsizevtlb;200200+201201+ /*202202+ * 0 = All TLBWR instructions go to FTLB203203+ * 1 = 15:1: For every 16 TBLWR instructions, 15 go to the204204+ * FTLB and 1 goes to the VTLB.205205+ * 2 = 7:1: As above with 7:1 ratio.206206+ * 3 = 3:1: As above with 3:1 ratio.207207+ *208208+ * Use the linear midpoint as the probability threshold.209209+ */210210+ if (probability >= 12)211211+ return 1;212212+ else if (probability >= 6)213213+ return 2;214214+ else215215+ /*216216+ * So FTLB is less than 4 times bigger than VTLB.217217+ * A 3:1 ratio can still be useful though.218218+ */219219+ return 3;220220+}221221+196222static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)197223{198224 unsigned int config6;···229203 case CPU_P5600:230204 /* proAptiv & related cores use Config6 to enable the FTLB */231205 config6 = read_c0_config6();206206+ /* Clear the old probability value */207207+ config6 &= ~(3 << MIPS_CONF6_FTLBP_SHIFT);232208 if (enable)233209 /* Enable FTLB */234234- write_c0_config6(config6 | MIPS_CONF6_FTLBEN);210210+ write_c0_config6(config6 |211211+ (calculate_ftlb_probability(c)212212+ << MIPS_CONF6_FTLBP_SHIFT)213213+ | MIPS_CONF6_FTLBEN);235214 else236215 /* Disable FTLB */237216 write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN);···788757 c->cputype = CPU_LOONGSON2;789758 __cpu_name[cpu] = "ICT Loongson-2";790759 set_elf_platform(cpu, "loongson2e");760760+ set_isa(c, MIPS_CPU_ISA_III);791761 break;792762 case PRID_REV_LOONGSON2F:793763 c->cputype = CPU_LOONGSON2;794764 __cpu_name[cpu] = "ICT Loongson-2";795765 set_elf_platform(cpu, "loongson2f");766766+ set_isa(c, MIPS_CPU_ISA_III);796767 break;797768 case PRID_REV_LOONGSON3A:798769 c->cputype = CPU_LOONGSON3;799799- c->writecombine = _CACHE_UNCACHED_ACCELERATED;800770 __cpu_name[cpu] = "ICT Loongson-3";801771 set_elf_platform(cpu, "loongson3a");772772+ set_isa(c, MIPS_CPU_ISA_M64R1);802773 break;803774 case PRID_REV_LOONGSON3B_R1:804775 case PRID_REV_LOONGSON3B_R2:805776 c->cputype = CPU_LOONGSON3;806777 __cpu_name[cpu] = "ICT Loongson-3";807778 set_elf_platform(cpu, "loongson3b");779779+ set_isa(c, MIPS_CPU_ISA_M64R1);808780 break;809781 }810782811811- set_isa(c, MIPS_CPU_ISA_III);812783 c->options = R4K_OPTS |813784 MIPS_CPU_FPU | MIPS_CPU_LLSC |814785 MIPS_CPU_32FPR;815786 c->tlbsize = 64;787787+ c->writecombine = _CACHE_UNCACHED_ACCELERATED;816788 break;817789 case PRID_IMP_LOONGSON_32: /* Loongson-1 */818790 decode_configs(c);
+32-10
arch/mips/kernel/jump_label.c
···18181919#ifdef HAVE_JUMP_LABEL20202121-#define J_RANGE_MASK ((1ul << 28) - 1)2121+/*2222+ * Define parameters for the standard MIPS and the microMIPS jump2323+ * instruction encoding respectively:2424+ *2525+ * - the ISA bit of the target, either 0 or 1 respectively,2626+ *2727+ * - the amount the jump target address is shifted right to fit in the2828+ * immediate field of the machine instruction, either 2 or 1,2929+ *3030+ * - the mask determining the size of the jump region relative to the3131+ * delay-slot instruction, either 256MB or 128MB,3232+ *3333+ * - the jump target alignment, either 4 or 2 bytes.3434+ */3535+#define J_ISA_BIT IS_ENABLED(CONFIG_CPU_MICROMIPS)3636+#define J_RANGE_SHIFT (2 - J_ISA_BIT)3737+#define J_RANGE_MASK ((1ul << (26 + J_RANGE_SHIFT)) - 1)3838+#define J_ALIGN_MASK ((1ul << J_RANGE_SHIFT) - 1)22392340void arch_jump_label_transform(struct jump_entry *e,2441 enum jump_label_type type)2542{4343+ union mips_instruction *insn_p;2644 union mips_instruction insn;2727- union mips_instruction *insn_p =2828- (union mips_instruction *)(unsigned long)e->code;29453030- /* Jump only works within a 256MB aligned region. */3131- BUG_ON((e->target & ~J_RANGE_MASK) != (e->code & ~J_RANGE_MASK));4646+ insn_p = (union mips_instruction *)msk_isa16_mode(e->code);32473333- /* Target must have 4 byte alignment. */3434- BUG_ON((e->target & 3) != 0);4848+ /* Jump only works within an aligned region its delay slot is in. */4949+ BUG_ON((e->target & ~J_RANGE_MASK) != ((e->code + 4) & ~J_RANGE_MASK));5050+5151+ /* Target must have the right alignment and ISA must be preserved. */5252+ BUG_ON((e->target & J_ALIGN_MASK) != J_ISA_BIT);35533654 if (type == JUMP_LABEL_ENABLE) {3737- insn.j_format.opcode = j_op;3838- insn.j_format.target = (e->target & J_RANGE_MASK) >> 2;5555+ insn.j_format.opcode = J_ISA_BIT ? mm_j32_op : j_op;5656+ insn.j_format.target = e->target >> J_RANGE_SHIFT;3957 } else {4058 insn.word = 0; /* nop */4159 }42604361 get_online_cpus();4462 mutex_lock(&text_mutex);4545- *insn_p = insn;6363+ if (IS_ENABLED(CONFIG_CPU_MICROMIPS)) {6464+ insn_p->halfword[0] = insn.word >> 16;6565+ insn_p->halfword[1] = insn.word;6666+ } else6767+ *insn_p = insn;46684769 flush_icache_range((unsigned long)insn_p,4870 (unsigned long)insn_p + sizeof(*insn_p));
+2-2
arch/mips/kernel/rtlx.c
···9494 int ret = 0;95959696 if (index >= RTLX_CHANNELS) {9797- pr_debug(KERN_DEBUG "rtlx_open index out of range\n");9797+ pr_debug("rtlx_open index out of range\n");9898 return -ENOSYS;9999 }100100101101 if (atomic_inc_return(&channel_wqs[index].in_open) > 1) {102102- pr_debug(KERN_DEBUG "rtlx_open channel %d already opened\n", index);102102+ pr_debug("rtlx_open channel %d already opened\n", index);103103 ret = -EBUSY;104104 goto out_fail;105105 }
+2-2
arch/mips/kernel/setup.c
···485485 * NOTE: historically plat_mem_setup did the entire platform initialization.486486 * This was rather impractical because it meant plat_mem_setup had to487487 * get away without any kind of memory allocator. To keep old code from488488- * breaking plat_setup was just renamed to plat_setup and a second platform488488+ * breaking plat_setup was just renamed to plat_mem_setup and a second platform489489 * initialization hook for anything else was introduced.490490 */491491···493493494494static int __init early_parse_mem(char *p)495495{496496- unsigned long start, size;496496+ phys_t start, size;497497498498 /*499499 * If a user specifies memory size, we
···9292 /* This marks the end of the previous function,9393 which means we overran. */9494 break;9595- stack_size = (unsigned) stack_adjustment;9595+ stack_size = (unsigned long) stack_adjustment;9696 } else if (is_ra_save_ins(&ip)) {9797 int ra_slot = ip.i_format.simmediate;9898 if (ra_slot < 0)
+1
arch/mips/sgi-ip27/ip27-memory.c
···107107}108108109109unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];110110+EXPORT_SYMBOL(__node_distances);110111111112static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b)112113{
-2
arch/powerpc/include/asm/pci-bridge.h
···159159160160 int pci_ext_config_space; /* for pci devices */161161162162- bool force_32bit_msi;163163-164162 struct pci_dev *pcidev; /* back-pointer to the pci device */165163#ifdef CONFIG_EEH166164 struct eeh_dev *edev; /* eeh device */
···141141/* Only used for 64 bit */142142#define _TIF_DO_NOTIFY_MASK \143143 (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \144144- _TIF_USER_RETURN_NOTIFY)144144+ _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)145145146146/* flags to check in __switch_to() */147147#define _TIF_WORK_CTXSW \
···146146147147static int __init x86_xsave_setup(char *s)148148{149149+ if (strlen(s))150150+ return 0;149151 setup_clear_cpu_cap(X86_FEATURE_XSAVE);150152 setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);151153 setup_clear_cpu_cap(X86_FEATURE_XSAVES);
+8
arch/x86/kernel/cpu/microcode/core.c
···465465466466 if (uci->valid && uci->mc)467467 microcode_ops->apply_microcode(cpu);468468+ else if (!uci->mc)469469+ /*470470+ * We might resume and not have applied late microcode but still471471+ * have a newer patch stashed from the early loader. We don't472472+ * have it in uci->mc so we have to load it the same way we're473473+ * applying patches early on the APs.474474+ */475475+ load_ucode_ap();468476}469477470478static struct syscore_ops mc_syscore_ops = {
···828828 jnz native_irq_return_ldt829829#endif830830831831+.global native_irq_return_iret831832native_irq_return_iret:833833+ /*834834+ * This may fault. Non-paranoid faults on return to userspace are835835+ * handled by fixup_bad_iret. These include #SS, #GP, and #NP.836836+ * Double-faults due to espfix64 are handled in do_double_fault.837837+ * Other faults here are fatal.838838+ */832839 iretq833833- _ASM_EXTABLE(native_irq_return_iret, bad_iret)834840835841#ifdef CONFIG_X86_ESPFIX64836842native_irq_return_ldt:···863857 popq_cfi %rax864858 jmp native_irq_return_iret865859#endif866866-867867- .section .fixup,"ax"868868-bad_iret:869869- /*870870- * The iret traps when the %cs or %ss being restored is bogus.871871- * We've lost the original trap vector and error code.872872- * #GPF is the most likely one to get for an invalid selector.873873- * So pretend we completed the iret and took the #GPF in user mode.874874- *875875- * We are now running with the kernel GS after exception recovery.876876- * But error_entry expects us to have user GS to match the user %cs,877877- * so swap back.878878- */879879- pushq $0880880-881881- SWAPGS882882- jmp general_protection883883-884884- .previous885860886861 /* edi: workmask, edx: work */887862retint_careful:···908921#endif909922 CFI_ENDPROC910923END(common_interrupt)911911-912912- /*913913- * If IRET takes a fault on the espfix stack, then we914914- * end up promoting it to a doublefault. In that case,915915- * modify the stack to make it look like we just entered916916- * the #GP handler from user space, similar to bad_iret.917917- */918918-#ifdef CONFIG_X86_ESPFIX64919919- ALIGN920920-__do_double_fault:921921- XCPT_FRAME 1 RDI+8922922- movq RSP(%rdi),%rax /* Trap on the espfix stack? */923923- sarq $PGDIR_SHIFT,%rax924924- cmpl $ESPFIX_PGD_ENTRY,%eax925925- jne do_double_fault /* No, just deliver the fault */926926- cmpl $__KERNEL_CS,CS(%rdi)927927- jne do_double_fault928928- movq RIP(%rdi),%rax929929- cmpq $native_irq_return_iret,%rax930930- jne do_double_fault /* This shouldn't happen... */931931- movq PER_CPU_VAR(kernel_stack),%rax932932- subq $(6*8-KERNEL_STACK_OFFSET),%rax /* Reset to original stack */933933- movq %rax,RSP(%rdi)934934- movq $0,(%rax) /* Missing (lost) #GP error code */935935- movq $general_protection,RIP(%rdi)936936- retq937937- CFI_ENDPROC938938-END(__do_double_fault)939939-#else940940-# define __do_double_fault do_double_fault941941-#endif942924943925/*944926 * APIC interrupts.···10801124idtentry bounds do_bounds has_error_code=010811125idtentry invalid_op do_invalid_op has_error_code=010821126idtentry device_not_available do_device_not_available has_error_code=010831083-idtentry double_fault __do_double_fault has_error_code=1 paranoid=111271127+idtentry double_fault do_double_fault has_error_code=1 paranoid=110841128idtentry coprocessor_segment_overrun do_coprocessor_segment_overrun has_error_code=010851129idtentry invalid_TSS do_invalid_TSS has_error_code=110861130idtentry segment_not_present do_segment_not_present has_error_code=1···1245128912461290idtentry debug do_debug has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK12471291idtentry int3 do_int3 has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK12481248-idtentry stack_segment do_stack_segment has_error_code=1 paranoid=112921292+idtentry stack_segment do_stack_segment has_error_code=112491293#ifdef CONFIG_XEN12501294idtentry xen_debug do_debug has_error_code=012511295idtentry xen_int3 do_int3 has_error_code=0···1355139913561400/*13571401 * There are two places in the kernel that can potentially fault with13581358- * usergs. Handle them here. The exception handlers after iret run with13591359- * kernel gs again, so don't set the user space flag. B stepping K8s13601360- * sometimes report an truncated RIP for IRET exceptions returning to13611361- * compat mode. Check for these here too.14021402+ * usergs. Handle them here. B stepping K8s sometimes report a14031403+ * truncated RIP for IRET exceptions returning to compat mode. Check14041404+ * for these here too.13621405 */13631406error_kernelspace:13641407 CFI_REL_OFFSET rcx, RCX+813651408 incl %ebx13661409 leaq native_irq_return_iret(%rip),%rcx13671410 cmpq %rcx,RIP+8(%rsp)13681368- je error_swapgs14111411+ je error_bad_iret13691412 movl %ecx,%eax /* zero extend */13701413 cmpq %rax,RIP+8(%rsp)13711414 je bstep_iret···13751420bstep_iret:13761421 /* Fix truncated RIP */13771422 movq %rcx,RIP+8(%rsp)13781378- jmp error_swapgs14231423+ /* fall through */14241424+14251425+error_bad_iret:14261426+ SWAPGS14271427+ mov %rsp,%rdi14281428+ call fixup_bad_iret14291429+ mov %rax,%rsp14301430+ decl %ebx /* Return to usergs */14311431+ jmp error_sti13791432 CFI_ENDPROC13801433END(error_entry)13811434
···233233DO_ERROR(X86_TRAP_OLD_MF, SIGFPE, "coprocessor segment overrun",coprocessor_segment_overrun)234234DO_ERROR(X86_TRAP_TS, SIGSEGV, "invalid TSS", invalid_TSS)235235DO_ERROR(X86_TRAP_NP, SIGBUS, "segment not present", segment_not_present)236236-#ifdef CONFIG_X86_32237236DO_ERROR(X86_TRAP_SS, SIGBUS, "stack segment", stack_segment)238238-#endif239237DO_ERROR(X86_TRAP_AC, SIGBUS, "alignment check", alignment_check)240238241239#ifdef CONFIG_X86_64242240/* Runs on IST stack */243243-dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code)244244-{245245- enum ctx_state prev_state;246246-247247- prev_state = exception_enter();248248- if (notify_die(DIE_TRAP, "stack segment", regs, error_code,249249- X86_TRAP_SS, SIGBUS) != NOTIFY_STOP) {250250- preempt_conditional_sti(regs);251251- do_trap(X86_TRAP_SS, SIGBUS, "stack segment", regs, error_code, NULL);252252- preempt_conditional_cli(regs);253253- }254254- exception_exit(prev_state);255255-}256256-257241dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)258242{259243 static const char str[] = "double fault";260244 struct task_struct *tsk = current;245245+246246+#ifdef CONFIG_X86_ESPFIX64247247+ extern unsigned char native_irq_return_iret[];248248+249249+ /*250250+ * If IRET takes a non-IST fault on the espfix64 stack, then we251251+ * end up promoting it to a doublefault. In that case, modify252252+ * the stack to make it look like we just entered the #GP253253+ * handler from user space, similar to bad_iret.254254+ */255255+ if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&256256+ regs->cs == __KERNEL_CS &&257257+ regs->ip == (unsigned long)native_irq_return_iret)258258+ {259259+ struct pt_regs *normal_regs = task_pt_regs(current);260260+261261+ /* Fake a #GP(0) from userspace. */262262+ memmove(&normal_regs->ip, (void *)regs->sp, 5*8);263263+ normal_regs->orig_ax = 0; /* Missing (lost) #GP error code */264264+ regs->ip = (unsigned long)general_protection;265265+ regs->sp = (unsigned long)&normal_regs->orig_ax;266266+ return;267267+ }268268+#endif261269262270 exception_enter();263271 /* Return not checked because double check cannot be ignored */···407399 return regs;408400}409401NOKPROBE_SYMBOL(sync_regs);402402+403403+struct bad_iret_stack {404404+ void *error_entry_ret;405405+ struct pt_regs regs;406406+};407407+408408+asmlinkage __visible409409+struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)410410+{411411+ /*412412+ * This is called from entry_64.S early in handling a fault413413+ * caused by a bad iret to user mode. To handle the fault414414+ * correctly, we want move our stack frame to task_pt_regs415415+ * and we want to pretend that the exception came from the416416+ * iret target.417417+ */418418+ struct bad_iret_stack *new_stack =419419+ container_of(task_pt_regs(current),420420+ struct bad_iret_stack, regs);421421+422422+ /* Copy the IRET target to the new stack. */423423+ memmove(&new_stack->regs.ip, (void *)s->regs.sp, 5*8);424424+425425+ /* Copy the remainder of the stack from the current stack. */426426+ memmove(new_stack, s, offsetof(struct bad_iret_stack, regs.ip));427427+428428+ BUG_ON(!user_mode_vm(&new_stack->regs));429429+ return new_stack;430430+}410431#endif411432412433/*···815778 set_intr_gate(X86_TRAP_OLD_MF, coprocessor_segment_overrun);816779 set_intr_gate(X86_TRAP_TS, invalid_TSS);817780 set_intr_gate(X86_TRAP_NP, segment_not_present);818818- set_intr_gate_ist(X86_TRAP_SS, &stack_segment, STACKFAULT_STACK);781781+ set_intr_gate(X86_TRAP_SS, stack_segment);819782 set_intr_gate(X86_TRAP_GP, general_protection);820783 set_intr_gate(X86_TRAP_SPURIOUS, spurious_interrupt_bug);821784 set_intr_gate(X86_TRAP_MF, coprocessor_error);
+3-3
arch/x86/kvm/mmu.c
···630630 * kvm mmu, before reclaiming the page, we should631631 * unmap it from mmu first.632632 */633633- WARN_ON(!kvm_is_mmio_pfn(pfn) && !page_count(pfn_to_page(pfn)));633633+ WARN_ON(!kvm_is_reserved_pfn(pfn) && !page_count(pfn_to_page(pfn)));634634635635 if (!shadow_accessed_mask || old_spte & shadow_accessed_mask)636636 kvm_set_pfn_accessed(pfn);···24612461 spte |= PT_PAGE_SIZE_MASK;24622462 if (tdp_enabled)24632463 spte |= kvm_x86_ops->get_mt_mask(vcpu, gfn,24642464- kvm_is_mmio_pfn(pfn));24642464+ kvm_is_reserved_pfn(pfn));2465246524662466 if (host_writable)24672467 spte |= SPTE_HOST_WRITEABLE;···27372737 * PT_PAGE_TABLE_LEVEL and there would be no adjustment done27382738 * here.27392739 */27402740- if (!is_error_noslot_pfn(pfn) && !kvm_is_mmio_pfn(pfn) &&27402740+ if (!is_error_noslot_pfn(pfn) && !kvm_is_reserved_pfn(pfn) &&27412741 level == PT_PAGE_TABLE_LEVEL &&27422742 PageTransCompound(pfn_to_page(pfn)) &&27432743 !has_wrprotected_page(vcpu->kvm, gfn, PT_DIRECTORY_LEVEL)) {
+10-1
arch/x86/mm/init_64.c
···11231123 unsigned long end = (unsigned long) &__end_rodata_hpage_align;11241124 unsigned long text_end = PFN_ALIGN(&__stop___ex_table);11251125 unsigned long rodata_end = PFN_ALIGN(&__end_rodata);11261126- unsigned long all_end = PFN_ALIGN(&_end);11261126+ unsigned long all_end;1127112711281128 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",11291129 (end - start) >> 10);···11341134 /*11351135 * The rodata/data/bss/brk section (but not the kernel text!)11361136 * should also be not-executable.11371137+ *11381138+ * We align all_end to PMD_SIZE because the existing mapping11391139+ * is a full PMD. If we would align _brk_end to PAGE_SIZE we11401140+ * split the PMD and the reminder between _brk_end and the end11411141+ * of the PMD will remain mapped executable.11421142+ *11431143+ * Any PMD which was setup after the one which covers _brk_end11441144+ * has been zapped already via cleanup_highmem().11371145 */11461146+ all_end = roundup((unsigned long)_brk_end, PMD_SIZE);11381147 set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);1139114811401149 rodata_test();
+10-1
arch/x86/tools/calc_run_size.pl
···1919 if ($file_offset == 0) {2020 $file_offset = $offset;2121 } elsif ($file_offset != $offset) {2222- die ".bss and .brk lack common file offset\n";2222+ # BFD linker shows the same file offset in ELF.2323+ # Gold linker shows them as consecutive.2424+ next if ($file_offset + $mem_size == $offset + $size);2525+2626+ printf STDERR "file_offset: 0x%lx\n", $file_offset;2727+ printf STDERR "mem_size: 0x%lx\n", $mem_size;2828+ printf STDERR "offset: 0x%lx\n", $offset;2929+ printf STDERR "size: 0x%lx\n", $size;3030+3131+ die ".bss and .brk are non-contiguous\n";2332 }2433 }2534}
···182182 /* Make sure timer is stopped before playing with interrupts */183183 sun4i_clkevt_time_stop(0);184184185185+ sun4i_clockevent.cpumask = cpu_possible_mask;186186+ sun4i_clockevent.irq = irq;187187+188188+ clockevents_config_and_register(&sun4i_clockevent, rate,189189+ TIMER_SYNC_TICKS, 0xffffffff);190190+185191 ret = setup_irq(irq, &sun4i_timer_irq);186192 if (ret)187193 pr_warn("failed to setup irq %d\n", irq);···195189 /* Enable timer0 interrupt */196190 val = readl(timer_base + TIMER_IRQ_EN_REG);197191 writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);198198-199199- sun4i_clockevent.cpumask = cpu_possible_mask;200200- sun4i_clockevent.irq = irq;201201-202202- clockevents_config_and_register(&sun4i_clockevent, rate,203203- TIMER_SYNC_TICKS, 0xffffffff);204192}205193CLOCKSOURCE_OF_DECLARE(sun4i, "allwinner,sun4i-a10-timer",206194 sun4i_timer_init);
+16-7
drivers/dma/pl330.c
···271271#define DMAC_MODE_NS (1 << 0)272272 unsigned int mode;273273 unsigned int data_bus_width:10; /* In number of bits */274274- unsigned int data_buf_dep:10;274274+ unsigned int data_buf_dep:11;275275 unsigned int num_chan:4;276276 unsigned int num_peri:6;277277 u32 peri_ns;···23362336 int burst_len;2337233723382338 burst_len = pl330->pcfg.data_bus_width / 8;23392339- burst_len *= pl330->pcfg.data_buf_dep;23392339+ burst_len *= pl330->pcfg.data_buf_dep / pl330->pcfg.num_chan;23402340 burst_len >>= desc->rqcfg.brst_size;2341234123422342 /* src/dst_burst_len can't be more than 16 */···24592459 /* Select max possible burst size */24602460 burst = pl330->pcfg.data_bus_width / 8;2461246124622462- while (burst > 1) {24632463- if (!(len % burst))24642464- break;24622462+ /*24632463+ * Make sure we use a burst size that aligns with all the memcpy24642464+ * parameters because our DMA programming algorithm doesn't cope with24652465+ * transfers which straddle an entry in the DMA device's MFIFO.24662466+ */24672467+ while ((src | dst | len) & (burst - 1))24652468 burst /= 2;24662466- }2467246924682470 desc->rqcfg.brst_size = 0;24692471 while (burst != (1 << desc->rqcfg.brst_size))24702472 desc->rqcfg.brst_size++;24732473+24742474+ /*24752475+ * If burst size is smaller than bus width then make sure we only24762476+ * transfer one at a time to avoid a burst stradling an MFIFO entry.24772477+ */24782478+ if (desc->rqcfg.brst_size * 8 < pl330->pcfg.data_bus_width)24792479+ desc->rqcfg.brst_len = 1;2471248024722481 desc->rqcfg.brst_len = get_burst_len(desc, len);24732482···274127322742273327432734 dev_info(&adev->dev,27442744- "Loaded driver for PL330 DMAC-%d\n", adev->periphid);27352735+ "Loaded driver for PL330 DMAC-%x\n", adev->periphid);27452736 dev_info(&adev->dev,27462737 "\tDBUFF-%ux%ubytes Num_Chans-%u Num_Peri-%u Num_Events-%u\n",27472738 pcfg->data_buf_dep, pcfg->data_bus_width / 8, pcfg->num_chan,
···16701670 goto out_regs;1671167116721672 if (drm_core_check_feature(dev, DRIVER_MODESET)) {16731673- ret = i915_kick_out_vgacon(dev_priv);16741674- if (ret) {16751675- DRM_ERROR("failed to remove conflicting VGA console\n");16761676- goto out_gtt;16771677- }16781678-16731673+ /* WARNING: Apparently we must kick fbdev drivers before vgacon,16741674+ * otherwise the vga fbdev driver falls over. */16791675 ret = i915_kick_out_firmware_fb(dev_priv);16801676 if (ret) {16811677 DRM_ERROR("failed to remove conflicting framebuffer drivers\n");16781678+ goto out_gtt;16791679+ }16801680+16811681+ ret = i915_kick_out_vgacon(dev_priv);16821682+ if (ret) {16831683+ DRM_ERROR("failed to remove conflicting VGA console\n");16821684 goto out_gtt;16831685 }16841686 }
+4
drivers/gpu/drm/i915/intel_display.c
···94089408 struct drm_device *dev = crtc->base.dev;94099409 struct drm_i915_private *dev_priv = dev->dev_private;9410941094119411+ if (i915_reset_in_progress(&dev_priv->gpu_error) ||94129412+ crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))94139413+ return true;94149414+94119415 /*94129416 * The relevant registers doen't exist on pre-ctg.94139417 * As the flip done interrupt doesn't trigger for mmio
+1
drivers/gpu/drm/i915/intel_dp.c
···44504450 * vdd might still be enabled do to the delayed vdd off.44514451 * Make sure vdd is actually turned off here.44524452 */44534453+ cancel_delayed_work_sync(&intel_dp->panel_vdd_work);44534454 pps_lock(intel_dp);44544455 edp_panel_vdd_off_sync(intel_dp);44554456 pps_unlock(intel_dp);
···322322 }323323324324 if (!radeon_connector->edid) {325325+ /* don't fetch the edid from the vbios if ddc fails and runpm is326326+ * enabled so we report disconnected.327327+ */328328+ if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))329329+ return;330330+325331 if (rdev->is_atom_bios) {326332 /* some laptops provide a hardcoded edid in rom for LCDs */327333 if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) ||···832826static enum drm_connector_status833827radeon_lvds_detect(struct drm_connector *connector, bool force)834828{829829+ struct drm_device *dev = connector->dev;830830+ struct radeon_device *rdev = dev->dev_private;835831 struct radeon_connector *radeon_connector = to_radeon_connector(connector);836832 struct drm_encoder *encoder = radeon_best_single_encoder(connector);837833 enum drm_connector_status ret = connector_status_disconnected;···850842 /* check if panel is valid */851843 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)852844 ret = connector_status_connected;853853-845845+ /* don't fetch the edid from the vbios if ddc fails and runpm is846846+ * enabled so we report disconnected.847847+ */848848+ if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))849849+ ret = connector_status_disconnected;854850 }855851856852 /* check for edid as well */···16011589 /* check if panel is valid */16021590 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)16031591 ret = connector_status_connected;15921592+ /* don't fetch the edid from the vbios if ddc fails and runpm is15931593+ * enabled so we report disconnected.15941594+ */15951595+ if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))15961596+ ret = connector_status_disconnected;16041597 }16051598 /* eDP is always DP */16061599 radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;
···185185 if (rdev->flags & RADEON_IS_AGP)186186 return false;187187188188+ /*189189+ * Older chips have a HW limitation, they can only generate 40 bits190190+ * of address for "64-bit" MSIs which breaks on some platforms, notably191191+ * IBM POWER servers, so we limit them192192+ */193193+ if (rdev->family < CHIP_BONAIRE) {194194+ dev_info(rdev->dev, "radeon: MSI limited to 32-bit\n");195195+ rdev->pdev->no_64bit_msi = 1;196196+ }197197+188198 /* force MSI on */189199 if (radeon_msi == 1)190200 return true;
+2-4
drivers/hwmon/g762.c
···10841084 if (ret)10851085 goto clock_dis;1086108610871087- data->hwmon_dev = devm_hwmon_device_register_with_groups(dev,10881088- client->name,10891089- data,10901090- g762_groups);10871087+ data->hwmon_dev = hwmon_device_register_with_groups(dev, client->name,10881088+ data, g762_groups);10911089 if (IS_ERR(data->hwmon_dev)) {10921090 ret = PTR_ERR(data->hwmon_dev);10931091 goto clock_dis;
+33-7
drivers/iio/accel/bmc150-accel.c
···44444545#define BMC150_ACCEL_REG_INT_STATUS_2 0x0B4646#define BMC150_ACCEL_ANY_MOTION_MASK 0x074747+#define BMC150_ACCEL_ANY_MOTION_BIT_X BIT(0)4848+#define BMC150_ACCEL_ANY_MOTION_BIT_Y BIT(1)4949+#define BMC150_ACCEL_ANY_MOTION_BIT_Z BIT(2)4750#define BMC150_ACCEL_ANY_MOTION_BIT_SIGN BIT(3)48514952#define BMC150_ACCEL_REG_PMU_LPW 0x11···9592#define BMC150_ACCEL_SLOPE_THRES_MASK 0xFF96939794/* Slope duration in terms of number of samples */9898-#define BMC150_ACCEL_DEF_SLOPE_DURATION 29595+#define BMC150_ACCEL_DEF_SLOPE_DURATION 19996/* in terms of multiples of g's/LSB, based on range */100100-#define BMC150_ACCEL_DEF_SLOPE_THRESHOLD 59797+#define BMC150_ACCEL_DEF_SLOPE_THRESHOLD 11019810299#define BMC150_ACCEL_REG_XOUT_L 0x02103100···539536 if (ret < 0) {540537 dev_err(&data->client->dev,541538 "Failed: bmc150_accel_set_power_state for %d\n", on);539539+ if (on)540540+ pm_runtime_put_noidle(&data->client->dev);541541+542542 return ret;543543 }544544···817811818812 ret = bmc150_accel_setup_any_motion_interrupt(data, state);819813 if (ret < 0) {814814+ bmc150_accel_set_power_state(data, false);820815 mutex_unlock(&data->mutex);821816 return ret;822817 }···853846854847static const struct iio_event_spec bmc150_accel_event = {855848 .type = IIO_EV_TYPE_ROC,856856- .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING,849849+ .dir = IIO_EV_DIR_EITHER,857850 .mask_separate = BIT(IIO_EV_INFO_VALUE) |858851 BIT(IIO_EV_INFO_ENABLE) |859852 BIT(IIO_EV_INFO_PERIOD)···10611054 else10621055 ret = bmc150_accel_setup_new_data_interrupt(data, state);10631056 if (ret < 0) {10571057+ bmc150_accel_set_power_state(data, false);10641058 mutex_unlock(&data->mutex);10651059 return ret;10661060 }···11001092 else11011093 dir = IIO_EV_DIR_RISING;1102109411031103- if (ret & BMC150_ACCEL_ANY_MOTION_MASK)10951095+ if (ret & BMC150_ACCEL_ANY_MOTION_BIT_X)11041096 iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL,11051097 0,11061106- IIO_MOD_X_OR_Y_OR_Z,10981098+ IIO_MOD_X,11071099 IIO_EV_TYPE_ROC,11081108- IIO_EV_DIR_EITHER),11001100+ dir),11011101+ data->timestamp);11021102+ if (ret & BMC150_ACCEL_ANY_MOTION_BIT_Y)11031103+ iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL,11041104+ 0,11051105+ IIO_MOD_Y,11061106+ IIO_EV_TYPE_ROC,11071107+ dir),11081108+ data->timestamp);11091109+ if (ret & BMC150_ACCEL_ANY_MOTION_BIT_Z)11101110+ iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL,11111111+ 0,11121112+ IIO_MOD_Z,11131113+ IIO_EV_TYPE_ROC,11141114+ dir),11091115 data->timestamp);11101116ack_intr_status:11111117 if (!data->dready_trigger_on)···13761354{13771355 struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));13781356 struct bmc150_accel_data *data = iio_priv(indio_dev);13571357+ int ret;1379135813801359 dev_dbg(&data->client->dev, __func__);13601360+ ret = bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_SUSPEND, 0);13611361+ if (ret < 0)13621362+ return -EAGAIN;1381136313821382- return bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_SUSPEND, 0);13641364+ return 0;13831365}1384136613851367static int bmc150_accel_runtime_resume(struct device *dev)
+2
drivers/iio/accel/kxcjk-1013.c
···269269 return ret;270270 }271271272272+ ret &= ~(KXCJK1013_REG_CTRL1_BIT_GSEL0 |273273+ KXCJK1013_REG_CTRL1_BIT_GSEL1);272274 ret |= (KXCJK1013_scale_table[range_index].gsel_0 << 3);273275 ret |= (KXCJK1013_scale_table[range_index].gsel_1 << 4);274276
···101101 int parent_irq;102102103103 parent_irq = irq_of_parse_and_map(dn, irq);104104- if (parent_irq < 0) {104104+ if (!parent_irq) {105105 pr_err("failed to map interrupt %d\n", irq);106106- return parent_irq;106106+ return -EINVAL;107107 }108108109109 data->irq_map_mask |= be32_to_cpup(map_mask + irq);
+2-2
drivers/irqchip/irq-brcmstb-l2.c
···135135 __raw_writel(0xffffffff, data->base + CPU_CLEAR);136136137137 data->parent_irq = irq_of_parse_and_map(np, 0);138138- if (data->parent_irq < 0) {138138+ if (!data->parent_irq) {139139 pr_err("failed to find parent interrupt\n");140140- ret = data->parent_irq;140140+ ret = -EINVAL;141141 goto out_unmap;142142 }143143
+2-1
drivers/net/bonding/bond_main.c
···24712471 bond_slave_state_change(bond);24722472 if (BOND_MODE(bond) == BOND_MODE_XOR)24732473 bond_update_slave_arr(bond, NULL);24742474- } else if (do_failover) {24742474+ }24752475+ if (do_failover) {24752476 block_netpoll_tx();24762477 bond_select_active_slave(bond);24772478 unblock_netpoll_tx();
+2-2
drivers/net/can/dev.c
···110110 long rate;111111 u64 v64;112112113113- /* Use CIA recommended sample points */113113+ /* Use CiA recommended sample points */114114 if (bt->sample_point) {115115 sampl_pt = bt->sample_point;116116 } else {···382382 BUG_ON(idx >= priv->echo_skb_max);383383384384 if (priv->echo_skb[idx]) {385385- kfree_skb(priv->echo_skb[idx]);385385+ dev_kfree_skb_any(priv->echo_skb[idx]);386386 priv->echo_skb[idx] = NULL;387387 }388388}
+1
drivers/net/can/m_can/Kconfig
···11config CAN_M_CAN22+ depends on HAS_IOMEM23 tristate "Bosch M_CAN devices"34 ---help---45 Say Y here if you want to support for Bosch M_CAN controller.
···10121012 /* igb_get_stats64() might access the rings on this vector,10131013 * we must wait a grace period before freeing it.10141014 */10151015- kfree_rcu(q_vector, rcu);10151015+ if (q_vector)10161016+ kfree_rcu(q_vector, rcu);10161017}1017101810181019/**···17931792 adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE;1794179317951794 for (i = 0; i < adapter->num_q_vectors; i++) {17961796- napi_synchronize(&(adapter->q_vector[i]->napi));17971797- napi_disable(&(adapter->q_vector[i]->napi));17951795+ if (adapter->q_vector[i]) {17961796+ napi_synchronize(&adapter->q_vector[i]->napi);17971797+ napi_disable(&adapter->q_vector[i]->napi);17981798+ }17981799 }1799180018001801···37203717 int i;3721371837223719 for (i = 0; i < adapter->num_tx_queues; i++)37233723- igb_free_tx_resources(adapter->tx_ring[i]);37203720+ if (adapter->tx_ring[i])37213721+ igb_free_tx_resources(adapter->tx_ring[i]);37243722}3725372337263724void igb_unmap_and_free_tx_resource(struct igb_ring *ring,···37863782 int i;3787378337883784 for (i = 0; i < adapter->num_tx_queues; i++)37893789- igb_clean_tx_ring(adapter->tx_ring[i]);37853785+ if (adapter->tx_ring[i])37863786+ igb_clean_tx_ring(adapter->tx_ring[i]);37903787}3791378837923789/**···38243819 int i;3825382038263821 for (i = 0; i < adapter->num_rx_queues; i++)38273827- igb_free_rx_resources(adapter->rx_ring[i]);38223822+ if (adapter->rx_ring[i])38233823+ igb_free_rx_resources(adapter->rx_ring[i]);38283824}3829382538303826/**···38803874 int i;3881387538823876 for (i = 0; i < adapter->num_rx_queues; i++)38833883- igb_clean_rx_ring(adapter->rx_ring[i]);38773877+ if (adapter->rx_ring[i])38783878+ igb_clean_rx_ring(adapter->rx_ring[i]);38843879}3885388038863881/**···74117404 pci_restore_state(pdev);74127405 pci_save_state(pdev);7413740674077407+ if (!pci_device_is_present(pdev))74087408+ return -ENODEV;74147409 err = pci_enable_device_mem(pdev);74157410 if (err) {74167411 dev_err(&pdev->dev,
+13-4
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
···39363936 * if SR-IOV and VMDQ are disabled - otherwise ensure39373937 * that hardware VLAN filters remain enabled.39383938 */39393939- if (!(adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |39403940- IXGBE_FLAG_SRIOV_ENABLED)))39393939+ if (adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |39403940+ IXGBE_FLAG_SRIOV_ENABLED))39413941 vlnctrl |= (IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);39423942 } else {39433943 if (netdev->flags & IFF_ALLMULTI) {···76697669 return -EOPNOTSUPP;7670767076717671 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);76727672+ if (!br_spec)76737673+ return -EINVAL;7672767476737675 nla_for_each_nested(attr, br_spec, rem) {76747676 __u16 mode;···7678767676797677 if (nla_type(attr) != IFLA_BRIDGE_MODE)76807678 continue;76797679+76807680+ if (nla_len(attr) < sizeof(mode))76817681+ return -EINVAL;7681768276827683 mode = nla_get_u16(attr);76837684 if (mode == BRIDGE_MODE_VEPA) {···79847979 int i, err, pci_using_dac, expected_gts;79857980 unsigned int indices = MAX_TX_QUEUES;79867981 u8 part_str[IXGBE_PBANUM_LENGTH];79827982+ bool disable_dev = false;79877983#ifdef IXGBE_FCOE79887984 u16 device_caps;79897985#endif···83758369 iounmap(adapter->io_addr);83768370 kfree(adapter->mac_table);83778371err_ioremap:83728372+ disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);83788373 free_netdev(netdev);83798374err_alloc_etherdev:83808375 pci_release_selected_regions(pdev,83818376 pci_select_bars(pdev, IORESOURCE_MEM));83828377err_pci_reg:83838378err_dma:83848384- if (!adapter || !test_and_set_bit(__IXGBE_DISABLED, &adapter->state))83798379+ if (!adapter || disable_dev)83858380 pci_disable_device(pdev);83868381 return err;83878382}···84008393{84018394 struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);84028395 struct net_device *netdev = adapter->netdev;83968396+ bool disable_dev;8403839784048398 ixgbe_dbg_adapter_exit(adapter);84058399···84508442 e_dev_info("complete\n");8451844384528444 kfree(adapter->mac_table);84458445+ disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);84538446 free_netdev(netdev);8454844784558448 pci_disable_pcie_error_reporting(pdev);8456844984578457- if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))84508450+ if (disable_dev)84588451 pci_disable_device(pdev);84598452}84608453
···177177 */178178 plat->maxmtu = JUMBO_LEN;179179180180- /* Set default value for multicast hash bins */181181- plat->multicast_filter_bins = HASH_TABLE_SIZE;182182-183183- /* Set default value for unicast filter entries */184184- plat->unicast_filter_entries = 1;185185-186180 /*187181 * Currently only the properties needed on SPEAr600188182 * are provided. All other properties should be added···264270 return PTR_ERR(addr);265271266272 plat_dat = dev_get_platdata(&pdev->dev);273273+274274+ /* Set default value for multicast hash bins */275275+ plat_dat->multicast_filter_bins = HASH_TABLE_SIZE;276276+277277+ /* Set default value for unicast filter entries */278278+ plat_dat->unicast_filter_entries = 1;279279+267280 if (pdev->dev.of_node) {268281 if (!plat_dat)269282 plat_dat = devm_kzalloc(&pdev->dev,
···974974 struct ath_vif *avp;975975976976 /*977977- * Pick the MAC address of the first interface as the new hardware978978- * MAC address. The hardware will use it together with the BSSID mask979979- * when matching addresses.977977+ * The hardware will use primary station addr together with the978978+ * BSSID mask when matching addresses.980979 */981980 memset(iter_data, 0, sizeof(*iter_data));982981 memset(&iter_data->mask, 0xff, ETH_ALEN);···12041205 list_add_tail(&avp->list, &avp->chanctx->vifs);12051206 }1206120712081208+ ath9k_calculate_summary_state(sc, avp->chanctx);12091209+12071210 ath9k_assign_hw_queues(hw, vif);1208121112091212 an->sc = sc;···12741273 ath9k_beacon_remove_slot(sc, vif);1275127412761275 ath_tx_node_cleanup(sc, &avp->mcast_node);12761276+12771277+ ath9k_calculate_summary_state(sc, avp->chanctx);1277127812781279 mutex_unlock(&sc->mutex);12791280}
···4040 return;41414242 irq = irq_of_parse_and_map(np, 0);4343- if (irq < 0) {4444- brcmf_err("interrupt could not be mapped: err=%d\n", irq);4343+ if (!irq) {4444+ brcmf_err("interrupt could not be mapped\n");4545 devm_kfree(dev, sdiodev->pdata);4646 return;4747 }
···299299 primary_offset = ch->center_freq1 - ch->chan->center_freq;300300 switch (ch->width) {301301 case NL80211_CHAN_WIDTH_20:302302+ case NL80211_CHAN_WIDTH_20_NOHT:302303 ch_inf.bw = BRCMU_CHAN_BW_20;303304 WARN_ON(primary_offset != 0);304305 break;···324323 ch_inf.sb = BRCMU_CHAN_SB_LU;325324 }326325 break;326326+ case NL80211_CHAN_WIDTH_80P80:327327+ case NL80211_CHAN_WIDTH_160:328328+ case NL80211_CHAN_WIDTH_5:329329+ case NL80211_CHAN_WIDTH_10:327330 default:328331 WARN_ON_ONCE(1);329332 }···338333 case IEEE80211_BAND_5GHZ:339334 ch_inf.band = BRCMU_CHAN_BAND_5G;340335 break;336336+ case IEEE80211_BAND_60GHZ:341337 default:342338 WARN_ON_ONCE(1);343339 }
+2
drivers/net/wireless/iwlwifi/iwl-fw.h
···155155 * @IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT: supports Quiet Period requests156156 * @IWL_UCODE_TLV_CAPA_DQA_SUPPORT: supports dynamic queue allocation (DQA),157157 * which also implies support for the scheduler configuration command158158+ * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command158159 */159160enum iwl_ucode_tlv_capa {160161 IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = BIT(0),···164163 IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT = BIT(10),165164 IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT = BIT(11),166165 IWL_UCODE_TLV_CAPA_DQA_SUPPORT = BIT(12),166166+ IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT = BIT(18),167167};168168169169/* The default calibrate table size if not specified by firmware file */
+9-3
drivers/net/wireless/iwlwifi/mvm/mac80211.c
···2448244824492449 switch (vif->type) {24502450 case NL80211_IFTYPE_STATION:24512451- /* Use aux roc framework (HS20) */24522452- ret = iwl_mvm_send_aux_roc_cmd(mvm, channel,24532453- vif, duration);24512451+ if (mvm->fw->ucode_capa.capa[0] &24522452+ IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT) {24532453+ /* Use aux roc framework (HS20) */24542454+ ret = iwl_mvm_send_aux_roc_cmd(mvm, channel,24552455+ vif, duration);24562456+ goto out_unlock;24572457+ }24582458+ IWL_ERR(mvm, "hotspot not supported\n");24592459+ ret = -EINVAL;24542460 goto out_unlock;24552461 case NL80211_IFTYPE_P2P_DEVICE:24562462 /* handle below */
+10-10
drivers/net/wireless/iwlwifi/mvm/scan.c
···602602 SCAN_COMPLETE_NOTIFICATION };603603 int ret;604604605605- if (mvm->scan_status == IWL_MVM_SCAN_NONE)606606- return 0;607607-608608- if (iwl_mvm_is_radio_killed(mvm)) {609609- ieee80211_scan_completed(mvm->hw, true);610610- iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);611611- mvm->scan_status = IWL_MVM_SCAN_NONE;612612- return 0;613613- }614614-615605 iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort,616606 scan_abort_notif,617607 ARRAY_SIZE(scan_abort_notif),···1390140013911401int iwl_mvm_cancel_scan(struct iwl_mvm *mvm)13921402{14031403+ if (mvm->scan_status == IWL_MVM_SCAN_NONE)14041404+ return 0;14051405+14061406+ if (iwl_mvm_is_radio_killed(mvm)) {14071407+ ieee80211_scan_completed(mvm->hw, true);14081408+ iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);14091409+ mvm->scan_status = IWL_MVM_SCAN_NONE;14101410+ return 0;14111411+ }14121412+13931413 if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LMAC_SCAN)13941414 return iwl_mvm_scan_offload_stop(mvm, true);13951415 return iwl_mvm_cancel_regular_scan(mvm);
···158158 skb_trim(skb, frame_length);159159}160160161161-void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)161161+/*162162+ * H/W needs L2 padding between the header and the paylod if header size163163+ * is not 4 bytes aligned.164164+ */165165+void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int hdr_len)162166{163163- unsigned int payload_length = skb->len - header_length;164164- unsigned int header_align = ALIGN_SIZE(skb, 0);165165- unsigned int payload_align = ALIGN_SIZE(skb, header_length);166166- unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;167167-168168- /*169169- * Adjust the header alignment if the payload needs to be moved more170170- * than the header.171171- */172172- if (payload_align > header_align)173173- header_align += 4;174174-175175- /* There is nothing to do if no alignment is needed */176176- if (!header_align)177177- return;178178-179179- /* Reserve the amount of space needed in front of the frame */180180- skb_push(skb, header_align);181181-182182- /*183183- * Move the header.184184- */185185- memmove(skb->data, skb->data + header_align, header_length);186186-187187- /* Move the payload, if present and if required */188188- if (payload_length && payload_align)189189- memmove(skb->data + header_length + l2pad,190190- skb->data + header_length + l2pad + payload_align,191191- payload_length);192192-193193- /* Trim the skb to the correct size */194194- skb_trim(skb, header_length + l2pad + payload_length);195195-}196196-197197-void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)198198-{199199- /*200200- * L2 padding is only present if the skb contains more than just the201201- * IEEE 802.11 header.202202- */203203- unsigned int l2pad = (skb->len > header_length) ?204204- L2PAD_SIZE(header_length) : 0;167167+ unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;205168206169 if (!l2pad)207170 return;208171209209- memmove(skb->data + l2pad, skb->data, header_length);172172+ skb_push(skb, l2pad);173173+ memmove(skb->data, skb->data + l2pad, hdr_len);174174+}175175+176176+void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int hdr_len)177177+{178178+ unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;179179+180180+ if (!l2pad)181181+ return;182182+183183+ memmove(skb->data + l2pad, skb->data, hdr_len);210184 skb_pull(skb, l2pad);211185}212186
···450450 return NULL;451451}452452453453+static int of_empty_ranges_quirk(void)454454+{455455+ if (IS_ENABLED(CONFIG_PPC)) {456456+ /* To save cycles, we cache the result */457457+ static int quirk_state = -1;458458+459459+ if (quirk_state < 0)460460+ quirk_state =461461+ of_machine_is_compatible("Power Macintosh") ||462462+ of_machine_is_compatible("MacRISC");463463+ return quirk_state;464464+ }465465+ return false;466466+}467467+453468static int of_translate_one(struct device_node *parent, struct of_bus *bus,454469 struct of_bus *pbus, __be32 *addr,455470 int na, int ns, int pna, const char *rprop)···490475 * This code is only enabled on powerpc. --gcl491476 */492477 ranges = of_get_property(parent, rprop, &rlen);493493-#if !defined(CONFIG_PPC)494494- if (ranges == NULL) {478478+ if (ranges == NULL && !of_empty_ranges_quirk()) {495479 pr_err("OF: no ranges; cannot translate\n");496480 return 1;497481 }498498-#endif /* !defined(CONFIG_PPC) */499482 if (ranges == NULL || rlen == 0) {500483 offset = of_read_number(addr, na);501484 memset(addr, 0, pna * 4);
+1-1
drivers/of/dynamic.c
···247247 * @allocflags: Allocation flags (typically pass GFP_KERNEL)248248 *249249 * Copy a property by dynamically allocating the memory of both the250250- * property stucture and the property name & contents. The property's250250+ * property structure and the property name & contents. The property's251251 * flags have the OF_DYNAMIC bit set so that we can differentiate between252252 * dynamically allocated properties and not.253253 * Returns the newly allocated property or NULL on out of memory error.
+1-1
drivers/of/fdt.c
···773773 if (offset < 0)774774 return -ENODEV;775775776776- while (match->compatible) {776776+ while (match->compatible[0]) {777777 unsigned long addr;778778 if (fdt_node_check_compatible(fdt, offset, match->compatible)) {779779 match++;
+8-3
drivers/of/selftest.c
···896896 return;897897 }898898899899- while (last_node_index >= 0) {899899+ while (last_node_index-- > 0) {900900 if (nodes[last_node_index]) {901901 np = of_find_node_by_path(nodes[last_node_index]->full_name);902902- if (strcmp(np->full_name, "/aliases") != 0) {902902+ if (np == nodes[last_node_index]) {903903+ if (of_aliases == np) {904904+ of_node_put(of_aliases);905905+ of_aliases = NULL;906906+ }903907 detach_node_and_children(np);904908 } else {905909 for_each_property_of_node(np, prop) {···912908 }913909 }914910 }915915- last_node_index--;916911 }917912}918913···924921 res = selftest_data_add();925922 if (res)926923 return res;924924+ if (!of_aliases)925925+ of_aliases = of_find_node_by_path("/aliases");927926928927 np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a");929928 if (!np) {
+1-1
drivers/pci/access.c
···444444 return pcie_caps_reg(dev) & PCI_EXP_FLAGS_VERS;445445}446446447447-static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev)447447+bool pcie_cap_has_lnkctl(const struct pci_dev *dev)448448{449449 int type = pci_pcie_type(dev);450450
+6-1
drivers/pci/host/pci-xgene.c
···631631 if (ret)632632 return ret;633633634634- bus = pci_scan_root_bus(&pdev->dev, 0, &xgene_pcie_ops, port, &res);634634+ bus = pci_create_root_bus(&pdev->dev, 0,635635+ &xgene_pcie_ops, port, &res);635636 if (!bus)636637 return -ENOMEM;638638+639639+ pci_scan_child_bus(bus);640640+ pci_assign_unassigned_bus_resources(bus);641641+ pci_bus_add_devices(bus);637642638643 platform_set_drvdata(pdev, port);639644 return 0;
+26
drivers/pci/msi.c
···590590 return entry;591591}592592593593+static int msi_verify_entries(struct pci_dev *dev)594594+{595595+ struct msi_desc *entry;596596+597597+ list_for_each_entry(entry, &dev->msi_list, list) {598598+ if (!dev->no_64bit_msi || !entry->msg.address_hi)599599+ continue;600600+ dev_err(&dev->dev, "Device has broken 64-bit MSI but arch"601601+ " tried to assign one above 4G\n");602602+ return -EIO;603603+ }604604+ return 0;605605+}606606+593607/**594608 * msi_capability_init - configure device's MSI capability structure595609 * @dev: pointer to the pci_dev data structure of MSI device function···635621636622 /* Configure MSI capability structure */637623 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);624624+ if (ret) {625625+ msi_mask_irq(entry, mask, ~mask);626626+ free_msi_irqs(dev);627627+ return ret;628628+ }629629+630630+ ret = msi_verify_entries(dev);638631 if (ret) {639632 msi_mask_irq(entry, mask, ~mask);640633 free_msi_irqs(dev);···759738 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);760739 if (ret)761740 goto out_avail;741741+742742+ /* Check if all MSI entries honor device restrictions */743743+ ret = msi_verify_entries(dev);744744+ if (ret)745745+ goto out_free;762746763747 /*764748 * Some devices require MSI-X to be enabled before we can touch the
+2
drivers/pci/pci.h
···6677extern const unsigned char pcie_link_speed[];8899+bool pcie_cap_has_lnkctl(const struct pci_dev *dev);1010+911/* Functions internal to the PCI core code */10121113int pci_create_sysfs_dev_files(struct pci_dev *pdev);
+17-13
drivers/pci/probe.c
···407407{408408 struct pci_dev *dev = child->self;409409 u16 mem_base_lo, mem_limit_lo;410410- unsigned long base, limit;410410+ u64 base64, limit64;411411+ dma_addr_t base, limit;411412 struct pci_bus_region region;412413 struct resource *res;413414414415 res = child->resource[2];415416 pci_read_config_word(dev, PCI_PREF_MEMORY_BASE, &mem_base_lo);416417 pci_read_config_word(dev, PCI_PREF_MEMORY_LIMIT, &mem_limit_lo);417417- base = ((unsigned long) mem_base_lo & PCI_PREF_RANGE_MASK) << 16;418418- limit = ((unsigned long) mem_limit_lo & PCI_PREF_RANGE_MASK) << 16;418418+ base64 = (mem_base_lo & PCI_PREF_RANGE_MASK) << 16;419419+ limit64 = (mem_limit_lo & PCI_PREF_RANGE_MASK) << 16;419420420421 if ((mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {421422 u32 mem_base_hi, mem_limit_hi;···430429 * this, just assume they are not being used.431430 */432431 if (mem_base_hi <= mem_limit_hi) {433433-#if BITS_PER_LONG == 64434434- base |= ((unsigned long) mem_base_hi) << 32;435435- limit |= ((unsigned long) mem_limit_hi) << 32;436436-#else437437- if (mem_base_hi || mem_limit_hi) {438438- dev_err(&dev->dev, "can't handle 64-bit address space for bridge\n");439439- return;440440- }441441-#endif432432+ base64 |= (u64) mem_base_hi << 32;433433+ limit64 |= (u64) mem_limit_hi << 32;442434 }443435 }436436+437437+ base = (dma_addr_t) base64;438438+ limit = (dma_addr_t) limit64;439439+440440+ if (base != base64) {441441+ dev_err(&dev->dev, "can't handle bridge window above 4GB (bus address %#010llx)\n",442442+ (unsigned long long) base64);443443+ return;444444+ }445445+444446 if (base <= limit) {445447 res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) |446448 IORESOURCE_MEM | IORESOURCE_PREFETCH;···13271323 ~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);1328132413291325 /* Initialize Link Control Register */13301330- if (dev->subordinate)13261326+ if (pcie_cap_has_lnkctl(dev))13311327 pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,13321328 ~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);13331329
+7
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
···412412 struct fc_frame_header *fh;413413 struct fcoe_rcv_info *fr;414414 struct fcoe_percpu_s *bg;415415+ struct sk_buff *tmp_skb;415416 unsigned short oxid;416417417418 interface = container_of(ptype, struct bnx2fc_interface,···424423 printk(KERN_ERR PFX "bnx2fc_rcv: lport is NULL\n");425424 goto err;426425 }426426+427427+ tmp_skb = skb_share_check(skb, GFP_ATOMIC);428428+ if (!tmp_skb)429429+ goto err;430430+431431+ skb = tmp_skb;427432428433 if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {429434 printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n");
+2
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
···828828 if (status == CPL_ERR_RTX_NEG_ADVICE)829829 goto rel_skb;830830831831+ module_put(THIS_MODULE);832832+831833 if (status && status != CPL_ERR_TCAM_FULL &&832834 status != CPL_ERR_CONN_EXIST &&833835 status != CPL_ERR_ARP_MISS)
+1-1
drivers/scsi/cxgbi/libcxgbi.c
···816816 read_lock_bh(&csk->callback_lock);817817 if (csk->user_data)818818 iscsi_conn_failure(csk->user_data,819819- ISCSI_ERR_CONN_FAILED);819819+ ISCSI_ERR_TCP_CONN_CLOSE);820820 read_unlock_bh(&csk->callback_lock);821821 }822822}
···27382738 struct t10_pr_registration *pr_reg, *pr_reg_tmp, *pr_reg_n, *pr_res_holder;27392739 struct t10_reservation *pr_tmpl = &dev->t10_pr;27402740 u32 pr_res_mapped_lun = 0;27412741- int all_reg = 0, calling_it_nexus = 0, released_regs = 0;27412741+ int all_reg = 0, calling_it_nexus = 0;27422742+ bool sa_res_key_unmatched = sa_res_key != 0;27422743 int prh_type = 0, prh_scope = 0;2743274427442745 if (!se_sess)···28142813 if (!all_reg) {28152814 if (pr_reg->pr_res_key != sa_res_key)28162815 continue;28162816+ sa_res_key_unmatched = false;2817281728182818 calling_it_nexus = (pr_reg_n == pr_reg) ? 1 : 0;28192819 pr_reg_nacl = pr_reg->pr_reg_nacl;···28222820 __core_scsi3_free_registration(dev, pr_reg,28232821 (preempt_type == PREEMPT_AND_ABORT) ? &preempt_and_abort_list :28242822 NULL, calling_it_nexus);28252825- released_regs++;28262823 } else {28272824 /*28282825 * Case for any existing all registrants type···28392838 if ((sa_res_key) &&28402839 (pr_reg->pr_res_key != sa_res_key))28412840 continue;28412841+ sa_res_key_unmatched = false;2842284228432843 calling_it_nexus = (pr_reg_n == pr_reg) ? 1 : 0;28442844 if (calling_it_nexus)···28502848 __core_scsi3_free_registration(dev, pr_reg,28512849 (preempt_type == PREEMPT_AND_ABORT) ? &preempt_and_abort_list :28522850 NULL, 0);28532853- released_regs++;28542851 }28552852 if (!calling_it_nexus)28562853 core_scsi3_ua_allocate(pr_reg_nacl,···28642863 * registered reservation key, then the device server shall28652864 * complete the command with RESERVATION CONFLICT status.28662865 */28672867- if (!released_regs) {28662866+ if (sa_res_key_unmatched) {28682867 spin_unlock(&dev->dev_reservation_lock);28692868 core_scsi3_put_pr_reg(pr_reg_n);28702869 return TCM_RESERVATION_CONFLICT;
+1-1
drivers/target/target_core_transport.c
···22922292 * and let it call back once the write buffers are ready.22932293 */22942294 target_add_to_state_list(cmd);22952295- if (cmd->data_direction != DMA_TO_DEVICE) {22952295+ if (cmd->data_direction != DMA_TO_DEVICE || cmd->data_length == 0) {22962296 target_execute_cmd(cmd);22972297 return 0;22982298 }
+21-16
drivers/thermal/cpu_cooling.c
···5050 unsigned int cpufreq_state;5151 unsigned int cpufreq_val;5252 struct cpumask allowed_cpus;5353+ struct list_head node;5354};5455static DEFINE_IDR(cpufreq_idr);5556static DEFINE_MUTEX(cooling_cpufreq_lock);56575758static unsigned int cpufreq_dev_count;58595959-/* notify_table passes value to the CPUFREQ_ADJUST callback function. */6060-#define NOTIFY_INVALID NULL6161-static struct cpufreq_cooling_device *notify_device;6060+static LIST_HEAD(cpufreq_dev_list);62616362/**6463 * get_idr - function to get a unique id.···286287287288 cpufreq_device->cpufreq_state = cooling_state;288289 cpufreq_device->cpufreq_val = clip_freq;289289- notify_device = cpufreq_device;290290291291 for_each_cpu(cpuid, mask) {292292 if (is_cpufreq_valid(cpuid))293293 cpufreq_update_policy(cpuid);294294 }295295-296296- notify_device = NOTIFY_INVALID;297295298296 return 0;299297}···312316{313317 struct cpufreq_policy *policy = data;314318 unsigned long max_freq = 0;319319+ struct cpufreq_cooling_device *cpufreq_dev;315320316316- if (event != CPUFREQ_ADJUST || notify_device == NOTIFY_INVALID)321321+ if (event != CPUFREQ_ADJUST)317322 return 0;318323319319- if (cpumask_test_cpu(policy->cpu, ¬ify_device->allowed_cpus))320320- max_freq = notify_device->cpufreq_val;321321- else322322- return 0;324324+ mutex_lock(&cooling_cpufreq_lock);325325+ list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {326326+ if (!cpumask_test_cpu(policy->cpu,327327+ &cpufreq_dev->allowed_cpus))328328+ continue;323329324324- /* Never exceed user_policy.max */325325- if (max_freq > policy->user_policy.max)326326- max_freq = policy->user_policy.max;330330+ if (!cpufreq_dev->cpufreq_val)331331+ cpufreq_dev->cpufreq_val = get_cpu_frequency(332332+ cpumask_any(&cpufreq_dev->allowed_cpus),333333+ cpufreq_dev->cpufreq_state);327334328328- if (policy->max != max_freq)329329- cpufreq_verify_within_limits(policy, 0, max_freq);335335+ max_freq = cpufreq_dev->cpufreq_val;336336+337337+ if (policy->max != max_freq)338338+ cpufreq_verify_within_limits(policy, 0, max_freq);339339+ }340340+ mutex_unlock(&cooling_cpufreq_lock);330341331342 return 0;332343}···489486 cpufreq_register_notifier(&thermal_cpufreq_notifier_block,490487 CPUFREQ_POLICY_NOTIFIER);491488 cpufreq_dev_count++;489489+ list_add(&cpufreq_dev->node, &cpufreq_dev_list);492490493491 mutex_unlock(&cooling_cpufreq_lock);494492···553549554550 cpufreq_dev = cdev->devdata;555551 mutex_lock(&cooling_cpufreq_lock);552552+ list_del(&cpufreq_dev->node);556553 cpufreq_dev_count--;557554558555 /* Unregister the notifier for the last cpufreq cooling device */
+3-6
drivers/thermal/samsung/exynos_thermal_common.c
···417417418418 th_zone = sensor_conf->pzone_data;419419420420- if (th_zone->therm_dev)421421- thermal_zone_device_unregister(th_zone->therm_dev);420420+ thermal_zone_device_unregister(th_zone->therm_dev);422421423423- for (i = 0; i < th_zone->cool_dev_size; i++) {424424- if (th_zone->cool_dev[i])425425- cpufreq_cooling_unregister(th_zone->cool_dev[i]);426426- }422422+ for (i = 0; i < th_zone->cool_dev_size; ++i)423423+ cpufreq_cooling_unregister(th_zone->cool_dev[i]);427424428425 dev_info(sensor_conf->dev,429426 "Exynos: Kernel Thermal management unregistered\n");
···791791792792 trb = dwc->ep0_trb;793793794794+ r = next_request(&ep0->request_list);795795+ if (!r)796796+ return;797797+794798 status = DWC3_TRB_SIZE_TRBSTS(trb->size);795799 if (status == DWC3_TRBSTS_SETUP_PENDING) {796800 dwc3_trace(trace_dwc3_ep0, "Setup Pending received");···804800805801 return;806802 }807807-808808- r = next_request(&ep0->request_list);809809- if (!r)810810- return;811803812804 ur = &r->request;813805
+1-4
drivers/usb/host/xhci-hub.c
···222223232424#include <linux/slab.h>2525-#include <linux/device.h>2625#include <asm/unaligned.h>27262827#include "xhci.h"···11481149 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME11491150 * is enabled, so also enable remote wake here.11501151 */11511151- if (hcd->self.root_hub->do_remote_wakeup11521152- && device_may_wakeup(hcd->self.controller)) {11531153-11521152+ if (hcd->self.root_hub->do_remote_wakeup) {11541153 if (t1 & PORT_CONNECT) {11551154 t2 |= PORT_WKOC_E | PORT_WKDISC_E;11561155 t2 &= ~PORT_WKCONN_E;
+1-1
drivers/usb/host/xhci-pci.c
···281281 if (xhci->quirks & XHCI_COMP_MODE_QUIRK)282282 pdev->no_d3cold = true;283283284284- return xhci_suspend(xhci);284284+ return xhci_suspend(xhci, do_wakeup);285285}286286287287static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
+9-1
drivers/usb/host/xhci-plat.c
···204204 struct usb_hcd *hcd = dev_get_drvdata(dev);205205 struct xhci_hcd *xhci = hcd_to_xhci(hcd);206206207207- return xhci_suspend(xhci);207207+ /*208208+ * xhci_suspend() needs `do_wakeup` to know whether host is allowed209209+ * to do wakeup during suspend. Since xhci_plat_suspend is currently210210+ * only designed for system suspend, device_may_wakeup() is enough211211+ * to dertermine whether host is allowed to do wakeup. Need to212212+ * reconsider this when xhci_plat_suspend enlarges its scope, e.g.,213213+ * also applies to runtime suspend.214214+ */215215+ return xhci_suspend(xhci, device_may_wakeup(dev));208216}209217210218static int xhci_plat_resume(struct device *dev)
+11-32
drivers/usb/host/xhci-ring.c
···10671067 false);10681068 xhci_ring_cmd_db(xhci);10691069 } else {10701070- /* Clear our internal halted state and restart the ring(s) */10701070+ /* Clear our internal halted state */10711071 xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED;10721072- ring_doorbell_for_active_rings(xhci, slot_id, ep_index);10731072 }10741073}10751074···18221823 ep->stopped_td = td;18231824 return 0;18241825 } else {18251825- if (trb_comp_code == COMP_STALL) {18261826- /* The transfer is completed from the driver's18271827- * perspective, but we need to issue a set dequeue18281828- * command for this stalled endpoint to move the dequeue18291829- * pointer past the TD. We can't do that here because18301830- * the halt condition must be cleared first. Let the18311831- * USB class driver clear the stall later.18321832- */18331833- ep->stopped_td = td;18341834- ep->stopped_stream = ep_ring->stream_id;18351835- } else if (xhci_requires_manual_halt_cleanup(xhci,18361836- ep_ctx, trb_comp_code)) {18371837- /* Other types of errors halt the endpoint, but the18381838- * class driver doesn't call usb_reset_endpoint() unless18391839- * the error is -EPIPE. Clear the halted status in the18401840- * xHCI hardware manually.18261826+ if (trb_comp_code == COMP_STALL ||18271827+ xhci_requires_manual_halt_cleanup(xhci, ep_ctx,18281828+ trb_comp_code)) {18291829+ /* Issue a reset endpoint command to clear the host side18301830+ * halt, followed by a set dequeue command to move the18311831+ * dequeue pointer past the TD.18321832+ * The class driver clears the device side halt later.18411833 */18421834 xhci_cleanup_halted_endpoint(xhci,18431835 slot_id, ep_index, ep_ring->stream_id,···19481958 else19491959 td->urb->actual_length = 0;1950196019511951- xhci_cleanup_halted_endpoint(xhci,19521952- slot_id, ep_index, 0, td, event_trb);19531953- return finish_td(xhci, td, event_trb, event, ep, status, true);19611961+ return finish_td(xhci, td, event_trb, event, ep, status, false);19541962 }19551963 /*19561964 * Did we transfer any data, despite the errors that might have···25072519 if (ret) {25082520 urb = td->urb;25092521 urb_priv = urb->hcpriv;25102510- /* Leave the TD around for the reset endpoint function25112511- * to use(but only if it's not a control endpoint,25122512- * since we already queued the Set TR dequeue pointer25132513- * command for stalled control endpoints).25142514- */25152515- if (usb_endpoint_xfer_control(&urb->ep->desc) ||25162516- (trb_comp_code != COMP_STALL &&25172517- trb_comp_code != COMP_BABBLE))25182518- xhci_urb_free_priv(xhci, urb_priv);25192519- else25202520- kfree(urb_priv);25222522+25232523+ xhci_urb_free_priv(xhci, urb_priv);2521252425222525 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);25232526 if ((urb->actual_length != urb->transfer_buffer_length &&
+56-51
drivers/usb/host/xhci.c
···3535#define DRIVER_AUTHOR "Sarah Sharp"3636#define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver"37373838+#define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E)3939+3840/* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */3941static int link_quirk;4042module_param(link_quirk, int, S_IRUGO | S_IWUSR);···853851 xhci_set_cmd_ring_deq(xhci);854852}855853854854+static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)855855+{856856+ int port_index;857857+ __le32 __iomem **port_array;858858+ unsigned long flags;859859+ u32 t1, t2;860860+861861+ spin_lock_irqsave(&xhci->lock, flags);862862+863863+ /* disble usb3 ports Wake bits*/864864+ port_index = xhci->num_usb3_ports;865865+ port_array = xhci->usb3_ports;866866+ while (port_index--) {867867+ t1 = readl(port_array[port_index]);868868+ t1 = xhci_port_state_to_neutral(t1);869869+ t2 = t1 & ~PORT_WAKE_BITS;870870+ if (t1 != t2)871871+ writel(t2, port_array[port_index]);872872+ }873873+874874+ /* disble usb2 ports Wake bits*/875875+ port_index = xhci->num_usb2_ports;876876+ port_array = xhci->usb2_ports;877877+ while (port_index--) {878878+ t1 = readl(port_array[port_index]);879879+ t1 = xhci_port_state_to_neutral(t1);880880+ t2 = t1 & ~PORT_WAKE_BITS;881881+ if (t1 != t2)882882+ writel(t2, port_array[port_index]);883883+ }884884+885885+ spin_unlock_irqrestore(&xhci->lock, flags);886886+}887887+856888/*857889 * Stop HC (not bus-specific)858890 *859891 * This is called when the machine transition into S3/S4 mode.860892 *861893 */862862-int xhci_suspend(struct xhci_hcd *xhci)894894+int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)863895{864896 int rc = 0;865897 unsigned int delay = XHCI_MAX_HALT_USEC;···903867 if (hcd->state != HC_STATE_SUSPENDED ||904868 xhci->shared_hcd->state != HC_STATE_SUSPENDED)905869 return -EINVAL;870870+871871+ /* Clear root port wake on bits if wakeup not allowed. */872872+ if (!do_wakeup)873873+ xhci_disable_port_wake_on_bits(xhci);906874907875 /* Don't poll the roothubs on bus suspend. */908876 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);···29522912 }29532913}2954291429552955-/* Deal with stalled endpoints. The core should have sent the control message29562956- * to clear the halt condition. However, we need to make the xHCI hardware29572957- * reset its sequence number, since a device will expect a sequence number of29582958- * zero after the halt condition is cleared.29152915+/* Called when clearing halted device. The core should have sent the control29162916+ * message to clear the device halt condition. The host side of the halt should29172917+ * already be cleared with a reset endpoint command issued when the STALL tx29182918+ * event was received.29192919+ *29592920 * Context: in_interrupt29602921 */29222922+29612923void xhci_endpoint_reset(struct usb_hcd *hcd,29622924 struct usb_host_endpoint *ep)29632925{29642926 struct xhci_hcd *xhci;29652965- struct usb_device *udev;29662966- unsigned int ep_index;29672967- unsigned long flags;29682968- int ret;29692969- struct xhci_virt_ep *virt_ep;29702970- struct xhci_command *command;2971292729722928 xhci = hcd_to_xhci(hcd);29732973- udev = (struct usb_device *) ep->hcpriv;29742974- /* Called with a root hub endpoint (or an endpoint that wasn't added29752975- * with xhci_add_endpoint()29762976- */29772977- if (!ep->hcpriv)29782978- return;29792979- ep_index = xhci_get_endpoint_index(&ep->desc);29802980- virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index];29812981- if (!virt_ep->stopped_td) {29822982- xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,29832983- "Endpoint 0x%x not halted, refusing to reset.",29842984- ep->desc.bEndpointAddress);29852985- return;29862986- }29872987- if (usb_endpoint_xfer_control(&ep->desc)) {29882988- xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,29892989- "Control endpoint stall already handled.");29902990- return;29912991- }2992292929932993- command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);29942994- if (!command)29952995- return;29962996-29972997- xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,29982998- "Queueing reset endpoint command");29992999- spin_lock_irqsave(&xhci->lock, flags);30003000- ret = xhci_queue_reset_ep(xhci, command, udev->slot_id, ep_index);30012930 /*30023002- * Can't change the ring dequeue pointer until it's transitioned to the30033003- * stopped state, which is only upon a successful reset endpoint30043004- * command. Better hope that last command worked!29312931+ * We might need to implement the config ep cmd in xhci 4.8.1 note:29322932+ * The Reset Endpoint Command may only be issued to endpoints in the29332933+ * Halted state. If software wishes reset the Data Toggle or Sequence29342934+ * Number of an endpoint that isn't in the Halted state, then software29352935+ * may issue a Configure Endpoint Command with the Drop and Add bits set29362936+ * for the target endpoint. that is in the Stopped state.30052937 */30063006- if (!ret) {30073007- xhci_cleanup_stalled_ring(xhci, udev, ep_index);30083008- kfree(virt_ep->stopped_td);30093009- xhci_ring_cmd_db(xhci);30103010- }30113011- virt_ep->stopped_td = NULL;30123012- virt_ep->stopped_stream = 0;30133013- spin_unlock_irqrestore(&xhci->lock, flags);3014293830153015- if (ret)30163016- xhci_warn(xhci, "FIXME allocate a new ring segment\n");29392939+ /* For now just print debug to follow the situation */29402940+ xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n",29412941+ ep->desc.bEndpointAddress);30172942}3018294330192944static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
···926926#define BAYER_CONTOUR_CABLE_PID 0x6001927927928928/*929929- * The following are the values for the Matrix Orbital FTDI Range930930- * Anything in this range will use an FT232RL.929929+ * Matrix Orbital Intelligent USB displays.930930+ * http://www.matrixorbital.com931931 */932932#define MTXORB_VID 0x1B3D933933#define MTXORB_FTDI_RANGE_0100_PID 0x0100···11861186#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD11871187#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE11881188#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF11891189-11901190-11891189+#define MTXORB_FTDI_RANGE_4701_PID 0x470111901190+#define MTXORB_FTDI_RANGE_9300_PID 0x930011911191+#define MTXORB_FTDI_RANGE_9301_PID 0x930111921192+#define MTXORB_FTDI_RANGE_9302_PID 0x930211931193+#define MTXORB_FTDI_RANGE_9303_PID 0x930311941194+#define MTXORB_FTDI_RANGE_9304_PID 0x930411951195+#define MTXORB_FTDI_RANGE_9305_PID 0x930511961196+#define MTXORB_FTDI_RANGE_9306_PID 0x930611971197+#define MTXORB_FTDI_RANGE_9307_PID 0x930711981198+#define MTXORB_FTDI_RANGE_9308_PID 0x930811991199+#define MTXORB_FTDI_RANGE_9309_PID 0x930912001200+#define MTXORB_FTDI_RANGE_930A_PID 0x930A12011201+#define MTXORB_FTDI_RANGE_930B_PID 0x930B12021202+#define MTXORB_FTDI_RANGE_930C_PID 0x930C12031203+#define MTXORB_FTDI_RANGE_930D_PID 0x930D12041204+#define MTXORB_FTDI_RANGE_930E_PID 0x930E12051205+#define MTXORB_FTDI_RANGE_930F_PID 0x930F12061206+#define MTXORB_FTDI_RANGE_9310_PID 0x931012071207+#define MTXORB_FTDI_RANGE_9311_PID 0x931112081208+#define MTXORB_FTDI_RANGE_9312_PID 0x931212091209+#define MTXORB_FTDI_RANGE_9313_PID 0x931312101210+#define MTXORB_FTDI_RANGE_9314_PID 0x931412111211+#define MTXORB_FTDI_RANGE_9315_PID 0x931512121212+#define MTXORB_FTDI_RANGE_9316_PID 0x931612131213+#define MTXORB_FTDI_RANGE_9317_PID 0x931712141214+#define MTXORB_FTDI_RANGE_9318_PID 0x931812151215+#define MTXORB_FTDI_RANGE_9319_PID 0x931912161216+#define MTXORB_FTDI_RANGE_931A_PID 0x931A12171217+#define MTXORB_FTDI_RANGE_931B_PID 0x931B12181218+#define MTXORB_FTDI_RANGE_931C_PID 0x931C12191219+#define MTXORB_FTDI_RANGE_931D_PID 0x931D12201220+#define MTXORB_FTDI_RANGE_931E_PID 0x931E12211221+#define MTXORB_FTDI_RANGE_931F_PID 0x931F1191122211921223/*11931224 * The Mobility Lab (TML)
+59-38
drivers/usb/serial/keyspan.c
···311311 if ((data[0] & 0x80) == 0) {312312 /* no errors on individual bytes, only313313 possible overrun err */314314- if (data[0] & RXERROR_OVERRUN)315315- err = TTY_OVERRUN;316316- else317317- err = 0;314314+ if (data[0] & RXERROR_OVERRUN) {315315+ tty_insert_flip_char(&port->port, 0,316316+ TTY_OVERRUN);317317+ }318318 for (i = 1; i < urb->actual_length ; ++i)319319- tty_insert_flip_char(&port->port, data[i], err);319319+ tty_insert_flip_char(&port->port, data[i],320320+ TTY_NORMAL);320321 } else {321322 /* some bytes had errors, every byte has status */322323 dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);323324 for (i = 0; i + 1 < urb->actual_length; i += 2) {324324- int stat = data[i], flag = 0;325325- if (stat & RXERROR_OVERRUN)326326- flag |= TTY_OVERRUN;327327- if (stat & RXERROR_FRAMING)328328- flag |= TTY_FRAME;329329- if (stat & RXERROR_PARITY)330330- flag |= TTY_PARITY;325325+ int stat = data[i];326326+ int flag = TTY_NORMAL;327327+328328+ if (stat & RXERROR_OVERRUN) {329329+ tty_insert_flip_char(&port->port, 0,330330+ TTY_OVERRUN);331331+ }331332 /* XXX should handle break (0x10) */333333+ if (stat & RXERROR_PARITY)334334+ flag = TTY_PARITY;335335+ else if (stat & RXERROR_FRAMING)336336+ flag = TTY_FRAME;337337+332338 tty_insert_flip_char(&port->port, data[i+1],333339 flag);334340 }···655649 } else {656650 /* some bytes had errors, every byte has status */657651 for (i = 0; i + 1 < urb->actual_length; i += 2) {658658- int stat = data[i], flag = 0;659659- if (stat & RXERROR_OVERRUN)660660- flag |= TTY_OVERRUN;661661- if (stat & RXERROR_FRAMING)662662- flag |= TTY_FRAME;663663- if (stat & RXERROR_PARITY)664664- flag |= TTY_PARITY;652652+ int stat = data[i];653653+ int flag = TTY_NORMAL;654654+655655+ if (stat & RXERROR_OVERRUN) {656656+ tty_insert_flip_char(&port->port, 0,657657+ TTY_OVERRUN);658658+ }665659 /* XXX should handle break (0x10) */660660+ if (stat & RXERROR_PARITY)661661+ flag = TTY_PARITY;662662+ else if (stat & RXERROR_FRAMING)663663+ flag = TTY_FRAME;664664+666665 tty_insert_flip_char(&port->port, data[i+1],667666 flag);668667 }···724713 */725714 for (x = 0; x + 1 < len &&726715 i + 1 < urb->actual_length; x += 2) {727727- int stat = data[i], flag = 0;716716+ int stat = data[i];717717+ int flag = TTY_NORMAL;728718729729- if (stat & RXERROR_OVERRUN)730730- flag |= TTY_OVERRUN;731731- if (stat & RXERROR_FRAMING)732732- flag |= TTY_FRAME;733733- if (stat & RXERROR_PARITY)734734- flag |= TTY_PARITY;719719+ if (stat & RXERROR_OVERRUN) {720720+ tty_insert_flip_char(&port->port, 0,721721+ TTY_OVERRUN);722722+ }735723 /* XXX should handle break (0x10) */724724+ if (stat & RXERROR_PARITY)725725+ flag = TTY_PARITY;726726+ else if (stat & RXERROR_FRAMING)727727+ flag = TTY_FRAME;728728+736729 tty_insert_flip_char(&port->port, data[i+1],737730 flag);738731 i += 2;···788773 if ((data[0] & 0x80) == 0) {789774 /* no errors on individual bytes, only790775 possible overrun err*/791791- if (data[0] & RXERROR_OVERRUN)792792- err = TTY_OVERRUN;793793- else794794- err = 0;776776+ if (data[0] & RXERROR_OVERRUN) {777777+ tty_insert_flip_char(&port->port, 0,778778+ TTY_OVERRUN);779779+ }795780 for (i = 1; i < urb->actual_length ; ++i)796781 tty_insert_flip_char(&port->port,797797- data[i], err);782782+ data[i], TTY_NORMAL);798783 } else {799784 /* some bytes had errors, every byte has status */800785 dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);801786 for (i = 0; i + 1 < urb->actual_length; i += 2) {802802- int stat = data[i], flag = 0;803803- if (stat & RXERROR_OVERRUN)804804- flag |= TTY_OVERRUN;805805- if (stat & RXERROR_FRAMING)806806- flag |= TTY_FRAME;807807- if (stat & RXERROR_PARITY)808808- flag |= TTY_PARITY;787787+ int stat = data[i];788788+ int flag = TTY_NORMAL;789789+790790+ if (stat & RXERROR_OVERRUN) {791791+ tty_insert_flip_char(792792+ &port->port, 0,793793+ TTY_OVERRUN);794794+ }809795 /* XXX should handle break (0x10) */796796+ if (stat & RXERROR_PARITY)797797+ flag = TTY_PARITY;798798+ else if (stat & RXERROR_FRAMING)799799+ flag = TTY_FRAME;800800+810801 tty_insert_flip_char(&port->port,811802 data[i+1], flag);812803 }
+3-8
drivers/usb/serial/ssu100.c
···490490 if (*tty_flag == TTY_NORMAL)491491 *tty_flag = TTY_FRAME;492492 }493493- if (lsr & UART_LSR_OE){493493+ if (lsr & UART_LSR_OE) {494494 port->icount.overrun++;495495- if (*tty_flag == TTY_NORMAL)496496- *tty_flag = TTY_OVERRUN;495495+ tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);497496 }498497 }499498···510511 if ((len >= 4) &&511512 (packet[0] == 0x1b) && (packet[1] == 0x1b) &&512513 ((packet[2] == 0x00) || (packet[2] == 0x01))) {513513- if (packet[2] == 0x00) {514514+ if (packet[2] == 0x00)514515 ssu100_update_lsr(port, packet[3], &flag);515515- if (flag == TTY_OVERRUN)516516- tty_insert_flip_char(&port->port, 0,517517- TTY_OVERRUN);518518- }519516 if (packet[2] == 0x01)520517 ssu100_update_msr(port, packet[3]);521518
···10111011 bytes = min(bytes, working_bytes);10121012 kaddr = kmap_atomic(page_out);10131013 memcpy(kaddr + *pg_offset, buf + buf_offset, bytes);10141014- if (*pg_index == (vcnt - 1) && *pg_offset == 0)10151015- memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);10161014 kunmap_atomic(kaddr);10171015 flush_dcache_page(page_out);10181016···10511053 }1052105410531055 return 1;10561056+}10571057+10581058+/*10591059+ * When uncompressing data, we need to make sure and zero any parts of10601060+ * the biovec that were not filled in by the decompression code. pg_index10611061+ * and pg_offset indicate the last page and the last offset of that page10621062+ * that have been filled in. This will zero everything remaining in the10631063+ * biovec.10641064+ */10651065+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,10661066+ unsigned long pg_index,10671067+ unsigned long pg_offset)10681068+{10691069+ while (pg_index < vcnt) {10701070+ struct page *page = bvec[pg_index].bv_page;10711071+ unsigned long off = bvec[pg_index].bv_offset;10721072+ unsigned long len = bvec[pg_index].bv_len;10731073+10741074+ if (pg_offset < off)10751075+ pg_offset = off;10761076+ if (pg_offset < off + len) {10771077+ unsigned long bytes = off + len - pg_offset;10781078+ char *kaddr;10791079+10801080+ kaddr = kmap_atomic(page);10811081+ memset(kaddr + pg_offset, 0, bytes);10821082+ kunmap_atomic(kaddr);10831083+ }10841084+ pg_index++;10851085+ pg_offset = 0;10861086+ }10541087}
+3-1
fs/btrfs/compression.h
···4545 unsigned long nr_pages);4646int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,4747 int mirror_num, unsigned long bio_flags);4848-4848+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,4949+ unsigned long pg_index,5050+ unsigned long pg_offset);4951struct btrfs_compress_op {5052 struct list_head *(*alloc_workspace)(void);5153
+2-12
fs/btrfs/ctree.c
···8080{8181 int i;82828383-#ifdef CONFIG_DEBUG_LOCK_ALLOC8484- /* lockdep really cares that we take all of these spinlocks8585- * in the right order. If any of the locks in the path are not8686- * currently blocking, it is going to complain. So, make really8787- * really sure by forcing the path to blocking before we clear8888- * the path blocking.8989- */9083 if (held) {9184 btrfs_set_lock_blocking_rw(held, held_rw);9285 if (held_rw == BTRFS_WRITE_LOCK)···8895 held_rw = BTRFS_READ_LOCK_BLOCKING;8996 }9097 btrfs_set_path_blocking(p);9191-#endif92989399 for (i = BTRFS_MAX_LEVEL - 1; i >= 0; i--) {94100 if (p->nodes[i] && p->locks[i]) {···99107 }100108 }101109102102-#ifdef CONFIG_DEBUG_LOCK_ALLOC103110 if (held)104111 btrfs_clear_lock_blocking_rw(held, held_rw);105105-#endif106112}107113108114/* this also releases the path */···28832893 }28842894 p->locks[level] = BTRFS_WRITE_LOCK;28852895 } else {28862886- err = btrfs_try_tree_read_lock(b);28962896+ err = btrfs_tree_read_lock_atomic(b);28872897 if (!err) {28882898 btrfs_set_path_blocking(p);28892899 btrfs_tree_read_lock(b);···30153025 }3016302630173027 level = btrfs_header_level(b);30183018- err = btrfs_try_tree_read_lock(b);30283028+ err = btrfs_tree_read_lock_atomic(b);30193029 if (!err) {30203030 btrfs_set_path_blocking(p);30213031 btrfs_tree_read_lock(b);
+21-3
fs/btrfs/locking.c
···128128}129129130130/*131131+ * take a spinning read lock.132132+ * returns 1 if we get the read lock and 0 if we don't133133+ * this won't wait for blocking writers134134+ */135135+int btrfs_tree_read_lock_atomic(struct extent_buffer *eb)136136+{137137+ if (atomic_read(&eb->blocking_writers))138138+ return 0;139139+140140+ read_lock(&eb->lock);141141+ if (atomic_read(&eb->blocking_writers)) {142142+ read_unlock(&eb->lock);143143+ return 0;144144+ }145145+ atomic_inc(&eb->read_locks);146146+ atomic_inc(&eb->spinning_readers);147147+ return 1;148148+}149149+150150+/*131151 * returns 1 if we get the read lock and 0 if we don't132152 * this won't wait for blocking writers133153 */···178158 atomic_read(&eb->blocking_readers))179159 return 0;180160181181- if (!write_trylock(&eb->lock))182182- return 0;183183-161161+ write_lock(&eb->lock);184162 if (atomic_read(&eb->blocking_writers) ||185163 atomic_read(&eb->blocking_readers)) {186164 write_unlock(&eb->lock);
···373373 }374374done:375375 kunmap(pages_in[page_in_index]);376376+ if (!ret)377377+ btrfs_clear_biovec_end(bvec, vcnt, page_out_index, pg_offset);376378 return ret;377379}378380···412410 goto out;413411 }414412413413+ /*414414+ * the caller is already checking against PAGE_SIZE, but lets415415+ * move this check closer to the memcpy/memset416416+ */417417+ destlen = min_t(unsigned long, destlen, PAGE_SIZE);415418 bytes = min_t(unsigned long, destlen, out_len - start_byte);416419417420 kaddr = kmap_atomic(dest_page);418421 memcpy(kaddr, workspace->buf + start_byte, bytes);422422+423423+ /*424424+ * btrfs_getblock is doing a zero on the tail of the page too,425425+ * but this will cover anything missing from the decompressed426426+ * data.427427+ */428428+ if (bytes < destlen)429429+ memset(kaddr+bytes, 0, destlen-bytes);419430 kunmap_atomic(kaddr);420431out:421432 return ret;
+18-2
fs/btrfs/zlib.c
···299299 zlib_inflateEnd(&workspace->strm);300300 if (data_in)301301 kunmap(pages_in[page_in_index]);302302+ if (!ret)303303+ btrfs_clear_biovec_end(bvec, vcnt, page_out_index, pg_offset);302304 return ret;303305}304306···312310 struct workspace *workspace = list_entry(ws, struct workspace, list);313311 int ret = 0;314312 int wbits = MAX_WBITS;315315- unsigned long bytes_left = destlen;313313+ unsigned long bytes_left;316314 unsigned long total_out = 0;315315+ unsigned long pg_offset = 0;317316 char *kaddr;317317+318318+ destlen = min_t(unsigned long, destlen, PAGE_SIZE);319319+ bytes_left = destlen;318320319321 workspace->strm.next_in = data_in;320322 workspace->strm.avail_in = srclen;···347341 unsigned long buf_start;348342 unsigned long buf_offset;349343 unsigned long bytes;350350- unsigned long pg_offset = 0;351344352345 ret = zlib_inflate(&workspace->strm, Z_NO_FLUSH);353346 if (ret != Z_OK && ret != Z_STREAM_END)···389384 ret = 0;390385391386 zlib_inflateEnd(&workspace->strm);387387+388388+ /*389389+ * this should only happen if zlib returned fewer bytes than we390390+ * expected. btrfs_get_block is responsible for zeroing from the391391+ * end of the inline extent (destlen) to the end of the page392392+ */393393+ if (pg_offset < destlen) {394394+ kaddr = kmap_atomic(dest_page);395395+ memset(kaddr + pg_offset, 0, destlen - pg_offset);396396+ kunmap_atomic(kaddr);397397+ }392398 return ret;393399}394400
+1
fs/dcache.c
···778778 struct dentry *parent = lock_parent(dentry);779779 if (likely(!dentry->d_lockref.count)) {780780 __dentry_kill(dentry);781781+ dput(parent);781782 goto restart;782783 }783784 if (parent)
+21-21
fs/isofs/inode.c
···174174 * Compute the hash for the isofs name corresponding to the dentry.175175 */176176static int177177-isofs_hash_common(struct qstr *qstr, int ms)178178-{179179- const char *name;180180- int len;181181-182182- len = qstr->len;183183- name = qstr->name;184184- if (ms) {185185- while (len && name[len-1] == '.')186186- len--;187187- }188188-189189- qstr->hash = full_name_hash(name, len);190190-191191- return 0;192192-}193193-194194-/*195195- * Compute the hash for the isofs name corresponding to the dentry.196196- */197197-static int198177isofs_hashi_common(struct qstr *qstr, int ms)199178{200179 const char *name;···242263}243264244265#ifdef CONFIG_JOLIET266266+/*267267+ * Compute the hash for the isofs name corresponding to the dentry.268268+ */269269+static int270270+isofs_hash_common(struct qstr *qstr, int ms)271271+{272272+ const char *name;273273+ int len;274274+275275+ len = qstr->len;276276+ name = qstr->name;277277+ if (ms) {278278+ while (len && name[len-1] == '.')279279+ len--;280280+ }281281+282282+ qstr->hash = full_name_hash(name, len);283283+284284+ return 0;285285+}286286+245287static int246288isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr)247289{
+6-2
fs/nfsd/nfs4callback.c
···774774{775775 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {776776 rpc_sleep_on(&clp->cl_cb_waitq, task, NULL);777777- dprintk("%s slot is busy\n", __func__);778778- return false;777777+ /* Race breaker */778778+ if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {779779+ dprintk("%s slot is busy\n", __func__);780780+ return false;781781+ }782782+ rpc_wake_up_queued_task(&clp->cl_cb_waitq, task);779783 }780784 return true;781785}
···1818 * position @h. For example1919 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.2020 */2121-#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l))2222-#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l))2121+#define GENMASK(h, l) \2222+ (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))2323+2424+#define GENMASK_ULL(h, l) \2525+ (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))23262427extern unsigned int __sw_hweight8(unsigned int w);2528extern unsigned int __sw_hweight16(unsigned int w);
+6
include/linux/can/dev.h
···9999 return 1;100100}101101102102+static inline bool can_is_canfd_skb(const struct sk_buff *skb)103103+{104104+ /* the CAN specific type of skb is identified by its data length */105105+ return skb->len == CANFD_MTU;106106+}107107+102108/* get data length from can_dlc with sanitized can_dlc */103109u8 can_dlc2len(u8 can_dlc);104110
···331331 unsigned int is_added:1;332332 unsigned int is_busmaster:1; /* device is busmaster */333333 unsigned int no_msi:1; /* device may not use msi */334334+ unsigned int no_64bit_msi:1; /* device may only use 32-bit MSIs */334335 unsigned int block_cfg_access:1; /* config space access is blocked */335336 unsigned int broken_parity_status:1; /* Device generates false positive parity */336337 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
+7-1
include/linux/percpu-refcount.h
···133133 /* paired with smp_store_release() in percpu_ref_reinit() */134134 smp_read_barrier_depends();135135136136- if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC))136136+ /*137137+ * Theoretically, the following could test just ATOMIC; however,138138+ * then we'd have to mask off DEAD separately as DEAD may be139139+ * visible without ATOMIC if we race with percpu_ref_kill(). DEAD140140+ * implies ATOMIC anyway. Test them together.141141+ */142142+ if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC_DEAD))137143 return false;138144139145 *percpu_countp = (unsigned long __percpu *)percpu_ptr;
+2
include/net/inet_common.h
···3737int inet_ctl_sock_create(struct sock **sk, unsigned short family,3838 unsigned short type, unsigned char protocol,3939 struct net *net);4040+int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,4141+ int *addr_len);40424143static inline void inet_ctl_sock_destroy(struct sock *sk)4244{
-2
include/net/netfilter/nf_tables.h
···396396/**397397 * struct nft_trans - nf_tables object update in transaction398398 *399399- * @rcu_head: rcu head to defer release of transaction data400399 * @list: used internally401400 * @msg_type: message type402401 * @ctx: transaction context403402 * @data: internal information related to the transaction404403 */405404struct nft_trans {406406- struct rcu_head rcu_head;407405 struct list_head list;408406 int msg_type;409407 struct nft_ctx ctx;
···1562156215631563 if (!task) {15641564 /*15651565- * Per cpu events are removed via an smp call and15661566- * the removal is always successful.15651565+ * Per cpu events are removed via an smp call. The removal can15661566+ * fail if the CPU is currently offline, but in that case we15671567+ * already called __perf_remove_from_context from15681568+ * perf_event_exit_cpu.15671569 */15681570 cpu_function_call(event->cpu, __perf_remove_from_context, &re);15691571 return;···8119811781208118static void __perf_event_exit_context(void *__info)81218119{81228122- struct remove_event re = { .detach_group = false };81208120+ struct remove_event re = { .detach_group = true };81238121 struct perf_event_context *ctx = __info;8124812281258123 perf_pmu_rotate_stop(ctx->pmu);
···24752475EXPORT_PER_CPU_SYMBOL(kernel_cpustat);2476247624772477/*24782478- * Return any ns on the sched_clock that have not yet been accounted in24792479- * @p in case that task is currently running.24802480- *24812481- * Called with task_rq_lock() held on @rq.24822482- */24832483-static u64 do_task_delta_exec(struct task_struct *p, struct rq *rq)24842484-{24852485- u64 ns = 0;24862486-24872487- /*24882488- * Must be ->curr _and_ ->on_rq. If dequeued, we would24892489- * project cycles that may never be accounted to this24902490- * thread, breaking clock_gettime().24912491- */24922492- if (task_current(rq, p) && task_on_rq_queued(p)) {24932493- update_rq_clock(rq);24942494- ns = rq_clock_task(rq) - p->se.exec_start;24952495- if ((s64)ns < 0)24962496- ns = 0;24972497- }24982498-24992499- return ns;25002500-}25012501-25022502-unsigned long long task_delta_exec(struct task_struct *p)25032503-{25042504- unsigned long flags;25052505- struct rq *rq;25062506- u64 ns = 0;25072507-25082508- rq = task_rq_lock(p, &flags);25092509- ns = do_task_delta_exec(p, rq);25102510- task_rq_unlock(rq, p, &flags);25112511-25122512- return ns;25132513-}25142514-25152515-/*25162478 * Return accounted runtime for the task.25172479 * In case the task is currently running, return the runtime plus current's25182480 * pending runtime that have not been accounted yet.···24832521{24842522 unsigned long flags;24852523 struct rq *rq;24862486- u64 ns = 0;25242524+ u64 ns;2487252524882526#if defined(CONFIG_64BIT) && defined(CONFIG_SMP)24892527 /*···25022540#endif2503254125042542 rq = task_rq_lock(p, &flags);25052505- ns = p->se.sum_exec_runtime + do_task_delta_exec(p, rq);25432543+ /*25442544+ * Must be ->curr _and_ ->on_rq. If dequeued, we would25452545+ * project cycles that may never be accounted to this25462546+ * thread, breaking clock_gettime().25472547+ */25482548+ if (task_current(rq, p) && task_on_rq_queued(p)) {25492549+ update_rq_clock(rq);25502550+ p->sched_class->update_curr(rq);25512551+ }25522552+ ns = p->se.sum_exec_runtime;25062553 task_rq_unlock(rq, p, &flags);2507255425082555 return ns;···63396368 if (!sched_debug())63406369 break;63416370 }63716371+63726372+ if (!level)63736373+ return;63746374+63426375 /*63436376 * 'level' contains the number of unique distances, excluding the63446377 * identity distance node_distance(i,i).···74197444 if (unlikely(running))74207445 put_prev_task(rq, tsk);7421744674227422- tg = container_of(task_css_check(tsk, cpu_cgrp_id,74237423- lockdep_is_held(&tsk->sighand->siglock)),74477447+ /*74487448+ * All callers are synchronized by task_rq_lock(); we do not use RCU74497449+ * which is pointless here. Thus, we pass "true" to task_css_check()74507450+ * to prevent lockdep warnings.74517451+ */74527452+ tg = container_of(task_css_check(tsk, cpu_cgrp_id, true),74247453 struct task_group, css);74257454 tg = autogroup_task_group(tsk, tg);74267455 tsk->sched_task_group = tg;
···726726 account_cfs_rq_runtime(cfs_rq, delta_exec);727727}728728729729+static void update_curr_fair(struct rq *rq)730730+{731731+ update_curr(cfs_rq_of(&rq->curr->se));732732+}733733+729734static inline void730735update_stats_wait_start(struct cfs_rq *cfs_rq, struct sched_entity *se)731736{···11831178 if ((cur->flags & PF_EXITING) || is_idle_task(cur))11841179 cur = NULL;11851180 raw_spin_unlock_irq(&dst_rq->lock);11811181+11821182+ /*11831183+ * Because we have preemption enabled we can get migrated around and11841184+ * end try selecting ourselves (current == env->p) as a swap candidate.11851185+ */11861186+ if (cur == env->p)11871187+ goto unlock;1186118811871189 /*11881190 * "imp" is the fault differential for the source task between the···79607948 .switched_to = switched_to_fair,7961794979627950 .get_rr_interval = get_rr_interval_fair,79517951+79527952+ .update_curr = update_curr_fair,7963795379647954#ifdef CONFIG_FAIR_GROUP_SCHED79657955 .task_move_group = task_move_group_fair,
+5
kernel/sched/idle_task.c
···7575 return 0;7676}77777878+static void update_curr_idle(struct rq *rq)7979+{8080+}8181+7882/*7983 * Simple, special scheduling class for the per-CPU idle tasks:8084 */···105101106102 .prio_changed = prio_changed_idle,107103 .switched_to = switched_to_idle,104104+ .update_curr = update_curr_idle,108105};
···552552 case SKB_FCLONE_CLONE:553553 fclones = container_of(skb, struct sk_buff_fclones, skb2);554554555555- /* Warning : We must perform the atomic_dec_and_test() before556556- * setting skb->fclone back to SKB_FCLONE_FREE, otherwise557557- * skb_clone() could set clone_ref to 2 before our decrement.558558- * Anyway, if we are going to free the structure, no need to559559- * rewrite skb->fclone.555555+ /* The clone portion is available for556556+ * fast-cloning again.560557 */561561- if (atomic_dec_and_test(&fclones->fclone_ref)) {558558+ skb->fclone = SKB_FCLONE_FREE;559559+560560+ if (atomic_dec_and_test(&fclones->fclone_ref))562561 kmem_cache_free(skbuff_fclone_cache, fclones);563563- } else {564564- /* The clone portion is available for565565- * fast-cloning again.566566- */567567- skb->fclone = SKB_FCLONE_FREE;568568- }569562 break;570563 }571564}···880887 if (skb->fclone == SKB_FCLONE_ORIG &&881888 n->fclone == SKB_FCLONE_FREE) {882889 n->fclone = SKB_FCLONE_CLONE;883883- /* As our fastclone was free, clone_ref must be 1 at this point.884884- * We could use atomic_inc() here, but it is faster885885- * to set the final value.886886- */887887- atomic_set(&fclones->fclone_ref, 2);890890+ atomic_inc(&fclones->fclone_ref);888891 } else {889892 if (skb_pfmemalloc(skb))890893 gfp_mask |= __GFP_MEMALLOC;
+18-18
net/dcb/dcbnl.c
···10801080 if (!app)10811081 return -EMSGSIZE;1082108210831083- spin_lock(&dcb_lock);10831083+ spin_lock_bh(&dcb_lock);10841084 list_for_each_entry(itr, &dcb_app_list, list) {10851085 if (itr->ifindex == netdev->ifindex) {10861086 err = nla_put(skb, DCB_ATTR_IEEE_APP, sizeof(itr->app),10871087 &itr->app);10881088 if (err) {10891089- spin_unlock(&dcb_lock);10891089+ spin_unlock_bh(&dcb_lock);10901090 return -EMSGSIZE;10911091 }10921092 }···10971097 else10981098 dcbx = -EOPNOTSUPP;1099109911001100- spin_unlock(&dcb_lock);11001100+ spin_unlock_bh(&dcb_lock);11011101 nla_nest_end(skb, app);1102110211031103 /* get peer info if available */···12341234 }1235123512361236 /* local app */12371237- spin_lock(&dcb_lock);12371237+ spin_lock_bh(&dcb_lock);12381238 app = nla_nest_start(skb, DCB_ATTR_CEE_APP_TABLE);12391239 if (!app)12401240 goto dcb_unlock;···12711271 else12721272 dcbx = -EOPNOTSUPP;1273127312741274- spin_unlock(&dcb_lock);12741274+ spin_unlock_bh(&dcb_lock);1275127512761276 /* features flags */12771277 if (ops->getfeatcfg) {···13261326 return 0;1327132713281328dcb_unlock:13291329- spin_unlock(&dcb_lock);13291329+ spin_unlock_bh(&dcb_lock);13301330nla_put_failure:13311331 return err;13321332}···17621762 struct dcb_app_type *itr;17631763 u8 prio = 0;1764176417651765- spin_lock(&dcb_lock);17651765+ spin_lock_bh(&dcb_lock);17661766 if ((itr = dcb_app_lookup(app, dev->ifindex, 0)))17671767 prio = itr->app.priority;17681768- spin_unlock(&dcb_lock);17681768+ spin_unlock_bh(&dcb_lock);1769176917701770 return prio;17711771}···17891789 if (dev->dcbnl_ops->getdcbx)17901790 event.dcbx = dev->dcbnl_ops->getdcbx(dev);1791179117921792- spin_lock(&dcb_lock);17921792+ spin_lock_bh(&dcb_lock);17931793 /* Search for existing match and replace */17941794 if ((itr = dcb_app_lookup(new, dev->ifindex, 0))) {17951795 if (new->priority)···18041804 if (new->priority)18051805 err = dcb_app_add(new, dev->ifindex);18061806out:18071807- spin_unlock(&dcb_lock);18071807+ spin_unlock_bh(&dcb_lock);18081808 if (!err)18091809 call_dcbevent_notifiers(DCB_APP_EVENT, &event);18101810 return err;···18231823 struct dcb_app_type *itr;18241824 u8 prio = 0;1825182518261826- spin_lock(&dcb_lock);18261826+ spin_lock_bh(&dcb_lock);18271827 if ((itr = dcb_app_lookup(app, dev->ifindex, 0)))18281828 prio |= 1 << itr->app.priority;18291829- spin_unlock(&dcb_lock);18291829+ spin_unlock_bh(&dcb_lock);1830183018311831 return prio;18321832}···18501850 if (dev->dcbnl_ops->getdcbx)18511851 event.dcbx = dev->dcbnl_ops->getdcbx(dev);1852185218531853- spin_lock(&dcb_lock);18531853+ spin_lock_bh(&dcb_lock);18541854 /* Search for existing match and abort if found */18551855 if (dcb_app_lookup(new, dev->ifindex, new->priority)) {18561856 err = -EEXIST;···1859185918601860 err = dcb_app_add(new, dev->ifindex);18611861out:18621862- spin_unlock(&dcb_lock);18621862+ spin_unlock_bh(&dcb_lock);18631863 if (!err)18641864 call_dcbevent_notifiers(DCB_APP_EVENT, &event);18651865 return err;···18821882 if (dev->dcbnl_ops->getdcbx)18831883 event.dcbx = dev->dcbnl_ops->getdcbx(dev);1884188418851885- spin_lock(&dcb_lock);18851885+ spin_lock_bh(&dcb_lock);18861886 /* Search for existing match and remove it. */18871887 if ((itr = dcb_app_lookup(del, dev->ifindex, del->priority))) {18881888 list_del(&itr->list);···18901890 err = 0;18911891 }1892189218931893- spin_unlock(&dcb_lock);18931893+ spin_unlock_bh(&dcb_lock);18941894 if (!err)18951895 call_dcbevent_notifiers(DCB_APP_EVENT, &event);18961896 return err;···19021902 struct dcb_app_type *app;19031903 struct dcb_app_type *tmp;1904190419051905- spin_lock(&dcb_lock);19051905+ spin_lock_bh(&dcb_lock);19061906 list_for_each_entry_safe(app, tmp, &dcb_app_list, list) {19071907 list_del(&app->list);19081908 kfree(app);19091909 }19101910- spin_unlock(&dcb_lock);19101910+ spin_unlock_bh(&dcb_lock);19111911}1912191219131913static int __init dcbnl_init(void)
+11
net/ipv4/af_inet.c
···13861386 return pp;13871387}1388138813891389+int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)13901390+{13911391+ if (sk->sk_family == AF_INET)13921392+ return ip_recv_error(sk, msg, len, addr_len);13931393+#if IS_ENABLED(CONFIG_IPV6)13941394+ if (sk->sk_family == AF_INET6)13951395+ return pingv6_ops.ipv6_recv_error(sk, msg, len, addr_len);13961396+#endif13971397+ return -EINVAL;13981398+}13991399+13891400static int inet_gro_complete(struct sk_buff *skb, int nhoff)13901401{13911402 __be16 newlen = htons(skb->len - nhoff);
···598598 if (th->rst)599599 return;600600601601- if (skb_rtable(skb)->rt_type != RTN_LOCAL)601601+ /* If sk not NULL, it means we did a successful lookup and incoming602602+ * route had to be correct. prequeue might have dropped our dst.603603+ */604604+ if (!sk && skb_rtable(skb)->rt_type != RTN_LOCAL)602605 return;603606604607 /* Swap the send and the receive. */
+2-2
net/ipv6/ip6_gre.c
···502502503503 skb->protocol = gre_proto;504504 /* WCCP version 1 and 2 protocol decoding.505505- * - Change protocol to IP505505+ * - Change protocol to IPv6506506 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header507507 */508508 if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {509509- skb->protocol = htons(ETH_P_IP);509509+ skb->protocol = htons(ETH_P_IPV6);510510 if ((*(h + offset) & 0xF0) != 0x40)511511 offset += 4;512512 }
+2-1
net/ipv6/ip6_offload.c
···6969 int nhoff;70707171 if (unlikely(skb_shinfo(skb)->gso_type &7272- ~(SKB_GSO_UDP |7272+ ~(SKB_GSO_TCPV4 |7373+ SKB_GSO_UDP |7374 SKB_GSO_DODGY |7475 SKB_GSO_TCP_ECN |7576 SKB_GSO_GRE |
···903903 if (th->rst)904904 return;905905906906- if (!ipv6_unicast_destination(skb))906906+ /* If sk not NULL, it means we did a successful lookup and incoming907907+ * route had to be correct. prequeue might have dropped our dst.908908+ */909909+ if (!sk && !ipv6_unicast_destination(skb))907910 return;908911909912#ifdef CONFIG_TCP_MD5SIG
···18631863 if (*op < IP_SET_OP_VERSION) {18641864 /* Check the version at the beginning of operations */18651865 struct ip_set_req_version *req_version = data;18661866+18671867+ if (*len < sizeof(struct ip_set_req_version)) {18681868+ ret = -EINVAL;18691869+ goto done;18701870+ }18711871+18661872 if (req_version->version != IPSET_PROTOCOL) {18671873 ret = -EPROTO;18681874 goto done;
+2
net/netfilter/ipvs/ip_vs_xmit.c
···846846 new_skb = skb_realloc_headroom(skb, max_headroom);847847 if (!new_skb)848848 goto error;849849+ if (skb->sk)850850+ skb_set_owner_w(new_skb, skb->sk);849851 consume_skb(skb);850852 skb = new_skb;851853 }
+8-16
net/netfilter/nf_tables_api.c
···34843484 }34853485}3486348634873487-/* Schedule objects for release via rcu to make sure no packets are accesing34883488- * removed rules.34893489- */34903490-static void nf_tables_commit_release_rcu(struct rcu_head *rt)34873487+static void nf_tables_commit_release(struct nft_trans *trans)34913488{34923492- struct nft_trans *trans = container_of(rt, struct nft_trans, rcu_head);34933493-34943489 switch (trans->msg_type) {34953490 case NFT_MSG_DELTABLE:34963491 nf_tables_table_destroy(&trans->ctx);···36073612 }36083613 }3609361436153615+ synchronize_rcu();36163616+36103617 list_for_each_entry_safe(trans, next, &net->nft.commit_list, list) {36113618 list_del(&trans->list);36123612- trans->ctx.nla = NULL;36133613- call_rcu(&trans->rcu_head, nf_tables_commit_release_rcu);36193619+ nf_tables_commit_release(trans);36143620 }3615362136163622 nf_tables_gen_notify(net, skb, NFT_MSG_NEWGEN);···36193623 return 0;36203624}3621362536223622-/* Schedule objects for release via rcu to make sure no packets are accesing36233623- * aborted rules.36243624- */36253625-static void nf_tables_abort_release_rcu(struct rcu_head *rt)36263626+static void nf_tables_abort_release(struct nft_trans *trans)36263627{36273627- struct nft_trans *trans = container_of(rt, struct nft_trans, rcu_head);36283628-36293628 switch (trans->msg_type) {36303629 case NFT_MSG_NEWTABLE:36313630 nf_tables_table_destroy(&trans->ctx);···37163725 }37173726 }3718372737283728+ synchronize_rcu();37293729+37193730 list_for_each_entry_safe_reverse(trans, next,37203731 &net->nft.commit_list, list) {37213732 list_del(&trans->list);37223722- trans->ctx.nla = NULL;37233723- call_rcu(&trans->rcu_head, nf_tables_abort_release_rcu);37333733+ nf_tables_abort_release(trans);37243734 }3725373537263736 return 0;
+11-1
net/netfilter/nfnetlink.c
···4747 [NFNLGRP_CONNTRACK_EXP_NEW] = NFNL_SUBSYS_CTNETLINK_EXP,4848 [NFNLGRP_CONNTRACK_EXP_UPDATE] = NFNL_SUBSYS_CTNETLINK_EXP,4949 [NFNLGRP_CONNTRACK_EXP_DESTROY] = NFNL_SUBSYS_CTNETLINK_EXP,5050+ [NFNLGRP_NFTABLES] = NFNL_SUBSYS_NFTABLES,5151+ [NFNLGRP_ACCT_QUOTA] = NFNL_SUBSYS_ACCT,5052};51535254void nfnl_lock(__u8 subsys_id)···466464static int nfnetlink_bind(int group)467465{468466 const struct nfnetlink_subsystem *ss;469469- int type = nfnl_group2type[group];467467+ int type;468468+469469+ if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX)470470+ return -EINVAL;471471+472472+ type = nfnl_group2type[group];470473471474 rcu_read_lock();472475 ss = nfnetlink_get_subsys(type);···520513static int __init nfnetlink_init(void)521514{522515 int i;516516+517517+ for (i = NFNLGRP_NONE + 1; i <= NFNLGRP_MAX; i++)518518+ BUG_ON(nfnl_group2type[i] == NFNL_SUBSYS_NONE);523519524520 for (i=0; i<NFNL_SUBSYS_COUNT; i++)525521 mutex_init(&table[i].mutex);
+6-34
net/netfilter/nft_compat.c
···2121#include <linux/netfilter_ipv6/ip6_tables.h>2222#include <net/netfilter/nf_tables.h>23232424-static const struct {2525- const char *name;2626- u8 type;2727-} table_to_chaintype[] = {2828- { "filter", NFT_CHAIN_T_DEFAULT },2929- { "raw", NFT_CHAIN_T_DEFAULT },3030- { "security", NFT_CHAIN_T_DEFAULT },3131- { "mangle", NFT_CHAIN_T_ROUTE },3232- { "nat", NFT_CHAIN_T_NAT },3333- { },3434-};3535-3636-static int nft_compat_table_to_chaintype(const char *table)3737-{3838- int i;3939-4040- for (i = 0; table_to_chaintype[i].name != NULL; i++) {4141- if (strcmp(table_to_chaintype[i].name, table) == 0)4242- return table_to_chaintype[i].type;4343- }4444-4545- return -1;4646-}4747-4824static int nft_compat_chain_validate_dependency(const char *tablename,4925 const struct nft_chain *chain)5026{5151- enum nft_chain_type type;5227 const struct nft_base_chain *basechain;53285429 if (!tablename || !(chain->flags & NFT_BASE_CHAIN))5530 return 0;56315757- type = nft_compat_table_to_chaintype(tablename);5858- if (type < 0)5959- return -EINVAL;6060-6132 basechain = nft_base_chain(chain);6262- if (basechain->type->type != type)3333+ if (strcmp(tablename, "nat") == 0 &&3434+ basechain->type->type != NFT_CHAIN_T_NAT)6335 return -EINVAL;64366537 return 0;···89117 struct xt_target *target, void *info,90118 union nft_entry *entry, u8 proto, bool inv)91119{9292- par->net = &init_net;120120+ par->net = ctx->net;93121 par->table = ctx->table->name;94122 switch (ctx->afi->family) {95123 case AF_INET:···296324 struct xt_match *match, void *info,297325 union nft_entry *entry, u8 proto, bool inv)298326{299299- par->net = &init_net;327327+ par->net = ctx->net;300328 par->table = ctx->table->name;301329 switch (ctx->afi->family) {302330 case AF_INET:···346374 union nft_entry e = {};347375 int ret;348376349349- ret = nft_compat_chain_validate_dependency(match->name, ctx->chain);377377+ ret = nft_compat_chain_validate_dependency(match->table, ctx->chain);350378 if (ret < 0)351379 goto err;352380···420448 if (!(hook_mask & match->hooks))421449 return -EINVAL;422450423423- ret = nft_compat_chain_validate_dependency(match->name,451451+ ret = nft_compat_chain_validate_dependency(match->table,424452 ctx->chain);425453 if (ret < 0)426454 return ret;
+6-4
net/openvswitch/actions.c
···246246{247247 int transport_len = skb->len - skb_transport_offset(skb);248248249249- if (l4_proto == IPPROTO_TCP) {249249+ if (l4_proto == NEXTHDR_TCP) {250250 if (likely(transport_len >= sizeof(struct tcphdr)))251251 inet_proto_csum_replace16(&tcp_hdr(skb)->check, skb,252252 addr, new_addr, 1);253253- } else if (l4_proto == IPPROTO_UDP) {253253+ } else if (l4_proto == NEXTHDR_UDP) {254254 if (likely(transport_len >= sizeof(struct udphdr))) {255255 struct udphdr *uh = udp_hdr(skb);256256···261261 uh->check = CSUM_MANGLED_0;262262 }263263 }264264+ } else if (l4_proto == NEXTHDR_ICMP) {265265+ if (likely(transport_len >= sizeof(struct icmp6hdr)))266266+ inet_proto_csum_replace16(&icmp6_hdr(skb)->icmp6_cksum,267267+ skb, addr, new_addr, 1);264268 }265269}266270···726722727723 case OVS_ACTION_ATTR_SAMPLE:728724 err = sample(dp, skb, key, a);729729- if (unlikely(err)) /* skb already freed. */730730- return err;731725 break;732726 }733727
+7-7
net/openvswitch/datapath.c
···12651265 return msgsize;12661266}1267126712681268-/* Called with ovs_mutex or RCU read lock. */12681268+/* Called with ovs_mutex. */12691269static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb,12701270 u32 portid, u32 seq, u32 flags, u8 cmd)12711271{···15551555 if (!reply)15561556 return -ENOMEM;1557155715581558- rcu_read_lock();15581558+ ovs_lock();15591559 dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);15601560 if (IS_ERR(dp)) {15611561 err = PTR_ERR(dp);···15641564 err = ovs_dp_cmd_fill_info(dp, reply, info->snd_portid,15651565 info->snd_seq, 0, OVS_DP_CMD_NEW);15661566 BUG_ON(err < 0);15671567- rcu_read_unlock();15671567+ ovs_unlock();1568156815691569 return genlmsg_reply(reply, info);1570157015711571err_unlock_free:15721572- rcu_read_unlock();15721572+ ovs_unlock();15731573 kfree_skb(reply);15741574 return err;15751575}···15811581 int skip = cb->args[0];15821582 int i = 0;1583158315841584- rcu_read_lock();15851585- list_for_each_entry_rcu(dp, &ovs_net->dps, list_node) {15841584+ ovs_lock();15851585+ list_for_each_entry(dp, &ovs_net->dps, list_node) {15861586 if (i >= skip &&15871587 ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).portid,15881588 cb->nlh->nlmsg_seq, NLM_F_MULTI,···15901590 break;15911591 i++;15921592 }15931593- rcu_read_unlock();15931593+ ovs_unlock();1594159415951595 cb->args[0] = i;15961596
+8-1
net/openvswitch/flow_netlink.c
···145145 if (match->key->eth.type == htons(ETH_P_ARP)146146 || match->key->eth.type == htons(ETH_P_RARP)) {147147 key_expected |= 1 << OVS_KEY_ATTR_ARP;148148- if (match->mask && (match->mask->key.eth.type == htons(0xffff)))148148+ if (match->mask && (match->mask->key.tp.src == htons(0xff)))149149 mask_allowed |= 1 << OVS_KEY_ATTR_ARP;150150 }151151···689689 ipv6_key->ipv6_frag, OVS_FRAG_TYPE_MAX);690690 return -EINVAL;691691 }692692+693693+ if (!is_mask && ipv6_key->ipv6_label & htonl(0xFFF00000)) {694694+ OVS_NLERR("IPv6 flow label %x is out of range (max=%x).\n",695695+ ntohl(ipv6_key->ipv6_label), (1 << 20) - 1);696696+ return -EINVAL;697697+ }698698+692699 SW_FLOW_KEY_PUT(match, ipv6.label,693700 ipv6_key->ipv6_label, is_mask);694701 SW_FLOW_KEY_PUT(match, ip.proto,
···1933193319341934int kvm_vgic_create(struct kvm *kvm)19351935{19361936- int i, vcpu_lock_idx = -1, ret = 0;19361936+ int i, vcpu_lock_idx = -1, ret;19371937 struct kvm_vcpu *vcpu;1938193819391939 mutex_lock(&kvm->lock);···19481948 * vcpu->mutex. By grabbing the vcpu->mutex of all VCPUs we ensure19491949 * that no other VCPUs are run while we create the vgic.19501950 */19511951+ ret = -EBUSY;19511952 kvm_for_each_vcpu(i, vcpu, kvm) {19521953 if (!mutex_trylock(&vcpu->mutex))19531954 goto out_unlock;···19561955 }1957195619581957 kvm_for_each_vcpu(i, vcpu, kvm) {19591959- if (vcpu->arch.has_run_once) {19601960- ret = -EBUSY;19581958+ if (vcpu->arch.has_run_once)19611959 goto out_unlock;19621962- }19631960 }19611961+ ret = 0;1964196219651963 spin_lock_init(&kvm->arch.vgic.lock);19661964 kvm->arch.vgic.in_kernel = true;
+8-8
virt/kvm/kvm_main.c
···107107108108static bool largepages_enabled = true;109109110110-bool kvm_is_mmio_pfn(pfn_t pfn)110110+bool kvm_is_reserved_pfn(pfn_t pfn)111111{112112 if (pfn_valid(pfn))113113- return !is_zero_pfn(pfn) && PageReserved(pfn_to_page(pfn));113113+ return PageReserved(pfn_to_page(pfn));114114115115 return true;116116}···13211321 else if ((vma->vm_flags & VM_PFNMAP)) {13221322 pfn = ((addr - vma->vm_start) >> PAGE_SHIFT) +13231323 vma->vm_pgoff;13241324- BUG_ON(!kvm_is_mmio_pfn(pfn));13241324+ BUG_ON(!kvm_is_reserved_pfn(pfn));13251325 } else {13261326 if (async && vma_is_valid(vma, write_fault))13271327 *async = true;···14271427 if (is_error_noslot_pfn(pfn))14281428 return KVM_ERR_PTR_BAD_PAGE;1429142914301430- if (kvm_is_mmio_pfn(pfn)) {14301430+ if (kvm_is_reserved_pfn(pfn)) {14311431 WARN_ON(1);14321432 return KVM_ERR_PTR_BAD_PAGE;14331433 }···1456145614571457void kvm_release_pfn_clean(pfn_t pfn)14581458{14591459- if (!is_error_noslot_pfn(pfn) && !kvm_is_mmio_pfn(pfn))14591459+ if (!is_error_noslot_pfn(pfn) && !kvm_is_reserved_pfn(pfn))14601460 put_page(pfn_to_page(pfn));14611461}14621462EXPORT_SYMBOL_GPL(kvm_release_pfn_clean);···1477147714781478void kvm_set_pfn_dirty(pfn_t pfn)14791479{14801480- if (!kvm_is_mmio_pfn(pfn)) {14801480+ if (!kvm_is_reserved_pfn(pfn)) {14811481 struct page *page = pfn_to_page(pfn);14821482 if (!PageReserved(page))14831483 SetPageDirty(page);···1487148714881488void kvm_set_pfn_accessed(pfn_t pfn)14891489{14901490- if (!kvm_is_mmio_pfn(pfn))14901490+ if (!kvm_is_reserved_pfn(pfn))14911491 mark_page_accessed(pfn_to_page(pfn));14921492}14931493EXPORT_SYMBOL_GPL(kvm_set_pfn_accessed);1494149414951495void kvm_get_pfn(pfn_t pfn)14961496{14971497- if (!kvm_is_mmio_pfn(pfn))14971497+ if (!kvm_is_reserved_pfn(pfn))14981498 get_page(pfn_to_page(pfn));14991499}15001500EXPORT_SYMBOL_GPL(kvm_get_pfn);