We need the usb/thunderbolt fixes in here as well.
Unified · Split
| @@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com · 32 unmodified lines | ||
| 33 | 33 | Description: |
| 34 | 34 | The current state of the log write grant head. It |
| 35 | 35 | represents the total log reservation of all currently |
| 36 | − oustanding transactions, including regrants due to | |
| 36 | + outstanding transactions, including regrants due to | |
| 37 | 37 | rolling transactions. The grant head is exported in |
| 38 | 38 | "cycle:bytes" format. |
| 39 | 39 | Users: xfstests |
| @@ -21,6 +21,10 @@ properties: · 20 unmodified lines | ||
| 21 | 21 | - fsl,vf610-spdif |
| 22 | 22 | - fsl,imx6sx-spdif |
| 23 | 23 | - fsl,imx8qm-spdif |
| 24 | + - fsl,imx8qxp-spdif | |
| 25 | + - fsl,imx8mq-spdif | |
| 26 | + - fsl,imx8mm-spdif | |
| 27 | + - fsl,imx8mn-spdif | |
| 24 | 28 | |
| 25 | 29 | reg: |
| 26 | 30 | maxItems: 1 |
| @@ -1495,7 +1495,8 @@ Fails if any VCPU has already been created. · 1494 unmodified lines | ||
| 1495 | 1495 | |
| 1496 | 1496 | Define which vcpu is the Bootstrap Processor (BSP). Values are the same |
| 1497 | 1497 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default |
| 1498 | −is vcpu 0. | |
| 1498 | +is vcpu 0. This ioctl has to be called before vcpu creation, | |
| 1499 | +otherwise it will return EBUSY error. | |
| 1499 | 1500 | |
| 1500 | 1501 | |
| 1501 | 1502 | 4.42 KVM_GET_XSAVE |
| @@ -4806,8 +4807,10 @@ If an MSR access is not permitted through the filtering, it generates a · 3304 unmodified lines | ||
| 4806 | 4807 | allows user space to deflect and potentially handle various MSR accesses |
| 4807 | 4808 | into user space. |
| 4808 | 4809 | |
| 4809 | −If a vCPU is in running state while this ioctl is invoked, the vCPU may | |
| 4810 | −experience inconsistent filtering behavior on MSR accesses. | |
| 4810 | +Note, invoking this ioctl with a vCPU is running is inherently racy. However, | |
| 4811 | +KVM does guarantee that vCPUs will see either the previous filter or the new | |
| 4812 | +filter, e.g. MSRs with identical settings in both the old and new filter will | |
| 4813 | +have deterministic behavior. | |
| 4811 | 4814 | |
| 4812 | 4815 | 4.127 KVM_XEN_HVM_SET_ATTR |
| 4813 | 4816 | -------------------------- |
| @@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 1180 unmodified lines | ||
| 1181 | 1181 | M: Christian Brauner <christian@brauner.io> |
| 1182 | 1182 | M: Hridya Valsaraju <hridya@google.com> |
| 1183 | 1183 | M: Suren Baghdasaryan <surenb@google.com> |
| 1184 | −L: devel@driverdev.osuosl.org | |
| 1184 | +L: linux-kernel@vger.kernel.org | |
| 1185 | 1185 | S: Supported |
| 1186 | 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 1187 | 1187 | F: drivers/android/ |
| @@ -8116,7 +8116,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 6928 unmodified lines | ||
| 8116 | 8116 | |
| 8117 | 8117 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 |
| 8118 | 8118 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
| 8119 | −L: devel@driverdev.osuosl.org | |
| 8120 | 8119 | S: Maintained |
| 8121 | 8120 | F: drivers/staging/hikey9xx/ |
| 8122 | 8121 | |
| @@ -17040,7 +17039,7 @@ F: drivers/staging/vt665?/ · 8917 unmodified lines | ||
| 17040 | 17039 | |
| 17041 | 17040 | STAGING SUBSYSTEM |
| 17042 | 17041 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 17043 | −L: devel@driverdev.osuosl.org | |
| 17042 | +L: linux-staging@lists.linux.dev | |
| 17044 | 17043 | S: Supported |
| 17045 | 17044 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 17046 | 17045 | F: drivers/staging/ |
| @@ -19135,7 +19134,7 @@ VME SUBSYSTEM · 2088 unmodified lines | ||
| 19135 | 19134 | M: Martyn Welch <martyn@welchs.me.uk> |
| 19136 | 19135 | M: Manohar Vanga <manohar.vanga@gmail.com> |
| 19137 | 19136 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 19138 | −L: devel@driverdev.osuosl.org | |
| 19137 | +L: linux-kernel@vger.kernel.org | |
| 19139 | 19138 | S: Maintained |
| 19140 | 19139 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git |
| 19141 | 19140 | F: Documentation/driver-api/vme.rst |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | VERSION = 5 |
| 3 | 3 | PATCHLEVEL = 12 |
| 4 | 4 | SUBLEVEL = 0 |
| 5 | −EXTRAVERSION = -rc3 | |
| 5 | +EXTRAVERSION = -rc4 | |
| 6 | 6 | NAME = Frozen Wasteland |
| 7 | 7 | |
| 8 | 8 | # *DOCUMENTATION* |
| @@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p) · 8 unmodified lines | ||
| 9 | 9 | return 0; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 12 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 13 | 13 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 14 | 14 | struct ftrace_ops *ops, struct ftrace_regs *fregs) |
| 15 | 15 | { |
| @@ -176,7 +176,7 @@ SECTIONS · 175 unmodified lines | ||
| 176 | 176 | .fill : { |
| 177 | 177 | FILL(0); |
| 178 | 178 | BYTE(0); |
| 179 | − . = ALIGN(8); | |
| 179 | + STRUCT_ALIGN(); | |
| 180 | 180 | } |
| 181 | 181 | __appended_dtb = .; |
| 182 | 182 | /* leave space for appended DTB */ |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <linux/bug.h> |
| 8 | 8 | #include <asm/cputable.h> |
| 9 | 9 | |
| 10 | −static inline bool early_cpu_has_feature(unsigned long feature) | |
| 10 | +static __always_inline bool early_cpu_has_feature(unsigned long feature) | |
| 11 | 11 | { |
| 12 | 12 | return !!((CPU_FTRS_ALWAYS & feature) || |
| 13 | 13 | (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); |
| @@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature) · 32 unmodified lines | ||
| 46 | 46 | return static_branch_likely(&cpu_feature_keys[i]); |
| 47 | 47 | } |
| 48 | 48 | #else |
| 49 | −static inline bool cpu_has_feature(unsigned long feature) | |
| 49 | +static __always_inline bool cpu_has_feature(unsigned long feature) | |
| 50 | 50 | { |
| 51 | 51 | return early_cpu_has_feature(feature); |
| 52 | 52 | } |
| @@ -65,3 +65,14 @@ V_FUNCTION_END(__kernel_clock_getres) · 64 unmodified lines | ||
| 65 | 65 | V_FUNCTION_BEGIN(__kernel_time) |
| 66 | 66 | cvdso_call_time __c_kernel_time |
| 67 | 67 | V_FUNCTION_END(__kernel_time) |
| 68 | + | |
| 69 | +/* Routines for restoring integer registers, called by the compiler. */ | |
| 70 | +/* Called with r11 pointing to the stack header word of the caller of the */ | |
| 71 | +/* function, just beyond the end of the integer restore area. */ | |
| 72 | +_GLOBAL(_restgpr_31_x) | |
| 73 | +_GLOBAL(_rest32gpr_31_x) | |
| 74 | + lwz r0,4(r11) | |
| 75 | + lwz r31,-4(r11) | |
| 76 | + mtlr r0 | |
| 77 | + mr r1,r11 | |
| 78 | + blr | |
| @@ -93,7 +93,6 @@ config RISCV · 92 unmodified lines | ||
| 93 | 93 | select PCI_MSI if PCI |
| 94 | 94 | select RISCV_INTC |
| 95 | 95 | select RISCV_TIMER if RISCV_SBI |
| 96 | − select SPARSEMEM_STATIC if 32BIT | |
| 97 | 96 | select SPARSE_IRQ |
| 98 | 97 | select SYSCTL_EXCEPTION_TRACE |
| 99 | 98 | select THREAD_INFO_IN_TASK |
| @@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE · 54 unmodified lines | ||
| 154 | 153 | config ARCH_SPARSEMEM_ENABLE |
| 155 | 154 | def_bool y |
| 156 | 155 | depends on MMU |
| 157 | − select SPARSEMEM_VMEMMAP_ENABLE | |
| 156 | + select SPARSEMEM_STATIC if 32BIT && SPARSMEM | |
| 157 | + select SPARSEMEM_VMEMMAP_ENABLE if 64BIT | |
| 158 | 158 | |
| 159 | 159 | config ARCH_SELECT_MEMORY_MODEL |
| 160 | 160 | def_bool ARCH_SPARSEMEM_ENABLE |
| @@ -31,6 +31,8 @@ config SOC_CANAAN · 30 unmodified lines | ||
| 31 | 31 | select SIFIVE_PLIC |
| 32 | 32 | select ARCH_HAS_RESET_CONTROLLER |
| 33 | 33 | select PINCTRL |
| 34 | + select COMMON_CLK | |
| 35 | + select COMMON_CLK_K210 | |
| 34 | 36 | help |
| 35 | 37 | This enables support for Canaan Kendryte K210 SoC platform hardware. |
| 36 | 38 | |
| @@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b); · 8 unmodified lines | ||
| 9 | 9 | long long __ashrti3(long long a, int b); |
| 10 | 10 | long long __ashlti3(long long a, int b); |
| 11 | 11 | |
| 12 | + | |
| 13 | +#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs) | |
| 14 | + | |
| 15 | +DECLARE_DO_ERROR_INFO(do_trap_unknown); | |
| 16 | +DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned); | |
| 17 | +DECLARE_DO_ERROR_INFO(do_trap_insn_fault); | |
| 18 | +DECLARE_DO_ERROR_INFO(do_trap_insn_illegal); | |
| 19 | +DECLARE_DO_ERROR_INFO(do_trap_load_fault); | |
| 20 | +DECLARE_DO_ERROR_INFO(do_trap_load_misaligned); | |
| 21 | +DECLARE_DO_ERROR_INFO(do_trap_store_misaligned); | |
| 22 | +DECLARE_DO_ERROR_INFO(do_trap_store_fault); | |
| 23 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_u); | |
| 24 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_s); | |
| 25 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_m); | |
| 26 | +DECLARE_DO_ERROR_INFO(do_trap_break); | |
| 27 | + | |
| 12 | 28 | #endif /* _ASM_RISCV_PROTOTYPES_H */ |
| @@ -12,4 +12,6 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include <asm-generic/irq.h> |
| 14 | 14 | |
| 15 | +extern void __init init_IRQ(void); | |
| 16 | + | |
| 15 | 17 | #endif /* _ASM_RISCV_IRQ_H */ |
| @@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node); · 70 unmodified lines | ||
| 71 | 71 | int riscv_of_parent_hartid(struct device_node *node); |
| 72 | 72 | |
| 73 | 73 | extern void riscv_fill_hwcap(void); |
| 74 | +extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | |
| 74 | 75 | |
| 75 | 76 | #endif /* __ASSEMBLY__ */ |
| 76 | 77 | |
| @@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name); · 118 unmodified lines | ||
| 119 | 119 | extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, |
| 120 | 120 | unsigned int n); |
| 121 | 121 | |
| 122 | +void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, | |
| 123 | + unsigned long frame_pointer); | |
| 124 | +int do_syscall_trace_enter(struct pt_regs *regs); | |
| 125 | +void do_syscall_trace_exit(struct pt_regs *regs); | |
| 126 | + | |
| 122 | 127 | /** |
| 123 | 128 | * regs_get_register() - get register value from its offset |
| 124 | 129 | * @regs: pt_regs from which register value is gotten |
| @@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid { · 50 unmodified lines | ||
| 51 | 51 | SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, |
| 52 | 52 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, |
| 53 | 53 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, |
| 54 | − SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, | |
| 55 | 54 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, |
| 56 | − SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | |
| 55 | + SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, | |
| 57 | 56 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, |
| 57 | + SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | 60 | enum sbi_ext_hsm_fid { |
| @@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val) · 87 unmodified lines | ||
| 88 | 88 | return 0; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | +extern void time_init(void); | |
| 92 | + | |
| 91 | 93 | #endif /* _ASM_RISCV_TIMEX_H */ |
| @@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) · 7 unmodified lines | ||
| 8 | 8 | CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) |
| 9 | 9 | CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) |
| 10 | 10 | endif |
| 11 | +CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) | |
| 11 | 12 | |
| 12 | 13 | extra-y += head.o |
| 13 | 14 | extra-y += vmlinux.lds |
| @@ -2,39 +2,41 @@ · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | #include <linux/kprobes.h> |
| 4 | 4 | |
| 5 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 5 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 6 | 6 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 7 | − struct ftrace_ops *ops, struct ftrace_regs *regs) | |
| 7 | + struct ftrace_ops *ops, struct ftrace_regs *fregs) | |
| 8 | 8 | { |
| 9 | 9 | struct kprobe *p; |
| 10 | + struct pt_regs *regs; | |
| 10 | 11 | struct kprobe_ctlblk *kcb; |
| 11 | 12 | |
| 12 | 13 | p = get_kprobe((kprobe_opcode_t *)ip); |
| 13 | 14 | if (unlikely(!p) || kprobe_disabled(p)) |
| 14 | 15 | return; |
| 15 | 16 | |
| 17 | + regs = ftrace_get_regs(fregs); | |
| 16 | 18 | kcb = get_kprobe_ctlblk(); |
| 17 | 19 | if (kprobe_running()) { |
| 18 | 20 | kprobes_inc_nmissed_count(p); |
| 19 | 21 | } else { |
| 20 | − unsigned long orig_ip = instruction_pointer(&(regs->regs)); | |
| 22 | + unsigned long orig_ip = instruction_pointer(regs); | |
| 21 | 23 | |
| 22 | − instruction_pointer_set(&(regs->regs), ip); | |
| 24 | + instruction_pointer_set(regs, ip); | |
| 23 | 25 | |
| 24 | 26 | __this_cpu_write(current_kprobe, p); |
| 25 | 27 | kcb->kprobe_status = KPROBE_HIT_ACTIVE; |
| 26 | − if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) { | |
| 28 | + if (!p->pre_handler || !p->pre_handler(p, regs)) { | |
| 27 | 29 | /* |
| 28 | 30 | * Emulate singlestep (and also recover regs->pc) |
| 29 | 31 | * as if there is a nop |
| 30 | 32 | */ |
| 31 | − instruction_pointer_set(&(regs->regs), | |
| 33 | + instruction_pointer_set(regs, | |
| 32 | 34 | (unsigned long)p->addr + MCOUNT_INSN_SIZE); |
| 33 | 35 | if (unlikely(p->post_handler)) { |
| 34 | 36 | kcb->kprobe_status = KPROBE_HIT_SSDONE; |
| 35 | − p->post_handler(p, &(regs->regs), 0); | |
| 37 | + p->post_handler(p, regs, 0); | |
| 36 | 38 | } |
| 37 | − instruction_pointer_set(&(regs->regs), orig_ip); | |
| 39 | + instruction_pointer_set(regs, orig_ip); | |
| 38 | 40 | } |
| 39 | 41 | |
| 40 | 42 | /* |
| @@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr) · 255 unmodified lines | ||
| 256 | 256 | * normal page fault. |
| 257 | 257 | */ |
| 258 | 258 | regs->epc = (unsigned long) cur->addr; |
| 259 | − if (!instruction_pointer(regs)) | |
| 260 | − BUG(); | |
| 259 | + BUG_ON(!instruction_pointer(regs)); | |
| 261 | 260 | |
| 262 | 261 | if (kcb->kprobe_status == KPROBE_REENTER) |
| 263 | 262 | restore_previous_kprobe(kcb); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/cpu.h> |
| 11 | 11 | #include <linux/kernel.h> |
| 12 | 12 | #include <linux/sched.h> |
| 13 | +#include <linux/sched/debug.h> | |
| 13 | 14 | #include <linux/sched/task_stack.h> |
| 14 | 15 | #include <linux/tick.h> |
| 15 | 16 | #include <linux/ptrace.h> |
| @@ -116,7 +116,7 @@ void sbi_clear_ipi(void) · 115 unmodified lines | ||
| 116 | 116 | EXPORT_SYMBOL(sbi_clear_ipi); |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | − * sbi_set_timer_v01() - Program the timer for next timer event. | |
| 119 | + * __sbi_set_timer_v01() - Program the timer for next timer event. | |
| 120 | 120 | * @stime_value: The value after which next timer event should fire. |
| 121 | 121 | * |
| 122 | 122 | * Return: None |
| @@ -147,7 +147,8 @@ static void __init init_resources(void) · 146 unmodified lines | ||
| 147 | 147 | bss_res.end = __pa_symbol(__bss_stop) - 1; |
| 148 | 148 | bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; |
| 149 | 149 | |
| 150 | − mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res); | |
| 150 | + /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */ | |
| 151 | + mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt + 1) * sizeof(*mem_res); | |
| 151 | 152 | mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); |
| 152 | 153 | if (!mem_res) |
| 153 | 154 | panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz); |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <linux/delay.h> |
| 10 | 10 | #include <asm/sbi.h> |
| 11 | 11 | #include <asm/processor.h> |
| 12 | +#include <asm/timex.h> | |
| 12 | 13 | |
| 13 | 14 | unsigned long riscv_timebase; |
| 14 | 15 | EXPORT_SYMBOL_GPL(riscv_timebase); |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/module.h> |
| 18 | 18 | #include <linux/irq.h> |
| 19 | 19 | |
| 20 | +#include <asm/asm-prototypes.h> | |
| 20 | 21 | #include <asm/bug.h> |
| 21 | 22 | #include <asm/processor.h> |
| 22 | 23 | #include <asm/ptrace.h> |
| @@ -155,7 +155,7 @@ static void __init kasan_populate(void *start, void *end) · 154 unmodified lines | ||
| 155 | 155 | memset(start, KASAN_SHADOW_INIT, end - start); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | −void __init kasan_shallow_populate(void *start, void *end) | |
| 158 | +static void __init kasan_shallow_populate(void *start, void *end) | |
| 159 | 159 | { |
| 160 | 160 | unsigned long vaddr = (unsigned long)start & PAGE_MASK; |
| 161 | 161 | unsigned long vend = PAGE_ALIGN((unsigned long)end); |
| @@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end) · 25 unmodified lines | ||
| 187 | 187 | } |
| 188 | 188 | vaddr += PAGE_SIZE; |
| 189 | 189 | } |
| 190 | + | |
| 191 | + local_flush_tlb_all(); | |
| 190 | 192 | } |
| 191 | 193 | |
| 192 | 194 | void __init kasan_init(void) |
| @@ -202,7 +202,7 @@ extern unsigned int s390_pci_no_rid; · 201 unmodified lines | ||
| 202 | 202 | ----------------------------------------------------------------------------- */ |
| 203 | 203 | /* Base stuff */ |
| 204 | 204 | int zpci_create_device(u32 fid, u32 fh, enum zpci_state state); |
| 205 | −void zpci_remove_device(struct zpci_dev *zdev); | |
| 205 | +void zpci_remove_device(struct zpci_dev *zdev, bool set_error); | |
| 206 | 206 | int zpci_enable_device(struct zpci_dev *); |
| 207 | 207 | int zpci_disable_device(struct zpci_dev *); |
| 208 | 208 | int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); |
| @@ -968,7 +968,7 @@ static int cf_diag_all_start(void) · 967 unmodified lines | ||
| 968 | 968 | */ |
| 969 | 969 | static size_t cf_diag_needspace(unsigned int sets) |
| 970 | 970 | { |
| 971 | − struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events); | |
| 971 | + struct cpu_cf_events *cpuhw = get_cpu_ptr(&cpu_cf_events); | |
| 972 | 972 | size_t bytes = 0; |
| 973 | 973 | int i; |
| 974 | 974 | |
| @@ -984,6 +984,7 @@ static size_t cf_diag_needspace(unsigned int sets) · 9 unmodified lines | ||
| 984 | 984 | sizeof(((struct s390_ctrset_cpudata *)0)->no_sets)); |
| 985 | 985 | debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__, |
| 986 | 986 | bytes); |
| 987 | + put_cpu_ptr(&cpu_cf_events); | |
| 987 | 988 | return bytes; |
| 988 | 989 | } |
| 989 | 990 | |
| @@ -214,7 +214,7 @@ void vtime_flush(struct task_struct *tsk) · 213 unmodified lines | ||
| 214 | 214 | avg_steal = S390_lowcore.avg_steal_timer / 2; |
| 215 | 215 | if ((s64) steal > 0) { |
| 216 | 216 | S390_lowcore.steal_timer = 0; |
| 217 | − account_steal_time(steal); | |
| 217 | + account_steal_time(cputime_to_nsecs(steal)); | |
| 218 | 218 | avg_steal += steal; |
| 219 | 219 | } |
| 220 | 220 | S390_lowcore.avg_steal_timer = avg_steal; |
| @@ -682,16 +682,36 @@ int zpci_disable_device(struct zpci_dev *zdev) · 681 unmodified lines | ||
| 682 | 682 | } |
| 683 | 683 | EXPORT_SYMBOL_GPL(zpci_disable_device); |
| 684 | 684 | |
| 685 | −void zpci_remove_device(struct zpci_dev *zdev) | |
| 685 | +/* zpci_remove_device - Removes the given zdev from the PCI core | |
| 686 | + * @zdev: the zdev to be removed from the PCI core | |
| 687 | + * @set_error: if true the device's error state is set to permanent failure | |
| 688 | + * | |
| 689 | + * Sets a zPCI device to a configured but offline state; the zPCI | |
| 690 | + * device is still accessible through its hotplug slot and the zPCI | |
| 691 | + * API but is removed from the common code PCI bus, making it | |
| 692 | + * no longer available to drivers. | |
| 693 | + */ | |
| 694 | +void zpci_remove_device(struct zpci_dev *zdev, bool set_error) | |
| 686 | 695 | { |
| 687 | 696 | struct zpci_bus *zbus = zdev->zbus; |
| 688 | 697 | struct pci_dev *pdev; |
| 689 | 698 | |
| 699 | + if (!zdev->zbus->bus) | |
| 700 | + return; | |
| 701 | + | |
| 690 | 702 | pdev = pci_get_slot(zbus->bus, zdev->devfn); |
| 691 | 703 | if (pdev) { |
| 692 | − if (pdev->is_virtfn) | |
| 693 | − return zpci_iov_remove_virtfn(pdev, zdev->vfn); | |
| 704 | + if (set_error) | |
| 705 | + pdev->error_state = pci_channel_io_perm_failure; | |
| 706 | + if (pdev->is_virtfn) { | |
| 707 | + zpci_iov_remove_virtfn(pdev, zdev->vfn); | |
| 708 | + /* balance pci_get_slot */ | |
| 709 | + pci_dev_put(pdev); | |
| 710 | + return; | |
| 711 | + } | |
| 694 | 712 | pci_stop_and_remove_bus_device_locked(pdev); |
| 713 | + /* balance pci_get_slot */ | |
| 714 | + pci_dev_put(pdev); | |
| 695 | 715 | } |
| 696 | 716 | } |
| 697 | 717 | |
| @@ -765,7 +785,7 @@ void zpci_release_device(struct kref *kref) · 67 unmodified lines | ||
| 765 | 785 | struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); |
| 766 | 786 | |
| 767 | 787 | if (zdev->zbus->bus) |
| 768 | − zpci_remove_device(zdev); | |
| 788 | + zpci_remove_device(zdev, false); | |
| 769 | 789 | |
| 770 | 790 | switch (zdev->state) { |
| 771 | 791 | case ZPCI_FN_STATE_ONLINE: |
| @@ -76,13 +76,10 @@ void zpci_event_error(void *data) · 75 unmodified lines | ||
| 76 | 76 | static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) |
| 77 | 77 | { |
| 78 | 78 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); |
| 79 | − struct pci_dev *pdev = NULL; | |
| 80 | 79 | enum zpci_state state; |
| 80 | + struct pci_dev *pdev; | |
| 81 | 81 | int ret; |
| 82 | 82 | |
| 83 | − if (zdev && zdev->zbus->bus) | |
| 84 | − pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); | |
| 85 | − | |
| 86 | 83 | zpci_err("avail CCDF:\n"); |
| 87 | 84 | zpci_err_hex(ccdf, sizeof(*ccdf)); |
| 88 | 85 | |
| @@ -124,8 +121,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 35 unmodified lines | ||
| 124 | 121 | case 0x0303: /* Deconfiguration requested */ |
| 125 | 122 | if (!zdev) |
| 126 | 123 | break; |
| 127 | − if (pdev) | |
| 128 | − zpci_remove_device(zdev); | |
| 124 | + zpci_remove_device(zdev, false); | |
| 129 | 125 | |
| 130 | 126 | ret = zpci_disable_device(zdev); |
| 131 | 127 | if (ret) |
| @@ -140,12 +136,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 8 unmodified lines | ||
| 140 | 136 | case 0x0304: /* Configured -> Standby|Reserved */ |
| 141 | 137 | if (!zdev) |
| 142 | 138 | break; |
| 143 | − if (pdev) { | |
| 144 | − /* Give the driver a hint that the function is | |
| 145 | − * already unusable. */ | |
| 146 | − pdev->error_state = pci_channel_io_perm_failure; | |
| 147 | − zpci_remove_device(zdev); | |
| 148 | − } | |
| 139 | + /* Give the driver a hint that the function is | |
| 140 | + * already unusable. | |
| 141 | + */ | |
| 142 | + zpci_remove_device(zdev, true); | |
| 149 | 143 | |
| 150 | 144 | zdev->fh = ccdf->fh; |
| 151 | 145 | zpci_disable_device(zdev); |
| @@ -3659,6 +3659,9 @@ static int intel_pmu_hw_config(struct perf_event *event) · 3658 unmodified lines | ||
| 3659 | 3659 | return ret; |
| 3660 | 3660 | |
| 3661 | 3661 | if (event->attr.precise_ip) { |
| 3662 | + if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT) | |
| 3663 | + return -EINVAL; | |
| 3664 | + | |
| 3662 | 3665 | if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { |
| 3663 | 3666 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; |
| 3664 | 3667 | if (!(event->attr.sample_type & |
| @@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d · 2009 unmodified lines | ||
| 2010 | 2010 | */ |
| 2011 | 2011 | if (!pebs_status && cpuc->pebs_enabled && |
| 2012 | 2012 | !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) |
| 2013 | − pebs_status = cpuc->pebs_enabled; | |
| 2013 | + pebs_status = p->status = cpuc->pebs_enabled; | |
| 2014 | 2014 | |
| 2015 | 2015 | bit = find_first_bit((unsigned long *)&pebs_status, |
| 2016 | 2016 | x86_pmu.max_pebs_events); |
| @@ -884,12 +884,29 @@ struct kvm_hv_syndbg { · 883 unmodified lines | ||
| 884 | 884 | u64 options; |
| 885 | 885 | }; |
| 886 | 886 | |
| 887 | +/* Current state of Hyper-V TSC page clocksource */ | |
| 888 | +enum hv_tsc_page_status { | |
| 889 | + /* TSC page was not set up or disabled */ | |
| 890 | + HV_TSC_PAGE_UNSET = 0, | |
| 891 | + /* TSC page MSR was written by the guest, update pending */ | |
| 892 | + HV_TSC_PAGE_GUEST_CHANGED, | |
| 893 | + /* TSC page MSR was written by KVM userspace, update pending */ | |
| 894 | + HV_TSC_PAGE_HOST_CHANGED, | |
| 895 | + /* TSC page was properly set up and is currently active */ | |
| 896 | + HV_TSC_PAGE_SET, | |
| 897 | + /* TSC page is currently being updated and therefore is inactive */ | |
| 898 | + HV_TSC_PAGE_UPDATING, | |
| 899 | + /* TSC page was set up with an inaccessible GPA */ | |
| 900 | + HV_TSC_PAGE_BROKEN, | |
| 901 | +}; | |
| 902 | + | |
| 887 | 903 | /* Hyper-V emulation context */ |
| 888 | 904 | struct kvm_hv { |
| 889 | 905 | struct mutex hv_lock; |
| 890 | 906 | u64 hv_guest_os_id; |
| 891 | 907 | u64 hv_hypercall; |
| 892 | 908 | u64 hv_tsc_page; |
| 909 | + enum hv_tsc_page_status hv_tsc_page_status; | |
| 893 | 910 | |
| 894 | 911 | /* Hyper-v based guest crash (NT kernel bugcheck) parameters */ |
| 895 | 912 | u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS]; |
| @@ -931,6 +948,12 @@ enum kvm_irqchip_mode { · 35 unmodified lines | ||
| 931 | 948 | KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */ |
| 932 | 949 | }; |
| 933 | 950 | |
| 951 | +struct kvm_x86_msr_filter { | |
| 952 | + u8 count; | |
| 953 | + bool default_allow:1; | |
| 954 | + struct msr_bitmap_range ranges[16]; | |
| 955 | +}; | |
| 956 | + | |
| 934 | 957 | #define APICV_INHIBIT_REASON_DISABLE 0 |
| 935 | 958 | #define APICV_INHIBIT_REASON_HYPERV 1 |
| 936 | 959 | #define APICV_INHIBIT_REASON_NESTED 2 |
| @@ -1025,16 +1048,11 @@ struct kvm_arch { · 88 unmodified lines | ||
| 1025 | 1048 | bool guest_can_read_msr_platform_info; |
| 1026 | 1049 | bool exception_payload_enabled; |
| 1027 | 1050 | |
| 1051 | + bool bus_lock_detection_enabled; | |
| 1052 | + | |
| 1028 | 1053 | /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */ |
| 1029 | 1054 | u32 user_space_msr_mask; |
| 1030 | − | |
| 1031 | − struct { | |
| 1032 | − u8 count; | |
| 1033 | − bool default_allow:1; | |
| 1034 | − struct msr_bitmap_range ranges[16]; | |
| 1035 | − } msr_filter; | |
| 1036 | − | |
| 1037 | − bool bus_lock_detection_enabled; | |
| 1055 | + struct kvm_x86_msr_filter __rcu *msr_filter; | |
| 1038 | 1056 | |
| 1039 | 1057 | struct kvm_pmu_event_filter __rcu *pmu_event_filter; |
| 1040 | 1058 | struct task_struct *nx_lpage_recovery_thread; |
| @@ -551,15 +551,6 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, · 550 unmodified lines | ||
| 551 | 551 | *size = fpu_kernel_xstate_size; |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | −/* | |
| 555 | − * Thread-synchronous status. | |
| 556 | − * | |
| 557 | − * This is different from the flags in that nobody else | |
| 558 | − * ever touches our thread-synchronous status, so we don't | |
| 559 | − * have to worry about atomic accesses. | |
| 560 | − */ | |
| 561 | −#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/ | |
| 562 | − | |
| 563 | 554 | static inline void |
| 564 | 555 | native_load_sp0(unsigned long sp0) |
| 565 | 556 | { |
| @@ -205,10 +205,23 @@ static inline int arch_within_stack_frames(const void * const stack, · 204 unmodified lines | ||
| 205 | 205 | |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | +/* | |
| 209 | + * Thread-synchronous status. | |
| 210 | + * | |
| 211 | + * This is different from the flags in that nobody else | |
| 212 | + * ever touches our thread-synchronous status, so we don't | |
| 213 | + * have to worry about atomic accesses. | |
| 214 | + */ | |
| 215 | +#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/ | |
| 216 | + | |
| 217 | +#ifndef __ASSEMBLY__ | |
| 208 | 218 | #ifdef CONFIG_COMPAT |
| 209 | 219 | #define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */ |
| 220 | + | |
| 221 | +#define arch_set_restart_data(restart) \ | |
| 222 | + do { restart->arch_data = current_thread_info()->status; } while (0) | |
| 223 | + | |
| 210 | 224 | #endif |
| 211 | −#ifndef __ASSEMBLY__ | |
| 212 | 225 | |
| 213 | 226 | #ifdef CONFIG_X86_32 |
| 214 | 227 | #define in_ia32_syscall() true |
| @@ -2342,6 +2342,11 @@ static int cpuid_to_apicid[] = { · 2341 unmodified lines | ||
| 2342 | 2342 | [0 ... NR_CPUS - 1] = -1, |
| 2343 | 2343 | }; |
| 2344 | 2344 | |
| 2345 | +bool arch_match_cpu_phys_id(int cpu, u64 phys_id) | |
| 2346 | +{ | |
| 2347 | + return phys_id == cpuid_to_apicid[cpu]; | |
| 2348 | +} | |
| 2349 | + | |
| 2345 | 2350 | #ifdef CONFIG_SMP |
| 2346 | 2351 | /** |
| 2347 | 2352 | * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread |
| @@ -1032,6 +1032,16 @@ static int mp_map_pin_to_irq(u32 gsi, int idx, int ioapic, int pin, · 1031 unmodified lines | ||
| 1032 | 1032 | if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) { |
| 1033 | 1033 | irq = mp_irqs[idx].srcbusirq; |
| 1034 | 1034 | legacy = mp_is_legacy_irq(irq); |
| 1035 | + /* | |
| 1036 | + * IRQ2 is unusable for historical reasons on systems which | |
| 1037 | + * have a legacy PIC. See the comment vs. IRQ2 further down. | |
| 1038 | + * | |
| 1039 | + * If this gets removed at some point then the related code | |
| 1040 | + * in lapic_assign_system_vectors() needs to be adjusted as | |
| 1041 | + * well. | |
| 1042 | + */ | |
| 1043 | + if (legacy && irq == PIC_CASCADE_IR) | |
| 1044 | + return -EINVAL; | |
| 1035 | 1045 | } |
| 1036 | 1046 | |
| 1037 | 1047 | mutex_lock(&ioapic_mutex); |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include "common.h" |
| 14 | 14 | |
| 15 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 15 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 16 | 16 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 17 | 17 | struct ftrace_ops *ops, struct ftrace_regs *fregs) |
| 18 | 18 | { |
| @@ -836,28 +836,25 @@ static void kvm_kick_cpu(int cpu) · 835 unmodified lines | ||
| 836 | 836 | |
| 837 | 837 | static void kvm_wait(u8 *ptr, u8 val) |
| 838 | 838 | { |
| 839 | − unsigned long flags; | |
| 840 | − | |
| 841 | 839 | if (in_nmi()) |
| 842 | 840 | return; |
| 843 | 841 | |
| 844 | − local_irq_save(flags); | |
| 845 | − | |
| 846 | − if (READ_ONCE(*ptr) != val) | |
| 847 | − goto out; | |
| 848 | − | |
| 849 | 842 | /* |
| 850 | 843 | * halt until it's our turn and kicked. Note that we do safe halt |
| 851 | 844 | * for irq enabled case to avoid hang when lock info is overwritten |
| 852 | 845 | * in irq spinlock slowpath and no spurious interrupt occur to save us. |
| 853 | 846 | */ |
| 854 | − if (arch_irqs_disabled_flags(flags)) | |
| 855 | − halt(); | |
| 856 | − else | |
| 857 | − safe_halt(); | |
| 847 | + if (irqs_disabled()) { | |
| 848 | + if (READ_ONCE(*ptr) == val) | |
| 849 | + halt(); | |
| 850 | + } else { | |
| 851 | + local_irq_disable(); | |
| 858 | 852 | |
| 859 | −out: | |
| 860 | − local_irq_restore(flags); | |
| 853 | + if (READ_ONCE(*ptr) == val) | |
| 854 | + safe_halt(); | |
| 855 | + | |
| 856 | + local_irq_enable(); | |
| 857 | + } | |
| 861 | 858 | } |
| 862 | 859 | |
| 863 | 860 | #ifdef CONFIG_X86_32 |
| @@ -766,30 +766,8 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 765 unmodified lines | ||
| 766 | 766 | |
| 767 | 767 | static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) |
| 768 | 768 | { |
| 769 | − /* | |
| 770 | − * This function is fundamentally broken as currently | |
| 771 | − * implemented. | |
| 772 | − * | |
| 773 | − * The idea is that we want to trigger a call to the | |
| 774 | − * restart_block() syscall and that we want in_ia32_syscall(), | |
| 775 | − * in_x32_syscall(), etc. to match whatever they were in the | |
| 776 | − * syscall being restarted. We assume that the syscall | |
| 777 | − * instruction at (regs->ip - 2) matches whatever syscall | |
| 778 | − * instruction we used to enter in the first place. | |
| 779 | − * | |
| 780 | − * The problem is that we can get here when ptrace pokes | |
| 781 | − * syscall-like values into regs even if we're not in a syscall | |
| 782 | − * at all. | |
| 783 | − * | |
| 784 | − * For now, we maintain historical behavior and guess based on | |
| 785 | − * stored state. We could do better by saving the actual | |
| 786 | − * syscall arch in restart_block or (with caveats on x32) by | |
| 787 | − * checking if regs->ip points to 'int $0x80'. The current | |
| 788 | − * behavior is incorrect if a tracer has a different bitness | |
| 789 | − * than the tracee. | |
| 790 | − */ | |
| 791 | 769 | #ifdef CONFIG_IA32_EMULATION |
| 792 | − if (current_thread_info()->status & (TS_COMPAT|TS_I386_REGS_POKED)) | |
| 770 | + if (current->restart_block.arch_data & TS_COMPAT) | |
| 793 | 771 | return __NR_ia32_restart_syscall; |
| 794 | 772 | #endif |
| 795 | 773 | #ifdef CONFIG_X86_X32_ABI |
| @@ -520,10 +520,10 @@ static u64 get_time_ref_counter(struct kvm *kvm) · 519 unmodified lines | ||
| 520 | 520 | u64 tsc; |
| 521 | 521 | |
| 522 | 522 | /* |
| 523 | − * The guest has not set up the TSC page or the clock isn't | |
| 524 | − * stable, fall back to get_kvmclock_ns. | |
| 523 | + * Fall back to get_kvmclock_ns() when TSC page hasn't been set up, | |
| 524 | + * is broken, disabled or being updated. | |
| 525 | 525 | */ |
| 526 | − if (!hv->tsc_ref.tsc_sequence) | |
| 526 | + if (hv->hv_tsc_page_status != HV_TSC_PAGE_SET) | |
| 527 | 527 | return div_u64(get_kvmclock_ns(kvm), 100); |
| 528 | 528 | |
| 529 | 529 | vcpu = kvm_get_vcpu(kvm, 0); |
| @@ -1077,6 +1077,21 @@ static bool compute_tsc_page_parameters(struct pvclock_vcpu_time_info *hv_clock, · 547 unmodified lines | ||
| 1077 | 1077 | return true; |
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | +/* | |
| 1081 | + * Don't touch TSC page values if the guest has opted for TSC emulation after | |
| 1082 | + * migration. KVM doesn't fully support reenlightenment notifications and TSC | |
| 1083 | + * access emulation and Hyper-V is known to expect the values in TSC page to | |
| 1084 | + * stay constant before TSC access emulation is disabled from guest side | |
| 1085 | + * (HV_X64_MSR_TSC_EMULATION_STATUS). KVM userspace is expected to preserve TSC | |
| 1086 | + * frequency and guest visible TSC value across migration (and prevent it when | |
| 1087 | + * TSC scaling is unsupported). | |
| 1088 | + */ | |
| 1089 | +static inline bool tsc_page_update_unsafe(struct kvm_hv *hv) | |
| 1090 | +{ | |
| 1091 | + return (hv->hv_tsc_page_status != HV_TSC_PAGE_GUEST_CHANGED) && | |
| 1092 | + hv->hv_tsc_emulation_control; | |
| 1093 | +} | |
| 1094 | + | |
| 1080 | 1095 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 1081 | 1096 | struct pvclock_vcpu_time_info *hv_clock) |
| 1082 | 1097 | { |
| @@ -1087,7 +1102,8 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 4 unmodified lines | ||
| 1087 | 1102 | BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence)); |
| 1088 | 1103 | BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0); |
| 1089 | 1104 | |
| 1090 | − if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE)) | |
| 1105 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN || | |
| 1106 | + hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET) | |
| 1091 | 1107 | return; |
| 1092 | 1108 | |
| 1093 | 1109 | mutex_lock(&hv->hv_lock); |
| @@ -1101,7 +1117,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 7 unmodified lines | ||
| 1101 | 1117 | */ |
| 1102 | 1118 | if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn), |
| 1103 | 1119 | &tsc_seq, sizeof(tsc_seq)))) |
| 1120 | + goto out_err; | |
| 1121 | + | |
| 1122 | + if (tsc_seq && tsc_page_update_unsafe(hv)) { | |
| 1123 | + if (kvm_read_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref))) | |
| 1124 | + goto out_err; | |
| 1125 | + | |
| 1126 | + hv->hv_tsc_page_status = HV_TSC_PAGE_SET; | |
| 1104 | 1127 | goto out_unlock; |
| 1128 | + } | |
| 1105 | 1129 | |
| 1106 | 1130 | /* |
| 1107 | 1131 | * While we're computing and writing the parameters, force the |
| @@ -1110,15 +1134,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 2 unmodified lines | ||
| 1110 | 1134 | hv->tsc_ref.tsc_sequence = 0; |
| 1111 | 1135 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), |
| 1112 | 1136 | &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) |
| 1113 | − goto out_unlock; | |
| 1137 | + goto out_err; | |
| 1114 | 1138 | |
| 1115 | 1139 | if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref)) |
| 1116 | − goto out_unlock; | |
| 1140 | + goto out_err; | |
| 1117 | 1141 | |
| 1118 | 1142 | /* Ensure sequence is zero before writing the rest of the struct. */ |
| 1119 | 1143 | smp_wmb(); |
| 1120 | 1144 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref))) |
| 1121 | − goto out_unlock; | |
| 1145 | + goto out_err; | |
| 1122 | 1146 | |
| 1123 | 1147 | /* |
| 1124 | 1148 | * Now switch to the TSC page mechanism by writing the sequence. |
| @@ -1131,8 +1155,45 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 6 unmodified lines | ||
| 1131 | 1155 | smp_wmb(); |
| 1132 | 1156 | |
| 1133 | 1157 | hv->tsc_ref.tsc_sequence = tsc_seq; |
| 1134 | − kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1135 | − &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)); | |
| 1158 | + if (kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1159 | + &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) | |
| 1160 | + goto out_err; | |
| 1161 | + | |
| 1162 | + hv->hv_tsc_page_status = HV_TSC_PAGE_SET; | |
| 1163 | + goto out_unlock; | |
| 1164 | + | |
| 1165 | +out_err: | |
| 1166 | + hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN; | |
| 1167 | +out_unlock: | |
| 1168 | + mutex_unlock(&hv->hv_lock); | |
| 1169 | +} | |
| 1170 | + | |
| 1171 | +void kvm_hv_invalidate_tsc_page(struct kvm *kvm) | |
| 1172 | +{ | |
| 1173 | + struct kvm_hv *hv = to_kvm_hv(kvm); | |
| 1174 | + u64 gfn; | |
| 1175 | + | |
| 1176 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN || | |
| 1177 | + hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET || | |
| 1178 | + tsc_page_update_unsafe(hv)) | |
| 1179 | + return; | |
| 1180 | + | |
| 1181 | + mutex_lock(&hv->hv_lock); | |
| 1182 | + | |
| 1183 | + if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE)) | |
| 1184 | + goto out_unlock; | |
| 1185 | + | |
| 1186 | + /* Preserve HV_TSC_PAGE_GUEST_CHANGED/HV_TSC_PAGE_HOST_CHANGED states */ | |
| 1187 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_SET) | |
| 1188 | + hv->hv_tsc_page_status = HV_TSC_PAGE_UPDATING; | |
| 1189 | + | |
| 1190 | + gfn = hv->hv_tsc_page >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT; | |
| 1191 | + | |
| 1192 | + hv->tsc_ref.tsc_sequence = 0; | |
| 1193 | + if (kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1194 | + &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) | |
| 1195 | + hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN; | |
| 1196 | + | |
| 1136 | 1197 | out_unlock: |
| 1137 | 1198 | mutex_unlock(&hv->hv_lock); |
| 1138 | 1199 | } |
| @@ -1193,8 +1254,15 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 54 unmodified lines | ||
| 1193 | 1254 | } |
| 1194 | 1255 | case HV_X64_MSR_REFERENCE_TSC: |
| 1195 | 1256 | hv->hv_tsc_page = data; |
| 1196 | − if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) | |
| 1257 | + if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) { | |
| 1258 | + if (!host) | |
| 1259 | + hv->hv_tsc_page_status = HV_TSC_PAGE_GUEST_CHANGED; | |
| 1260 | + else | |
| 1261 | + hv->hv_tsc_page_status = HV_TSC_PAGE_HOST_CHANGED; | |
| 1197 | 1262 | kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu); |
| 1263 | + } else { | |
| 1264 | + hv->hv_tsc_page_status = HV_TSC_PAGE_UNSET; | |
| 1265 | + } | |
| 1198 | 1266 | break; |
| 1199 | 1267 | case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4: |
| 1200 | 1268 | return kvm_hv_msr_set_crash_data(kvm, |
| @@ -1229,6 +1297,9 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 28 unmodified lines | ||
| 1229 | 1297 | hv->hv_tsc_emulation_control = data; |
| 1230 | 1298 | break; |
| 1231 | 1299 | case HV_X64_MSR_TSC_EMULATION_STATUS: |
| 1300 | + if (data && !host) | |
| 1301 | + return 1; | |
| 1302 | + | |
| 1232 | 1303 | hv->hv_tsc_emulation_status = data; |
| 1233 | 1304 | break; |
| 1234 | 1305 | case HV_X64_MSR_TIME_REF_COUNT: |
| @@ -133,6 +133,7 @@ void kvm_hv_process_stimers(struct kvm_vcpu *vcpu); · 132 unmodified lines | ||
| 133 | 133 | |
| 134 | 134 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 135 | 135 | struct pvclock_vcpu_time_info *hv_clock); |
| 136 | +void kvm_hv_invalidate_tsc_page(struct kvm *kvm); | |
| 136 | 137 | |
| 137 | 138 | void kvm_hv_init_vm(struct kvm *kvm); |
| 138 | 139 | void kvm_hv_destroy_vm(struct kvm *kvm); |
| @@ -78,6 +78,11 @@ static inline struct kvm_mmu_page *sptep_to_sp(u64 *sptep) · 77 unmodified lines | ||
| 78 | 78 | return to_shadow_page(__pa(sptep)); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | +static inline int kvm_mmu_page_as_id(struct kvm_mmu_page *sp) | |
| 82 | +{ | |
| 83 | + return sp->role.smm ? 1 : 0; | |
| 84 | +} | |
| 85 | + | |
| 81 | 86 | static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu) |
| 82 | 87 | { |
| 83 | 88 | /* |
| @@ -20,6 +20,21 @@ static gfn_t round_gfn_for_level(gfn_t gfn, int level) · 19 unmodified lines | ||
| 20 | 20 | return gfn & -KVM_PAGES_PER_HPAGE(level); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | +/* | |
| 24 | + * Return the TDP iterator to the root PT and allow it to continue its | |
| 25 | + * traversal over the paging structure from there. | |
| 26 | + */ | |
| 27 | +void tdp_iter_restart(struct tdp_iter *iter) | |
| 28 | +{ | |
| 29 | + iter->yielded_gfn = iter->next_last_level_gfn; | |
| 30 | + iter->level = iter->root_level; | |
| 31 | + | |
| 32 | + iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level); | |
| 33 | + tdp_iter_refresh_sptep(iter); | |
| 34 | + | |
| 35 | + iter->valid = true; | |
| 36 | +} | |
| 37 | + | |
| 23 | 38 | /* |
| 24 | 39 | * Sets a TDP iterator to walk a pre-order traversal of the paging structure |
| 25 | 40 | * rooted at root_pt, starting with the walk to translate next_last_level_gfn. |
| @@ -31,16 +46,12 @@ void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, · 5 unmodified lines | ||
| 31 | 46 | WARN_ON(root_level > PT64_ROOT_MAX_LEVEL); |
| 32 | 47 | |
| 33 | 48 | iter->next_last_level_gfn = next_last_level_gfn; |
| 34 | − iter->yielded_gfn = iter->next_last_level_gfn; | |
| 35 | 49 | iter->root_level = root_level; |
| 36 | 50 | iter->min_level = min_level; |
| 37 | − iter->level = root_level; | |
| 38 | − iter->pt_path[iter->level - 1] = (tdp_ptep_t)root_pt; | |
| 39 | − | |
| 40 | − iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level); | |
| 41 | − tdp_iter_refresh_sptep(iter); | |
| 51 | + iter->pt_path[iter->root_level - 1] = (tdp_ptep_t)root_pt; | |
| 52 | + iter->as_id = kvm_mmu_page_as_id(sptep_to_sp(root_pt)); | |
| 42 | 53 | |
| 43 | − iter->valid = true; | |
| 54 | + tdp_iter_restart(iter); | |
| 44 | 55 | } |
| 45 | 56 | |
| 46 | 57 | /* |
| @@ -159,8 +170,3 @@ void tdp_iter_next(struct tdp_iter *iter) · 112 unmodified lines | ||
| 159 | 170 | iter->valid = false; |
| 160 | 171 | } |
| 161 | 172 | |
| 162 | −tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter) | |
| 163 | −{ | |
| 164 | − return iter->pt_path[iter->root_level - 1]; | |
| 165 | −} | |
| 166 | − | |
| @@ -36,6 +36,8 @@ struct tdp_iter { · 35 unmodified lines | ||
| 36 | 36 | int min_level; |
| 37 | 37 | /* The iterator's current level within the paging structure */ |
| 38 | 38 | int level; |
| 39 | + /* The address space ID, i.e. SMM vs. regular. */ | |
| 40 | + int as_id; | |
| 39 | 41 | /* A snapshot of the value at sptep */ |
| 40 | 42 | u64 old_spte; |
| 41 | 43 | /* |
| @@ -62,6 +64,6 @@ tdp_ptep_t spte_to_child_pt(u64 pte, int level); · 20 unmodified lines | ||
| 62 | 64 | void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, |
| 63 | 65 | int min_level, gfn_t next_last_level_gfn); |
| 64 | 66 | void tdp_iter_next(struct tdp_iter *iter); |
| 65 | −tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter); | |
| 67 | +void tdp_iter_restart(struct tdp_iter *iter); | |
| 66 | 68 | |
| 67 | 69 | #endif /* __KVM_X86_MMU_TDP_ITER_H */ |
| @@ -203,11 +203,6 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, · 202 unmodified lines | ||
| 203 | 203 | u64 old_spte, u64 new_spte, int level, |
| 204 | 204 | bool shared); |
| 205 | 205 | |
| 206 | −static int kvm_mmu_page_as_id(struct kvm_mmu_page *sp) | |
| 207 | −{ | |
| 208 | − return sp->role.smm ? 1 : 0; | |
| 209 | −} | |
| 210 | − | |
| 211 | 206 | static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level) |
| 212 | 207 | { |
| 213 | 208 | bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte); |
| @@ -301,11 +296,16 @@ static void tdp_mmu_unlink_page(struct kvm *kvm, struct kvm_mmu_page *sp, · 87 unmodified lines | ||
| 301 | 296 | * |
| 302 | 297 | * Given a page table that has been removed from the TDP paging structure, |
| 303 | 298 | * iterates through the page table to clear SPTEs and free child page tables. |
| 299 | + * | |
| 300 | + * Note that pt is passed in as a tdp_ptep_t, but it does not need RCU | |
| 301 | + * protection. Since this thread removed it from the paging structure, | |
| 302 | + * this thread will be responsible for ensuring the page is freed. Hence the | |
| 303 | + * early rcu_dereferences in the function. | |
| 304 | 304 | */ |
| 305 | −static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, | |
| 305 | +static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, | |
| 306 | 306 | bool shared) |
| 307 | 307 | { |
| 308 | − struct kvm_mmu_page *sp = sptep_to_sp(pt); | |
| 308 | + struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt)); | |
| 309 | 309 | int level = sp->role.level; |
| 310 | 310 | gfn_t base_gfn = sp->gfn; |
| 311 | 311 | u64 old_child_spte; |
| @@ -318,7 +318,7 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 6 unmodified lines | ||
| 318 | 318 | tdp_mmu_unlink_page(kvm, sp, shared); |
| 319 | 319 | |
| 320 | 320 | for (i = 0; i < PT64_ENT_PER_PAGE; i++) { |
| 321 | − sptep = pt + i; | |
| 321 | + sptep = rcu_dereference(pt) + i; | |
| 322 | 322 | gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1)); |
| 323 | 323 | |
| 324 | 324 | if (shared) { |
| @@ -492,10 +492,6 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 167 unmodified lines | ||
| 492 | 492 | struct tdp_iter *iter, |
| 493 | 493 | u64 new_spte) |
| 494 | 494 | { |
| 495 | − u64 *root_pt = tdp_iter_root_pt(iter); | |
| 496 | − struct kvm_mmu_page *root = sptep_to_sp(root_pt); | |
| 497 | − int as_id = kvm_mmu_page_as_id(root); | |
| 498 | − | |
| 499 | 495 | lockdep_assert_held_read(&kvm->mmu_lock); |
| 500 | 496 | |
| 501 | 497 | /* |
| @@ -509,8 +505,8 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 7 unmodified lines | ||
| 509 | 505 | new_spte) != iter->old_spte) |
| 510 | 506 | return false; |
| 511 | 507 | |
| 512 | − handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte, | |
| 513 | − iter->level, true); | |
| 508 | + handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, | |
| 509 | + new_spte, iter->level, true); | |
| 514 | 510 | |
| 515 | 511 | return true; |
| 516 | 512 | } |
| @@ -538,7 +534,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm, · 21 unmodified lines | ||
| 538 | 534 | * here since the SPTE is going from non-present |
| 539 | 535 | * to non-present. |
| 540 | 536 | */ |
| 541 | − WRITE_ONCE(*iter->sptep, 0); | |
| 537 | + WRITE_ONCE(*rcu_dereference(iter->sptep), 0); | |
| 542 | 538 | |
| 543 | 539 | return true; |
| 544 | 540 | } |
| @@ -564,10 +560,6 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 19 unmodified lines | ||
| 564 | 560 | u64 new_spte, bool record_acc_track, |
| 565 | 561 | bool record_dirty_log) |
| 566 | 562 | { |
| 567 | − tdp_ptep_t root_pt = tdp_iter_root_pt(iter); | |
| 568 | − struct kvm_mmu_page *root = sptep_to_sp(root_pt); | |
| 569 | − int as_id = kvm_mmu_page_as_id(root); | |
| 570 | − | |
| 571 | 563 | lockdep_assert_held_write(&kvm->mmu_lock); |
| 572 | 564 | |
| 573 | 565 | /* |
| @@ -581,13 +573,13 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 7 unmodified lines | ||
| 581 | 573 | |
| 582 | 574 | WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte); |
| 583 | 575 | |
| 584 | − __handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte, | |
| 585 | − iter->level, false); | |
| 576 | + __handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, | |
| 577 | + new_spte, iter->level, false); | |
| 586 | 578 | if (record_acc_track) |
| 587 | 579 | handle_changed_spte_acc_track(iter->old_spte, new_spte, |
| 588 | 580 | iter->level); |
| 589 | 581 | if (record_dirty_log) |
| 590 | − handle_changed_spte_dirty_log(kvm, as_id, iter->gfn, | |
| 582 | + handle_changed_spte_dirty_log(kvm, iter->as_id, iter->gfn, | |
| 591 | 583 | iter->old_spte, new_spte, |
| 592 | 584 | iter->level); |
| 593 | 585 | } |
| @@ -659,9 +651,7 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 65 unmodified lines | ||
| 659 | 651 | |
| 660 | 652 | WARN_ON(iter->gfn > iter->next_last_level_gfn); |
| 661 | 653 | |
| 662 | − tdp_iter_start(iter, iter->pt_path[iter->root_level - 1], | |
| 663 | − iter->root_level, iter->min_level, | |
| 664 | − iter->next_last_level_gfn); | |
| 654 | + tdp_iter_restart(iter); | |
| 665 | 655 | |
| 666 | 656 | return true; |
| 667 | 657 | } |
| @@ -1526,35 +1526,44 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); · 1525 unmodified lines | ||
| 1526 | 1526 | |
| 1527 | 1527 | bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type) |
| 1528 | 1528 | { |
| 1529 | + struct kvm_x86_msr_filter *msr_filter; | |
| 1530 | + struct msr_bitmap_range *ranges; | |
| 1529 | 1531 | struct kvm *kvm = vcpu->kvm; |
| 1530 | − struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges; | |
| 1531 | − u32 count = kvm->arch.msr_filter.count; | |
| 1532 | − u32 i; | |
| 1533 | − bool r = kvm->arch.msr_filter.default_allow; | |
| 1532 | + bool allowed; | |
| 1534 | 1533 | int idx; |
| 1534 | + u32 i; | |
| 1535 | 1535 | |
| 1536 | − /* MSR filtering not set up or x2APIC enabled, allow everything */ | |
| 1537 | − if (!count || (index >= 0x800 && index <= 0x8ff)) | |
| 1536 | + /* x2APIC MSRs do not support filtering. */ | |
| 1537 | + if (index >= 0x800 && index <= 0x8ff) | |
| 1538 | 1538 | return true; |
| 1539 | 1539 | |
| 1540 | − /* Prevent collision with set_msr_filter */ | |
| 1541 | 1540 | idx = srcu_read_lock(&kvm->srcu); |
| 1542 | 1541 | |
| 1543 | − for (i = 0; i < count; i++) { | |
| 1542 | + msr_filter = srcu_dereference(kvm->arch.msr_filter, &kvm->srcu); | |
| 1543 | + if (!msr_filter) { | |
| 1544 | + allowed = true; | |
| 1545 | + goto out; | |
| 1546 | + } | |
| 1547 | + | |
| 1548 | + allowed = msr_filter->default_allow; | |
| 1549 | + ranges = msr_filter->ranges; | |
| 1550 | + | |
| 1551 | + for (i = 0; i < msr_filter->count; i++) { | |
| 1544 | 1552 | u32 start = ranges[i].base; |
| 1545 | 1553 | u32 end = start + ranges[i].nmsrs; |
| 1546 | 1554 | u32 flags = ranges[i].flags; |
| 1547 | 1555 | unsigned long *bitmap = ranges[i].bitmap; |
| 1548 | 1556 | |
| 1549 | 1557 | if ((index >= start) && (index < end) && (flags & type)) { |
| 1550 | − r = !!test_bit(index - start, bitmap); | |
| 1558 | + allowed = !!test_bit(index - start, bitmap); | |
| 1551 | 1559 | break; |
| 1552 | 1560 | } |
| 1553 | 1561 | } |
| 1554 | 1562 | |
| 1563 | +out: | |
| 1555 | 1564 | srcu_read_unlock(&kvm->srcu, idx); |
| 1556 | 1565 | |
| 1557 | − return r; | |
| 1566 | + return allowed; | |
| 1558 | 1567 | } |
| 1559 | 1568 | EXPORT_SYMBOL_GPL(kvm_msr_allowed); |
| 1560 | 1569 | |
| @@ -2551,6 +2560,8 @@ static void kvm_gen_update_masterclock(struct kvm *kvm) · 990 unmodified lines | ||
| 2551 | 2560 | struct kvm_vcpu *vcpu; |
| 2552 | 2561 | struct kvm_arch *ka = &kvm->arch; |
| 2553 | 2562 | |
| 2563 | + kvm_hv_invalidate_tsc_page(kvm); | |
| 2564 | + | |
| 2554 | 2565 | spin_lock(&ka->pvclock_gtod_sync_lock); |
| 2555 | 2566 | kvm_make_mclock_inprogress_request(kvm); |
| 2556 | 2567 | /* no guest entries from this point */ |
| @@ -5352,25 +5363,34 @@ split_irqchip_unlock: · 2795 unmodified lines | ||
| 5352 | 5363 | return r; |
| 5353 | 5364 | } |
| 5354 | 5365 | |
| 5355 | −static void kvm_clear_msr_filter(struct kvm *kvm) | |
| 5366 | +static struct kvm_x86_msr_filter *kvm_alloc_msr_filter(bool default_allow) | |
| 5367 | +{ | |
| 5368 | + struct kvm_x86_msr_filter *msr_filter; | |
| 5369 | + | |
| 5370 | + msr_filter = kzalloc(sizeof(*msr_filter), GFP_KERNEL_ACCOUNT); | |
| 5371 | + if (!msr_filter) | |
| 5372 | + return NULL; | |
| 5373 | + | |
| 5374 | + msr_filter->default_allow = default_allow; | |
| 5375 | + return msr_filter; | |
| 5376 | +} | |
| 5377 | + | |
| 5378 | +static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter) | |
| 5356 | 5379 | { |
| 5357 | 5380 | u32 i; |
| 5358 | − u32 count = kvm->arch.msr_filter.count; | |
| 5359 | − struct msr_bitmap_range ranges[16]; | |
| 5360 | 5381 | |
| 5361 | − mutex_lock(&kvm->lock); | |
| 5362 | − kvm->arch.msr_filter.count = 0; | |
| 5363 | − memcpy(ranges, kvm->arch.msr_filter.ranges, count * sizeof(ranges[0])); | |
| 5364 | − mutex_unlock(&kvm->lock); | |
| 5365 | − synchronize_srcu(&kvm->srcu); | |
| 5382 | + if (!msr_filter) | |
| 5383 | + return; | |
| 5366 | 5384 | |
| 5367 | − for (i = 0; i < count; i++) | |
| 5368 | − kfree(ranges[i].bitmap); | |
| 5385 | + for (i = 0; i < msr_filter->count; i++) | |
| 5386 | + kfree(msr_filter->ranges[i].bitmap); | |
| 5387 | + | |
| 5388 | + kfree(msr_filter); | |
| 5369 | 5389 | } |
| 5370 | 5390 | |
| 5371 | −static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user_range) | |
| 5391 | +static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter, | |
| 5392 | + struct kvm_msr_filter_range *user_range) | |
| 5372 | 5393 | { |
| 5373 | − struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges; | |
| 5374 | 5394 | struct msr_bitmap_range range; |
| 5375 | 5395 | unsigned long *bitmap = NULL; |
| 5376 | 5396 | size_t bitmap_size; |
| @@ -5404,11 +5424,9 @@ static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user · 27 unmodified lines | ||
| 5404 | 5424 | goto err; |
| 5405 | 5425 | } |
| 5406 | 5426 | |
| 5407 | − /* Everything ok, add this range identifier to our global pool */ | |
| 5408 | − ranges[kvm->arch.msr_filter.count] = range; | |
| 5409 | − /* Make sure we filled the array before we tell anyone to walk it */ | |
| 5410 | − smp_wmb(); | |
| 5411 | − kvm->arch.msr_filter.count++; | |
| 5427 | + /* Everything ok, add this range identifier. */ | |
| 5428 | + msr_filter->ranges[msr_filter->count] = range; | |
| 5429 | + msr_filter->count++; | |
| 5412 | 5430 | |
| 5413 | 5431 | return 0; |
| 5414 | 5432 | err: |
| @@ -5419,10 +5437,11 @@ err: · 4 unmodified lines | ||
| 5419 | 5437 | static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) |
| 5420 | 5438 | { |
| 5421 | 5439 | struct kvm_msr_filter __user *user_msr_filter = argp; |
| 5440 | + struct kvm_x86_msr_filter *new_filter, *old_filter; | |
| 5422 | 5441 | struct kvm_msr_filter filter; |
| 5423 | 5442 | bool default_allow; |
| 5424 | − int r = 0; | |
| 5425 | 5443 | bool empty = true; |
| 5444 | + int r = 0; | |
| 5426 | 5445 | u32 i; |
| 5427 | 5446 | |
| 5428 | 5447 | if (copy_from_user(&filter, user_msr_filter, sizeof(filter))) |
| @@ -5435,25 +5454,32 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) · 6 unmodified lines | ||
| 5435 | 5454 | if (empty && !default_allow) |
| 5436 | 5455 | return -EINVAL; |
| 5437 | 5456 | |
| 5438 | − kvm_clear_msr_filter(kvm); | |
| 5439 | − | |
| 5440 | − kvm->arch.msr_filter.default_allow = default_allow; | |
| 5457 | + new_filter = kvm_alloc_msr_filter(default_allow); | |
| 5458 | + if (!new_filter) | |
| 5459 | + return -ENOMEM; | |
| 5441 | 5460 | |
| 5442 | − /* | |
| 5443 | − * Protect from concurrent calls to this function that could trigger | |
| 5444 | − * a TOCTOU violation on kvm->arch.msr_filter.count. | |
| 5445 | − */ | |
| 5446 | − mutex_lock(&kvm->lock); | |
| 5447 | 5461 | for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) { |
| 5448 | − r = kvm_add_msr_filter(kvm, &filter.ranges[i]); | |
| 5449 | − if (r) | |
| 5450 | − break; | |
| 5462 | + r = kvm_add_msr_filter(new_filter, &filter.ranges[i]); | |
| 5463 | + if (r) { | |
| 5464 | + kvm_free_msr_filter(new_filter); | |
| 5465 | + return r; | |
| 5466 | + } | |
| 5451 | 5467 | } |
| 5452 | 5468 | |
| 5469 | + mutex_lock(&kvm->lock); | |
| 5470 | + | |
| 5471 | + /* The per-VM filter is protected by kvm->lock... */ | |
| 5472 | + old_filter = srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1); | |
| 5473 | + | |
| 5474 | + rcu_assign_pointer(kvm->arch.msr_filter, new_filter); | |
| 5475 | + synchronize_srcu(&kvm->srcu); | |
| 5476 | + | |
| 5477 | + kvm_free_msr_filter(old_filter); | |
| 5478 | + | |
| 5453 | 5479 | kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED); |
| 5454 | 5480 | mutex_unlock(&kvm->lock); |
| 5455 | 5481 | |
| 5456 | − return r; | |
| 5482 | + return 0; | |
| 5457 | 5483 | } |
| 5458 | 5484 | |
| 5459 | 5485 | long kvm_arch_vm_ioctl(struct file *filp, |
| @@ -6603,7 +6629,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) · 1143 unmodified lines | ||
| 6603 | 6629 | int cpu = get_cpu(); |
| 6604 | 6630 | |
| 6605 | 6631 | cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); |
| 6606 | − smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, | |
| 6632 | + on_each_cpu_mask(vcpu->arch.wbinvd_dirty_mask, | |
| 6607 | 6633 | wbinvd_ipi, NULL, 1); |
| 6608 | 6634 | put_cpu(); |
| 6609 | 6635 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); |
| @@ -10634,8 +10660,6 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm) · 4024 unmodified lines | ||
| 10634 | 10660 | |
| 10635 | 10661 | void kvm_arch_destroy_vm(struct kvm *kvm) |
| 10636 | 10662 | { |
| 10637 | − u32 i; | |
| 10638 | − | |
| 10639 | 10663 | if (current->mm == kvm->mm) { |
| 10640 | 10664 | /* |
| 10641 | 10665 | * Free memory regions allocated on behalf of userspace, |
| @@ -10651,8 +10675,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 9 unmodified lines | ||
| 10651 | 10675 | mutex_unlock(&kvm->slots_lock); |
| 10652 | 10676 | } |
| 10653 | 10677 | static_call_cond(kvm_x86_vm_destroy)(kvm); |
| 10654 | − for (i = 0; i < kvm->arch.msr_filter.count; i++) | |
| 10655 | − kfree(kvm->arch.msr_filter.ranges[i].bitmap); | |
| 10678 | + kvm_free_msr_filter(srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1)); | |
| 10656 | 10679 | kvm_pic_destroy(kvm); |
| 10657 | 10680 | kvm_ioapic_destroy(kvm); |
| 10658 | 10681 | kvm_free_vcpus(kvm); |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | 28 | MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>"); |
| 29 | 29 | MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille"); |
| 30 | −MODULE_SUPPORTED_DEVICE("Eurobraille/Iris"); | |
| 31 | 30 | |
| 32 | 31 | static bool force; |
| 33 | 32 | |
| @@ -100,8 +100,6 @@ static LIST_HEAD(fore200e_boards); · 99 unmodified lines | ||
| 100 | 100 | |
| 101 | 101 | MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen"); |
| 102 | 102 | MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION); |
| 103 | −MODULE_SUPPORTED_DEVICE("PCA-200E, SBA-200E"); | |
| 104 | − | |
| 105 | 103 | |
| 106 | 104 | static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = { |
| 107 | 105 | { BUFFER_S1_NBR, BUFFER_L1_NBR }, |
| @@ -325,22 +325,22 @@ static void rpm_put_suppliers(struct device *dev) · 324 unmodified lines | ||
| 325 | 325 | static int __rpm_callback(int (*cb)(struct device *), struct device *dev) |
| 326 | 326 | __releases(&dev->power.lock) __acquires(&dev->power.lock) |
| 327 | 327 | { |
| 328 | − bool use_links = dev->power.links_count > 0; | |
| 329 | − bool get = false; | |
| 330 | 328 | int retval, idx; |
| 331 | − bool put; | |
| 329 | + bool use_links = dev->power.links_count > 0; | |
| 332 | 330 | |
| 333 | 331 | if (dev->power.irq_safe) { |
| 334 | 332 | spin_unlock(&dev->power.lock); |
| 335 | − } else if (!use_links) { | |
| 336 | − spin_unlock_irq(&dev->power.lock); | |
| 337 | 333 | } else { |
| 338 | − get = dev->power.runtime_status == RPM_RESUMING; | |
| 339 | − | |
| 340 | 334 | spin_unlock_irq(&dev->power.lock); |
| 341 | 335 | |
| 342 | − /* Resume suppliers if necessary. */ | |
| 343 | − if (get) { | |
| 336 | + /* | |
| 337 | + * Resume suppliers if necessary. | |
| 338 | + * | |
| 339 | + * The device's runtime PM status cannot change until this | |
| 340 | + * routine returns, so it is safe to read the status outside of | |
| 341 | + * the lock. | |
| 342 | + */ | |
| 343 | + if (use_links && dev->power.runtime_status == RPM_RESUMING) { | |
| 344 | 344 | idx = device_links_read_lock(); |
| 345 | 345 | |
| 346 | 346 | retval = rpm_get_suppliers(dev); |
| @@ -355,36 +355,24 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) · 8 unmodified lines | ||
| 355 | 355 | |
| 356 | 356 | if (dev->power.irq_safe) { |
| 357 | 357 | spin_lock(&dev->power.lock); |
| 358 | − return retval; | |
| 359 | − } | |
| 360 | − | |
| 361 | − spin_lock_irq(&dev->power.lock); | |
| 362 | − | |
| 363 | − if (!use_links) | |
| 364 | − return retval; | |
| 365 | − | |
| 366 | − /* | |
| 367 | − * If the device is suspending and the callback has returned success, | |
| 368 | − * drop the usage counters of the suppliers that have been reference | |
| 369 | − * counted on its resume. | |
| 370 | − * | |
| 371 | − * Do that if the resume fails too. | |
| 372 | − */ | |
| 373 | − put = dev->power.runtime_status == RPM_SUSPENDING && !retval; | |
| 374 | − if (put) | |
| 375 | − __update_runtime_status(dev, RPM_SUSPENDED); | |
| 376 | − else | |
| 377 | − put = get && retval; | |
| 378 | − | |
| 379 | − if (put) { | |
| 380 | − spin_unlock_irq(&dev->power.lock); | |
| 381 | − | |
| 382 | − idx = device_links_read_lock(); | |
| 358 | + } else { | |
| 359 | + /* | |
| 360 | + * If the device is suspending and the callback has returned | |
| 361 | + * success, drop the usage counters of the suppliers that have | |
| 362 | + * been reference counted on its resume. | |
| 363 | + * | |
| 364 | + * Do that if resume fails too. | |
| 365 | + */ | |
| 366 | + if (use_links | |
| 367 | + && ((dev->power.runtime_status == RPM_SUSPENDING && !retval) | |
| 368 | + || (dev->power.runtime_status == RPM_RESUMING && retval))) { | |
| 369 | + idx = device_links_read_lock(); | |
| 383 | 370 | |
| 384 | −fail: | |
| 385 | − rpm_put_suppliers(dev); | |
| 371 | + fail: | |
| 372 | + rpm_put_suppliers(dev); | |
| 386 | 373 | |
| 387 | − device_links_read_unlock(idx); | |
| 374 | + device_links_read_unlock(idx); | |
| 375 | + } | |
| 388 | 376 | |
| 389 | 377 | spin_lock_irq(&dev->power.lock); |
| 390 | 378 | } |
| @@ -5091,7 +5091,6 @@ module_param(floppy, charp, 0); · 5090 unmodified lines | ||
| 5091 | 5091 | module_param(FLOPPY_IRQ, int, 0); |
| 5092 | 5092 | module_param(FLOPPY_DMA, int, 0); |
| 5093 | 5093 | MODULE_AUTHOR("Alain L. Knaff"); |
| 5094 | −MODULE_SUPPORTED_DEVICE("fd"); | |
| 5095 | 5094 | MODULE_LICENSE("GPL"); |
| 5096 | 5095 | |
| 5097 | 5096 | /* This doesn't actually get used other than for module information */ |
| @@ -194,5 +194,4 @@ module_init(rsi_91x_bt_module_init); · 193 unmodified lines | ||
| 194 | 194 | module_exit(rsi_91x_bt_module_exit); |
| 195 | 195 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 196 | 196 | MODULE_DESCRIPTION("RSI BT driver"); |
| 197 | −MODULE_SUPPORTED_DEVICE("RSI-BT"); | |
| 198 | 197 | MODULE_LICENSE("Dual BSD/GPL"); |
| @@ -81,9 +81,6 @@ MODULE_DESCRIPTION("Driver for Applicom Profibus card"); · 80 unmodified lines | ||
| 81 | 81 | MODULE_LICENSE("GPL"); |
| 82 | 82 | MODULE_ALIAS_MISCDEV(AC_MINOR); |
| 83 | 83 | |
| 84 | −MODULE_SUPPORTED_DEVICE("ac"); | |
| 85 | − | |
| 86 | − | |
| 87 | 84 | static struct applicom_board { |
| 88 | 85 | unsigned long PhysIO; |
| 89 | 86 | void __iomem *RamIO; |
| @@ -64,7 +64,6 @@ · 63 unmodified lines | ||
| 64 | 64 | MODULE_LICENSE("GPL"); |
| 65 | 65 | MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); |
| 66 | 66 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); |
| 67 | −MODULE_SUPPORTED_DEVICE("toshiba"); | |
| 68 | 67 | |
| 69 | 68 | static DEFINE_MUTEX(tosh_mutex); |
| 70 | 69 | static int tosh_fn; |
| @@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines | ||
| 31 | 31 | struct counter_device counter; |
| 32 | 32 | struct regmap *regmap; |
| 33 | 33 | struct clk *clk; |
| 34 | − u32 ceiling; | |
| 34 | + u32 max_arr; | |
| 35 | 35 | bool enabled; |
| 36 | 36 | struct stm32_timer_regs bak; |
| 37 | 37 | }; |
| @@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines | ||
| 44 | 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges |
| 45 | 45 | */ |
| 46 | 46 | enum stm32_count_function { |
| 47 | − STM32_COUNT_SLAVE_MODE_DISABLED = -1, | |
| 47 | + STM32_COUNT_SLAVE_MODE_DISABLED, | |
| 48 | 48 | STM32_COUNT_ENCODER_MODE_1, |
| 49 | 49 | STM32_COUNT_ENCODER_MODE_2, |
| 50 | 50 | STM32_COUNT_ENCODER_MODE_3, |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | 53 | static enum counter_count_function stm32_count_functions[] = { |
| 54 | + [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE, | |
| 54 | 55 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, |
| 55 | 56 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, |
| 56 | 57 | [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, |
| @@ -73,8 +74,10 @@ static int stm32_count_write(struct counter_device *counter, · 16 unmodified lines | ||
| 73 | 74 | const unsigned long val) |
| 74 | 75 | { |
| 75 | 76 | struct stm32_timer_cnt *const priv = counter->priv; |
| 77 | + u32 ceiling; | |
| 76 | 78 | |
| 77 | − if (val > priv->ceiling) | |
| 79 | + regmap_read(priv->regmap, TIM_ARR, &ceiling); | |
| 80 | + if (val > ceiling) | |
| 78 | 81 | return -EINVAL; |
| 79 | 82 | |
| 80 | 83 | return regmap_write(priv->regmap, TIM_CNT, val); |
| @@ -90,6 +93,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 9 unmodified lines | ||
| 90 | 93 | regmap_read(priv->regmap, TIM_SMCR, &smcr); |
| 91 | 94 | |
| 92 | 95 | switch (smcr & TIM_SMCR_SMS) { |
| 96 | + case 0: | |
| 97 | + *function = STM32_COUNT_SLAVE_MODE_DISABLED; | |
| 98 | + return 0; | |
| 93 | 99 | case 1: |
| 94 | 100 | *function = STM32_COUNT_ENCODER_MODE_1; |
| 95 | 101 | return 0; |
| @@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines | ||
| 99 | 105 | case 3: |
| 100 | 106 | *function = STM32_COUNT_ENCODER_MODE_3; |
| 101 | 107 | return 0; |
| 108 | + default: | |
| 109 | + return -EINVAL; | |
| 102 | 110 | } |
| 103 | − | |
| 104 | − return -EINVAL; | |
| 105 | 111 | } |
| 106 | 112 | |
| 107 | 113 | static int stm32_count_function_set(struct counter_device *counter, |
| @@ -112,6 +118,9 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | ||
| 112 | 118 | u32 cr1, sms; |
| 113 | 119 | |
| 114 | 120 | switch (function) { |
| 121 | + case STM32_COUNT_SLAVE_MODE_DISABLED: | |
| 122 | + sms = 0; | |
| 123 | + break; | |
| 115 | 124 | case STM32_COUNT_ENCODER_MODE_1: |
| 116 | 125 | sms = 1; |
| 117 | 126 | break; |
| @@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | ||
| 122 | 131 | sms = 3; |
| 123 | 132 | break; |
| 124 | 133 | default: |
| 125 | − sms = 0; | |
| 126 | − break; | |
| 134 | + return -EINVAL; | |
| 127 | 135 | } |
| 128 | 136 | |
| 129 | 137 | /* Store enable status */ |
| @@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line | ||
| 131 | 139 | |
| 132 | 140 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); |
| 133 | 141 | |
| 134 | − /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ | |
| 135 | − regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); | |
| 136 | − regmap_write(priv->regmap, TIM_ARR, priv->ceiling); | |
| 137 | − | |
| 138 | 142 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); |
| 139 | 143 | |
| 140 | 144 | /* Make sure that registers are updated */ |
| @@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines | ||
| 185 | 189 | if (ret) |
| 186 | 190 | return ret; |
| 187 | 191 | |
| 192 | + if (ceiling > priv->max_arr) | |
| 193 | + return -ERANGE; | |
| 194 | + | |
| 188 | 195 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ |
| 189 | 196 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); |
| 190 | 197 | regmap_write(priv->regmap, TIM_ARR, ceiling); |
| 191 | 198 | |
| 192 | − priv->ceiling = ceiling; | |
| 193 | 199 | return len; |
| 194 | 200 | } |
| 195 | 201 | |
| @@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines | ||
| 274 | 280 | size_t function; |
| 275 | 281 | int err; |
| 276 | 282 | |
| 277 | − /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */ | |
| 278 | − *action = STM32_SYNAPSE_ACTION_NONE; | |
| 279 | − | |
| 280 | 283 | err = stm32_count_function_get(counter, count, &function); |
| 281 | 284 | if (err) |
| 282 | − return 0; | |
| 285 | + return err; | |
| 283 | 286 | |
| 284 | 287 | switch (function) { |
| 288 | + case STM32_COUNT_SLAVE_MODE_DISABLED: | |
| 289 | + /* counts on internal clock when CEN=1 */ | |
| 290 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 291 | + return 0; | |
| 285 | 292 | case STM32_COUNT_ENCODER_MODE_1: |
| 286 | 293 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ |
| 287 | 294 | if (synapse->signal->id == count->synapses[0].signal->id) |
| 288 | 295 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 289 | − break; | |
| 296 | + else | |
| 297 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 298 | + return 0; | |
| 290 | 299 | case STM32_COUNT_ENCODER_MODE_2: |
| 291 | 300 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ |
| 292 | 301 | if (synapse->signal->id == count->synapses[1].signal->id) |
| 293 | 302 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 294 | − break; | |
| 303 | + else | |
| 304 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 305 | + return 0; | |
| 295 | 306 | case STM32_COUNT_ENCODER_MODE_3: |
| 296 | 307 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ |
| 297 | 308 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 298 | − break; | |
| 309 | + return 0; | |
| 310 | + default: | |
| 311 | + return -EINVAL; | |
| 299 | 312 | } |
| 300 | − | |
| 301 | − return 0; | |
| 302 | 313 | } |
| 303 | 314 | |
| 304 | 315 | static const struct counter_ops stm32_timer_cnt_ops = { |
| @@ -359,7 +370,7 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev) · 54 unmodified lines | ||
| 359 | 370 | |
| 360 | 371 | priv->regmap = ddata->regmap; |
| 361 | 372 | priv->clk = ddata->clk; |
| 362 | − priv->ceiling = ddata->max_arr; | |
| 373 | + priv->max_arr = ddata->max_arr; | |
| 363 | 374 | |
| 364 | 375 | priv->counter.name = dev_name(dev); |
| 365 | 376 | priv->counter.parent = dev; |
| @@ -927,7 +927,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 926 unmodified lines | ||
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | /* first try to find a slot in an existing linked list entry */ |
| 930 | − for (prsv = efi_memreserve_root->next; prsv; prsv = rsv->next) { | |
| 930 | + for (prsv = efi_memreserve_root->next; prsv; ) { | |
| 931 | 931 | rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); |
| 932 | 932 | index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); |
| 933 | 933 | if (index < rsv->size) { |
| @@ -937,6 +937,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 3 unmodified lines | ||
| 937 | 937 | memunmap(rsv); |
| 938 | 938 | return efi_mem_reserve_iomem(addr, size); |
| 939 | 939 | } |
| 940 | + prsv = rsv->next; | |
| 940 | 941 | memunmap(rsv); |
| 941 | 942 | } |
| 942 | 943 | |
| @@ -484,6 +484,10 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *), · 483 unmodified lines | ||
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | + break; | |
| 488 | + case EFI_UNSUPPORTED: | |
| 489 | + err = -EOPNOTSUPP; | |
| 490 | + status = EFI_NOT_FOUND; | |
| 487 | 491 | break; |
| 488 | 492 | case EFI_NOT_FOUND: |
| 489 | 493 | break; |
| @@ -571,6 +571,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 570 unmodified lines | ||
| 571 | 571 | struct lock_class_key *lock_key, |
| 572 | 572 | struct lock_class_key *request_key) |
| 573 | 573 | { |
| 574 | + struct fwnode_handle *fwnode = gc->parent ? dev_fwnode(gc->parent) : NULL; | |
| 574 | 575 | unsigned long flags; |
| 575 | 576 | int ret = 0; |
| 576 | 577 | unsigned i; |
| @@ -594,6 +595,12 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 17 unmodified lines | ||
| 594 | 595 | |
| 595 | 596 | of_gpio_dev_init(gc, gdev); |
| 596 | 597 | |
| 598 | + /* | |
| 599 | + * Assign fwnode depending on the result of the previous calls, | |
| 600 | + * if none of them succeed, assign it to the parent's one. | |
| 601 | + */ | |
| 602 | + gdev->dev.fwnode = dev_fwnode(&gdev->dev) ?: fwnode; | |
| 603 | + | |
| 597 | 604 | gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL); |
| 598 | 605 | if (gdev->id < 0) { |
| 599 | 606 | ret = gdev->id; |
| @@ -4256,7 +4263,8 @@ static int __init gpiolib_dev_init(void) · 3656 unmodified lines | ||
| 4256 | 4263 | return ret; |
| 4257 | 4264 | } |
| 4258 | 4265 | |
| 4259 | − if (driver_register(&gpio_stub_drv) < 0) { | |
| 4266 | + ret = driver_register(&gpio_stub_drv); | |
| 4267 | + if (ret < 0) { | |
| 4260 | 4268 | pr_err("gpiolib: could not register GPIO stub driver\n"); |
| 4261 | 4269 | bus_unregister(&gpio_bus_type); |
| 4262 | 4270 | return ret; |
| @@ -1507,38 +1507,8 @@ static void dcn20_update_dchubp_dpp( · 1506 unmodified lines | ||
| 1507 | 1507 | if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed |
| 1508 | 1508 | || pipe_ctx->stream->update_flags.bits.gamut_remap |
| 1509 | 1509 | || pipe_ctx->stream->update_flags.bits.out_csc) { |
| 1510 | − struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc; | |
| 1511 | − | |
| 1512 | − if (mpc->funcs->set_gamut_remap) { | |
| 1513 | − int i; | |
| 1514 | − int mpcc_id = hubp->inst; | |
| 1515 | − struct mpc_grph_gamut_adjustment adjust; | |
| 1516 | − bool enable_remap_dpp = false; | |
| 1517 | − | |
| 1518 | − memset(&adjust, 0, sizeof(adjust)); | |
| 1519 | − adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS; | |
| 1520 | − | |
| 1521 | − /* save the enablement of gamut remap for dpp */ | |
| 1522 | − enable_remap_dpp = pipe_ctx->stream->gamut_remap_matrix.enable_remap; | |
| 1523 | − | |
| 1524 | − /* force bypass gamut remap for dpp/cm */ | |
| 1525 | − pipe_ctx->stream->gamut_remap_matrix.enable_remap = false; | |
| 1526 | − dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1527 | − | |
| 1528 | − /* restore gamut remap flag and use this remap into mpc */ | |
| 1529 | − pipe_ctx->stream->gamut_remap_matrix.enable_remap = enable_remap_dpp; | |
| 1530 | − | |
| 1531 | − /* build remap matrix for top plane if enabled */ | |
| 1532 | − if (enable_remap_dpp && pipe_ctx->top_pipe == NULL) { | |
| 1533 | − adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; | |
| 1534 | − for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++) | |
| 1535 | − adjust.temperature_matrix[i] = | |
| 1536 | − pipe_ctx->stream->gamut_remap_matrix.matrix[i]; | |
| 1537 | − } | |
| 1538 | − mpc->funcs->set_gamut_remap(mpc, mpcc_id, &adjust); | |
| 1539 | − } else | |
| 1540 | − /* dpp/cm gamut remap*/ | |
| 1541 | − dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1510 | + /* dpp/cm gamut remap*/ | |
| 1511 | + dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1542 | 1512 | |
| 1543 | 1513 | /*call the dcn2 method which uses mpc csc*/ |
| 1544 | 1514 | dc->hwss.program_output_csc(dc, |
| @@ -1595,6 +1595,11 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param · 1594 unmodified lines | ||
| 1595 | 1595 | dcn2_1_soc.num_chans = bw_params->num_channels; |
| 1596 | 1596 | |
| 1597 | 1597 | ASSERT(clk_table->num_entries); |
| 1598 | + /* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */ | |
| 1599 | + for (i = 0; i < dcn2_1_soc.num_states + 1; i++) { | |
| 1600 | + clock_limits[i] = dcn2_1_soc.clock_limits[i]; | |
| 1601 | + } | |
| 1602 | + | |
| 1598 | 1603 | for (i = 0; i < clk_table->num_entries; i++) { |
| 1599 | 1604 | /* loop backwards*/ |
| 1600 | 1605 | for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) { |
| @@ -113,6 +113,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 112 unmodified lines | ||
| 113 | 113 | struct pwl_result_data *rgb_resulted; |
| 114 | 114 | struct pwl_result_data *rgb; |
| 115 | 115 | struct pwl_result_data *rgb_plus_1; |
| 116 | + struct pwl_result_data *rgb_minus_1; | |
| 116 | 117 | struct fixed31_32 end_value; |
| 117 | 118 | |
| 118 | 119 | int32_t region_start, region_end; |
| @@ -140,7 +141,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 21 unmodified lines | ||
| 140 | 141 | region_start = -MAX_LOW_POINT; |
| 141 | 142 | region_end = NUMBER_REGIONS - MAX_LOW_POINT; |
| 142 | 143 | } else { |
| 143 | − /* 10 segments | |
| 144 | + /* 11 segments | |
| 144 | 145 | * segment is from 2^-10 to 2^0 |
| 145 | 146 | * There are less than 256 points, for optimization |
| 146 | 147 | */ |
| @@ -154,9 +155,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 7 unmodified lines | ||
| 154 | 155 | seg_distr[7] = 4; |
| 155 | 156 | seg_distr[8] = 4; |
| 156 | 157 | seg_distr[9] = 4; |
| 158 | + seg_distr[10] = 1; | |
| 157 | 159 | |
| 158 | 160 | region_start = -10; |
| 159 | − region_end = 0; | |
| 161 | + region_end = 1; | |
| 160 | 162 | } |
| 161 | 163 | |
| 162 | 164 | for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++) |
| @@ -189,6 +191,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 26 unmodified lines | ||
| 189 | 191 | rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index]; |
| 190 | 192 | rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index]; |
| 191 | 193 | |
| 194 | + rgb_resulted[hw_points].red = rgb_resulted[hw_points - 1].red; | |
| 195 | + rgb_resulted[hw_points].green = rgb_resulted[hw_points - 1].green; | |
| 196 | + rgb_resulted[hw_points].blue = rgb_resulted[hw_points - 1].blue; | |
| 197 | + | |
| 192 | 198 | // All 3 color channels have same x |
| 193 | 199 | corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2), |
| 194 | 200 | dc_fixpt_from_int(region_start)); |
| @@ -259,15 +265,18 @@ bool cm3_helper_translate_curve_to_hw_format( · 64 unmodified lines | ||
| 259 | 265 | |
| 260 | 266 | rgb = rgb_resulted; |
| 261 | 267 | rgb_plus_1 = rgb_resulted + 1; |
| 268 | + rgb_minus_1 = rgb; | |
| 262 | 269 | |
| 263 | 270 | i = 1; |
| 264 | 271 | while (i != hw_points + 1) { |
| 265 | − if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) | |
| 266 | − rgb_plus_1->red = rgb->red; | |
| 267 | − if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) | |
| 268 | − rgb_plus_1->green = rgb->green; | |
| 269 | − if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue)) | |
| 270 | − rgb_plus_1->blue = rgb->blue; | |
| 272 | + if (i >= hw_points - 1) { | |
| 273 | + if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) | |
| 274 | + rgb_plus_1->red = dc_fixpt_add(rgb->red, rgb_minus_1->delta_red); | |
| 275 | + if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) | |
| 276 | + rgb_plus_1->green = dc_fixpt_add(rgb->green, rgb_minus_1->delta_green); | |
| 277 | + if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue)) | |
| 278 | + rgb_plus_1->blue = dc_fixpt_add(rgb->blue, rgb_minus_1->delta_blue); | |
| 279 | + } | |
| 271 | 280 | |
| 272 | 281 | rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red); |
| 273 | 282 | rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green); |
| @@ -283,6 +292,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 9 unmodified lines | ||
| 283 | 292 | } |
| 284 | 293 | |
| 285 | 294 | ++rgb_plus_1; |
| 295 | + rgb_minus_1 = rgb; | |
| 286 | 296 | ++rgb; |
| 287 | 297 | ++i; |
| 288 | 298 | } |
| @@ -603,7 +603,6 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 602 unmodified lines | ||
| 603 | 603 | { |
| 604 | 604 | int report_size = stream->oa_buffer.format_size; |
| 605 | 605 | struct drm_i915_perf_record_header header; |
| 606 | − u32 sample_flags = stream->sample_flags; | |
| 607 | 606 | |
| 608 | 607 | header.type = DRM_I915_PERF_RECORD_SAMPLE; |
| 609 | 608 | header.pad = 0; |
| @@ -617,10 +616,8 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 7 unmodified lines | ||
| 617 | 616 | return -EFAULT; |
| 618 | 617 | buf += sizeof(header); |
| 619 | 618 | |
| 620 | − if (sample_flags & SAMPLE_OA_REPORT) { | |
| 621 | − if (copy_to_user(buf, report, report_size)) | |
| 622 | − return -EFAULT; | |
| 623 | − } | |
| 619 | + if (copy_to_user(buf, report, report_size)) | |
| 620 | + return -EFAULT; | |
| 624 | 621 | |
| 625 | 622 | (*offset) += header.size; |
| 626 | 623 | |
| @@ -2682,7 +2679,7 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream) · 2055 unmodified lines | ||
| 2682 | 2679 | |
| 2683 | 2680 | stream->perf->ops.oa_enable(stream); |
| 2684 | 2681 | |
| 2685 | − if (stream->periodic) | |
| 2682 | + if (stream->sample_flags & SAMPLE_OA_REPORT) | |
| 2686 | 2683 | hrtimer_start(&stream->poll_check_timer, |
| 2687 | 2684 | ns_to_ktime(stream->poll_oa_period), |
| 2688 | 2685 | HRTIMER_MODE_REL_PINNED); |
| @@ -2745,7 +2742,7 @@ static void i915_oa_stream_disable(struct i915_perf_stream *stream) · 56 unmodified lines | ||
| 2745 | 2742 | { |
| 2746 | 2743 | stream->perf->ops.oa_disable(stream); |
| 2747 | 2744 | |
| 2748 | − if (stream->periodic) | |
| 2745 | + if (stream->sample_flags & SAMPLE_OA_REPORT) | |
| 2749 | 2746 | hrtimer_cancel(&stream->poll_check_timer); |
| 2750 | 2747 | } |
| 2751 | 2748 | |
| @@ -3028,7 +3025,7 @@ static ssize_t i915_perf_read(struct file *file, · 276 unmodified lines | ||
| 3028 | 3025 | * disabled stream as an error. In particular it might otherwise lead |
| 3029 | 3026 | * to a deadlock for blocking file descriptors... |
| 3030 | 3027 | */ |
| 3031 | − if (!stream->enabled) | |
| 3028 | + if (!stream->enabled || !(stream->sample_flags & SAMPLE_OA_REPORT)) | |
| 3032 | 3029 | return -EIO; |
| 3033 | 3030 | |
| 3034 | 3031 | if (!(file->f_flags & O_NONBLOCK)) { |
| @@ -3316,7 +3316,18 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 3315 unmodified lines | ||
| 3316 | 3316 | |
| 3317 | 3317 | #define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000) |
| 3318 | 3318 | #define ILK_FBCQ_DIS (1 << 22) |
| 3319 | −#define ILK_PABSTRETCH_DIS (1 << 21) | |
| 3319 | +#define ILK_PABSTRETCH_DIS REG_BIT(21) | |
| 3320 | +#define ILK_SABSTRETCH_DIS REG_BIT(20) | |
| 3321 | +#define IVB_PRI_STRETCH_MAX_MASK REG_GENMASK(21, 20) | |
| 3322 | +#define IVB_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 0) | |
| 3323 | +#define IVB_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 1) | |
| 3324 | +#define IVB_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 2) | |
| 3325 | +#define IVB_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 3) | |
| 3326 | +#define IVB_SPR_STRETCH_MAX_MASK REG_GENMASK(19, 18) | |
| 3327 | +#define IVB_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 0) | |
| 3328 | +#define IVB_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 1) | |
| 3329 | +#define IVB_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 2) | |
| 3330 | +#define IVB_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 3) | |
| 3320 | 3331 | |
| 3321 | 3332 | |
| 3322 | 3333 | /* |
| @@ -8039,6 +8050,16 @@ enum { · 4716 unmodified lines | ||
| 8039 | 8050 | |
| 8040 | 8051 | #define _CHICKEN_PIPESL_1_A 0x420b0 |
| 8041 | 8052 | #define _CHICKEN_PIPESL_1_B 0x420b4 |
| 8053 | +#define HSW_PRI_STRETCH_MAX_MASK REG_GENMASK(28, 27) | |
| 8054 | +#define HSW_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 0) | |
| 8055 | +#define HSW_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 1) | |
| 8056 | +#define HSW_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 2) | |
| 8057 | +#define HSW_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 3) | |
| 8058 | +#define HSW_SPR_STRETCH_MAX_MASK REG_GENMASK(26, 25) | |
| 8059 | +#define HSW_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 0) | |
| 8060 | +#define HSW_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 1) | |
| 8061 | +#define HSW_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 2) | |
| 8062 | +#define HSW_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 3) | |
| 8042 | 8063 | #define HSW_FBCQ_DIS (1 << 22) |
| 8043 | 8064 | #define BDW_DPRS_MASK_VBLANK_SRD (1 << 0) |
| 8044 | 8065 | #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B) |
| @@ -7245,11 +7245,16 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 7244 unmodified lines | ||
| 7245 | 7245 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1, |
| 7246 | 7246 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD); |
| 7247 | 7247 | |
| 7248 | − /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | |
| 7249 | 7248 | for_each_pipe(dev_priv, pipe) { |
| 7249 | + /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | |
| 7250 | 7250 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), |
| 7251 | 7251 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) | |
| 7252 | 7252 | BDW_DPRS_MASK_VBLANK_SRD); |
| 7253 | + | |
| 7254 | + /* Undocumented but fixes async flip + VT-d corruption */ | |
| 7255 | + if (intel_vtd_active()) | |
| 7256 | + intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), | |
| 7257 | + HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1); | |
| 7253 | 7258 | } |
| 7254 | 7259 | |
| 7255 | 7260 | /* WaVSRefCountFullforceMissDisable:bdw */ |
| @@ -7285,11 +7290,20 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 29 unmodified lines | ||
| 7285 | 7290 | |
| 7286 | 7291 | static void hsw_init_clock_gating(struct drm_i915_private *dev_priv) |
| 7287 | 7292 | { |
| 7293 | + enum pipe pipe; | |
| 7294 | + | |
| 7288 | 7295 | /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ |
| 7289 | 7296 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A), |
| 7290 | 7297 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) | |
| 7291 | 7298 | HSW_FBCQ_DIS); |
| 7292 | 7299 | |
| 7300 | + for_each_pipe(dev_priv, pipe) { | |
| 7301 | + /* Undocumented but fixes async flip + VT-d corruption */ | |
| 7302 | + if (intel_vtd_active()) | |
| 7303 | + intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), | |
| 7304 | + HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1); | |
| 7305 | + } | |
| 7306 | + | |
| 7293 | 7307 | /* This is required by WaCatErrorRejectionIssue:hsw */ |
| 7294 | 7308 | intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, |
| 7295 | 7309 | intel_uncore_read(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | |
| @@ -551,6 +551,10 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · 550 unmodified lines | ||
| 551 | 551 | |
| 552 | 552 | if (!ttm_dma) |
| 553 | 553 | return; |
| 554 | + if (!ttm_dma->pages) { | |
| 555 | + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); | |
| 556 | + return; | |
| 557 | + } | |
| 554 | 558 | |
| 555 | 559 | /* Don't waste time looping if the object is coherent */ |
| 556 | 560 | if (nvbo->force_coherent) |
| @@ -583,6 +587,10 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 26 unmodified lines | ||
| 583 | 587 | |
| 584 | 588 | if (!ttm_dma) |
| 585 | 589 | return; |
| 590 | + if (!ttm_dma->pages) { | |
| 591 | + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); | |
| 592 | + return; | |
| 593 | + } | |
| 586 | 594 | |
| 587 | 595 | /* Don't waste time looping if the object is coherent */ |
| 588 | 596 | if (nvbo->force_coherent) |
| @@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc, · 2148 unmodified lines | ||
| 2149 | 2149 | const struct mipi_dsi_msg *msg) |
| 2150 | 2150 | { |
| 2151 | 2151 | struct mipi_dsi_packet pkt; |
| 2152 | + int ret; | |
| 2152 | 2153 | u32 r; |
| 2153 | 2154 | |
| 2154 | − r = mipi_dsi_create_packet(&pkt, msg); | |
| 2155 | − if (r < 0) | |
| 2156 | − return r; | |
| 2155 | + ret = mipi_dsi_create_packet(&pkt, msg); | |
| 2156 | + if (ret < 0) | |
| 2157 | + return ret; | |
| 2157 | 2158 | |
| 2158 | 2159 | WARN_ON(!dsi_bus_is_locked(dsi)); |
| 2159 | 2160 | |
| @@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines | ||
| 266 | 266 | select IIO_BUFFER |
| 267 | 267 | select IIO_BUFFER_HW_CONSUMER |
| 268 | 268 | select IIO_BUFFER_DMAENGINE |
| 269 | + depends on HAS_IOMEM | |
| 270 | + depends on OF | |
| 269 | 271 | help |
| 270 | 272 | Say yes here to build support for Analog Devices Generic |
| 271 | 273 | AXI ADC IP core. The IP core is used for interfacing with |
| @@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines | ||
| 923 | 925 | depends on ARCH_STM32 || COMPILE_TEST |
| 924 | 926 | depends on OF |
| 925 | 927 | depends on REGULATOR |
| 928 | + depends on HAS_IOMEM | |
| 926 | 929 | select IIO_BUFFER |
| 927 | 930 | select MFD_STM32_TIMERS |
| 928 | 931 | select IIO_STM32_TIMER_TRIGGER |
| @@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev, · 917 unmodified lines | ||
| 918 | 918 | return processed; |
| 919 | 919 | |
| 920 | 920 | /* Return millivolt or milliamps or millicentigrades */ |
| 921 | − *val = processed * 1000; | |
| 921 | + *val = processed; | |
| 922 | 922 | return IIO_VAL_INT; |
| 923 | 923 | } |
| 924 | 924 | |
| @@ -91,7 +91,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val, · 90 unmodified lines | ||
| 91 | 91 | int ret; |
| 92 | 92 | int i; |
| 93 | 93 | int bits_per_word = ad7949_adc->resolution; |
| 94 | − int mask = GENMASK(ad7949_adc->resolution, 0); | |
| 94 | + int mask = GENMASK(ad7949_adc->resolution - 1, 0); | |
| 95 | 95 | struct spi_message msg; |
| 96 | 96 | struct spi_transfer tx[] = { |
| 97 | 97 | { |
| @@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines | ||
| 597 | 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) |
| 598 | 598 | |
| 599 | 599 | VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0) |
| 600 | − VADC_CHAN_NO_SCALE(LR_MUX2_BAT_ID, 0) | |
| 600 | + VADC_CHAN_VOLT(LR_MUX2_BAT_ID, 0, SCALE_DEFAULT) | |
| 601 | 601 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) |
| 602 | 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) |
| 603 | 603 | VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0) |
| @@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) · 550 unmodified lines | ||
| 551 | 551 | MPU3050_FIFO_R, |
| 552 | 552 | &fifo_values[offset], |
| 553 | 553 | toread); |
| 554 | + if (ret) | |
| 555 | + goto out_trigger_unlock; | |
| 554 | 556 | |
| 555 | 557 | dev_dbg(mpu3050->dev, |
| 556 | 558 | "%04x %04x %04x %04x %04x\n", |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | ||
| 15 | 15 | struct hid_humidity_state { |
| 16 | 16 | struct hid_sensor_common common_attributes; |
| 17 | 17 | struct hid_sensor_hub_attribute_info humidity_attr; |
| 18 | − s32 humidity_data; | |
| 18 | + struct { | |
| 19 | + s32 humidity_data; | |
| 20 | + u64 timestamp __aligned(8); | |
| 21 | + } scan; | |
| 19 | 22 | int scale_pre_decml; |
| 20 | 23 | int scale_post_decml; |
| 21 | 24 | int scale_precision; |
| @@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines | ||
| 125 | 128 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); |
| 126 | 129 | |
| 127 | 130 | if (atomic_read(&humid_st->common_attributes.data_ready)) |
| 128 | − iio_push_to_buffers_with_timestamp(indio_dev, | |
| 129 | − &humid_st->humidity_data, | |
| 130 | − iio_get_time_ns(indio_dev)); | |
| 131 | + iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan, | |
| 132 | + iio_get_time_ns(indio_dev)); | |
| 131 | 133 | |
| 132 | 134 | return 0; |
| 133 | 135 | } |
| @@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | ||
| 142 | 144 | |
| 143 | 145 | switch (usage_id) { |
| 144 | 146 | case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY: |
| 145 | − humid_st->humidity_data = *(s32 *)raw_data; | |
| 147 | + humid_st->scan.humidity_data = *(s32 *)raw_data; | |
| 146 | 148 | |
| 147 | 149 | return 0; |
| 148 | 150 | default: |
| @@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines | ||
| 462 | 462 | if (ret) |
| 463 | 463 | goto err_ret; |
| 464 | 464 | |
| 465 | − ret = sscanf(indio_dev->name, "adis%u\n", &device_id); | |
| 466 | − if (ret != 1) { | |
| 465 | + if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) { | |
| 467 | 466 | ret = -EINVAL; |
| 468 | 467 | goto err_ret; |
| 469 | 468 | } |
| @@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines | ||
| 23 | 23 | struct hid_sensor_common common_attributes; |
| 24 | 24 | struct hid_sensor_hub_attribute_info prox_attr; |
| 25 | 25 | u32 human_presence; |
| 26 | + int scale_pre_decml; | |
| 27 | + int scale_post_decml; | |
| 28 | + int scale_precision; | |
| 26 | 29 | }; |
| 27 | 30 | |
| 28 | 31 | /* Channel definitions */ |
| @@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines | ||
| 93 | 96 | ret_type = IIO_VAL_INT; |
| 94 | 97 | break; |
| 95 | 98 | case IIO_CHAN_INFO_SCALE: |
| 96 | − *val = prox_state->prox_attr.units; | |
| 97 | − ret_type = IIO_VAL_INT; | |
| 99 | + *val = prox_state->scale_pre_decml; | |
| 100 | + *val2 = prox_state->scale_post_decml; | |
| 101 | + ret_type = prox_state->scale_precision; | |
| 98 | 102 | break; |
| 99 | 103 | case IIO_CHAN_INFO_OFFSET: |
| 100 | 104 | *val = hid_sensor_convert_exponent( |
| @@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines | ||
| 234 | 238 | HID_USAGE_SENSOR_HUMAN_PRESENCE, |
| 235 | 239 | &st->common_attributes.sensitivity); |
| 236 | 240 | |
| 241 | + st->scale_precision = hid_sensor_format_scale( | |
| 242 | + hsdev->usage, | |
| 243 | + &st->prox_attr, | |
| 244 | + &st->scale_pre_decml, &st->scale_post_decml); | |
| 245 | + | |
| 237 | 246 | return ret; |
| 238 | 247 | } |
| 239 | 248 | |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | ||
| 15 | 15 | struct temperature_state { |
| 16 | 16 | struct hid_sensor_common common_attributes; |
| 17 | 17 | struct hid_sensor_hub_attribute_info temperature_attr; |
| 18 | − s32 temperature_data; | |
| 18 | + struct { | |
| 19 | + s32 temperature_data; | |
| 20 | + u64 timestamp __aligned(8); | |
| 21 | + } scan; | |
| 19 | 22 | int scale_pre_decml; |
| 20 | 23 | int scale_post_decml; |
| 21 | 24 | int scale_precision; |
| @@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines | ||
| 32 | 35 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | |
| 33 | 36 | BIT(IIO_CHAN_INFO_HYSTERESIS), |
| 34 | 37 | }, |
| 35 | − IIO_CHAN_SOFT_TIMESTAMP(3), | |
| 38 | + IIO_CHAN_SOFT_TIMESTAMP(1), | |
| 36 | 39 | }; |
| 37 | 40 | |
| 38 | 41 | /* Adjust channel real bits based on report descriptor */ |
| @@ -123,9 +126,8 @@ static int temperature_proc_event(struct hid_sensor_hub_device *hsdev, · 84 unmodified lines | ||
| 123 | 126 | struct temperature_state *temp_st = iio_priv(indio_dev); |
| 124 | 127 | |
| 125 | 128 | if (atomic_read(&temp_st->common_attributes.data_ready)) |
| 126 | − iio_push_to_buffers_with_timestamp(indio_dev, | |
| 127 | − &temp_st->temperature_data, | |
| 128 | − iio_get_time_ns(indio_dev)); | |
| 129 | + iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan, | |
| 130 | + iio_get_time_ns(indio_dev)); | |
| 129 | 131 | |
| 130 | 132 | return 0; |
| 131 | 133 | } |
| @@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | ||
| 140 | 142 | |
| 141 | 143 | switch (usage_id) { |
| 142 | 144 | case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE: |
| 143 | − temp_st->temperature_data = *(s32 *)raw_data; | |
| 145 | + temp_st->scan.temperature_data = *(s32 *)raw_data; | |
| 144 | 146 | return 0; |
| 145 | 147 | default: |
| 146 | 148 | return -EINVAL; |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 28 | 28 | MODULE_DESCRIPTION("Joystick device interfaces"); |
| 29 | −MODULE_SUPPORTED_DEVICE("input/js"); | |
| 30 | 29 | MODULE_LICENSE("GPL"); |
| 31 | 30 | |
| 32 | 31 | #define JOYDEV_MINOR_BASE 0 |
| @@ -2714,7 +2714,6 @@ static int __init early_amd_iommu_init(void) · 2713 unmodified lines | ||
| 2714 | 2714 | struct acpi_table_header *ivrs_base; |
| 2715 | 2715 | int i, remap_cache_sz, ret; |
| 2716 | 2716 | acpi_status status; |
| 2717 | − u32 pci_id; | |
| 2718 | 2717 | |
| 2719 | 2718 | if (!amd_iommu_detected) |
| 2720 | 2719 | return -ENODEV; |
| @@ -2804,16 +2803,6 @@ static int __init early_amd_iommu_init(void) · 83 unmodified lines | ||
| 2804 | 2803 | if (ret) |
| 2805 | 2804 | goto out; |
| 2806 | 2805 | |
| 2807 | − /* Disable IOMMU if there's Stoney Ridge graphics */ | |
| 2808 | − for (i = 0; i < 32; i++) { | |
| 2809 | − pci_id = read_pci_config(0, i, 0, 0); | |
| 2810 | − if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { | |
| 2811 | − pr_info("Disable IOMMU on Stoney Ridge\n"); | |
| 2812 | − amd_iommu_disabled = true; | |
| 2813 | − break; | |
| 2814 | − } | |
| 2815 | − } | |
| 2816 | − | |
| 2817 | 2806 | /* Disable any previously enabled IOMMUs */ |
| 2818 | 2807 | if (!is_kdump_kernel() || amd_iommu_disabled) |
| 2819 | 2808 | disable_iommus(); |
| @@ -2880,6 +2869,7 @@ static bool detect_ivrs(void) · 60 unmodified lines | ||
| 2880 | 2869 | { |
| 2881 | 2870 | struct acpi_table_header *ivrs_base; |
| 2882 | 2871 | acpi_status status; |
| 2872 | + int i; | |
| 2883 | 2873 | |
| 2884 | 2874 | status = acpi_get_table("IVRS", 0, &ivrs_base); |
| 2885 | 2875 | if (status == AE_NOT_FOUND) |
| @@ -2892,6 +2882,17 @@ static bool detect_ivrs(void) · 6 unmodified lines | ||
| 2892 | 2882 | |
| 2893 | 2883 | acpi_put_table(ivrs_base); |
| 2894 | 2884 | |
| 2885 | + /* Don't use IOMMU if there is Stoney Ridge graphics */ | |
| 2886 | + for (i = 0; i < 32; i++) { | |
| 2887 | + u32 pci_id; | |
| 2888 | + | |
| 2889 | + pci_id = read_pci_config(0, i, 0, 0); | |
| 2890 | + if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { | |
| 2891 | + pr_info("Disable IOMMU on Stoney Ridge\n"); | |
| 2892 | + return false; | |
| 2893 | + } | |
| 2894 | + } | |
| 2895 | + | |
| 2895 | 2896 | /* Make sure ACS will be enabled during PCI probe */ |
| 2896 | 2897 | pci_request_acs(); |
| 2897 | 2898 | |
| @@ -2918,12 +2919,12 @@ static int __init state_next(void) · 20 unmodified lines | ||
| 2918 | 2919 | } |
| 2919 | 2920 | break; |
| 2920 | 2921 | case IOMMU_IVRS_DETECTED: |
| 2921 | − ret = early_amd_iommu_init(); | |
| 2922 | − init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; | |
| 2923 | − if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) { | |
| 2924 | − pr_info("AMD IOMMU disabled\n"); | |
| 2922 | + if (amd_iommu_disabled) { | |
| 2925 | 2923 | init_state = IOMMU_CMDLINE_DISABLED; |
| 2926 | 2924 | ret = -EINVAL; |
| 2925 | + } else { | |
| 2926 | + ret = early_amd_iommu_init(); | |
| 2927 | + init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; | |
| 2927 | 2928 | } |
| 2928 | 2929 | break; |
| 2929 | 2930 | case IOMMU_ACPI_FINISHED: |
| @@ -3001,8 +3002,11 @@ int __init amd_iommu_prepare(void) · 71 unmodified lines | ||
| 3001 | 3002 | amd_iommu_irq_remap = true; |
| 3002 | 3003 | |
| 3003 | 3004 | ret = iommu_go_to_state(IOMMU_ACPI_FINISHED); |
| 3004 | − if (ret) | |
| 3005 | + if (ret) { | |
| 3006 | + amd_iommu_irq_remap = false; | |
| 3005 | 3007 | return ret; |
| 3008 | + } | |
| 3009 | + | |
| 3006 | 3010 | return amd_iommu_irq_remap ? 0 : -ENODEV; |
| 3007 | 3011 | } |
| 3008 | 3012 | |
| @@ -849,12 +849,11 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev) · 848 unmodified lines | ||
| 849 | 849 | smmu = tegra_smmu_find(args.np); |
| 850 | 850 | if (smmu) { |
| 851 | 851 | err = tegra_smmu_configure(smmu, dev, &args); |
| 852 | − of_node_put(args.np); | |
| 853 | 852 | |
| 854 | − if (err < 0) | |
| 853 | + if (err < 0) { | |
| 854 | + of_node_put(args.np); | |
| 855 | 855 | return ERR_PTR(err); |
| 856 | − | |
| 857 | − break; | |
| 856 | + } | |
| 858 | 857 | } |
| 859 | 858 | |
| 860 | 859 | of_node_put(args.np); |
| @@ -430,4 +430,3 @@ MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>"); · 429 unmodified lines | ||
| 430 | 430 | MODULE_AUTHOR("Ben Backx <ben@bbackx.com>"); |
| 431 | 431 | MODULE_DESCRIPTION("FireDTV DVB Driver"); |
| 432 | 432 | MODULE_LICENSE("GPL"); |
| 433 | −MODULE_SUPPORTED_DEVICE("FireDTV DVB"); | |
| @@ -41,7 +41,6 @@ MODULE_PARM_DESC(debug, · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | MODULE_AUTHOR("Andy Walls"); |
| 43 | 43 | MODULE_DESCRIPTION("CX23418 ALSA Interface"); |
| 44 | −MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | |
| 45 | 44 | MODULE_LICENSE("GPL"); |
| 46 | 45 | |
| 47 | 46 | MODULE_VERSION(CX18_VERSION); |
| @@ -232,7 +232,6 @@ MODULE_PARM_DESC(cx18_first_minor, · 231 unmodified lines | ||
| 232 | 232 | |
| 233 | 233 | MODULE_AUTHOR("Hans Verkuil"); |
| 234 | 234 | MODULE_DESCRIPTION("CX23418 driver"); |
| 235 | −MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | |
| 236 | 235 | MODULE_LICENSE("GPL"); |
| 237 | 236 | |
| 238 | 237 | MODULE_VERSION(CX18_VERSION); |
| @@ -104,7 +104,6 @@ MODULE_PARM_DESC(index, "Index value for cx25821 capture interface(s)."); · 103 unmodified lines | ||
| 104 | 104 | MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards"); |
| 105 | 105 | MODULE_AUTHOR("Hiep Huynh"); |
| 106 | 106 | MODULE_LICENSE("GPL"); |
| 107 | −MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */ | |
| 108 | 107 | |
| 109 | 108 | static unsigned int debug; |
| 110 | 109 | module_param(debug, int, 0644); |
| @@ -98,7 +98,6 @@ MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); · 97 unmodified lines | ||
| 98 | 98 | MODULE_LICENSE("GPL v2"); |
| 99 | 99 | MODULE_VERSION(CX88_VERSION); |
| 100 | 100 | |
| 101 | −MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}"); | |
| 102 | 101 | static unsigned int debug; |
| 103 | 102 | module_param(debug, int, 0644); |
| 104 | 103 | MODULE_PARM_DESC(debug, "enable debug messages"); |
| @@ -38,7 +38,6 @@ MODULE_PARM_DESC(index, · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | MODULE_AUTHOR("Andy Walls"); |
| 40 | 40 | MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface"); |
| 41 | −MODULE_SUPPORTED_DEVICE("CX23415/CX23416 MPEG2 encoder"); | |
| 42 | 41 | MODULE_LICENSE("GPL"); |
| 43 | 42 | |
| 44 | 43 | MODULE_VERSION(IVTV_VERSION); |
| @@ -275,9 +275,6 @@ MODULE_PARM_DESC(ivtv_first_minor, "Set device node number assigned to first car · 274 unmodified lines | ||
| 275 | 275 | |
| 276 | 276 | MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil"); |
| 277 | 277 | MODULE_DESCRIPTION("CX23415/CX23416 driver"); |
| 278 | −MODULE_SUPPORTED_DEVICE | |
| 279 | − ("CX23415/CX23416 MPEG2 encoder (WinTV PVR-150/250/350/500,\n" | |
| 280 | − "\t\t\tYuan MPG series and similar)"); | |
| 281 | 278 | MODULE_LICENSE("GPL"); |
| 282 | 279 | |
| 283 | 280 | MODULE_VERSION(IVTV_VERSION); |
| @@ -1269,6 +1269,5 @@ late_initcall_sync(sta2x11_vip_init_module); · 1268 unmodified lines | ||
| 1269 | 1269 | MODULE_DESCRIPTION("STA2X11 Video Input Port driver"); |
| 1270 | 1270 | MODULE_AUTHOR("Wind River"); |
| 1271 | 1271 | MODULE_LICENSE("GPL v2"); |
| 1272 | −MODULE_SUPPORTED_DEVICE("sta2x11 video input"); | |
| 1273 | 1272 | MODULE_VERSION(DRV_VERSION); |
| 1274 | 1273 | MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl); |
| @@ -1363,4 +1363,3 @@ module_platform_driver(atmel_isi_driver); · 1362 unmodified lines | ||
| 1363 | 1363 | MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>"); |
| 1364 | 1364 | MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux"); |
| 1365 | 1365 | MODULE_LICENSE("GPL"); |
| 1366 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -330,4 +330,3 @@ module_platform_driver(atmel_isc_driver); · 329 unmodified lines | ||
| 330 | 330 | MODULE_AUTHOR("Songjun Wu"); |
| 331 | 331 | MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC"); |
| 332 | 332 | MODULE_LICENSE("GPL v2"); |
| 333 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -44,10 +44,6 @@ · 43 unmodified lines | ||
| 44 | 44 | MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>"); |
| 45 | 45 | MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver"); |
| 46 | 46 | MODULE_LICENSE("GPL"); |
| 47 | −MODULE_SUPPORTED_DEVICE("Video"); | |
| 48 | − | |
| 49 | − | |
| 50 | − | |
| 51 | 47 | |
| 52 | 48 | struct cafe_camera { |
| 53 | 49 | int registered; /* Fully initialized? */ |
| @@ -2149,4 +2149,3 @@ MODULE_AUTHOR("Yannick Fertre <yannick.fertre@st.com>"); · 2148 unmodified lines | ||
| 2149 | 2149 | MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>"); |
| 2150 | 2150 | MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver"); |
| 2151 | 2151 | MODULE_LICENSE("GPL"); |
| 2152 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -56,7 +56,6 @@ MODULE_PARM_DESC(flicker_mode, "Flicker frequency (0 (disabled), " __stringify(5 · 55 unmodified lines | ||
| 56 | 56 | |
| 57 | 57 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); |
| 58 | 58 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); |
| 59 | −MODULE_SUPPORTED_DEVICE("video"); | |
| 60 | 59 | MODULE_LICENSE("GPL"); |
| 61 | 60 | MODULE_VERSION(CPIA_VERSION); |
| 62 | 61 | |
| @@ -51,7 +51,6 @@ MODULE_PARM_DESC(index, "Index value for tm6000x capture interface(s)."); · 50 unmodified lines | ||
| 51 | 51 | MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards"); |
| 52 | 52 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 53 | 53 | MODULE_LICENSE("GPL v2"); |
| 54 | −MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}"); | |
| 55 | 54 | static unsigned int debug; |
| 56 | 55 | module_param(debug, int, 0644); |
| 57 | 56 | MODULE_PARM_DESC(debug, "enable debug messages"); |
| @@ -23,8 +23,6 @@ MODULE_DESCRIPTION("DVB driver extension module for tm5600/6000/6010 based TV ca · 22 unmodified lines | ||
| 23 | 23 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | 25 | |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}"); | |
| 27 | − | |
| 28 | 26 | static int debug; |
| 29 | 27 | |
| 30 | 28 | module_param(debug, int, 0644); |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); |
| 34 | 34 | MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets"); |
| 35 | −MODULE_SUPPORTED_DEVICE(DRIVER_NAME); | |
| 36 | 35 | MODULE_LICENSE("GPL"); |
| 37 | 36 | MODULE_VERSION("2.1"); |
| 38 | 37 | |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define PCIEFD_DRV_NAME "peak_pciefd" |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("EMS CPC-PCI/PCIe/104P CAN card"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define EMS_PCI_V1_MAX_CHAN 2 |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define EMS_PCMCIA_MAX_CHAN 2 |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>"); |
| 35 | 35 | MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards"); |
| 36 | −MODULE_SUPPORTED_DEVICE("KVASER PCAN PCI CAN card"); | |
| 37 | 36 | MODULE_LICENSE("GPL v2"); |
| 38 | 37 | |
| 39 | 38 | #define MAX_NO_OF_CHANNELS 4 /* max no of channels on a single card */ |
| @@ -24,8 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 26 | 26 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards"); |
| 27 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards"); | |
| 28 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN miniPCIe/cPCI PC/104+ PCI/104e CAN Cards"); | |
| 29 | 27 | MODULE_LICENSE("GPL v2"); |
| 30 | 28 | |
| 31 | 29 | #define DRV_NAME "peak_pci" |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards"); |
| 24 | 24 | MODULE_LICENSE("GPL v2"); |
| 25 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN-PC Card"); | |
| 26 | 25 | |
| 27 | 26 | /* PEAK-System PCMCIA driver name */ |
| 28 | 27 | #define PCC_NAME "peak_pcmcia" |
| @@ -25,18 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>"); |
| 26 | 26 | MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with " |
| 27 | 27 | "the SJA1000 chips"); |
| 28 | −MODULE_SUPPORTED_DEVICE("Adlink PCI-7841/cPCI-7841, " | |
| 29 | − "Adlink PCI-7841/cPCI-7841 SE, " | |
| 30 | − "Marathon CAN-bus-PCI, " | |
| 31 | − "Marathon CAN-bus-PCIe, " | |
| 32 | − "TEWS TECHNOLOGIES TPMC810, " | |
| 33 | − "esd CAN-PCI/CPCI/PCI104/200, " | |
| 34 | − "esd CAN-PCI/PMC/266, " | |
| 35 | − "esd CAN-PCIe/2000, " | |
| 36 | − "Connect Tech Inc. CANpro/104-Plus Opto (CRG001), " | |
| 37 | − "IXXAT PC-I 04/PCI, " | |
| 38 | − "ELCUS CAN-200-PCI, " | |
| 39 | − "ASEM DUAL CAN-RAW") | |
| 40 | 28 | MODULE_LICENSE("GPL v2"); |
| 41 | 29 | |
| 42 | 30 | #define PLX_PCI_MAX_CHAN 2 |
| @@ -18,8 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | #include "pcan_usb_core.h" |
| 20 | 20 | |
| 21 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB adapter"); | |
| 22 | − | |
| 23 | 21 | /* PCAN-USB Endpoints */ |
| 24 | 22 | #define PCAN_USB_EP_CMDOUT 1 |
| 25 | 23 | #define PCAN_USB_EP_CMDIN (PCAN_USB_EP_CMDOUT | USB_DIR_IN) |
| @@ -16,9 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | #include "pcan_usb_core.h" |
| 17 | 17 | #include "pcan_usb_pro.h" |
| 18 | 18 | |
| 19 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter"); | |
| 20 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter"); | |
| 21 | − | |
| 22 | 19 | #define PCAN_USBPROFD_CHANNEL_COUNT 2 |
| 23 | 20 | #define PCAN_USBFD_CHANNEL_COUNT 1 |
| 24 | 21 | |
| @@ -17,8 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | #include "pcan_usb_core.h" |
| 18 | 18 | #include "pcan_usb_pro.h" |
| 19 | 19 | |
| 20 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter"); | |
| 21 | − | |
| 22 | 20 | #define PCAN_USBPRO_CHANNEL_COUNT 2 |
| 23 | 21 | |
| 24 | 22 | /* PCAN-USB Pro adapter internal clock (MHz) */ |
| @@ -2167,7 +2167,6 @@ static void __exit scc_cleanup_driver(void) · 2166 unmodified lines | ||
| 2167 | 2167 | |
| 2168 | 2168 | MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>"); |
| 2169 | 2169 | MODULE_DESCRIPTION("AX.25 Device Driver for Z8530 based HDLC cards"); |
| 2170 | −MODULE_SUPPORTED_DEVICE("Z8530 based SCC cards for Amateur Radio"); | |
| 2171 | 2170 | MODULE_LICENSE("GPL"); |
| 2172 | 2171 | module_init(scc_init_driver); |
| 2173 | 2172 | module_exit(scc_cleanup_driver); |
| @@ -28,7 +28,6 @@ · 27 unmodified lines | ||
| 28 | 28 | MODULE_AUTHOR("Michael Wu <flamingice@sourmilk.net>"); |
| 29 | 29 | MODULE_AUTHOR("Jouni Malinen <j@w1.fi>"); |
| 30 | 30 | MODULE_DESCRIPTION("Driver for IEEE 802.11b wireless cards based on ADMtek ADM8211"); |
| 31 | −MODULE_SUPPORTED_DEVICE("ADM8211"); | |
| 32 | 31 | MODULE_LICENSE("GPL"); |
| 33 | 32 | |
| 34 | 33 | static unsigned int tx_ring_size __read_mostly = 16; |
| @@ -90,7 +90,6 @@ MODULE_PARM_DESC(no_hw_rfkill_switch, "Ignore the GPIO RFKill switch state"); · 89 unmodified lines | ||
| 90 | 90 | MODULE_AUTHOR("Jiri Slaby"); |
| 91 | 91 | MODULE_AUTHOR("Nick Kossifidis"); |
| 92 | 92 | MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards."); |
| 93 | −MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards"); | |
| 94 | 93 | MODULE_LICENSE("Dual BSD/GPL"); |
| 95 | 94 | |
| 96 | 95 | static int ath5k_init(struct ieee80211_hw *hw); |
| @@ -34,7 +34,6 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type); · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | MODULE_AUTHOR("Atheros Communications"); |
| 36 | 36 | MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards."); |
| 37 | −MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); | |
| 38 | 37 | MODULE_LICENSE("Dual BSD/GPL"); |
| 39 | 38 | |
| 40 | 39 | static void ath9k_hw_set_clockrate(struct ath_hw *ah) |
| @@ -37,7 +37,6 @@ static char *dev_info = "ath9k"; · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | MODULE_AUTHOR("Atheros Communications"); |
| 39 | 39 | MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards."); |
| 40 | −MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); | |
| 41 | 40 | MODULE_LICENSE("Dual BSD/GPL"); |
| 42 | 41 | |
| 43 | 42 | static unsigned int ath9k_debug = ATH_DBG_DEFAULT; |
| @@ -75,7 +75,6 @@ · 74 unmodified lines | ||
| 75 | 75 | MODULE_AUTHOR("Simon Kelley"); |
| 76 | 76 | MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); |
| 77 | 77 | MODULE_LICENSE("GPL"); |
| 78 | −MODULE_SUPPORTED_DEVICE("Atmel at76c50x wireless cards"); | |
| 79 | 78 | |
| 80 | 79 | /* The name of the firmware file to be loaded |
| 81 | 80 | over-rides any automatic selection */ |
| @@ -57,7 +57,6 @@ · 56 unmodified lines | ||
| 57 | 57 | MODULE_AUTHOR("Simon Kelley"); |
| 58 | 58 | MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); |
| 59 | 59 | MODULE_LICENSE("GPL"); |
| 60 | −MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards"); | |
| 61 | 60 | |
| 62 | 61 | /*====================================================================*/ |
| 63 | 62 | |
| @@ -16,7 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | MODULE_AUTHOR("Simon Kelley"); |
| 17 | 17 | MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); |
| 18 | 18 | MODULE_LICENSE("GPL"); |
| 19 | −MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards"); | |
| 20 | 19 | |
| 21 | 20 | static const struct pci_device_id card_ids[] = { |
| 22 | 21 | { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID }, |
| @@ -87,7 +87,6 @@ static int n_adapters_found; · 86 unmodified lines | ||
| 87 | 87 | |
| 88 | 88 | MODULE_AUTHOR("Broadcom Corporation"); |
| 89 | 89 | MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver."); |
| 90 | −MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards"); | |
| 91 | 90 | MODULE_LICENSE("Dual BSD/GPL"); |
| 92 | 91 | /* This needs to be adjusted when brcms_firmwares changes */ |
| 93 | 92 | MODULE_FIRMWARE("brcm/bcm43xx-0.fw"); |
| @@ -12,7 +12,6 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | MODULE_AUTHOR("Broadcom Corporation"); |
| 14 | 14 | MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities."); |
| 15 | −MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards"); | |
| 16 | 15 | MODULE_LICENSE("Dual BSD/GPL"); |
| 17 | 16 | |
| 18 | 17 | struct sk_buff *brcmu_pkt_buf_get_skb(uint len) |
| @@ -251,7 +251,6 @@ MODULE_AUTHOR("Benjamin Reed"); · 250 unmodified lines | ||
| 251 | 251 | MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet cards. " |
| 252 | 252 | "Direct support for ISA/PCI/MPI cards and support for PCMCIA when used with airo_cs."); |
| 253 | 253 | MODULE_LICENSE("Dual BSD/GPL"); |
| 254 | −MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350"); | |
| 255 | 254 | module_param_hw_array(io, int, ioport, NULL, 0); |
| 256 | 255 | module_param_hw_array(irq, int, irq, NULL, 0); |
| 257 | 256 | module_param_array(rates, int, NULL, 0); |
| @@ -47,7 +47,6 @@ MODULE_DESCRIPTION("Support for Cisco/Aironet 802.11 wireless ethernet " · 46 unmodified lines | ||
| 47 | 47 | "cards. This is the module that links the PCMCIA card " |
| 48 | 48 | "with the airo module."); |
| 49 | 49 | MODULE_LICENSE("Dual BSD/GPL"); |
| 50 | −MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards"); | |
| 51 | 50 | |
| 52 | 51 | /*====================================================================*/ |
| 53 | 52 | |
| @@ -26,7 +26,6 @@ static char *dev_info = "hostap_cs"; · 25 unmodified lines | ||
| 26 | 26 | MODULE_AUTHOR("Jouni Malinen"); |
| 27 | 27 | MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " |
| 28 | 28 | "cards (PC Card)."); |
| 29 | −MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PC Card)"); | |
| 30 | 29 | MODULE_LICENSE("GPL"); |
| 31 | 30 | |
| 32 | 31 | |
| @@ -27,7 +27,6 @@ static char *dev_info = "hostap_pci"; · 26 unmodified lines | ||
| 27 | 27 | MODULE_AUTHOR("Jouni Malinen"); |
| 28 | 28 | MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN " |
| 29 | 29 | "PCI cards."); |
| 30 | −MODULE_SUPPORTED_DEVICE("Intersil Prism2.5-based WLAN PCI cards"); | |
| 31 | 30 | MODULE_LICENSE("GPL"); |
| 32 | 31 | |
| 33 | 32 | |
| @@ -30,7 +30,6 @@ static char *dev_info = "hostap_plx"; · 29 unmodified lines | ||
| 30 | 30 | MODULE_AUTHOR("Jouni Malinen"); |
| 31 | 31 | MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " |
| 32 | 32 | "cards (PLX)."); |
| 33 | −MODULE_SUPPORTED_DEVICE("Intersil Prism2-based WLAN cards (PLX)"); | |
| 34 | 33 | MODULE_LICENSE("GPL"); |
| 35 | 34 | |
| 36 | 35 | |
| @@ -1821,7 +1821,6 @@ static const struct pci_device_id rt2400pci_device_table[] = { · 1820 unmodified lines | ||
| 1821 | 1821 | MODULE_AUTHOR(DRV_PROJECT); |
| 1822 | 1822 | MODULE_VERSION(DRV_VERSION); |
| 1823 | 1823 | MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver."); |
| 1824 | −MODULE_SUPPORTED_DEVICE("Ralink RT2460 PCI & PCMCIA chipset based cards"); | |
| 1825 | 1824 | MODULE_DEVICE_TABLE(pci, rt2400pci_device_table); |
| 1826 | 1825 | MODULE_LICENSE("GPL"); |
| 1827 | 1826 | |
| @@ -2119,7 +2119,6 @@ static const struct pci_device_id rt2500pci_device_table[] = { · 2118 unmodified lines | ||
| 2119 | 2119 | MODULE_AUTHOR(DRV_PROJECT); |
| 2120 | 2120 | MODULE_VERSION(DRV_VERSION); |
| 2121 | 2121 | MODULE_DESCRIPTION("Ralink RT2500 PCI & PCMCIA Wireless LAN driver."); |
| 2122 | −MODULE_SUPPORTED_DEVICE("Ralink RT2560 PCI & PCMCIA chipset based cards"); | |
| 2123 | 2122 | MODULE_DEVICE_TABLE(pci, rt2500pci_device_table); |
| 2124 | 2123 | MODULE_LICENSE("GPL"); |
| 2125 | 2124 | |
| @@ -1956,7 +1956,6 @@ static const struct usb_device_id rt2500usb_device_table[] = { · 1955 unmodified lines | ||
| 1956 | 1956 | MODULE_AUTHOR(DRV_PROJECT); |
| 1957 | 1957 | MODULE_VERSION(DRV_VERSION); |
| 1958 | 1958 | MODULE_DESCRIPTION("Ralink RT2500 USB Wireless LAN driver."); |
| 1959 | −MODULE_SUPPORTED_DEVICE("Ralink RT2570 USB chipset based cards"); | |
| 1960 | 1959 | MODULE_DEVICE_TABLE(usb, rt2500usb_device_table); |
| 1961 | 1960 | MODULE_LICENSE("GPL"); |
| 1962 | 1961 | |
| @@ -439,7 +439,6 @@ static const struct pci_device_id rt2800pci_device_table[] = { · 438 unmodified lines | ||
| 439 | 439 | MODULE_AUTHOR(DRV_PROJECT); |
| 440 | 440 | MODULE_VERSION(DRV_VERSION); |
| 441 | 441 | MODULE_DESCRIPTION("Ralink RT2800 PCI & PCMCIA Wireless LAN driver."); |
| 442 | −MODULE_SUPPORTED_DEVICE("Ralink RT2860 PCI & PCMCIA chipset based cards"); | |
| 443 | 442 | MODULE_FIRMWARE(FIRMWARE_RT2860); |
| 444 | 443 | MODULE_DEVICE_TABLE(pci, rt2800pci_device_table); |
| 445 | 444 | MODULE_LICENSE("GPL"); |
| @@ -1248,7 +1248,6 @@ static const struct usb_device_id rt2800usb_device_table[] = { · 1247 unmodified lines | ||
| 1248 | 1248 | MODULE_AUTHOR(DRV_PROJECT); |
| 1249 | 1249 | MODULE_VERSION(DRV_VERSION); |
| 1250 | 1250 | MODULE_DESCRIPTION("Ralink RT2800 USB Wireless LAN driver."); |
| 1251 | −MODULE_SUPPORTED_DEVICE("Ralink RT2870 USB chipset based cards"); | |
| 1252 | 1251 | MODULE_DEVICE_TABLE(usb, rt2800usb_device_table); |
| 1253 | 1252 | MODULE_FIRMWARE(FIRMWARE_RT2870); |
| 1254 | 1253 | MODULE_LICENSE("GPL"); |
| @@ -2993,8 +2993,6 @@ static const struct pci_device_id rt61pci_device_table[] = { · 2992 unmodified lines | ||
| 2993 | 2993 | MODULE_AUTHOR(DRV_PROJECT); |
| 2994 | 2994 | MODULE_VERSION(DRV_VERSION); |
| 2995 | 2995 | MODULE_DESCRIPTION("Ralink RT61 PCI & PCMCIA Wireless LAN driver."); |
| 2996 | −MODULE_SUPPORTED_DEVICE("Ralink RT2561, RT2561s & RT2661 " | |
| 2997 | − "PCI & PCMCIA chipset based cards"); | |
| 2998 | 2996 | MODULE_DEVICE_TABLE(pci, rt61pci_device_table); |
| 2999 | 2997 | MODULE_FIRMWARE(FIRMWARE_RT2561); |
| 3000 | 2998 | MODULE_FIRMWARE(FIRMWARE_RT2561s); |
| @@ -2513,7 +2513,6 @@ static const struct usb_device_id rt73usb_device_table[] = { · 2512 unmodified lines | ||
| 2513 | 2513 | MODULE_AUTHOR(DRV_PROJECT); |
| 2514 | 2514 | MODULE_VERSION(DRV_VERSION); |
| 2515 | 2515 | MODULE_DESCRIPTION("Ralink RT73 USB Wireless LAN driver."); |
| 2516 | −MODULE_SUPPORTED_DEVICE("Ralink RT2571W & RT2671 USB chipset based cards"); | |
| 2517 | 2516 | MODULE_DEVICE_TABLE(usb, rt73usb_device_table); |
| 2518 | 2517 | MODULE_FIRMWARE(FIRMWARE_RT2571); |
| 2519 | 2518 | MODULE_LICENSE("GPL"); |
| @@ -441,6 +441,5 @@ module_init(rsi_91x_hal_module_init); · 440 unmodified lines | ||
| 441 | 441 | module_exit(rsi_91x_hal_module_exit); |
| 442 | 442 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 443 | 443 | MODULE_DESCRIPTION("Station driver for RSI 91x devices"); |
| 444 | −MODULE_SUPPORTED_DEVICE("RSI-91x"); | |
| 445 | 444 | MODULE_VERSION("0.1"); |
| 446 | 445 | MODULE_LICENSE("Dual BSD/GPL"); |
| @@ -1571,7 +1571,6 @@ module_exit(rsi_module_exit); · 1570 unmodified lines | ||
| 1571 | 1571 | |
| 1572 | 1572 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 1573 | 1573 | MODULE_DESCRIPTION("Common SDIO layer for RSI drivers"); |
| 1574 | −MODULE_SUPPORTED_DEVICE("RSI-91x"); | |
| 1575 | 1574 | MODULE_DEVICE_TABLE(sdio, rsi_dev_table); |
| 1576 | 1575 | MODULE_FIRMWARE(FIRMWARE_RSI9113); |
| 1577 | 1576 | MODULE_VERSION("0.1"); |
| @@ -928,7 +928,6 @@ module_usb_driver(rsi_driver); · 927 unmodified lines | ||
| 928 | 928 | |
| 929 | 929 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 930 | 930 | MODULE_DESCRIPTION("Common USB layer for RSI drivers"); |
| 931 | −MODULE_SUPPORTED_DEVICE("RSI-91x"); | |
| 932 | 931 | MODULE_DEVICE_TABLE(usb, rsi_dev_table); |
| 933 | 932 | MODULE_FIRMWARE(FIRMWARE_RSI9113); |
| 934 | 933 | MODULE_VERSION("0.1"); |
| @@ -1226,28 +1226,12 @@ static void nvme_keep_alive_end_io(struct request *rq, blk_status_t status) · 1225 unmodified lines | ||
| 1226 | 1226 | queue_delayed_work(nvme_wq, &ctrl->ka_work, ctrl->kato * HZ); |
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | −static int nvme_keep_alive(struct nvme_ctrl *ctrl) | |
| 1230 | −{ | |
| 1231 | − struct request *rq; | |
| 1232 | − | |
| 1233 | − rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd, | |
| 1234 | − BLK_MQ_REQ_RESERVED); | |
| 1235 | − if (IS_ERR(rq)) | |
| 1236 | − return PTR_ERR(rq); | |
| 1237 | − | |
| 1238 | − rq->timeout = ctrl->kato * HZ; | |
| 1239 | − rq->end_io_data = ctrl; | |
| 1240 | − | |
| 1241 | − blk_execute_rq_nowait(NULL, rq, 0, nvme_keep_alive_end_io); | |
| 1242 | − | |
| 1243 | − return 0; | |
| 1244 | −} | |
| 1245 | − | |
| 1246 | 1229 | static void nvme_keep_alive_work(struct work_struct *work) |
| 1247 | 1230 | { |
| 1248 | 1231 | struct nvme_ctrl *ctrl = container_of(to_delayed_work(work), |
| 1249 | 1232 | struct nvme_ctrl, ka_work); |
| 1250 | 1233 | bool comp_seen = ctrl->comp_seen; |
| 1234 | + struct request *rq; | |
| 1251 | 1235 | |
| 1252 | 1236 | if ((ctrl->ctratt & NVME_CTRL_ATTR_TBKAS) && comp_seen) { |
| 1253 | 1237 | dev_dbg(ctrl->device, |
| @@ -1257,12 +1241,18 @@ static void nvme_keep_alive_work(struct work_struct *work) · 3 unmodified lines | ||
| 1257 | 1241 | return; |
| 1258 | 1242 | } |
| 1259 | 1243 | |
| 1260 | − if (nvme_keep_alive(ctrl)) { | |
| 1244 | + rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd, | |
| 1245 | + BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT); | |
| 1246 | + if (IS_ERR(rq)) { | |
| 1261 | 1247 | /* allocation failure, reset the controller */ |
| 1262 | − dev_err(ctrl->device, "keep-alive failed\n"); | |
| 1248 | + dev_err(ctrl->device, "keep-alive failed: %ld\n", PTR_ERR(rq)); | |
| 1263 | 1249 | nvme_reset_ctrl(ctrl); |
| 1264 | 1250 | return; |
| 1265 | 1251 | } |
| 1252 | + | |
| 1253 | + rq->timeout = ctrl->kato * HZ; | |
| 1254 | + rq->end_io_data = ctrl; | |
| 1255 | + blk_execute_rq_nowait(NULL, rq, 0, nvme_keep_alive_end_io); | |
| 1266 | 1256 | } |
| 1267 | 1257 | |
| 1268 | 1258 | static void nvme_start_keep_alive(struct nvme_ctrl *ctrl) |
| @@ -1964,30 +1954,18 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) · 695 unmodified lines | ||
| 1964 | 1954 | blk_queue_max_write_zeroes_sectors(queue, UINT_MAX); |
| 1965 | 1955 | } |
| 1966 | 1956 | |
| 1967 | −static void nvme_config_write_zeroes(struct gendisk *disk, struct nvme_ns *ns) | |
| 1957 | +/* | |
| 1958 | + * Even though NVMe spec explicitly states that MDTS is not applicable to the | |
| 1959 | + * write-zeroes, we are cautious and limit the size to the controllers | |
| 1960 | + * max_hw_sectors value, which is based on the MDTS field and possibly other | |
| 1961 | + * limiting factors. | |
| 1962 | + */ | |
| 1963 | +static void nvme_config_write_zeroes(struct request_queue *q, | |
| 1964 | + struct nvme_ctrl *ctrl) | |
| 1968 | 1965 | { |
| 1969 | − u64 max_blocks; | |
| 1970 | − | |
| 1971 | − if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) || | |
| 1972 | − (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) | |
| 1973 | − return; | |
| 1974 | − /* | |
| 1975 | − * Even though NVMe spec explicitly states that MDTS is not | |
| 1976 | − * applicable to the write-zeroes:- "The restriction does not apply to | |
| 1977 | − * commands that do not transfer data between the host and the | |
| 1978 | − * controller (e.g., Write Uncorrectable ro Write Zeroes command).". | |
| 1979 | − * In order to be more cautious use controller's max_hw_sectors value | |
| 1980 | − * to configure the maximum sectors for the write-zeroes which is | |
| 1981 | − * configured based on the controller's MDTS field in the | |
| 1982 | − * nvme_init_identify() if available. | |
| 1983 | − */ | |
| 1984 | − if (ns->ctrl->max_hw_sectors == UINT_MAX) | |
| 1985 | − max_blocks = (u64)USHRT_MAX + 1; | |
| 1986 | − else | |
| 1987 | − max_blocks = ns->ctrl->max_hw_sectors + 1; | |
| 1988 | − | |
| 1989 | − blk_queue_max_write_zeroes_sectors(disk->queue, | |
| 1990 | − nvme_lba_to_sect(ns, max_blocks)); | |
| 1966 | + if ((ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) && | |
| 1967 | + !(ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) | |
| 1968 | + blk_queue_max_write_zeroes_sectors(q, ctrl->max_hw_sectors); | |
| 1991 | 1969 | } |
| 1992 | 1970 | |
| 1993 | 1971 | static bool nvme_ns_ids_valid(struct nvme_ns_ids *ids) |
| @@ -2159,7 +2137,7 @@ static void nvme_update_disk_info(struct gendisk *disk, · 165 unmodified lines | ||
| 2159 | 2137 | set_capacity_and_notify(disk, capacity); |
| 2160 | 2138 | |
| 2161 | 2139 | nvme_config_discard(disk, ns); |
| 2162 | − nvme_config_write_zeroes(disk, ns); | |
| 2140 | + nvme_config_write_zeroes(disk->queue, ns->ctrl); | |
| 2163 | 2141 | |
| 2164 | 2142 | set_disk_ro(disk, (id->nsattr & NVME_NS_ATTR_RO) || |
| 2165 | 2143 | test_bit(NVME_NS_FORCE_RO, &ns->flags)); |
| @@ -18,6 +18,13 @@ · 17 unmodified lines | ||
| 18 | 18 | /* default is -1: the fail fast mechanism is disabled */ |
| 19 | 19 | #define NVMF_DEF_FAIL_FAST_TMO -1 |
| 20 | 20 | |
| 21 | +/* | |
| 22 | + * Reserved one command for internal usage. This command is used for sending | |
| 23 | + * the connect command, as well as for the keep alive command on the admin | |
| 24 | + * queue once live. | |
| 25 | + */ | |
| 26 | +#define NVMF_RESERVED_TAGS 1 | |
| 27 | + | |
| 21 | 28 | /* |
| 22 | 29 | * Define a host as seen by the target. We allocate one at boot, but also |
| 23 | 30 | * allow the override it when creating controllers. This is both to provide |
| @@ -2863,7 +2863,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) · 2862 unmodified lines | ||
| 2863 | 2863 | memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set)); |
| 2864 | 2864 | ctrl->tag_set.ops = &nvme_fc_mq_ops; |
| 2865 | 2865 | ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size; |
| 2866 | − ctrl->tag_set.reserved_tags = 1; /* fabric connect */ | |
| 2866 | + ctrl->tag_set.reserved_tags = NVMF_RESERVED_TAGS; | |
| 2867 | 2867 | ctrl->tag_set.numa_node = ctrl->ctrl.numa_node; |
| 2868 | 2868 | ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |
| 2869 | 2869 | ctrl->tag_set.cmd_size = |
| @@ -3485,7 +3485,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 615 unmodified lines | ||
| 3485 | 3485 | memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set)); |
| 3486 | 3486 | ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops; |
| 3487 | 3487 | ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH; |
| 3488 | − ctrl->admin_tag_set.reserved_tags = 2; /* fabric connect + Keep-Alive */ | |
| 3488 | + ctrl->admin_tag_set.reserved_tags = NVMF_RESERVED_TAGS; | |
| 3489 | 3489 | ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node; |
| 3490 | 3490 | ctrl->admin_tag_set.cmd_size = |
| 3491 | 3491 | struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv, |
| @@ -736,8 +736,11 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl) · 735 unmodified lines | ||
| 736 | 736 | return ret; |
| 737 | 737 | |
| 738 | 738 | ctrl->ctrl.queue_count = nr_io_queues + 1; |
| 739 | − if (ctrl->ctrl.queue_count < 2) | |
| 740 | − return 0; | |
| 739 | + if (ctrl->ctrl.queue_count < 2) { | |
| 740 | + dev_err(ctrl->ctrl.device, | |
| 741 | + "unable to set any I/O queues\n"); | |
| 742 | + return -ENOMEM; | |
| 743 | + } | |
| 741 | 744 | |
| 742 | 745 | dev_info(ctrl->ctrl.device, |
| 743 | 746 | "creating %d I/O queues.\n", nr_io_queues); |
| @@ -798,7 +801,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 54 unmodified lines | ||
| 798 | 801 | memset(set, 0, sizeof(*set)); |
| 799 | 802 | set->ops = &nvme_rdma_admin_mq_ops; |
| 800 | 803 | set->queue_depth = NVME_AQ_MQ_TAG_DEPTH; |
| 801 | − set->reserved_tags = 2; /* connect + keep-alive */ | |
| 804 | + set->reserved_tags = NVMF_RESERVED_TAGS; | |
| 802 | 805 | set->numa_node = nctrl->numa_node; |
| 803 | 806 | set->cmd_size = sizeof(struct nvme_rdma_request) + |
| 804 | 807 | NVME_RDMA_DATA_SGL_SIZE; |
| @@ -811,7 +814,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 6 unmodified lines | ||
| 811 | 814 | memset(set, 0, sizeof(*set)); |
| 812 | 815 | set->ops = &nvme_rdma_mq_ops; |
| 813 | 816 | set->queue_depth = nctrl->sqsize + 1; |
| 814 | − set->reserved_tags = 1; /* fabric connect */ | |
| 817 | + set->reserved_tags = NVMF_RESERVED_TAGS; | |
| 815 | 818 | set->numa_node = nctrl->numa_node; |
| 816 | 819 | set->flags = BLK_MQ_F_SHOULD_MERGE; |
| 817 | 820 | set->cmd_size = sizeof(struct nvme_rdma_request) + |
| @@ -287,7 +287,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req, · 286 unmodified lines | ||
| 287 | 287 | * directly, otherwise queue io_work. Also, only do that if we |
| 288 | 288 | * are on the same cpu, so we don't introduce contention. |
| 289 | 289 | */ |
| 290 | − if (queue->io_cpu == __smp_processor_id() && | |
| 290 | + if (queue->io_cpu == raw_smp_processor_id() && | |
| 291 | 291 | sync && empty && mutex_trylock(&queue->send_mutex)) { |
| 292 | 292 | queue->more_requests = !last; |
| 293 | 293 | nvme_tcp_send_all(queue); |
| @@ -568,6 +568,13 @@ static int nvme_tcp_setup_h2c_data_pdu(struct nvme_tcp_request *req, · 274 unmodified lines | ||
| 568 | 568 | req->pdu_len = le32_to_cpu(pdu->r2t_length); |
| 569 | 569 | req->pdu_sent = 0; |
| 570 | 570 | |
| 571 | + if (unlikely(!req->pdu_len)) { | |
| 572 | + dev_err(queue->ctrl->ctrl.device, | |
| 573 | + "req %d r2t len is %u, probably a bug...\n", | |
| 574 | + rq->tag, req->pdu_len); | |
| 575 | + return -EPROTO; | |
| 576 | + } | |
| 577 | + | |
| 571 | 578 | if (unlikely(req->data_sent + req->pdu_len > req->data_len)) { |
| 572 | 579 | dev_err(queue->ctrl->ctrl.device, |
| 573 | 580 | "req %d r2t len %u exceeded data len %u (%zu sent)\n", |
| @@ -1575,7 +1582,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 1001 unmodified lines | ||
| 1575 | 1582 | memset(set, 0, sizeof(*set)); |
| 1576 | 1583 | set->ops = &nvme_tcp_admin_mq_ops; |
| 1577 | 1584 | set->queue_depth = NVME_AQ_MQ_TAG_DEPTH; |
| 1578 | − set->reserved_tags = 2; /* connect + keep-alive */ | |
| 1585 | + set->reserved_tags = NVMF_RESERVED_TAGS; | |
| 1579 | 1586 | set->numa_node = nctrl->numa_node; |
| 1580 | 1587 | set->flags = BLK_MQ_F_BLOCKING; |
| 1581 | 1588 | set->cmd_size = sizeof(struct nvme_tcp_request); |
| @@ -1587,7 +1594,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, · 5 unmodified lines | ||
| 1587 | 1594 | memset(set, 0, sizeof(*set)); |
| 1588 | 1595 | set->ops = &nvme_tcp_mq_ops; |
| 1589 | 1596 | set->queue_depth = nctrl->sqsize + 1; |
| 1590 | − set->reserved_tags = 1; /* fabric connect */ | |
| 1597 | + set->reserved_tags = NVMF_RESERVED_TAGS; | |
| 1591 | 1598 | set->numa_node = nctrl->numa_node; |
| 1592 | 1599 | set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING; |
| 1593 | 1600 | set->cmd_size = sizeof(struct nvme_tcp_request); |
| @@ -1745,8 +1752,11 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl) · 151 unmodified lines | ||
| 1745 | 1752 | return ret; |
| 1746 | 1753 | |
| 1747 | 1754 | ctrl->queue_count = nr_io_queues + 1; |
| 1748 | − if (ctrl->queue_count < 2) | |
| 1749 | − return 0; | |
| 1755 | + if (ctrl->queue_count < 2) { | |
| 1756 | + dev_err(ctrl->device, | |
| 1757 | + "unable to set any I/O queues\n"); | |
| 1758 | + return -ENOMEM; | |
| 1759 | + } | |
| 1750 | 1760 | |
| 1751 | 1761 | dev_info(ctrl->device, |
| 1752 | 1762 | "creating %d I/O queues.\n", nr_io_queues); |
| @@ -1118,9 +1118,20 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl) · 1117 unmodified lines | ||
| 1118 | 1118 | { |
| 1119 | 1119 | lockdep_assert_held(&ctrl->lock); |
| 1120 | 1120 | |
| 1121 | − if (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES || | |
| 1122 | − nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES || | |
| 1123 | − nvmet_cc_mps(ctrl->cc) != 0 || | |
| 1121 | + /* | |
| 1122 | + * Only I/O controllers should verify iosqes,iocqes. | |
| 1123 | + * Strictly speaking, the spec says a discovery controller | |
| 1124 | + * should verify iosqes,iocqes are zeroed, however that | |
| 1125 | + * would break backwards compatibility, so don't enforce it. | |
| 1126 | + */ | |
| 1127 | + if (ctrl->subsys->type != NVME_NQN_DISC && | |
| 1128 | + (nvmet_cc_iosqes(ctrl->cc) != NVME_NVM_IOSQES || | |
| 1129 | + nvmet_cc_iocqes(ctrl->cc) != NVME_NVM_IOCQES)) { | |
| 1130 | + ctrl->csts = NVME_CSTS_CFS; | |
| 1131 | + return; | |
| 1132 | + } | |
| 1133 | + | |
| 1134 | + if (nvmet_cc_mps(ctrl->cc) != 0 || | |
| 1124 | 1135 | nvmet_cc_ams(ctrl->cc) != 0 || |
| 1125 | 1136 | nvmet_cc_css(ctrl->cc) != 0) { |
| 1126 | 1137 | ctrl->csts = NVME_CSTS_CFS; |
| @@ -349,7 +349,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl) · 348 unmodified lines | ||
| 349 | 349 | memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set)); |
| 350 | 350 | ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops; |
| 351 | 351 | ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH; |
| 352 | − ctrl->admin_tag_set.reserved_tags = 2; /* connect + keep-alive */ | |
| 352 | + ctrl->admin_tag_set.reserved_tags = NVMF_RESERVED_TAGS; | |
| 353 | 353 | ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node; |
| 354 | 354 | ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) + |
| 355 | 355 | NVME_INLINE_SG_CNT * sizeof(struct scatterlist); |
| @@ -520,7 +520,7 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl) · 164 unmodified lines | ||
| 520 | 520 | memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set)); |
| 521 | 521 | ctrl->tag_set.ops = &nvme_loop_mq_ops; |
| 522 | 522 | ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size; |
| 523 | − ctrl->tag_set.reserved_tags = 1; /* fabric connect */ | |
| 523 | + ctrl->tag_set.reserved_tags = NVMF_RESERVED_TAGS; | |
| 524 | 524 | ctrl->tag_set.numa_node = ctrl->ctrl.numa_node; |
| 525 | 525 | ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |
| 526 | 526 | ctrl->tag_set.cmd_size = sizeof(struct nvme_loop_iod) + |
| @@ -1098,11 +1098,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue) · 1097 unmodified lines | ||
| 1098 | 1098 | cmd->rbytes_done += ret; |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | + nvmet_tcp_unmap_pdu_iovec(cmd); | |
| 1101 | 1102 | if (queue->data_digest) { |
| 1102 | 1103 | nvmet_tcp_prep_recv_ddgst(cmd); |
| 1103 | 1104 | return 0; |
| 1104 | 1105 | } |
| 1105 | − nvmet_tcp_unmap_pdu_iovec(cmd); | |
| 1106 | 1106 | |
| 1107 | 1107 | if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) && |
| 1108 | 1108 | cmd->rbytes_done == cmd->req.transfer_len) { |
| @@ -241,6 +241,5 @@ module_platform_driver_probe(amiga_parallel_driver, amiga_parallel_probe); · 240 unmodified lines | ||
| 241 | 241 | |
| 242 | 242 | MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>"); |
| 243 | 243 | MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port"); |
| 244 | −MODULE_SUPPORTED_DEVICE("Amiga builtin Parallel Port"); | |
| 245 | 244 | MODULE_LICENSE("GPL"); |
| 246 | 245 | MODULE_ALIAS("platform:amiga-parallel"); |
| @@ -218,7 +218,6 @@ static void __exit parport_atari_exit(void) · 217 unmodified lines | ||
| 218 | 218 | |
| 219 | 219 | MODULE_AUTHOR("Andreas Schwab"); |
| 220 | 220 | MODULE_DESCRIPTION("Parport Driver for Atari builtin Port"); |
| 221 | −MODULE_SUPPORTED_DEVICE("Atari builtin Parallel Port"); | |
| 222 | 221 | MODULE_LICENSE("GPL"); |
| 223 | 222 | |
| 224 | 223 | module_init(parport_atari_init) |
| @@ -41,7 +41,6 @@ · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | MODULE_AUTHOR("Helge Deller <deller@gmx.de>"); |
| 43 | 43 | MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver"); |
| 44 | −MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port"); | |
| 45 | 44 | MODULE_LICENSE("GPL"); |
| 46 | 45 | |
| 47 | 46 | |
| @@ -359,7 +359,6 @@ static void __exit parport_mfc3_exit(void) · 358 unmodified lines | ||
| 359 | 359 | |
| 360 | 360 | MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>"); |
| 361 | 361 | MODULE_DESCRIPTION("Parport Driver for Multiface 3 expansion cards Parallel Port"); |
| 362 | −MODULE_SUPPORTED_DEVICE("Multiface 3 Parallel Port"); | |
| 363 | 362 | MODULE_LICENSE("GPL"); |
| 364 | 363 | |
| 365 | 364 | module_init(parport_mfc3_init) |
| @@ -377,6 +377,5 @@ module_platform_driver(bpp_sbus_driver); · 376 unmodified lines | ||
| 377 | 377 | |
| 378 | 378 | MODULE_AUTHOR("Derrick J Brashear"); |
| 379 | 379 | MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port"); |
| 380 | −MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port"); | |
| 381 | 380 | MODULE_VERSION("2.0"); |
| 382 | 381 | MODULE_LICENSE("GPL"); |
| @@ -34,12 +34,11 @@ static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr, · 33 unmodified lines | ||
| 34 | 34 | if (nbytes >= MAX_DRC_NAME_LEN) |
| 35 | 35 | return 0; |
| 36 | 36 | |
| 37 | − memcpy(drc_name, buf, nbytes); | |
| 37 | + strscpy(drc_name, buf, nbytes + 1); | |
| 38 | 38 | |
| 39 | 39 | end = strchr(drc_name, '\n'); |
| 40 | − if (!end) | |
| 41 | − end = &drc_name[nbytes]; | |
| 42 | − *end = '\0'; | |
| 40 | + if (end) | |
| 41 | + *end = '\0'; | |
| 43 | 42 | |
| 44 | 43 | rc = dlpar_add_slot(drc_name); |
| 45 | 44 | if (rc) |
| @@ -65,12 +64,11 @@ static ssize_t remove_slot_store(struct kobject *kobj, · 19 unmodified lines | ||
| 65 | 64 | if (nbytes >= MAX_DRC_NAME_LEN) |
| 66 | 65 | return 0; |
| 67 | 66 | |
| 68 | − memcpy(drc_name, buf, nbytes); | |
| 67 | + strscpy(drc_name, buf, nbytes + 1); | |
| 69 | 68 | |
| 70 | 69 | end = strchr(drc_name, '\n'); |
| 71 | − if (!end) | |
| 72 | − end = &drc_name[nbytes]; | |
| 73 | − *end = '\0'; | |
| 70 | + if (end) | |
| 71 | + *end = '\0'; | |
| 74 | 72 | |
| 75 | 73 | rc = dlpar_remove_slot(drc_name); |
| 76 | 74 | if (rc) |
| @@ -93,8 +93,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) · 92 unmodified lines | ||
| 93 | 93 | pci_dev_put(pdev); |
| 94 | 94 | return -EBUSY; |
| 95 | 95 | } |
| 96 | + pci_dev_put(pdev); | |
| 96 | 97 | |
| 97 | − zpci_remove_device(zdev); | |
| 98 | + zpci_remove_device(zdev, false); | |
| 98 | 99 | |
| 99 | 100 | rc = zpci_disable_device(zdev); |
| 100 | 101 | if (rc) |
| @@ -63,7 +63,6 @@ void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); · 62 unmodified lines | ||
| 63 | 63 | MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>"); |
| 64 | 64 | MODULE_DESCRIPTION("Linux on S/390 DASD device driver," |
| 65 | 65 | " Copyright IBM Corp. 2000"); |
| 66 | −MODULE_SUPPORTED_DEVICE("dasd"); | |
| 67 | 66 | MODULE_LICENSE("GPL"); |
| 68 | 67 | |
| 69 | 68 | /* |
| @@ -50,7 +50,6 @@ MODULE_PARM_DESC(sol_compat, · 49 unmodified lines | ||
| 50 | 50 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); |
| 51 | 51 | MODULE_DESCRIPTION("7-Segment Display driver for Sun Microsystems CP1400/1500"); |
| 52 | 52 | MODULE_LICENSE("GPL"); |
| 53 | −MODULE_SUPPORTED_DEVICE("d7s"); | |
| 54 | 53 | |
| 55 | 54 | struct d7s { |
| 56 | 55 | void __iomem *regs; |
| @@ -80,7 +80,6 @@ · 79 unmodified lines | ||
| 80 | 80 | MODULE_AUTHOR("Hewlett-Packard Company"); |
| 81 | 81 | MODULE_DESCRIPTION("Driver for HP Smart Array Controller version " \ |
| 82 | 82 | HPSA_DRIVER_VERSION); |
| 83 | −MODULE_SUPPORTED_DEVICE("HP Smart Array Controllers"); | |
| 84 | 83 | MODULE_VERSION(HPSA_DRIVER_VERSION); |
| 85 | 84 | MODULE_LICENSE("GPL"); |
| 86 | 85 | MODULE_ALIAS("cciss"); |
| @@ -5784,6 +5784,8 @@ static void ibmvfc_free_mem(struct ibmvfc_host *vhost) · 5783 unmodified lines | ||
| 5784 | 5784 | vhost->disc_buf_dma); |
| 5785 | 5785 | dma_free_coherent(vhost->dev, sizeof(*vhost->login_buf), |
| 5786 | 5786 | vhost->login_buf, vhost->login_buf_dma); |
| 5787 | + dma_free_coherent(vhost->dev, sizeof(*vhost->channel_setup_buf), | |
| 5788 | + vhost->channel_setup_buf, vhost->channel_setup_dma); | |
| 5787 | 5789 | dma_pool_destroy(vhost->sg_pool); |
| 5788 | 5790 | ibmvfc_free_queue(vhost, async_q); |
| 5789 | 5791 | LEAVE; |
| @@ -2421,7 +2421,7 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, · 2420 unmodified lines | ||
| 2421 | 2421 | memset(dstbuf, 0, 33); |
| 2422 | 2422 | size = (nbytes < 32) ? nbytes : 32; |
| 2423 | 2423 | if (copy_from_user(dstbuf, buf, size)) |
| 2424 | − return 0; | |
| 2424 | + return -EFAULT; | |
| 2425 | 2425 | |
| 2426 | 2426 | if (dent == phba->debug_InjErrLBA) { |
| 2427 | 2427 | if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') && |
| @@ -2430,7 +2430,7 @@ lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, · 2 unmodified lines | ||
| 2430 | 2430 | } |
| 2431 | 2431 | |
| 2432 | 2432 | if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp))) |
| 2433 | − return 0; | |
| 2433 | + return -EINVAL; | |
| 2434 | 2434 | |
| 2435 | 2435 | if (dent == phba->debug_writeGuard) |
| 2436 | 2436 | phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; |
| @@ -413,7 +413,7 @@ mpt3sas_get_port_by_id(struct MPT3SAS_ADAPTER *ioc, · 412 unmodified lines | ||
| 413 | 413 | * And add this object to port_table_list. |
| 414 | 414 | */ |
| 415 | 415 | if (!ioc->multipath_on_hba) { |
| 416 | − port = kzalloc(sizeof(struct hba_port), GFP_KERNEL); | |
| 416 | + port = kzalloc(sizeof(struct hba_port), GFP_ATOMIC); | |
| 417 | 417 | if (!port) |
| 418 | 418 | return NULL; |
| 419 | 419 | |
| @@ -2273,12 +2273,12 @@ static void myrs_cleanup(struct myrs_hba *cs) · 2272 unmodified lines | ||
| 2273 | 2273 | if (cs->mmio_base) { |
| 2274 | 2274 | cs->disable_intr(cs); |
| 2275 | 2275 | iounmap(cs->mmio_base); |
| 2276 | + cs->mmio_base = NULL; | |
| 2276 | 2277 | } |
| 2277 | 2278 | if (cs->irq) |
| 2278 | 2279 | free_irq(cs->irq, cs); |
| 2279 | 2280 | if (cs->io_addr) |
| 2280 | 2281 | release_region(cs->io_addr, 0x80); |
| 2281 | − iounmap(cs->mmio_base); | |
| 2282 | 2282 | pci_set_drvdata(pdev, NULL); |
| 2283 | 2283 | pci_disable_device(pdev); |
| 2284 | 2284 | scsi_host_put(cs->host); |
| @@ -55,7 +55,6 @@ · 54 unmodified lines | ||
| 55 | 55 | |
| 56 | 56 | MODULE_AUTHOR("YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>"); |
| 57 | 57 | MODULE_DESCRIPTION("WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI host adapter module"); |
| 58 | −MODULE_SUPPORTED_DEVICE("sd,sr,sg,st"); | |
| 59 | 58 | MODULE_LICENSE("GPL"); |
| 60 | 59 | |
| 61 | 60 | #include "nsp_io.h" |
| @@ -116,7 +116,6 @@ · 115 unmodified lines | ||
| 116 | 116 | (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \ |
| 117 | 117 | QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0)) |
| 118 | 118 | #endif |
| 119 | −#endif | |
| 120 | 119 | |
| 121 | 120 | #define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \ |
| 122 | 121 | ? le16_to_cpu((iocb)->u.isp2x.target.extended) \ |
| @@ -244,6 +243,7 @@ struct ctio_to_2xxx { · 121 unmodified lines | ||
| 244 | 243 | #ifndef CTIO_RET_TYPE |
| 245 | 244 | #define CTIO_RET_TYPE 0x17 /* CTIO return entry */ |
| 246 | 245 | #define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */ |
| 246 | +#endif | |
| 247 | 247 | |
| 248 | 248 | struct fcp_hdr { |
| 249 | 249 | uint8_t r_ctl; |
| @@ -280,27 +280,28 @@ static int sd_zbc_update_wp_offset_cb(struct blk_zone *zone, unsigned int idx, · 279 unmodified lines | ||
| 280 | 280 | static void sd_zbc_update_wp_offset_workfn(struct work_struct *work) |
| 281 | 281 | { |
| 282 | 282 | struct scsi_disk *sdkp; |
| 283 | + unsigned long flags; | |
| 283 | 284 | unsigned int zno; |
| 284 | 285 | int ret; |
| 285 | 286 | |
| 286 | 287 | sdkp = container_of(work, struct scsi_disk, zone_wp_offset_work); |
| 287 | 288 | |
| 288 | − spin_lock_bh(&sdkp->zones_wp_offset_lock); | |
| 289 | + spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags); | |
| 289 | 290 | for (zno = 0; zno < sdkp->nr_zones; zno++) { |
| 290 | 291 | if (sdkp->zones_wp_offset[zno] != SD_ZBC_UPDATING_WP_OFST) |
| 291 | 292 | continue; |
| 292 | 293 | |
| 293 | − spin_unlock_bh(&sdkp->zones_wp_offset_lock); | |
| 294 | + spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags); | |
| 294 | 295 | ret = sd_zbc_do_report_zones(sdkp, sdkp->zone_wp_update_buf, |
| 295 | 296 | SD_BUF_SIZE, |
| 296 | 297 | zno * sdkp->zone_blocks, true); |
| 297 | − spin_lock_bh(&sdkp->zones_wp_offset_lock); | |
| 298 | + spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags); | |
| 298 | 299 | if (!ret) |
| 299 | 300 | sd_zbc_parse_report(sdkp, sdkp->zone_wp_update_buf + 64, |
| 300 | 301 | zno, sd_zbc_update_wp_offset_cb, |
| 301 | 302 | sdkp); |
| 302 | 303 | } |
| 303 | − spin_unlock_bh(&sdkp->zones_wp_offset_lock); | |
| 304 | + spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags); | |
| 304 | 305 | |
| 305 | 306 | scsi_device_put(sdkp->device); |
| 306 | 307 | } |
| @@ -324,6 +325,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 17 unmodified lines | ||
| 324 | 325 | struct request *rq = cmd->request; |
| 325 | 326 | struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); |
| 326 | 327 | unsigned int wp_offset, zno = blk_rq_zone_no(rq); |
| 328 | + unsigned long flags; | |
| 327 | 329 | blk_status_t ret; |
| 328 | 330 | |
| 329 | 331 | ret = sd_zbc_cmnd_checks(cmd); |
| @@ -337,7 +339,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 7 unmodified lines | ||
| 337 | 339 | if (!blk_req_zone_write_trylock(rq)) |
| 338 | 340 | return BLK_STS_ZONE_RESOURCE; |
| 339 | 341 | |
| 340 | − spin_lock_bh(&sdkp->zones_wp_offset_lock); | |
| 342 | + spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags); | |
| 341 | 343 | wp_offset = sdkp->zones_wp_offset[zno]; |
| 342 | 344 | switch (wp_offset) { |
| 343 | 345 | case SD_ZBC_INVALID_WP_OFST: |
| @@ -366,7 +368,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba, · 22 unmodified lines | ||
| 366 | 368 | |
| 367 | 369 | *lba += wp_offset; |
| 368 | 370 | } |
| 369 | − spin_unlock_bh(&sdkp->zones_wp_offset_lock); | |
| 371 | + spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags); | |
| 370 | 372 | if (ret) |
| 371 | 373 | blk_req_zone_write_unlock(rq); |
| 372 | 374 | return ret; |
| @@ -445,6 +447,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 72 unmodified lines | ||
| 445 | 447 | struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); |
| 446 | 448 | unsigned int zno = blk_rq_zone_no(rq); |
| 447 | 449 | enum req_opf op = req_op(rq); |
| 450 | + unsigned long flags; | |
| 448 | 451 | |
| 449 | 452 | /* |
| 450 | 453 | * If we got an error for a command that needs updating the write |
| @@ -452,7 +455,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 1 unmodified line | ||
| 452 | 455 | * invalid to force an update from disk the next time a zone append |
| 453 | 456 | * command is issued. |
| 454 | 457 | */ |
| 455 | − spin_lock_bh(&sdkp->zones_wp_offset_lock); | |
| 458 | + spin_lock_irqsave(&sdkp->zones_wp_offset_lock, flags); | |
| 456 | 459 | |
| 457 | 460 | if (result && op != REQ_OP_ZONE_RESET_ALL) { |
| 458 | 461 | if (op == REQ_OP_ZONE_APPEND) { |
| @@ -496,7 +499,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, · 37 unmodified lines | ||
| 496 | 499 | } |
| 497 | 500 | |
| 498 | 501 | unlock_wp_offset: |
| 499 | − spin_unlock_bh(&sdkp->zones_wp_offset_lock); | |
| 502 | + spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags); | |
| 500 | 503 | |
| 501 | 504 | return good_bytes; |
| 502 | 505 | } |
| @@ -48,7 +48,6 @@ · 47 unmodified lines | ||
| 48 | 48 | MODULE_AUTHOR("Microsemi"); |
| 49 | 49 | MODULE_DESCRIPTION("Driver for Microsemi Smart Family Controller version " |
| 50 | 50 | DRIVER_VERSION); |
| 51 | −MODULE_SUPPORTED_DEVICE("Microsemi Smart Family Controllers"); | |
| 52 | 51 | MODULE_VERSION(DRIVER_VERSION); |
| 53 | 52 | MODULE_LICENSE("GPL"); |
| 54 | 53 | |
| @@ -1269,8 +1269,8 @@ static int st_open(struct inode *inode, struct file *filp) · 1268 unmodified lines | ||
| 1269 | 1269 | spin_lock(&st_use_lock); |
| 1270 | 1270 | if (STp->in_use) { |
| 1271 | 1271 | spin_unlock(&st_use_lock); |
| 1272 | − scsi_tape_put(STp); | |
| 1273 | 1272 | DEBC_printk(STp, "Device already in use.\n"); |
| 1273 | + scsi_tape_put(STp); | |
| 1274 | 1274 | return (-EBUSY); |
| 1275 | 1275 | } |
| 1276 | 1276 | |
| @@ -911,7 +911,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm) · 910 unmodified lines | ||
| 911 | 911 | if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc) |
| 912 | 912 | return; |
| 913 | 913 | |
| 914 | − if (lpm & !hba->vreg_info.vcc->enabled) | |
| 914 | + if (lpm && !hba->vreg_info.vcc->enabled) | |
| 915 | 915 | regulator_set_mode(hba->vreg_info.vccq2->reg, |
| 916 | 916 | REGULATOR_MODE_IDLE); |
| 917 | 917 | else if (!lpm) |
| @@ -30,7 +30,6 @@ · 29 unmodified lines | ||
| 30 | 30 | MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); |
| 31 | 31 | MODULE_DESCRIPTION("Maple bus driver for Dreamcast"); |
| 32 | 32 | MODULE_LICENSE("GPL v2"); |
| 33 | −MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}"); | |
| 34 | 33 | |
| 35 | 34 | static void maple_dma_handler(struct work_struct *work); |
| 36 | 35 | static void maple_vblank_handler(struct work_struct *work); |
| @@ -1433,6 +1433,7 @@ static int cqspi_probe(struct platform_device *pdev) · 1432 unmodified lines | ||
| 1433 | 1433 | cqspi = spi_master_get_devdata(master); |
| 1434 | 1434 | |
| 1435 | 1435 | cqspi->pdev = pdev; |
| 1436 | + platform_set_drvdata(pdev, cqspi); | |
| 1436 | 1437 | |
| 1437 | 1438 | /* Obtain configuration from OF. */ |
| 1438 | 1439 | ret = cqspi_of_get_pdata(cqspi); |
| @@ -1281,7 +1281,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, · 1280 unmodified lines | ||
| 1281 | 1281 | devpriv->amcc + AMCC_OP_REG_INTCSR); |
| 1282 | 1282 | |
| 1283 | 1283 | ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED, |
| 1284 | − dev->board_name, dev); | |
| 1284 | + "cb_pcidas", dev); | |
| 1285 | 1285 | if (ret) { |
| 1286 | 1286 | dev_dbg(dev->class_dev, "unable to allocate irq %d\n", |
| 1287 | 1287 | pcidev->irq); |
| @@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev, · 4034 unmodified lines | ||
| 4035 | 4035 | init_stc_registers(dev); |
| 4036 | 4036 | |
| 4037 | 4037 | retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, |
| 4038 | − dev->board_name, dev); | |
| 4038 | + "cb_pcidas64", dev); | |
| 4039 | 4039 | if (retval) { |
| 4040 | 4040 | dev_dbg(dev->class_dev, "unable to allocate irq %u\n", |
| 4041 | 4041 | pcidev->irq); |
| @@ -877,5 +877,4 @@ module_comedi_usb_driver(vmk80xx_driver, vmk80xx_usb_driver); · 876 unmodified lines | ||
| 877 | 877 | |
| 878 | 878 | MODULE_AUTHOR("Manuel Gebele <forensixs@gmx.de>"); |
| 879 | 879 | MODULE_DESCRIPTION("Velleman USB Board Low-Level Driver"); |
| 880 | −MODULE_SUPPORTED_DEVICE("K8055/K8061 aka VM110/VM140"); | |
| 881 | 880 | MODULE_LICENSE("GPL"); |
| @@ -150,7 +150,7 @@ struct vnt_cts { · 149 unmodified lines | ||
| 150 | 150 | u16 reserved; |
| 151 | 151 | struct ieee80211_cts data; |
| 152 | 152 | u16 reserved2; |
| 153 | −} __packed; | |
| 153 | +} __packed __aligned(2); | |
| 154 | 154 | |
| 155 | 155 | struct vnt_cts_fb { |
| 156 | 156 | struct vnt_phy_field b; |
| @@ -160,7 +160,7 @@ struct vnt_cts_fb { · 3 unmodified lines | ||
| 160 | 160 | __le16 cts_duration_ba_f1; |
| 161 | 161 | struct ieee80211_cts data; |
| 162 | 162 | u16 reserved2; |
| 163 | −} __packed; | |
| 163 | +} __packed __aligned(2); | |
| 164 | 164 | |
| 165 | 165 | struct vnt_tx_fifo_head { |
| 166 | 166 | u8 tx_key[WLAN_KEY_LEN_CCMP]; |
| @@ -747,7 +747,6 @@ module_platform_driver(optee_driver); · 746 unmodified lines | ||
| 747 | 747 | |
| 748 | 748 | MODULE_AUTHOR("Linaro"); |
| 749 | 749 | MODULE_DESCRIPTION("OP-TEE driver"); |
| 750 | −MODULE_SUPPORTED_DEVICE(""); | |
| 751 | 750 | MODULE_VERSION("1.0"); |
| 752 | 751 | MODULE_LICENSE("GPL v2"); |
| 753 | 752 | MODULE_ALIAS("platform:optee"); |
| @@ -674,6 +674,9 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, · 673 unmodified lines | ||
| 674 | 674 | { |
| 675 | 675 | struct cooling_dev_stats *stats = cdev->stats; |
| 676 | 676 | |
| 677 | + if (!stats) | |
| 678 | + return; | |
| 679 | + | |
| 677 | 680 | spin_lock(&stats->lock); |
| 678 | 681 | |
| 679 | 682 | if (stats->state == new_state) |
| @@ -768,12 +768,6 @@ static int tb_init_port(struct tb_port *port) · 767 unmodified lines | ||
| 768 | 768 | |
| 769 | 769 | tb_dump_port(port->sw->tb, &port->config); |
| 770 | 770 | |
| 771 | − /* Control port does not need HopID allocation */ | |
| 772 | − if (port->port) { | |
| 773 | − ida_init(&port->in_hopids); | |
| 774 | − ida_init(&port->out_hopids); | |
| 775 | − } | |
| 776 | − | |
| 777 | 771 | INIT_LIST_HEAD(&port->list); |
| 778 | 772 | return 0; |
| 779 | 773 | |
| @@ -1842,10 +1836,8 @@ static void tb_switch_release(struct device *dev) · 1062 unmodified lines | ||
| 1842 | 1836 | dma_port_free(sw->dma_port); |
| 1843 | 1837 | |
| 1844 | 1838 | tb_switch_for_each_port(sw, port) { |
| 1845 | − if (!port->disabled) { | |
| 1846 | − ida_destroy(&port->in_hopids); | |
| 1847 | − ida_destroy(&port->out_hopids); | |
| 1848 | − } | |
| 1839 | + ida_destroy(&port->in_hopids); | |
| 1840 | + ida_destroy(&port->out_hopids); | |
| 1849 | 1841 | } |
| 1850 | 1842 | |
| 1851 | 1843 | kfree(sw->uuid); |
| @@ -2025,6 +2017,12 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, · 173 unmodified lines | ||
| 2025 | 2017 | /* minimum setup for tb_find_cap and tb_drom_read to work */ |
| 2026 | 2018 | sw->ports[i].sw = sw; |
| 2027 | 2019 | sw->ports[i].port = i; |
| 2020 | + | |
| 2021 | + /* Control port does not need HopID allocation */ | |
| 2022 | + if (i) { | |
| 2023 | + ida_init(&sw->ports[i].in_hopids); | |
| 2024 | + ida_init(&sw->ports[i].out_hopids); | |
| 2025 | + } | |
| 2028 | 2026 | } |
| 2029 | 2027 | |
| 2030 | 2028 | ret = tb_switch_find_vse_cap(sw, TB_VSE_CAP_PLUG_EVENTS); |
| @@ -138,6 +138,10 @@ static void tb_discover_tunnels(struct tb_switch *sw) · 137 unmodified lines | ||
| 138 | 138 | parent->boot = true; |
| 139 | 139 | parent = tb_switch_parent(parent); |
| 140 | 140 | } |
| 141 | + } else if (tb_tunnel_is_dp(tunnel)) { | |
| 142 | + /* Keep the domain from powering down */ | |
| 143 | + pm_runtime_get_sync(&tunnel->src_port->sw->dev); | |
| 144 | + pm_runtime_get_sync(&tunnel->dst_port->sw->dev); | |
| 141 | 145 | } |
| 142 | 146 | |
| 143 | 147 | list_add_tail(&tunnel->list, &tcm->tunnel_list); |
| @@ -1639,8 +1639,6 @@ module_exit(icom_exit); · 1638 unmodified lines | ||
| 1639 | 1639 | |
| 1640 | 1640 | MODULE_AUTHOR("Michael Anderson <mjanders@us.ibm.com>"); |
| 1641 | 1641 | MODULE_DESCRIPTION("IBM iSeries Serial IOA driver"); |
| 1642 | −MODULE_SUPPORTED_DEVICE | |
| 1643 | − ("IBM iSeries 2745, 2771, 2772, 2742, 2793 and 2805 Communications adapters"); | |
| 1644 | 1642 | MODULE_LICENSE("GPL"); |
| 1645 | 1643 | MODULE_FIRMWARE("icom_call_setup.bin"); |
| 1646 | 1644 | MODULE_FIRMWARE("icom_res_dce.bin"); |
| @@ -19,7 +19,6 @@ · 18 unmodified lines | ||
| 19 | 19 | MODULE_AUTHOR("Digi International, https://www.digi.com"); |
| 20 | 20 | MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line"); |
| 21 | 21 | MODULE_LICENSE("GPL"); |
| 22 | −MODULE_SUPPORTED_DEVICE("jsm"); | |
| 23 | 22 | |
| 24 | 23 | #define JSM_DRIVER_NAME "jsm" |
| 25 | 24 | #define NR_PORTS 32 |
| @@ -2197,7 +2197,10 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device *pdev, · 2196 unmodified lines | ||
| 2197 | 2197 | * inverted in the first TDs isoc TRB. |
| 2198 | 2198 | */ |
| 2199 | 2199 | field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) | |
| 2200 | − start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count); | |
| 2200 | + TRB_SIA | TRB_TBC(burst_count); | |
| 2201 | + | |
| 2202 | + if (!start_cycle) | |
| 2203 | + field |= TRB_CYCLE; | |
| 2201 | 2204 | |
| 2202 | 2205 | /* Fill the rest of the TRB fields, and remaining normal TRBs. */ |
| 2203 | 2206 | for (i = 0; i < trbs_per_td; i++) { |
| @@ -783,8 +783,6 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) · 782 unmodified lines | ||
| 783 | 783 | |
| 784 | 784 | trace_dwc3_gadget_ep_disable(dep); |
| 785 | 785 | |
| 786 | − dwc3_remove_requests(dwc, dep); | |
| 787 | − | |
| 788 | 786 | /* make sure HW endpoint isn't stalled */ |
| 789 | 787 | if (dep->flags & DWC3_EP_STALL) |
| 790 | 788 | __dwc3_gadget_ep_set_halt(dep, 0, false); |
| @@ -803,6 +801,8 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) · 12 unmodified lines | ||
| 803 | 801 | dep->endpoint.desc = NULL; |
| 804 | 802 | } |
| 805 | 803 | |
| 804 | + dwc3_remove_requests(dwc, dep); | |
| 805 | + | |
| 806 | 806 | return 0; |
| 807 | 807 | } |
| 808 | 808 | |
| @@ -1617,7 +1617,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · 808 unmodified lines | ||
| 1617 | 1617 | { |
| 1618 | 1618 | struct dwc3 *dwc = dep->dwc; |
| 1619 | 1619 | |
| 1620 | − if (!dep->endpoint.desc || !dwc->pullups_connected) { | |
| 1620 | + if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) { | |
| 1621 | 1621 | dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n", |
| 1622 | 1622 | dep->name); |
| 1623 | 1623 | return -ESHUTDOWN; |
| @@ -2247,6 +2247,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 623 unmodified lines | ||
| 2247 | 2247 | if (!is_on) { |
| 2248 | 2248 | u32 count; |
| 2249 | 2249 | |
| 2250 | + dwc->connected = false; | |
| 2250 | 2251 | /* |
| 2251 | 2252 | * In the Synopsis DesignWare Cores USB3 Databook Rev. 3.30a |
| 2252 | 2253 | * Section 4.1.8 Table 4-7, it states that for a device-initiated |
| @@ -2271,7 +2272,6 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) · 18 unmodified lines | ||
| 2271 | 2272 | dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) % |
| 2272 | 2273 | dwc->ev_buf->length; |
| 2273 | 2274 | } |
| 2274 | − dwc->connected = false; | |
| 2275 | 2275 | } else { |
| 2276 | 2276 | __dwc3_gadget_start(dwc); |
| 2277 | 2277 | } |
| @@ -3329,8 +3329,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) · 1051 unmodified lines | ||
| 3329 | 3329 | { |
| 3330 | 3330 | u32 reg; |
| 3331 | 3331 | |
| 3332 | − dwc->connected = true; | |
| 3333 | − | |
| 3334 | 3332 | /* |
| 3335 | 3333 | * WORKAROUND: DWC3 revisions <1.88a have an issue which |
| 3336 | 3334 | * would cause a missing Disconnect Event if there's a |
| @@ -3370,6 +3368,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) · 33 unmodified lines | ||
| 3370 | 3368 | * transfers." |
| 3371 | 3369 | */ |
| 3372 | 3370 | dwc3_stop_active_transfers(dwc); |
| 3371 | + dwc->connected = true; | |
| 3373 | 3372 | |
| 3374 | 3373 | reg = dwc3_readl(dwc->regs, DWC3_DCTL); |
| 3375 | 3374 | reg &= ~DWC3_DCTL_TSTCTRL_MASK; |
| @@ -97,6 +97,8 @@ struct gadget_config_name { · 96 unmodified lines | ||
| 97 | 97 | struct list_head list; |
| 98 | 98 | }; |
| 99 | 99 | |
| 100 | +#define USB_MAX_STRING_WITH_NULL_LEN (USB_MAX_STRING_LEN+1) | |
| 101 | + | |
| 100 | 102 | static int usb_string_copy(const char *s, char **s_copy) |
| 101 | 103 | { |
| 102 | 104 | int ret; |
| @@ -106,12 +108,16 @@ static int usb_string_copy(const char *s, char **s_copy) · 3 unmodified lines | ||
| 106 | 108 | if (ret > USB_MAX_STRING_LEN) |
| 107 | 109 | return -EOVERFLOW; |
| 108 | 110 | |
| 109 | − str = kstrdup(s, GFP_KERNEL); | |
| 110 | − if (!str) | |
| 111 | − return -ENOMEM; | |
| 111 | + if (copy) { | |
| 112 | + str = copy; | |
| 113 | + } else { | |
| 114 | + str = kmalloc(USB_MAX_STRING_WITH_NULL_LEN, GFP_KERNEL); | |
| 115 | + if (!str) | |
| 116 | + return -ENOMEM; | |
| 117 | + } | |
| 118 | + strcpy(str, s); | |
| 112 | 119 | if (str[ret - 1] == '\n') |
| 113 | 120 | str[ret - 1] = '\0'; |
| 114 | − kfree(copy); | |
| 115 | 121 | *s_copy = str; |
| 116 | 122 | return 0; |
| 117 | 123 | } |
| @@ -117,7 +117,6 @@ MODULE_DEVICE_TABLE(usb, ld_usb_table); · 116 unmodified lines | ||
| 117 | 117 | MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>"); |
| 118 | 118 | MODULE_DESCRIPTION("LD USB Driver"); |
| 119 | 119 | MODULE_LICENSE("GPL"); |
| 120 | −MODULE_SUPPORTED_DEVICE("LD USB Devices"); | |
| 121 | 120 | |
| 122 | 121 | /* All interrupt in transfers are collected in a ring buffer to |
| 123 | 122 | * avoid racing conditions and get better performance of the driver. |
| @@ -656,6 +656,13 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) · 655 unmodified lines | ||
| 656 | 656 | need_auto_sense = 1; |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | + /* Some devices (Kindle) require another command after SYNC CACHE */ | |
| 660 | + if ((us->fflags & US_FL_SENSE_AFTER_SYNC) && | |
| 661 | + srb->cmnd[0] == SYNCHRONIZE_CACHE) { | |
| 662 | + usb_stor_dbg(us, "-- sense after SYNC CACHE\n"); | |
| 663 | + need_auto_sense = 1; | |
| 664 | + } | |
| 665 | + | |
| 659 | 666 | /* |
| 660 | 667 | * If we have a failure, we're going to do a REQUEST_SENSE |
| 661 | 668 | * automatically. Note that we differentiate between a command |
| @@ -2211,6 +2211,18 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, · 2210 unmodified lines | ||
| 2211 | 2211 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
| 2212 | 2212 | US_FL_NO_READ_DISC_INFO ), |
| 2213 | 2213 | |
| 2214 | +/* | |
| 2215 | + * Reported by Matthias Schwarzott <zzam@gentoo.org> | |
| 2216 | + * The Amazon Kindle treats SYNCHRONIZE CACHE as an indication that | |
| 2217 | + * the host may be finished with it, and automatically ejects its | |
| 2218 | + * emulated media unless it receives another command within one second. | |
| 2219 | + */ | |
| 2220 | +UNUSUAL_DEV( 0x1949, 0x0004, 0x0000, 0x9999, | |
| 2221 | + "Amazon", | |
| 2222 | + "Kindle", | |
| 2223 | + USB_SC_DEVICE, USB_PR_DEVICE, NULL, | |
| 2224 | + US_FL_SENSE_AFTER_SYNC ), | |
| 2225 | + | |
| 2214 | 2226 | /* |
| 2215 | 2227 | * Reported by Oliver Neukum <oneukum@suse.com> |
| 2216 | 2228 | * This device morphes spontaneously into another device if the access |
| @@ -945,6 +945,7 @@ static int tcpm_set_current_limit(struct tcpm_port *port, u32 max_ma, u32 mv) · 944 unmodified lines | ||
| 945 | 945 | |
| 946 | 946 | port->supply_voltage = mv; |
| 947 | 947 | port->current_limit = max_ma; |
| 948 | + power_supply_changed(port->psy); | |
| 948 | 949 | |
| 949 | 950 | if (port->tcpc->set_current_limit) |
| 950 | 951 | ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv); |
| @@ -2931,6 +2932,7 @@ static int tcpm_pd_select_pdo(struct tcpm_port *port, int *sink_pdo, · 1980 unmodified lines | ||
| 2931 | 2932 | |
| 2932 | 2933 | port->pps_data.supported = false; |
| 2933 | 2934 | port->usb_type = POWER_SUPPLY_USB_TYPE_PD; |
| 2935 | + power_supply_changed(port->psy); | |
| 2934 | 2936 | |
| 2935 | 2937 | /* |
| 2936 | 2938 | * Select the source PDO providing the most power which has a |
| @@ -2955,6 +2957,7 @@ static int tcpm_pd_select_pdo(struct tcpm_port *port, int *sink_pdo, · 18 unmodified lines | ||
| 2955 | 2957 | port->pps_data.supported = true; |
| 2956 | 2958 | port->usb_type = |
| 2957 | 2959 | POWER_SUPPLY_USB_TYPE_PD_PPS; |
| 2960 | + power_supply_changed(port->psy); | |
| 2958 | 2961 | } |
| 2959 | 2962 | continue; |
| 2960 | 2963 | default: |
| @@ -3112,6 +3115,7 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) · 151 unmodified lines | ||
| 3112 | 3115 | port->pps_data.out_volt)); |
| 3113 | 3116 | port->pps_data.op_curr = min(port->pps_data.max_curr, |
| 3114 | 3117 | port->pps_data.op_curr); |
| 3118 | + power_supply_changed(port->psy); | |
| 3115 | 3119 | } |
| 3116 | 3120 | |
| 3117 | 3121 | return src_pdo; |
| @@ -3347,6 +3351,7 @@ static int tcpm_set_charge(struct tcpm_port *port, bool charge) · 229 unmodified lines | ||
| 3347 | 3351 | return ret; |
| 3348 | 3352 | } |
| 3349 | 3353 | port->vbus_charge = charge; |
| 3354 | + power_supply_changed(port->psy); | |
| 3350 | 3355 | return 0; |
| 3351 | 3356 | } |
| 3352 | 3357 | |
| @@ -3530,6 +3535,7 @@ static void tcpm_reset_port(struct tcpm_port *port) · 177 unmodified lines | ||
| 3530 | 3535 | port->try_src_count = 0; |
| 3531 | 3536 | port->try_snk_count = 0; |
| 3532 | 3537 | port->usb_type = POWER_SUPPLY_USB_TYPE_C; |
| 3538 | + power_supply_changed(port->psy); | |
| 3533 | 3539 | port->nr_sink_caps = 0; |
| 3534 | 3540 | port->sink_cap_done = false; |
| 3535 | 3541 | if (port->tcpc->enable_frs) |
| @@ -5219,7 +5225,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work) · 1683 unmodified lines | ||
| 5219 | 5225 | goto unlock; |
| 5220 | 5226 | |
| 5221 | 5227 | /* Send when the state machine is idle */ |
| 5222 | − if (port->state != SNK_READY || port->vdm_state != VDM_STATE_DONE || port->send_discover) | |
| 5228 | + if (port->state != SNK_READY || port->vdm_sm_running || port->send_discover) | |
| 5223 | 5229 | goto resched; |
| 5224 | 5230 | |
| 5225 | 5231 | port->upcoming_state = GET_SINK_CAP; |
| @@ -5957,7 +5963,7 @@ static int tcpm_psy_set_prop(struct power_supply *psy, · 731 unmodified lines | ||
| 5957 | 5963 | ret = -EINVAL; |
| 5958 | 5964 | break; |
| 5959 | 5965 | } |
| 5960 | − | |
| 5966 | + power_supply_changed(port->psy); | |
| 5961 | 5967 | return ret; |
| 5962 | 5968 | } |
| 5963 | 5969 | |
| @@ -6110,6 +6116,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc) · 146 unmodified lines | ||
| 6110 | 6116 | err = devm_tcpm_psy_register(port); |
| 6111 | 6117 | if (err) |
| 6112 | 6118 | goto out_role_sw_put; |
| 6119 | + power_supply_changed(port->psy); | |
| 6113 | 6120 | |
| 6114 | 6121 | port->typec_port = typec_register_port(port->dev, &port->typec_caps); |
| 6115 | 6122 | if (IS_ERR(port->typec_port)) { |
| @@ -53,7 +53,6 @@ enum { · 52 unmodified lines | ||
| 53 | 53 | struct tps6598x_rx_identity_reg { |
| 54 | 54 | u8 status; |
| 55 | 55 | struct usb_pd_identity identity; |
| 56 | − u32 vdo[3]; | |
| 57 | 56 | } __packed; |
| 58 | 57 | |
| 59 | 58 | /* Standard Task return codes */ |
| @@ -174,7 +174,7 @@ static ssize_t usbip_sockfd_store(struct device *dev, · 173 unmodified lines | ||
| 174 | 174 | |
| 175 | 175 | udc->ud.tcp_socket = socket; |
| 176 | 176 | udc->ud.tcp_rx = tcp_rx; |
| 177 | − udc->ud.tcp_rx = tcp_tx; | |
| 177 | + udc->ud.tcp_tx = tcp_tx; | |
| 178 | 178 | udc->ud.status = SDEV_ST_USED; |
| 179 | 179 | |
| 180 | 180 | spin_unlock_irq(&udc->ud.lock); |
| @@ -431,8 +431,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 430 unmodified lines | ||
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | adapter = vdpa_alloc_device(struct ifcvf_adapter, vdpa, |
| 434 | − dev, &ifc_vdpa_ops, | |
| 435 | − IFCVF_MAX_QUEUE_PAIRS * 2, NULL); | |
| 434 | + dev, &ifc_vdpa_ops, NULL); | |
| 436 | 435 | if (adapter == NULL) { |
| 437 | 436 | IFCVF_ERR(pdev, "Failed to allocate vDPA structure"); |
| 438 | 437 | return -ENOMEM; |
| @@ -456,7 +455,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 17 unmodified lines | ||
| 456 | 455 | for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) |
| 457 | 456 | vf->vring[i].irq = -EINVAL; |
| 458 | 457 | |
| 459 | − ret = vdpa_register_device(&adapter->vdpa); | |
| 458 | + ret = vdpa_register_device(&adapter->vdpa, IFCVF_MAX_QUEUE_PAIRS * 2); | |
| 460 | 459 | if (ret) { |
| 461 | 460 | IFCVF_ERR(pdev, "Failed to register ifcvf to vdpa bus"); |
| 462 | 461 | goto err; |
| @@ -1982,7 +1982,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, · 1981 unmodified lines | ||
| 1982 | 1982 | max_vqs = min_t(u32, max_vqs, MLX5_MAX_SUPPORTED_VQS); |
| 1983 | 1983 | |
| 1984 | 1984 | ndev = vdpa_alloc_device(struct mlx5_vdpa_net, mvdev.vdev, mdev->device, &mlx5_vdpa_ops, |
| 1985 | − 2 * mlx5_vdpa_max_qps(max_vqs), NULL); | |
| 1985 | + NULL); | |
| 1986 | 1986 | if (IS_ERR(ndev)) |
| 1987 | 1987 | return PTR_ERR(ndev); |
| 1988 | 1988 | |
| @@ -2009,7 +2009,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, · 20 unmodified lines | ||
| 2009 | 2009 | if (err) |
| 2010 | 2010 | goto err_res; |
| 2011 | 2011 | |
| 2012 | − err = vdpa_register_device(&mvdev->vdev); | |
| 2012 | + err = vdpa_register_device(&mvdev->vdev, 2 * mlx5_vdpa_max_qps(max_vqs)); | |
| 2013 | 2013 | if (err) |
| 2014 | 2014 | goto err_reg; |
| 2015 | 2015 | |
| @@ -69,7 +69,6 @@ static void vdpa_release_dev(struct device *d) · 68 unmodified lines | ||
| 69 | 69 | * initialized but before registered. |
| 70 | 70 | * @parent: the parent device |
| 71 | 71 | * @config: the bus operations that is supported by this device |
| 72 | − * @nvqs: number of virtqueues supported by this device | |
| 73 | 72 | * @size: size of the parent structure that contains private data |
| 74 | 73 | * @name: name of the vdpa device; optional. |
| 75 | 74 | * |
| @@ -81,7 +80,7 @@ static void vdpa_release_dev(struct device *d) · 5 unmodified lines | ||
| 81 | 80 | */ |
| 82 | 81 | struct vdpa_device *__vdpa_alloc_device(struct device *parent, |
| 83 | 82 | const struct vdpa_config_ops *config, |
| 84 | − int nvqs, size_t size, const char *name) | |
| 83 | + size_t size, const char *name) | |
| 85 | 84 | { |
| 86 | 85 | struct vdpa_device *vdev; |
| 87 | 86 | int err = -EINVAL; |
| @@ -107,7 +106,6 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, · 19 unmodified lines | ||
| 107 | 106 | vdev->index = err; |
| 108 | 107 | vdev->config = config; |
| 109 | 108 | vdev->features_valid = false; |
| 110 | − vdev->nvqs = nvqs; | |
| 111 | 109 | |
| 112 | 110 | if (name) |
| 113 | 111 | err = dev_set_name(&vdev->dev, "%s", name); |
| @@ -136,10 +134,12 @@ static int vdpa_name_match(struct device *dev, const void *data) · 22 unmodified lines | ||
| 136 | 134 | return (strcmp(dev_name(&vdev->dev), data) == 0); |
| 137 | 135 | } |
| 138 | 136 | |
| 139 | −static int __vdpa_register_device(struct vdpa_device *vdev) | |
| 137 | +static int __vdpa_register_device(struct vdpa_device *vdev, int nvqs) | |
| 140 | 138 | { |
| 141 | 139 | struct device *dev; |
| 142 | 140 | |
| 141 | + vdev->nvqs = nvqs; | |
| 142 | + | |
| 143 | 143 | lockdep_assert_held(&vdpa_dev_mutex); |
| 144 | 144 | dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match); |
| 145 | 145 | if (dev) { |
| @@ -155,15 +155,16 @@ static int __vdpa_register_device(struct vdpa_device *vdev) · 9 unmodified lines | ||
| 155 | 155 | * Caller must invoke this routine in the management device dev_add() |
| 156 | 156 | * callback after setting up valid mgmtdev for this vdpa device. |
| 157 | 157 | * @vdev: the vdpa device to be registered to vDPA bus |
| 158 | + * @nvqs: number of virtqueues supported by this device | |
| 158 | 159 | * |
| 159 | 160 | * Returns an error when fail to add device to vDPA bus |
| 160 | 161 | */ |
| 161 | −int _vdpa_register_device(struct vdpa_device *vdev) | |
| 162 | +int _vdpa_register_device(struct vdpa_device *vdev, int nvqs) | |
| 162 | 163 | { |
| 163 | 164 | if (!vdev->mdev) |
| 164 | 165 | return -EINVAL; |
| 165 | 166 | |
| 166 | − return __vdpa_register_device(vdev); | |
| 167 | + return __vdpa_register_device(vdev, nvqs); | |
| 167 | 168 | } |
| 168 | 169 | EXPORT_SYMBOL_GPL(_vdpa_register_device); |
| 169 | 170 | |
| @@ -171,15 +172,16 @@ EXPORT_SYMBOL_GPL(_vdpa_register_device); · 1 unmodified line | ||
| 171 | 172 | * vdpa_register_device - register a vDPA device |
| 172 | 173 | * Callers must have a succeed call of vdpa_alloc_device() before. |
| 173 | 174 | * @vdev: the vdpa device to be registered to vDPA bus |
| 175 | + * @nvqs: number of virtqueues supported by this device | |
| 174 | 176 | * |
| 175 | 177 | * Returns an error when fail to add to vDPA bus |
| 176 | 178 | */ |
| 177 | −int vdpa_register_device(struct vdpa_device *vdev) | |
| 179 | +int vdpa_register_device(struct vdpa_device *vdev, int nvqs) | |
| 178 | 180 | { |
| 179 | 181 | int err; |
| 180 | 182 | |
| 181 | 183 | mutex_lock(&vdpa_dev_mutex); |
| 182 | − err = __vdpa_register_device(vdev); | |
| 184 | + err = __vdpa_register_device(vdev, nvqs); | |
| 183 | 185 | mutex_unlock(&vdpa_dev_mutex); |
| 184 | 186 | return err; |
| 185 | 187 | } |
| @@ -235,7 +235,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr) · 234 unmodified lines | ||
| 235 | 235 | ops = &vdpasim_config_ops; |
| 236 | 236 | |
| 237 | 237 | vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops, |
| 238 | − dev_attr->nvqs, dev_attr->name); | |
| 238 | + dev_attr->name); | |
| 239 | 239 | if (!vdpasim) |
| 240 | 240 | goto err_alloc; |
| 241 | 241 | |
| @@ -110,8 +110,7 @@ out: · 109 unmodified lines | ||
| 110 | 110 | |
| 111 | 111 | static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config) |
| 112 | 112 | { |
| 113 | − struct virtio_net_config *net_config = | |
| 114 | − (struct virtio_net_config *)config; | |
| 113 | + struct virtio_net_config *net_config = config; | |
| 115 | 114 | |
| 116 | 115 | net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500); |
| 117 | 116 | net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); |
| @@ -147,7 +146,7 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name) · 29 unmodified lines | ||
| 147 | 146 | if (IS_ERR(simdev)) |
| 148 | 147 | return PTR_ERR(simdev); |
| 149 | 148 | |
| 150 | − ret = _vdpa_register_device(&simdev->vdpa); | |
| 149 | + ret = _vdpa_register_device(&simdev->vdpa, VDPASIM_NET_VQ_NUM); | |
| 151 | 150 | if (ret) |
| 152 | 151 | goto reg_err; |
| 153 | 152 | |
| @@ -21,8 +21,8 @@ config VFIO_VIRQFD · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | menuconfig VFIO |
| 23 | 23 | tristate "VFIO Non-Privileged userspace driver framework" |
| 24 | − depends on IOMMU_API | |
| 25 | − select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64) | |
| 24 | + select IOMMU_API | |
| 25 | + select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64) | |
| 26 | 26 | help |
| 27 | 27 | VFIO provides a framework for secure userspace device drivers. |
| 28 | 28 | See Documentation/driver-api/vfio.rst for more details. |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | 2 | config VFIO_PLATFORM |
| 3 | 3 | tristate "VFIO support for platform devices" |
| 4 | − depends on VFIO && EVENTFD && (ARM || ARM64) | |
| 4 | + depends on VFIO && EVENTFD && (ARM || ARM64 || COMPILE_TEST) | |
| 5 | 5 | select VFIO_VIRQFD |
| 6 | 6 | help |
| 7 | 7 | Support for platform devices with VFIO. This is required to make |
| @@ -12,7 +12,7 @@ config VFIO_PLATFORM · 4 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | config VFIO_AMBA |
| 14 | 14 | tristate "VFIO support for AMBA devices" |
| 15 | − depends on VFIO_PLATFORM && ARM_AMBA | |
| 15 | + depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST) | |
| 16 | 16 | help |
| 17 | 17 | Support for ARM AMBA devices with VFIO. This is required to make |
| 18 | 18 | use of ARM AMBA devices present on the system using the VFIO |
| @@ -189,7 +189,7 @@ static struct vfio_dma *vfio_find_dma(struct vfio_iommu *iommu, · 188 unmodified lines | ||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu, |
| 192 | − dma_addr_t start, size_t size) | |
| 192 | + dma_addr_t start, u64 size) | |
| 193 | 193 | { |
| 194 | 194 | struct rb_node *res = NULL; |
| 195 | 195 | struct rb_node *node = iommu->dma_list.rb_node; |
| @@ -785,7 +785,12 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr, · 589 unmodified lines | ||
| 785 | 785 | return -ENODEV; |
| 786 | 786 | |
| 787 | 787 | ret = vaddr_get_pfns(mm, vaddr, 1, dma->prot, pfn_base, pages); |
| 788 | − if (ret == 1 && do_accounting && !is_invalid_reserved_pfn(*pfn_base)) { | |
| 788 | + if (ret != 1) | |
| 789 | + goto out; | |
| 790 | + | |
| 791 | + ret = 0; | |
| 792 | + | |
| 793 | + if (do_accounting && !is_invalid_reserved_pfn(*pfn_base)) { | |
| 789 | 794 | ret = vfio_lock_acct(dma, 1, true); |
| 790 | 795 | if (ret) { |
| 791 | 796 | put_pfn(*pfn_base, dma->prot); |
| @@ -797,6 +802,7 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr, · 5 unmodified lines | ||
| 797 | 802 | } |
| 798 | 803 | } |
| 799 | 804 | |
| 805 | +out: | |
| 800 | 806 | mmput(mm); |
| 801 | 807 | return ret; |
| 802 | 808 | } |
| @@ -1288,7 +1294,7 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 485 unmodified lines | ||
| 1288 | 1294 | int ret = -EINVAL, retries = 0; |
| 1289 | 1295 | unsigned long pgshift; |
| 1290 | 1296 | dma_addr_t iova = unmap->iova; |
| 1291 | − unsigned long size = unmap->size; | |
| 1297 | + u64 size = unmap->size; | |
| 1292 | 1298 | bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL; |
| 1293 | 1299 | bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR; |
| 1294 | 1300 | struct rb_node *n, *first_n; |
| @@ -1304,14 +1310,12 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu, · 9 unmodified lines | ||
| 1304 | 1310 | if (unmap_all) { |
| 1305 | 1311 | if (iova || size) |
| 1306 | 1312 | goto unlock; |
| 1307 | − size = SIZE_MAX; | |
| 1308 | − } else if (!size || size & (pgsize - 1)) { | |
| 1313 | + size = U64_MAX; | |
| 1314 | + } else if (!size || size & (pgsize - 1) || | |
| 1315 | + iova + size - 1 < iova || size > SIZE_MAX) { | |
| 1309 | 1316 | goto unlock; |
| 1310 | 1317 | } |
| 1311 | 1318 | |
| 1312 | − if (iova + size - 1 < iova || size > SIZE_MAX) | |
| 1313 | − goto unlock; | |
| 1314 | − | |
| 1315 | 1319 | /* When dirty tracking is enabled, allow only min supported pgsize */ |
| 1316 | 1320 | if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) && |
| 1317 | 1321 | (!iommu->dirty_page_tracking || (bitmap->pgsize != pgsize))) { |
| @@ -308,8 +308,10 @@ static long vhost_vdpa_get_vring_num(struct vhost_vdpa *v, u16 __user *argp) · 307 unmodified lines | ||
| 308 | 308 | |
| 309 | 309 | static void vhost_vdpa_config_put(struct vhost_vdpa *v) |
| 310 | 310 | { |
| 311 | − if (v->config_ctx) | |
| 311 | + if (v->config_ctx) { | |
| 312 | 312 | eventfd_ctx_put(v->config_ctx); |
| 313 | + v->config_ctx = NULL; | |
| 314 | + } | |
| 313 | 315 | } |
| 314 | 316 | |
| 315 | 317 | static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp) |
| @@ -329,8 +331,12 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp) · 13 unmodified lines | ||
| 329 | 331 | if (!IS_ERR_OR_NULL(ctx)) |
| 330 | 332 | eventfd_ctx_put(ctx); |
| 331 | 333 | |
| 332 | − if (IS_ERR(v->config_ctx)) | |
| 333 | − return PTR_ERR(v->config_ctx); | |
| 334 | + if (IS_ERR(v->config_ctx)) { | |
| 335 | + long ret = PTR_ERR(v->config_ctx); | |
| 336 | + | |
| 337 | + v->config_ctx = NULL; | |
| 338 | + return ret; | |
| 339 | + } | |
| 334 | 340 | |
| 335 | 341 | v->vdpa->config->set_config_cb(v->vdpa, &cb); |
| 336 | 342 | |
| @@ -900,14 +906,10 @@ err: · 563 unmodified lines | ||
| 900 | 906 | |
| 901 | 907 | static void vhost_vdpa_clean_irq(struct vhost_vdpa *v) |
| 902 | 908 | { |
| 903 | − struct vhost_virtqueue *vq; | |
| 904 | 909 | int i; |
| 905 | 910 | |
| 906 | − for (i = 0; i < v->nvqs; i++) { | |
| 907 | − vq = &v->vqs[i]; | |
| 908 | − if (vq->call_ctx.producer.irq) | |
| 909 | − irq_bypass_unregister_producer(&vq->call_ctx.producer); | |
| 910 | − } | |
| 911 | + for (i = 0; i < v->nvqs; i++) | |
| 912 | + vhost_vdpa_unsetup_vq_irq(v, i); | |
| 911 | 913 | } |
| 912 | 914 | |
| 913 | 915 | static int vhost_vdpa_release(struct inode *inode, struct file *filep) |
| @@ -332,8 +332,8 @@ static void vhost_vq_reset(struct vhost_dev *dev, · 331 unmodified lines | ||
| 332 | 332 | vq->error_ctx = NULL; |
| 333 | 333 | vq->kick = NULL; |
| 334 | 334 | vq->log_ctx = NULL; |
| 335 | − vhost_reset_is_le(vq); | |
| 336 | 335 | vhost_disable_cross_endian(vq); |
| 336 | + vhost_reset_is_le(vq); | |
| 337 | 337 | vq->busyloop_timeout = 0; |
| 338 | 338 | vq->umem = NULL; |
| 339 | 339 | vq->iotlb = NULL; |
| @@ -141,15 +141,14 @@ void virtio_config_changed(struct virtio_device *dev) · 140 unmodified lines | ||
| 141 | 141 | } |
| 142 | 142 | EXPORT_SYMBOL_GPL(virtio_config_changed); |
| 143 | 143 | |
| 144 | −void virtio_config_disable(struct virtio_device *dev) | |
| 144 | +static void virtio_config_disable(struct virtio_device *dev) | |
| 145 | 145 | { |
| 146 | 146 | spin_lock_irq(&dev->config_lock); |
| 147 | 147 | dev->config_enabled = false; |
| 148 | 148 | spin_unlock_irq(&dev->config_lock); |
| 149 | 149 | } |
| 150 | −EXPORT_SYMBOL_GPL(virtio_config_disable); | |
| 151 | 150 | |
| 152 | −void virtio_config_enable(struct virtio_device *dev) | |
| 151 | +static void virtio_config_enable(struct virtio_device *dev) | |
| 153 | 152 | { |
| 154 | 153 | spin_lock_irq(&dev->config_lock); |
| 155 | 154 | dev->config_enabled = true; |
| @@ -158,7 +157,6 @@ void virtio_config_enable(struct virtio_device *dev) · 2 unmodified lines | ||
| 158 | 157 | dev->config_change_pending = false; |
| 159 | 158 | spin_unlock_irq(&dev->config_lock); |
| 160 | 159 | } |
| 161 | −EXPORT_SYMBOL_GPL(virtio_config_enable); | |
| 162 | 160 | |
| 163 | 161 | void virtio_add_status(struct virtio_device *dev, unsigned int status) |
| 164 | 162 | { |
| @@ -548,8 +548,7 @@ static void virtio_mmio_release_dev(struct device *_d) · 547 unmodified lines | ||
| 548 | 548 | { |
| 549 | 549 | struct virtio_device *vdev = |
| 550 | 550 | container_of(_d, struct virtio_device, dev); |
| 551 | − struct virtio_mmio_device *vm_dev = | |
| 552 | − container_of(vdev, struct virtio_mmio_device, vdev); | |
| 551 | + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); | |
| 553 | 552 | struct platform_device *pdev = vm_dev->pdev; |
| 554 | 553 | |
| 555 | 554 | devm_kfree(&pdev->dev, vm_dev); |
| @@ -273,7 +273,6 @@ module_exit(cpu5wdt_exit_module); · 272 unmodified lines | ||
| 273 | 273 | |
| 274 | 274 | MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>"); |
| 275 | 275 | MODULE_DESCRIPTION("sma cpu5 watchdog driver"); |
| 276 | −MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog"); | |
| 277 | 276 | MODULE_LICENSE("GPL"); |
| 278 | 277 | |
| 279 | 278 | module_param_hw(port, int, ioport, 0); |
| @@ -172,7 +172,6 @@ MODULE_PARM_DESC(wd2_timeout, "Default watchdog2 timeout in 1/10secs"); · 171 unmodified lines | ||
| 172 | 172 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); |
| 173 | 173 | MODULE_DESCRIPTION("Hardware watchdog driver for Sun Microsystems CP1400/1500"); |
| 174 | 174 | MODULE_LICENSE("GPL"); |
| 175 | −MODULE_SUPPORTED_DEVICE("watchdog"); | |
| 176 | 175 | |
| 177 | 176 | static void cpwd_writew(u16 val, void __iomem *addr) |
| 178 | 177 | { |
| @@ -46,7 +46,6 @@ · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); |
| 48 | 48 | MODULE_DESCRIPTION("Hardware watchdog driver for Sun RIO"); |
| 49 | −MODULE_SUPPORTED_DEVICE("watchdog"); | |
| 50 | 49 | MODULE_LICENSE("GPL"); |
| 51 | 50 | |
| 52 | 51 | #define DRIVER_NAME "riowd" |
| @@ -70,7 +70,6 @@ const struct inode_operations afs_dir_inode_operations = { · 69 unmodified lines | ||
| 70 | 70 | .permission = afs_permission, |
| 71 | 71 | .getattr = afs_getattr, |
| 72 | 72 | .setattr = afs_setattr, |
| 73 | − .listxattr = afs_listxattr, | |
| 74 | 73 | }; |
| 75 | 74 | |
| 76 | 75 | const struct address_space_operations afs_dir_aops = { |
| @@ -43,7 +43,6 @@ const struct inode_operations afs_file_inode_operations = { · 42 unmodified lines | ||
| 43 | 43 | .getattr = afs_getattr, |
| 44 | 44 | .setattr = afs_setattr, |
| 45 | 45 | .permission = afs_permission, |
| 46 | − .listxattr = afs_listxattr, | |
| 47 | 46 | }; |
| 48 | 47 | |
| 49 | 48 | const struct address_space_operations afs_fs_aops = { |
| @@ -181,10 +181,13 @@ void afs_wait_for_operation(struct afs_operation *op) · 180 unmodified lines | ||
| 181 | 181 | if (test_bit(AFS_SERVER_FL_IS_YFS, &op->server->flags) && |
| 182 | 182 | op->ops->issue_yfs_rpc) |
| 183 | 183 | op->ops->issue_yfs_rpc(op); |
| 184 | − else | |
| 184 | + else if (op->ops->issue_afs_rpc) | |
| 185 | 185 | op->ops->issue_afs_rpc(op); |
| 186 | + else | |
| 187 | + op->ac.error = -ENOTSUPP; | |
| 186 | 188 | |
| 187 | − op->error = afs_wait_for_call_to_complete(op->call, &op->ac); | |
| 189 | + if (op->call) | |
| 190 | + op->error = afs_wait_for_call_to_complete(op->call, &op->ac); | |
| 188 | 191 | } |
| 189 | 192 | |
| 190 | 193 | switch (op->error) { |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | |
| 28 | 28 | static const struct inode_operations afs_symlink_inode_operations = { |
| 29 | 29 | .get_link = page_get_link, |
| 30 | − .listxattr = afs_listxattr, | |
| 31 | 30 | }; |
| 32 | 31 | |
| 33 | 32 | static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *parent_vnode) |
| @@ -1509,7 +1509,6 @@ extern int afs_launder_page(struct page *); · 1508 unmodified lines | ||
| 1509 | 1509 | * xattr.c |
| 1510 | 1510 | */ |
| 1511 | 1511 | extern const struct xattr_handler *afs_xattr_handlers[]; |
| 1512 | −extern ssize_t afs_listxattr(struct dentry *, char *, size_t); | |
| 1513 | 1512 | |
| 1514 | 1513 | /* |
| 1515 | 1514 | * yfsclient.c |
| @@ -32,7 +32,6 @@ const struct inode_operations afs_mntpt_inode_operations = { · 31 unmodified lines | ||
| 32 | 32 | .lookup = afs_mntpt_lookup, |
| 33 | 33 | .readlink = page_readlink, |
| 34 | 34 | .getattr = afs_getattr, |
| 35 | − .listxattr = afs_listxattr, | |
| 36 | 35 | }; |
| 37 | 36 | |
| 38 | 37 | const struct inode_operations afs_autocell_inode_operations = { |
| @@ -11,29 +11,6 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/xattr.h> |
| 12 | 12 | #include "internal.h" |
| 13 | 13 | |
| 14 | −static const char afs_xattr_list[] = | |
| 15 | − "afs.acl\0" | |
| 16 | − "afs.cell\0" | |
| 17 | − "afs.fid\0" | |
| 18 | − "afs.volume\0" | |
| 19 | − "afs.yfs.acl\0" | |
| 20 | − "afs.yfs.acl_inherited\0" | |
| 21 | − "afs.yfs.acl_num_cleaned\0" | |
| 22 | − "afs.yfs.vol_acl"; | |
| 23 | − | |
| 24 | −/* | |
| 25 | − * Retrieve a list of the supported xattrs. | |
| 26 | − */ | |
| 27 | −ssize_t afs_listxattr(struct dentry *dentry, char *buffer, size_t size) | |
| 28 | −{ | |
| 29 | − if (size == 0) | |
| 30 | − return sizeof(afs_xattr_list); | |
| 31 | − if (size < sizeof(afs_xattr_list)) | |
| 32 | − return -ERANGE; | |
| 33 | − memcpy(buffer, afs_xattr_list, sizeof(afs_xattr_list)); | |
| 34 | − return sizeof(afs_xattr_list); | |
| 35 | −} | |
| 36 | − | |
| 37 | 14 | /* |
| 38 | 15 | * Deal with the result of a successful fetch ACL operation. |
| 39 | 16 | */ |
| @@ -231,6 +208,8 @@ static int afs_xattr_get_yfs(const struct xattr_handler *handler, · 191 unmodified lines | ||
| 231 | 208 | else |
| 232 | 209 | ret = -ERANGE; |
| 233 | 210 | } |
| 211 | + } else if (ret == -ENOTSUPP) { | |
| 212 | + ret = -ENODATA; | |
| 234 | 213 | } |
| 235 | 214 | |
| 236 | 215 | error_yacl: |
| @@ -256,6 +235,7 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 19 unmodified lines | ||
| 256 | 235 | { |
| 257 | 236 | struct afs_operation *op; |
| 258 | 237 | struct afs_vnode *vnode = AFS_FS_I(inode); |
| 238 | + int ret; | |
| 259 | 239 | |
| 260 | 240 | if (flags == XATTR_CREATE || |
| 261 | 241 | strcmp(name, "acl") != 0) |
| @@ -270,7 +250,10 @@ static int afs_xattr_set_yfs(const struct xattr_handler *handler, · 8 unmodified lines | ||
| 270 | 250 | return afs_put_operation(op); |
| 271 | 251 | |
| 272 | 252 | op->ops = &yfs_store_opaque_acl2_operation; |
| 273 | − return afs_do_sync_operation(op); | |
| 253 | + ret = afs_do_sync_operation(op); | |
| 254 | + if (ret == -ENOTSUPP) | |
| 255 | + ret = -ENODATA; | |
| 256 | + return ret; | |
| 274 | 257 | } |
| 275 | 258 | |
| 276 | 259 | static const struct xattr_handler afs_xattr_yfs_handler = { |
| @@ -1365,7 +1365,9 @@ get_old_root(struct btrfs_root *root, u64 time_seq) · 1364 unmodified lines | ||
| 1365 | 1365 | "failed to read tree block %llu from get_old_root", |
| 1366 | 1366 | logical); |
| 1367 | 1367 | } else { |
| 1368 | + btrfs_tree_read_lock(old); | |
| 1368 | 1369 | eb = btrfs_clone_extent_buffer(old); |
| 1370 | + btrfs_tree_read_unlock(old); | |
| 1369 | 1371 | free_extent_buffer(old); |
| 1370 | 1372 | } |
| 1371 | 1373 | } else if (old_root) { |
| @@ -3323,6 +3323,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, · 3322 unmodified lines | ||
| 3323 | 3323 | |
| 3324 | 3324 | if (last_ref && btrfs_header_generation(buf) == trans->transid) { |
| 3325 | 3325 | struct btrfs_block_group *cache; |
| 3326 | + bool must_pin = false; | |
| 3326 | 3327 | |
| 3327 | 3328 | if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) { |
| 3328 | 3329 | ret = check_ref_cleanup(trans, buf->start); |
| @@ -3340,7 +3341,27 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans, · 11 unmodified lines | ||
| 3340 | 3341 | goto out; |
| 3341 | 3342 | } |
| 3342 | 3343 | |
| 3343 | − if (btrfs_is_zoned(fs_info)) { | |
| 3344 | + /* | |
| 3345 | + * If this is a leaf and there are tree mod log users, we may | |
| 3346 | + * have recorded mod log operations that point to this leaf. | |
| 3347 | + * So we must make sure no one reuses this leaf's extent before | |
| 3348 | + * mod log operations are applied to a node, otherwise after | |
| 3349 | + * rewinding a node using the mod log operations we get an | |
| 3350 | + * inconsistent btree, as the leaf's extent may now be used as | |
| 3351 | + * a node or leaf for another different btree. | |
| 3352 | + * We are safe from races here because at this point no other | |
| 3353 | + * node or root points to this extent buffer, so if after this | |
| 3354 | + * check a new tree mod log user joins, it will not be able to | |
| 3355 | + * find a node pointing to this leaf and record operations that | |
| 3356 | + * point to this leaf. | |
| 3357 | + */ | |
| 3358 | + if (btrfs_header_level(buf) == 0) { | |
| 3359 | + read_lock(&fs_info->tree_mod_log_lock); | |
| 3360 | + must_pin = !list_empty(&fs_info->tree_mod_seq_list); | |
| 3361 | + read_unlock(&fs_info->tree_mod_log_lock); | |
| 3362 | + } | |
| 3363 | + | |
| 3364 | + if (must_pin || btrfs_is_zoned(fs_info)) { | |
| 3344 | 3365 | btrfs_redirty_list_add(trans->transaction, buf); |
| 3345 | 3366 | pin_down_extent(trans, cache, buf->start, buf->len, 1); |
| 3346 | 3367 | btrfs_put_block_group(cache); |
| @@ -2885,6 +2885,35 @@ static void end_page_read(struct page *page, bool uptodate, u64 start, u32 len) · 2884 unmodified lines | ||
| 2885 | 2885 | btrfs_subpage_end_reader(fs_info, page, start, len); |
| 2886 | 2886 | } |
| 2887 | 2887 | |
| 2888 | +/* | |
| 2889 | + * Find extent buffer for a givne bytenr. | |
| 2890 | + * | |
| 2891 | + * This is for end_bio_extent_readpage(), thus we can't do any unsafe locking | |
| 2892 | + * in endio context. | |
| 2893 | + */ | |
| 2894 | +static struct extent_buffer *find_extent_buffer_readpage( | |
| 2895 | + struct btrfs_fs_info *fs_info, struct page *page, u64 bytenr) | |
| 2896 | +{ | |
| 2897 | + struct extent_buffer *eb; | |
| 2898 | + | |
| 2899 | + /* | |
| 2900 | + * For regular sectorsize, we can use page->private to grab extent | |
| 2901 | + * buffer | |
| 2902 | + */ | |
| 2903 | + if (fs_info->sectorsize == PAGE_SIZE) { | |
| 2904 | + ASSERT(PagePrivate(page) && page->private); | |
| 2905 | + return (struct extent_buffer *)page->private; | |
| 2906 | + } | |
| 2907 | + | |
| 2908 | + /* For subpage case, we need to lookup buffer radix tree */ | |
| 2909 | + rcu_read_lock(); | |
| 2910 | + eb = radix_tree_lookup(&fs_info->buffer_radix, | |
| 2911 | + bytenr >> fs_info->sectorsize_bits); | |
| 2912 | + rcu_read_unlock(); | |
| 2913 | + ASSERT(eb); | |
| 2914 | + return eb; | |
| 2915 | +} | |
| 2916 | + | |
| 2888 | 2917 | /* |
| 2889 | 2918 | * after a readpage IO is done, we need to: |
| 2890 | 2919 | * clear the uptodate bits on error |
| @@ -2996,7 +3025,7 @@ static void end_bio_extent_readpage(struct bio *bio) · 105 unmodified lines | ||
| 2996 | 3025 | } else { |
| 2997 | 3026 | struct extent_buffer *eb; |
| 2998 | 3027 | |
| 2999 | − eb = (struct extent_buffer *)page->private; | |
| 3028 | + eb = find_extent_buffer_readpage(fs_info, page, start); | |
| 3000 | 3029 | set_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags); |
| 3001 | 3030 | eb->read_mirror = mirror; |
| 3002 | 3031 | atomic_dec(&eb->io_pages); |
| @@ -3020,7 +3049,7 @@ readpage_ok: · 17 unmodified lines | ||
| 3020 | 3049 | */ |
| 3021 | 3050 | if (page->index == end_index && i_size <= end) { |
| 3022 | 3051 | u32 zero_start = max(offset_in_page(i_size), |
| 3023 | − offset_in_page(end)); | |
| 3052 | + offset_in_page(start)); | |
| 3024 | 3053 | |
| 3025 | 3054 | zero_user_segment(page, zero_start, |
| 3026 | 3055 | offset_in_page(end) + 1); |
| @@ -9008,7 +9008,7 @@ int __init btrfs_init_cachep(void) · 9007 unmodified lines | ||
| 9008 | 9008 | |
| 9009 | 9009 | btrfs_free_space_bitmap_cachep = kmem_cache_create("btrfs_free_space_bitmap", |
| 9010 | 9010 | PAGE_SIZE, PAGE_SIZE, |
| 9011 | − SLAB_RED_ZONE, NULL); | |
| 9011 | + SLAB_MEM_SPREAD, NULL); | |
| 9012 | 9012 | if (!btrfs_free_space_bitmap_cachep) |
| 9013 | 9013 | goto fail; |
| 9014 | 9014 | |
| @@ -9877,6 +9877,7 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 862 unmodified lines | ||
| 9877 | 9877 | struct btrfs_path *path; |
| 9878 | 9878 | u64 start = ins->objectid; |
| 9879 | 9879 | u64 len = ins->offset; |
| 9880 | + int qgroup_released; | |
| 9880 | 9881 | int ret; |
| 9881 | 9882 | |
| 9882 | 9883 | memset(&stack_fi, 0, sizeof(stack_fi)); |
| @@ -9889,16 +9890,16 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 6 unmodified lines | ||
| 9889 | 9890 | btrfs_set_stack_file_extent_compression(&stack_fi, BTRFS_COMPRESS_NONE); |
| 9890 | 9891 | /* Encryption and other encoding is reserved and all 0 */ |
| 9891 | 9892 | |
| 9892 | − ret = btrfs_qgroup_release_data(inode, file_offset, len); | |
| 9893 | − if (ret < 0) | |
| 9894 | − return ERR_PTR(ret); | |
| 9893 | + qgroup_released = btrfs_qgroup_release_data(inode, file_offset, len); | |
| 9894 | + if (qgroup_released < 0) | |
| 9895 | + return ERR_PTR(qgroup_released); | |
| 9895 | 9896 | |
| 9896 | 9897 | if (trans) { |
| 9897 | 9898 | ret = insert_reserved_file_extent(trans, inode, |
| 9898 | 9899 | file_offset, &stack_fi, |
| 9899 | − true, ret); | |
| 9900 | + true, qgroup_released); | |
| 9900 | 9901 | if (ret) |
| 9901 | − return ERR_PTR(ret); | |
| 9902 | + goto free_qgroup; | |
| 9902 | 9903 | return trans; |
| 9903 | 9904 | } |
| 9904 | 9905 | |
| @@ -9909,21 +9910,35 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent( · 4 unmodified lines | ||
| 9909 | 9910 | extent_info.file_offset = file_offset; |
| 9910 | 9911 | extent_info.extent_buf = (char *)&stack_fi; |
| 9911 | 9912 | extent_info.is_new_extent = true; |
| 9912 | − extent_info.qgroup_reserved = ret; | |
| 9913 | + extent_info.qgroup_reserved = qgroup_released; | |
| 9913 | 9914 | extent_info.insertions = 0; |
| 9914 | 9915 | |
| 9915 | 9916 | path = btrfs_alloc_path(); |
| 9916 | − if (!path) | |
| 9917 | − return ERR_PTR(-ENOMEM); | |
| 9917 | + if (!path) { | |
| 9918 | + ret = -ENOMEM; | |
| 9919 | + goto free_qgroup; | |
| 9920 | + } | |
| 9918 | 9921 | |
| 9919 | 9922 | ret = btrfs_replace_file_extents(&inode->vfs_inode, path, file_offset, |
| 9920 | 9923 | file_offset + len - 1, &extent_info, |
| 9921 | 9924 | &trans); |
| 9922 | 9925 | btrfs_free_path(path); |
| 9923 | 9926 | if (ret) |
| 9924 | − return ERR_PTR(ret); | |
| 9925 | − | |
| 9927 | + goto free_qgroup; | |
| 9926 | 9928 | return trans; |
| 9929 | + | |
| 9930 | +free_qgroup: | |
| 9931 | + /* | |
| 9932 | + * We have released qgroup data range at the beginning of the function, | |
| 9933 | + * and normally qgroup_released bytes will be freed when committing | |
| 9934 | + * transaction. | |
| 9935 | + * But if we error out early, we have to free what we have released | |
| 9936 | + * or we leak qgroup data reservation. | |
| 9937 | + */ | |
| 9938 | + btrfs_qgroup_free_refroot(inode->root->fs_info, | |
| 9939 | + inode->root->root_key.objectid, qgroup_released, | |
| 9940 | + BTRFS_QGROUP_RSV_DATA); | |
| 9941 | + return ERR_PTR(ret); | |
| 9927 | 9942 | } |
| 9928 | 9943 | |
| 9929 | 9944 | static int __btrfs_prealloc_file_range(struct inode *inode, int mode, |
| @@ -209,7 +209,7 @@ int btree_readahead_hook(struct extent_buffer *eb, int err) · 208 unmodified lines | ||
| 209 | 209 | /* find extent */ |
| 210 | 210 | spin_lock(&fs_info->reada_lock); |
| 211 | 211 | re = radix_tree_lookup(&fs_info->reada_tree, |
| 212 | − eb->start >> PAGE_SHIFT); | |
| 212 | + eb->start >> fs_info->sectorsize_bits); | |
| 213 | 213 | if (re) |
| 214 | 214 | re->refcnt++; |
| 215 | 215 | spin_unlock(&fs_info->reada_lock); |
| @@ -240,7 +240,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_device *dev, u64 logical, · 24 unmodified lines | ||
| 240 | 240 | zone = NULL; |
| 241 | 241 | spin_lock(&fs_info->reada_lock); |
| 242 | 242 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, |
| 243 | − logical >> PAGE_SHIFT, 1); | |
| 243 | + logical >> fs_info->sectorsize_bits, 1); | |
| 244 | 244 | if (ret == 1 && logical >= zone->start && logical <= zone->end) { |
| 245 | 245 | kref_get(&zone->refcnt); |
| 246 | 246 | spin_unlock(&fs_info->reada_lock); |
| @@ -283,13 +283,13 @@ static struct reada_zone *reada_find_zone(struct btrfs_device *dev, u64 logical, · 36 unmodified lines | ||
| 283 | 283 | |
| 284 | 284 | spin_lock(&fs_info->reada_lock); |
| 285 | 285 | ret = radix_tree_insert(&dev->reada_zones, |
| 286 | − (unsigned long)(zone->end >> PAGE_SHIFT), | |
| 287 | − zone); | |
| 286 | + (unsigned long)(zone->end >> fs_info->sectorsize_bits), | |
| 287 | + zone); | |
| 288 | 288 | |
| 289 | 289 | if (ret == -EEXIST) { |
| 290 | 290 | kfree(zone); |
| 291 | 291 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, |
| 292 | − logical >> PAGE_SHIFT, 1); | |
| 292 | + logical >> fs_info->sectorsize_bits, 1); | |
| 293 | 293 | if (ret == 1 && logical >= zone->start && logical <= zone->end) |
| 294 | 294 | kref_get(&zone->refcnt); |
| 295 | 295 | else |
| @@ -315,7 +315,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_fs_info *fs_info, · 19 unmodified lines | ||
| 315 | 315 | u64 length; |
| 316 | 316 | int real_stripes; |
| 317 | 317 | int nzones = 0; |
| 318 | − unsigned long index = logical >> PAGE_SHIFT; | |
| 318 | + unsigned long index = logical >> fs_info->sectorsize_bits; | |
| 319 | 319 | int dev_replace_is_ongoing; |
| 320 | 320 | int have_zone = 0; |
| 321 | 321 | |
| @@ -497,7 +497,7 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 175 unmodified lines | ||
| 497 | 497 | struct reada_extent *re) |
| 498 | 498 | { |
| 499 | 499 | int i; |
| 500 | − unsigned long index = re->logical >> PAGE_SHIFT; | |
| 500 | + unsigned long index = re->logical >> fs_info->sectorsize_bits; | |
| 501 | 501 | |
| 502 | 502 | spin_lock(&fs_info->reada_lock); |
| 503 | 503 | if (--re->refcnt) { |
| @@ -538,11 +538,12 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, · 34 unmodified lines | ||
| 538 | 538 | static void reada_zone_release(struct kref *kref) |
| 539 | 539 | { |
| 540 | 540 | struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt); |
| 541 | + struct btrfs_fs_info *fs_info = zone->device->fs_info; | |
| 541 | 542 | |
| 542 | − lockdep_assert_held(&zone->device->fs_info->reada_lock); | |
| 543 | + lockdep_assert_held(&fs_info->reada_lock); | |
| 543 | 544 | |
| 544 | 545 | radix_tree_delete(&zone->device->reada_zones, |
| 545 | − zone->end >> PAGE_SHIFT); | |
| 546 | + zone->end >> fs_info->sectorsize_bits); | |
| 546 | 547 | |
| 547 | 548 | kfree(zone); |
| 548 | 549 | } |
| @@ -593,7 +594,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical, · 44 unmodified lines | ||
| 593 | 594 | static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock) |
| 594 | 595 | { |
| 595 | 596 | int i; |
| 596 | − unsigned long index = zone->end >> PAGE_SHIFT; | |
| 597 | + unsigned long index = zone->end >> zone->device->fs_info->sectorsize_bits; | |
| 597 | 598 | |
| 598 | 599 | for (i = 0; i < zone->ndevs; ++i) { |
| 599 | 600 | struct reada_zone *peer; |
| @@ -628,7 +629,7 @@ static int reada_pick_zone(struct btrfs_device *dev) · 28 unmodified lines | ||
| 628 | 629 | (void **)&zone, index, 1); |
| 629 | 630 | if (ret == 0) |
| 630 | 631 | break; |
| 631 | − index = (zone->end >> PAGE_SHIFT) + 1; | |
| 632 | + index = (zone->end >> dev->fs_info->sectorsize_bits) + 1; | |
| 632 | 633 | if (zone->locked) { |
| 633 | 634 | if (zone->elems > top_locked_elems) { |
| 634 | 635 | top_locked_elems = zone->elems; |
| @@ -709,7 +710,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 74 unmodified lines | ||
| 709 | 710 | * plugging to speed things up |
| 710 | 711 | */ |
| 711 | 712 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, |
| 712 | − dev->reada_next >> PAGE_SHIFT, 1); | |
| 713 | + dev->reada_next >> fs_info->sectorsize_bits, 1); | |
| 713 | 714 | if (ret == 0 || re->logical > dev->reada_curr_zone->end) { |
| 714 | 715 | ret = reada_pick_zone(dev); |
| 715 | 716 | if (!ret) { |
| @@ -718,7 +719,7 @@ static int reada_start_machine_dev(struct btrfs_device *dev) · 2 unmodified lines | ||
| 718 | 719 | } |
| 719 | 720 | re = NULL; |
| 720 | 721 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, |
| 721 | − dev->reada_next >> PAGE_SHIFT, 1); | |
| 722 | + dev->reada_next >> fs_info->sectorsize_bits, 1); | |
| 722 | 723 | } |
| 723 | 724 | if (ret == 0) { |
| 724 | 725 | spin_unlock(&fs_info->reada_lock); |
| @@ -885,7 +886,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 160 unmodified lines | ||
| 885 | 886 | pr_cont(" curr off %llu", |
| 886 | 887 | device->reada_next - zone->start); |
| 887 | 888 | pr_cont("\n"); |
| 888 | − index = (zone->end >> PAGE_SHIFT) + 1; | |
| 889 | + index = (zone->end >> fs_info->sectorsize_bits) + 1; | |
| 889 | 890 | } |
| 890 | 891 | cnt = 0; |
| 891 | 892 | index = 0; |
| @@ -910,7 +911,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 18 unmodified lines | ||
| 910 | 911 | } |
| 911 | 912 | } |
| 912 | 913 | pr_cont("\n"); |
| 913 | − index = (re->logical >> PAGE_SHIFT) + 1; | |
| 914 | + index = (re->logical >> fs_info->sectorsize_bits) + 1; | |
| 914 | 915 | if (++cnt > 15) |
| 915 | 916 | break; |
| 916 | 917 | } |
| @@ -926,7 +927,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 9 unmodified lines | ||
| 926 | 927 | if (ret == 0) |
| 927 | 928 | break; |
| 928 | 929 | if (!re->scheduled) { |
| 929 | − index = (re->logical >> PAGE_SHIFT) + 1; | |
| 930 | + index = (re->logical >> fs_info->sectorsize_bits) + 1; | |
| 930 | 931 | continue; |
| 931 | 932 | } |
| 932 | 933 | pr_debug("re: logical %llu size %u list empty %d scheduled %d", |
| @@ -942,7 +943,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) · 9 unmodified lines | ||
| 942 | 943 | } |
| 943 | 944 | } |
| 944 | 945 | pr_cont("\n"); |
| 945 | − index = (re->logical >> PAGE_SHIFT) + 1; | |
| 946 | + index = (re->logical >> fs_info->sectorsize_bits) + 1; | |
| 946 | 947 | } |
| 947 | 948 | spin_unlock(&fs_info->reada_lock); |
| 948 | 949 | } |
| @@ -3169,10 +3169,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, · 3168 unmodified lines | ||
| 3169 | 3169 | |
| 3170 | 3170 | mutex_lock(&log_root_tree->log_mutex); |
| 3171 | 3171 | |
| 3172 | − index2 = log_root_tree->log_transid % 2; | |
| 3173 | − list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); | |
| 3174 | − root_log_ctx.log_transid = log_root_tree->log_transid; | |
| 3175 | − | |
| 3176 | 3172 | if (btrfs_is_zoned(fs_info)) { |
| 3177 | 3173 | if (!log_root_tree->node) { |
| 3178 | 3174 | ret = btrfs_alloc_log_tree_node(trans, log_root_tree); |
| @@ -3183,6 +3179,10 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, · 4 unmodified lines | ||
| 3183 | 3179 | } |
| 3184 | 3180 | } |
| 3185 | 3181 | |
| 3182 | + index2 = log_root_tree->log_transid % 2; | |
| 3183 | + list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); | |
| 3184 | + root_log_ctx.log_transid = log_root_tree->log_transid; | |
| 3185 | + | |
| 3186 | 3186 | /* |
| 3187 | 3187 | * Now we are safe to update the log_root_tree because we're under the |
| 3188 | 3188 | * log_mutex, and we're a current writer so we're holding the commit |
| @@ -248,7 +248,7 @@ nlmsg_fail: · 247 unmodified lines | ||
| 248 | 248 | |
| 249 | 249 | /* |
| 250 | 250 | * Try to find a matching registration for the tcon's server name and share name. |
| 251 | − * Calls to this funciton must be protected by cifs_swnreg_idr_mutex. | |
| 251 | + * Calls to this function must be protected by cifs_swnreg_idr_mutex. | |
| 252 | 252 | * TODO Try to avoid memory allocations |
| 253 | 253 | */ |
| 254 | 254 | static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon) |
| @@ -1118,7 +1118,6 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, · 1117 unmodified lines | ||
| 1118 | 1118 | /* Retain old ACEs which we can retain */ |
| 1119 | 1119 | for (i = 0; i < src_num_aces; ++i) { |
| 1120 | 1120 | pntace = (struct cifs_ace *) (acl_base + size); |
| 1121 | − pnntace = (struct cifs_ace *) (nacl_base + nsize); | |
| 1122 | 1121 | |
| 1123 | 1122 | if (!new_aces_set && (pntace->flags & INHERITED_ACE)) { |
| 1124 | 1123 | /* Place the new ACEs in between existing explicit and inherited */ |
| @@ -1131,14 +1130,18 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, · 6 unmodified lines | ||
| 1131 | 1130 | } |
| 1132 | 1131 | |
| 1133 | 1132 | /* If it's any one of the ACE we're replacing, skip! */ |
| 1134 | − if ((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) || | |
| 1133 | + if (!mode_from_sid && | |
| 1134 | + ((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) || | |
| 1135 | 1135 | (compare_sids(&pntace->sid, pownersid) == 0) || |
| 1136 | 1136 | (compare_sids(&pntace->sid, pgrpsid) == 0) || |
| 1137 | 1137 | (compare_sids(&pntace->sid, &sid_everyone) == 0) || |
| 1138 | − (compare_sids(&pntace->sid, &sid_authusers) == 0)) { | |
| 1138 | + (compare_sids(&pntace->sid, &sid_authusers) == 0))) { | |
| 1139 | 1139 | goto next_ace; |
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | + /* update the pointer to the next ACE to populate*/ | |
| 1143 | + pnntace = (struct cifs_ace *) (nacl_base + nsize); | |
| 1144 | + | |
| 1142 | 1145 | nsize += cifs_copy_ace(pnntace, pntace, NULL); |
| 1143 | 1146 | num_aces++; |
| 1144 | 1147 | |
| @@ -1196,9 +1196,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, · 1195 unmodified lines | ||
| 1196 | 1196 | pr_warn_once("Witness protocol support is experimental\n"); |
| 1197 | 1197 | break; |
| 1198 | 1198 | case Opt_rootfs: |
| 1199 | −#ifdef CONFIG_CIFS_ROOT | |
| 1200 | − ctx->rootfs = true; | |
| 1199 | +#ifndef CONFIG_CIFS_ROOT | |
| 1200 | + cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n"); | |
| 1201 | + goto cifs_parse_mount_err; | |
| 1201 | 1202 | #endif |
| 1203 | + ctx->rootfs = true; | |
| 1202 | 1204 | break; |
| 1203 | 1205 | case Opt_posixpaths: |
| 1204 | 1206 | if (result.negated) |
| @@ -2395,7 +2395,7 @@ int cifs_getattr(struct user_namespace *mnt_userns, const struct path *path, · 2394 unmodified lines | ||
| 2395 | 2395 | * We need to be sure that all dirty pages are written and the server |
| 2396 | 2396 | * has actual ctime, mtime and file length. |
| 2397 | 2397 | */ |
| 2398 | − if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE)) && | |
| 2398 | + if ((request_mask & (STATX_CTIME | STATX_MTIME | STATX_SIZE | STATX_BLOCKS)) && | |
| 2399 | 2399 | !CIFS_CACHE_READ(CIFS_I(inode)) && |
| 2400 | 2400 | inode->i_mapping && inode->i_mapping->nrpages != 0) { |
| 2401 | 2401 | rc = filemap_fdatawait(inode->i_mapping); |
| @@ -2585,6 +2585,14 @@ set_size_out: · 183 unmodified lines | ||
| 2585 | 2585 | if (rc == 0) { |
| 2586 | 2586 | cifsInode->server_eof = attrs->ia_size; |
| 2587 | 2587 | cifs_setsize(inode, attrs->ia_size); |
| 2588 | + /* | |
| 2589 | + * i_blocks is not related to (i_size / i_blksize), but instead | |
| 2590 | + * 512 byte (2**9) size is required for calculating num blocks. | |
| 2591 | + * Until we can query the server for actual allocation size, | |
| 2592 | + * this is best estimate we have for blocks allocated for a file | |
| 2593 | + * Number of blocks must be rounded up so size 1 is not 0 blocks | |
| 2594 | + */ | |
| 2595 | + inode->i_blocks = (512 - 1 + attrs->ia_size) >> 9; | |
| 2588 | 2596 | |
| 2589 | 2597 | /* |
| 2590 | 2598 | * The man page of truncate says if the size changed, |
| @@ -1196,9 +1196,12 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, · 1195 unmodified lines | ||
| 1196 | 1196 | /* |
| 1197 | 1197 | * Compounding is never used during session establish. |
| 1198 | 1198 | */ |
| 1199 | − if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) | |
| 1199 | + if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP) || (optype & CIFS_SESS_OP)) { | |
| 1200 | + mutex_lock(&server->srv_mutex); | |
| 1200 | 1201 | smb311_update_preauth_hash(ses, rqst[0].rq_iov, |
| 1201 | 1202 | rqst[0].rq_nvec); |
| 1203 | + mutex_unlock(&server->srv_mutex); | |
| 1204 | + } | |
| 1202 | 1205 | |
| 1203 | 1206 | for (i = 0; i < num_rqst; i++) { |
| 1204 | 1207 | rc = wait_for_response(server, midQ[i]); |
| @@ -1266,7 +1269,9 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, · 61 unmodified lines | ||
| 1266 | 1269 | .iov_base = resp_iov[0].iov_base, |
| 1267 | 1270 | .iov_len = resp_iov[0].iov_len |
| 1268 | 1271 | }; |
| 1272 | + mutex_lock(&server->srv_mutex); | |
| 1269 | 1273 | smb311_update_preauth_hash(ses, &iov, 1); |
| 1274 | + mutex_unlock(&server->srv_mutex); | |
| 1270 | 1275 | } |
| 1271 | 1276 | |
| 1272 | 1277 | out: |
| @@ -626,27 +626,41 @@ int ext4_claim_free_clusters(struct ext4_sb_info *sbi, · 625 unmodified lines | ||
| 626 | 626 | |
| 627 | 627 | /** |
| 628 | 628 | * ext4_should_retry_alloc() - check if a block allocation should be retried |
| 629 | − * @sb: super block | |
| 630 | − * @retries: number of attemps has been made | |
| 629 | + * @sb: superblock | |
| 630 | + * @retries: number of retry attempts made so far | |
| 631 | 631 | * |
| 632 | − * ext4_should_retry_alloc() is called when ENOSPC is returned, and if | |
| 633 | − * it is profitable to retry the operation, this function will wait | |
| 634 | − * for the current or committing transaction to complete, and then | |
| 635 | − * return TRUE. We will only retry once. | |
| 632 | + * ext4_should_retry_alloc() is called when ENOSPC is returned while | |
| 633 | + * attempting to allocate blocks. If there's an indication that a pending | |
| 634 | + * journal transaction might free some space and allow another attempt to | |
| 635 | + * succeed, this function will wait for the current or committing transaction | |
| 636 | + * to complete and then return TRUE. | |
| 636 | 637 | */ |
| 637 | 638 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) |
| 638 | 639 | { |
| 639 | − if (!ext4_has_free_clusters(EXT4_SB(sb), 1, 0) || | |
| 640 | − (*retries)++ > 1 || | |
| 641 | − !EXT4_SB(sb)->s_journal) | |
| 640 | + struct ext4_sb_info *sbi = EXT4_SB(sb); | |
| 641 | + | |
| 642 | + if (!sbi->s_journal) | |
| 642 | 643 | return 0; |
| 643 | 644 | |
| 644 | − smp_mb(); | |
| 645 | − if (EXT4_SB(sb)->s_mb_free_pending == 0) | |
| 645 | + if (++(*retries) > 3) { | |
| 646 | + percpu_counter_inc(&sbi->s_sra_exceeded_retry_limit); | |
| 646 | 647 | return 0; |
| 648 | + } | |
| 647 | 649 | |
| 650 | + /* | |
| 651 | + * if there's no indication that blocks are about to be freed it's | |
| 652 | + * possible we just missed a transaction commit that did so | |
| 653 | + */ | |
| 654 | + smp_mb(); | |
| 655 | + if (sbi->s_mb_free_pending == 0) | |
| 656 | + return ext4_has_free_clusters(sbi, 1, 0); | |
| 657 | + | |
| 658 | + /* | |
| 659 | + * it's possible we've just missed a transaction commit here, | |
| 660 | + * so ignore the returned status | |
| 661 | + */ | |
| 648 | 662 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); |
| 649 | − jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal); | |
| 663 | + (void) jbd2_journal_force_commit_nested(sbi->s_journal); | |
| 650 | 664 | return 1; |
| 651 | 665 | } |
| 652 | 666 | |
| @@ -1484,6 +1484,7 @@ struct ext4_sb_info { · 1483 unmodified lines | ||
| 1484 | 1484 | struct percpu_counter s_freeinodes_counter; |
| 1485 | 1485 | struct percpu_counter s_dirs_counter; |
| 1486 | 1486 | struct percpu_counter s_dirtyclusters_counter; |
| 1487 | + struct percpu_counter s_sra_exceeded_retry_limit; | |
| 1487 | 1488 | struct blockgroup_lock *s_blockgroup_lock; |
| 1488 | 1489 | struct proc_dir_entry *s_proc; |
| 1489 | 1490 | struct kobject s_kobj; |
| @@ -2793,6 +2794,8 @@ void __ext4_fc_track_link(handle_t *handle, struct inode *inode, · 1303 unmodified lines | ||
| 2793 | 2794 | struct dentry *dentry); |
| 2794 | 2795 | void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry); |
| 2795 | 2796 | void ext4_fc_track_link(handle_t *handle, struct dentry *dentry); |
| 2797 | +void __ext4_fc_track_create(handle_t *handle, struct inode *inode, | |
| 2798 | + struct dentry *dentry); | |
| 2796 | 2799 | void ext4_fc_track_create(handle_t *handle, struct dentry *dentry); |
| 2797 | 2800 | void ext4_fc_track_inode(handle_t *handle, struct inode *inode); |
| 2798 | 2801 | void ext4_fc_mark_ineligible(struct super_block *sb, int reason); |
| @@ -4382,7 +4382,7 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, · 4381 unmodified lines | ||
| 4382 | 4382 | { |
| 4383 | 4383 | struct inode *inode = file_inode(file); |
| 4384 | 4384 | handle_t *handle; |
| 4385 | − int ret, ret2 = 0, ret3 = 0; | |
| 4385 | + int ret = 0, ret2 = 0, ret3 = 0; | |
| 4386 | 4386 | int retries = 0; |
| 4387 | 4387 | int depth = 0; |
| 4388 | 4388 | struct ext4_map_blocks map; |
| @@ -513,10 +513,10 @@ void ext4_fc_track_link(handle_t *handle, struct dentry *dentry) · 512 unmodified lines | ||
| 513 | 513 | __ext4_fc_track_link(handle, d_inode(dentry), dentry); |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | −void ext4_fc_track_create(handle_t *handle, struct dentry *dentry) | |
| 516 | +void __ext4_fc_track_create(handle_t *handle, struct inode *inode, | |
| 517 | + struct dentry *dentry) | |
| 517 | 518 | { |
| 518 | 519 | struct __track_dentry_update_args args; |
| 519 | − struct inode *inode = d_inode(dentry); | |
| 520 | 520 | int ret; |
| 521 | 521 | |
| 522 | 522 | args.dentry = dentry; |
| @@ -527,6 +527,11 @@ void ext4_fc_track_create(handle_t *handle, struct dentry *dentry) · 4 unmodified lines | ||
| 527 | 527 | trace_ext4_fc_track_create(inode, dentry, ret); |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | +void ext4_fc_track_create(handle_t *handle, struct dentry *dentry) | |
| 531 | +{ | |
| 532 | + __ext4_fc_track_create(handle, d_inode(dentry), dentry); | |
| 533 | +} | |
| 534 | + | |
| 530 | 535 | /* __track_fn for inode tracking */ |
| 531 | 536 | static int __track_inode(struct inode *inode, void *arg, bool update) |
| 532 | 537 | { |
| @@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page, · 1937 unmodified lines | ||
| 1938 | 1938 | if (!ret) |
| 1939 | 1939 | ret = err; |
| 1940 | 1940 | |
| 1941 | − if (!ext4_has_inline_data(inode)) | |
| 1942 | − ext4_walk_page_buffers(NULL, page_bufs, 0, len, | |
| 1943 | − NULL, bput_one); | |
| 1944 | 1941 | ext4_set_inode_state(inode, EXT4_STATE_JDATA); |
| 1945 | 1942 | out: |
| 1946 | 1943 | unlock_page(page); |
| 1947 | 1944 | out_no_pagelock: |
| 1945 | + if (!inline_data && page_bufs) | |
| 1946 | + ext4_walk_page_buffers(NULL, page_bufs, 0, len, | |
| 1947 | + NULL, bput_one); | |
| 1948 | 1948 | brelse(inode_bh); |
| 1949 | 1949 | return ret; |
| 1950 | 1950 | } |
| @@ -5026,7 +5026,7 @@ static int ext4_do_update_inode(handle_t *handle, · 3075 unmodified lines | ||
| 5026 | 5026 | struct ext4_inode_info *ei = EXT4_I(inode); |
| 5027 | 5027 | struct buffer_head *bh = iloc->bh; |
| 5028 | 5028 | struct super_block *sb = inode->i_sb; |
| 5029 | − int err = 0, rc, block; | |
| 5029 | + int err = 0, block; | |
| 5030 | 5030 | int need_datasync = 0, set_large_file = 0; |
| 5031 | 5031 | uid_t i_uid; |
| 5032 | 5032 | gid_t i_gid; |
| @@ -5138,9 +5138,9 @@ static int ext4_do_update_inode(handle_t *handle, · 105 unmodified lines | ||
| 5138 | 5138 | bh->b_data); |
| 5139 | 5139 | |
| 5140 | 5140 | BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); |
| 5141 | − rc = ext4_handle_dirty_metadata(handle, NULL, bh); | |
| 5142 | − if (!err) | |
| 5143 | − err = rc; | |
| 5141 | + err = ext4_handle_dirty_metadata(handle, NULL, bh); | |
| 5142 | + if (err) | |
| 5143 | + goto out_brelse; | |
| 5144 | 5144 | ext4_clear_inode_state(inode, EXT4_STATE_NEW); |
| 5145 | 5145 | if (set_large_file) { |
| 5146 | 5146 | BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get write access"); |
| @@ -5387,8 +5387,10 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, · 240 unmodified lines | ||
| 5387 | 5387 | inode->i_gid = attr->ia_gid; |
| 5388 | 5388 | error = ext4_mark_inode_dirty(handle, inode); |
| 5389 | 5389 | ext4_journal_stop(handle); |
| 5390 | − if (unlikely(error)) | |
| 5390 | + if (unlikely(error)) { | |
| 5391 | + ext4_fc_stop_update(inode); | |
| 5391 | 5392 | return error; |
| 5393 | + } | |
| 5392 | 5394 | } |
| 5393 | 5395 | |
| 5394 | 5396 | if (attr->ia_valid & ATTR_SIZE) { |
| @@ -2709,8 +2709,15 @@ static int ext4_mb_init_backend(struct super_block *sb) · 2708 unmodified lines | ||
| 2709 | 2709 | } |
| 2710 | 2710 | |
| 2711 | 2711 | if (ext4_has_feature_flex_bg(sb)) { |
| 2712 | − /* a single flex group is supposed to be read by a single IO */ | |
| 2713 | − sbi->s_mb_prefetch = min(1 << sbi->s_es->s_log_groups_per_flex, | |
| 2712 | + /* a single flex group is supposed to be read by a single IO. | |
| 2713 | + * 2 ^ s_log_groups_per_flex != UINT_MAX as s_mb_prefetch is | |
| 2714 | + * unsigned integer, so the maximum shift is 32. | |
| 2715 | + */ | |
| 2716 | + if (sbi->s_es->s_log_groups_per_flex >= 32) { | |
| 2717 | + ext4_msg(sb, KERN_ERR, "too many log groups per flexible block group"); | |
| 2718 | + goto err_freesgi; | |
| 2719 | + } | |
| 2720 | + sbi->s_mb_prefetch = min_t(uint, 1 << sbi->s_es->s_log_groups_per_flex, | |
| 2714 | 2721 | BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9)); |
| 2715 | 2722 | sbi->s_mb_prefetch *= 8; /* 8 prefetch IOs in flight at most */ |
| 2716 | 2723 | } else { |
| @@ -3613,6 +3613,31 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, · 3612 unmodified lines | ||
| 3613 | 3613 | return retval; |
| 3614 | 3614 | } |
| 3615 | 3615 | |
| 3616 | +static void ext4_resetent(handle_t *handle, struct ext4_renament *ent, | |
| 3617 | + unsigned ino, unsigned file_type) | |
| 3618 | +{ | |
| 3619 | + struct ext4_renament old = *ent; | |
| 3620 | + int retval = 0; | |
| 3621 | + | |
| 3622 | + /* | |
| 3623 | + * old->de could have moved from under us during make indexed dir, | |
| 3624 | + * so the old->de may no longer valid and need to find it again | |
| 3625 | + * before reset old inode info. | |
| 3626 | + */ | |
| 3627 | + old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL); | |
| 3628 | + if (IS_ERR(old.bh)) | |
| 3629 | + retval = PTR_ERR(old.bh); | |
| 3630 | + if (!old.bh) | |
| 3631 | + retval = -ENOENT; | |
| 3632 | + if (retval) { | |
| 3633 | + ext4_std_error(old.dir->i_sb, retval); | |
| 3634 | + return; | |
| 3635 | + } | |
| 3636 | + | |
| 3637 | + ext4_setent(handle, &old, ino, file_type); | |
| 3638 | + brelse(old.bh); | |
| 3639 | +} | |
| 3640 | + | |
| 3616 | 3641 | static int ext4_find_delete_entry(handle_t *handle, struct inode *dir, |
| 3617 | 3642 | const struct qstr *d_name) |
| 3618 | 3643 | { |
| @@ -3774,14 +3799,14 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 155 unmodified lines | ||
| 3774 | 3799 | */ |
| 3775 | 3800 | retval = -ENOENT; |
| 3776 | 3801 | if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino) |
| 3777 | − goto end_rename; | |
| 3802 | + goto release_bh; | |
| 3778 | 3803 | |
| 3779 | 3804 | new.bh = ext4_find_entry(new.dir, &new.dentry->d_name, |
| 3780 | 3805 | &new.de, &new.inlined); |
| 3781 | 3806 | if (IS_ERR(new.bh)) { |
| 3782 | 3807 | retval = PTR_ERR(new.bh); |
| 3783 | 3808 | new.bh = NULL; |
| 3784 | − goto end_rename; | |
| 3809 | + goto release_bh; | |
| 3785 | 3810 | } |
| 3786 | 3811 | if (new.bh) { |
| 3787 | 3812 | if (!new.inode) { |
| @@ -3798,15 +3823,13 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 10 unmodified lines | ||
| 3798 | 3823 | handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); |
| 3799 | 3824 | if (IS_ERR(handle)) { |
| 3800 | 3825 | retval = PTR_ERR(handle); |
| 3801 | − handle = NULL; | |
| 3802 | − goto end_rename; | |
| 3826 | + goto release_bh; | |
| 3803 | 3827 | } |
| 3804 | 3828 | } else { |
| 3805 | 3829 | whiteout = ext4_whiteout_for_rename(mnt_userns, &old, credits, &handle); |
| 3806 | 3830 | if (IS_ERR(whiteout)) { |
| 3807 | 3831 | retval = PTR_ERR(whiteout); |
| 3808 | − whiteout = NULL; | |
| 3809 | − goto end_rename; | |
| 3832 | + goto release_bh; | |
| 3810 | 3833 | } |
| 3811 | 3834 | } |
| 3812 | 3835 | |
| @@ -3850,6 +3873,7 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 37 unmodified lines | ||
| 3850 | 3873 | retval = ext4_mark_inode_dirty(handle, whiteout); |
| 3851 | 3874 | if (unlikely(retval)) |
| 3852 | 3875 | goto end_rename; |
| 3876 | + | |
| 3853 | 3877 | } |
| 3854 | 3878 | if (!new.bh) { |
| 3855 | 3879 | retval = ext4_add_entry(handle, new.dentry, old.inode); |
| @@ -3923,6 +3947,8 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 67 unmodified lines | ||
| 3923 | 3947 | ext4_fc_track_unlink(handle, new.dentry); |
| 3924 | 3948 | __ext4_fc_track_link(handle, old.inode, new.dentry); |
| 3925 | 3949 | __ext4_fc_track_unlink(handle, old.inode, old.dentry); |
| 3950 | + if (whiteout) | |
| 3951 | + __ext4_fc_track_create(handle, whiteout, old.dentry); | |
| 3926 | 3952 | } |
| 3927 | 3953 | |
| 3928 | 3954 | if (new.inode) { |
| @@ -3937,19 +3963,21 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, · 8 unmodified lines | ||
| 3937 | 3963 | end_rename: |
| 3938 | 3964 | if (whiteout) { |
| 3939 | 3965 | if (retval) { |
| 3940 | − ext4_setent(handle, &old, | |
| 3941 | − old.inode->i_ino, old_file_type); | |
| 3966 | + ext4_resetent(handle, &old, | |
| 3967 | + old.inode->i_ino, old_file_type); | |
| 3942 | 3968 | drop_nlink(whiteout); |
| 3969 | + ext4_orphan_add(handle, whiteout); | |
| 3943 | 3970 | } |
| 3944 | 3971 | unlock_new_inode(whiteout); |
| 3972 | + ext4_journal_stop(handle); | |
| 3945 | 3973 | iput(whiteout); |
| 3946 | − | |
| 3974 | + } else { | |
| 3975 | + ext4_journal_stop(handle); | |
| 3947 | 3976 | } |
| 3977 | +release_bh: | |
| 3948 | 3978 | brelse(old.dir_bh); |
| 3949 | 3979 | brelse(old.bh); |
| 3950 | 3980 | brelse(new.bh); |
| 3951 | − if (handle) | |
| 3952 | − ext4_journal_stop(handle); | |
| 3953 | 3981 | return retval; |
| 3954 | 3982 | } |
| 3955 | 3983 | |
| @@ -1210,6 +1210,7 @@ static void ext4_put_super(struct super_block *sb) · 1209 unmodified lines | ||
| 1210 | 1210 | percpu_counter_destroy(&sbi->s_freeinodes_counter); |
| 1211 | 1211 | percpu_counter_destroy(&sbi->s_dirs_counter); |
| 1212 | 1212 | percpu_counter_destroy(&sbi->s_dirtyclusters_counter); |
| 1213 | + percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit); | |
| 1213 | 1214 | percpu_free_rwsem(&sbi->s_writepages_rwsem); |
| 1214 | 1215 | #ifdef CONFIG_QUOTA |
| 1215 | 1216 | for (i = 0; i < EXT4_MAXQUOTAS; i++) |
| @@ -5011,6 +5012,9 @@ no_journal: · 3795 unmodified lines | ||
| 5011 | 5012 | if (!err) |
| 5012 | 5013 | err = percpu_counter_init(&sbi->s_dirtyclusters_counter, 0, |
| 5013 | 5014 | GFP_KERNEL); |
| 5015 | + if (!err) | |
| 5016 | + err = percpu_counter_init(&sbi->s_sra_exceeded_retry_limit, 0, | |
| 5017 | + GFP_KERNEL); | |
| 5014 | 5018 | if (!err) |
| 5015 | 5019 | err = percpu_init_rwsem(&sbi->s_writepages_rwsem); |
| 5016 | 5020 | |
| @@ -5124,6 +5128,7 @@ failed_mount6: · 107 unmodified lines | ||
| 5124 | 5128 | percpu_counter_destroy(&sbi->s_freeinodes_counter); |
| 5125 | 5129 | percpu_counter_destroy(&sbi->s_dirs_counter); |
| 5126 | 5130 | percpu_counter_destroy(&sbi->s_dirtyclusters_counter); |
| 5131 | + percpu_counter_destroy(&sbi->s_sra_exceeded_retry_limit); | |
| 5127 | 5132 | percpu_free_rwsem(&sbi->s_writepages_rwsem); |
| 5128 | 5133 | failed_mount5: |
| 5129 | 5134 | ext4_ext_release(sb); |
| @@ -5149,8 +5154,8 @@ failed_mount_wq: · 19 unmodified lines | ||
| 5149 | 5154 | failed_mount3a: |
| 5150 | 5155 | ext4_es_unregister_shrinker(sbi); |
| 5151 | 5156 | failed_mount3: |
| 5152 | − del_timer_sync(&sbi->s_err_report); | |
| 5153 | 5157 | flush_work(&sbi->s_error_work); |
| 5158 | + del_timer_sync(&sbi->s_err_report); | |
| 5154 | 5159 | if (sbi->s_mmp_tsk) |
| 5155 | 5160 | kthread_stop(sbi->s_mmp_tsk); |
| 5156 | 5161 | failed_mount2: |
| @@ -24,6 +24,7 @@ typedef enum { · 23 unmodified lines | ||
| 24 | 24 | attr_session_write_kbytes, |
| 25 | 25 | attr_lifetime_write_kbytes, |
| 26 | 26 | attr_reserved_clusters, |
| 27 | + attr_sra_exceeded_retry_limit, | |
| 27 | 28 | attr_inode_readahead, |
| 28 | 29 | attr_trigger_test_error, |
| 29 | 30 | attr_first_error_time, |
| @@ -202,6 +203,7 @@ EXT4_ATTR_FUNC(delayed_allocation_blocks, 0444); · 172 unmodified lines | ||
| 202 | 203 | EXT4_ATTR_FUNC(session_write_kbytes, 0444); |
| 203 | 204 | EXT4_ATTR_FUNC(lifetime_write_kbytes, 0444); |
| 204 | 205 | EXT4_ATTR_FUNC(reserved_clusters, 0644); |
| 206 | +EXT4_ATTR_FUNC(sra_exceeded_retry_limit, 0444); | |
| 205 | 207 | |
| 206 | 208 | EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, inode_readahead, |
| 207 | 209 | ext4_sb_info, s_inode_readahead_blks); |
| @@ -251,6 +253,7 @@ static struct attribute *ext4_attrs[] = { · 43 unmodified lines | ||
| 251 | 253 | ATTR_LIST(session_write_kbytes), |
| 252 | 254 | ATTR_LIST(lifetime_write_kbytes), |
| 253 | 255 | ATTR_LIST(reserved_clusters), |
| 256 | + ATTR_LIST(sra_exceeded_retry_limit), | |
| 254 | 257 | ATTR_LIST(inode_readahead_blks), |
| 255 | 258 | ATTR_LIST(inode_goal), |
| 256 | 259 | ATTR_LIST(mb_stats), |
| @@ -374,6 +377,10 @@ static ssize_t ext4_attr_show(struct kobject *kobj, · 117 unmodified lines | ||
| 374 | 377 | return snprintf(buf, PAGE_SIZE, "%llu\n", |
| 375 | 378 | (unsigned long long) |
| 376 | 379 | atomic64_read(&sbi->s_resv_clusters)); |
| 380 | + case attr_sra_exceeded_retry_limit: | |
| 381 | + return snprintf(buf, PAGE_SIZE, "%llu\n", | |
| 382 | + (unsigned long long) | |
| 383 | + percpu_counter_sum(&sbi->s_sra_exceeded_retry_limit)); | |
| 377 | 384 | case attr_inode_readahead: |
| 378 | 385 | case attr_pointer_ui: |
| 379 | 386 | if (!ptr) |
| @@ -201,55 +201,76 @@ static int ext4_end_enable_verity(struct file *filp, const void *desc, · 200 unmodified lines | ||
| 201 | 201 | struct inode *inode = file_inode(filp); |
| 202 | 202 | const int credits = 2; /* superblock and inode for ext4_orphan_del() */ |
| 203 | 203 | handle_t *handle; |
| 204 | + struct ext4_iloc iloc; | |
| 204 | 205 | int err = 0; |
| 205 | − int err2; | |
| 206 | 206 | |
| 207 | − if (desc != NULL) { | |
| 208 | − /* Succeeded; write the verity descriptor. */ | |
| 209 | − err = ext4_write_verity_descriptor(inode, desc, desc_size, | |
| 210 | − merkle_tree_size); | |
| 211 | − | |
| 212 | − /* Write all pages before clearing VERITY_IN_PROGRESS. */ | |
| 213 | − if (!err) | |
| 214 | − err = filemap_write_and_wait(inode->i_mapping); | |
| 215 | − } | |
| 207 | + /* | |
| 208 | + * If an error already occurred (which fs/verity/ signals by passing | |
| 209 | + * desc == NULL), then only clean-up is needed. | |
| 210 | + */ | |
| 211 | + if (desc == NULL) | |
| 212 | + goto cleanup; | |
| 216 | 213 | |
| 217 | − /* If we failed, truncate anything we wrote past i_size. */ | |
| 218 | − if (desc == NULL || err) | |
| 219 | − ext4_truncate(inode); | |
| 214 | + /* Append the verity descriptor. */ | |
| 215 | + err = ext4_write_verity_descriptor(inode, desc, desc_size, | |
| 216 | + merkle_tree_size); | |
| 217 | + if (err) | |
| 218 | + goto cleanup; | |
| 220 | 219 | |
| 221 | 220 | /* |
| 222 | − * We must always clean up by clearing EXT4_STATE_VERITY_IN_PROGRESS and | |
| 223 | − * deleting the inode from the orphan list, even if something failed. | |
| 224 | − * If everything succeeded, we'll also set the verity bit in the same | |
| 225 | − * transaction. | |
| 221 | + * Write all pages (both data and verity metadata). Note that this must | |
| 222 | + * happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages | |
| 223 | + * beyond i_size won't be written properly. For crash consistency, this | |
| 224 | + * also must happen before the verity inode flag gets persisted. | |
| 226 | 225 | */ |
| 226 | + err = filemap_write_and_wait(inode->i_mapping); | |
| 227 | + if (err) | |
| 228 | + goto cleanup; | |
| 227 | 229 | |
| 228 | − ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS); | |
| 230 | + /* | |
| 231 | + * Finally, set the verity inode flag and remove the inode from the | |
| 232 | + * orphan list (in a single transaction). | |
| 233 | + */ | |
| 229 | 234 | |
| 230 | 235 | handle = ext4_journal_start(inode, EXT4_HT_INODE, credits); |
| 231 | 236 | if (IS_ERR(handle)) { |
| 232 | − ext4_orphan_del(NULL, inode); | |
| 233 | − return PTR_ERR(handle); | |
| 237 | + err = PTR_ERR(handle); | |
| 238 | + goto cleanup; | |
| 234 | 239 | } |
| 235 | 240 | |
| 236 | − err2 = ext4_orphan_del(handle, inode); | |
| 237 | − if (err2) | |
| 238 | − goto out_stop; | |
| 241 | + err = ext4_orphan_del(handle, inode); | |
| 242 | + if (err) | |
| 243 | + goto stop_and_cleanup; | |
| 239 | 244 | |
| 240 | − if (desc != NULL && !err) { | |
| 241 | − struct ext4_iloc iloc; | |
| 245 | + err = ext4_reserve_inode_write(handle, inode, &iloc); | |
| 246 | + if (err) | |
| 247 | + goto stop_and_cleanup; | |
| 242 | 248 | |
| 243 | − err = ext4_reserve_inode_write(handle, inode, &iloc); | |
| 244 | − if (err) | |
| 245 | − goto out_stop; | |
| 246 | − ext4_set_inode_flag(inode, EXT4_INODE_VERITY); | |
| 247 | − ext4_set_inode_flags(inode, false); | |
| 248 | − err = ext4_mark_iloc_dirty(handle, inode, &iloc); | |
| 249 | − } | |
| 250 | −out_stop: | |
| 249 | + ext4_set_inode_flag(inode, EXT4_INODE_VERITY); | |
| 250 | + ext4_set_inode_flags(inode, false); | |
| 251 | + err = ext4_mark_iloc_dirty(handle, inode, &iloc); | |
| 252 | + if (err) | |
| 253 | + goto stop_and_cleanup; | |
| 254 | + | |
| 255 | + ext4_journal_stop(handle); | |
| 256 | + | |
| 257 | + ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS); | |
| 258 | + return 0; | |
| 259 | + | |
| 260 | +stop_and_cleanup: | |
| 251 | 261 | ext4_journal_stop(handle); |
| 252 | − return err ?: err2; | |
| 262 | +cleanup: | |
| 263 | + /* | |
| 264 | + * Verity failed to be enabled, so clean up by truncating any verity | |
| 265 | + * metadata that was written beyond i_size (both from cache and from | |
| 266 | + * disk), removing the inode from the orphan list (if it wasn't done | |
| 267 | + * already), and clearing EXT4_STATE_VERITY_IN_PROGRESS. | |
| 268 | + */ | |
| 269 | + truncate_inode_pages(inode->i_mapping, inode->i_size); | |
| 270 | + ext4_truncate(inode); | |
| 271 | + ext4_orphan_del(NULL, inode); | |
| 272 | + ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS); | |
| 273 | + return err; | |
| 253 | 274 | } |
| 254 | 275 | |
| 255 | 276 | static int ext4_get_verity_descriptor_location(struct inode *inode, |
| @@ -1462,6 +1462,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value, · 1461 unmodified lines | ||
| 1462 | 1462 | if (!ce) |
| 1463 | 1463 | return NULL; |
| 1464 | 1464 | |
| 1465 | + WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) && | |
| 1466 | + !(current->flags & PF_MEMALLOC_NOFS)); | |
| 1467 | + | |
| 1465 | 1468 | ea_data = kvmalloc(value_len, GFP_KERNEL); |
| 1466 | 1469 | if (!ea_data) { |
| 1467 | 1470 | mb_cache_entry_put(ea_inode_cache, ce); |
| @@ -2327,6 +2330,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, · 859 unmodified lines | ||
| 2327 | 2330 | error = -ENOSPC; |
| 2328 | 2331 | goto cleanup; |
| 2329 | 2332 | } |
| 2333 | + WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS)); | |
| 2330 | 2334 | } |
| 2331 | 2335 | |
| 2332 | 2336 | error = ext4_reserve_inode_write(handle, inode, &is.iloc); |
| @@ -2400,7 +2404,7 @@ retry_inode: · 67 unmodified lines | ||
| 2400 | 2404 | * external inode if possible. |
| 2401 | 2405 | */ |
| 2402 | 2406 | if (ext4_has_feature_ea_inode(inode->i_sb) && |
| 2403 | − !i.in_inode) { | |
| 2407 | + i.value_len && !i.in_inode) { | |
| 2404 | 2408 | i.in_inode = 1; |
| 2405 | 2409 | goto retry_inode; |
| 2406 | 2410 | } |
| @@ -2229,19 +2229,21 @@ static int fuse_device_clone(struct fuse_conn *fc, struct file *new) · 2228 unmodified lines | ||
| 2229 | 2229 | static long fuse_dev_ioctl(struct file *file, unsigned int cmd, |
| 2230 | 2230 | unsigned long arg) |
| 2231 | 2231 | { |
| 2232 | − int err = -ENOTTY; | |
| 2232 | + int res; | |
| 2233 | + int oldfd; | |
| 2234 | + struct fuse_dev *fud = NULL; | |
| 2233 | 2235 | |
| 2234 | − if (cmd == FUSE_DEV_IOC_CLONE) { | |
| 2235 | − int oldfd; | |
| 2236 | + if (_IOC_TYPE(cmd) != FUSE_DEV_IOC_MAGIC) | |
| 2237 | + return -ENOTTY; | |
| 2236 | 2238 | |
| 2237 | − err = -EFAULT; | |
| 2238 | − if (!get_user(oldfd, (__u32 __user *) arg)) { | |
| 2239 | + switch (_IOC_NR(cmd)) { | |
| 2240 | + case _IOC_NR(FUSE_DEV_IOC_CLONE): | |
| 2241 | + res = -EFAULT; | |
| 2242 | + if (!get_user(oldfd, (__u32 __user *)arg)) { | |
| 2239 | 2243 | struct file *old = fget(oldfd); |
| 2240 | 2244 | |
| 2241 | − err = -EINVAL; | |
| 2245 | + res = -EINVAL; | |
| 2242 | 2246 | if (old) { |
| 2243 | − struct fuse_dev *fud = NULL; | |
| 2244 | − | |
| 2245 | 2247 | /* |
| 2246 | 2248 | * Check against file->f_op because CUSE |
| 2247 | 2249 | * uses the same ioctl handler. |
| @@ -2252,14 +2254,18 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd, · 4 unmodified lines | ||
| 2252 | 2254 | |
| 2253 | 2255 | if (fud) { |
| 2254 | 2256 | mutex_lock(&fuse_mutex); |
| 2255 | − err = fuse_device_clone(fud->fc, file); | |
| 2257 | + res = fuse_device_clone(fud->fc, file); | |
| 2256 | 2258 | mutex_unlock(&fuse_mutex); |
| 2257 | 2259 | } |
| 2258 | 2260 | fput(old); |
| 2259 | 2261 | } |
| 2260 | 2262 | } |
| 2263 | + break; | |
| 2264 | + default: | |
| 2265 | + res = -ENOTTY; | |
| 2266 | + break; | |
| 2261 | 2267 | } |
| 2262 | − return err; | |
| 2268 | + return res; | |
| 2263 | 2269 | } |
| 2264 | 2270 | |
| 2265 | 2271 | const struct file_operations fuse_dev_operations = { |
| @@ -863,6 +863,7 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc) · 862 unmodified lines | ||
| 863 | 863 | |
| 864 | 864 | static inline void fuse_make_bad(struct inode *inode) |
| 865 | 865 | { |
| 866 | + remove_inode_hash(inode); | |
| 866 | 867 | set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state); |
| 867 | 868 | } |
| 868 | 869 | |
| @@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct super_block *sb, struct fs_context *fsc) · 1323 unmodified lines | ||
| 1324 | 1324 | |
| 1325 | 1325 | /* virtiofs allocates and installs its own fuse devices */ |
| 1326 | 1326 | ctx->fudptr = NULL; |
| 1327 | − if (ctx->dax) | |
| 1327 | + if (ctx->dax) { | |
| 1328 | + if (!fs->dax_dev) { | |
| 1329 | + err = -EINVAL; | |
| 1330 | + pr_err("virtio-fs: dax can't be enabled as filesystem" | |
| 1331 | + " device does not support it.\n"); | |
| 1332 | + goto err_free_fuse_devs; | |
| 1333 | + } | |
| 1328 | 1334 | ctx->dax_dev = fs->dax_dev; |
| 1335 | + } | |
| 1329 | 1336 | err = fuse_fill_super_common(sb, ctx); |
| 1330 | 1337 | if (err < 0) |
| 1331 | 1338 | goto err_free_fuse_devs; |
| @@ -386,13 +386,16 @@ static struct io_wq_work *io_get_next_work(struct io_wqe *wqe) · 385 unmodified lines | ||
| 386 | 386 | return NULL; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | −static void io_flush_signals(void) | |
| 389 | +static bool io_flush_signals(void) | |
| 390 | 390 | { |
| 391 | 391 | if (unlikely(test_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL))) { |
| 392 | + __set_current_state(TASK_RUNNING); | |
| 392 | 393 | if (current->task_works) |
| 393 | 394 | task_work_run(); |
| 394 | 395 | clear_tsk_thread_flag(current, TIF_NOTIFY_SIGNAL); |
| 396 | + return true; | |
| 395 | 397 | } |
| 398 | + return false; | |
| 396 | 399 | } |
| 397 | 400 | |
| 398 | 401 | static void io_assign_current_work(struct io_worker *worker, |
| @@ -488,6 +491,8 @@ static int io_wqe_worker(void *data) · 89 unmodified lines | ||
| 488 | 491 | set_task_comm(current, buf); |
| 489 | 492 | |
| 490 | 493 | while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)) { |
| 494 | + long ret; | |
| 495 | + | |
| 491 | 496 | set_current_state(TASK_INTERRUPTIBLE); |
| 492 | 497 | loop: |
| 493 | 498 | raw_spin_lock_irq(&wqe->lock); |
| @@ -497,8 +502,10 @@ loop: · 3 unmodified lines | ||
| 497 | 502 | } |
| 498 | 503 | __io_worker_idle(wqe, worker); |
| 499 | 504 | raw_spin_unlock_irq(&wqe->lock); |
| 500 | − io_flush_signals(); | |
| 501 | − if (schedule_timeout(WORKER_IDLE_TIMEOUT)) | |
| 505 | + if (io_flush_signals()) | |
| 506 | + continue; | |
| 507 | + ret = schedule_timeout(WORKER_IDLE_TIMEOUT); | |
| 508 | + if (try_to_freeze() || ret) | |
| 502 | 509 | continue; |
| 503 | 510 | if (fatal_signal_pending(current)) |
| 504 | 511 | break; |
| @@ -709,6 +716,7 @@ static int io_wq_manager(void *data) · 204 unmodified lines | ||
| 709 | 716 | set_current_state(TASK_INTERRUPTIBLE); |
| 710 | 717 | io_wq_check_workers(wq); |
| 711 | 718 | schedule_timeout(HZ); |
| 719 | + try_to_freeze(); | |
| 712 | 720 | if (fatal_signal_pending(current)) |
| 713 | 721 | set_bit(IO_WQ_BIT_EXIT, &wq->state); |
| 714 | 722 | } while (!test_bit(IO_WQ_BIT_EXIT, &wq->state)); |
| @@ -2,7 +2,6 @@ · 1 unmodified line | ||
| 2 | 2 | #define INTERNAL_IO_WQ_H |
| 3 | 3 | |
| 4 | 4 | #include <linux/refcount.h> |
| 5 | −#include <linux/io_uring.h> | |
| 6 | 5 | |
| 7 | 6 | struct io_wq; |
| 8 | 7 | |
| @@ -21,6 +20,15 @@ enum io_wq_cancel { · 12 unmodified lines | ||
| 21 | 20 | IO_WQ_CANCEL_NOTFOUND, /* work not found */ |
| 22 | 21 | }; |
| 23 | 22 | |
| 23 | +struct io_wq_work_node { | |
| 24 | + struct io_wq_work_node *next; | |
| 25 | +}; | |
| 26 | + | |
| 27 | +struct io_wq_work_list { | |
| 28 | + struct io_wq_work_node *first; | |
| 29 | + struct io_wq_work_node *last; | |
| 30 | +}; | |
| 31 | + | |
| 24 | 32 | static inline void wq_list_add_after(struct io_wq_work_node *node, |
| 25 | 33 | struct io_wq_work_node *pos, |
| 26 | 34 | struct io_wq_work_list *list) |
| @@ -258,7 +258,8 @@ enum { · 257 unmodified lines | ||
| 258 | 258 | |
| 259 | 259 | struct io_sq_data { |
| 260 | 260 | refcount_t refs; |
| 261 | − struct rw_semaphore rw_lock; | |
| 261 | + atomic_t park_pending; | |
| 262 | + struct mutex lock; | |
| 262 | 263 | |
| 263 | 264 | /* ctx's that are using this sqd */ |
| 264 | 265 | struct list_head ctx_list; |
| @@ -273,6 +274,7 @@ struct io_sq_data { · 8 unmodified lines | ||
| 273 | 274 | |
| 274 | 275 | unsigned long state; |
| 275 | 276 | struct completion exited; |
| 277 | + struct callback_head *park_task_work; | |
| 276 | 278 | }; |
| 277 | 279 | |
| 278 | 280 | #define IO_IOPOLL_BATCH 8 |
| @@ -402,7 +404,7 @@ struct io_ring_ctx { · 123 unmodified lines | ||
| 402 | 404 | struct socket *ring_sock; |
| 403 | 405 | #endif |
| 404 | 406 | |
| 405 | − struct idr io_buffer_idr; | |
| 407 | + struct xarray io_buffers; | |
| 406 | 408 | |
| 407 | 409 | struct xarray personalities; |
| 408 | 410 | u32 pers_next; |
| @@ -454,6 +456,22 @@ struct io_ring_ctx { · 45 unmodified lines | ||
| 454 | 456 | struct list_head tctx_list; |
| 455 | 457 | }; |
| 456 | 458 | |
| 459 | +struct io_uring_task { | |
| 460 | + /* submission side */ | |
| 461 | + struct xarray xa; | |
| 462 | + struct wait_queue_head wait; | |
| 463 | + const struct io_ring_ctx *last; | |
| 464 | + struct io_wq *io_wq; | |
| 465 | + struct percpu_counter inflight; | |
| 466 | + atomic_t in_idle; | |
| 467 | + bool sqpoll; | |
| 468 | + | |
| 469 | + spinlock_t task_lock; | |
| 470 | + struct io_wq_work_list task_list; | |
| 471 | + unsigned long task_state; | |
| 472 | + struct callback_head task_work; | |
| 473 | +}; | |
| 474 | + | |
| 457 | 475 | /* |
| 458 | 476 | * First field must be the file pointer in all the |
| 459 | 477 | * iocb unions! See also 'struct kiocb' in <linux/fs.h> |
| @@ -1135,7 +1153,7 @@ static struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p) · 675 unmodified lines | ||
| 1135 | 1153 | init_waitqueue_head(&ctx->cq_wait); |
| 1136 | 1154 | INIT_LIST_HEAD(&ctx->cq_overflow_list); |
| 1137 | 1155 | init_completion(&ctx->ref_comp); |
| 1138 | − idr_init(&ctx->io_buffer_idr); | |
| 1156 | + xa_init_flags(&ctx->io_buffers, XA_FLAGS_ALLOC1); | |
| 1139 | 1157 | xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1); |
| 1140 | 1158 | mutex_init(&ctx->uring_lock); |
| 1141 | 1159 | init_waitqueue_head(&ctx->wait); |
| @@ -1550,14 +1568,17 @@ static void io_req_complete_post(struct io_kiocb *req, long res, · 408 unmodified lines | ||
| 1550 | 1568 | io_put_task(req->task, 1); |
| 1551 | 1569 | list_add(&req->compl.list, &cs->locked_free_list); |
| 1552 | 1570 | cs->locked_free_nr++; |
| 1553 | − } else | |
| 1554 | − req = NULL; | |
| 1571 | + } else { | |
| 1572 | + if (!percpu_ref_tryget(&ctx->refs)) | |
| 1573 | + req = NULL; | |
| 1574 | + } | |
| 1555 | 1575 | io_commit_cqring(ctx); |
| 1556 | 1576 | spin_unlock_irqrestore(&ctx->completion_lock, flags); |
| 1557 | − io_cqring_ev_posted(ctx); | |
| 1558 | 1577 | |
| 1559 | − if (req) | |
| 1578 | + if (req) { | |
| 1579 | + io_cqring_ev_posted(ctx); | |
| 1560 | 1580 | percpu_ref_put(&ctx->refs); |
| 1581 | + } | |
| 1561 | 1582 | } |
| 1562 | 1583 | |
| 1563 | 1584 | static void io_req_complete_state(struct io_kiocb *req, long res, |
| @@ -1925,17 +1946,44 @@ static int io_req_task_work_add(struct io_kiocb *req) · 361 unmodified lines | ||
| 1925 | 1946 | return ret; |
| 1926 | 1947 | } |
| 1927 | 1948 | |
| 1928 | −static void io_req_task_work_add_fallback(struct io_kiocb *req, | |
| 1929 | − task_work_func_t cb) | |
| 1949 | +static bool io_run_task_work_head(struct callback_head **work_head) | |
| 1950 | +{ | |
| 1951 | + struct callback_head *work, *next; | |
| 1952 | + bool executed = false; | |
| 1953 | + | |
| 1954 | + do { | |
| 1955 | + work = xchg(work_head, NULL); | |
| 1956 | + if (!work) | |
| 1957 | + break; | |
| 1958 | + | |
| 1959 | + do { | |
| 1960 | + next = work->next; | |
| 1961 | + work->func(work); | |
| 1962 | + work = next; | |
| 1963 | + cond_resched(); | |
| 1964 | + } while (work); | |
| 1965 | + executed = true; | |
| 1966 | + } while (1); | |
| 1967 | + | |
| 1968 | + return executed; | |
| 1969 | +} | |
| 1970 | + | |
| 1971 | +static void io_task_work_add_head(struct callback_head **work_head, | |
| 1972 | + struct callback_head *task_work) | |
| 1930 | 1973 | { |
| 1931 | − struct io_ring_ctx *ctx = req->ctx; | |
| 1932 | 1974 | struct callback_head *head; |
| 1933 | 1975 | |
| 1934 | − init_task_work(&req->task_work, cb); | |
| 1935 | 1976 | do { |
| 1936 | − head = READ_ONCE(ctx->exit_task_work); | |
| 1937 | − req->task_work.next = head; | |
| 1938 | − } while (cmpxchg(&ctx->exit_task_work, head, &req->task_work) != head); | |
| 1977 | + head = READ_ONCE(*work_head); | |
| 1978 | + task_work->next = head; | |
| 1979 | + } while (cmpxchg(work_head, head, task_work) != head); | |
| 1980 | +} | |
| 1981 | + | |
| 1982 | +static void io_req_task_work_add_fallback(struct io_kiocb *req, | |
| 1983 | + task_work_func_t cb) | |
| 1984 | +{ | |
| 1985 | + init_task_work(&req->task_work, cb); | |
| 1986 | + io_task_work_add_head(&req->ctx->exit_task_work, &req->task_work); | |
| 1939 | 1987 | } |
| 1940 | 1988 | |
| 1941 | 1989 | static void __io_req_task_cancel(struct io_kiocb *req, int error) |
| @@ -2843,7 +2891,7 @@ static struct io_buffer *io_buffer_select(struct io_kiocb *req, size_t *len, · 901 unmodified lines | ||
| 2843 | 2891 | |
| 2844 | 2892 | lockdep_assert_held(&req->ctx->uring_lock); |
| 2845 | 2893 | |
| 2846 | − head = idr_find(&req->ctx->io_buffer_idr, bgid); | |
| 2894 | + head = xa_load(&req->ctx->io_buffers, bgid); | |
| 2847 | 2895 | if (head) { |
| 2848 | 2896 | if (!list_empty(&head->list)) { |
| 2849 | 2897 | kbuf = list_last_entry(&head->list, struct io_buffer, |
| @@ -2851,7 +2899,7 @@ static struct io_buffer *io_buffer_select(struct io_kiocb *req, size_t *len, · 1 unmodified line | ||
| 2851 | 2899 | list_del(&kbuf->list); |
| 2852 | 2900 | } else { |
| 2853 | 2901 | kbuf = head; |
| 2854 | − idr_remove(&req->ctx->io_buffer_idr, bgid); | |
| 2902 | + xa_erase(&req->ctx->io_buffers, bgid); | |
| 2855 | 2903 | } |
| 2856 | 2904 | if (*len > kbuf->len) |
| 2857 | 2905 | *len = kbuf->len; |
| @@ -3892,7 +3940,7 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx, struct io_buffer *buf, · 1034 unmodified lines | ||
| 3892 | 3940 | } |
| 3893 | 3941 | i++; |
| 3894 | 3942 | kfree(buf); |
| 3895 | − idr_remove(&ctx->io_buffer_idr, bgid); | |
| 3943 | + xa_erase(&ctx->io_buffers, bgid); | |
| 3896 | 3944 | |
| 3897 | 3945 | return i; |
| 3898 | 3946 | } |
| @@ -3910,7 +3958,7 @@ static int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags) · 11 unmodified lines | ||
| 3910 | 3958 | lockdep_assert_held(&ctx->uring_lock); |
| 3911 | 3959 | |
| 3912 | 3960 | ret = -ENOENT; |
| 3913 | − head = idr_find(&ctx->io_buffer_idr, p->bgid); | |
| 3961 | + head = xa_load(&ctx->io_buffers, p->bgid); | |
| 3914 | 3962 | if (head) |
| 3915 | 3963 | ret = __io_remove_buffers(ctx, head, p->bgid, p->nbufs); |
| 3916 | 3964 | if (ret < 0) |
| @@ -3993,21 +4041,14 @@ static int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags) · 76 unmodified lines | ||
| 3993 | 4041 | |
| 3994 | 4042 | lockdep_assert_held(&ctx->uring_lock); |
| 3995 | 4043 | |
| 3996 | − list = head = idr_find(&ctx->io_buffer_idr, p->bgid); | |
| 4044 | + list = head = xa_load(&ctx->io_buffers, p->bgid); | |
| 3997 | 4045 | |
| 3998 | 4046 | ret = io_add_buffers(p, &head); |
| 3999 | − if (ret < 0) | |
| 4000 | − goto out; | |
| 4001 | − | |
| 4002 | − if (!list) { | |
| 4003 | − ret = idr_alloc(&ctx->io_buffer_idr, head, p->bgid, p->bgid + 1, | |
| 4004 | − GFP_KERNEL); | |
| 4005 | − if (ret < 0) { | |
| 4047 | + if (ret >= 0 && !list) { | |
| 4048 | + ret = xa_insert(&ctx->io_buffers, p->bgid, head, GFP_KERNEL); | |
| 4049 | + if (ret < 0) | |
| 4006 | 4050 | __io_remove_buffers(ctx, head, p->bgid, -1U); |
| 4007 | − goto out; | |
| 4008 | − } | |
| 4009 | 4051 | } |
| 4010 | −out: | |
| 4011 | 4052 | if (ret < 0) |
| 4012 | 4053 | req_set_fail_links(req); |
| 4013 | 4054 | |
| @@ -4345,6 +4386,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 331 unmodified lines | ||
| 4345 | 4386 | struct io_async_msghdr iomsg, *kmsg; |
| 4346 | 4387 | struct socket *sock; |
| 4347 | 4388 | unsigned flags; |
| 4389 | + int min_ret = 0; | |
| 4348 | 4390 | int ret; |
| 4349 | 4391 | |
| 4350 | 4392 | sock = sock_from_file(req->file); |
| @@ -4359,12 +4401,15 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 8 unmodified lines | ||
| 4359 | 4401 | kmsg = &iomsg; |
| 4360 | 4402 | } |
| 4361 | 4403 | |
| 4362 | − flags = req->sr_msg.msg_flags; | |
| 4404 | + flags = req->sr_msg.msg_flags | MSG_NOSIGNAL; | |
| 4363 | 4405 | if (flags & MSG_DONTWAIT) |
| 4364 | 4406 | req->flags |= REQ_F_NOWAIT; |
| 4365 | 4407 | else if (issue_flags & IO_URING_F_NONBLOCK) |
| 4366 | 4408 | flags |= MSG_DONTWAIT; |
| 4367 | 4409 | |
| 4410 | + if (flags & MSG_WAITALL) | |
| 4411 | + min_ret = iov_iter_count(&kmsg->msg.msg_iter); | |
| 4412 | + | |
| 4368 | 4413 | ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags); |
| 4369 | 4414 | if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN) |
| 4370 | 4415 | return io_setup_async_msg(req, kmsg); |
| @@ -4375,7 +4420,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags) · 4 unmodified lines | ||
| 4375 | 4420 | if (kmsg->free_iov) |
| 4376 | 4421 | kfree(kmsg->free_iov); |
| 4377 | 4422 | req->flags &= ~REQ_F_NEED_CLEANUP; |
| 4378 | − if (ret < 0) | |
| 4423 | + if (ret < min_ret) | |
| 4379 | 4424 | req_set_fail_links(req); |
| 4380 | 4425 | __io_req_complete(req, issue_flags, ret, 0); |
| 4381 | 4426 | return 0; |
| @@ -4388,6 +4433,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 6 unmodified lines | ||
| 4388 | 4433 | struct iovec iov; |
| 4389 | 4434 | struct socket *sock; |
| 4390 | 4435 | unsigned flags; |
| 4436 | + int min_ret = 0; | |
| 4391 | 4437 | int ret; |
| 4392 | 4438 | |
| 4393 | 4439 | sock = sock_from_file(req->file); |
| @@ -4403,12 +4449,15 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 9 unmodified lines | ||
| 4403 | 4449 | msg.msg_controllen = 0; |
| 4404 | 4450 | msg.msg_namelen = 0; |
| 4405 | 4451 | |
| 4406 | − flags = req->sr_msg.msg_flags; | |
| 4452 | + flags = req->sr_msg.msg_flags | MSG_NOSIGNAL; | |
| 4407 | 4453 | if (flags & MSG_DONTWAIT) |
| 4408 | 4454 | req->flags |= REQ_F_NOWAIT; |
| 4409 | 4455 | else if (issue_flags & IO_URING_F_NONBLOCK) |
| 4410 | 4456 | flags |= MSG_DONTWAIT; |
| 4411 | 4457 | |
| 4458 | + if (flags & MSG_WAITALL) | |
| 4459 | + min_ret = iov_iter_count(&msg.msg_iter); | |
| 4460 | + | |
| 4412 | 4461 | msg.msg_flags = flags; |
| 4413 | 4462 | ret = sock_sendmsg(sock, &msg); |
| 4414 | 4463 | if ((issue_flags & IO_URING_F_NONBLOCK) && ret == -EAGAIN) |
| @@ -4416,7 +4465,7 @@ static int io_send(struct io_kiocb *req, unsigned int issue_flags) · 1 unmodified line | ||
| 4416 | 4465 | if (ret == -ERESTARTSYS) |
| 4417 | 4466 | ret = -EINTR; |
| 4418 | 4467 | |
| 4419 | − if (ret < 0) | |
| 4468 | + if (ret < min_ret) | |
| 4420 | 4469 | req_set_fail_links(req); |
| 4421 | 4470 | __io_req_complete(req, issue_flags, ret, 0); |
| 4422 | 4471 | return 0; |
| @@ -4568,6 +4617,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 145 unmodified lines | ||
| 4568 | 4617 | struct socket *sock; |
| 4569 | 4618 | struct io_buffer *kbuf; |
| 4570 | 4619 | unsigned flags; |
| 4620 | + int min_ret = 0; | |
| 4571 | 4621 | int ret, cflags = 0; |
| 4572 | 4622 | bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; |
| 4573 | 4623 | |
| @@ -4593,12 +4643,15 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines | ||
| 4593 | 4643 | 1, req->sr_msg.len); |
| 4594 | 4644 | } |
| 4595 | 4645 | |
| 4596 | − flags = req->sr_msg.msg_flags; | |
| 4646 | + flags = req->sr_msg.msg_flags | MSG_NOSIGNAL; | |
| 4597 | 4647 | if (flags & MSG_DONTWAIT) |
| 4598 | 4648 | req->flags |= REQ_F_NOWAIT; |
| 4599 | 4649 | else if (force_nonblock) |
| 4600 | 4650 | flags |= MSG_DONTWAIT; |
| 4601 | 4651 | |
| 4652 | + if (flags & MSG_WAITALL) | |
| 4653 | + min_ret = iov_iter_count(&kmsg->msg.msg_iter); | |
| 4654 | + | |
| 4602 | 4655 | ret = __sys_recvmsg_sock(sock, &kmsg->msg, req->sr_msg.umsg, |
| 4603 | 4656 | kmsg->uaddr, flags); |
| 4604 | 4657 | if (force_nonblock && ret == -EAGAIN) |
| @@ -4612,7 +4665,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) · 7 unmodified lines | ||
| 4612 | 4665 | if (kmsg->free_iov) |
| 4613 | 4666 | kfree(kmsg->free_iov); |
| 4614 | 4667 | req->flags &= ~REQ_F_NEED_CLEANUP; |
| 4615 | − if (ret < 0) | |
| 4668 | + if (ret < min_ret || ((flags & MSG_WAITALL) && (kmsg->msg.msg_flags & (MSG_TRUNC | MSG_CTRUNC)))) | |
| 4616 | 4669 | req_set_fail_links(req); |
| 4617 | 4670 | __io_req_complete(req, issue_flags, ret, cflags); |
| 4618 | 4671 | return 0; |
| @@ -4627,6 +4680,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 8 unmodified lines | ||
| 4627 | 4680 | struct socket *sock; |
| 4628 | 4681 | struct iovec iov; |
| 4629 | 4682 | unsigned flags; |
| 4683 | + int min_ret = 0; | |
| 4630 | 4684 | int ret, cflags = 0; |
| 4631 | 4685 | bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; |
| 4632 | 4686 | |
| @@ -4652,12 +4706,15 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 19 unmodified lines | ||
| 4652 | 4706 | msg.msg_iocb = NULL; |
| 4653 | 4707 | msg.msg_flags = 0; |
| 4654 | 4708 | |
| 4655 | − flags = req->sr_msg.msg_flags; | |
| 4709 | + flags = req->sr_msg.msg_flags | MSG_NOSIGNAL; | |
| 4656 | 4710 | if (flags & MSG_DONTWAIT) |
| 4657 | 4711 | req->flags |= REQ_F_NOWAIT; |
| 4658 | 4712 | else if (force_nonblock) |
| 4659 | 4713 | flags |= MSG_DONTWAIT; |
| 4660 | 4714 | |
| 4715 | + if (flags & MSG_WAITALL) | |
| 4716 | + min_ret = iov_iter_count(&msg.msg_iter); | |
| 4717 | + | |
| 4661 | 4718 | ret = sock_recvmsg(sock, &msg, flags); |
| 4662 | 4719 | if (force_nonblock && ret == -EAGAIN) |
| 4663 | 4720 | return -EAGAIN; |
| @@ -4666,7 +4723,7 @@ static int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 2 unmodified lines | ||
| 4666 | 4723 | out_free: |
| 4667 | 4724 | if (req->flags & REQ_F_BUFFER_SELECTED) |
| 4668 | 4725 | cflags = io_put_recv_kbuf(req); |
| 4669 | − if (ret < 0) | |
| 4726 | + if (ret < min_ret || ((flags & MSG_WAITALL) && (msg.msg_flags & (MSG_TRUNC | MSG_CTRUNC)))) | |
| 4670 | 4727 | req_set_fail_links(req); |
| 4671 | 4728 | __io_req_complete(req, issue_flags, ret, cflags); |
| 4672 | 4729 | return 0; |
| @@ -6204,7 +6261,6 @@ static enum hrtimer_restart io_link_timeout_fn(struct hrtimer *timer) · 1531 unmodified lines | ||
| 6204 | 6261 | spin_unlock_irqrestore(&ctx->completion_lock, flags); |
| 6205 | 6262 | |
| 6206 | 6263 | if (prev) { |
| 6207 | − req_set_fail_links(prev); | |
| 6208 | 6264 | io_async_find_and_cancel(ctx, req, prev->user_data, -ETIME); |
| 6209 | 6265 | io_put_req_deferred(prev, 1); |
| 6210 | 6266 | } else { |
| @@ -6694,17 +6750,17 @@ static int io_sq_thread(void *data) · 483 unmodified lines | ||
| 6694 | 6750 | set_cpus_allowed_ptr(current, cpu_online_mask); |
| 6695 | 6751 | current->flags |= PF_NO_SETAFFINITY; |
| 6696 | 6752 | |
| 6697 | − down_read(&sqd->rw_lock); | |
| 6698 | − | |
| 6753 | + mutex_lock(&sqd->lock); | |
| 6699 | 6754 | while (!test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state)) { |
| 6700 | 6755 | int ret; |
| 6701 | 6756 | bool cap_entries, sqt_spin, needs_sched; |
| 6702 | 6757 | |
| 6703 | 6758 | if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state)) { |
| 6704 | − up_read(&sqd->rw_lock); | |
| 6759 | + mutex_unlock(&sqd->lock); | |
| 6705 | 6760 | cond_resched(); |
| 6706 | − down_read(&sqd->rw_lock); | |
| 6761 | + mutex_lock(&sqd->lock); | |
| 6707 | 6762 | io_run_task_work(); |
| 6763 | + io_run_task_work_head(&sqd->park_task_work); | |
| 6708 | 6764 | timeout = jiffies + sqd->sq_thread_idle; |
| 6709 | 6765 | continue; |
| 6710 | 6766 | } |
| @@ -6750,32 +6806,28 @@ static int io_sq_thread(void *data) · 39 unmodified lines | ||
| 6750 | 6806 | list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) |
| 6751 | 6807 | io_ring_set_wakeup_flag(ctx); |
| 6752 | 6808 | |
| 6753 | − up_read(&sqd->rw_lock); | |
| 6809 | + mutex_unlock(&sqd->lock); | |
| 6754 | 6810 | schedule(); |
| 6755 | − down_read(&sqd->rw_lock); | |
| 6811 | + try_to_freeze(); | |
| 6812 | + mutex_lock(&sqd->lock); | |
| 6756 | 6813 | list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) |
| 6757 | 6814 | io_ring_clear_wakeup_flag(ctx); |
| 6758 | 6815 | } |
| 6759 | 6816 | |
| 6760 | 6817 | finish_wait(&sqd->wait, &wait); |
| 6818 | + io_run_task_work_head(&sqd->park_task_work); | |
| 6761 | 6819 | timeout = jiffies + sqd->sq_thread_idle; |
| 6762 | 6820 | } |
| 6763 | − up_read(&sqd->rw_lock); | |
| 6764 | − down_write(&sqd->rw_lock); | |
| 6765 | − /* | |
| 6766 | − * someone may have parked and added a cancellation task_work, run | |
| 6767 | − * it first because we don't want it in io_uring_cancel_sqpoll() | |
| 6768 | − */ | |
| 6769 | − io_run_task_work(); | |
| 6770 | 6821 | |
| 6771 | 6822 | list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) |
| 6772 | 6823 | io_uring_cancel_sqpoll(ctx); |
| 6773 | 6824 | sqd->thread = NULL; |
| 6774 | 6825 | list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) |
| 6775 | 6826 | io_ring_set_wakeup_flag(ctx); |
| 6776 | − up_write(&sqd->rw_lock); | |
| 6827 | + mutex_unlock(&sqd->lock); | |
| 6777 | 6828 | |
| 6778 | 6829 | io_run_task_work(); |
| 6830 | + io_run_task_work_head(&sqd->park_task_work); | |
| 6779 | 6831 | complete(&sqd->exited); |
| 6780 | 6832 | do_exit(0); |
| 6781 | 6833 | } |
| @@ -7075,23 +7127,28 @@ static int io_sqe_files_unregister(struct io_ring_ctx *ctx) · 293 unmodified lines | ||
| 7075 | 7127 | } |
| 7076 | 7128 | |
| 7077 | 7129 | static void io_sq_thread_unpark(struct io_sq_data *sqd) |
| 7078 | − __releases(&sqd->rw_lock) | |
| 7130 | + __releases(&sqd->lock) | |
| 7079 | 7131 | { |
| 7080 | 7132 | WARN_ON_ONCE(sqd->thread == current); |
| 7081 | 7133 | |
| 7134 | + /* | |
| 7135 | + * Do the dance but not conditional clear_bit() because it'd race with | |
| 7136 | + * other threads incrementing park_pending and setting the bit. | |
| 7137 | + */ | |
| 7082 | 7138 | clear_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state); |
| 7083 | − up_write(&sqd->rw_lock); | |
| 7139 | + if (atomic_dec_return(&sqd->park_pending)) | |
| 7140 | + set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state); | |
| 7141 | + mutex_unlock(&sqd->lock); | |
| 7084 | 7142 | } |
| 7085 | 7143 | |
| 7086 | 7144 | static void io_sq_thread_park(struct io_sq_data *sqd) |
| 7087 | − __acquires(&sqd->rw_lock) | |
| 7145 | + __acquires(&sqd->lock) | |
| 7088 | 7146 | { |
| 7089 | 7147 | WARN_ON_ONCE(sqd->thread == current); |
| 7090 | 7148 | |
| 7149 | + atomic_inc(&sqd->park_pending); | |
| 7091 | 7150 | set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state); |
| 7092 | − down_write(&sqd->rw_lock); | |
| 7093 | − /* set again for consistency, in case concurrent parks are happening */ | |
| 7094 | − set_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state); | |
| 7151 | + mutex_lock(&sqd->lock); | |
| 7095 | 7152 | if (sqd->thread) |
| 7096 | 7153 | wake_up_process(sqd->thread); |
| 7097 | 7154 | } |
| @@ -7100,17 +7157,19 @@ static void io_sq_thread_stop(struct io_sq_data *sqd) · 2 unmodified lines | ||
| 7100 | 7157 | { |
| 7101 | 7158 | WARN_ON_ONCE(sqd->thread == current); |
| 7102 | 7159 | |
| 7103 | − down_write(&sqd->rw_lock); | |
| 7160 | + mutex_lock(&sqd->lock); | |
| 7104 | 7161 | set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state); |
| 7105 | 7162 | if (sqd->thread) |
| 7106 | 7163 | wake_up_process(sqd->thread); |
| 7107 | − up_write(&sqd->rw_lock); | |
| 7164 | + mutex_unlock(&sqd->lock); | |
| 7108 | 7165 | wait_for_completion(&sqd->exited); |
| 7109 | 7166 | } |
| 7110 | 7167 | |
| 7111 | 7168 | static void io_put_sq_data(struct io_sq_data *sqd) |
| 7112 | 7169 | { |
| 7113 | 7170 | if (refcount_dec_and_test(&sqd->refs)) { |
| 7171 | + WARN_ON_ONCE(atomic_read(&sqd->park_pending)); | |
| 7172 | + | |
| 7114 | 7173 | io_sq_thread_stop(sqd); |
| 7115 | 7174 | kfree(sqd); |
| 7116 | 7175 | } |
| @@ -7184,9 +7243,10 @@ static struct io_sq_data *io_get_sq_data(struct io_uring_params *p, · 67 unmodified lines | ||
| 7184 | 7243 | if (!sqd) |
| 7185 | 7244 | return ERR_PTR(-ENOMEM); |
| 7186 | 7245 | |
| 7246 | + atomic_set(&sqd->park_pending, 0); | |
| 7187 | 7247 | refcount_set(&sqd->refs, 1); |
| 7188 | 7248 | INIT_LIST_HEAD(&sqd->ctx_list); |
| 7189 | − init_rwsem(&sqd->rw_lock); | |
| 7249 | + mutex_init(&sqd->lock); | |
| 7190 | 7250 | init_waitqueue_head(&sqd->wait); |
| 7191 | 7251 | init_completion(&sqd->exited); |
| 7192 | 7252 | return sqd; |
| @@ -7866,22 +7926,17 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx, · 673 unmodified lines | ||
| 7866 | 7926 | |
| 7867 | 7927 | ret = 0; |
| 7868 | 7928 | io_sq_thread_park(sqd); |
| 7929 | + list_add(&ctx->sqd_list, &sqd->ctx_list); | |
| 7930 | + io_sqd_update_thread_idle(sqd); | |
| 7869 | 7931 | /* don't attach to a dying SQPOLL thread, would be racy */ |
| 7870 | − if (attached && !sqd->thread) { | |
| 7932 | + if (attached && !sqd->thread) | |
| 7871 | 7933 | ret = -ENXIO; |
| 7872 | − } else { | |
| 7873 | − list_add(&ctx->sqd_list, &sqd->ctx_list); | |
| 7874 | − io_sqd_update_thread_idle(sqd); | |
| 7875 | − } | |
| 7876 | 7934 | io_sq_thread_unpark(sqd); |
| 7877 | 7935 | |
| 7878 | − if (ret < 0) { | |
| 7879 | − io_put_sq_data(sqd); | |
| 7880 | − ctx->sq_data = NULL; | |
| 7881 | − return ret; | |
| 7882 | − } else if (attached) { | |
| 7936 | + if (ret < 0) | |
| 7937 | + goto err; | |
| 7938 | + if (attached) | |
| 7883 | 7939 | return 0; |
| 7884 | − } | |
| 7885 | 7940 | |
| 7886 | 7941 | if (p->flags & IORING_SETUP_SQ_AFF) { |
| 7887 | 7942 | int cpu = p->sq_thread_cpu; |
| @@ -8332,19 +8387,13 @@ static int io_eventfd_unregister(struct io_ring_ctx *ctx) · 444 unmodified lines | ||
| 8332 | 8387 | return -ENXIO; |
| 8333 | 8388 | } |
| 8334 | 8389 | |
| 8335 | −static int __io_destroy_buffers(int id, void *p, void *data) | |
| 8336 | −{ | |
| 8337 | − struct io_ring_ctx *ctx = data; | |
| 8338 | − struct io_buffer *buf = p; | |
| 8339 | − | |
| 8340 | − __io_remove_buffers(ctx, buf, id, -1U); | |
| 8341 | − return 0; | |
| 8342 | −} | |
| 8343 | − | |
| 8344 | 8390 | static void io_destroy_buffers(struct io_ring_ctx *ctx) |
| 8345 | 8391 | { |
| 8346 | − idr_for_each(&ctx->io_buffer_idr, __io_destroy_buffers, ctx); | |
| 8347 | − idr_destroy(&ctx->io_buffer_idr); | |
| 8392 | + struct io_buffer *buf; | |
| 8393 | + unsigned long index; | |
| 8394 | + | |
| 8395 | + xa_for_each(&ctx->io_buffers, index, buf) | |
| 8396 | + __io_remove_buffers(ctx, buf, index, -1U); | |
| 8348 | 8397 | } |
| 8349 | 8398 | |
| 8350 | 8399 | static void io_req_cache_free(struct list_head *list, struct task_struct *tsk) |
| @@ -8386,11 +8435,13 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx) · 35 unmodified lines | ||
| 8386 | 8435 | { |
| 8387 | 8436 | /* |
| 8388 | 8437 | * Some may use context even when all refs and requests have been put, |
| 8389 | − * and they are free to do so while still holding uring_lock, see | |
| 8390 | − * __io_req_task_submit(). Wait for them to finish. | |
| 8438 | + * and they are free to do so while still holding uring_lock or | |
| 8439 | + * completion_lock, see __io_req_task_submit(). Wait for them to finish. | |
| 8391 | 8440 | */ |
| 8392 | 8441 | mutex_lock(&ctx->uring_lock); |
| 8393 | 8442 | mutex_unlock(&ctx->uring_lock); |
| 8443 | + spin_lock_irq(&ctx->completion_lock); | |
| 8444 | + spin_unlock_irq(&ctx->completion_lock); | |
| 8394 | 8445 | |
| 8395 | 8446 | io_sq_thread_finish(ctx); |
| 8396 | 8447 | io_sqe_buffers_unregister(ctx); |
| @@ -8478,26 +8529,9 @@ static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id) · 81 unmodified lines | ||
| 8478 | 8529 | return -EINVAL; |
| 8479 | 8530 | } |
| 8480 | 8531 | |
| 8481 | −static bool io_run_ctx_fallback(struct io_ring_ctx *ctx) | |
| 8532 | +static inline bool io_run_ctx_fallback(struct io_ring_ctx *ctx) | |
| 8482 | 8533 | { |
| 8483 | − struct callback_head *work, *next; | |
| 8484 | − bool executed = false; | |
| 8485 | − | |
| 8486 | − do { | |
| 8487 | − work = xchg(&ctx->exit_task_work, NULL); | |
| 8488 | − if (!work) | |
| 8489 | − break; | |
| 8490 | − | |
| 8491 | − do { | |
| 8492 | − next = work->next; | |
| 8493 | − work->func(work); | |
| 8494 | − work = next; | |
| 8495 | − cond_resched(); | |
| 8496 | − } while (work); | |
| 8497 | − executed = true; | |
| 8498 | − } while (1); | |
| 8499 | − | |
| 8500 | − return executed; | |
| 8534 | + return io_run_task_work_head(&ctx->exit_task_work); | |
| 8501 | 8535 | } |
| 8502 | 8536 | |
| 8503 | 8537 | struct io_tctx_exit { |
| @@ -8580,6 +8614,14 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) · 76 unmodified lines | ||
| 8580 | 8614 | io_unregister_personality(ctx, index); |
| 8581 | 8615 | mutex_unlock(&ctx->uring_lock); |
| 8582 | 8616 | |
| 8617 | + /* prevent SQPOLL from submitting new requests */ | |
| 8618 | + if (ctx->sq_data) { | |
| 8619 | + io_sq_thread_park(ctx->sq_data); | |
| 8620 | + list_del_init(&ctx->sqd_list); | |
| 8621 | + io_sqd_update_thread_idle(ctx->sq_data); | |
| 8622 | + io_sq_thread_unpark(ctx->sq_data); | |
| 8623 | + } | |
| 8624 | + | |
| 8583 | 8625 | io_kill_timeouts(ctx, NULL, NULL); |
| 8584 | 8626 | io_poll_remove_all(ctx, NULL, NULL); |
| 8585 | 8627 | |
| @@ -8879,7 +8921,7 @@ static void io_sqpoll_cancel_sync(struct io_ring_ctx *ctx) · 293 unmodified lines | ||
| 8879 | 8921 | if (task) { |
| 8880 | 8922 | init_completion(&work.completion); |
| 8881 | 8923 | init_task_work(&work.task_work, io_sqpoll_cancel_cb); |
| 8882 | − WARN_ON_ONCE(task_work_add(task, &work.task_work, TWA_SIGNAL)); | |
| 8924 | + io_task_work_add_head(&sqd->park_task_work, &work.task_work); | |
| 8883 | 8925 | wake_up_process(task); |
| 8884 | 8926 | } |
| 8885 | 8927 | io_sq_thread_unpark(sqd); |
| @@ -170,6 +170,16 @@ int iomap_swapfile_activate(struct swap_info_struct *sis, · 169 unmodified lines | ||
| 170 | 170 | return ret; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | + /* | |
| 174 | + * If this swapfile doesn't contain even a single page-aligned | |
| 175 | + * contiguous range of blocks, reject this useless swapfile to | |
| 176 | + * prevent confusion later on. | |
| 177 | + */ | |
| 178 | + if (isi.nr_pages == 0) { | |
| 179 | + pr_warn("swapon: Cannot find a single usable page in file.\n"); | |
| 180 | + return -EINVAL; | |
| 181 | + } | |
| 182 | + | |
| 173 | 183 | *pagespan = 1 + isi.highest_ppage - isi.lowest_ppage; |
| 174 | 184 | sis->max = isi.nr_pages; |
| 175 | 185 | sis->pages = isi.nr_pages - 1; |
| @@ -1808,9 +1808,6 @@ check_conflicting_open(struct file *filp, const long arg, int flags) · 1807 unmodified lines | ||
| 1808 | 1808 | |
| 1809 | 1809 | if (flags & FL_LAYOUT) |
| 1810 | 1810 | return 0; |
| 1811 | − if (flags & FL_DELEG) | |
| 1812 | − /* We leave these checks to the caller. */ | |
| 1813 | − return 0; | |
| 1814 | 1811 | |
| 1815 | 1812 | if (arg == F_RDLCK) |
| 1816 | 1813 | return inode_is_open_for_write(inode) ? -EAGAIN : 0; |
| @@ -73,6 +73,7 @@ config NFSD_V4 · 72 unmodified lines | ||
| 73 | 73 | select NFSD_V3 |
| 74 | 74 | select FS_POSIX_ACL |
| 75 | 75 | select SUNRPC_GSS |
| 76 | + select CRYPTO | |
| 76 | 77 | select CRYPTO_MD5 |
| 77 | 78 | select CRYPTO_SHA256 |
| 78 | 79 | select GRACE_PERIOD |
| @@ -898,6 +898,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags, · 897 unmodified lines | ||
| 898 | 898 | continue; |
| 899 | 899 | if (!nfsd_match_cred(nf->nf_cred, current_cred())) |
| 900 | 900 | continue; |
| 901 | + if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) | |
| 902 | + continue; | |
| 901 | 903 | if (nfsd_file_get(nf) != NULL) |
| 902 | 904 | return nf; |
| 903 | 905 | } |
| @@ -1189,6 +1189,7 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) · 1188 unmodified lines | ||
| 1189 | 1189 | switch (task->tk_status) { |
| 1190 | 1190 | case -EIO: |
| 1191 | 1191 | case -ETIMEDOUT: |
| 1192 | + case -EACCES: | |
| 1192 | 1193 | nfsd4_mark_cb_down(clp, task->tk_status); |
| 1193 | 1194 | } |
| 1194 | 1195 | break; |
| @@ -1302,7 +1302,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src, · 1301 unmodified lines | ||
| 1302 | 1302 | struct nfsd_file *dst) |
| 1303 | 1303 | { |
| 1304 | 1304 | nfs42_ssc_close(src->nf_file); |
| 1305 | − /* 'src' is freed by nfsd4_do_async_copy */ | |
| 1305 | + fput(src->nf_file); | |
| 1306 | 1306 | nfsd_file_put(dst); |
| 1307 | 1307 | mntput(ss_mnt); |
| 1308 | 1308 | } |
| @@ -4940,31 +4940,6 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_delegation *dp, · 4939 unmodified lines | ||
| 4940 | 4940 | return fl; |
| 4941 | 4941 | } |
| 4942 | 4942 | |
| 4943 | −static int nfsd4_check_conflicting_opens(struct nfs4_client *clp, | |
| 4944 | − struct nfs4_file *fp) | |
| 4945 | −{ | |
| 4946 | − struct nfs4_clnt_odstate *co; | |
| 4947 | − struct file *f = fp->fi_deleg_file->nf_file; | |
| 4948 | − struct inode *ino = locks_inode(f); | |
| 4949 | − int writes = atomic_read(&ino->i_writecount); | |
| 4950 | − | |
| 4951 | − if (fp->fi_fds[O_WRONLY]) | |
| 4952 | − writes--; | |
| 4953 | − if (fp->fi_fds[O_RDWR]) | |
| 4954 | − writes--; | |
| 4955 | − if (writes > 0) | |
| 4956 | − return -EAGAIN; | |
| 4957 | − spin_lock(&fp->fi_lock); | |
| 4958 | − list_for_each_entry(co, &fp->fi_clnt_odstate, co_perfile) { | |
| 4959 | − if (co->co_client != clp) { | |
| 4960 | − spin_unlock(&fp->fi_lock); | |
| 4961 | − return -EAGAIN; | |
| 4962 | − } | |
| 4963 | − } | |
| 4964 | − spin_unlock(&fp->fi_lock); | |
| 4965 | − return 0; | |
| 4966 | −} | |
| 4967 | − | |
| 4968 | 4943 | static struct nfs4_delegation * |
| 4969 | 4944 | nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, |
| 4970 | 4945 | struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate) |
| @@ -4984,12 +4959,9 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, · 13 unmodified lines | ||
| 4984 | 4959 | |
| 4985 | 4960 | nf = find_readable_file(fp); |
| 4986 | 4961 | if (!nf) { |
| 4987 | − /* | |
| 4988 | − * We probably could attempt another open and get a read | |
| 4989 | − * delegation, but for now, don't bother until the | |
| 4990 | − * client actually sends us one. | |
| 4991 | − */ | |
| 4992 | − return ERR_PTR(-EAGAIN); | |
| 4962 | + /* We should always have a readable file here */ | |
| 4963 | + WARN_ON_ONCE(1); | |
| 4964 | + return ERR_PTR(-EBADF); | |
| 4993 | 4965 | } |
| 4994 | 4966 | spin_lock(&state_lock); |
| 4995 | 4967 | spin_lock(&fp->fi_lock); |
| @@ -5019,19 +4991,11 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, · 23 unmodified lines | ||
| 5019 | 4991 | if (!fl) |
| 5020 | 4992 | goto out_clnt_odstate; |
| 5021 | 4993 | |
| 5022 | − status = nfsd4_check_conflicting_opens(clp, fp); | |
| 5023 | − if (status) { | |
| 5024 | − locks_free_lock(fl); | |
| 5025 | − goto out_clnt_odstate; | |
| 5026 | − } | |
| 5027 | 4994 | status = vfs_setlease(fp->fi_deleg_file->nf_file, fl->fl_type, &fl, NULL); |
| 5028 | 4995 | if (fl) |
| 5029 | 4996 | locks_free_lock(fl); |
| 5030 | 4997 | if (status) |
| 5031 | 4998 | goto out_clnt_odstate; |
| 5032 | − status = nfsd4_check_conflicting_opens(clp, fp); | |
| 5033 | − if (status) | |
| 5034 | − goto out_clnt_odstate; | |
| 5035 | 4999 | |
| 5036 | 5000 | spin_lock(&state_lock); |
| 5037 | 5001 | spin_lock(&fp->fi_lock); |
| @@ -5113,6 +5077,17 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, · 75 unmodified lines | ||
| 5113 | 5077 | goto out_no_deleg; |
| 5114 | 5078 | if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED)) |
| 5115 | 5079 | goto out_no_deleg; |
| 5080 | + /* | |
| 5081 | + * Also, if the file was opened for write or | |
| 5082 | + * create, there's a good chance the client's | |
| 5083 | + * about to write to it, resulting in an | |
| 5084 | + * immediate recall (since we don't support | |
| 5085 | + * write delegations): | |
| 5086 | + */ | |
| 5087 | + if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) | |
| 5088 | + goto out_no_deleg; | |
| 5089 | + if (open->op_create == NFS4_OPEN_CREATE) | |
| 5090 | + goto out_no_deleg; | |
| 5116 | 5091 | break; |
| 5117 | 5092 | default: |
| 5118 | 5093 | goto out_no_deleg; |
| @@ -5389,7 +5364,7 @@ nfs4_laundromat(struct nfsd_net *nn) · 270 unmodified lines | ||
| 5389 | 5364 | idr_for_each_entry(&nn->s2s_cp_stateids, cps_t, i) { |
| 5390 | 5365 | cps = container_of(cps_t, struct nfs4_cpntf_state, cp_stateid); |
| 5391 | 5366 | if (cps->cp_stateid.sc_type == NFS4_COPYNOTIFY_STID && |
| 5392 | − cps->cpntf_time > cutoff) | |
| 5367 | + cps->cpntf_time < cutoff) | |
| 5393 | 5368 | _free_cpntf_state_locked(nn, cps); |
| 5394 | 5369 | } |
| 5395 | 5370 | spin_unlock(&nn->s2s_cp_lock); |
| @@ -1055,10 +1055,9 @@ static long do_restart_poll(struct restart_block *restart_block) · 1054 unmodified lines | ||
| 1055 | 1055 | |
| 1056 | 1056 | ret = do_sys_poll(ufds, nfds, to); |
| 1057 | 1057 | |
| 1058 | − if (ret == -ERESTARTNOHAND) { | |
| 1059 | − restart_block->fn = do_restart_poll; | |
| 1060 | − ret = -ERESTART_RESTARTBLOCK; | |
| 1061 | − } | |
| 1058 | + if (ret == -ERESTARTNOHAND) | |
| 1059 | + ret = set_restart_fn(restart_block, do_restart_poll); | |
| 1060 | + | |
| 1062 | 1061 | return ret; |
| 1063 | 1062 | } |
| 1064 | 1063 | |
| @@ -1080,7 +1079,6 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 15 unmodified lines | ||
| 1080 | 1079 | struct restart_block *restart_block; |
| 1081 | 1080 | |
| 1082 | 1081 | restart_block = ¤t->restart_block; |
| 1083 | − restart_block->fn = do_restart_poll; | |
| 1084 | 1082 | restart_block->poll.ufds = ufds; |
| 1085 | 1083 | restart_block->poll.nfds = nfds; |
| 1086 | 1084 | |
| @@ -1091,7 +1089,7 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, · 4 unmodified lines | ||
| 1091 | 1089 | } else |
| 1092 | 1090 | restart_block->poll.has_timeout = 0; |
| 1093 | 1091 | |
| 1094 | − ret = -ERESTART_RESTARTBLOCK; | |
| 1092 | + ret = set_restart_fn(restart_block, do_restart_poll); | |
| 1095 | 1093 | } |
| 1096 | 1094 | return ret; |
| 1097 | 1095 | } |
| @@ -1007,9 +1007,10 @@ xfs_create( · 1006 unmodified lines | ||
| 1007 | 1007 | /* |
| 1008 | 1008 | * Make sure that we have allocated dquot(s) on disk. |
| 1009 | 1009 | */ |
| 1010 | − error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, | |
| 1011 | − XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, | |
| 1012 | − &udqp, &gdqp, &pdqp); | |
| 1010 | + error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns), | |
| 1011 | + fsgid_into_mnt(mnt_userns), prid, | |
| 1012 | + XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, | |
| 1013 | + &udqp, &gdqp, &pdqp); | |
| 1013 | 1014 | if (error) |
| 1014 | 1015 | return error; |
| 1015 | 1016 | |
| @@ -1157,9 +1158,10 @@ xfs_create_tmpfile( · 141 unmodified lines | ||
| 1157 | 1158 | /* |
| 1158 | 1159 | * Make sure that we have allocated dquot(s) on disk. |
| 1159 | 1160 | */ |
| 1160 | − error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, | |
| 1161 | − XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, | |
| 1162 | − &udqp, &gdqp, &pdqp); | |
| 1161 | + error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns), | |
| 1162 | + fsgid_into_mnt(mnt_userns), prid, | |
| 1163 | + XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, | |
| 1164 | + &udqp, &gdqp, &pdqp); | |
| 1163 | 1165 | if (error) |
| 1164 | 1166 | return error; |
| 1165 | 1167 | |
| @@ -168,6 +168,12 @@ xfs_bulkstat_one( · 167 unmodified lines | ||
| 168 | 168 | }; |
| 169 | 169 | int error; |
| 170 | 170 | |
| 171 | + if (breq->mnt_userns != &init_user_ns) { | |
| 172 | + xfs_warn_ratelimited(breq->mp, | |
| 173 | + "bulkstat not supported inside of idmapped mounts."); | |
| 174 | + return -EINVAL; | |
| 175 | + } | |
| 176 | + | |
| 171 | 177 | ASSERT(breq->icount == 1); |
| 172 | 178 | |
| 173 | 179 | bc.buf = kmem_zalloc(sizeof(struct xfs_bulkstat), |
| @@ -634,6 +634,47 @@ xfs_check_summary_counts( · 633 unmodified lines | ||
| 634 | 634 | return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount); |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | +/* | |
| 638 | + * Flush and reclaim dirty inodes in preparation for unmount. Inodes and | |
| 639 | + * internal inode structures can be sitting in the CIL and AIL at this point, | |
| 640 | + * so we need to unpin them, write them back and/or reclaim them before unmount | |
| 641 | + * can proceed. | |
| 642 | + * | |
| 643 | + * An inode cluster that has been freed can have its buffer still pinned in | |
| 644 | + * memory because the transaction is still sitting in a iclog. The stale inodes | |
| 645 | + * on that buffer will be pinned to the buffer until the transaction hits the | |
| 646 | + * disk and the callbacks run. Pushing the AIL will skip the stale inodes and | |
| 647 | + * may never see the pinned buffer, so nothing will push out the iclog and | |
| 648 | + * unpin the buffer. | |
| 649 | + * | |
| 650 | + * Hence we need to force the log to unpin everything first. However, log | |
| 651 | + * forces don't wait for the discards they issue to complete, so we have to | |
| 652 | + * explicitly wait for them to complete here as well. | |
| 653 | + * | |
| 654 | + * Then we can tell the world we are unmounting so that error handling knows | |
| 655 | + * that the filesystem is going away and we should error out anything that we | |
| 656 | + * have been retrying in the background. This will prevent never-ending | |
| 657 | + * retries in AIL pushing from hanging the unmount. | |
| 658 | + * | |
| 659 | + * Finally, we can push the AIL to clean all the remaining dirty objects, then | |
| 660 | + * reclaim the remaining inodes that are still in memory at this point in time. | |
| 661 | + */ | |
| 662 | +static void | |
| 663 | +xfs_unmount_flush_inodes( | |
| 664 | + struct xfs_mount *mp) | |
| 665 | +{ | |
| 666 | + xfs_log_force(mp, XFS_LOG_SYNC); | |
| 667 | + xfs_extent_busy_wait_all(mp); | |
| 668 | + flush_workqueue(xfs_discard_wq); | |
| 669 | + | |
| 670 | + mp->m_flags |= XFS_MOUNT_UNMOUNTING; | |
| 671 | + | |
| 672 | + xfs_ail_push_all_sync(mp->m_ail); | |
| 673 | + cancel_delayed_work_sync(&mp->m_reclaim_work); | |
| 674 | + xfs_reclaim_inodes(mp); | |
| 675 | + xfs_health_unmount(mp); | |
| 676 | +} | |
| 677 | + | |
| 637 | 678 | /* |
| 638 | 679 | * This function does the following on an initial mount of a file system: |
| 639 | 680 | * - reads the superblock from disk and init the mount struct |
| @@ -1008,7 +1049,7 @@ xfs_mountfs( · 368 unmodified lines | ||
| 1008 | 1049 | /* Clean out dquots that might be in memory after quotacheck. */ |
| 1009 | 1050 | xfs_qm_unmount(mp); |
| 1010 | 1051 | /* |
| 1011 | − * Cancel all delayed reclaim work and reclaim the inodes directly. | |
| 1052 | + * Flush all inode reclamation work and flush the log. | |
| 1012 | 1053 | * We have to do this /after/ rtunmount and qm_unmount because those |
| 1013 | 1054 | * two will have scheduled delayed reclaim for the rt/quota inodes. |
| 1014 | 1055 | * |
| @@ -1018,11 +1059,8 @@ xfs_mountfs( · 3 unmodified lines | ||
| 1018 | 1059 | * qm_unmount_quotas and therefore rely on qm_unmount to release the |
| 1019 | 1060 | * quota inodes. |
| 1020 | 1061 | */ |
| 1021 | − cancel_delayed_work_sync(&mp->m_reclaim_work); | |
| 1022 | − xfs_reclaim_inodes(mp); | |
| 1023 | − xfs_health_unmount(mp); | |
| 1062 | + xfs_unmount_flush_inodes(mp); | |
| 1024 | 1063 | out_log_dealloc: |
| 1025 | − mp->m_flags |= XFS_MOUNT_UNMOUNTING; | |
| 1026 | 1064 | xfs_log_mount_cancel(mp); |
| 1027 | 1065 | out_fail_wait: |
| 1028 | 1066 | if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) |
| @@ -1063,47 +1101,7 @@ xfs_unmountfs( · 34 unmodified lines | ||
| 1063 | 1101 | xfs_rtunmount_inodes(mp); |
| 1064 | 1102 | xfs_irele(mp->m_rootip); |
| 1065 | 1103 | |
| 1066 | − /* | |
| 1067 | − * We can potentially deadlock here if we have an inode cluster | |
| 1068 | − * that has been freed has its buffer still pinned in memory because | |
| 1069 | − * the transaction is still sitting in a iclog. The stale inodes | |
| 1070 | − * on that buffer will be pinned to the buffer until the | |
| 1071 | − * transaction hits the disk and the callbacks run. Pushing the AIL will | |
| 1072 | − * skip the stale inodes and may never see the pinned buffer, so | |
| 1073 | − * nothing will push out the iclog and unpin the buffer. Hence we | |
| 1074 | − * need to force the log here to ensure all items are flushed into the | |
| 1075 | − * AIL before we go any further. | |
| 1076 | − */ | |
| 1077 | − xfs_log_force(mp, XFS_LOG_SYNC); | |
| 1078 | − | |
| 1079 | − /* | |
| 1080 | − * Wait for all busy extents to be freed, including completion of | |
| 1081 | − * any discard operation. | |
| 1082 | − */ | |
| 1083 | − xfs_extent_busy_wait_all(mp); | |
| 1084 | − flush_workqueue(xfs_discard_wq); | |
| 1085 | − | |
| 1086 | − /* | |
| 1087 | − * We now need to tell the world we are unmounting. This will allow | |
| 1088 | − * us to detect that the filesystem is going away and we should error | |
| 1089 | − * out anything that we have been retrying in the background. This will | |
| 1090 | − * prevent neverending retries in AIL pushing from hanging the unmount. | |
| 1091 | − */ | |
| 1092 | − mp->m_flags |= XFS_MOUNT_UNMOUNTING; | |
| 1093 | − | |
| 1094 | − /* | |
| 1095 | − * Flush all pending changes from the AIL. | |
| 1096 | − */ | |
| 1097 | − xfs_ail_push_all_sync(mp->m_ail); | |
| 1098 | − | |
| 1099 | − /* | |
| 1100 | − * Reclaim all inodes. At this point there should be no dirty inodes and | |
| 1101 | − * none should be pinned or locked. Stop background inode reclaim here | |
| 1102 | − * if it is still running. | |
| 1103 | − */ | |
| 1104 | − cancel_delayed_work_sync(&mp->m_reclaim_work); | |
| 1105 | − xfs_reclaim_inodes(mp); | |
| 1106 | − xfs_health_unmount(mp); | |
| 1104 | + xfs_unmount_flush_inodes(mp); | |
| 1107 | 1105 | |
| 1108 | 1106 | xfs_qm_unmount(mp); |
| 1109 | 1107 | |
| @@ -182,7 +182,8 @@ xfs_symlink( · 181 unmodified lines | ||
| 182 | 182 | /* |
| 183 | 183 | * Make sure that we have allocated dquot(s) on disk. |
| 184 | 184 | */ |
| 185 | − error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, | |
| 185 | + error = xfs_qm_vop_dqalloc(dp, fsuid_into_mnt(mnt_userns), | |
| 186 | + fsgid_into_mnt(mnt_userns), prid, | |
| 186 | 187 | XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, |
| 187 | 188 | &udqp, &gdqp, &pdqp); |
| 188 | 189 | if (error) |
| @@ -165,6 +165,21 @@ static int zonefs_writepages(struct address_space *mapping, · 164 unmodified lines | ||
| 165 | 165 | return iomap_writepages(mapping, wbc, &wpc, &zonefs_writeback_ops); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | +static int zonefs_swap_activate(struct swap_info_struct *sis, | |
| 169 | + struct file *swap_file, sector_t *span) | |
| 170 | +{ | |
| 171 | + struct inode *inode = file_inode(swap_file); | |
| 172 | + struct zonefs_inode_info *zi = ZONEFS_I(inode); | |
| 173 | + | |
| 174 | + if (zi->i_ztype != ZONEFS_ZTYPE_CNV) { | |
| 175 | + zonefs_err(inode->i_sb, | |
| 176 | + "swap file: not a conventional zone file\n"); | |
| 177 | + return -EINVAL; | |
| 178 | + } | |
| 179 | + | |
| 180 | + return iomap_swapfile_activate(sis, swap_file, span, &zonefs_iomap_ops); | |
| 181 | +} | |
| 182 | + | |
| 168 | 183 | static const struct address_space_operations zonefs_file_aops = { |
| 169 | 184 | .readpage = zonefs_readpage, |
| 170 | 185 | .readahead = zonefs_readahead, |
| @@ -177,6 +192,7 @@ static const struct address_space_operations zonefs_file_aops = { · 6 unmodified lines | ||
| 177 | 192 | .is_partially_uptodate = iomap_is_partially_uptodate, |
| 178 | 193 | .error_remove_page = generic_error_remove_page, |
| 179 | 194 | .direct_IO = noop_direct_IO, |
| 195 | + .swap_activate = zonefs_swap_activate, | |
| 180 | 196 | }; |
| 181 | 197 | |
| 182 | 198 | static void zonefs_update_stats(struct inode *inode, loff_t new_isize) |
| @@ -727,6 +743,68 @@ out_release: · 544 unmodified lines | ||
| 727 | 743 | return ret; |
| 728 | 744 | } |
| 729 | 745 | |
| 746 | +/* | |
| 747 | + * Do not exceed the LFS limits nor the file zone size. If pos is under the | |
| 748 | + * limit it becomes a short access. If it exceeds the limit, return -EFBIG. | |
| 749 | + */ | |
| 750 | +static loff_t zonefs_write_check_limits(struct file *file, loff_t pos, | |
| 751 | + loff_t count) | |
| 752 | +{ | |
| 753 | + struct inode *inode = file_inode(file); | |
| 754 | + struct zonefs_inode_info *zi = ZONEFS_I(inode); | |
| 755 | + loff_t limit = rlimit(RLIMIT_FSIZE); | |
| 756 | + loff_t max_size = zi->i_max_size; | |
| 757 | + | |
| 758 | + if (limit != RLIM_INFINITY) { | |
| 759 | + if (pos >= limit) { | |
| 760 | + send_sig(SIGXFSZ, current, 0); | |
| 761 | + return -EFBIG; | |
| 762 | + } | |
| 763 | + count = min(count, limit - pos); | |
| 764 | + } | |
| 765 | + | |
| 766 | + if (!(file->f_flags & O_LARGEFILE)) | |
| 767 | + max_size = min_t(loff_t, MAX_NON_LFS, max_size); | |
| 768 | + | |
| 769 | + if (unlikely(pos >= max_size)) | |
| 770 | + return -EFBIG; | |
| 771 | + | |
| 772 | + return min(count, max_size - pos); | |
| 773 | +} | |
| 774 | + | |
| 775 | +static ssize_t zonefs_write_checks(struct kiocb *iocb, struct iov_iter *from) | |
| 776 | +{ | |
| 777 | + struct file *file = iocb->ki_filp; | |
| 778 | + struct inode *inode = file_inode(file); | |
| 779 | + struct zonefs_inode_info *zi = ZONEFS_I(inode); | |
| 780 | + loff_t count; | |
| 781 | + | |
| 782 | + if (IS_SWAPFILE(inode)) | |
| 783 | + return -ETXTBSY; | |
| 784 | + | |
| 785 | + if (!iov_iter_count(from)) | |
| 786 | + return 0; | |
| 787 | + | |
| 788 | + if ((iocb->ki_flags & IOCB_NOWAIT) && !(iocb->ki_flags & IOCB_DIRECT)) | |
| 789 | + return -EINVAL; | |
| 790 | + | |
| 791 | + if (iocb->ki_flags & IOCB_APPEND) { | |
| 792 | + if (zi->i_ztype != ZONEFS_ZTYPE_SEQ) | |
| 793 | + return -EINVAL; | |
| 794 | + mutex_lock(&zi->i_truncate_mutex); | |
| 795 | + iocb->ki_pos = zi->i_wpoffset; | |
| 796 | + mutex_unlock(&zi->i_truncate_mutex); | |
| 797 | + } | |
| 798 | + | |
| 799 | + count = zonefs_write_check_limits(file, iocb->ki_pos, | |
| 800 | + iov_iter_count(from)); | |
| 801 | + if (count < 0) | |
| 802 | + return count; | |
| 803 | + | |
| 804 | + iov_iter_truncate(from, count); | |
| 805 | + return iov_iter_count(from); | |
| 806 | +} | |
| 807 | + | |
| 730 | 808 | /* |
| 731 | 809 | * Handle direct writes. For sequential zone files, this is the only possible |
| 732 | 810 | * write path. For these files, check that the user is issuing writes |
| @@ -744,8 +822,7 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) · 11 unmodified lines | ||
| 744 | 822 | struct super_block *sb = inode->i_sb; |
| 745 | 823 | bool sync = is_sync_kiocb(iocb); |
| 746 | 824 | bool append = false; |
| 747 | − size_t count; | |
| 748 | − ssize_t ret; | |
| 825 | + ssize_t ret, count; | |
| 749 | 826 | |
| 750 | 827 | /* |
| 751 | 828 | * For async direct IOs to sequential zone files, refuse IOCB_NOWAIT |
| @@ -763,12 +840,11 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) · 11 unmodified lines | ||
| 763 | 840 | inode_lock(inode); |
| 764 | 841 | } |
| 765 | 842 | |
| 766 | − ret = generic_write_checks(iocb, from); | |
| 767 | − if (ret <= 0) | |
| 843 | + count = zonefs_write_checks(iocb, from); | |
| 844 | + if (count <= 0) { | |
| 845 | + ret = count; | |
| 768 | 846 | goto inode_unlock; |
| 769 | − | |
| 770 | − iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos); | |
| 771 | − count = iov_iter_count(from); | |
| 847 | + } | |
| 772 | 848 | |
| 773 | 849 | if ((iocb->ki_pos | count) & (sb->s_blocksize - 1)) { |
| 774 | 850 | ret = -EINVAL; |
| @@ -828,12 +904,10 @@ static ssize_t zonefs_file_buffered_write(struct kiocb *iocb, · 53 unmodified lines | ||
| 828 | 904 | inode_lock(inode); |
| 829 | 905 | } |
| 830 | 906 | |
| 831 | − ret = generic_write_checks(iocb, from); | |
| 907 | + ret = zonefs_write_checks(iocb, from); | |
| 832 | 908 | if (ret <= 0) |
| 833 | 909 | goto inode_unlock; |
| 834 | 910 | |
| 835 | − iov_iter_truncate(from, zi->i_max_size - iocb->ki_pos); | |
| 836 | − | |
| 837 | 911 | ret = iomap_file_buffered_write(iocb, from, &zonefs_iomap_ops); |
| 838 | 912 | if (ret > 0) |
| 839 | 913 | iocb->ki_pos += ret; |
| @@ -966,9 +1040,7 @@ static int zonefs_open_zone(struct inode *inode) · 126 unmodified lines | ||
| 966 | 1040 | |
| 967 | 1041 | mutex_lock(&zi->i_truncate_mutex); |
| 968 | 1042 | |
| 969 | − zi->i_wr_refcnt++; | |
| 970 | − if (zi->i_wr_refcnt == 1) { | |
| 971 | − | |
| 1043 | + if (!zi->i_wr_refcnt) { | |
| 972 | 1044 | if (atomic_inc_return(&sbi->s_open_zones) > sbi->s_max_open_zones) { |
| 973 | 1045 | atomic_dec(&sbi->s_open_zones); |
| 974 | 1046 | ret = -EBUSY; |
| @@ -978,7 +1050,6 @@ static int zonefs_open_zone(struct inode *inode) · 3 unmodified lines | ||
| 978 | 1050 | if (i_size_read(inode) < zi->i_max_size) { |
| 979 | 1051 | ret = zonefs_zone_mgmt(inode, REQ_OP_ZONE_OPEN); |
| 980 | 1052 | if (ret) { |
| 981 | − zi->i_wr_refcnt--; | |
| 982 | 1053 | atomic_dec(&sbi->s_open_zones); |
| 983 | 1054 | goto unlock; |
| 984 | 1055 | } |
| @@ -986,6 +1057,8 @@ static int zonefs_open_zone(struct inode *inode) · 1 unmodified line | ||
| 986 | 1057 | } |
| 987 | 1058 | } |
| 988 | 1059 | |
| 1060 | + zi->i_wr_refcnt++; | |
| 1061 | + | |
| 989 | 1062 | unlock: |
| 990 | 1063 | mutex_unlock(&zi->i_truncate_mutex); |
| 991 | 1064 | |
| @@ -612,9 +612,11 @@ static inline void ttm_bo_pin(struct ttm_buffer_object *bo) · 611 unmodified lines | ||
| 612 | 612 | static inline void ttm_bo_unpin(struct ttm_buffer_object *bo) |
| 613 | 613 | { |
| 614 | 614 | dma_resv_assert_held(bo->base.resv); |
| 615 | − WARN_ON_ONCE(!bo->pin_count); | |
| 616 | 615 | WARN_ON_ONCE(!kref_read(&bo->kref)); |
| 617 | − --bo->pin_count; | |
| 616 | + if (bo->pin_count) | |
| 617 | + --bo->pin_count; | |
| 618 | + else | |
| 619 | + WARN_ON_ONCE(true); | |
| 618 | 620 | } |
| 619 | 621 | |
| 620 | 622 | int ttm_mem_evict_first(struct ttm_bo_device *bdev, |
| @@ -105,8 +105,19 @@ extern struct bus_type amba_bustype; · 104 unmodified lines | ||
| 105 | 105 | #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) |
| 106 | 106 | #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) |
| 107 | 107 | |
| 108 | +#ifdef CONFIG_ARM_AMBA | |
| 108 | 109 | int amba_driver_register(struct amba_driver *); |
| 109 | 110 | void amba_driver_unregister(struct amba_driver *); |
| 111 | +#else | |
| 112 | +static inline int amba_driver_register(struct amba_driver *drv) | |
| 113 | +{ | |
| 114 | + return -EINVAL; | |
| 115 | +} | |
| 116 | +static inline void amba_driver_unregister(struct amba_driver *drv) | |
| 117 | +{ | |
| 118 | +} | |
| 119 | +#endif | |
| 120 | + | |
| 110 | 121 | struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t); |
| 111 | 122 | void amba_device_put(struct amba_device *); |
| 112 | 123 | int amba_device_add(struct amba_device *, struct resource *); |
| @@ -72,8 +72,10 @@ typedef void *efi_handle_t; · 71 unmodified lines | ||
| 72 | 72 | */ |
| 73 | 73 | typedef guid_t efi_guid_t __aligned(__alignof__(u32)); |
| 74 | 74 | |
| 75 | −#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ | |
| 76 | − GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) | |
| 75 | +#define EFI_GUID(a, b, c, d...) (efi_guid_t){ { \ | |
| 76 | + (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ | |
| 77 | + (b) & 0xff, ((b) >> 8) & 0xff, \ | |
| 78 | + (c) & 0xff, ((c) >> 8) & 0xff, d } } | |
| 77 | 79 | |
| 78 | 80 | /* |
| 79 | 81 | * Generic EFI table header |
| @@ -5,31 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | #include <linux/sched.h> |
| 6 | 6 | #include <linux/xarray.h> |
| 7 | 7 | |
| 8 | −struct io_wq_work_node { | |
| 9 | − struct io_wq_work_node *next; | |
| 10 | −}; | |
| 11 | − | |
| 12 | −struct io_wq_work_list { | |
| 13 | − struct io_wq_work_node *first; | |
| 14 | − struct io_wq_work_node *last; | |
| 15 | −}; | |
| 16 | − | |
| 17 | −struct io_uring_task { | |
| 18 | − /* submission side */ | |
| 19 | − struct xarray xa; | |
| 20 | − struct wait_queue_head wait; | |
| 21 | − void *last; | |
| 22 | − void *io_wq; | |
| 23 | − struct percpu_counter inflight; | |
| 24 | − atomic_t in_idle; | |
| 25 | − bool sqpoll; | |
| 26 | − | |
| 27 | − spinlock_t task_lock; | |
| 28 | − struct io_wq_work_list task_list; | |
| 29 | − unsigned long task_state; | |
| 30 | − struct callback_head task_work; | |
| 31 | −}; | |
| 32 | − | |
| 33 | 8 | #if defined(CONFIG_IO_URING) |
| 34 | 9 | struct sock *io_uring_get_socket(struct file *file); |
| 35 | 10 | void __io_uring_task_cancel(void); |
| @@ -30,9 +30,6 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <linux/percpu.h> |
| 31 | 31 | #include <asm/module.h> |
| 32 | 32 | |
| 33 | −/* Not Yet Implemented */ | |
| 34 | −#define MODULE_SUPPORTED_DEVICE(name) | |
| 35 | − | |
| 36 | 33 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN |
| 37 | 34 | |
| 38 | 35 | struct modversion_info { |
| @@ -23,6 +23,7 @@ enum timespec_type { · 22 unmodified lines | ||
| 23 | 23 | * System call restart block. |
| 24 | 24 | */ |
| 25 | 25 | struct restart_block { |
| 26 | + unsigned long arch_data; | |
| 26 | 27 | long (*fn)(struct restart_block *); |
| 27 | 28 | union { |
| 28 | 29 | /* For futex_wait and futex_wait_requeue_pi */ |
| @@ -104,7 +104,6 @@ struct svcxprt_rdma { · 103 unmodified lines | ||
| 104 | 104 | |
| 105 | 105 | wait_queue_head_t sc_send_wait; /* SQ exhaustion waitlist */ |
| 106 | 106 | unsigned long sc_flags; |
| 107 | − u32 sc_pending_recvs; | |
| 108 | 107 | struct list_head sc_read_complete_q; |
| 109 | 108 | struct work_struct sc_work; |
| 110 | 109 | |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/types.h> |
| 12 | 12 | #include <linux/bug.h> |
| 13 | 13 | #include <linux/restart_block.h> |
| 14 | +#include <linux/errno.h> | |
| 14 | 15 | |
| 15 | 16 | #ifdef CONFIG_THREAD_INFO_IN_TASK |
| 16 | 17 | /* |
| @@ -59,6 +60,18 @@ enum syscall_work_bit { · 42 unmodified lines | ||
| 59 | 60 | |
| 60 | 61 | #ifdef __KERNEL__ |
| 61 | 62 | |
| 63 | +#ifndef arch_set_restart_data | |
| 64 | +#define arch_set_restart_data(restart) do { } while (0) | |
| 65 | +#endif | |
| 66 | + | |
| 67 | +static inline long set_restart_fn(struct restart_block *restart, | |
| 68 | + long (*fn)(struct restart_block *)) | |
| 69 | +{ | |
| 70 | + restart->fn = fn; | |
| 71 | + arch_set_restart_data(restart); | |
| 72 | + return -ERESTART_RESTARTBLOCK; | |
| 73 | +} | |
| 74 | + | |
| 62 | 75 | #ifndef THREAD_ALIGN |
| 63 | 76 | #define THREAD_ALIGN THREAD_SIZE |
| 64 | 77 | #endif |
| @@ -86,6 +86,8 @@ · 85 unmodified lines | ||
| 86 | 86 | /* lies about caching, so always sync */ \ |
| 87 | 87 | US_FLAG(NO_SAME, 0x40000000) \ |
| 88 | 88 | /* Cannot handle WRITE_SAME */ \ |
| 89 | + US_FLAG(SENSE_AFTER_SYNC, 0x80000000) \ | |
| 90 | + /* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */ \ | |
| 89 | 91 | |
| 90 | 92 | #define US_FLAG(name, value) US_FL_##name = value , |
| 91 | 93 | enum { US_DO_ALL_FLAGS }; |
| @@ -250,20 +250,20 @@ struct vdpa_config_ops { · 249 unmodified lines | ||
| 250 | 250 | |
| 251 | 251 | struct vdpa_device *__vdpa_alloc_device(struct device *parent, |
| 252 | 252 | const struct vdpa_config_ops *config, |
| 253 | − int nvqs, size_t size, const char *name); | |
| 253 | + size_t size, const char *name); | |
| 254 | 254 | |
| 255 | −#define vdpa_alloc_device(dev_struct, member, parent, config, nvqs, name) \ | |
| 255 | +#define vdpa_alloc_device(dev_struct, member, parent, config, name) \ | |
| 256 | 256 | container_of(__vdpa_alloc_device( \ |
| 257 | − parent, config, nvqs, \ | |
| 257 | + parent, config, \ | |
| 258 | 258 | sizeof(dev_struct) + \ |
| 259 | 259 | BUILD_BUG_ON_ZERO(offsetof( \ |
| 260 | 260 | dev_struct, member)), name), \ |
| 261 | 261 | dev_struct, member) |
| 262 | 262 | |
| 263 | −int vdpa_register_device(struct vdpa_device *vdev); | |
| 263 | +int vdpa_register_device(struct vdpa_device *vdev, int nvqs); | |
| 264 | 264 | void vdpa_unregister_device(struct vdpa_device *vdev); |
| 265 | 265 | |
| 266 | −int _vdpa_register_device(struct vdpa_device *vdev); | |
| 266 | +int _vdpa_register_device(struct vdpa_device *vdev, int nvqs); | |
| 267 | 267 | void _vdpa_unregister_device(struct vdpa_device *vdev); |
| 268 | 268 | |
| 269 | 269 | /** |
| @@ -132,8 +132,6 @@ bool is_virtio_device(struct device *dev); · 131 unmodified lines | ||
| 132 | 132 | void virtio_break_device(struct virtio_device *dev); |
| 133 | 133 | |
| 134 | 134 | void virtio_config_changed(struct virtio_device *dev); |
| 135 | −void virtio_config_disable(struct virtio_device *dev); | |
| 136 | −void virtio_config_enable(struct virtio_device *dev); | |
| 137 | 135 | int virtio_finalize_features(struct virtio_device *dev); |
| 138 | 136 | #ifdef CONFIG_PM_SLEEP |
| 139 | 137 | int virtio_device_freeze(struct virtio_device *dev); |
| @@ -173,9 +173,10 @@ static inline void ww_acquire_done(struct ww_acquire_ctx *ctx) · 172 unmodified lines | ||
| 173 | 173 | */ |
| 174 | 174 | static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx) |
| 175 | 175 | { |
| 176 | −#ifdef CONFIG_DEBUG_MUTEXES | |
| 176 | +#ifdef CONFIG_DEBUG_LOCK_ALLOC | |
| 177 | 177 | mutex_release(&ctx->dep_map, _THIS_IP_); |
| 178 | − | |
| 178 | +#endif | |
| 179 | +#ifdef CONFIG_DEBUG_MUTEXES | |
| 179 | 180 | DEBUG_LOCKS_WARN_ON(ctx->acquired); |
| 180 | 181 | if (!IS_ENABLED(CONFIG_PROVE_LOCKING)) |
| 181 | 182 | /* |
| @@ -30,7 +30,7 @@ TRACE_EVENT(workqueue_queue_work, · 29 unmodified lines | ||
| 30 | 30 | TP_STRUCT__entry( |
| 31 | 31 | __field( void *, work ) |
| 32 | 32 | __field( void *, function) |
| 33 | − __field( const char *, workqueue) | |
| 33 | + __string( workqueue, pwq->wq->name) | |
| 34 | 34 | __field( unsigned int, req_cpu ) |
| 35 | 35 | __field( unsigned int, cpu ) |
| 36 | 36 | ), |
| @@ -38,13 +38,13 @@ TRACE_EVENT(workqueue_queue_work, · 1 unmodified line | ||
| 38 | 38 | TP_fast_assign( |
| 39 | 39 | __entry->work = work; |
| 40 | 40 | __entry->function = work->func; |
| 41 | − __entry->workqueue = pwq->wq->name; | |
| 41 | + __assign_str(workqueue, pwq->wq->name); | |
| 42 | 42 | __entry->req_cpu = req_cpu; |
| 43 | 43 | __entry->cpu = pwq->pool->cpu; |
| 44 | 44 | ), |
| 45 | 45 | |
| 46 | 46 | TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u", |
| 47 | − __entry->work, __entry->function, __entry->workqueue, | |
| 47 | + __entry->work, __entry->function, __get_str(workqueue), | |
| 48 | 48 | __entry->req_cpu, __entry->cpu) |
| 49 | 49 | ); |
| 50 | 50 | |
| @@ -903,7 +903,8 @@ struct fuse_notify_retrieve_in { · 902 unmodified lines | ||
| 903 | 903 | }; |
| 904 | 904 | |
| 905 | 905 | /* Device ioctls: */ |
| 906 | −#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t) | |
| 906 | +#define FUSE_DEV_IOC_MAGIC 229 | |
| 907 | +#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t) | |
| 907 | 908 | |
| 908 | 909 | struct fuse_lseek_in { |
| 909 | 910 | uint64_t fh; |
| @@ -2444,7 +2444,6 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) · 2443 unmodified lines | ||
| 2444 | 2444 | if (!IS_ERR(tsk)) { |
| 2445 | 2445 | sigfillset(&tsk->blocked); |
| 2446 | 2446 | sigdelsetmask(&tsk->blocked, sigmask(SIGKILL)); |
| 2447 | − tsk->flags |= PF_NOFREEZE; | |
| 2448 | 2447 | } |
| 2449 | 2448 | return tsk; |
| 2450 | 2449 | } |
| @@ -134,7 +134,7 @@ bool freeze_task(struct task_struct *p) · 133 unmodified lines | ||
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | − if (!(p->flags & PF_KTHREAD)) | |
| 137 | + if (!(p->flags & (PF_KTHREAD | PF_IO_WORKER))) | |
| 138 | 138 | fake_signal_wake_up(p); |
| 139 | 139 | else |
| 140 | 140 | wake_up_state(p, TASK_INTERRUPTIBLE); |
| @@ -2728,14 +2728,13 @@ retry: · 2727 unmodified lines | ||
| 2728 | 2728 | goto out; |
| 2729 | 2729 | |
| 2730 | 2730 | restart = ¤t->restart_block; |
| 2731 | − restart->fn = futex_wait_restart; | |
| 2732 | 2731 | restart->futex.uaddr = uaddr; |
| 2733 | 2732 | restart->futex.val = val; |
| 2734 | 2733 | restart->futex.time = *abs_time; |
| 2735 | 2734 | restart->futex.bitset = bitset; |
| 2736 | 2735 | restart->futex.flags = flags | FLAGS_HAS_TIMEOUT; |
| 2737 | 2736 | |
| 2738 | − ret = -ERESTART_RESTARTBLOCK; | |
| 2737 | + ret = set_restart_fn(restart, futex_wait_restart); | |
| 2739 | 2738 | |
| 2740 | 2739 | out: |
| 2741 | 2740 | if (to) { |
| @@ -159,7 +159,7 @@ static const struct irq_domain_ops irq_sim_domain_ops = { · 158 unmodified lines | ||
| 159 | 159 | * irq_domain_create_sim - Create a new interrupt simulator irq_domain and |
| 160 | 160 | * allocate a range of dummy interrupts. |
| 161 | 161 | * |
| 162 | − * @fnode: struct fwnode_handle to be associated with this domain. | |
| 162 | + * @fwnode: struct fwnode_handle to be associated with this domain. | |
| 163 | 163 | * @num_irqs: Number of interrupts to allocate. |
| 164 | 164 | * |
| 165 | 165 | * On success: return a new irq_domain object. |
| @@ -228,7 +228,7 @@ static void devm_irq_domain_release_sim(struct device *dev, void *res) · 62 unmodified lines | ||
| 228 | 228 | * a managed device. |
| 229 | 229 | * |
| 230 | 230 | * @dev: Device to initialize the simulator object for. |
| 231 | − * @fnode: struct fwnode_handle to be associated with this domain. | |
| 231 | + * @fwnode: struct fwnode_handle to be associated with this domain. | |
| 232 | 232 | * @num_irqs: Number of interrupts to allocate |
| 233 | 233 | * |
| 234 | 234 | * On success: return a new irq_domain object. |
| @@ -1142,11 +1142,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) · 1141 unmodified lines | ||
| 1142 | 1142 | irqreturn_t ret; |
| 1143 | 1143 | |
| 1144 | 1144 | local_bh_disable(); |
| 1145 | + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) | |
| 1146 | + local_irq_disable(); | |
| 1145 | 1147 | ret = action->thread_fn(action->irq, action->dev_id); |
| 1146 | 1148 | if (ret == IRQ_HANDLED) |
| 1147 | 1149 | atomic_inc(&desc->threads_handled); |
| 1148 | 1150 | |
| 1149 | 1151 | irq_finalize_oneshot(desc, action); |
| 1152 | + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) | |
| 1153 | + local_irq_enable(); | |
| 1150 | 1154 | local_bh_enable(); |
| 1151 | 1155 | return ret; |
| 1152 | 1156 | } |
| @@ -407,6 +407,14 @@ static bool jump_label_can_update(struct jump_entry *entry, bool init) · 406 unmodified lines | ||
| 407 | 407 | return false; |
| 408 | 408 | |
| 409 | 409 | if (!kernel_text_address(jump_entry_code(entry))) { |
| 410 | + /* | |
| 411 | + * This skips patching built-in __exit, which | |
| 412 | + * is part of init_section_contains() but is | |
| 413 | + * not part of kernel_text_address(). | |
| 414 | + * | |
| 415 | + * Skipping built-in __exit is fine since it | |
| 416 | + * will never be executed. | |
| 417 | + */ | |
| 410 | 418 | WARN_ONCE(!jump_entry_is_init(entry), |
| 411 | 419 | "can't patch jump_label at %pS", |
| 412 | 420 | (void *)jump_entry_code(entry)); |
| @@ -626,7 +626,7 @@ static inline int mutex_can_spin_on_owner(struct mutex *lock) · 625 unmodified lines | ||
| 626 | 626 | */ |
| 627 | 627 | static __always_inline bool |
| 628 | 628 | mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, |
| 629 | − const bool use_ww_ctx, struct mutex_waiter *waiter) | |
| 629 | + struct mutex_waiter *waiter) | |
| 630 | 630 | { |
| 631 | 631 | if (!waiter) { |
| 632 | 632 | /* |
| @@ -702,7 +702,7 @@ fail: · 69 unmodified lines | ||
| 702 | 702 | #else |
| 703 | 703 | static __always_inline bool |
| 704 | 704 | mutex_optimistic_spin(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, |
| 705 | − const bool use_ww_ctx, struct mutex_waiter *waiter) | |
| 705 | + struct mutex_waiter *waiter) | |
| 706 | 706 | { |
| 707 | 707 | return false; |
| 708 | 708 | } |
| @@ -922,6 +922,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 213 unmodified lines | ||
| 922 | 922 | struct ww_mutex *ww; |
| 923 | 923 | int ret; |
| 924 | 924 | |
| 925 | + if (!use_ww_ctx) | |
| 926 | + ww_ctx = NULL; | |
| 927 | + | |
| 925 | 928 | might_sleep(); |
| 926 | 929 | |
| 927 | 930 | #ifdef CONFIG_DEBUG_MUTEXES |
| @@ -929,7 +932,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 1 unmodified line | ||
| 929 | 932 | #endif |
| 930 | 933 | |
| 931 | 934 | ww = container_of(lock, struct ww_mutex, base); |
| 932 | − if (use_ww_ctx && ww_ctx) { | |
| 935 | + if (ww_ctx) { | |
| 933 | 936 | if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) |
| 934 | 937 | return -EALREADY; |
| 935 | 938 | |
| @@ -946,10 +949,10 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 10 unmodified lines | ||
| 946 | 949 | mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip); |
| 947 | 950 | |
| 948 | 951 | if (__mutex_trylock(lock) || |
| 949 | − mutex_optimistic_spin(lock, ww_ctx, use_ww_ctx, NULL)) { | |
| 952 | + mutex_optimistic_spin(lock, ww_ctx, NULL)) { | |
| 950 | 953 | /* got the lock, yay! */ |
| 951 | 954 | lock_acquired(&lock->dep_map, ip); |
| 952 | − if (use_ww_ctx && ww_ctx) | |
| 955 | + if (ww_ctx) | |
| 953 | 956 | ww_mutex_set_context_fastpath(ww, ww_ctx); |
| 954 | 957 | preempt_enable(); |
| 955 | 958 | return 0; |
| @@ -960,7 +963,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 4 unmodified lines | ||
| 960 | 963 | * After waiting to acquire the wait_lock, try again. |
| 961 | 964 | */ |
| 962 | 965 | if (__mutex_trylock(lock)) { |
| 963 | − if (use_ww_ctx && ww_ctx) | |
| 966 | + if (ww_ctx) | |
| 964 | 967 | __ww_mutex_check_waiters(lock, ww_ctx); |
| 965 | 968 | |
| 966 | 969 | goto skip_wait; |
| @@ -1013,7 +1016,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 46 unmodified lines | ||
| 1013 | 1016 | goto err; |
| 1014 | 1017 | } |
| 1015 | 1018 | |
| 1016 | − if (use_ww_ctx && ww_ctx) { | |
| 1019 | + if (ww_ctx) { | |
| 1017 | 1020 | ret = __ww_mutex_check_kill(lock, &waiter, ww_ctx); |
| 1018 | 1021 | if (ret) |
| 1019 | 1022 | goto err; |
| @@ -1026,7 +1029,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 6 unmodified lines | ||
| 1026 | 1029 | * ww_mutex needs to always recheck its position since its waiter |
| 1027 | 1030 | * list is not FIFO ordered. |
| 1028 | 1031 | */ |
| 1029 | − if ((use_ww_ctx && ww_ctx) || !first) { | |
| 1032 | + if (ww_ctx || !first) { | |
| 1030 | 1033 | first = __mutex_waiter_is_first(lock, &waiter); |
| 1031 | 1034 | if (first) |
| 1032 | 1035 | __mutex_set_flag(lock, MUTEX_FLAG_HANDOFF); |
| @@ -1039,7 +1042,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 6 unmodified lines | ||
| 1039 | 1042 | * or we must see its unlock and acquire. |
| 1040 | 1043 | */ |
| 1041 | 1044 | if (__mutex_trylock(lock) || |
| 1042 | − (first && mutex_optimistic_spin(lock, ww_ctx, use_ww_ctx, &waiter))) | |
| 1045 | + (first && mutex_optimistic_spin(lock, ww_ctx, &waiter))) | |
| 1043 | 1046 | break; |
| 1044 | 1047 | |
| 1045 | 1048 | spin_lock(&lock->wait_lock); |
| @@ -1048,7 +1051,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, · 2 unmodified lines | ||
| 1048 | 1051 | acquired: |
| 1049 | 1052 | __set_current_state(TASK_RUNNING); |
| 1050 | 1053 | |
| 1051 | − if (use_ww_ctx && ww_ctx) { | |
| 1054 | + if (ww_ctx) { | |
| 1052 | 1055 | /* |
| 1053 | 1056 | * Wound-Wait; we stole the lock (!first_waiter), check the |
| 1054 | 1057 | * waiters as anyone might want to wound us. |
| @@ -1068,7 +1071,7 @@ skip_wait: · 13 unmodified lines | ||
| 1068 | 1071 | /* got the lock - cleanup and rejoice! */ |
| 1069 | 1072 | lock_acquired(&lock->dep_map, ip); |
| 1070 | 1073 | |
| 1071 | − if (use_ww_ctx && ww_ctx) | |
| 1074 | + if (ww_ctx) | |
| 1072 | 1075 | ww_mutex_lock_acquired(ww, ww_ctx); |
| 1073 | 1076 | |
| 1074 | 1077 | spin_unlock(&lock->wait_lock); |
| @@ -244,8 +244,6 @@ void migrate_to_reboot_cpu(void) · 243 unmodified lines | ||
| 244 | 244 | void kernel_restart(char *cmd) |
| 245 | 245 | { |
| 246 | 246 | kernel_restart_prepare(cmd); |
| 247 | − if (pm_power_off_prepare) | |
| 248 | − pm_power_off_prepare(); | |
| 249 | 247 | migrate_to_reboot_cpu(); |
| 250 | 248 | syscore_shutdown(); |
| 251 | 249 | if (!cmd) |
| @@ -288,7 +288,8 @@ bool task_set_jobctl_pending(struct task_struct *task, unsigned long mask) · 287 unmodified lines | ||
| 288 | 288 | JOBCTL_STOP_SIGMASK | JOBCTL_TRAPPING)); |
| 289 | 289 | BUG_ON((mask & JOBCTL_TRAPPING) && !(mask & JOBCTL_PENDING_MASK)); |
| 290 | 290 | |
| 291 | − if (unlikely(fatal_signal_pending(task) || (task->flags & PF_EXITING))) | |
| 291 | + if (unlikely(fatal_signal_pending(task) || | |
| 292 | + (task->flags & (PF_EXITING | PF_IO_WORKER)))) | |
| 292 | 293 | return false; |
| 293 | 294 | |
| 294 | 295 | if (mask & JOBCTL_STOP_SIGMASK) |
| @@ -833,6 +834,9 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 538 unmodified lines | ||
| 833 | 834 | |
| 834 | 835 | if (!valid_signal(sig)) |
| 835 | 836 | return -EINVAL; |
| 837 | + /* PF_IO_WORKER threads don't take any signals */ | |
| 838 | + if (t->flags & PF_IO_WORKER) | |
| 839 | + return -ESRCH; | |
| 836 | 840 | |
| 837 | 841 | if (!si_fromuser(info)) |
| 838 | 842 | return 0; |
| @@ -35,27 +35,30 @@ static inline void *static_call_addr(struct static_call_site *site) · 34 unmodified lines | ||
| 35 | 35 | return (void *)((long)site->addr + (long)&site->addr); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | +static inline unsigned long __static_call_key(const struct static_call_site *site) | |
| 39 | +{ | |
| 40 | + return (long)site->key + (long)&site->key; | |
| 41 | +} | |
| 38 | 42 | |
| 39 | 43 | static inline struct static_call_key *static_call_key(const struct static_call_site *site) |
| 40 | 44 | { |
| 41 | − return (struct static_call_key *) | |
| 42 | − (((long)site->key + (long)&site->key) & ~STATIC_CALL_SITE_FLAGS); | |
| 45 | + return (void *)(__static_call_key(site) & ~STATIC_CALL_SITE_FLAGS); | |
| 43 | 46 | } |
| 44 | 47 | |
| 45 | 48 | /* These assume the key is word-aligned. */ |
| 46 | 49 | static inline bool static_call_is_init(struct static_call_site *site) |
| 47 | 50 | { |
| 48 | − return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_INIT; | |
| 51 | + return __static_call_key(site) & STATIC_CALL_SITE_INIT; | |
| 49 | 52 | } |
| 50 | 53 | |
| 51 | 54 | static inline bool static_call_is_tail(struct static_call_site *site) |
| 52 | 55 | { |
| 53 | − return ((long)site->key + (long)&site->key) & STATIC_CALL_SITE_TAIL; | |
| 56 | + return __static_call_key(site) & STATIC_CALL_SITE_TAIL; | |
| 54 | 57 | } |
| 55 | 58 | |
| 56 | 59 | static inline void static_call_set_init(struct static_call_site *site) |
| 57 | 60 | { |
| 58 | − site->key = ((long)static_call_key(site) | STATIC_CALL_SITE_INIT) - | |
| 61 | + site->key = (__static_call_key(site) | STATIC_CALL_SITE_INIT) - | |
| 59 | 62 | (long)&site->key; |
| 60 | 63 | } |
| 61 | 64 | |
| @@ -146,6 +149,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 84 unmodified lines | ||
| 146 | 149 | }; |
| 147 | 150 | |
| 148 | 151 | for (site_mod = &first; site_mod; site_mod = site_mod->next) { |
| 152 | + bool init = system_state < SYSTEM_RUNNING; | |
| 149 | 153 | struct module *mod = site_mod->mod; |
| 150 | 154 | |
| 151 | 155 | if (!site_mod->sites) { |
| @@ -165,6 +169,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 13 unmodified lines | ||
| 165 | 169 | if (mod) { |
| 166 | 170 | stop = mod->static_call_sites + |
| 167 | 171 | mod->num_static_call_sites; |
| 172 | + init = mod->state == MODULE_STATE_COMING; | |
| 168 | 173 | } |
| 169 | 174 | #endif |
| 170 | 175 | |
| @@ -172,25 +177,26 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) · 1 unmodified line | ||
| 172 | 177 | site < stop && static_call_key(site) == key; site++) { |
| 173 | 178 | void *site_addr = static_call_addr(site); |
| 174 | 179 | |
| 175 | − if (static_call_is_init(site)) { | |
| 176 | − /* | |
| 177 | − * Don't write to call sites which were in | |
| 178 | − * initmem and have since been freed. | |
| 179 | − */ | |
| 180 | − if (!mod && system_state >= SYSTEM_RUNNING) | |
| 181 | − continue; | |
| 182 | − if (mod && !within_module_init((unsigned long)site_addr, mod)) | |
| 183 | − continue; | |
| 184 | − } | |
| 180 | + if (!init && static_call_is_init(site)) | |
| 181 | + continue; | |
| 185 | 182 | |
| 186 | 183 | if (!kernel_text_address((unsigned long)site_addr)) { |
| 187 | − WARN_ONCE(1, "can't patch static call site at %pS", | |
| 184 | + /* | |
| 185 | + * This skips patching built-in __exit, which | |
| 186 | + * is part of init_section_contains() but is | |
| 187 | + * not part of kernel_text_address(). | |
| 188 | + * | |
| 189 | + * Skipping built-in __exit is fine since it | |
| 190 | + * will never be executed. | |
| 191 | + */ | |
| 192 | + WARN_ONCE(!static_call_is_init(site), | |
| 193 | + "can't patch static call site at %pS", | |
| 188 | 194 | site_addr); |
| 189 | 195 | continue; |
| 190 | 196 | } |
| 191 | 197 | |
| 192 | 198 | arch_static_call_transform(site_addr, NULL, func, |
| 193 | − static_call_is_tail(site)); | |
| 199 | + static_call_is_tail(site)); | |
| 194 | 200 | } |
| 195 | 201 | } |
| 196 | 202 | |
| @@ -349,7 +355,7 @@ static int static_call_add_module(struct module *mod) · 152 unmodified lines | ||
| 349 | 355 | struct static_call_site *site; |
| 350 | 356 | |
| 351 | 357 | for (site = start; site != stop; site++) { |
| 352 | − unsigned long s_key = (long)site->key + (long)&site->key; | |
| 358 | + unsigned long s_key = __static_call_key(site); | |
| 353 | 359 | unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS; |
| 354 | 360 | unsigned long key; |
| 355 | 361 | |
| @@ -854,9 +854,9 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags, · 853 unmodified lines | ||
| 854 | 854 | if (flags == TIMER_ABSTIME) |
| 855 | 855 | return -ERESTARTNOHAND; |
| 856 | 856 | |
| 857 | − restart->fn = alarm_timer_nsleep_restart; | |
| 858 | 857 | restart->nanosleep.clockid = type; |
| 859 | 858 | restart->nanosleep.expires = exp; |
| 859 | + set_restart_fn(restart, alarm_timer_nsleep_restart); | |
| 860 | 860 | return ret; |
| 861 | 861 | } |
| 862 | 862 | |
| @@ -1957,9 +1957,9 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer_mode mode, · 1956 unmodified lines | ||
| 1957 | 1957 | } |
| 1958 | 1958 | |
| 1959 | 1959 | restart = ¤t->restart_block; |
| 1960 | − restart->fn = hrtimer_nanosleep_restart; | |
| 1961 | 1960 | restart->nanosleep.clockid = t.timer.base->clockid; |
| 1962 | 1961 | restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer); |
| 1962 | + set_restart_fn(restart, hrtimer_nanosleep_restart); | |
| 1963 | 1963 | out: |
| 1964 | 1964 | destroy_hrtimer_on_stack(&t.timer); |
| 1965 | 1965 | return ret; |
| @@ -1480,8 +1480,8 @@ static int posix_cpu_nsleep(const clockid_t which_clock, int flags, · 1479 unmodified lines | ||
| 1480 | 1480 | if (flags & TIMER_ABSTIME) |
| 1481 | 1481 | return -ERESTARTNOHAND; |
| 1482 | 1482 | |
| 1483 | − restart_block->fn = posix_cpu_nsleep_restart; | |
| 1484 | 1483 | restart_block->nanosleep.clockid = which_clock; |
| 1484 | + set_restart_fn(restart_block, posix_cpu_nsleep_restart); | |
| 1485 | 1485 | } |
| 1486 | 1486 | return error; |
| 1487 | 1487 | } |
| @@ -702,7 +702,6 @@ MODULE_LICENSE("GPL"); · 701 unmodified lines | ||
| 702 | 702 | |
| 703 | 703 | MODULE_AUTHOR(BATADV_DRIVER_AUTHOR); |
| 704 | 704 | MODULE_DESCRIPTION(BATADV_DRIVER_DESC); |
| 705 | −MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE); | |
| 706 | 705 | MODULE_VERSION(BATADV_SOURCE_VERSION); |
| 707 | 706 | MODULE_ALIAS_RTNL_LINK("batadv"); |
| 708 | 707 | MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME); |
| @@ -1825,11 +1825,14 @@ static int · 1824 unmodified lines | ||
| 1825 | 1825 | svcauth_gss_release(struct svc_rqst *rqstp) |
| 1826 | 1826 | { |
| 1827 | 1827 | struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data; |
| 1828 | − struct rpc_gss_wire_cred *gc = &gsd->clcred; | |
| 1828 | + struct rpc_gss_wire_cred *gc; | |
| 1829 | 1829 | struct xdr_buf *resbuf = &rqstp->rq_res; |
| 1830 | 1830 | int stat = -EINVAL; |
| 1831 | 1831 | struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); |
| 1832 | 1832 | |
| 1833 | + if (!gsd) | |
| 1834 | + goto out; | |
| 1835 | + gc = &gsd->clcred; | |
| 1833 | 1836 | if (gc->gc_proc != RPC_GSS_PROC_DATA) |
| 1834 | 1837 | goto out; |
| 1835 | 1838 | /* Release can be called twice, but we only wrap once. */ |
| @@ -1870,10 +1873,10 @@ out_err: · 34 unmodified lines | ||
| 1870 | 1873 | if (rqstp->rq_cred.cr_group_info) |
| 1871 | 1874 | put_group_info(rqstp->rq_cred.cr_group_info); |
| 1872 | 1875 | rqstp->rq_cred.cr_group_info = NULL; |
| 1873 | − if (gsd->rsci) | |
| 1876 | + if (gsd && gsd->rsci) { | |
| 1874 | 1877 | cache_put(&gsd->rsci->h, sn->rsc_cache); |
| 1875 | − gsd->rsci = NULL; | |
| 1876 | − | |
| 1878 | + gsd->rsci = NULL; | |
| 1879 | + } | |
| 1877 | 1880 | return stat; |
| 1878 | 1881 | } |
| 1879 | 1882 | |
| @@ -1413,7 +1413,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) · 1412 unmodified lines | ||
| 1413 | 1413 | |
| 1414 | 1414 | sendit: |
| 1415 | 1415 | if (svc_authorise(rqstp)) |
| 1416 | − goto close; | |
| 1416 | + goto close_xprt; | |
| 1417 | 1417 | return 1; /* Caller can now send it */ |
| 1418 | 1418 | |
| 1419 | 1419 | release_dropit: |
| @@ -1425,6 +1425,8 @@ release_dropit: · 5 unmodified lines | ||
| 1425 | 1425 | return 0; |
| 1426 | 1426 | |
| 1427 | 1427 | close: |
| 1428 | + svc_authorise(rqstp); | |
| 1429 | +close_xprt: | |
| 1428 | 1430 | if (rqstp->rq_xprt && test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) |
| 1429 | 1431 | svc_close_xprt(rqstp->rq_xprt); |
| 1430 | 1432 | dprintk("svc: svc_process close\n"); |
| @@ -1433,7 +1435,7 @@ release_dropit: · 2 unmodified lines | ||
| 1433 | 1435 | err_short_len: |
| 1434 | 1436 | svc_printk(rqstp, "short len %zd, dropping request\n", |
| 1435 | 1437 | argv->iov_len); |
| 1436 | − goto close; | |
| 1438 | + goto close_xprt; | |
| 1437 | 1439 | |
| 1438 | 1440 | err_bad_rpc: |
| 1439 | 1441 | serv->sv_stats->rpcbadfmt++; |
| @@ -1060,7 +1060,7 @@ static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, st · 1059 unmodified lines | ||
| 1060 | 1060 | struct svc_xprt *xprt; |
| 1061 | 1061 | int ret = 0; |
| 1062 | 1062 | |
| 1063 | − spin_lock(&serv->sv_lock); | |
| 1063 | + spin_lock_bh(&serv->sv_lock); | |
| 1064 | 1064 | list_for_each_entry(xprt, xprt_list, xpt_list) { |
| 1065 | 1065 | if (xprt->xpt_net != net) |
| 1066 | 1066 | continue; |
| @@ -1068,7 +1068,7 @@ static int svc_close_list(struct svc_serv *serv, struct list_head *xprt_list, st · 1 unmodified line | ||
| 1068 | 1068 | set_bit(XPT_CLOSE, &xprt->xpt_flags); |
| 1069 | 1069 | svc_xprt_enqueue(xprt); |
| 1070 | 1070 | } |
| 1071 | − spin_unlock(&serv->sv_lock); | |
| 1071 | + spin_unlock_bh(&serv->sv_lock); | |
| 1072 | 1072 | return ret; |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| @@ -252,9 +252,9 @@ xprt_setup_rdma_bc(struct xprt_create *args) · 251 unmodified lines | ||
| 252 | 252 | xprt->timeout = &xprt_rdma_bc_timeout; |
| 253 | 253 | xprt_set_bound(xprt); |
| 254 | 254 | xprt_set_connected(xprt); |
| 255 | − xprt->bind_timeout = RPCRDMA_BIND_TO; | |
| 256 | − xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO; | |
| 257 | − xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO; | |
| 255 | + xprt->bind_timeout = 0; | |
| 256 | + xprt->reestablish_timeout = 0; | |
| 257 | + xprt->idle_timeout = 0; | |
| 258 | 258 | |
| 259 | 259 | xprt->prot = XPRT_TRANSPORT_BC_RDMA; |
| 260 | 260 | xprt->ops = &xprt_rdma_bc_procs; |
| @@ -266,46 +266,33 @@ void svc_rdma_release_rqst(struct svc_rqst *rqstp) · 265 unmodified lines | ||
| 266 | 266 | svc_rdma_recv_ctxt_put(rdma, ctxt); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | −static bool svc_rdma_refresh_recvs(struct svcxprt_rdma *rdma, | |
| 270 | − unsigned int wanted, bool temp) | |
| 269 | +static int __svc_rdma_post_recv(struct svcxprt_rdma *rdma, | |
| 270 | + struct svc_rdma_recv_ctxt *ctxt) | |
| 271 | 271 | { |
| 272 | − const struct ib_recv_wr *bad_wr = NULL; | |
| 273 | − struct svc_rdma_recv_ctxt *ctxt; | |
| 274 | − struct ib_recv_wr *recv_chain; | |
| 275 | 272 | int ret; |
| 276 | 273 | |
| 277 | − recv_chain = NULL; | |
| 278 | − while (wanted--) { | |
| 279 | − ctxt = svc_rdma_recv_ctxt_get(rdma); | |
| 280 | − if (!ctxt) | |
| 281 | − break; | |
| 282 | − | |
| 283 | − trace_svcrdma_post_recv(ctxt); | |
| 284 | − ctxt->rc_temp = temp; | |
| 285 | − ctxt->rc_recv_wr.next = recv_chain; | |
| 286 | − recv_chain = &ctxt->rc_recv_wr; | |
| 287 | − rdma->sc_pending_recvs++; | |
| 288 | − } | |
| 289 | − if (!recv_chain) | |
| 290 | − return false; | |
| 291 | − | |
| 292 | − ret = ib_post_recv(rdma->sc_qp, recv_chain, &bad_wr); | |
| 274 | + trace_svcrdma_post_recv(ctxt); | |
| 275 | + ret = ib_post_recv(rdma->sc_qp, &ctxt->rc_recv_wr, NULL); | |
| 293 | 276 | if (ret) |
| 294 | 277 | goto err_post; |
| 295 | − return true; | |
| 278 | + return 0; | |
| 296 | 279 | |
| 297 | 280 | err_post: |
| 298 | − while (bad_wr) { | |
| 299 | − ctxt = container_of(bad_wr, struct svc_rdma_recv_ctxt, | |
| 300 | − rc_recv_wr); | |
| 301 | − bad_wr = bad_wr->next; | |
| 302 | − svc_rdma_recv_ctxt_put(rdma, ctxt); | |
| 303 | − } | |
| 304 | − | |
| 305 | 281 | trace_svcrdma_rq_post_err(rdma, ret); |
| 306 | − /* Since we're destroying the xprt, no need to reset | |
| 307 | − * sc_pending_recvs. */ | |
| 308 | − return false; | |
| 282 | + svc_rdma_recv_ctxt_put(rdma, ctxt); | |
| 283 | + return ret; | |
| 284 | +} | |
| 285 | + | |
| 286 | +static int svc_rdma_post_recv(struct svcxprt_rdma *rdma) | |
| 287 | +{ | |
| 288 | + struct svc_rdma_recv_ctxt *ctxt; | |
| 289 | + | |
| 290 | + if (test_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags)) | |
| 291 | + return 0; | |
| 292 | + ctxt = svc_rdma_recv_ctxt_get(rdma); | |
| 293 | + if (!ctxt) | |
| 294 | + return -ENOMEM; | |
| 295 | + return __svc_rdma_post_recv(rdma, ctxt); | |
| 309 | 296 | } |
| 310 | 297 | |
| 311 | 298 | /** |
| @@ -316,7 +303,20 @@ err_post: · 4 unmodified lines | ||
| 316 | 303 | */ |
| 317 | 304 | bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma) |
| 318 | 305 | { |
| 319 | − return svc_rdma_refresh_recvs(rdma, rdma->sc_max_requests, true); | |
| 306 | + struct svc_rdma_recv_ctxt *ctxt; | |
| 307 | + unsigned int i; | |
| 308 | + int ret; | |
| 309 | + | |
| 310 | + for (i = 0; i < rdma->sc_max_requests; i++) { | |
| 311 | + ctxt = svc_rdma_recv_ctxt_get(rdma); | |
| 312 | + if (!ctxt) | |
| 313 | + return false; | |
| 314 | + ctxt->rc_temp = true; | |
| 315 | + ret = __svc_rdma_post_recv(rdma, ctxt); | |
| 316 | + if (ret) | |
| 317 | + return false; | |
| 318 | + } | |
| 319 | + return true; | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
| @@ -324,6 +324,8 @@ bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma) · 1 unmodified line | ||
| 324 | 324 | * @cq: Completion Queue context |
| 325 | 325 | * @wc: Work Completion object |
| 326 | 326 | * |
| 327 | + * NB: The svc_xprt/svcxprt_rdma is pinned whenever it's possible that | |
| 328 | + * the Receive completion handler could be running. | |
| 327 | 329 | */ |
| 328 | 330 | static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) |
| 329 | 331 | { |
| @@ -331,8 +333,6 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line | ||
| 331 | 333 | struct ib_cqe *cqe = wc->wr_cqe; |
| 332 | 334 | struct svc_rdma_recv_ctxt *ctxt; |
| 333 | 335 | |
| 334 | − rdma->sc_pending_recvs--; | |
| 335 | − | |
| 336 | 336 | /* WARNING: Only wc->wr_cqe and wc->status are reliable */ |
| 337 | 337 | ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe); |
| 338 | 338 | |
| @@ -340,6 +340,9 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 1 unmodified line | ||
| 340 | 340 | if (wc->status != IB_WC_SUCCESS) |
| 341 | 341 | goto flushed; |
| 342 | 342 | |
| 343 | + if (svc_rdma_post_recv(rdma)) | |
| 344 | + goto post_err; | |
| 345 | + | |
| 343 | 346 | /* All wc fields are now known to be valid */ |
| 344 | 347 | ctxt->rc_byte_len = wc->byte_len; |
| 345 | 348 | |
| @@ -350,18 +353,11 @@ static void svc_rdma_wc_receive(struct ib_cq *cq, struct ib_wc *wc) · 4 unmodified lines | ||
| 350 | 353 | spin_unlock(&rdma->sc_rq_dto_lock); |
| 351 | 354 | if (!test_bit(RDMAXPRT_CONN_PENDING, &rdma->sc_flags)) |
| 352 | 355 | svc_xprt_enqueue(&rdma->sc_xprt); |
| 353 | − | |
| 354 | − if (!test_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags) && | |
| 355 | − rdma->sc_pending_recvs < rdma->sc_max_requests) | |
| 356 | − if (!svc_rdma_refresh_recvs(rdma, RPCRDMA_MAX_RECV_BATCH, | |
| 357 | − false)) | |
| 358 | − goto post_err; | |
| 359 | − | |
| 360 | 356 | return; |
| 361 | 357 | |
| 362 | 358 | flushed: |
| 363 | − svc_rdma_recv_ctxt_put(rdma, ctxt); | |
| 364 | 359 | post_err: |
| 360 | + svc_rdma_recv_ctxt_put(rdma, ctxt); | |
| 365 | 361 | set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags); |
| 366 | 362 | svc_xprt_enqueue(&rdma->sc_xprt); |
| 367 | 363 | } |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 34 | 34 | MODULE_DESCRIPTION("A loopback soundcard"); |
| 35 | 35 | MODULE_LICENSE("GPL"); |
| 36 | −MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}"); | |
| 37 | 36 | |
| 38 | 37 | #define MAX_PCM_SUBSTREAMS 8 |
| 39 | 38 | |
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 26 | 26 | MODULE_DESCRIPTION("Dummy soundcard (/dev/null)"); |
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | −MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}"); | |
| 29 | 28 | |
| 30 | 29 | #define MAX_PCM_DEVICES 4 |
| 31 | 30 | #define MAX_PCM_SUBSTREAMS 128 |
| @@ -53,7 +53,6 @@ · 52 unmodified lines | ||
| 53 | 53 | MODULE_AUTHOR("Michael T. Mayers"); |
| 54 | 54 | MODULE_DESCRIPTION("MOTU MidiTimePiece AV multiport MIDI"); |
| 55 | 55 | MODULE_LICENSE("GPL"); |
| 56 | −MODULE_SUPPORTED_DEVICE("{{MOTU,MidiTimePiece AV multiport MIDI}}"); | |
| 57 | 56 | |
| 58 | 57 | // io resources |
| 59 | 58 | #define MTPAV_IOBASE 0x378 |
| @@ -37,7 +37,6 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); · 36 unmodified lines | ||
| 37 | 37 | MODULE_AUTHOR("Matthias Koenig <mk@phasorlab.de>"); |
| 38 | 38 | MODULE_DESCRIPTION("ESI Miditerminal 4140"); |
| 39 | 39 | MODULE_LICENSE("GPL"); |
| 40 | −MODULE_SUPPORTED_DEVICE("{{ESI,Miditerminal 4140}}"); | |
| 41 | 40 | |
| 42 | 41 | /********************************************************************* |
| 43 | 42 | * Chip specific |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Stas Sergeev <stsp@users.sourceforge.net>"); |
| 23 | 23 | MODULE_DESCRIPTION("PC-Speaker driver"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | −MODULE_SUPPORTED_DEVICE("{{PC-Speaker, pcsp}}"); | |
| 26 | 25 | MODULE_ALIAS("platform:pcspkr"); |
| 27 | 26 | |
| 28 | 27 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| @@ -57,7 +57,6 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); · 56 unmodified lines | ||
| 57 | 57 | MODULE_AUTHOR("Levent Guendogdu, Tobias Gehrig, Matthias Koenig"); |
| 58 | 58 | MODULE_DESCRIPTION("Midiman Portman2x4"); |
| 59 | 59 | MODULE_LICENSE("GPL"); |
| 60 | −MODULE_SUPPORTED_DEVICE("{{Midiman,Portman2x4}}"); | |
| 61 | 60 | |
| 62 | 61 | /********************************************************************* |
| 63 | 62 | * Chip specific |
| @@ -34,7 +34,6 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | MODULE_DESCRIPTION("MIDI serial u16550"); |
| 36 | 36 | MODULE_LICENSE("GPL"); |
| 37 | −MODULE_SUPPORTED_DEVICE("{{ALSA, MIDI serial u16550}}"); | |
| 38 | 37 | |
| 39 | 38 | #define SNDRV_SERIAL_SOUNDCANVAS 0 /* Roland Soundcanvas; F5 NN selects part */ |
| 40 | 39 | #define SNDRV_SERIAL_MS124T 1 /* Midiator MS-124T */ |
| @@ -43,7 +43,6 @@ · 42 unmodified lines | ||
| 43 | 43 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 44 | 44 | MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices"); |
| 45 | 45 | MODULE_LICENSE("GPL"); |
| 46 | −MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}"); | |
| 47 | 46 | |
| 48 | 47 | #define MAX_MIDI_DEVICES 4 |
| 49 | 48 | |
| @@ -493,11 +493,10 @@ void snd_dice_stream_stop_duplex(struct snd_dice *dice) · 492 unmodified lines | ||
| 493 | 493 | struct reg_params tx_params, rx_params; |
| 494 | 494 | |
| 495 | 495 | if (dice->substreams_counter == 0) { |
| 496 | − if (get_register_params(dice, &tx_params, &rx_params) >= 0) { | |
| 497 | − amdtp_domain_stop(&dice->domain); | |
| 496 | + if (get_register_params(dice, &tx_params, &rx_params) >= 0) | |
| 498 | 497 | finish_session(dice, &tx_params, &rx_params); |
| 499 | − } | |
| 500 | 498 | |
| 499 | + amdtp_domain_stop(&dice->domain); | |
| 501 | 500 | release_resources(dice); |
| 502 | 501 | } |
| 503 | 502 | } |
| @@ -22,13 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); |
| 23 | 23 | MODULE_DESCRIPTION("AD1816A, AD1815"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | −MODULE_SUPPORTED_DEVICE("{{Highscreen,Sound-Boostar 16 3D}," | |
| 26 | − "{Analog Devices,AD1815}," | |
| 27 | − "{Analog Devices,AD1816A}," | |
| 28 | − "{TerraTec,Base 64}," | |
| 29 | − "{TerraTec,AudioSystem EWS64S}," | |
| 30 | − "{Aztech/Newcom SC-16 3D}," | |
| 31 | − "{Shark Predator ISA}}"); | |
| 32 | 25 | |
| 33 | 26 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ |
| 34 | 27 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -22,9 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_DESCRIPTION(CRD_NAME); |
| 23 | 23 | MODULE_AUTHOR("Tugrul Galatali <galatalt@stuy.edu>, Jaroslav Kysela <perex@perex.cz>"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | −MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848}," | |
| 26 | − "{Analog Devices,AD1847}," | |
| 27 | − "{Crystal Semiconductors,CS4248}}"); | |
| 28 | 25 | |
| 29 | 26 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 30 | 27 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -26,17 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #define PFX "als100: " |
| 27 | 27 | |
| 28 | 28 | MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0"); |
| 29 | −MODULE_SUPPORTED_DEVICE("{{Diamond Technologies DT-019X}," | |
| 30 | − "{Avance Logic ALS-007}}" | |
| 31 | − "{{Avance Logic,ALS100 - PRO16PNP}," | |
| 32 | − "{Avance Logic,ALS110}," | |
| 33 | − "{Avance Logic,ALS120}," | |
| 34 | − "{Avance Logic,ALS200}," | |
| 35 | − "{3D Melody,MF1000}," | |
| 36 | − "{Digimate,3D Sound}," | |
| 37 | − "{Avance Logic,ALS120}," | |
| 38 | − "{RTL,RTL3000}}"); | |
| 39 | − | |
| 40 | 29 | MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); |
| 41 | 30 | MODULE_LICENSE("GPL"); |
| 42 | 31 | |
| @@ -35,11 +35,6 @@ · 34 unmodified lines | ||
| 35 | 35 | MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); |
| 36 | 36 | MODULE_DESCRIPTION("Aztech Systems AZT2320"); |
| 37 | 37 | MODULE_LICENSE("GPL"); |
| 38 | −MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V}," | |
| 39 | − "{Aztech Systems,AZT2320}," | |
| 40 | − "{Aztech Systems,AZT3300}," | |
| 41 | − "{Aztech Systems,AZT2320}," | |
| 42 | − "{Aztech Systems,AZT3000}}"); | |
| 43 | 38 | |
| 44 | 39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 45 | 40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -51,7 +51,6 @@ · 50 unmodified lines | ||
| 51 | 51 | MODULE_AUTHOR("George Talusan <gstalusan@uwaterloo.ca>"); |
| 52 | 52 | MODULE_DESCRIPTION("C-Media CMI8330/CMI8329"); |
| 53 | 53 | MODULE_LICENSE("GPL"); |
| 54 | −MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}"); | |
| 55 | 54 | |
| 56 | 55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 57 | 56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -23,7 +23,6 @@ · 22 unmodified lines | ||
| 23 | 23 | MODULE_DESCRIPTION(CRD_NAME); |
| 24 | 24 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 25 | 25 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}"); | |
| 27 | 26 | |
| 28 | 27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 29 | 28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -18,40 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 19 | 19 | MODULE_LICENSE("GPL"); |
| 20 | 20 | MODULE_DESCRIPTION("Cirrus Logic CS4232-9"); |
| 21 | −MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000}," | |
| 22 | − "{Turtle Beach,Tropez Plus}," | |
| 23 | − "{SIC CrystalWave 32}," | |
| 24 | − "{Hewlett Packard,Omnibook 5500}," | |
| 25 | − "{TerraTec,Maestro 32/96}," | |
| 26 | − "{Philips,PCA70PS}}," | |
| 27 | − "{{Crystal Semiconductors,CS4235}," | |
| 28 | − "{Crystal Semiconductors,CS4236}," | |
| 29 | − "{Crystal Semiconductors,CS4237}," | |
| 30 | − "{Crystal Semiconductors,CS4238}," | |
| 31 | − "{Crystal Semiconductors,CS4239}," | |
| 32 | − "{Acer,AW37}," | |
| 33 | − "{Acer,AW35/Pro}," | |
| 34 | − "{Crystal,3D}," | |
| 35 | − "{Crystal Computer,TidalWave128}," | |
| 36 | − "{Dell,Optiplex GX1}," | |
| 37 | − "{Dell,Workstation 400 sound}," | |
| 38 | − "{EliteGroup,P5TX-LA sound}," | |
| 39 | − "{Gallant,SC-70P}," | |
| 40 | − "{Gateway,E1000 Onboard CS4236B}," | |
| 41 | − "{Genius,Sound Maker 3DJ}," | |
| 42 | − "{Hewlett Packard,HP6330 sound}," | |
| 43 | − "{IBM,PC 300PL sound}," | |
| 44 | − "{IBM,Aptiva 2137 E24}," | |
| 45 | − "{IBM,IntelliStation M Pro}," | |
| 46 | − "{Intel,Marlin Spike Mobo CS4235}," | |
| 47 | − "{Intel PR440FX Onboard}," | |
| 48 | − "{Guillemot,MaxiSound 16 PnP}," | |
| 49 | − "{NewClear,3D}," | |
| 50 | − "{TerraTec,AudioSystem EWS64L/XL}," | |
| 51 | − "{Typhoon Soundsystem,CS4236B}," | |
| 52 | − "{Turtle Beach,Malibu}," | |
| 53 | − "{Unknown,Digital PC 5000 Onboard}}"); | |
| 54 | − | |
| 55 | 21 | MODULE_ALIAS("snd_cs4232"); |
| 56 | 22 | |
| 57 | 23 | #define IDENT "CS4232+" |
| @@ -26,11 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | MODULE_DESCRIPTION(CRD_NAME); |
| 27 | 27 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 28 | 28 | MODULE_LICENSE("GPL"); |
| 29 | −MODULE_SUPPORTED_DEVICE("{{ESS,ES688 PnP AudioDrive,pnp:ESS0100}," | |
| 30 | − "{ESS,ES1688 PnP AudioDrive,pnp:ESS0102}," | |
| 31 | − "{ESS,ES688 AudioDrive,pnp:ESS6881}," | |
| 32 | − "{ESS,ES1688 AudioDrive,pnp:ESS1681}}"); | |
| 33 | − | |
| 34 | 29 | MODULE_ALIAS("snd_es968"); |
| 35 | 30 | |
| 36 | 31 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| @@ -1929,17 +1929,9 @@ static int snd_es18xx_mixer(struct snd_card *card) · 1928 unmodified lines | ||
| 1929 | 1929 | |
| 1930 | 1930 | /* Card level */ |
| 1931 | 1931 | |
| 1932 | −MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>"); | |
| 1932 | +MODULE_AUTHOR("Christian Fischbach <fishbach@pool.informatik.rwth-aachen.de>, Abramo Bagnara <abramo@alsa-project.org>"); | |
| 1933 | 1933 | MODULE_DESCRIPTION("ESS ES18xx AudioDrive"); |
| 1934 | 1934 | MODULE_LICENSE("GPL"); |
| 1935 | −MODULE_SUPPORTED_DEVICE("{{ESS,ES1868 PnP AudioDrive}," | |
| 1936 | − "{ESS,ES1869 PnP AudioDrive}," | |
| 1937 | − "{ESS,ES1878 PnP AudioDrive}," | |
| 1938 | − "{ESS,ES1879 PnP AudioDrive}," | |
| 1939 | − "{ESS,ES1887 PnP AudioDrive}," | |
| 1940 | − "{ESS,ES1888 PnP AudioDrive}," | |
| 1941 | − "{ESS,ES1887 AudioDrive}," | |
| 1942 | − "{ESS,ES1888 AudioDrive}}"); | |
| 1943 | 1935 | |
| 1944 | 1936 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 1945 | 1937 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -23,7 +23,6 @@ · 22 unmodified lines | ||
| 23 | 23 | MODULE_DESCRIPTION(CRD_NAME); |
| 24 | 24 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 25 | 25 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}"); | |
| 27 | 26 | |
| 28 | 27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 29 | 28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | MODULE_DESCRIPTION(CRD_NAME); |
| 28 | 28 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 29 | 29 | MODULE_LICENSE("GPL"); |
| 30 | −MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}"); | |
| 31 | 30 | |
| 32 | 31 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 33 | 32 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 22 | 22 | MODULE_DESCRIPTION("Gravis UltraSound MAX"); |
| 23 | 23 | MODULE_LICENSE("GPL"); |
| 24 | −MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}"); | |
| 25 | 24 | |
| 26 | 25 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 27 | 26 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -28,14 +28,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 27 unmodified lines | ||
| 28 | 28 | MODULE_LICENSE("GPL"); |
| 29 | 29 | #ifndef SNDRV_STB |
| 30 | 30 | MODULE_DESCRIPTION("AMD InterWave"); |
| 31 | −MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Plug & Play}," | |
| 32 | − "{STB,SoundRage32}," | |
| 33 | − "{MED,MED3210}," | |
| 34 | − "{Dynasonix,Dynasonix Pro}," | |
| 35 | − "{Panasonic,PCA761AW}}"); | |
| 36 | 31 | #else |
| 37 | 32 | MODULE_DESCRIPTION("AMD InterWave STB with TEA6330T"); |
| 38 | −MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}"); | |
| 39 | 33 | #endif |
| 40 | 34 | |
| 41 | 35 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| @@ -22,11 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 23 | 23 | MODULE_DESCRIPTION("Yamaha OPL3SA2+"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | −MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S}," | |
| 26 | − "{Genius,Sound Maker 3DX}," | |
| 27 | − "{Yamaha,OPL3SA3}," | |
| 28 | − "{Intel,AL440LX sound}," | |
| 29 | − "{NeoMagic,MagicWave 3DX}}"); | |
| 30 | 25 | |
| 31 | 26 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 32 | 27 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -33,9 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>"); |
| 34 | 34 | MODULE_LICENSE("GPL"); |
| 35 | 35 | MODULE_DESCRIPTION("Miro miroSOUND PCM1 pro, PCM12, PCM20 Radio"); |
| 36 | −MODULE_SUPPORTED_DEVICE("{{Miro,miroSOUND PCM1 pro}, " | |
| 37 | − "{Miro,miroSOUND PCM12}, " | |
| 38 | − "{Miro,miroSOUND PCM20 Radio}}"); | |
| 39 | 36 | |
| 40 | 37 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| 41 | 38 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -36,17 +36,11 @@ MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); · 35 unmodified lines | ||
| 36 | 36 | MODULE_LICENSE("GPL"); |
| 37 | 37 | #ifdef OPTi93X |
| 38 | 38 | MODULE_DESCRIPTION("OPTi93X"); |
| 39 | −MODULE_SUPPORTED_DEVICE("{{OPTi,82C931/3}}"); | |
| 40 | 39 | #else /* OPTi93X */ |
| 41 | 40 | #ifdef CS4231 |
| 42 | 41 | MODULE_DESCRIPTION("OPTi92X - CS4231"); |
| 43 | −MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (CS4231)}," | |
| 44 | − "{OPTi,82C925 (CS4231)}}"); | |
| 45 | 42 | #else /* CS4231 */ |
| 46 | 43 | MODULE_DESCRIPTION("OPTi92X - AD1848"); |
| 47 | −MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)}," | |
| 48 | − "{OPTi,82C925 (AD1848)}," | |
| 49 | − "{OAK,Mozart}}"); | |
| 50 | 44 | #endif /* CS4231 */ |
| 51 | 45 | #endif /* OPTi93X */ |
| 52 | 46 | |
| @@ -28,9 +28,6 @@ · 27 unmodified lines | ||
| 28 | 28 | #define PFX "jazz16: " |
| 29 | 29 | |
| 30 | 30 | MODULE_DESCRIPTION("Media Vision Jazz16"); |
| 31 | −MODULE_SUPPORTED_DEVICE("{{Media Vision ??? }," | |
| 32 | − "{RTL,RTL3000}}"); | |
| 33 | − | |
| 34 | 31 | MODULE_AUTHOR("Krzysztof Helt <krzysztof.h1@wp.pl>"); |
| 35 | 32 | MODULE_LICENSE("GPL"); |
| 36 | 33 | |
| @@ -31,16 +31,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 30 unmodified lines | ||
| 31 | 31 | MODULE_LICENSE("GPL"); |
| 32 | 32 | #ifndef SNDRV_SBAWE |
| 33 | 33 | MODULE_DESCRIPTION("Sound Blaster 16"); |
| 34 | −MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 16}," | |
| 35 | − "{Creative Labs,SB Vibra16S}," | |
| 36 | − "{Creative Labs,SB Vibra16C}," | |
| 37 | − "{Creative Labs,SB Vibra16CL}," | |
| 38 | − "{Creative Labs,SB Vibra16X}}"); | |
| 39 | 34 | #else |
| 40 | 35 | MODULE_DESCRIPTION("Sound Blaster AWE"); |
| 41 | −MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32}," | |
| 42 | − "{Creative Labs,SB AWE 64}," | |
| 43 | − "{Creative Labs,SB AWE 64 Gold}}"); | |
| 44 | 36 | #endif |
| 45 | 37 | |
| 46 | 38 | #if 0 |
| @@ -17,7 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 18 | 18 | MODULE_DESCRIPTION("Sound Blaster 1.0/2.0/Pro"); |
| 19 | 19 | MODULE_LICENSE("GPL"); |
| 20 | −MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}"); | |
| 21 | 20 | |
| 22 | 21 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 23 | 22 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -29,9 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | MODULE_AUTHOR("Krzysztof Helt"); |
| 30 | 30 | MODULE_DESCRIPTION("Gallant SC-6000"); |
| 31 | 31 | MODULE_LICENSE("GPL"); |
| 32 | −MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000}," | |
| 33 | − "{AudioExcel, Audio Excel DSP 16}," | |
| 34 | − "{Zoltrix, AV302}}"); | |
| 35 | 32 | |
| 36 | 33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 37 | 34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>"); |
| 22 | 22 | MODULE_DESCRIPTION("Turtle Beach Wavefront"); |
| 23 | 23 | MODULE_LICENSE("GPL"); |
| 24 | −MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}"); | |
| 25 | 24 | |
| 26 | 25 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 27 | 26 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | MODULE_AUTHOR("Vivien Chappelier <vivien.chappelier@linux-mips.org>"); |
| 33 | 33 | MODULE_DESCRIPTION("SGI O2 Audio"); |
| 34 | 34 | MODULE_LICENSE("GPL"); |
| 35 | −MODULE_SUPPORTED_DEVICE("{{Silicon Graphics, O2 Audio}}"); | |
| 36 | 35 | |
| 37 | 36 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| 38 | 37 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -43,7 +43,6 @@ · 42 unmodified lines | ||
| 43 | 43 | MODULE_AUTHOR("Kyle McMartin <kyle@parisc-linux.org>, Thibaut Varene <t-bone@parisc-linux.org>"); |
| 44 | 44 | MODULE_DESCRIPTION("Analog Devices AD1889 ALSA sound driver"); |
| 45 | 45 | MODULE_LICENSE("GPL"); |
| 46 | −MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1889}}"); | |
| 47 | 46 | |
| 48 | 47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 49 | 48 | module_param_array(index, int, NULL, 0444); |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | MODULE_AUTHOR("Matt Wu <Matt_Wu@acersoftech.com.cn>"); |
| 30 | 30 | MODULE_DESCRIPTION("ALI M5451"); |
| 31 | 31 | MODULE_LICENSE("GPL"); |
| 32 | −MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}"); | |
| 33 | 32 | |
| 34 | 33 | static int index = SNDRV_DEFAULT_IDX1; /* Index */ |
| 35 | 34 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -86,7 +86,6 @@ enum {DEVICE_ALS300, DEVICE_ALS300_PLUS}; · 85 unmodified lines | ||
| 86 | 86 | MODULE_AUTHOR("Ash Willis <ashwillis@programmer.net>"); |
| 87 | 87 | MODULE_DESCRIPTION("Avance Logic ALS300"); |
| 88 | 88 | MODULE_LICENSE("GPL"); |
| 89 | −MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS300},{Avance Logic,ALS300+}}"); | |
| 90 | 89 | |
| 91 | 90 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 92 | 91 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -68,7 +68,6 @@ · 67 unmodified lines | ||
| 68 | 68 | MODULE_AUTHOR("Bart Hartgers <bart@etpmod.phys.tue.nl>, Andreas Mohr"); |
| 69 | 69 | MODULE_DESCRIPTION("Avance Logic ALS4000"); |
| 70 | 70 | MODULE_LICENSE("GPL"); |
| 71 | −MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}"); | |
| 72 | 71 | |
| 73 | 72 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 74 | 73 | #define SUPPORT_JOYSTICK 1 |
| @@ -23,7 +23,6 @@ · 22 unmodified lines | ||
| 23 | 23 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 24 | 24 | MODULE_DESCRIPTION("ATI IXP AC97 controller"); |
| 25 | 25 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250/300/400/600}}"); | |
| 27 | 26 | |
| 28 | 27 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| 29 | 28 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -23,7 +23,6 @@ · 22 unmodified lines | ||
| 23 | 23 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 24 | 24 | MODULE_DESCRIPTION("ATI IXP MC97 controller"); |
| 25 | 25 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{ATI,IXP150/200/250}}"); | |
| 27 | 26 | |
| 28 | 27 | static int index = -2; /* Exclude the first card */ |
| 29 | 28 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -41,8 +41,6 @@ MODULE_PARM_DESC(pcifix, "Enable VIA-workaround for " CARD_NAME " soundcard."); · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | MODULE_DESCRIPTION("Aureal vortex"); |
| 43 | 43 | MODULE_LICENSE("GPL"); |
| 44 | −MODULE_SUPPORTED_DEVICE("{{Aureal Semiconductor Inc., Aureal Vortex Sound Processor}}"); | |
| 45 | − | |
| 46 | 44 | MODULE_DEVICE_TABLE(pci, snd_vortex_ids); |
| 47 | 45 | |
| 48 | 46 | static void vortex_fix_latency(struct pci_dev *vortex) |
| @@ -196,7 +196,6 @@ · 195 unmodified lines | ||
| 196 | 196 | MODULE_AUTHOR("Andreas Mohr <andi AT lisas.de>"); |
| 197 | 197 | MODULE_DESCRIPTION("Aztech AZF3328 (PCI168)"); |
| 198 | 198 | MODULE_LICENSE("GPL"); |
| 199 | −MODULE_SUPPORTED_DEVICE("{{Aztech,AZF3328}}"); | |
| 200 | 199 | |
| 201 | 200 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 202 | 201 | #define SUPPORT_GAMEPORT 1 |
| @@ -23,8 +23,6 @@ · 22 unmodified lines | ||
| 23 | 23 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 24 | 24 | MODULE_DESCRIPTION("Brooktree Bt87x audio driver"); |
| 25 | 25 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Brooktree,Bt878}," | |
| 27 | − "{Brooktree,Bt879}}"); | |
| 28 | 26 | |
| 29 | 27 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ |
| 30 | 28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -137,7 +137,6 @@ · 136 unmodified lines | ||
| 137 | 137 | MODULE_AUTHOR("James Courtier-Dutton <James@superbug.demon.co.uk>"); |
| 138 | 138 | MODULE_DESCRIPTION("CA0106"); |
| 139 | 139 | MODULE_LICENSE("GPL"); |
| 140 | −MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}"); | |
| 141 | 140 | |
| 142 | 141 | // module parameters (see "Module Parameters") |
| 143 | 142 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| @@ -30,10 +30,6 @@ · 29 unmodified lines | ||
| 30 | 30 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 31 | 31 | MODULE_DESCRIPTION("C-Media CMI8x38 PCI"); |
| 32 | 32 | MODULE_LICENSE("GPL"); |
| 33 | −MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8738}," | |
| 34 | − "{C-Media,CMI8738B}," | |
| 35 | − "{C-Media,CMI8338A}," | |
| 36 | − "{C-Media,CMI8338B}}"); | |
| 37 | 33 | |
| 38 | 34 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 39 | 35 | #define SUPPORT_JOYSTICK 1 |
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 26 | 26 | MODULE_DESCRIPTION("Cirrus Logic CS4281"); |
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | −MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,CS4281}}"); | |
| 29 | 28 | |
| 30 | 29 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 31 | 30 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -21,13 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 22 | 22 | MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX"); |
| 23 | 23 | MODULE_LICENSE("GPL"); |
| 24 | −MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)}," | |
| 25 | − "{Cirrus Logic,Sound Fusion (CS4610)}," | |
| 26 | − "{Cirrus Logic,Sound Fusion (CS4612)}," | |
| 27 | − "{Cirrus Logic,Sound Fusion (CS4615)}," | |
| 28 | − "{Cirrus Logic,Sound Fusion (CS4622)}," | |
| 29 | − "{Cirrus Logic,Sound Fusion (CS4624)}," | |
| 30 | − "{Cirrus Logic,Sound Fusion (CS4630)}}"); | |
| 31 | 24 | |
| 32 | 25 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 33 | 26 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -393,4 +393,3 @@ module_pci_driver(cs5535audio_driver); · 392 unmodified lines | ||
| 393 | 393 | MODULE_AUTHOR("Jaya Kumar"); |
| 394 | 394 | MODULE_LICENSE("GPL"); |
| 395 | 395 | MODULE_DESCRIPTION("CS5535 Audio"); |
| 396 | −MODULE_SUPPORTED_DEVICE("CS5535 Audio"); | |
| @@ -18,7 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | MODULE_AUTHOR("Creative Technology Ltd"); |
| 19 | 19 | MODULE_DESCRIPTION("X-Fi driver version 1.03"); |
| 20 | 20 | MODULE_LICENSE("GPL v2"); |
| 21 | −MODULE_SUPPORTED_DEVICE("{{Creative Labs, Sound Blaster X-Fi}"); | |
| 22 | 21 | |
| 23 | 22 | static unsigned int reference_rate = 48000; |
| 24 | 23 | static unsigned int multiple = 2; |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | MODULE_AUTHOR("Giuliano Pochini <pochini@shiny.it>"); |
| 11 | 11 | MODULE_LICENSE("GPL v2"); |
| 12 | 12 | MODULE_DESCRIPTION("Echoaudio " ECHOCARD_NAME " soundcards driver"); |
| 13 | −MODULE_SUPPORTED_DEVICE("{{Echoaudio," ECHOCARD_NAME "}}"); | |
| 14 | 13 | MODULE_DEVICE_TABLE(pci, snd_echo_ids); |
| 15 | 14 | |
| 16 | 15 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| @@ -18,8 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 19 | 19 | MODULE_DESCRIPTION("EMU10K1"); |
| 20 | 20 | MODULE_LICENSE("GPL"); |
| 21 | −MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS}," | |
| 22 | − "{Creative Labs,SB Audigy}}"); | |
| 23 | 21 | |
| 24 | 22 | #if IS_ENABLED(CONFIG_SND_SEQUENCER) |
| 25 | 23 | #define ENABLE_SYNTH |
| @@ -31,7 +31,6 @@ · 30 unmodified lines | ||
| 31 | 31 | MODULE_AUTHOR("Francisco Moraes <fmoraes@nc.rr.com>"); |
| 32 | 32 | MODULE_DESCRIPTION("EMU10K1X"); |
| 33 | 33 | MODULE_LICENSE("GPL"); |
| 34 | −MODULE_SUPPORTED_DEVICE("{{Dell Creative Labs,SB Live!}"); | |
| 35 | 34 | |
| 36 | 35 | // module parameters (see "Module Parameters") |
| 37 | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| @@ -52,17 +52,9 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Thomas Sailer <sailer@ife.ee.et · 51 unmodified lines | ||
| 52 | 52 | MODULE_LICENSE("GPL"); |
| 53 | 53 | #ifdef CHIP1370 |
| 54 | 54 | MODULE_DESCRIPTION("Ensoniq AudioPCI ES1370"); |
| 55 | −MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI-97 ES1370}," | |
| 56 | − "{Creative Labs,SB PCI64/128 (ES1370)}}"); | |
| 57 | 55 | #endif |
| 58 | 56 | #ifdef CHIP1371 |
| 59 | 57 | MODULE_DESCRIPTION("Ensoniq/Creative AudioPCI ES1371+"); |
| 60 | −MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI ES1371/73}," | |
| 61 | − "{Ensoniq,AudioPCI ES1373}," | |
| 62 | − "{Creative Labs,Ectiva EV1938}," | |
| 63 | − "{Creative Labs,SB PCI64/128 (ES1371/73)}," | |
| 64 | − "{Creative Labs,Vibra PCI128}," | |
| 65 | − "{Ectiva,EV1938}}"); | |
| 66 | 58 | #endif |
| 67 | 59 | |
| 68 | 60 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| @@ -52,10 +52,6 @@ · 51 unmodified lines | ||
| 52 | 52 | MODULE_AUTHOR("Jaromir Koutek <miri@punknet.cz>"); |
| 53 | 53 | MODULE_DESCRIPTION("ESS Solo-1"); |
| 54 | 54 | MODULE_LICENSE("GPL"); |
| 55 | −MODULE_SUPPORTED_DEVICE("{{ESS,ES1938}," | |
| 56 | − "{ESS,ES1946}," | |
| 57 | − "{ESS,ES1969}," | |
| 58 | − "{TerraTec,128i PCI}}"); | |
| 59 | 55 | |
| 60 | 56 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 61 | 57 | #define SUPPORT_JOYSTICK 1 |
| @@ -107,10 +107,6 @@ · 106 unmodified lines | ||
| 107 | 107 | |
| 108 | 108 | MODULE_DESCRIPTION("ESS Maestro"); |
| 109 | 109 | MODULE_LICENSE("GPL"); |
| 110 | −MODULE_SUPPORTED_DEVICE("{{ESS,Maestro 2e}," | |
| 111 | − "{ESS,Maestro 2}," | |
| 112 | − "{ESS,Maestro 1}," | |
| 113 | − "{TerraTec,DMX}}"); | |
| 114 | 110 | |
| 115 | 111 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 116 | 112 | #define SUPPORT_JOYSTICK 1 |
| @@ -26,8 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 27 | 27 | MODULE_DESCRIPTION("ForteMedia FM801"); |
| 28 | 28 | MODULE_LICENSE("GPL"); |
| 29 | −MODULE_SUPPORTED_DEVICE("{{ForteMedia,FM801}," | |
| 30 | − "{Genius,SoundMaker Live 5.1}}"); | |
| 31 | 29 | |
| 32 | 30 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 33 | 31 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -4065,7 +4065,7 @@ static int add_micmute_led_hook(struct hda_codec *codec) · 4064 unmodified lines | ||
| 4065 | 4065 | |
| 4066 | 4066 | spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE; |
| 4067 | 4067 | spec->micmute_led.capture = 0; |
| 4068 | − spec->micmute_led.led_value = 0; | |
| 4068 | + spec->micmute_led.led_value = -1; | |
| 4069 | 4069 | spec->micmute_led.old_hook = spec->cap_sync_hook; |
| 4070 | 4070 | spec->cap_sync_hook = update_micmute_led; |
| 4071 | 4071 | if (!snd_hda_gen_add_kctl(spec, NULL, &micmute_led_mode_ctl)) |
| @@ -208,40 +208,6 @@ MODULE_PARM_DESC(snoop, "Enable/disable snooping"); · 207 unmodified lines | ||
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | MODULE_LICENSE("GPL"); |
| 211 | −MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," | |
| 212 | − "{Intel, ICH6M}," | |
| 213 | − "{Intel, ICH7}," | |
| 214 | − "{Intel, ESB2}," | |
| 215 | − "{Intel, ICH8}," | |
| 216 | − "{Intel, ICH9}," | |
| 217 | − "{Intel, ICH10}," | |
| 218 | − "{Intel, PCH}," | |
| 219 | − "{Intel, CPT}," | |
| 220 | − "{Intel, PPT}," | |
| 221 | − "{Intel, LPT}," | |
| 222 | − "{Intel, LPT_LP}," | |
| 223 | − "{Intel, WPT_LP}," | |
| 224 | − "{Intel, SPT}," | |
| 225 | − "{Intel, SPT_LP}," | |
| 226 | − "{Intel, HPT}," | |
| 227 | − "{Intel, PBG}," | |
| 228 | − "{Intel, SCH}," | |
| 229 | − "{ATI, SB450}," | |
| 230 | − "{ATI, SB600}," | |
| 231 | − "{ATI, RS600}," | |
| 232 | − "{ATI, RS690}," | |
| 233 | − "{ATI, RS780}," | |
| 234 | − "{ATI, R600}," | |
| 235 | − "{ATI, RV630}," | |
| 236 | − "{ATI, RV610}," | |
| 237 | − "{ATI, RV670}," | |
| 238 | − "{ATI, RV635}," | |
| 239 | − "{ATI, RV620}," | |
| 240 | − "{ATI, RV770}," | |
| 241 | − "{VIA, VT8251}," | |
| 242 | − "{VIA, VT8237A}," | |
| 243 | − "{SiS, SIS966}," | |
| 244 | − "{ULI, M5461}}"); | |
| 245 | 211 | MODULE_DESCRIPTION("Intel HDA driver"); |
| 246 | 212 | |
| 247 | 213 | #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO) |
| @@ -4225,6 +4225,12 @@ static void alc_fixup_hp_gpio_led(struct hda_codec *codec, · 4224 unmodified lines | ||
| 4225 | 4225 | } |
| 4226 | 4226 | } |
| 4227 | 4227 | |
| 4228 | +static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, | |
| 4229 | + const struct hda_fixup *fix, int action) | |
| 4230 | +{ | |
| 4231 | + alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); | |
| 4232 | +} | |
| 4233 | + | |
| 4228 | 4234 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
| 4229 | 4235 | const struct hda_fixup *fix, int action) |
| 4230 | 4236 | { |
| @@ -6381,6 +6387,7 @@ enum { · 2150 unmodified lines | ||
| 6381 | 6387 | ALC294_FIXUP_ASUS_GX502_VERBS, |
| 6382 | 6388 | ALC285_FIXUP_HP_GPIO_LED, |
| 6383 | 6389 | ALC285_FIXUP_HP_MUTE_LED, |
| 6390 | + ALC236_FIXUP_HP_GPIO_LED, | |
| 6384 | 6391 | ALC236_FIXUP_HP_MUTE_LED, |
| 6385 | 6392 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
| 6386 | 6393 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
| @@ -7616,6 +7623,10 @@ static const struct hda_fixup alc269_fixups[] = { · 1229 unmodified lines | ||
| 7616 | 7623 | .type = HDA_FIXUP_FUNC, |
| 7617 | 7624 | .v.func = alc285_fixup_hp_mute_led, |
| 7618 | 7625 | }, |
| 7626 | + [ALC236_FIXUP_HP_GPIO_LED] = { | |
| 7627 | + .type = HDA_FIXUP_FUNC, | |
| 7628 | + .v.func = alc236_fixup_hp_gpio_led, | |
| 7629 | + }, | |
| 7619 | 7630 | [ALC236_FIXUP_HP_MUTE_LED] = { |
| 7620 | 7631 | .type = HDA_FIXUP_FUNC, |
| 7621 | 7632 | .v.func = alc236_fixup_hp_mute_led, |
| @@ -8045,9 +8056,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 423 unmodified lines | ||
| 8045 | 8056 | SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", |
| 8046 | 8057 | ALC285_FIXUP_HP_GPIO_AMP_INIT), |
| 8047 | 8058 | SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), |
| 8059 | + SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), | |
| 8048 | 8060 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
| 8049 | 8061 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), |
| 8050 | 8062 | SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
| 8063 | + SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), | |
| 8064 | + SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), | |
| 8051 | 8065 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
| 8052 | 8066 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
| 8053 | 8067 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| @@ -8242,7 +8256,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 188 unmodified lines | ||
| 8242 | 8256 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), |
| 8243 | 8257 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
| 8244 | 8258 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
| 8259 | + SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), | |
| 8245 | 8260 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
| 8261 | + SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), | |
| 8246 | 8262 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
| 8247 | 8263 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
| 8248 | 8264 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), |
| @@ -60,12 +60,6 @@ · 59 unmodified lines | ||
| 60 | 60 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 61 | 61 | MODULE_DESCRIPTION("ICEnsemble ICE1712 (Envy24)"); |
| 62 | 62 | MODULE_LICENSE("GPL"); |
| 63 | −MODULE_SUPPORTED_DEVICE("{" | |
| 64 | − HOONTECH_DEVICE_DESC | |
| 65 | − DELTA_DEVICE_DESC | |
| 66 | − EWS_DEVICE_DESC | |
| 67 | − "{ICEnsemble,Generic ICE1712}," | |
| 68 | − "{ICEnsemble,Generic Envy24}}"); | |
| 69 | 63 | |
| 70 | 64 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 71 | 65 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -44,25 +44,6 @@ · 43 unmodified lines | ||
| 44 | 44 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 45 | 45 | MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)"); |
| 46 | 46 | MODULE_LICENSE("GPL"); |
| 47 | −MODULE_SUPPORTED_DEVICE("{" | |
| 48 | − REVO_DEVICE_DESC | |
| 49 | − AMP_AUDIO2000_DEVICE_DESC | |
| 50 | − AUREON_DEVICE_DESC | |
| 51 | − VT1720_MOBO_DEVICE_DESC | |
| 52 | − PONTIS_DEVICE_DESC | |
| 53 | − PRODIGY192_DEVICE_DESC | |
| 54 | − PRODIGY_HIFI_DEVICE_DESC | |
| 55 | − JULI_DEVICE_DESC | |
| 56 | − MAYA44_DEVICE_DESC | |
| 57 | − PHASE_DEVICE_DESC | |
| 58 | − WTM_DEVICE_DESC | |
| 59 | − SE_DEVICE_DESC | |
| 60 | − QTET_DEVICE_DESC | |
| 61 | − "{VIA,VT1720}," | |
| 62 | − "{VIA,VT1724}," | |
| 63 | − "{ICEnsemble,Generic ICE1724}," | |
| 64 | − "{ICEnsemble,Generic Envy24HT}" | |
| 65 | − "{ICEnsemble,Generic Envy24PT}}"); | |
| 66 | 47 | |
| 67 | 48 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 68 | 49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -27,29 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 28 | 28 | MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455"); |
| 29 | 29 | MODULE_LICENSE("GPL"); |
| 30 | −MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH}," | |
| 31 | − "{Intel,82901AB-ICH0}," | |
| 32 | − "{Intel,82801BA-ICH2}," | |
| 33 | − "{Intel,82801CA-ICH3}," | |
| 34 | − "{Intel,82801DB-ICH4}," | |
| 35 | − "{Intel,ICH5}," | |
| 36 | − "{Intel,ICH6}," | |
| 37 | − "{Intel,ICH7}," | |
| 38 | − "{Intel,6300ESB}," | |
| 39 | − "{Intel,ESB2}," | |
| 40 | − "{Intel,MX440}," | |
| 41 | − "{SiS,SI7012}," | |
| 42 | − "{NVidia,nForce Audio}," | |
| 43 | − "{NVidia,nForce2 Audio}," | |
| 44 | − "{NVidia,nForce3 Audio}," | |
| 45 | − "{NVidia,MCP04}," | |
| 46 | − "{NVidia,MCP501}," | |
| 47 | − "{NVidia,CK804}," | |
| 48 | − "{NVidia,CK8}," | |
| 49 | − "{NVidia,CK8S}," | |
| 50 | − "{AMD,AMD768}," | |
| 51 | − "{AMD,AMD8111}," | |
| 52 | − "{ALI,M5455}}"); | |
| 53 | 30 | |
| 54 | 31 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| 55 | 32 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -25,21 +25,6 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); · 24 unmodified lines | ||
| 25 | 25 | MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; " |
| 26 | 26 | "SiS 7013; NVidia MCP/2/2S/3 modems"); |
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | −MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH}," | |
| 29 | − "{Intel,82901AB-ICH0}," | |
| 30 | − "{Intel,82801BA-ICH2}," | |
| 31 | − "{Intel,82801CA-ICH3}," | |
| 32 | − "{Intel,82801DB-ICH4}," | |
| 33 | − "{Intel,ICH5}," | |
| 34 | − "{Intel,ICH6}," | |
| 35 | − "{Intel,ICH7}," | |
| 36 | − "{Intel,MX440}," | |
| 37 | − "{SiS,7013}," | |
| 38 | − "{NVidia,NForce Modem}," | |
| 39 | − "{NVidia,NForce2 Modem}," | |
| 40 | − "{NVidia,NForce2s Modem}," | |
| 41 | − "{NVidia,NForce3 Modem}," | |
| 42 | − "{AMD,AMD768}}"); | |
| 43 | 28 | |
| 44 | 29 | static int index = -2; /* Exclude the first card */ |
| 45 | 30 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -388,7 +388,6 @@ struct snd_korg1212 { · 387 unmodified lines | ||
| 388 | 388 | |
| 389 | 389 | MODULE_DESCRIPTION("korg1212"); |
| 390 | 390 | MODULE_LICENSE("GPL"); |
| 391 | −MODULE_SUPPORTED_DEVICE("{{KORG,korg1212}}"); | |
| 392 | 391 | MODULE_FIRMWARE("korg/k1212.dsp"); |
| 393 | 392 | |
| 394 | 393 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| @@ -54,7 +54,6 @@ MODULE_PARM_DESC(sample_rate_min, "Minimal sample rate"); · 53 unmodified lines | ||
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | MODULE_LICENSE("GPL"); |
| 57 | −MODULE_SUPPORTED_DEVICE("{{Digigram, Lola}}"); | |
| 58 | 57 | MODULE_DESCRIPTION("Digigram Lola driver"); |
| 59 | 58 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 60 | 59 | |
| @@ -21,8 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | MODULE_AUTHOR("Tim Blechmann"); |
| 22 | 22 | MODULE_LICENSE("GPL"); |
| 23 | 23 | MODULE_DESCRIPTION("digigram lx6464es"); |
| 24 | −MODULE_SUPPORTED_DEVICE("{digigram lx6464es{}}"); | |
| 25 | − | |
| 26 | 24 | |
| 27 | 25 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 28 | 26 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -39,11 +39,6 @@ · 38 unmodified lines | ||
| 39 | 39 | MODULE_AUTHOR("Zach Brown <zab@zabbo.net>, Takashi Iwai <tiwai@suse.de>"); |
| 40 | 40 | MODULE_DESCRIPTION("ESS Maestro3 PCI"); |
| 41 | 41 | MODULE_LICENSE("GPL"); |
| 42 | −MODULE_SUPPORTED_DEVICE("{{ESS,Maestro3 PCI}," | |
| 43 | − "{ESS,ES1988}," | |
| 44 | − "{ESS,Allegro PCI}," | |
| 45 | − "{ESS,Allegro-1 PCI}," | |
| 46 | − "{ESS,Canyon3D-2/LE PCI}}"); | |
| 47 | 42 | MODULE_FIRMWARE("ess/maestro3_assp_kernel.fw"); |
| 48 | 43 | MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw"); |
| 49 | 44 | |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | MODULE_AUTHOR("Digigram <alsa@digigram.com>"); |
| 33 | 33 | MODULE_DESCRIPTION("Digigram " CARD_NAME); |
| 34 | 34 | MODULE_LICENSE("GPL"); |
| 35 | −MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}"); | |
| 36 | 35 | |
| 37 | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 38 | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -32,8 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 33 | 33 | MODULE_DESCRIPTION("NeoMagic NM256AV/ZX"); |
| 34 | 34 | MODULE_LICENSE("GPL"); |
| 35 | −MODULE_SUPPORTED_DEVICE("{{NeoMagic,NM256AV}," | |
| 36 | − "{NeoMagic,NM256ZX}}"); | |
| 37 | 35 | |
| 38 | 36 | /* |
| 39 | 37 | * some compile conditions. |
| @@ -56,9 +56,6 @@ · 55 unmodified lines | ||
| 56 | 56 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 57 | 57 | MODULE_DESCRIPTION("C-Media CMI8788 driver"); |
| 58 | 58 | MODULE_LICENSE("GPL v2"); |
| 59 | −MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8786}" | |
| 60 | − ",{C-Media,CMI8787}" | |
| 61 | − ",{C-Media,CMI8788}}"); | |
| 62 | 59 | |
| 63 | 60 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 64 | 61 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 30 | 30 | MODULE_DESCRIPTION("Studio Evolution SE6X driver"); |
| 31 | 31 | MODULE_LICENSE("GPL v2"); |
| 32 | −MODULE_SUPPORTED_DEVICE("{{Studio Evolution,SE6X}}"); | |
| 33 | 32 | |
| 34 | 33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 35 | 34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -16,7 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 17 | 17 | MODULE_DESCRIPTION("Asus Virtuoso driver"); |
| 18 | 18 | MODULE_LICENSE("GPL v2"); |
| 19 | −MODULE_SUPPORTED_DEVICE("{{Asus,AV66},{Asus,AV100},{Asus,AV200}}"); | |
| 20 | 19 | |
| 21 | 20 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| 22 | 21 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
| @@ -35,7 +35,6 @@ MODULE_AUTHOR("Markus Bollinger <bollinger@digigram.com>, " · 34 unmodified lines | ||
| 35 | 35 | "Marc Titinger <titinger@digigram.com>"); |
| 36 | 36 | MODULE_DESCRIPTION("Digigram " DRIVER_NAME " " PCXHR_DRIVER_VERSION_STRING); |
| 37 | 37 | MODULE_LICENSE("GPL"); |
| 38 | −MODULE_SUPPORTED_DEVICE("{{Digigram," DRIVER_NAME "}}"); | |
| 39 | 38 | |
| 40 | 39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 41 | 40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -103,7 +103,6 @@ · 102 unmodified lines | ||
| 103 | 103 | MODULE_AUTHOR("Peter Gruber <nokos@gmx.net>"); |
| 104 | 104 | MODULE_DESCRIPTION("riptide"); |
| 105 | 105 | MODULE_LICENSE("GPL"); |
| 106 | −MODULE_SUPPORTED_DEVICE("{{Conexant,Riptide}}"); | |
| 107 | 106 | MODULE_FIRMWARE("riptide.hex"); |
| 108 | 107 | |
| 109 | 108 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
| @@ -88,7 +88,6 @@ MODULE_PARM_DESC(fullduplex, "Support full-duplex mode."); · 87 unmodified lines | ||
| 88 | 88 | MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>, Pilo Chambert <pilo.c@wanadoo.fr>"); |
| 89 | 89 | MODULE_DESCRIPTION("RME Digi32, Digi32/8, Digi32 PRO"); |
| 90 | 90 | MODULE_LICENSE("GPL"); |
| 91 | −MODULE_SUPPORTED_DEVICE("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}"); | |
| 92 | 91 | |
| 93 | 92 | /* Defines for RME Digi32 series */ |
| 94 | 93 | #define RME32_SPDIF_NCHANNELS 2 |
| @@ -31,11 +31,6 @@ MODULE_AUTHOR("Anders Torger <torger@ludd.luth.se>"); · 30 unmodified lines | ||
| 31 | 31 | MODULE_DESCRIPTION("RME Digi96, Digi96/8, Digi96/8 PRO, Digi96/8 PST, " |
| 32 | 32 | "Digi96/8 PAD"); |
| 33 | 33 | MODULE_LICENSE("GPL"); |
| 34 | −MODULE_SUPPORTED_DEVICE("{{RME,Digi96}," | |
| 35 | − "{RME,Digi96/8}," | |
| 36 | − "{RME,Digi96/8 PRO}," | |
| 37 | − "{RME,Digi96/8 PST}," | |
| 38 | − "{RME,Digi96/8 PAD}}"); | |
| 39 | 34 | |
| 40 | 35 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 41 | 36 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -44,9 +44,6 @@ MODULE_PARM_DESC(enable, "Enable/disable specific Hammerfall DSP soundcards."); · 43 unmodified lines | ||
| 44 | 44 | MODULE_AUTHOR("Paul Davis <paul@linuxaudiosystems.com>, Marcus Andersson, Thomas Charbonnel <thomas@undata.org>"); |
| 45 | 45 | MODULE_DESCRIPTION("RME Hammerfall DSP"); |
| 46 | 46 | MODULE_LICENSE("GPL"); |
| 47 | −MODULE_SUPPORTED_DEVICE("{{RME Hammerfall-DSP}," | |
| 48 | − "{RME HDSP-9652}," | |
| 49 | − "{RME HDSP-9632}}"); | |
| 50 | 47 | MODULE_FIRMWARE("rpm_firmware.bin"); |
| 51 | 48 | MODULE_FIRMWARE("multiface_firmware.bin"); |
| 52 | 49 | MODULE_FIRMWARE("multiface_firmware_rev11.bin"); |
| @@ -165,7 +165,6 @@ MODULE_AUTHOR · 164 unmodified lines | ||
| 165 | 165 | ); |
| 166 | 166 | MODULE_DESCRIPTION("RME HDSPM"); |
| 167 | 167 | MODULE_LICENSE("GPL"); |
| 168 | −MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}"); | |
| 169 | 168 | |
| 170 | 169 | /* --- Write registers. --- |
| 171 | 170 | These are defined as byte-offsets from the iobase value. */ |
| @@ -39,8 +39,6 @@ MODULE_PARM_DESC(precise_ptr, "Enable precise pointer (doesn't work reliably).") · 38 unmodified lines | ||
| 39 | 39 | MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch"); |
| 40 | 40 | MODULE_DESCRIPTION("RME Digi9652/Digi9636"); |
| 41 | 41 | MODULE_LICENSE("GPL"); |
| 42 | −MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall}," | |
| 43 | − "{RME,Hammerfall-Light}}"); | |
| 44 | 42 | |
| 45 | 43 | /* The Hammerfall has two sets of 24 ADAT + 2 S/PDIF channels, one for |
| 46 | 44 | capture, one for playback. Both the ADAT and S/PDIF channels appear |
| @@ -24,7 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | MODULE_AUTHOR("David Dillow <dave@thedillows.org>"); |
| 25 | 25 | MODULE_DESCRIPTION("SiS7019"); |
| 26 | 26 | MODULE_LICENSE("GPL"); |
| 27 | −MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}"); | |
| 28 | 27 | |
| 29 | 28 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| 30 | 29 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 30 | 30 | MODULE_DESCRIPTION("S3 SonicVibes PCI"); |
| 31 | 31 | MODULE_LICENSE("GPL"); |
| 32 | −MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}"); | |
| 33 | 32 | |
| 34 | 33 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 35 | 34 | #define SUPPORT_JOYSTICK 1 |
| @@ -17,18 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>"); |
| 18 | 18 | MODULE_DESCRIPTION("Trident 4D-WaveDX/NX & SiS SI7018"); |
| 19 | 19 | MODULE_LICENSE("GPL"); |
| 20 | −MODULE_SUPPORTED_DEVICE("{{Trident,4DWave DX}," | |
| 21 | − "{Trident,4DWave NX}," | |
| 22 | − "{SiS,SI7018 PCI Audio}," | |
| 23 | − "{Best Union,Miss Melody 4DWave PCI}," | |
| 24 | − "{HIS,4DWave PCI}," | |
| 25 | − "{Warpspeed,ONSpeed 4DWave PCI}," | |
| 26 | − "{Aztech Systems,PCI 64-Q3D}," | |
| 27 | − "{Addonics,SV 750}," | |
| 28 | − "{CHIC,True Sound 4Dwave}," | |
| 29 | − "{Shark,Predator4D-PCI}," | |
| 30 | − "{Jaton,SonicWave 4D}," | |
| 31 | − "{Hoontech,SoundTrack Digital 4DWave NX}}"); | |
| 32 | 20 | |
| 33 | 21 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 34 | 22 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -56,7 +56,6 @@ · 55 unmodified lines | ||
| 56 | 56 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 57 | 57 | MODULE_DESCRIPTION("VIA VT82xx audio"); |
| 58 | 58 | MODULE_LICENSE("GPL"); |
| 59 | −MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}"); | |
| 60 | 59 | |
| 61 | 60 | #if IS_REACHABLE(CONFIG_GAMEPORT) |
| 62 | 61 | #define SUPPORT_JOYSTICK 1 |
| @@ -38,7 +38,6 @@ · 37 unmodified lines | ||
| 38 | 38 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 39 | 39 | MODULE_DESCRIPTION("VIA VT82xx modem"); |
| 40 | 40 | MODULE_LICENSE("GPL"); |
| 41 | −MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C modem,pci}}"); | |
| 42 | 41 | |
| 43 | 42 | static int index = -2; /* Exclude the first card */ |
| 44 | 43 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 21 | 21 | MODULE_DESCRIPTION("Digigram VX222 V2/Mic"); |
| 22 | 22 | MODULE_LICENSE("GPL"); |
| 23 | −MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}"); | |
| 24 | 23 | |
| 25 | 24 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 26 | 25 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -17,12 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 18 | 18 | MODULE_DESCRIPTION("Yamaha DS-1 PCI"); |
| 19 | 19 | MODULE_LICENSE("GPL"); |
| 20 | −MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF724}," | |
| 21 | − "{Yamaha,YMF724F}," | |
| 22 | − "{Yamaha,YMF740}," | |
| 23 | − "{Yamaha,YMF740C}," | |
| 24 | − "{Yamaha,YMF744}," | |
| 25 | − "{Yamaha,YMF754}}"); | |
| 26 | 20 | |
| 27 | 21 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 28 | 22 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
| 23 | 23 | MODULE_DESCRIPTION("Sound Core " CARD_NAME); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | −MODULE_SUPPORTED_DEVICE("{{Sound Core," CARD_NAME "}}"); | |
| 26 | 25 | |
| 27 | 26 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 28 | 27 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -17,13 +17,9 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <sound/initval.h> |
| 18 | 18 | #include <sound/tlv.h> |
| 19 | 19 | |
| 20 | −/* | |
| 21 | − */ | |
| 22 | − | |
| 23 | 20 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 24 | 21 | MODULE_DESCRIPTION("Digigram VXPocket"); |
| 25 | 22 | MODULE_LICENSE("GPL"); |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Digigram,VXPocket},{Digigram,VXPocket440}}"); | |
| 27 | 23 | |
| 28 | 24 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 29 | 25 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -18,7 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | #define CHIP_NAME "PMac" |
| 19 | 19 | |
| 20 | 20 | MODULE_DESCRIPTION("PowerMac"); |
| 21 | −MODULE_SUPPORTED_DEVICE("{{Apple,PowerMac}}"); | |
| 22 | 21 | MODULE_LICENSE("GPL"); |
| 23 | 22 | |
| 24 | 23 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); |
| 33 | 33 | MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver"); |
| 34 | 34 | MODULE_LICENSE("GPL"); |
| 35 | −MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}"); | |
| 36 | 35 | MODULE_FIRMWARE("aica_firmware.bin"); |
| 37 | 36 | |
| 38 | 37 | /* module parameters */ |
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | MODULE_AUTHOR("Rafael Ignacio Zurita <rizurita@yahoo.com>"); |
| 26 | 26 | MODULE_DESCRIPTION("SuperH DAC audio driver"); |
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | −MODULE_SUPPORTED_DEVICE("{{SuperH DAC audio support}}"); | |
| 29 | 28 | |
| 30 | 29 | /* Module Parameters */ |
| 31 | 30 | static int index = SNDRV_DEFAULT_IDX1; |
| @@ -186,7 +186,6 @@ config SND_SOC_ALL_CODECS · 185 unmodified lines | ||
| 186 | 186 | imply SND_SOC_SI476X |
| 187 | 187 | imply SND_SOC_SIMPLE_AMPLIFIER |
| 188 | 188 | imply SND_SOC_SIMPLE_MUX |
| 189 | − imply SND_SOC_SIRF_AUDIO_CODEC | |
| 190 | 189 | imply SND_SOC_SPDIF |
| 191 | 190 | imply SND_SOC_SSM2305 |
| 192 | 191 | imply SND_SOC_SSM2518 |
| @@ -1279,10 +1278,6 @@ config SND_SOC_SIMPLE_MUX · 1086 unmodified lines | ||
| 1279 | 1278 | tristate "Simple Audio Mux" |
| 1280 | 1279 | select GPIOLIB |
| 1281 | 1280 | |
| 1282 | −config SND_SOC_SIRF_AUDIO_CODEC | |
| 1283 | − tristate "SiRF SoC internal audio codec" | |
| 1284 | − select REGMAP_MMIO | |
| 1285 | − | |
| 1286 | 1281 | config SND_SOC_SPDIF |
| 1287 | 1282 | tristate "S/PDIF CODEC" |
| 1288 | 1283 | |
| @@ -812,6 +812,7 @@ static const struct of_device_id ak4458_of_match[] = { · 811 unmodified lines | ||
| 812 | 812 | { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata}, |
| 813 | 813 | { }, |
| 814 | 814 | }; |
| 815 | +MODULE_DEVICE_TABLE(of, ak4458_of_match); | |
| 815 | 816 | |
| 816 | 817 | static struct i2c_driver ak4458_i2c_driver = { |
| 817 | 818 | .driver = { |
| @@ -419,6 +419,7 @@ static const struct of_device_id ak5558_i2c_dt_ids[] __maybe_unused = { · 418 unmodified lines | ||
| 419 | 419 | { .compatible = "asahi-kasei,ak5558"}, |
| 420 | 420 | { } |
| 421 | 421 | }; |
| 422 | +MODULE_DEVICE_TABLE(of, ak5558_i2c_dt_ids); | |
| 422 | 423 | |
| 423 | 424 | static struct i2c_driver ak5558_i2c_driver = { |
| 424 | 425 | .driver = { |
| @@ -401,7 +401,7 @@ static const struct regmap_config cs42l42_regmap = { · 400 unmodified lines | ||
| 401 | 401 | }; |
| 402 | 402 | |
| 403 | 403 | static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false); |
| 404 | −static DECLARE_TLV_DB_SCALE(mixer_tlv, -6200, 100, false); | |
| 404 | +static DECLARE_TLV_DB_SCALE(mixer_tlv, -6300, 100, true); | |
| 405 | 405 | |
| 406 | 406 | static const char * const cs42l42_hpf_freq_text[] = { |
| 407 | 407 | "1.86Hz", "120Hz", "235Hz", "466Hz" |
| @@ -458,7 +458,7 @@ static const struct snd_kcontrol_new cs42l42_snd_controls[] = { · 50 unmodified lines | ||
| 458 | 458 | CS42L42_DAC_HPF_EN_SHIFT, true, false), |
| 459 | 459 | SOC_DOUBLE_R_TLV("Mixer Volume", CS42L42_MIXER_CHA_VOL, |
| 460 | 460 | CS42L42_MIXER_CHB_VOL, CS42L42_MIXER_CH_VOL_SHIFT, |
| 461 | − 0x3e, 1, mixer_tlv) | |
| 461 | + 0x3f, 1, mixer_tlv) | |
| 462 | 462 | }; |
| 463 | 463 | |
| 464 | 464 | static int cs42l42_hpdrv_evt(struct snd_soc_dapm_widget *w, |
| @@ -511,43 +511,6 @@ static const struct snd_soc_dapm_route cs42l42_audio_map[] = { · 46 unmodified lines | ||
| 511 | 511 | {"HP", NULL, "HPDRV"} |
| 512 | 512 | }; |
| 513 | 513 | |
| 514 | −static int cs42l42_set_bias_level(struct snd_soc_component *component, | |
| 515 | − enum snd_soc_bias_level level) | |
| 516 | −{ | |
| 517 | − struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); | |
| 518 | − int ret; | |
| 519 | − | |
| 520 | − switch (level) { | |
| 521 | − case SND_SOC_BIAS_ON: | |
| 522 | − break; | |
| 523 | − case SND_SOC_BIAS_PREPARE: | |
| 524 | − break; | |
| 525 | − case SND_SOC_BIAS_STANDBY: | |
| 526 | − if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { | |
| 527 | − regcache_cache_only(cs42l42->regmap, false); | |
| 528 | − regcache_sync(cs42l42->regmap); | |
| 529 | − ret = regulator_bulk_enable( | |
| 530 | − ARRAY_SIZE(cs42l42->supplies), | |
| 531 | − cs42l42->supplies); | |
| 532 | − if (ret != 0) { | |
| 533 | − dev_err(component->dev, | |
| 534 | − "Failed to enable regulators: %d\n", | |
| 535 | − ret); | |
| 536 | − return ret; | |
| 537 | − } | |
| 538 | − } | |
| 539 | − break; | |
| 540 | − case SND_SOC_BIAS_OFF: | |
| 541 | − | |
| 542 | − regcache_cache_only(cs42l42->regmap, true); | |
| 543 | − regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), | |
| 544 | − cs42l42->supplies); | |
| 545 | − break; | |
| 546 | − } | |
| 547 | − | |
| 548 | − return 0; | |
| 549 | −} | |
| 550 | − | |
| 551 | 514 | static int cs42l42_component_probe(struct snd_soc_component *component) |
| 552 | 515 | { |
| 553 | 516 | struct cs42l42_private *cs42l42 = |
| @@ -560,7 +523,6 @@ static int cs42l42_component_probe(struct snd_soc_component *component) · 6 unmodified lines | ||
| 560 | 523 | |
| 561 | 524 | static const struct snd_soc_component_driver soc_component_dev_cs42l42 = { |
| 562 | 525 | .probe = cs42l42_component_probe, |
| 563 | − .set_bias_level = cs42l42_set_bias_level, | |
| 564 | 526 | .dapm_widgets = cs42l42_dapm_widgets, |
| 565 | 527 | .num_dapm_widgets = ARRAY_SIZE(cs42l42_dapm_widgets), |
| 566 | 528 | .dapm_routes = cs42l42_audio_map, |
| @@ -691,24 +653,6 @@ static int cs42l42_pll_config(struct snd_soc_component *component) · 124 unmodified lines | ||
| 691 | 653 | CS42L42_CLK_OASRC_SEL_MASK, |
| 692 | 654 | CS42L42_CLK_OASRC_SEL_12 << |
| 693 | 655 | CS42L42_CLK_OASRC_SEL_SHIFT); |
| 694 | − /* channel 1 on low LRCLK, 32 bit */ | |
| 695 | − snd_soc_component_update_bits(component, | |
| 696 | − CS42L42_ASP_RX_DAI0_CH1_AP_RES, | |
| 697 | − CS42L42_ASP_RX_CH_AP_MASK | | |
| 698 | − CS42L42_ASP_RX_CH_RES_MASK, | |
| 699 | − (CS42L42_ASP_RX_CH_AP_LOW << | |
| 700 | − CS42L42_ASP_RX_CH_AP_SHIFT) | | |
| 701 | − (CS42L42_ASP_RX_CH_RES_32 << | |
| 702 | − CS42L42_ASP_RX_CH_RES_SHIFT)); | |
| 703 | − /* Channel 2 on high LRCLK, 32 bit */ | |
| 704 | − snd_soc_component_update_bits(component, | |
| 705 | − CS42L42_ASP_RX_DAI0_CH2_AP_RES, | |
| 706 | − CS42L42_ASP_RX_CH_AP_MASK | | |
| 707 | − CS42L42_ASP_RX_CH_RES_MASK, | |
| 708 | − (CS42L42_ASP_RX_CH_AP_HI << | |
| 709 | − CS42L42_ASP_RX_CH_AP_SHIFT) | | |
| 710 | − (CS42L42_ASP_RX_CH_RES_32 << | |
| 711 | − CS42L42_ASP_RX_CH_RES_SHIFT)); | |
| 712 | 656 | if (pll_ratio_table[i].mclk_src_sel == 0) { |
| 713 | 657 | /* Pass the clock straight through */ |
| 714 | 658 | snd_soc_component_update_bits(component, |
| @@ -797,27 +741,23 @@ static int cs42l42_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) · 82 unmodified lines | ||
| 797 | 741 | /* Bitclock/frame inversion */ |
| 798 | 742 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { |
| 799 | 743 | case SND_SOC_DAIFMT_NB_NF: |
| 744 | + asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT; | |
| 800 | 745 | break; |
| 801 | 746 | case SND_SOC_DAIFMT_NB_IF: |
| 802 | − asp_cfg_val |= CS42L42_ASP_POL_INV << | |
| 803 | − CS42L42_ASP_LCPOL_IN_SHIFT; | |
| 747 | + asp_cfg_val |= CS42L42_ASP_SCPOL_NOR << CS42L42_ASP_SCPOL_SHIFT; | |
| 748 | + asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT; | |
| 804 | 749 | break; |
| 805 | 750 | case SND_SOC_DAIFMT_IB_NF: |
| 806 | − asp_cfg_val |= CS42L42_ASP_POL_INV << | |
| 807 | − CS42L42_ASP_SCPOL_IN_DAC_SHIFT; | |
| 808 | 751 | break; |
| 809 | 752 | case SND_SOC_DAIFMT_IB_IF: |
| 810 | − asp_cfg_val |= CS42L42_ASP_POL_INV << | |
| 811 | − CS42L42_ASP_LCPOL_IN_SHIFT; | |
| 812 | − asp_cfg_val |= CS42L42_ASP_POL_INV << | |
| 813 | − CS42L42_ASP_SCPOL_IN_DAC_SHIFT; | |
| 753 | + asp_cfg_val |= CS42L42_ASP_LCPOL_INV << CS42L42_ASP_LCPOL_SHIFT; | |
| 814 | 754 | break; |
| 815 | 755 | } |
| 816 | 756 | |
| 817 | − snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG, | |
| 818 | − CS42L42_ASP_MODE_MASK | | |
| 819 | − CS42L42_ASP_SCPOL_IN_DAC_MASK | | |
| 820 | − CS42L42_ASP_LCPOL_IN_MASK, asp_cfg_val); | |
| 757 | + snd_soc_component_update_bits(component, CS42L42_ASP_CLK_CFG, CS42L42_ASP_MODE_MASK | | |
| 758 | + CS42L42_ASP_SCPOL_MASK | | |
| 759 | + CS42L42_ASP_LCPOL_MASK, | |
| 760 | + asp_cfg_val); | |
| 821 | 761 | |
| 822 | 762 | return 0; |
| 823 | 763 | } |
| @@ -828,14 +768,29 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream, · 4 unmodified lines | ||
| 828 | 768 | { |
| 829 | 769 | struct snd_soc_component *component = dai->component; |
| 830 | 770 | struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); |
| 831 | − int retval; | |
| 771 | + unsigned int width = (params_width(params) / 8) - 1; | |
| 772 | + unsigned int val = 0; | |
| 832 | 773 | |
| 833 | 774 | cs42l42->srate = params_rate(params); |
| 834 | − cs42l42->swidth = params_width(params); | |
| 835 | 775 | |
| 836 | − retval = cs42l42_pll_config(component); | |
| 776 | + switch(substream->stream) { | |
| 777 | + case SNDRV_PCM_STREAM_PLAYBACK: | |
| 778 | + val |= width << CS42L42_ASP_RX_CH_RES_SHIFT; | |
| 779 | + /* channel 1 on low LRCLK */ | |
| 780 | + snd_soc_component_update_bits(component, CS42L42_ASP_RX_DAI0_CH1_AP_RES, | |
| 781 | + CS42L42_ASP_RX_CH_AP_MASK | | |
| 782 | + CS42L42_ASP_RX_CH_RES_MASK, val); | |
| 783 | + /* Channel 2 on high LRCLK */ | |
| 784 | + val |= CS42L42_ASP_RX_CH_AP_HI << CS42L42_ASP_RX_CH_AP_SHIFT; | |
| 785 | + snd_soc_component_update_bits(component, CS42L42_ASP_RX_DAI0_CH2_AP_RES, | |
| 786 | + CS42L42_ASP_RX_CH_AP_MASK | | |
| 787 | + CS42L42_ASP_RX_CH_RES_MASK, val); | |
| 788 | + break; | |
| 789 | + default: | |
| 790 | + break; | |
| 791 | + } | |
| 837 | 792 | |
| 838 | − return retval; | |
| 793 | + return cs42l42_pll_config(component); | |
| 839 | 794 | } |
| 840 | 795 | |
| 841 | 796 | static int cs42l42_set_sysclk(struct snd_soc_dai *dai, |
| @@ -900,9 +855,9 @@ static int cs42l42_mute(struct snd_soc_dai *dai, int mute, int direction) · 58 unmodified lines | ||
| 900 | 855 | return 0; |
| 901 | 856 | } |
| 902 | 857 | |
| 903 | −#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \ | |
| 904 | − SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | \ | |
| 905 | − SNDRV_PCM_FMTBIT_S32_LE) | |
| 858 | +#define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ | |
| 859 | + SNDRV_PCM_FMTBIT_S24_LE |\ | |
| 860 | + SNDRV_PCM_FMTBIT_S32_LE ) | |
| 906 | 861 | |
| 907 | 862 | |
| 908 | 863 | static const struct snd_soc_dai_ops cs42l42_ops = { |
| @@ -1801,7 +1756,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client, · 892 unmodified lines | ||
| 1801 | 1756 | dev_dbg(&i2c_client->dev, "Found reset GPIO\n"); |
| 1802 | 1757 | gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); |
| 1803 | 1758 | } |
| 1804 | − mdelay(3); | |
| 1759 | + usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2); | |
| 1805 | 1760 | |
| 1806 | 1761 | /* Request IRQ */ |
| 1807 | 1762 | ret = devm_request_threaded_irq(&i2c_client->dev, |
| @@ -1926,6 +1881,7 @@ static int cs42l42_runtime_resume(struct device *dev) · 118 unmodified lines | ||
| 1926 | 1881 | } |
| 1927 | 1882 | |
| 1928 | 1883 | gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); |
| 1884 | + usleep_range(CS42L42_BOOT_TIME_US, CS42L42_BOOT_TIME_US * 2); | |
| 1929 | 1885 | |
| 1930 | 1886 | regcache_cache_only(cs42l42->regmap, false); |
| 1931 | 1887 | regcache_sync(cs42l42->regmap); |
| @@ -258,11 +258,12 @@ · 257 unmodified lines | ||
| 258 | 258 | #define CS42L42_ASP_SLAVE_MODE 0x00 |
| 259 | 259 | #define CS42L42_ASP_MODE_SHIFT 4 |
| 260 | 260 | #define CS42L42_ASP_MODE_MASK (1 << CS42L42_ASP_MODE_SHIFT) |
| 261 | −#define CS42L42_ASP_SCPOL_IN_DAC_SHIFT 2 | |
| 262 | −#define CS42L42_ASP_SCPOL_IN_DAC_MASK (1 << CS42L42_ASP_SCPOL_IN_DAC_SHIFT) | |
| 263 | −#define CS42L42_ASP_LCPOL_IN_SHIFT 0 | |
| 264 | −#define CS42L42_ASP_LCPOL_IN_MASK (1 << CS42L42_ASP_LCPOL_IN_SHIFT) | |
| 265 | −#define CS42L42_ASP_POL_INV 1 | |
| 261 | +#define CS42L42_ASP_SCPOL_SHIFT 2 | |
| 262 | +#define CS42L42_ASP_SCPOL_MASK (3 << CS42L42_ASP_SCPOL_SHIFT) | |
| 263 | +#define CS42L42_ASP_SCPOL_NOR 3 | |
| 264 | +#define CS42L42_ASP_LCPOL_SHIFT 0 | |
| 265 | +#define CS42L42_ASP_LCPOL_MASK (3 << CS42L42_ASP_LCPOL_SHIFT) | |
| 266 | +#define CS42L42_ASP_LCPOL_INV 3 | |
| 266 | 267 | |
| 267 | 268 | #define CS42L42_ASP_FRM_CFG (CS42L42_PAGE_12 + 0x08) |
| 268 | 269 | #define CS42L42_ASP_STP_SHIFT 4 |
| @@ -739,6 +740,7 @@ · 470 unmodified lines | ||
| 739 | 740 | #define CS42L42_FRAC2_VAL(val) (((val) & 0xff0000) >> 16) |
| 740 | 741 | |
| 741 | 742 | #define CS42L42_NUM_SUPPLIES 5 |
| 743 | +#define CS42L42_BOOT_TIME_US 3000 | |
| 742 | 744 | |
| 743 | 745 | static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = { |
| 744 | 746 | "VA", |
| @@ -756,7 +758,6 @@ struct cs42l42_private { · 11 unmodified lines | ||
| 756 | 758 | struct completion pdn_done; |
| 757 | 759 | u32 sclk; |
| 758 | 760 | u32 srate; |
| 759 | − u32 swidth; | |
| 760 | 761 | u8 plug_state; |
| 761 | 762 | u8 hs_type; |
| 762 | 763 | u8 ts_inv; |
| @@ -63,13 +63,8 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(adc_pga_gain_tlv, · 62 unmodified lines | ||
| 63 | 63 | 1, 1, TLV_DB_SCALE_ITEM(0, 0, 0), |
| 64 | 64 | 2, 2, TLV_DB_SCALE_ITEM(250, 0, 0), |
| 65 | 65 | 3, 3, TLV_DB_SCALE_ITEM(450, 0, 0), |
| 66 | − 4, 4, TLV_DB_SCALE_ITEM(700, 0, 0), | |
| 67 | − 5, 5, TLV_DB_SCALE_ITEM(1000, 0, 0), | |
| 68 | − 6, 6, TLV_DB_SCALE_ITEM(1300, 0, 0), | |
| 69 | − 7, 7, TLV_DB_SCALE_ITEM(1600, 0, 0), | |
| 70 | − 8, 8, TLV_DB_SCALE_ITEM(1800, 0, 0), | |
| 71 | − 9, 9, TLV_DB_SCALE_ITEM(2100, 0, 0), | |
| 72 | − 10, 10, TLV_DB_SCALE_ITEM(2400, 0, 0), | |
| 66 | + 4, 7, TLV_DB_SCALE_ITEM(700, 300, 0), | |
| 67 | + 8, 10, TLV_DB_SCALE_ITEM(1800, 300, 0), | |
| 73 | 68 | ); |
| 74 | 69 | |
| 75 | 70 | static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpout_vol_tlv, |
| @@ -2895,7 +2895,7 @@ static int rx_macro_enable_echo(struct snd_soc_dapm_widget *w, · 2894 unmodified lines | ||
| 2895 | 2895 | { |
| 2896 | 2896 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
| 2897 | 2897 | u16 val, ec_hq_reg; |
| 2898 | − int ec_tx; | |
| 2898 | + int ec_tx = -1; | |
| 2899 | 2899 | |
| 2900 | 2900 | val = snd_soc_component_read(component, |
| 2901 | 2901 | CDC_RX_INP_MUX_RX_MIX_CFG4); |
| @@ -189,7 +189,6 @@ struct va_macro { · 188 unmodified lines | ||
| 189 | 189 | struct device *dev; |
| 190 | 190 | unsigned long active_ch_mask[VA_MACRO_MAX_DAIS]; |
| 191 | 191 | unsigned long active_ch_cnt[VA_MACRO_MAX_DAIS]; |
| 192 | − unsigned long active_decimator[VA_MACRO_MAX_DAIS]; | |
| 193 | 192 | u16 dmic_clk_div; |
| 194 | 193 | |
| 195 | 194 | int dec_mode[VA_MACRO_NUM_DECIMATORS]; |
| @@ -549,11 +548,9 @@ static int va_macro_tx_mixer_put(struct snd_kcontrol *kcontrol, · 353 unmodified lines | ||
| 549 | 548 | if (enable) { |
| 550 | 549 | set_bit(dec_id, &va->active_ch_mask[dai_id]); |
| 551 | 550 | va->active_ch_cnt[dai_id]++; |
| 552 | − va->active_decimator[dai_id] = dec_id; | |
| 553 | 551 | } else { |
| 554 | 552 | clear_bit(dec_id, &va->active_ch_mask[dai_id]); |
| 555 | 553 | va->active_ch_cnt[dai_id]--; |
| 556 | − va->active_decimator[dai_id] = -1; | |
| 557 | 554 | } |
| 558 | 555 | |
| 559 | 556 | snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, enable, update); |
| @@ -880,18 +877,19 @@ static int va_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream) · 320 unmodified lines | ||
| 880 | 877 | struct va_macro *va = snd_soc_component_get_drvdata(component); |
| 881 | 878 | u16 tx_vol_ctl_reg, decimator; |
| 882 | 879 | |
| 883 | − decimator = va->active_decimator[dai->id]; | |
| 884 | − | |
| 885 | − tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL + | |
| 886 | − VA_MACRO_TX_PATH_OFFSET * decimator; | |
| 887 | − if (mute) | |
| 888 | − snd_soc_component_update_bits(component, tx_vol_ctl_reg, | |
| 889 | − CDC_VA_TX_PATH_PGA_MUTE_EN_MASK, | |
| 890 | − CDC_VA_TX_PATH_PGA_MUTE_EN); | |
| 891 | − else | |
| 892 | − snd_soc_component_update_bits(component, tx_vol_ctl_reg, | |
| 893 | − CDC_VA_TX_PATH_PGA_MUTE_EN_MASK, | |
| 894 | − CDC_VA_TX_PATH_PGA_MUTE_DISABLE); | |
| 880 | + for_each_set_bit(decimator, &va->active_ch_mask[dai->id], | |
| 881 | + VA_MACRO_DEC_MAX) { | |
| 882 | + tx_vol_ctl_reg = CDC_VA_TX0_TX_PATH_CTL + | |
| 883 | + VA_MACRO_TX_PATH_OFFSET * decimator; | |
| 884 | + if (mute) | |
| 885 | + snd_soc_component_update_bits(component, tx_vol_ctl_reg, | |
| 886 | + CDC_VA_TX_PATH_PGA_MUTE_EN_MASK, | |
| 887 | + CDC_VA_TX_PATH_PGA_MUTE_EN); | |
| 888 | + else | |
| 889 | + snd_soc_component_update_bits(component, tx_vol_ctl_reg, | |
| 890 | + CDC_VA_TX_PATH_PGA_MUTE_EN_MASK, | |
| 891 | + CDC_VA_TX_PATH_PGA_MUTE_DISABLE); | |
| 892 | + } | |
| 895 | 893 | |
| 896 | 894 | return 0; |
| 897 | 895 | } |
| @@ -1211,14 +1211,16 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, · 1210 unmodified lines | ||
| 1211 | 1211 | struct snd_kcontrol *kcontrol, int event) |
| 1212 | 1212 | { |
| 1213 | 1213 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
| 1214 | − u16 gain_reg; | |
| 1214 | + u16 path_reg, gain_reg; | |
| 1215 | 1215 | int val; |
| 1216 | 1216 | |
| 1217 | − switch (w->reg) { | |
| 1218 | − case CDC_WSA_RX0_RX_PATH_MIX_CTL: | |
| 1217 | + switch (w->shift) { | |
| 1218 | + case WSA_MACRO_RX_MIX0: | |
| 1219 | + path_reg = CDC_WSA_RX0_RX_PATH_MIX_CTL; | |
| 1219 | 1220 | gain_reg = CDC_WSA_RX0_RX_VOL_MIX_CTL; |
| 1220 | 1221 | break; |
| 1221 | − case CDC_WSA_RX1_RX_PATH_MIX_CTL: | |
| 1222 | + case WSA_MACRO_RX_MIX1: | |
| 1223 | + path_reg = CDC_WSA_RX1_RX_PATH_MIX_CTL; | |
| 1222 | 1224 | gain_reg = CDC_WSA_RX1_RX_VOL_MIX_CTL; |
| 1223 | 1225 | break; |
| 1224 | 1226 | default: |
| @@ -1231,7 +1233,7 @@ static int wsa_macro_enable_mix_path(struct snd_soc_dapm_widget *w, · 6 unmodified lines | ||
| 1231 | 1233 | snd_soc_component_write(component, gain_reg, val); |
| 1232 | 1234 | break; |
| 1233 | 1235 | case SND_SOC_DAPM_POST_PMD: |
| 1234 | − snd_soc_component_update_bits(component, w->reg, | |
| 1236 | + snd_soc_component_update_bits(component, path_reg, | |
| 1235 | 1237 | CDC_WSA_RX_PATH_MIX_CLK_EN_MASK, |
| 1236 | 1238 | CDC_WSA_RX_PATH_MIX_CLK_DISABLE); |
| 1237 | 1239 | break; |
| @@ -2068,14 +2070,14 @@ static const struct snd_soc_dapm_widget wsa_macro_dapm_widgets[] = { · 830 unmodified lines | ||
| 2068 | 2070 | SND_SOC_DAPM_MUX("WSA_RX0 INP0", SND_SOC_NOPM, 0, 0, &rx0_prim_inp0_mux), |
| 2069 | 2071 | SND_SOC_DAPM_MUX("WSA_RX0 INP1", SND_SOC_NOPM, 0, 0, &rx0_prim_inp1_mux), |
| 2070 | 2072 | SND_SOC_DAPM_MUX("WSA_RX0 INP2", SND_SOC_NOPM, 0, 0, &rx0_prim_inp2_mux), |
| 2071 | − SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", CDC_WSA_RX0_RX_PATH_MIX_CTL, | |
| 2072 | − 0, 0, &rx0_mix_mux, wsa_macro_enable_mix_path, | |
| 2073 | + SND_SOC_DAPM_MUX_E("WSA_RX0 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX0, | |
| 2074 | + 0, &rx0_mix_mux, wsa_macro_enable_mix_path, | |
| 2073 | 2075 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
| 2074 | 2076 | SND_SOC_DAPM_MUX("WSA_RX1 INP0", SND_SOC_NOPM, 0, 0, &rx1_prim_inp0_mux), |
| 2075 | 2077 | SND_SOC_DAPM_MUX("WSA_RX1 INP1", SND_SOC_NOPM, 0, 0, &rx1_prim_inp1_mux), |
| 2076 | 2078 | SND_SOC_DAPM_MUX("WSA_RX1 INP2", SND_SOC_NOPM, 0, 0, &rx1_prim_inp2_mux), |
| 2077 | − SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", CDC_WSA_RX1_RX_PATH_MIX_CTL, | |
| 2078 | − 0, 0, &rx1_mix_mux, wsa_macro_enable_mix_path, | |
| 2079 | + SND_SOC_DAPM_MUX_E("WSA_RX1 MIX INP", SND_SOC_NOPM, WSA_MACRO_RX_MIX1, | |
| 2080 | + 0, &rx1_mix_mux, wsa_macro_enable_mix_path, | |
| 2079 | 2081 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
| 2080 | 2082 | |
| 2081 | 2083 | SND_SOC_DAPM_MIXER_E("WSA_RX INT0 MIX", SND_SOC_NOPM, 0, 0, NULL, 0, |
| @@ -209,6 +209,7 @@ static bool rt1015_volatile_register(struct device *dev, unsigned int reg) · 208 unmodified lines | ||
| 209 | 209 | case RT1015_VENDOR_ID: |
| 210 | 210 | case RT1015_DEVICE_ID: |
| 211 | 211 | case RT1015_PRO_ALT: |
| 212 | + case RT1015_MAN_I2C: | |
| 212 | 213 | case RT1015_DAC3: |
| 213 | 214 | case RT1015_VBAT_TEST_OUT1: |
| 214 | 215 | case RT1015_VBAT_TEST_OUT2: |
| @@ -513,6 +514,7 @@ static void rt1015_calibrate(struct rt1015_priv *rt1015) · 298 unmodified lines | ||
| 513 | 514 | msleep(300); |
| 514 | 515 | regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008); |
| 515 | 516 | regmap_write(regmap, RT1015_SYS_RST1, 0x05F5); |
| 517 | + regmap_write(regmap, RT1015_CLK_DET, 0x8000); | |
| 516 | 518 | |
| 517 | 519 | regcache_cache_bypass(regmap, false); |
| 518 | 520 | regcache_mark_dirty(regmap); |
| @@ -339,9 +339,9 @@ static bool rt5640_readable_register(struct device *dev, unsigned int reg) · 338 unmodified lines | ||
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); |
| 342 | −static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); | |
| 342 | +static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0); | |
| 343 | 343 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); |
| 344 | −static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); | |
| 344 | +static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000); | |
| 345 | 345 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); |
| 346 | 346 | |
| 347 | 347 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ |
| @@ -285,9 +285,9 @@ static bool rt5651_readable_register(struct device *dev, unsigned int reg) · 284 unmodified lines | ||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); |
| 288 | −static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); | |
| 288 | +static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0); | |
| 289 | 289 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); |
| 290 | −static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); | |
| 290 | +static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000); | |
| 291 | 291 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); |
| 292 | 292 | |
| 293 | 293 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ |
| @@ -3426,12 +3426,17 @@ static int rt5659_set_component_sysclk(struct snd_soc_component *component, int · 3425 unmodified lines | ||
| 3426 | 3426 | { |
| 3427 | 3427 | struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component); |
| 3428 | 3428 | unsigned int reg_val = 0; |
| 3429 | + int ret; | |
| 3429 | 3430 | |
| 3430 | 3431 | if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src) |
| 3431 | 3432 | return 0; |
| 3432 | 3433 | |
| 3433 | 3434 | switch (clk_id) { |
| 3434 | 3435 | case RT5659_SCLK_S_MCLK: |
| 3436 | + ret = clk_set_rate(rt5659->mclk, freq); | |
| 3437 | + if (ret) | |
| 3438 | + return ret; | |
| 3439 | + | |
| 3435 | 3440 | reg_val |= RT5659_SCLK_SRC_MCLK; |
| 3436 | 3441 | break; |
| 3437 | 3442 | case RT5659_SCLK_S_PLL1: |
| @@ -629,21 +629,69 @@ static SOC_ENUM_SINGLE_DECL(rt5670_if2_dac_enum, RT5670_DIG_INF1_DATA, · 628 unmodified lines | ||
| 629 | 629 | static SOC_ENUM_SINGLE_DECL(rt5670_if2_adc_enum, RT5670_DIG_INF1_DATA, |
| 630 | 630 | RT5670_IF2_ADC_SEL_SFT, rt5670_data_select); |
| 631 | 631 | |
| 632 | +/* | |
| 633 | + * For reliable output-mute LED control we need a "DAC1 Playback Switch" control. | |
| 634 | + * We emulate this by only clearing the RT5670_M_DAC1_L/_R AD_DA_MIXER register | |
| 635 | + * bits when both our emulated DAC1 Playback Switch control and the DAC1 MIXL/R | |
| 636 | + * DAPM-mixer DAC1 input are enabled. | |
| 637 | + */ | |
| 638 | +static void rt5670_update_ad_da_mixer_dac1_m_bits(struct rt5670_priv *rt5670) | |
| 639 | +{ | |
| 640 | + int val = RT5670_M_DAC1_L | RT5670_M_DAC1_R; | |
| 641 | + | |
| 642 | + if (rt5670->dac1_mixl_dac1_switch && rt5670->dac1_playback_switch_l) | |
| 643 | + val &= ~RT5670_M_DAC1_L; | |
| 644 | + | |
| 645 | + if (rt5670->dac1_mixr_dac1_switch && rt5670->dac1_playback_switch_r) | |
| 646 | + val &= ~RT5670_M_DAC1_R; | |
| 647 | + | |
| 648 | + regmap_update_bits(rt5670->regmap, RT5670_AD_DA_MIXER, | |
| 649 | + RT5670_M_DAC1_L | RT5670_M_DAC1_R, val); | |
| 650 | +} | |
| 651 | + | |
| 652 | +static int rt5670_dac1_playback_switch_get(struct snd_kcontrol *kcontrol, | |
| 653 | + struct snd_ctl_elem_value *ucontrol) | |
| 654 | +{ | |
| 655 | + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); | |
| 656 | + struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); | |
| 657 | + | |
| 658 | + ucontrol->value.integer.value[0] = rt5670->dac1_playback_switch_l; | |
| 659 | + ucontrol->value.integer.value[1] = rt5670->dac1_playback_switch_r; | |
| 660 | + | |
| 661 | + return 0; | |
| 662 | +} | |
| 663 | + | |
| 664 | +static int rt5670_dac1_playback_switch_put(struct snd_kcontrol *kcontrol, | |
| 665 | + struct snd_ctl_elem_value *ucontrol) | |
| 666 | +{ | |
| 667 | + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); | |
| 668 | + struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); | |
| 669 | + | |
| 670 | + if (rt5670->dac1_playback_switch_l == ucontrol->value.integer.value[0] && | |
| 671 | + rt5670->dac1_playback_switch_r == ucontrol->value.integer.value[1]) | |
| 672 | + return 0; | |
| 673 | + | |
| 674 | + rt5670->dac1_playback_switch_l = ucontrol->value.integer.value[0]; | |
| 675 | + rt5670->dac1_playback_switch_r = ucontrol->value.integer.value[1]; | |
| 676 | + | |
| 677 | + rt5670_update_ad_da_mixer_dac1_m_bits(rt5670); | |
| 678 | + | |
| 679 | + return 1; | |
| 680 | +} | |
| 681 | + | |
| 632 | 682 | static const struct snd_kcontrol_new rt5670_snd_controls[] = { |
| 633 | 683 | /* Headphone Output Volume */ |
| 634 | − SOC_DOUBLE("HP Playback Switch", RT5670_HP_VOL, | |
| 635 | − RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1), | |
| 636 | 684 | SOC_DOUBLE_TLV("HP Playback Volume", RT5670_HP_VOL, |
| 637 | 685 | RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, |
| 638 | 686 | 39, 1, out_vol_tlv), |
| 639 | 687 | /* OUTPUT Control */ |
| 640 | − SOC_DOUBLE("OUT Channel Switch", RT5670_LOUT1, | |
| 641 | − RT5670_VOL_L_SFT, RT5670_VOL_R_SFT, 1, 1), | |
| 642 | 688 | SOC_DOUBLE_TLV("OUT Playback Volume", RT5670_LOUT1, |
| 643 | 689 | RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, 39, 1, out_vol_tlv), |
| 644 | 690 | /* DAC Digital Volume */ |
| 645 | 691 | SOC_DOUBLE("DAC2 Playback Switch", RT5670_DAC_CTRL, |
| 646 | 692 | RT5670_M_DAC_L2_VOL_SFT, RT5670_M_DAC_R2_VOL_SFT, 1, 1), |
| 693 | + SOC_DOUBLE_EXT("DAC1 Playback Switch", SND_SOC_NOPM, 0, 1, 1, 0, | |
| 694 | + rt5670_dac1_playback_switch_get, rt5670_dac1_playback_switch_put), | |
| 647 | 695 | SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5670_DAC1_DIG_VOL, |
| 648 | 696 | RT5670_L_VOL_SFT, RT5670_R_VOL_SFT, |
| 649 | 697 | 175, 0, dac_vol_tlv), |
| @@ -913,18 +961,44 @@ static const struct snd_kcontrol_new rt5670_mono_adc_r_mix[] = { · 263 unmodified lines | ||
| 913 | 961 | RT5670_M_MONO_ADC_R2_SFT, 1, 1), |
| 914 | 962 | }; |
| 915 | 963 | |
| 964 | +/* See comment above rt5670_update_ad_da_mixer_dac1_m_bits() */ | |
| 965 | +static int rt5670_put_dac1_mix_dac1_switch(struct snd_kcontrol *kcontrol, | |
| 966 | + struct snd_ctl_elem_value *ucontrol) | |
| 967 | +{ | |
| 968 | + struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; | |
| 969 | + struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); | |
| 970 | + struct rt5670_priv *rt5670 = snd_soc_component_get_drvdata(component); | |
| 971 | + int ret; | |
| 972 | + | |
| 973 | + if (mc->shift == 0) | |
| 974 | + rt5670->dac1_mixl_dac1_switch = ucontrol->value.integer.value[0]; | |
| 975 | + else | |
| 976 | + rt5670->dac1_mixr_dac1_switch = ucontrol->value.integer.value[0]; | |
| 977 | + | |
| 978 | + /* Apply the update (if any) */ | |
| 979 | + ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); | |
| 980 | + if (ret == 0) | |
| 981 | + return 0; | |
| 982 | + | |
| 983 | + rt5670_update_ad_da_mixer_dac1_m_bits(rt5670); | |
| 984 | + | |
| 985 | + return 1; | |
| 986 | +} | |
| 987 | + | |
| 988 | +#define SOC_DAPM_SINGLE_RT5670_DAC1_SW(name, shift) \ | |
| 989 | + SOC_SINGLE_EXT(name, SND_SOC_NOPM, shift, 1, 0, \ | |
| 990 | + snd_soc_dapm_get_volsw, rt5670_put_dac1_mix_dac1_switch) | |
| 991 | + | |
| 916 | 992 | static const struct snd_kcontrol_new rt5670_dac_l_mix[] = { |
| 917 | 993 | SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER, |
| 918 | 994 | RT5670_M_ADCMIX_L_SFT, 1, 1), |
| 919 | − SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER, | |
| 920 | − RT5670_M_DAC1_L_SFT, 1, 1), | |
| 995 | + SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 0), | |
| 921 | 996 | }; |
| 922 | 997 | |
| 923 | 998 | static const struct snd_kcontrol_new rt5670_dac_r_mix[] = { |
| 924 | 999 | SOC_DAPM_SINGLE("Stereo ADC Switch", RT5670_AD_DA_MIXER, |
| 925 | 1000 | RT5670_M_ADCMIX_R_SFT, 1, 1), |
| 926 | − SOC_DAPM_SINGLE("DAC1 Switch", RT5670_AD_DA_MIXER, | |
| 927 | − RT5670_M_DAC1_R_SFT, 1, 1), | |
| 1001 | + SOC_DAPM_SINGLE_RT5670_DAC1_SW("DAC1 Switch", 1), | |
| 928 | 1002 | }; |
| 929 | 1003 | |
| 930 | 1004 | static const struct snd_kcontrol_new rt5670_sto_dac_l_mix[] = { |
| @@ -1656,12 +1730,10 @@ static const struct snd_soc_dapm_widget rt5670_dapm_widgets[] = { · 725 unmodified lines | ||
| 1656 | 1730 | RT5670_PWR_ADC_S1F_BIT, 0, NULL, 0), |
| 1657 | 1731 | SND_SOC_DAPM_SUPPLY("ADC Stereo2 Filter", RT5670_PWR_DIG2, |
| 1658 | 1732 | RT5670_PWR_ADC_S2F_BIT, 0, NULL, 0), |
| 1659 | − SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", RT5670_STO1_ADC_DIG_VOL, | |
| 1660 | − RT5670_L_MUTE_SFT, 1, rt5670_sto1_adc_l_mix, | |
| 1661 | − ARRAY_SIZE(rt5670_sto1_adc_l_mix)), | |
| 1662 | − SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", RT5670_STO1_ADC_DIG_VOL, | |
| 1663 | − RT5670_R_MUTE_SFT, 1, rt5670_sto1_adc_r_mix, | |
| 1664 | − ARRAY_SIZE(rt5670_sto1_adc_r_mix)), | |
| 1733 | + SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", SND_SOC_NOPM, 0, 0, | |
| 1734 | + rt5670_sto1_adc_l_mix, ARRAY_SIZE(rt5670_sto1_adc_l_mix)), | |
| 1735 | + SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", SND_SOC_NOPM, 0, 0, | |
| 1736 | + rt5670_sto1_adc_r_mix, ARRAY_SIZE(rt5670_sto1_adc_r_mix)), | |
| 1665 | 1737 | SND_SOC_DAPM_MIXER("Sto2 ADC MIXL", SND_SOC_NOPM, 0, 0, |
| 1666 | 1738 | rt5670_sto2_adc_l_mix, |
| 1667 | 1739 | ARRAY_SIZE(rt5670_sto2_adc_l_mix)), |
| @@ -2999,6 +3071,16 @@ static int rt5670_i2c_probe(struct i2c_client *i2c, · 1331 unmodified lines | ||
| 2999 | 3071 | dev_info(&i2c->dev, "quirk JD mode 3\n"); |
| 3000 | 3072 | } |
| 3001 | 3073 | |
| 3074 | + /* | |
| 3075 | + * Enable the emulated "DAC1 Playback Switch" by default to avoid | |
| 3076 | + * muting the output with older UCM profiles. | |
| 3077 | + */ | |
| 3078 | + rt5670->dac1_playback_switch_l = true; | |
| 3079 | + rt5670->dac1_playback_switch_r = true; | |
| 3080 | + /* The Power-On-Reset values for the DAC1 mixer have the DAC1 input enabled. */ | |
| 3081 | + rt5670->dac1_mixl_dac1_switch = true; | |
| 3082 | + rt5670->dac1_mixr_dac1_switch = true; | |
| 3083 | + | |
| 3002 | 3084 | rt5670->regmap = devm_regmap_init_i2c(i2c, &rt5670_regmap); |
| 3003 | 3085 | if (IS_ERR(rt5670->regmap)) { |
| 3004 | 3086 | ret = PTR_ERR(rt5670->regmap); |
| @@ -212,12 +212,8 @@ · 211 unmodified lines | ||
| 212 | 212 | /* global definition */ |
| 213 | 213 | #define RT5670_L_MUTE (0x1 << 15) |
| 214 | 214 | #define RT5670_L_MUTE_SFT 15 |
| 215 | −#define RT5670_VOL_L_MUTE (0x1 << 14) | |
| 216 | −#define RT5670_VOL_L_SFT 14 | |
| 217 | 215 | #define RT5670_R_MUTE (0x1 << 7) |
| 218 | 216 | #define RT5670_R_MUTE_SFT 7 |
| 219 | −#define RT5670_VOL_R_MUTE (0x1 << 6) | |
| 220 | −#define RT5670_VOL_R_SFT 6 | |
| 221 | 217 | #define RT5670_L_VOL_MASK (0x3f << 8) |
| 222 | 218 | #define RT5670_L_VOL_SFT 8 |
| 223 | 219 | #define RT5670_R_VOL_MASK (0x3f) |
| @@ -2017,6 +2013,11 @@ struct rt5670_priv { · 1793 unmodified lines | ||
| 2017 | 2013 | int dsp_rate; |
| 2018 | 2014 | int jack_type; |
| 2019 | 2015 | int jack_type_saved; |
| 2016 | + | |
| 2017 | + bool dac1_mixl_dac1_switch; | |
| 2018 | + bool dac1_mixr_dac1_switch; | |
| 2019 | + bool dac1_playback_switch_l; | |
| 2020 | + bool dac1_playback_switch_r; | |
| 2020 | 2021 | }; |
| 2021 | 2022 | |
| 2022 | 2023 | void rt5670_jack_suspend(struct snd_soc_component *component); |
| @@ -895,6 +895,13 @@ static int rt711_probe(struct snd_soc_component *component) · 894 unmodified lines | ||
| 895 | 895 | return 0; |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | +static void rt711_remove(struct snd_soc_component *component) | |
| 899 | +{ | |
| 900 | + struct rt711_priv *rt711 = snd_soc_component_get_drvdata(component); | |
| 901 | + | |
| 902 | + regcache_cache_only(rt711->regmap, true); | |
| 903 | +} | |
| 904 | + | |
| 898 | 905 | static const struct snd_soc_component_driver soc_codec_dev_rt711 = { |
| 899 | 906 | .probe = rt711_probe, |
| 900 | 907 | .set_bias_level = rt711_set_bias_level, |
| @@ -905,6 +912,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt711 = { · 4 unmodified lines | ||
| 905 | 912 | .dapm_routes = rt711_audio_map, |
| 906 | 913 | .num_dapm_routes = ARRAY_SIZE(rt711_audio_map), |
| 907 | 914 | .set_jack = rt711_set_jack_detect, |
| 915 | + .remove = rt711_remove, | |
| 908 | 916 | }; |
| 909 | 917 | |
| 910 | 918 | static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, |
| @@ -71,7 +71,7 @@ static const struct reg_default sgtl5000_reg_defaults[] = { · 70 unmodified lines | ||
| 71 | 71 | { SGTL5000_DAP_EQ_BASS_BAND4, 0x002f }, |
| 72 | 72 | { SGTL5000_DAP_MAIN_CHAN, 0x8000 }, |
| 73 | 73 | { SGTL5000_DAP_MIX_CHAN, 0x0000 }, |
| 74 | − { SGTL5000_DAP_AVC_CTRL, 0x0510 }, | |
| 74 | + { SGTL5000_DAP_AVC_CTRL, 0x5100 }, | |
| 75 | 75 | { SGTL5000_DAP_AVC_THRESHOLD, 0x1473 }, |
| 76 | 76 | { SGTL5000_DAP_AVC_ATTACK, 0x0028 }, |
| 77 | 77 | { SGTL5000_DAP_AVC_DECAY, 0x0050 }, |
| @@ -1,124 +0,0 @@ | ||
| 1 | −/* SPDX-License-Identifier: GPL-2.0-or-later */ | |
| 2 | −/* | |
| 3 | − * SiRF inner codec controllers define | |
| 4 | − * | |
| 5 | − * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. | |
| 6 | − */ | |
| 7 | − | |
| 8 | −#ifndef _SIRF_AUDIO_CODEC_H | |
| 9 | −#define _SIRF_AUDIO_CODEC_H | |
| 10 | − | |
| 11 | − | |
| 12 | −#define AUDIO_IC_CODEC_PWR (0x00E0) | |
| 13 | −#define AUDIO_IC_CODEC_CTRL0 (0x00E4) | |
| 14 | −#define AUDIO_IC_CODEC_CTRL1 (0x00E8) | |
| 15 | −#define AUDIO_IC_CODEC_CTRL2 (0x00EC) | |
| 16 | −#define AUDIO_IC_CODEC_CTRL3 (0x00F0) | |
| 17 | − | |
| 18 | −#define MICBIASEN (1 << 3) | |
| 19 | − | |
| 20 | −#define IC_RDACEN (1 << 0) | |
| 21 | −#define IC_LDACEN (1 << 1) | |
| 22 | −#define IC_HSREN (1 << 2) | |
| 23 | −#define IC_HSLEN (1 << 3) | |
| 24 | −#define IC_SPEN (1 << 4) | |
| 25 | −#define IC_CPEN (1 << 5) | |
| 26 | − | |
| 27 | −#define IC_HPRSELR (1 << 6) | |
| 28 | −#define IC_HPLSELR (1 << 7) | |
| 29 | −#define IC_HPRSELL (1 << 8) | |
| 30 | −#define IC_HPLSELL (1 << 9) | |
| 31 | −#define IC_SPSELR (1 << 10) | |
| 32 | −#define IC_SPSELL (1 << 11) | |
| 33 | − | |
| 34 | −#define IC_MONOR (1 << 12) | |
| 35 | −#define IC_MONOL (1 << 13) | |
| 36 | − | |
| 37 | −#define IC_RXOSRSEL (1 << 28) | |
| 38 | −#define IC_CPFREQ (1 << 29) | |
| 39 | −#define IC_HSINVEN (1 << 30) | |
| 40 | − | |
| 41 | −#define IC_MICINREN (1 << 0) | |
| 42 | −#define IC_MICINLEN (1 << 1) | |
| 43 | −#define IC_MICIN1SEL (1 << 2) | |
| 44 | −#define IC_MICIN2SEL (1 << 3) | |
| 45 | −#define IC_MICDIFSEL (1 << 4) | |
| 46 | −#define IC_LINEIN1SEL (1 << 5) | |
| 47 | −#define IC_LINEIN2SEL (1 << 6) | |
| 48 | −#define IC_RADCEN (1 << 7) | |
| 49 | −#define IC_LADCEN (1 << 8) | |
| 50 | −#define IC_ALM (1 << 9) | |
| 51 | − | |
| 52 | −#define IC_DIGMICEN (1 << 22) | |
| 53 | −#define IC_DIGMICFREQ (1 << 23) | |
| 54 | −#define IC_ADC14B_12 (1 << 24) | |
| 55 | −#define IC_FIRDAC_HSL_EN (1 << 25) | |
| 56 | −#define IC_FIRDAC_HSR_EN (1 << 26) | |
| 57 | −#define IC_FIRDAC_LOUT_EN (1 << 27) | |
| 58 | −#define IC_POR (1 << 28) | |
| 59 | −#define IC_CODEC_CLK_EN (1 << 29) | |
| 60 | −#define IC_HP_3DB_BOOST (1 << 30) | |
| 61 | − | |
| 62 | −#define IC_ADC_LEFT_GAIN_SHIFT 16 | |
| 63 | −#define IC_ADC_RIGHT_GAIN_SHIFT 10 | |
| 64 | −#define IC_ADC_GAIN_MASK 0x3F | |
| 65 | −#define IC_MIC_MAX_GAIN 0x39 | |
| 66 | − | |
| 67 | −#define IC_RXPGAR_MASK 0x3F | |
| 68 | −#define IC_RXPGAR_SHIFT 14 | |
| 69 | −#define IC_RXPGAL_MASK 0x3F | |
| 70 | −#define IC_RXPGAL_SHIFT 21 | |
| 71 | −#define IC_RXPGAR 0x7B | |
| 72 | −#define IC_RXPGAL 0x7B | |
| 73 | − | |
| 74 | −#define AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK 0x3F | |
| 75 | −#define AUDIO_PORT_TX_FIFO_SC_OFFSET 0 | |
| 76 | −#define AUDIO_PORT_TX_FIFO_LC_OFFSET 10 | |
| 77 | −#define AUDIO_PORT_TX_FIFO_HC_OFFSET 20 | |
| 78 | − | |
| 79 | −#define TX_FIFO_SC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \ | |
| 80 | − << AUDIO_PORT_TX_FIFO_SC_OFFSET) | |
| 81 | −#define TX_FIFO_LC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \ | |
| 82 | − << AUDIO_PORT_TX_FIFO_LC_OFFSET) | |
| 83 | −#define TX_FIFO_HC(x) (((x) & AUDIO_PORT_TX_FIFO_LEVEL_CHECK_MASK) \ | |
| 84 | − << AUDIO_PORT_TX_FIFO_HC_OFFSET) | |
| 85 | − | |
| 86 | −#define AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK 0x0F | |
| 87 | −#define AUDIO_PORT_RX_FIFO_SC_OFFSET 0 | |
| 88 | −#define AUDIO_PORT_RX_FIFO_LC_OFFSET 10 | |
| 89 | −#define AUDIO_PORT_RX_FIFO_HC_OFFSET 20 | |
| 90 | − | |
| 91 | −#define RX_FIFO_SC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \ | |
| 92 | − << AUDIO_PORT_RX_FIFO_SC_OFFSET) | |
| 93 | −#define RX_FIFO_LC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \ | |
| 94 | − << AUDIO_PORT_RX_FIFO_LC_OFFSET) | |
| 95 | −#define RX_FIFO_HC(x) (((x) & AUDIO_PORT_RX_FIFO_LEVEL_CHECK_MASK) \ | |
| 96 | − << AUDIO_PORT_RX_FIFO_HC_OFFSET) | |
| 97 | −#define AUDIO_PORT_IC_CODEC_TX_CTRL (0x00F4) | |
| 98 | −#define AUDIO_PORT_IC_CODEC_RX_CTRL (0x00F8) | |
| 99 | − | |
| 100 | −#define AUDIO_PORT_IC_TXFIFO_OP (0x00FC) | |
| 101 | −#define AUDIO_PORT_IC_TXFIFO_LEV_CHK (0x0100) | |
| 102 | −#define AUDIO_PORT_IC_TXFIFO_STS (0x0104) | |
| 103 | −#define AUDIO_PORT_IC_TXFIFO_INT (0x0108) | |
| 104 | −#define AUDIO_PORT_IC_TXFIFO_INT_MSK (0x010C) | |
| 105 | − | |
| 106 | −#define AUDIO_PORT_IC_RXFIFO_OP (0x0110) | |
| 107 | −#define AUDIO_PORT_IC_RXFIFO_LEV_CHK (0x0114) | |
| 108 | −#define AUDIO_PORT_IC_RXFIFO_STS (0x0118) | |
| 109 | −#define AUDIO_PORT_IC_RXFIFO_INT (0x011C) | |
| 110 | −#define AUDIO_PORT_IC_RXFIFO_INT_MSK (0x0120) | |
| 111 | − | |
| 112 | −#define AUDIO_FIFO_START (1 << 0) | |
| 113 | −#define AUDIO_FIFO_RESET (1 << 1) | |
| 114 | − | |
| 115 | −#define AUDIO_FIFO_FULL (1 << 0) | |
| 116 | −#define AUDIO_FIFO_EMPTY (1 << 1) | |
| 117 | −#define AUDIO_FIFO_OFLOW (1 << 2) | |
| 118 | −#define AUDIO_FIFO_UFLOW (1 << 3) | |
| 119 | − | |
| 120 | −#define IC_TX_ENABLE (0x03) | |
| 121 | −#define IC_RX_ENABLE_MONO (0x01) | |
| 122 | −#define IC_RX_ENABLE_STEREO (0x03) | |
| 123 | − | |
| 124 | −#endif /*__SIRF_AUDIO_CODEC_H*/ | |
| @@ -1873,6 +1873,12 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai, · 1872 unmodified lines | ||
| 1873 | 1873 | |
| 1874 | 1874 | wcd = snd_soc_component_get_drvdata(dai->component); |
| 1875 | 1875 | |
| 1876 | + if (tx_num > WCD934X_TX_MAX || rx_num > WCD934X_RX_MAX) { | |
| 1877 | + dev_err(wcd->dev, "Invalid tx %d or rx %d channel count\n", | |
| 1878 | + tx_num, rx_num); | |
| 1879 | + return -EINVAL; | |
| 1880 | + } | |
| 1881 | + | |
| 1876 | 1882 | if (!tx_slot || !rx_slot) { |
| 1877 | 1883 | dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n", |
| 1878 | 1884 | tx_slot, rx_slot); |
| @@ -878,6 +878,7 @@ static int fsl_ssi_hw_free(struct snd_pcm_substream *substream, · 877 unmodified lines | ||
| 878 | 878 | static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt) |
| 879 | 879 | { |
| 880 | 880 | u32 strcr = 0, scr = 0, stcr, srcr, mask; |
| 881 | + unsigned int slots; | |
| 881 | 882 | |
| 882 | 883 | ssi->dai_fmt = fmt; |
| 883 | 884 | |
| @@ -909,10 +910,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi *ssi, unsigned int fmt) · 25 unmodified lines | ||
| 909 | 910 | return -EINVAL; |
| 910 | 911 | } |
| 911 | 912 | |
| 913 | + slots = ssi->slots ? : 2; | |
| 912 | 914 | regmap_update_bits(ssi->regs, REG_SSI_STCCR, |
| 913 | − SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2)); | |
| 915 | + SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots)); | |
| 914 | 916 | regmap_update_bits(ssi->regs, REG_SSI_SRCCR, |
| 915 | − SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(2)); | |
| 917 | + SSI_SxCCR_DC_MASK, SSI_SxCCR_DC(slots)); | |
| 916 | 918 | |
| 917 | 919 | /* Data on rising edge of bclk, frame low, 1clk before data */ |
| 918 | 920 | strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP | SSI_STCR_TEFS; |
| @@ -172,15 +172,16 @@ int asoc_simple_parse_clk(struct device *dev, · 171 unmodified lines | ||
| 172 | 172 | * or device's module clock. |
| 173 | 173 | */ |
| 174 | 174 | clk = devm_get_clk_from_child(dev, node, NULL); |
| 175 | − if (IS_ERR(clk)) | |
| 176 | − clk = devm_get_clk_from_child(dev, dlc->of_node, NULL); | |
| 177 | − | |
| 178 | 175 | if (!IS_ERR(clk)) { |
| 179 | − simple_dai->clk = clk; | |
| 180 | 176 | simple_dai->sysclk = clk_get_rate(clk); |
| 181 | − } else if (!of_property_read_u32(node, "system-clock-frequency", | |
| 182 | − &val)) { | |
| 177 | + | |
| 178 | + simple_dai->clk = clk; | |
| 179 | + } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { | |
| 183 | 180 | simple_dai->sysclk = val; |
| 181 | + } else { | |
| 182 | + clk = devm_get_clk_from_child(dev, dlc->of_node, NULL); | |
| 183 | + if (!IS_ERR(clk)) | |
| 184 | + simple_dai->sysclk = clk_get_rate(clk); | |
| 184 | 185 | } |
| 185 | 186 | |
| 186 | 187 | if (of_property_read_bool(node, "system-clock-direction-out")) |
| @@ -581,7 +581,7 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { · 580 unmodified lines | ||
| 581 | 581 | }, |
| 582 | 582 | .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | |
| 583 | 583 | BYT_RT5640_JD_SRC_JD1_IN4P | |
| 584 | − BYT_RT5640_OVCD_TH_1500UA | | |
| 584 | + BYT_RT5640_OVCD_TH_2000UA | | |
| 585 | 585 | BYT_RT5640_OVCD_SF_0P75 | |
| 586 | 586 | BYT_RT5640_MCLK_EN), |
| 587 | 587 | }, |
| @@ -555,7 +555,9 @@ static int mtk_dai_tdm_hw_params(struct snd_pcm_substream *substream, · 554 unmodified lines | ||
| 555 | 555 | |
| 556 | 556 | /* set tdm */ |
| 557 | 557 | if (tdm_priv->bck_invert) |
| 558 | − tdm_con |= 1 << BCK_INVERSE_SFT; | |
| 558 | + regmap_update_bits(afe->regmap, AUDIO_TOP_CON3, | |
| 559 | + BCK_INVERSE_MASK_SFT, | |
| 560 | + 0x1 << BCK_INVERSE_SFT); | |
| 559 | 561 | |
| 560 | 562 | if (tdm_priv->lck_invert) |
| 561 | 563 | tdm_con |= 1 << LRCK_INVERSE_SFT; |
| @@ -21,6 +21,11 @@ enum { · 20 unmodified lines | ||
| 21 | 21 | /***************************************************************************** |
| 22 | 22 | * R E G I S T E R D E F I N I T I O N |
| 23 | 23 | *****************************************************************************/ |
| 24 | +/* AUDIO_TOP_CON3 */ | |
| 25 | +#define BCK_INVERSE_SFT 3 | |
| 26 | +#define BCK_INVERSE_MASK 0x1 | |
| 27 | +#define BCK_INVERSE_MASK_SFT (0x1 << 3) | |
| 28 | + | |
| 24 | 29 | /* AFE_DAC_CON0 */ |
| 25 | 30 | #define VUL12_ON_SFT 31 |
| 26 | 31 | #define VUL12_ON_MASK 0x1 |
| @@ -2079,9 +2084,6 @@ enum { · 2052 unmodified lines | ||
| 2079 | 2084 | #define TDM_EN_SFT 0 |
| 2080 | 2085 | #define TDM_EN_MASK 0x1 |
| 2081 | 2086 | #define TDM_EN_MASK_SFT (0x1 << 0) |
| 2082 | −#define BCK_INVERSE_SFT 1 | |
| 2083 | −#define BCK_INVERSE_MASK 0x1 | |
| 2084 | −#define BCK_INVERSE_MASK_SFT (0x1 << 1) | |
| 2085 | 2087 | #define LRCK_INVERSE_SFT 2 |
| 2086 | 2088 | #define LRCK_INVERSE_MASK 0x1 |
| 2087 | 2089 | #define LRCK_INVERSE_MASK_SFT (0x1 << 2) |
| @@ -739,7 +739,7 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev, · 738 unmodified lines | ||
| 739 | 739 | |
| 740 | 740 | for_each_child_of_node(dev->of_node, node) { |
| 741 | 741 | ret = of_property_read_u32(node, "reg", &id); |
| 742 | − if (ret || id < 0 || id >= data->variant->num_dai) { | |
| 742 | + if (ret || id < 0) { | |
| 743 | 743 | dev_err(dev, "valid dai id not found: %d\n", ret); |
| 744 | 744 | continue; |
| 745 | 745 | } |
| @@ -27,18 +27,18 @@ · 26 unmodified lines | ||
| 27 | 27 | #define SPK_TDM_RX_MASK 0x03 |
| 28 | 28 | #define NUM_TDM_SLOTS 8 |
| 29 | 29 | #define SLIM_MAX_TX_PORTS 16 |
| 30 | −#define SLIM_MAX_RX_PORTS 16 | |
| 30 | +#define SLIM_MAX_RX_PORTS 13 | |
| 31 | 31 | #define WCD934X_DEFAULT_MCLK_RATE 9600000 |
| 32 | 32 | |
| 33 | 33 | struct sdm845_snd_data { |
| 34 | 34 | struct snd_soc_jack jack; |
| 35 | 35 | bool jack_setup; |
| 36 | − bool stream_prepared[SLIM_MAX_RX_PORTS]; | |
| 36 | + bool stream_prepared[AFE_PORT_MAX]; | |
| 37 | 37 | struct snd_soc_card *card; |
| 38 | 38 | uint32_t pri_mi2s_clk_count; |
| 39 | 39 | uint32_t sec_mi2s_clk_count; |
| 40 | 40 | uint32_t quat_tdm_clk_count; |
| 41 | − struct sdw_stream_runtime *sruntime[SLIM_MAX_RX_PORTS]; | |
| 41 | + struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | static unsigned int tdm_slot_offset[8] = {0, 4, 8, 12, 16, 20, 24, 28}; |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include <linux/of.h> |
| 32 | 32 | #include <linux/of_graph.h> |
| 33 | 33 | #include <linux/dmi.h> |
| 34 | +#include <linux/acpi.h> | |
| 34 | 35 | #include <sound/core.h> |
| 35 | 36 | #include <sound/pcm.h> |
| 36 | 37 | #include <sound/pcm_params.h> |
| @@ -1573,6 +1574,9 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) · 1536 unmodified lines | ||
| 1573 | 1574 | if (card->long_name) |
| 1574 | 1575 | return 0; /* long name already set by driver or from DMI */ |
| 1575 | 1576 | |
| 1577 | + if (!is_acpi_device_node(card->dev->fwnode)) | |
| 1578 | + return 0; | |
| 1579 | + | |
| 1576 | 1580 | /* make up dmi long name as: vendor-product-version-board */ |
| 1577 | 1581 | vendor = dmi_get_system_info(DMI_BOARD_VENDOR); |
| 1578 | 1582 | if (!vendor || !is_dmi_valid(vendor)) { |
| @@ -207,7 +207,7 @@ int hda_dsp_core_power_down(struct snd_sof_dev *sdev, unsigned int core_mask) · 206 unmodified lines | ||
| 207 | 207 | |
| 208 | 208 | ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, |
| 209 | 209 | HDA_DSP_REG_ADSPCS, adspcs, |
| 210 | − !(adspcs & HDA_DSP_ADSPCS_SPA_MASK(core_mask)), | |
| 210 | + !(adspcs & HDA_DSP_ADSPCS_CPA_MASK(core_mask)), | |
| 211 | 211 | HDA_DSP_REG_POLL_INTERVAL_US, |
| 212 | 212 | HDA_DSP_PD_TIMEOUT * USEC_PER_MSEC); |
| 213 | 213 | if (ret < 0) |
| @@ -897,6 +897,7 @@ free_streams: · 896 unmodified lines | ||
| 897 | 897 | /* dsp_unmap: not currently used */ |
| 898 | 898 | iounmap(sdev->bar[HDA_DSP_BAR]); |
| 899 | 899 | hdac_bus_unmap: |
| 900 | + platform_device_unregister(hdev->dmic_dev); | |
| 900 | 901 | iounmap(bus->remap_addr); |
| 901 | 902 | hda_codec_i915_exit(sdev); |
| 902 | 903 | err: |
| @@ -62,7 +62,6 @@ MODULE_PARM_DESC(enable, "Enable Sun AMD7930 soundcard."); · 61 unmodified lines | ||
| 62 | 62 | MODULE_AUTHOR("Thomas K. Dyas and David S. Miller"); |
| 63 | 63 | MODULE_DESCRIPTION("Sun AMD7930"); |
| 64 | 64 | MODULE_LICENSE("GPL"); |
| 65 | −MODULE_SUPPORTED_DEVICE("{{Sun,AMD7930}}"); | |
| 66 | 65 | |
| 67 | 66 | /* Device register layout. */ |
| 68 | 67 | |
| @@ -52,7 +52,6 @@ MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard."); · 51 unmodified lines | ||
| 52 | 52 | MODULE_AUTHOR("Jaroslav Kysela, Derrick J. Brashear and David S. Miller"); |
| 53 | 53 | MODULE_DESCRIPTION("Sun CS4231"); |
| 54 | 54 | MODULE_LICENSE("GPL"); |
| 55 | −MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}"); | |
| 56 | 55 | |
| 57 | 56 | #ifdef SBUS_SUPPORT |
| 58 | 57 | struct sbus_dma_info { |
| @@ -76,7 +76,6 @@ · 75 unmodified lines | ||
| 76 | 76 | MODULE_AUTHOR("Rudolf Koenig, Brent Baccala and Martin Habets"); |
| 77 | 77 | MODULE_DESCRIPTION("Sun DBRI"); |
| 78 | 78 | MODULE_LICENSE("GPL"); |
| 79 | −MODULE_SUPPORTED_DEVICE("{{Sun,DBRI}}"); | |
| 80 | 79 | |
| 81 | 80 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 82 | 81 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | MODULE_AUTHOR("Torsten Schenk <torsten.schenk@zoho.com>"); |
| 27 | 27 | MODULE_DESCRIPTION("TerraTec DMX 6Fire USB audio driver"); |
| 28 | 28 | MODULE_LICENSE("GPL v2"); |
| 29 | −MODULE_SUPPORTED_DEVICE("{{TerraTec,DMX 6Fire USB}}"); | |
| 30 | 29 | |
| 31 | 30 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
| 32 | 31 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ |
| @@ -26,20 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
| 27 | 27 | MODULE_DESCRIPTION("caiaq USB audio"); |
| 28 | 28 | MODULE_LICENSE("GPL"); |
| 29 | −MODULE_SUPPORTED_DEVICE("{{Native Instruments,RigKontrol2}," | |
| 30 | − "{Native Instruments,RigKontrol3}," | |
| 31 | − "{Native Instruments,Kore Controller}," | |
| 32 | − "{Native Instruments,Kore Controller 2}," | |
| 33 | − "{Native Instruments,Audio Kontrol 1}," | |
| 34 | − "{Native Instruments,Audio 2 DJ}," | |
| 35 | − "{Native Instruments,Audio 4 DJ}," | |
| 36 | − "{Native Instruments,Audio 8 DJ}," | |
| 37 | − "{Native Instruments,Traktor Audio 2}," | |
| 38 | − "{Native Instruments,Session I/O}," | |
| 39 | − "{Native Instruments,GuitarRig mobile}," | |
| 40 | − "{Native Instruments,Traktor Kontrol X1}," | |
| 41 | − "{Native Instruments,Traktor Kontrol S4}," | |
| 42 | − "{Native Instruments,Maschine Controller}}"); | |
| 43 | 29 | |
| 44 | 30 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
| 45 | 31 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
| @@ -58,8 +58,6 @@ · 57 unmodified lines | ||
| 58 | 58 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
| 59 | 59 | MODULE_DESCRIPTION("USB Audio"); |
| 60 | 60 | MODULE_LICENSE("GPL"); |
| 61 | −MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}"); | |
| 62 | − | |
| 63 | 61 | |
| 64 | 62 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
| 65 | 63 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| @@ -21,23 +21,6 @@ MODULE_AUTHOR("Michael Trimarchi <michael@amarulasolutions.com>"); · 20 unmodified lines | ||
| 21 | 21 | MODULE_AUTHOR("Antonio Ospite <ao2@amarulasolutions.com>"); |
| 22 | 22 | MODULE_DESCRIPTION("M2Tech hiFace USB-SPDIF audio driver"); |
| 23 | 23 | MODULE_LICENSE("GPL v2"); |
| 24 | −MODULE_SUPPORTED_DEVICE("{{M2Tech,Young}," | |
| 25 | − "{M2Tech,hiFace}," | |
| 26 | − "{M2Tech,North Star}," | |
| 27 | − "{M2Tech,W4S Young}," | |
| 28 | − "{M2Tech,Corrson}," | |
| 29 | − "{M2Tech,AUDIA}," | |
| 30 | − "{M2Tech,SL Audio}," | |
| 31 | − "{M2Tech,Empirical}," | |
| 32 | − "{M2Tech,Rockna}," | |
| 33 | − "{M2Tech,Pathos}," | |
| 34 | − "{M2Tech,Metronome}," | |
| 35 | − "{M2Tech,CAD}," | |
| 36 | − "{M2Tech,Audio Esclusive}," | |
| 37 | − "{M2Tech,Rotel}," | |
| 38 | − "{M2Tech,Eeaudio}," | |
| 39 | − "{The Chord Company,CHORD}," | |
| 40 | − "{AVA Group A/S,Vitus}}"); | |
| 41 | 24 | |
| 42 | 25 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
| 43 | 26 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ |
| @@ -19,7 +19,6 @@ · 18 unmodified lines | ||
| 19 | 19 | MODULE_DESCRIPTION("Edirol UA-101/1000 driver"); |
| 20 | 20 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 21 | 21 | MODULE_LICENSE("GPL v2"); |
| 22 | −MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}"); | |
| 23 | 22 | |
| 24 | 23 | /* |
| 25 | 24 | * Should not be lower than the minimum scheduling delay of the host |
| @@ -2883,7 +2883,7 @@ static int snd_djm_controls_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_v · 2882 unmodified lines | ||
| 2883 | 2883 | u8 group = (private_value & SND_DJM_GROUP_MASK) >> SND_DJM_GROUP_SHIFT; |
| 2884 | 2884 | u16 value = elem->value.enumerated.item[0]; |
| 2885 | 2885 | |
| 2886 | − kctl->private_value = ((device << SND_DJM_DEVICE_SHIFT) | | |
| 2886 | + kctl->private_value = (((unsigned long)device << SND_DJM_DEVICE_SHIFT) | | |
| 2887 | 2887 | (group << SND_DJM_GROUP_SHIFT) | |
| 2888 | 2888 | value); |
| 2889 | 2889 | |
| @@ -2921,7 +2921,7 @@ static int snd_djm_controls_create(struct usb_mixer_interface *mixer, · 31 unmodified lines | ||
| 2921 | 2921 | value = device->controls[i].default_value; |
| 2922 | 2922 | knew.name = device->controls[i].name; |
| 2923 | 2923 | knew.private_value = ( |
| 2924 | − (device_idx << SND_DJM_DEVICE_SHIFT) | | |
| 2924 | + ((unsigned long)device_idx << SND_DJM_DEVICE_SHIFT) | | |
| 2925 | 2925 | (i << SND_DJM_GROUP_SHIFT) | |
| 2926 | 2926 | value); |
| 2927 | 2927 | err = snd_djm_controls_update(mixer, device_idx, i, value); |
| @@ -137,7 +137,6 @@ · 136 unmodified lines | ||
| 137 | 137 | MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>"); |
| 138 | 138 | MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2"); |
| 139 | 139 | MODULE_LICENSE("GPL"); |
| 140 | −MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604),"NAME_ALLCAPS"(0x8001)(0x8005)(0x8007)}}"); | |
| 141 | 140 | |
| 142 | 141 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
| 143 | 142 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
| @@ -1887,4 +1887,3 @@ MODULE_AUTHOR("Vaibhav Agarwal <vaibhav.agarwal@intel.com>"); · 1886 unmodified lines | ||
| 1887 | 1887 | MODULE_AUTHOR("Jerome Anand <jerome.anand@intel.com>"); |
| 1888 | 1888 | MODULE_DESCRIPTION("Intel HDMI Audio driver"); |
| 1889 | 1889 | MODULE_LICENSE("GPL v2"); |
| 1890 | −MODULE_SUPPORTED_DEVICE("{Intel,Intel_HAD}"); | |
| @@ -391,4 +391,3 @@ module_exit(xen_drv_fini); · 390 unmodified lines | ||
| 391 | 391 | MODULE_DESCRIPTION("Xen virtual sound device frontend"); |
| 392 | 392 | MODULE_LICENSE("GPL"); |
| 393 | 393 | MODULE_ALIAS("xen:" XENSND_DRIVER_NAME); |
| 394 | −MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual soundcard}}"); | |
| @@ -8,10 +8,13 @@ · 7 unmodified lines | ||
| 8 | 8 | /x86_64/debug_regs |
| 9 | 9 | /x86_64/evmcs_test |
| 10 | 10 | /x86_64/get_cpuid_test |
| 11 | +/x86_64/get_msr_index_features | |
| 11 | 12 | /x86_64/kvm_pv_test |
| 13 | +/x86_64/hyperv_clock | |
| 12 | 14 | /x86_64/hyperv_cpuid |
| 13 | 15 | /x86_64/mmio_warning_test |
| 14 | 16 | /x86_64/platform_info_test |
| 17 | +/x86_64/set_boot_cpu_id | |
| 15 | 18 | /x86_64/set_sregs_test |
| 16 | 19 | /x86_64/smm_test |
| 17 | 20 | /x86_64/state_test |
| @@ -39,12 +39,15 @@ LIBKVM_aarch64 = lib/aarch64/processor.c lib/aarch64/ucall.c · 38 unmodified lines | ||
| 39 | 39 | LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c lib/s390x/diag318_test_handler.c |
| 40 | 40 | |
| 41 | 41 | TEST_GEN_PROGS_x86_64 = x86_64/cr4_cpuid_sync_test |
| 42 | +TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features | |
| 42 | 43 | TEST_GEN_PROGS_x86_64 += x86_64/evmcs_test |
| 43 | 44 | TEST_GEN_PROGS_x86_64 += x86_64/get_cpuid_test |
| 45 | +TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock | |
| 44 | 46 | TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid |
| 45 | 47 | TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test |
| 46 | 48 | TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test |
| 47 | 49 | TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test |
| 50 | +TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id | |
| 48 | 51 | TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test |
| 49 | 52 | TEST_GEN_PROGS_x86_64 += x86_64/smm_test |
| 50 | 53 | TEST_GEN_PROGS_x86_64 += x86_64/state_test |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | |
| 17 | 17 | #include "sparsebit.h" |
| 18 | 18 | |
| 19 | +#define KVM_DEV_PATH "/dev/kvm" | |
| 19 | 20 | #define KVM_MAX_VCPUS 512 |
| 20 | 21 | |
| 21 | 22 | /* |
| @@ -133,6 +134,7 @@ void vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl, · 111 unmodified lines | ||
| 133 | 134 | int _vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl, |
| 134 | 135 | void *arg); |
| 135 | 136 | void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg); |
| 137 | +int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg); | |
| 136 | 138 | void kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg); |
| 137 | 139 | int _kvm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg); |
| 138 | 140 | void vm_mem_region_set_flags(struct kvm_vm *vm, uint32_t slot, uint32_t flags); |
| @@ -1697,11 +1697,16 @@ void vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg) · 1696 unmodified lines | ||
| 1697 | 1697 | { |
| 1698 | 1698 | int ret; |
| 1699 | 1699 | |
| 1700 | − ret = ioctl(vm->fd, cmd, arg); | |
| 1700 | + ret = _vm_ioctl(vm, cmd, arg); | |
| 1701 | 1701 | TEST_ASSERT(ret == 0, "vm ioctl %lu failed, rc: %i errno: %i (%s)", |
| 1702 | 1702 | cmd, ret, errno, strerror(errno)); |
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | +int _vm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg) | |
| 1706 | +{ | |
| 1707 | + return ioctl(vm->fd, cmd, arg); | |
| 1708 | +} | |
| 1709 | + | |
| 1705 | 1710 | /* |
| 1706 | 1711 | * KVM system ioctl |
| 1707 | 1712 | * |
| @@ -10,8 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | #include "sparsebit.h" |
| 12 | 12 | |
| 13 | −#define KVM_DEV_PATH "/dev/kvm" | |
| 14 | − | |
| 15 | 13 | struct userspace_mem_region { |
| 16 | 14 | struct kvm_userspace_memory_region region; |
| 17 | 15 | struct sparsebit *unused_phy_pages; |
| @@ -0,0 +1,134 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Test that KVM_GET_MSR_INDEX_LIST and | |
| 4 | + * KVM_GET_MSR_FEATURE_INDEX_LIST work as intended | |
| 5 | + * | |
| 6 | + * Copyright (C) 2020, Red Hat, Inc. | |
| 7 | + */ | |
| 8 | +#include <fcntl.h> | |
| 9 | +#include <stdio.h> | |
| 10 | +#include <stdlib.h> | |
| 11 | +#include <string.h> | |
| 12 | +#include <sys/ioctl.h> | |
| 13 | + | |
| 14 | +#include "test_util.h" | |
| 15 | +#include "kvm_util.h" | |
| 16 | +#include "processor.h" | |
| 17 | + | |
| 18 | +static int kvm_num_index_msrs(int kvm_fd, int nmsrs) | |
| 19 | +{ | |
| 20 | + struct kvm_msr_list *list; | |
| 21 | + int r; | |
| 22 | + | |
| 23 | + list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0])); | |
| 24 | + list->nmsrs = nmsrs; | |
| 25 | + r = ioctl(kvm_fd, KVM_GET_MSR_INDEX_LIST, list); | |
| 26 | + TEST_ASSERT(r == -1 && errno == E2BIG, | |
| 27 | + "Unexpected result from KVM_GET_MSR_INDEX_LIST probe, r: %i", | |
| 28 | + r); | |
| 29 | + | |
| 30 | + r = list->nmsrs; | |
| 31 | + free(list); | |
| 32 | + return r; | |
| 33 | +} | |
| 34 | + | |
| 35 | +static void test_get_msr_index(void) | |
| 36 | +{ | |
| 37 | + int old_res, res, kvm_fd, r; | |
| 38 | + struct kvm_msr_list *list; | |
| 39 | + | |
| 40 | + kvm_fd = open(KVM_DEV_PATH, O_RDONLY); | |
| 41 | + if (kvm_fd < 0) | |
| 42 | + exit(KSFT_SKIP); | |
| 43 | + | |
| 44 | + old_res = kvm_num_index_msrs(kvm_fd, 0); | |
| 45 | + TEST_ASSERT(old_res != 0, "Expecting nmsrs to be > 0"); | |
| 46 | + | |
| 47 | + if (old_res != 1) { | |
| 48 | + res = kvm_num_index_msrs(kvm_fd, 1); | |
| 49 | + TEST_ASSERT(res > 1, "Expecting nmsrs to be > 1"); | |
| 50 | + TEST_ASSERT(res == old_res, "Expecting nmsrs to be identical"); | |
| 51 | + } | |
| 52 | + | |
| 53 | + list = malloc(sizeof(*list) + old_res * sizeof(list->indices[0])); | |
| 54 | + list->nmsrs = old_res; | |
| 55 | + r = ioctl(kvm_fd, KVM_GET_MSR_INDEX_LIST, list); | |
| 56 | + | |
| 57 | + TEST_ASSERT(r == 0, | |
| 58 | + "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST, r: %i", | |
| 59 | + r); | |
| 60 | + TEST_ASSERT(list->nmsrs == old_res, "Expecting nmsrs to be identical"); | |
| 61 | + free(list); | |
| 62 | + | |
| 63 | + close(kvm_fd); | |
| 64 | +} | |
| 65 | + | |
| 66 | +static int kvm_num_feature_msrs(int kvm_fd, int nmsrs) | |
| 67 | +{ | |
| 68 | + struct kvm_msr_list *list; | |
| 69 | + int r; | |
| 70 | + | |
| 71 | + list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0])); | |
| 72 | + list->nmsrs = nmsrs; | |
| 73 | + r = ioctl(kvm_fd, KVM_GET_MSR_FEATURE_INDEX_LIST, list); | |
| 74 | + TEST_ASSERT(r == -1 && errno == E2BIG, | |
| 75 | + "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST probe, r: %i", | |
| 76 | + r); | |
| 77 | + | |
| 78 | + r = list->nmsrs; | |
| 79 | + free(list); | |
| 80 | + return r; | |
| 81 | +} | |
| 82 | + | |
| 83 | +struct kvm_msr_list *kvm_get_msr_feature_list(int kvm_fd, int nmsrs) | |
| 84 | +{ | |
| 85 | + struct kvm_msr_list *list; | |
| 86 | + int r; | |
| 87 | + | |
| 88 | + list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0])); | |
| 89 | + list->nmsrs = nmsrs; | |
| 90 | + r = ioctl(kvm_fd, KVM_GET_MSR_FEATURE_INDEX_LIST, list); | |
| 91 | + | |
| 92 | + TEST_ASSERT(r == 0, | |
| 93 | + "Unexpected result from KVM_GET_MSR_FEATURE_INDEX_LIST, r: %i", | |
| 94 | + r); | |
| 95 | + | |
| 96 | + return list; | |
| 97 | +} | |
| 98 | + | |
| 99 | +static void test_get_msr_feature(void) | |
| 100 | +{ | |
| 101 | + int res, old_res, i, kvm_fd; | |
| 102 | + struct kvm_msr_list *feature_list; | |
| 103 | + | |
| 104 | + kvm_fd = open(KVM_DEV_PATH, O_RDONLY); | |
| 105 | + if (kvm_fd < 0) | |
| 106 | + exit(KSFT_SKIP); | |
| 107 | + | |
| 108 | + old_res = kvm_num_feature_msrs(kvm_fd, 0); | |
| 109 | + TEST_ASSERT(old_res != 0, "Expecting nmsrs to be > 0"); | |
| 110 | + | |
| 111 | + if (old_res != 1) { | |
| 112 | + res = kvm_num_feature_msrs(kvm_fd, 1); | |
| 113 | + TEST_ASSERT(res > 1, "Expecting nmsrs to be > 1"); | |
| 114 | + TEST_ASSERT(res == old_res, "Expecting nmsrs to be identical"); | |
| 115 | + } | |
| 116 | + | |
| 117 | + feature_list = kvm_get_msr_feature_list(kvm_fd, old_res); | |
| 118 | + TEST_ASSERT(old_res == feature_list->nmsrs, | |
| 119 | + "Unmatching number of msr indexes"); | |
| 120 | + | |
| 121 | + for (i = 0; i < feature_list->nmsrs; i++) | |
| 122 | + kvm_get_feature_msr(feature_list->indices[i]); | |
| 123 | + | |
| 124 | + free(feature_list); | |
| 125 | + close(kvm_fd); | |
| 126 | +} | |
| 127 | + | |
| 128 | +int main(int argc, char *argv[]) | |
| 129 | +{ | |
| 130 | + if (kvm_check_cap(KVM_CAP_GET_MSR_FEATURES)) | |
| 131 | + test_get_msr_feature(); | |
| 132 | + | |
| 133 | + test_get_msr_index(); | |
| 134 | +} | |
| @@ -0,0 +1,260 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0-only | |
| 2 | +/* | |
| 3 | + * Copyright (C) 2021, Red Hat, Inc. | |
| 4 | + * | |
| 5 | + * Tests for Hyper-V clocksources | |
| 6 | + */ | |
| 7 | +#include "test_util.h" | |
| 8 | +#include "kvm_util.h" | |
| 9 | +#include "processor.h" | |
| 10 | + | |
| 11 | +struct ms_hyperv_tsc_page { | |
| 12 | + volatile u32 tsc_sequence; | |
| 13 | + u32 reserved1; | |
| 14 | + volatile u64 tsc_scale; | |
| 15 | + volatile s64 tsc_offset; | |
| 16 | +} __packed; | |
| 17 | + | |
| 18 | +#define HV_X64_MSR_GUEST_OS_ID 0x40000000 | |
| 19 | +#define HV_X64_MSR_TIME_REF_COUNT 0x40000020 | |
| 20 | +#define HV_X64_MSR_REFERENCE_TSC 0x40000021 | |
| 21 | +#define HV_X64_MSR_TSC_FREQUENCY 0x40000022 | |
| 22 | +#define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x40000106 | |
| 23 | +#define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107 | |
| 24 | + | |
| 25 | +/* Simplified mul_u64_u64_shr() */ | |
| 26 | +static inline u64 mul_u64_u64_shr64(u64 a, u64 b) | |
| 27 | +{ | |
| 28 | + union { | |
| 29 | + u64 ll; | |
| 30 | + struct { | |
| 31 | + u32 low, high; | |
| 32 | + } l; | |
| 33 | + } rm, rn, rh, a0, b0; | |
| 34 | + u64 c; | |
| 35 | + | |
| 36 | + a0.ll = a; | |
| 37 | + b0.ll = b; | |
| 38 | + | |
| 39 | + rm.ll = (u64)a0.l.low * b0.l.high; | |
| 40 | + rn.ll = (u64)a0.l.high * b0.l.low; | |
| 41 | + rh.ll = (u64)a0.l.high * b0.l.high; | |
| 42 | + | |
| 43 | + rh.l.low = c = rm.l.high + rn.l.high + rh.l.low; | |
| 44 | + rh.l.high = (c >> 32) + rh.l.high; | |
| 45 | + | |
| 46 | + return rh.ll; | |
| 47 | +} | |
| 48 | + | |
| 49 | +static inline void nop_loop(void) | |
| 50 | +{ | |
| 51 | + int i; | |
| 52 | + | |
| 53 | + for (i = 0; i < 1000000; i++) | |
| 54 | + asm volatile("nop"); | |
| 55 | +} | |
| 56 | + | |
| 57 | +static inline void check_tsc_msr_rdtsc(void) | |
| 58 | +{ | |
| 59 | + u64 tsc_freq, r1, r2, t1, t2; | |
| 60 | + s64 delta_ns; | |
| 61 | + | |
| 62 | + tsc_freq = rdmsr(HV_X64_MSR_TSC_FREQUENCY); | |
| 63 | + GUEST_ASSERT(tsc_freq > 0); | |
| 64 | + | |
| 65 | + /* First, check MSR-based clocksource */ | |
| 66 | + r1 = rdtsc(); | |
| 67 | + t1 = rdmsr(HV_X64_MSR_TIME_REF_COUNT); | |
| 68 | + nop_loop(); | |
| 69 | + r2 = rdtsc(); | |
| 70 | + t2 = rdmsr(HV_X64_MSR_TIME_REF_COUNT); | |
| 71 | + | |
| 72 | + GUEST_ASSERT(r2 > r1 && t2 > t1); | |
| 73 | + | |
| 74 | + /* HV_X64_MSR_TIME_REF_COUNT is in 100ns */ | |
| 75 | + delta_ns = ((t2 - t1) * 100) - ((r2 - r1) * 1000000000 / tsc_freq); | |
| 76 | + if (delta_ns < 0) | |
| 77 | + delta_ns = -delta_ns; | |
| 78 | + | |
| 79 | + /* 1% tolerance */ | |
| 80 | + GUEST_ASSERT(delta_ns * 100 < (t2 - t1) * 100); | |
| 81 | +} | |
| 82 | + | |
| 83 | +static inline void check_tsc_msr_tsc_page(struct ms_hyperv_tsc_page *tsc_page) | |
| 84 | +{ | |
| 85 | + u64 r1, r2, t1, t2; | |
| 86 | + | |
| 87 | + /* Compare TSC page clocksource with HV_X64_MSR_TIME_REF_COUNT */ | |
| 88 | + t1 = mul_u64_u64_shr64(rdtsc(), tsc_page->tsc_scale) + tsc_page->tsc_offset; | |
| 89 | + r1 = rdmsr(HV_X64_MSR_TIME_REF_COUNT); | |
| 90 | + | |
| 91 | + /* 10 ms tolerance */ | |
| 92 | + GUEST_ASSERT(r1 >= t1 && r1 - t1 < 100000); | |
| 93 | + nop_loop(); | |
| 94 | + | |
| 95 | + t2 = mul_u64_u64_shr64(rdtsc(), tsc_page->tsc_scale) + tsc_page->tsc_offset; | |
| 96 | + r2 = rdmsr(HV_X64_MSR_TIME_REF_COUNT); | |
| 97 | + GUEST_ASSERT(r2 >= t1 && r2 - t2 < 100000); | |
| 98 | +} | |
| 99 | + | |
| 100 | +static void guest_main(struct ms_hyperv_tsc_page *tsc_page, vm_paddr_t tsc_page_gpa) | |
| 101 | +{ | |
| 102 | + u64 tsc_scale, tsc_offset; | |
| 103 | + | |
| 104 | + /* Set Guest OS id to enable Hyper-V emulation */ | |
| 105 | + GUEST_SYNC(1); | |
| 106 | + wrmsr(HV_X64_MSR_GUEST_OS_ID, (u64)0x8100 << 48); | |
| 107 | + GUEST_SYNC(2); | |
| 108 | + | |
| 109 | + check_tsc_msr_rdtsc(); | |
| 110 | + | |
| 111 | + GUEST_SYNC(3); | |
| 112 | + | |
| 113 | + /* Set up TSC page is disabled state, check that it's clean */ | |
| 114 | + wrmsr(HV_X64_MSR_REFERENCE_TSC, tsc_page_gpa); | |
| 115 | + GUEST_ASSERT(tsc_page->tsc_sequence == 0); | |
| 116 | + GUEST_ASSERT(tsc_page->tsc_scale == 0); | |
| 117 | + GUEST_ASSERT(tsc_page->tsc_offset == 0); | |
| 118 | + | |
| 119 | + GUEST_SYNC(4); | |
| 120 | + | |
| 121 | + /* Set up TSC page is enabled state */ | |
| 122 | + wrmsr(HV_X64_MSR_REFERENCE_TSC, tsc_page_gpa | 0x1); | |
| 123 | + GUEST_ASSERT(tsc_page->tsc_sequence != 0); | |
| 124 | + | |
| 125 | + GUEST_SYNC(5); | |
| 126 | + | |
| 127 | + check_tsc_msr_tsc_page(tsc_page); | |
| 128 | + | |
| 129 | + GUEST_SYNC(6); | |
| 130 | + | |
| 131 | + tsc_offset = tsc_page->tsc_offset; | |
| 132 | + /* Call KVM_SET_CLOCK from userspace, check that TSC page was updated */ | |
| 133 | + GUEST_SYNC(7); | |
| 134 | + GUEST_ASSERT(tsc_page->tsc_offset != tsc_offset); | |
| 135 | + | |
| 136 | + nop_loop(); | |
| 137 | + | |
| 138 | + /* | |
| 139 | + * Enable Re-enlightenment and check that TSC page stays constant across | |
| 140 | + * KVM_SET_CLOCK. | |
| 141 | + */ | |
| 142 | + wrmsr(HV_X64_MSR_REENLIGHTENMENT_CONTROL, 0x1 << 16 | 0xff); | |
| 143 | + wrmsr(HV_X64_MSR_TSC_EMULATION_CONTROL, 0x1); | |
| 144 | + tsc_offset = tsc_page->tsc_offset; | |
| 145 | + tsc_scale = tsc_page->tsc_scale; | |
| 146 | + GUEST_SYNC(8); | |
| 147 | + GUEST_ASSERT(tsc_page->tsc_offset == tsc_offset); | |
| 148 | + GUEST_ASSERT(tsc_page->tsc_scale == tsc_scale); | |
| 149 | + | |
| 150 | + GUEST_SYNC(9); | |
| 151 | + | |
| 152 | + check_tsc_msr_tsc_page(tsc_page); | |
| 153 | + | |
| 154 | + /* | |
| 155 | + * Disable re-enlightenment and TSC page, check that KVM doesn't update | |
| 156 | + * it anymore. | |
| 157 | + */ | |
| 158 | + wrmsr(HV_X64_MSR_REENLIGHTENMENT_CONTROL, 0); | |
| 159 | + wrmsr(HV_X64_MSR_TSC_EMULATION_CONTROL, 0); | |
| 160 | + wrmsr(HV_X64_MSR_REFERENCE_TSC, 0); | |
| 161 | + memset(tsc_page, 0, sizeof(*tsc_page)); | |
| 162 | + | |
| 163 | + GUEST_SYNC(10); | |
| 164 | + GUEST_ASSERT(tsc_page->tsc_sequence == 0); | |
| 165 | + GUEST_ASSERT(tsc_page->tsc_offset == 0); | |
| 166 | + GUEST_ASSERT(tsc_page->tsc_scale == 0); | |
| 167 | + | |
| 168 | + GUEST_DONE(); | |
| 169 | +} | |
| 170 | + | |
| 171 | +#define VCPU_ID 0 | |
| 172 | + | |
| 173 | +static void host_check_tsc_msr_rdtsc(struct kvm_vm *vm) | |
| 174 | +{ | |
| 175 | + u64 tsc_freq, r1, r2, t1, t2; | |
| 176 | + s64 delta_ns; | |
| 177 | + | |
| 178 | + tsc_freq = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TSC_FREQUENCY); | |
| 179 | + TEST_ASSERT(tsc_freq > 0, "TSC frequency must be nonzero"); | |
| 180 | + | |
| 181 | + /* First, check MSR-based clocksource */ | |
| 182 | + r1 = rdtsc(); | |
| 183 | + t1 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT); | |
| 184 | + nop_loop(); | |
| 185 | + r2 = rdtsc(); | |
| 186 | + t2 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT); | |
| 187 | + | |
| 188 | + TEST_ASSERT(t2 > t1, "Time reference MSR is not monotonic (%ld <= %ld)", t1, t2); | |
| 189 | + | |
| 190 | + /* HV_X64_MSR_TIME_REF_COUNT is in 100ns */ | |
| 191 | + delta_ns = ((t2 - t1) * 100) - ((r2 - r1) * 1000000000 / tsc_freq); | |
| 192 | + if (delta_ns < 0) | |
| 193 | + delta_ns = -delta_ns; | |
| 194 | + | |
| 195 | + /* 1% tolerance */ | |
| 196 | + TEST_ASSERT(delta_ns * 100 < (t2 - t1) * 100, | |
| 197 | + "Elapsed time does not match (MSR=%ld, TSC=%ld)", | |
| 198 | + (t2 - t1) * 100, (r2 - r1) * 1000000000 / tsc_freq); | |
| 199 | +} | |
| 200 | + | |
| 201 | +int main(void) | |
| 202 | +{ | |
| 203 | + struct kvm_vm *vm; | |
| 204 | + struct kvm_run *run; | |
| 205 | + struct ucall uc; | |
| 206 | + vm_vaddr_t tsc_page_gva; | |
| 207 | + int stage; | |
| 208 | + | |
| 209 | + vm = vm_create_default(VCPU_ID, 0, guest_main); | |
| 210 | + run = vcpu_state(vm, VCPU_ID); | |
| 211 | + | |
| 212 | + vcpu_set_hv_cpuid(vm, VCPU_ID); | |
| 213 | + | |
| 214 | + tsc_page_gva = vm_vaddr_alloc(vm, getpagesize(), 0x10000, 0, 0); | |
| 215 | + memset(addr_gpa2hva(vm, tsc_page_gva), 0x0, getpagesize()); | |
| 216 | + TEST_ASSERT((addr_gva2gpa(vm, tsc_page_gva) & (getpagesize() - 1)) == 0, | |
| 217 | + "TSC page has to be page aligned\n"); | |
| 218 | + vcpu_args_set(vm, VCPU_ID, 2, tsc_page_gva, addr_gva2gpa(vm, tsc_page_gva)); | |
| 219 | + | |
| 220 | + host_check_tsc_msr_rdtsc(vm); | |
| 221 | + | |
| 222 | + for (stage = 1;; stage++) { | |
| 223 | + _vcpu_run(vm, VCPU_ID); | |
| 224 | + TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, | |
| 225 | + "Stage %d: unexpected exit reason: %u (%s),\n", | |
| 226 | + stage, run->exit_reason, | |
| 227 | + exit_reason_str(run->exit_reason)); | |
| 228 | + | |
| 229 | + switch (get_ucall(vm, VCPU_ID, &uc)) { | |
| 230 | + case UCALL_ABORT: | |
| 231 | + TEST_FAIL("%s at %s:%ld", (const char *)uc.args[0], | |
| 232 | + __FILE__, uc.args[1]); | |
| 233 | + /* NOT REACHED */ | |
| 234 | + case UCALL_SYNC: | |
| 235 | + break; | |
| 236 | + case UCALL_DONE: | |
| 237 | + /* Keep in sync with guest_main() */ | |
| 238 | + TEST_ASSERT(stage == 11, "Testing ended prematurely, stage %d\n", | |
| 239 | + stage); | |
| 240 | + goto out; | |
| 241 | + default: | |
| 242 | + TEST_FAIL("Unknown ucall %lu", uc.cmd); | |
| 243 | + } | |
| 244 | + | |
| 245 | + TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") && | |
| 246 | + uc.args[1] == stage, | |
| 247 | + "Stage %d: Unexpected register values vmexit, got %lx", | |
| 248 | + stage, (ulong)uc.args[1]); | |
| 249 | + | |
| 250 | + /* Reset kvmclock triggering TSC page update */ | |
| 251 | + if (stage == 7 || stage == 8 || stage == 10) { | |
| 252 | + struct kvm_clock_data clock = {0}; | |
| 253 | + | |
| 254 | + vm_ioctl(vm, KVM_SET_CLOCK, &clock); | |
| 255 | + } | |
| 256 | + } | |
| 257 | + | |
| 258 | +out: | |
| 259 | + kvm_vm_free(vm); | |
| 260 | +} | |
| @@ -0,0 +1,166 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Test that KVM_SET_BOOT_CPU_ID works as intended | |
| 4 | + * | |
| 5 | + * Copyright (C) 2020, Red Hat, Inc. | |
| 6 | + */ | |
| 7 | +#define _GNU_SOURCE /* for program_invocation_name */ | |
| 8 | +#include <fcntl.h> | |
| 9 | +#include <stdio.h> | |
| 10 | +#include <stdlib.h> | |
| 11 | +#include <string.h> | |
| 12 | +#include <sys/ioctl.h> | |
| 13 | + | |
| 14 | +#include "test_util.h" | |
| 15 | +#include "kvm_util.h" | |
| 16 | +#include "processor.h" | |
| 17 | + | |
| 18 | +#define N_VCPU 2 | |
| 19 | +#define VCPU_ID0 0 | |
| 20 | +#define VCPU_ID1 1 | |
| 21 | + | |
| 22 | +static uint32_t get_bsp_flag(void) | |
| 23 | +{ | |
| 24 | + return rdmsr(MSR_IA32_APICBASE) & MSR_IA32_APICBASE_BSP; | |
| 25 | +} | |
| 26 | + | |
| 27 | +static void guest_bsp_vcpu(void *arg) | |
| 28 | +{ | |
| 29 | + GUEST_SYNC(1); | |
| 30 | + | |
| 31 | + GUEST_ASSERT(get_bsp_flag() != 0); | |
| 32 | + | |
| 33 | + GUEST_DONE(); | |
| 34 | +} | |
| 35 | + | |
| 36 | +static void guest_not_bsp_vcpu(void *arg) | |
| 37 | +{ | |
| 38 | + GUEST_SYNC(1); | |
| 39 | + | |
| 40 | + GUEST_ASSERT(get_bsp_flag() == 0); | |
| 41 | + | |
| 42 | + GUEST_DONE(); | |
| 43 | +} | |
| 44 | + | |
| 45 | +static void test_set_boot_busy(struct kvm_vm *vm) | |
| 46 | +{ | |
| 47 | + int res; | |
| 48 | + | |
| 49 | + res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID0); | |
| 50 | + TEST_ASSERT(res == -1 && errno == EBUSY, | |
| 51 | + "KVM_SET_BOOT_CPU_ID set while running vm"); | |
| 52 | +} | |
| 53 | + | |
| 54 | +static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid) | |
| 55 | +{ | |
| 56 | + struct ucall uc; | |
| 57 | + int stage; | |
| 58 | + | |
| 59 | + for (stage = 0; stage < 2; stage++) { | |
| 60 | + | |
| 61 | + vcpu_run(vm, vcpuid); | |
| 62 | + | |
| 63 | + switch (get_ucall(vm, vcpuid, &uc)) { | |
| 64 | + case UCALL_SYNC: | |
| 65 | + TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") && | |
| 66 | + uc.args[1] == stage + 1, | |
| 67 | + "Stage %d: Unexpected register values vmexit, got %lx", | |
| 68 | + stage + 1, (ulong)uc.args[1]); | |
| 69 | + test_set_boot_busy(vm); | |
| 70 | + break; | |
| 71 | + case UCALL_DONE: | |
| 72 | + TEST_ASSERT(stage == 1, | |
| 73 | + "Expected GUEST_DONE in stage 2, got stage %d", | |
| 74 | + stage); | |
| 75 | + break; | |
| 76 | + case UCALL_ABORT: | |
| 77 | + TEST_ASSERT(false, "%s at %s:%ld\n\tvalues: %#lx, %#lx", | |
| 78 | + (const char *)uc.args[0], __FILE__, | |
| 79 | + uc.args[1], uc.args[2], uc.args[3]); | |
| 80 | + default: | |
| 81 | + TEST_ASSERT(false, "Unexpected exit: %s", | |
| 82 | + exit_reason_str(vcpu_state(vm, vcpuid)->exit_reason)); | |
| 83 | + } | |
| 84 | + } | |
| 85 | +} | |
| 86 | + | |
| 87 | +static struct kvm_vm *create_vm(void) | |
| 88 | +{ | |
| 89 | + struct kvm_vm *vm; | |
| 90 | + uint64_t vcpu_pages = (DEFAULT_STACK_PGS) * 2; | |
| 91 | + uint64_t extra_pg_pages = vcpu_pages / PTES_PER_MIN_PAGE * N_VCPU; | |
| 92 | + uint64_t pages = DEFAULT_GUEST_PHY_PAGES + vcpu_pages + extra_pg_pages; | |
| 93 | + | |
| 94 | + pages = vm_adjust_num_guest_pages(VM_MODE_DEFAULT, pages); | |
| 95 | + vm = vm_create(VM_MODE_DEFAULT, pages, O_RDWR); | |
| 96 | + | |
| 97 | + kvm_vm_elf_load(vm, program_invocation_name, 0, 0); | |
| 98 | + vm_create_irqchip(vm); | |
| 99 | + | |
| 100 | + return vm; | |
| 101 | +} | |
| 102 | + | |
| 103 | +static void add_x86_vcpu(struct kvm_vm *vm, uint32_t vcpuid, bool bsp_code) | |
| 104 | +{ | |
| 105 | + if (bsp_code) | |
| 106 | + vm_vcpu_add_default(vm, vcpuid, guest_bsp_vcpu); | |
| 107 | + else | |
| 108 | + vm_vcpu_add_default(vm, vcpuid, guest_not_bsp_vcpu); | |
| 109 | + | |
| 110 | + vcpu_set_cpuid(vm, vcpuid, kvm_get_supported_cpuid()); | |
| 111 | +} | |
| 112 | + | |
| 113 | +static void run_vm_bsp(uint32_t bsp_vcpu) | |
| 114 | +{ | |
| 115 | + struct kvm_vm *vm; | |
| 116 | + bool is_bsp_vcpu1 = bsp_vcpu == VCPU_ID1; | |
| 117 | + | |
| 118 | + vm = create_vm(); | |
| 119 | + | |
| 120 | + if (is_bsp_vcpu1) | |
| 121 | + vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1); | |
| 122 | + | |
| 123 | + add_x86_vcpu(vm, VCPU_ID0, !is_bsp_vcpu1); | |
| 124 | + add_x86_vcpu(vm, VCPU_ID1, is_bsp_vcpu1); | |
| 125 | + | |
| 126 | + run_vcpu(vm, VCPU_ID0); | |
| 127 | + run_vcpu(vm, VCPU_ID1); | |
| 128 | + | |
| 129 | + kvm_vm_free(vm); | |
| 130 | +} | |
| 131 | + | |
| 132 | +static void check_set_bsp_busy(void) | |
| 133 | +{ | |
| 134 | + struct kvm_vm *vm; | |
| 135 | + int res; | |
| 136 | + | |
| 137 | + vm = create_vm(); | |
| 138 | + | |
| 139 | + add_x86_vcpu(vm, VCPU_ID0, true); | |
| 140 | + add_x86_vcpu(vm, VCPU_ID1, false); | |
| 141 | + | |
| 142 | + res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1); | |
| 143 | + TEST_ASSERT(res == -1 && errno == EBUSY, "KVM_SET_BOOT_CPU_ID set after adding vcpu"); | |
| 144 | + | |
| 145 | + run_vcpu(vm, VCPU_ID0); | |
| 146 | + run_vcpu(vm, VCPU_ID1); | |
| 147 | + | |
| 148 | + res = _vm_ioctl(vm, KVM_SET_BOOT_CPU_ID, (void *) VCPU_ID1); | |
| 149 | + TEST_ASSERT(res == -1 && errno == EBUSY, "KVM_SET_BOOT_CPU_ID set to a terminated vcpu"); | |
| 150 | + | |
| 151 | + kvm_vm_free(vm); | |
| 152 | +} | |
| 153 | + | |
| 154 | +int main(int argc, char *argv[]) | |
| 155 | +{ | |
| 156 | + if (!kvm_check_cap(KVM_CAP_SET_BOOT_CPU_ID)) { | |
| 157 | + print_skip("set_boot_cpu_id not available"); | |
| 158 | + return 0; | |
| 159 | + } | |
| 160 | + | |
| 161 | + run_vm_bsp(VCPU_ID0); | |
| 162 | + run_vm_bsp(VCPU_ID1); | |
| 163 | + run_vm_bsp(VCPU_ID0); | |
| 164 | + | |
| 165 | + check_set_bsp_busy(); | |
| 166 | +} | |