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

Configure Feed

Select the types of activity you want to include in your feed.

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

Cross-merge networking fixes after downstream PR (net-6.19-rc5).

No conflicts, or adjacent changes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+2153 -892
+3
.mailmap
··· 416 416 Juha Yrjola <juha.yrjola@nokia.com> 417 417 Juha Yrjola <juha.yrjola@solidboot.com> 418 418 Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com> 419 + Justin Iurman <justin.iurman@gmail.com> <justin.iurman@uliege.be> 419 420 Iskren Chernev <me@iskren.info> <iskren.chernev@gmail.com> 420 421 Kalle Valo <kvalo@kernel.org> <kvalo@codeaurora.org> 421 422 Kalle Valo <kvalo@kernel.org> <quic_kvalo@quicinc.com> ··· 706 705 Santosh Shilimkar <santosh.shilimkar@oracle.org> 707 706 Santosh Shilimkar <ssantosh@kernel.org> 708 707 Sarangdhar Joshi <spjoshi@codeaurora.org> 708 + Saravana Kannan <saravanak@kernel.org> <skannan@codeaurora.org> 709 + Saravana Kannan <saravanak@kernel.org> <saravanak@google.com> 709 710 Sascha Hauer <s.hauer@pengutronix.de> 710 711 Sahitya Tummala <quic_stummala@quicinc.com> <stummala@codeaurora.org> 711 712 Sathishkumar Muruganandam <quic_murugana@quicinc.com> <murugana@codeaurora.org>
+4 -2
Documentation/netlink/specs/netdev.yaml
··· 142 142 name: ifindex 143 143 doc: | 144 144 ifindex of the netdev to which the pool belongs. 145 - May be reported as 0 if the page pool was allocated for a netdev 145 + May not be reported if the page pool was allocated for a netdev 146 146 which got destroyed already (page pools may outlast their netdevs 147 147 because they wait for all memory to be returned). 148 148 type: u32 ··· 601 601 name: page-pool-get 602 602 doc: | 603 603 Get / dump information about Page Pools. 604 - (Only Page Pools associated with a net_device can be listed.) 604 + Only Page Pools associated by the driver with a net_device 605 + can be listed. ifindex will not be reported if the net_device 606 + no longer exists. 605 607 attribute-set: page-pool 606 608 do: 607 609 request:
+5 -4
MAINTAINERS
··· 1283 1283 1284 1284 AMD XGBE DRIVER 1285 1285 M: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com> 1286 + M: Raju Rangoju <Raju.Rangoju@amd.com> 1286 1287 L: netdev@vger.kernel.org 1287 1288 S: Maintained 1288 1289 F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi ··· 6533 6532 F: tools/testing/selftests/cpufreq/ 6534 6533 6535 6534 CPU FREQUENCY DRIVERS - VIRTUAL MACHINE CPUFREQ 6536 - M: Saravana Kannan <saravanak@google.com> 6535 + M: Saravana Kannan <saravanak@kernel.org> 6537 6536 L: linux-pm@vger.kernel.org 6538 6537 S: Maintained 6539 6538 F: drivers/cpufreq/virtual-cpufreq.c ··· 7171 7170 F: include/linux/devcoredump.h 7172 7171 7173 7172 DEVICE DEPENDENCY HELPER SCRIPT 7174 - M: Saravana Kannan <saravanak@google.com> 7173 + M: Saravana Kannan <saravanak@kernel.org> 7175 7174 L: linux-kernel@vger.kernel.org 7176 7175 S: Maintained 7177 7176 F: scripts/dev-needs.sh ··· 18284 18283 X: tools/testing/selftests/net/can/ 18285 18284 18286 18285 NETWORKING [IOAM] 18287 - M: Justin Iurman <justin.iurman@uliege.be> 18286 + M: Justin Iurman <justin.iurman@gmail.com> 18288 18287 S: Maintained 18289 18288 F: Documentation/networking/ioam6* 18290 18289 F: include/linux/ioam6* ··· 19548 19547 19549 19548 OPEN FIRMWARE AND FLATTENED DEVICE TREE 19550 19549 M: Rob Herring <robh@kernel.org> 19551 - M: Saravana Kannan <saravanak@google.com> 19550 + M: Saravana Kannan <saravanak@kernel.org> 19552 19551 L: devicetree@vger.kernel.org 19553 19552 S: Maintained 19554 19553 Q: http://patchwork.kernel.org/project/devicetree/list/
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 19 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc3 5 + EXTRAVERSION = -rc4 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+7
arch/loongarch/include/asm/loongarch.h
··· 94 94 #define CPUCFG2_LSPW BIT(21) 95 95 #define CPUCFG2_LAM BIT(22) 96 96 #define CPUCFG2_PTW BIT(24) 97 + #define CPUCFG2_FRECIPE BIT(25) 98 + #define CPUCFG2_DIV32 BIT(26) 99 + #define CPUCFG2_LAM_BH BIT(27) 100 + #define CPUCFG2_LAMCAS BIT(28) 101 + #define CPUCFG2_LLACQ_SCREL BIT(29) 102 + #define CPUCFG2_SCQ BIT(30) 97 103 98 104 #define LOONGARCH_CPUCFG3 0x3 99 105 #define CPUCFG3_CCDMA BIT(0) ··· 114 108 #define CPUCFG3_SPW_HG_HF BIT(11) 115 109 #define CPUCFG3_RVA BIT(12) 116 110 #define CPUCFG3_RVAMAX GENMASK(16, 13) 111 + #define CPUCFG3_DBAR_HINTS BIT(17) 117 112 #define CPUCFG3_ALDORDER_CAP BIT(18) /* All address load ordered, capability */ 118 113 #define CPUCFG3_ASTORDER_CAP BIT(19) /* All address store ordered, capability */ 119 114 #define CPUCFG3_ALDORDER_STA BIT(20) /* All address load ordered, status */
+2 -2
arch/loongarch/kernel/head.S
··· 42 42 .align 12 43 43 44 44 SYM_CODE_START(kernel_entry) # kernel entry point 45 + UNWIND_HINT_END_OF_STACK 45 46 46 47 SETUP_TWINS 47 48 SETUP_MODES t0 ··· 114 113 * function after setting up the stack and tp registers. 115 114 */ 116 115 SYM_CODE_START(smpboot_entry) 116 + UNWIND_HINT_END_OF_STACK 117 117 118 118 SETUP_TWINS 119 119 SETUP_MODES t0 ··· 144 142 SYM_CODE_END(smpboot_entry) 145 143 146 144 #endif /* CONFIG_SMP */ 147 - 148 - SYM_ENTRY(kernel_entry_end, SYM_L_GLOBAL, SYM_A_NONE)
+10 -4
arch/loongarch/kernel/mcount_dyn.S
··· 94 94 * at the callsite, so there is no need to restore the T series regs. 95 95 */ 96 96 ftrace_common_return: 97 - PTR_L ra, sp, PT_R1 98 97 PTR_L a0, sp, PT_R4 99 98 PTR_L a1, sp, PT_R5 100 99 PTR_L a2, sp, PT_R6 ··· 103 104 PTR_L a6, sp, PT_R10 104 105 PTR_L a7, sp, PT_R11 105 106 PTR_L fp, sp, PT_R22 106 - PTR_L t0, sp, PT_ERA 107 107 PTR_L t1, sp, PT_R13 108 - PTR_ADDI sp, sp, PT_SIZE 109 108 bnez t1, .Ldirect 109 + 110 + PTR_L ra, sp, PT_R1 111 + PTR_L t0, sp, PT_ERA 112 + PTR_ADDI sp, sp, PT_SIZE 110 113 jr t0 111 114 .Ldirect: 115 + PTR_L t0, sp, PT_R1 116 + PTR_L ra, sp, PT_ERA 117 + PTR_ADDI sp, sp, PT_SIZE 112 118 jr t1 113 119 SYM_CODE_END(ftrace_common) 114 120 ··· 165 161 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 166 162 SYM_CODE_START(ftrace_stub_direct_tramp) 167 163 UNWIND_HINT_UNDEFINED 168 - jr t0 164 + move t1, ra 165 + move ra, t0 166 + jr t1 169 167 SYM_CODE_END(ftrace_stub_direct_tramp) 170 168 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
+5
arch/loongarch/kernel/traps.c
··· 535 535 asmlinkage void noinstr do_ade(struct pt_regs *regs) 536 536 { 537 537 irqentry_state_t state = irqentry_enter(regs); 538 + unsigned int esubcode = FIELD_GET(CSR_ESTAT_ESUBCODE, regs->csr_estat); 539 + 540 + if ((esubcode == EXSUBCODE_ADEM) && fixup_exception(regs)) 541 + goto out; 538 542 539 543 die_if_kernel("Kernel ade access", regs); 540 544 force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)regs->csr_badvaddr); 541 545 546 + out: 542 547 irqentry_exit(regs, state); 543 548 } 544 549
+5 -22
arch/loongarch/kernel/unwind_orc.c
··· 348 348 } 349 349 EXPORT_SYMBOL_GPL(unwind_start); 350 350 351 - static bool is_entry_func(unsigned long addr) 352 - { 353 - extern u32 kernel_entry; 354 - extern u32 kernel_entry_end; 355 - 356 - return addr >= (unsigned long)&kernel_entry && addr < (unsigned long)&kernel_entry_end; 357 - } 358 - 359 351 static inline unsigned long bt_address(unsigned long ra) 360 352 { 361 353 extern unsigned long eentry; 362 - 363 - if (__kernel_text_address(ra)) 364 - return ra; 365 - 366 - if (__module_text_address(ra)) 367 - return ra; 368 354 369 355 if (ra >= eentry && ra < eentry + EXCCODE_INT_END * VECSIZE) { 370 356 unsigned long func; ··· 369 383 break; 370 384 } 371 385 372 - return func + offset; 386 + ra = func + offset; 373 387 } 374 388 375 - return ra; 389 + if (__kernel_text_address(ra)) 390 + return ra; 391 + 392 + return 0; 376 393 } 377 394 378 395 bool unwind_next_frame(struct unwind_state *state) ··· 390 401 391 402 /* Don't let modules unload while we're reading their ORC data. */ 392 403 guard(rcu)(); 393 - 394 - if (is_entry_func(state->pc)) 395 - goto end; 396 404 397 405 orc = orc_find(state->pc); 398 406 if (!orc) { ··· 497 511 pr_err("cannot find unwind pc at %p\n", (void *)pc); 498 512 goto err; 499 513 } 500 - 501 - if (!__kernel_text_address(state->pc)) 502 - goto err; 503 514 504 515 return true; 505 516
+4 -4
arch/loongarch/mm/cache.c
··· 160 160 161 161 static const pgprot_t protection_map[16] = { 162 162 [VM_NONE] = __pgprot(_CACHE_CC | _PAGE_USER | 163 - _PAGE_PROTNONE | _PAGE_NO_EXEC | 164 - _PAGE_NO_READ), 163 + _PAGE_NO_EXEC | _PAGE_NO_READ | 164 + (_PAGE_PROTNONE ? : _PAGE_PRESENT)), 165 165 [VM_READ] = __pgprot(_CACHE_CC | _PAGE_VALID | 166 166 _PAGE_USER | _PAGE_PRESENT | 167 167 _PAGE_NO_EXEC), ··· 180 180 [VM_EXEC | VM_WRITE | VM_READ] = __pgprot(_CACHE_CC | _PAGE_VALID | 181 181 _PAGE_USER | _PAGE_PRESENT), 182 182 [VM_SHARED] = __pgprot(_CACHE_CC | _PAGE_USER | 183 - _PAGE_PROTNONE | _PAGE_NO_EXEC | 184 - _PAGE_NO_READ), 183 + _PAGE_NO_EXEC | _PAGE_NO_READ | 184 + (_PAGE_PROTNONE ? : _PAGE_PRESENT)), 185 185 [VM_SHARED | VM_READ] = __pgprot(_CACHE_CC | _PAGE_VALID | 186 186 _PAGE_USER | _PAGE_PRESENT | 187 187 _PAGE_NO_EXEC),
+47 -11
arch/loongarch/net/bpf_jit.c
··· 139 139 stack_adjust = round_up(stack_adjust, 16); 140 140 stack_adjust += bpf_stack_adjust; 141 141 142 + move_reg(ctx, LOONGARCH_GPR_T0, LOONGARCH_GPR_RA); 142 143 /* Reserve space for the move_imm + jirl instruction */ 143 144 for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++) 144 145 emit_insn(ctx, nop); ··· 239 238 * Call the next bpf prog and skip the first instruction 240 239 * of TCC initialization. 241 240 */ 242 - emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T3, 6); 241 + emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T3, 7); 243 242 } 244 243 } 245 244 ··· 281 280 * goto out; 282 281 */ 283 282 tc_ninsn = insn ? ctx->offset[insn+1] - ctx->offset[insn] : ctx->offset[0]; 283 + emit_zext_32(ctx, a2, true); 284 + 284 285 off = offsetof(struct bpf_array, map.max_entries); 285 286 emit_insn(ctx, ldwu, t1, a1, off); 286 287 /* bgeu $a2, $t1, jmp_offset */ ··· 953 950 emit_insn(ctx, ldd, REG_TCC, LOONGARCH_GPR_SP, tcc_ptr_off); 954 951 } 955 952 953 + if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) { 954 + const struct btf_func_model *m; 955 + int i; 956 + 957 + m = bpf_jit_find_kfunc_model(ctx->prog, insn); 958 + if (!m) 959 + return -EINVAL; 960 + 961 + for (i = 0; i < m->nr_args; i++) { 962 + u8 reg = regmap[BPF_REG_1 + i]; 963 + bool sign = m->arg_flags[i] & BTF_FMODEL_SIGNED_ARG; 964 + 965 + emit_abi_ext(ctx, reg, m->arg_size[i], sign); 966 + } 967 + } 968 + 956 969 move_addr(ctx, t1, func_addr); 957 970 emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0); 958 971 ··· 1284 1265 return 0; 1285 1266 } 1286 1267 1287 - return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_T0 : LOONGARCH_GPR_ZERO, (u64)target); 1268 + return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_RA : LOONGARCH_GPR_ZERO, (u64)target); 1288 1269 } 1289 1270 1290 1271 static int emit_call(struct jit_ctx *ctx, u64 addr) ··· 1309 1290 { 1310 1291 int ret; 1311 1292 bool is_call; 1293 + unsigned long size = 0; 1294 + unsigned long offset = 0; 1295 + void *image = NULL; 1296 + char namebuf[KSYM_NAME_LEN]; 1312 1297 u32 old_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP}; 1313 1298 u32 new_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP}; 1314 1299 1315 1300 /* Only poking bpf text is supported. Since kernel function entry 1316 1301 * is set up by ftrace, we rely on ftrace to poke kernel functions. 1317 1302 */ 1318 - if (!is_bpf_text_address((unsigned long)ip)) 1303 + if (!__bpf_address_lookup((unsigned long)ip, &size, &offset, namebuf)) 1319 1304 return -ENOTSUPP; 1305 + 1306 + image = ip - offset; 1307 + 1308 + /* zero offset means we're poking bpf prog entry */ 1309 + if (offset == 0) { 1310 + /* skip to the nop instruction in bpf prog entry: 1311 + * move t0, ra 1312 + * nop 1313 + */ 1314 + ip = image + LOONGARCH_INSN_SIZE; 1315 + } 1320 1316 1321 1317 is_call = old_t == BPF_MOD_CALL; 1322 1318 ret = emit_jump_or_nops(old_addr, ip, old_insns, is_call); ··· 1656 1622 1657 1623 /* To traced function */ 1658 1624 /* Ftrace jump skips 2 NOP instructions */ 1659 - if (is_kernel_text((unsigned long)orig_call)) 1625 + if (is_kernel_text((unsigned long)orig_call) || 1626 + is_module_text_address((unsigned long)orig_call)) 1660 1627 orig_call += LOONGARCH_FENTRY_NBYTES; 1661 1628 /* Direct jump skips 5 NOP instructions */ 1662 1629 else if (is_bpf_text_address((unsigned long)orig_call)) 1663 1630 orig_call += LOONGARCH_BPF_FENTRY_NBYTES; 1664 - /* Module tracing not supported - cause kernel lockups */ 1665 - else if (is_module_text_address((unsigned long)orig_call)) 1666 - return -ENOTSUPP; 1667 1631 1668 1632 if (flags & BPF_TRAMP_F_CALL_ORIG) { 1669 1633 move_addr(ctx, LOONGARCH_GPR_A0, (const u64)im); ··· 1754 1722 emit_insn(ctx, ldd, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 0); 1755 1723 emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, 16); 1756 1724 1757 - if (flags & BPF_TRAMP_F_SKIP_FRAME) 1725 + if (flags & BPF_TRAMP_F_SKIP_FRAME) { 1758 1726 /* return to parent function */ 1759 - emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_RA, 0); 1760 - else 1761 - /* return to traced function */ 1727 + move_reg(ctx, LOONGARCH_GPR_RA, LOONGARCH_GPR_T0); 1762 1728 emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T0, 0); 1729 + } else { 1730 + /* return to traced function */ 1731 + move_reg(ctx, LOONGARCH_GPR_T1, LOONGARCH_GPR_RA); 1732 + move_reg(ctx, LOONGARCH_GPR_RA, LOONGARCH_GPR_T0); 1733 + emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T1, 0); 1734 + } 1763 1735 } 1764 1736 1765 1737 ret = ctx->idx;
+26
arch/loongarch/net/bpf_jit.h
··· 88 88 emit_insn(ctx, addiw, reg, reg, 0); 89 89 } 90 90 91 + /* Emit proper extension according to ABI requirements. 92 + * Note that it requires a value of size `size` already resides in register `reg`. 93 + */ 94 + static inline void emit_abi_ext(struct jit_ctx *ctx, int reg, u8 size, bool sign) 95 + { 96 + /* ABI requires unsigned char/short to be zero-extended */ 97 + if (!sign && (size == 1 || size == 2)) 98 + return; 99 + 100 + switch (size) { 101 + case 1: 102 + emit_insn(ctx, extwb, reg, reg); 103 + break; 104 + case 2: 105 + emit_insn(ctx, extwh, reg, reg); 106 + break; 107 + case 4: 108 + emit_insn(ctx, addiw, reg, reg, 0); 109 + break; 110 + case 8: 111 + break; 112 + default: 113 + pr_warn("bpf_jit: invalid size %d for extension\n", size); 114 + } 115 + } 116 + 91 117 static inline void move_addr(struct jit_ctx *ctx, enum loongarch_gpr rd, u64 addr) 92 118 { 93 119 u64 imm_11_0, imm_31_12, imm_51_32, imm_63_52;
+1 -1
arch/x86/kernel/cpu/microcode/amd.c
··· 258 258 if (fam == 0x1a) { 259 259 if (model <= 0x2f || 260 260 (0x40 <= model && model <= 0x4f) || 261 - (0x60 <= model && model <= 0x6f)) 261 + (0x60 <= model && model <= 0x7f)) 262 262 return true; 263 263 } 264 264
+1 -1
block/bfq-cgroup.c
··· 380 380 blkg_rwstat_add_aux(&to->merged, &from->merged); 381 381 blkg_rwstat_add_aux(&to->service_time, &from->service_time); 382 382 blkg_rwstat_add_aux(&to->wait_time, &from->wait_time); 383 - bfq_stat_add_aux(&from->time, &from->time); 383 + bfq_stat_add_aux(&to->time, &from->time); 384 384 bfq_stat_add_aux(&to->avg_queue_size_sum, &from->avg_queue_size_sum); 385 385 bfq_stat_add_aux(&to->avg_queue_size_samples, 386 386 &from->avg_queue_size_samples);
+1 -1
block/bfq-iosched.h
··· 984 984 * unused for the root group. Used to know whether there 985 985 * are groups with more than one active @bfq_entity 986 986 * (see the comments to the function 987 - * bfq_bfqq_may_idle()). 987 + * bfq_better_to_idle()). 988 988 * @rq_pos_tree: rbtree sorted by next_request position, used when 989 989 * determining if two or more queues have interleaving 990 990 * requests (see bfq_find_close_cooperator()).
+1 -1
block/blk-mq.c
··· 3721 3721 struct blk_mq_hw_ctx, cpuhp_online); 3722 3722 int ret = 0; 3723 3723 3724 - if (blk_mq_hctx_has_online_cpu(hctx, cpu)) 3724 + if (!hctx->nr_ctx || blk_mq_hctx_has_online_cpu(hctx, cpu)) 3725 3725 return 0; 3726 3726 3727 3727 /*
+2 -1
drivers/atm/he.c
··· 1587 1587 he_dev->tbrq_base, he_dev->tbrq_phys); 1588 1588 1589 1589 if (he_dev->tpdrq_base) 1590 - dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), 1590 + dma_free_coherent(&he_dev->pci_dev->dev, 1591 + CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), 1591 1592 he_dev->tpdrq_base, he_dev->tpdrq_phys); 1592 1593 1593 1594 dma_pool_destroy(he_dev->tpd_pool);
+32 -3
drivers/block/ublk_drv.c
··· 237 237 bool canceling; 238 238 pid_t ublksrv_tgid; 239 239 struct delayed_work exit_work; 240 + struct work_struct partition_scan_work; 240 241 241 242 struct ublk_queue *queues[]; 242 243 }; ··· 254 253 static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub, 255 254 u16 q_id, u16 tag, struct ublk_io *io, size_t offset); 256 255 static inline unsigned int ublk_req_build_flags(struct request *req); 256 + 257 + static void ublk_partition_scan_work(struct work_struct *work) 258 + { 259 + struct ublk_device *ub = 260 + container_of(work, struct ublk_device, partition_scan_work); 261 + 262 + if (WARN_ON_ONCE(!test_and_clear_bit(GD_SUPPRESS_PART_SCAN, 263 + &ub->ub_disk->state))) 264 + return; 265 + 266 + mutex_lock(&ub->ub_disk->open_mutex); 267 + bdev_disk_changed(ub->ub_disk, false); 268 + mutex_unlock(&ub->ub_disk->open_mutex); 269 + } 257 270 258 271 static inline struct ublksrv_io_desc * 259 272 ublk_get_iod(const struct ublk_queue *ubq, unsigned tag) ··· 2041 2026 mutex_lock(&ub->mutex); 2042 2027 ublk_stop_dev_unlocked(ub); 2043 2028 mutex_unlock(&ub->mutex); 2029 + flush_work(&ub->partition_scan_work); 2044 2030 ublk_cancel_dev(ub); 2045 2031 } 2046 2032 ··· 2970 2954 2971 2955 ublk_apply_params(ub); 2972 2956 2973 - /* don't probe partitions if any daemon task is un-trusted */ 2974 - if (ub->unprivileged_daemons) 2975 - set_bit(GD_SUPPRESS_PART_SCAN, &disk->state); 2957 + /* 2958 + * Suppress partition scan to avoid potential IO hang. 2959 + * 2960 + * If ublk server error occurs during partition scan, the IO may 2961 + * wait while holding ub->mutex, which can deadlock with other 2962 + * operations that need the mutex. Defer partition scan to async 2963 + * work. 2964 + * For unprivileged daemons, keep GD_SUPPRESS_PART_SCAN set 2965 + * permanently. 2966 + */ 2967 + set_bit(GD_SUPPRESS_PART_SCAN, &disk->state); 2976 2968 2977 2969 ublk_get_device(ub); 2978 2970 ub->dev_info.state = UBLK_S_DEV_LIVE; ··· 2996 2972 goto out_put_cdev; 2997 2973 2998 2974 set_bit(UB_STATE_USED, &ub->state); 2975 + 2976 + /* Schedule async partition scan for trusted daemons */ 2977 + if (!ub->unprivileged_daemons) 2978 + schedule_work(&ub->partition_scan_work); 2999 2979 3000 2980 out_put_cdev: 3001 2981 if (ret) { ··· 3166 3138 mutex_init(&ub->mutex); 3167 3139 spin_lock_init(&ub->lock); 3168 3140 mutex_init(&ub->cancel_mutex); 3141 + INIT_WORK(&ub->partition_scan_work, ublk_partition_scan_work); 3169 3142 3170 3143 ret = ublk_alloc_dev_number(ub, header->dev_id); 3171 3144 if (ret < 0)
+3 -2
drivers/gpu/drm/drm_gem_shmem_helper.c
··· 96 96 /** 97 97 * drm_gem_shmem_init - Initialize an allocated object. 98 98 * @dev: DRM device 99 - * @obj: The allocated shmem GEM object. 99 + * @shmem: The allocated shmem GEM object. 100 + * @size: Buffer size in bytes 100 101 * 101 102 * Returns: 102 103 * 0 on success, or a negative error code on failure. ··· 896 895 897 896 MODULE_DESCRIPTION("DRM SHMEM memory-management helpers"); 898 897 MODULE_IMPORT_NS("DMA_BUF"); 899 - MODULE_LICENSE("GPL v2"); 898 + MODULE_LICENSE("GPL");
+13 -4
drivers/gpu/drm/drm_pagemap.c
··· 3 3 * Copyright © 2024-2025 Intel Corporation 4 4 */ 5 5 6 + #include <linux/dma-fence.h> 6 7 #include <linux/dma-mapping.h> 7 8 #include <linux/migrate.h> 8 9 #include <linux/pagemap.h> ··· 409 408 drm_pagemap_get_devmem_page(page, zdd); 410 409 } 411 410 412 - err = ops->copy_to_devmem(pages, pagemap_addr, npages); 411 + err = ops->copy_to_devmem(pages, pagemap_addr, npages, 412 + devmem_allocation->pre_migrate_fence); 413 413 if (err) 414 414 goto err_finalize; 415 + 416 + dma_fence_put(devmem_allocation->pre_migrate_fence); 417 + devmem_allocation->pre_migrate_fence = NULL; 415 418 416 419 /* Upon success bind devmem allocation to range and zdd */ 417 420 devmem_allocation->timeslice_expiration = get_jiffies_64() + ··· 601 596 for (i = 0; i < npages; ++i) 602 597 pages[i] = migrate_pfn_to_page(src[i]); 603 598 604 - err = ops->copy_to_ram(pages, pagemap_addr, npages); 599 + err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL); 605 600 if (err) 606 601 goto err_finalize; 607 602 ··· 737 732 for (i = 0; i < npages; ++i) 738 733 pages[i] = migrate_pfn_to_page(migrate.src[i]); 739 734 740 - err = ops->copy_to_ram(pages, pagemap_addr, npages); 735 + err = ops->copy_to_ram(pages, pagemap_addr, npages, NULL); 741 736 if (err) 742 737 goto err_finalize; 743 738 ··· 818 813 * @ops: Pointer to the operations structure for GPU SVM device memory 819 814 * @dpagemap: The struct drm_pagemap we're allocating from. 820 815 * @size: Size of device memory allocation 816 + * @pre_migrate_fence: Fence to wait for or pipeline behind before migration starts. 817 + * (May be NULL). 821 818 */ 822 819 void drm_pagemap_devmem_init(struct drm_pagemap_devmem *devmem_allocation, 823 820 struct device *dev, struct mm_struct *mm, 824 821 const struct drm_pagemap_devmem_ops *ops, 825 - struct drm_pagemap *dpagemap, size_t size) 822 + struct drm_pagemap *dpagemap, size_t size, 823 + struct dma_fence *pre_migrate_fence) 826 824 { 827 825 init_completion(&devmem_allocation->detached); 828 826 devmem_allocation->dev = dev; ··· 833 825 devmem_allocation->ops = ops; 834 826 devmem_allocation->dpagemap = dpagemap; 835 827 devmem_allocation->size = size; 828 + devmem_allocation->pre_migrate_fence = pre_migrate_fence; 836 829 } 837 830 EXPORT_SYMBOL_GPL(drm_pagemap_devmem_init); 838 831
+17 -20
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
··· 951 951 vma = eb_lookup_vma(eb, eb->exec[i].handle); 952 952 if (IS_ERR(vma)) { 953 953 err = PTR_ERR(vma); 954 - goto err; 954 + return err; 955 955 } 956 956 957 957 err = eb_validate_vma(eb, &eb->exec[i], vma); 958 958 if (unlikely(err)) { 959 959 i915_vma_put(vma); 960 - goto err; 960 + return err; 961 961 } 962 962 963 963 err = eb_add_vma(eb, &current_batch, i, vma); ··· 966 966 967 967 if (i915_gem_object_is_userptr(vma->obj)) { 968 968 err = i915_gem_object_userptr_submit_init(vma->obj); 969 - if (err) { 970 - if (i + 1 < eb->buffer_count) { 971 - /* 972 - * Execbuffer code expects last vma entry to be NULL, 973 - * since we already initialized this entry, 974 - * set the next value to NULL or we mess up 975 - * cleanup handling. 976 - */ 977 - eb->vma[i + 1].vma = NULL; 978 - } 979 - 969 + if (err) 980 970 return err; 981 - } 982 971 983 972 eb->vma[i].flags |= __EXEC_OBJECT_USERPTR_INIT; 984 973 eb->args->flags |= __EXEC_USERPTR_USED; ··· 975 986 } 976 987 977 988 return 0; 978 - 979 - err: 980 - eb->vma[i].vma = NULL; 981 - return err; 982 989 } 983 990 984 991 static int eb_lock_vmas(struct i915_execbuffer *eb) ··· 3360 3375 3361 3376 eb.exec = exec; 3362 3377 eb.vma = (struct eb_vma *)(exec + args->buffer_count + 1); 3363 - eb.vma[0].vma = NULL; 3378 + memset(eb.vma, 0, (args->buffer_count + 1) * sizeof(struct eb_vma)); 3379 + 3364 3380 eb.batch_pool = NULL; 3365 3381 3366 3382 eb.invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS; ··· 3570 3584 if (err) 3571 3585 return err; 3572 3586 3573 - /* Allocate extra slots for use by the command parser */ 3587 + /* 3588 + * Allocate extra slots for use by the command parser. 3589 + * 3590 + * Note that this allocation handles two different arrays (the 3591 + * exec2_list array, and the eventual eb.vma array introduced in 3592 + * i915_gem_do_execbuffer()), that reside in virtually contiguous 3593 + * memory. Also note that the allocation intentionally doesn't fill the 3594 + * area with zeros, because the exec2_list part doesn't need to be, as 3595 + * it's immediately overwritten by user data a few lines below. 3596 + * However, the eb.vma part is explicitly zeroed later in 3597 + * i915_gem_do_execbuffer(). 3598 + */ 3574 3599 exec2_list = kvmalloc_array(count + 2, eb_element_size(), 3575 3600 __GFP_NOWARN | GFP_KERNEL); 3576 3601 if (exec2_list == NULL) {
+11
drivers/gpu/drm/imagination/pvr_gem.c
··· 28 28 drm_gem_shmem_object_free(obj); 29 29 } 30 30 31 + static struct dma_buf *pvr_gem_export(struct drm_gem_object *obj, int flags) 32 + { 33 + struct pvr_gem_object *pvr_obj = gem_to_pvr_gem(obj); 34 + 35 + if (pvr_obj->flags & DRM_PVR_BO_PM_FW_PROTECT) 36 + return ERR_PTR(-EPERM); 37 + 38 + return drm_gem_prime_export(obj, flags); 39 + } 40 + 31 41 static int pvr_gem_mmap(struct drm_gem_object *gem_obj, struct vm_area_struct *vma) 32 42 { 33 43 struct pvr_gem_object *pvr_obj = gem_to_pvr_gem(gem_obj); ··· 52 42 static const struct drm_gem_object_funcs pvr_gem_object_funcs = { 53 43 .free = pvr_gem_object_free, 54 44 .print_info = drm_gem_shmem_object_print_info, 45 + .export = pvr_gem_export, 55 46 .pin = drm_gem_shmem_object_pin, 56 47 .unpin = drm_gem_shmem_object_unpin, 57 48 .get_sg_table = drm_gem_shmem_object_get_sg_table,
+13
drivers/gpu/drm/nouveau/dispnv50/atom.h
··· 152 152 nv50_head_atom_get(struct drm_atomic_state *state, struct drm_crtc *crtc) 153 153 { 154 154 struct drm_crtc_state *statec = drm_atomic_get_crtc_state(state, crtc); 155 + 155 156 if (IS_ERR(statec)) 156 157 return (void *)statec; 158 + 159 + return nv50_head_atom(statec); 160 + } 161 + 162 + static inline struct nv50_head_atom * 163 + nv50_head_atom_get_new(struct drm_atomic_state *state, struct drm_crtc *crtc) 164 + { 165 + struct drm_crtc_state *statec = drm_atomic_get_new_crtc_state(state, crtc); 166 + 167 + if (!statec) 168 + return NULL; 169 + 157 170 return nv50_head_atom(statec); 158 171 } 159 172
+1 -1
drivers/gpu/drm/nouveau/dispnv50/wndw.c
··· 583 583 asyw->image.offset[0] = nvbo->offset; 584 584 585 585 if (wndw->func->prepare) { 586 - asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc); 586 + asyh = nv50_head_atom_get_new(asyw->state.state, asyw->state.crtc); 587 587 if (IS_ERR(asyh)) 588 588 return PTR_ERR(asyh); 589 589
+10 -4
drivers/gpu/drm/xe/xe_guc_ct.c
··· 104 104 { 105 105 g2h_fence->cancel = true; 106 106 g2h_fence->fail = true; 107 - g2h_fence->done = true; 107 + 108 + /* WRITE_ONCE pairs with READ_ONCEs in guc_ct_send_recv. */ 109 + WRITE_ONCE(g2h_fence->done, true); 108 110 } 109 111 110 112 static bool g2h_fence_needs_alloc(struct g2h_fence *g2h_fence) ··· 1205 1203 return ret; 1206 1204 } 1207 1205 1208 - ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ); 1206 + /* READ_ONCEs pairs with WRITE_ONCEs in parse_g2h_response 1207 + * and g2h_fence_cancel. 1208 + */ 1209 + ret = wait_event_timeout(ct->g2h_fence_wq, READ_ONCE(g2h_fence.done), HZ); 1209 1210 if (!ret) { 1210 1211 LNL_FLUSH_WORK(&ct->g2h_worker); 1211 - if (g2h_fence.done) { 1212 + if (READ_ONCE(g2h_fence.done)) { 1212 1213 xe_gt_warn(gt, "G2H fence %u, action %04x, done\n", 1213 1214 g2h_fence.seqno, action[0]); 1214 1215 ret = 1; ··· 1459 1454 1460 1455 g2h_release_space(ct, GUC_CTB_HXG_MSG_MAX_LEN); 1461 1456 1462 - g2h_fence->done = true; 1457 + /* WRITE_ONCE pairs with READ_ONCEs in guc_ct_send_recv. */ 1458 + WRITE_ONCE(g2h_fence->done, true); 1463 1459 smp_mb(); 1464 1460 1465 1461 wake_up_all(&ct->g2h_fence_wq);
+20 -5
drivers/gpu/drm/xe/xe_migrate.c
··· 2062 2062 unsigned long sram_offset, 2063 2063 struct drm_pagemap_addr *sram_addr, 2064 2064 u64 vram_addr, 2065 + struct dma_fence *deps, 2065 2066 const enum xe_migrate_copy_dir dir) 2066 2067 { 2067 2068 struct xe_gt *gt = m->tile->primary_gt; ··· 2151 2150 2152 2151 xe_sched_job_add_migrate_flush(job, MI_INVALIDATE_TLB); 2153 2152 2153 + if (deps && !dma_fence_is_signaled(deps)) { 2154 + dma_fence_get(deps); 2155 + err = drm_sched_job_add_dependency(&job->drm, deps); 2156 + if (err) 2157 + dma_fence_wait(deps, false); 2158 + err = 0; 2159 + } 2160 + 2154 2161 mutex_lock(&m->job_mutex); 2155 2162 xe_sched_job_arm(job); 2156 2163 fence = dma_fence_get(&job->drm.s_fence->finished); ··· 2184 2175 * @npages: Number of pages to migrate. 2185 2176 * @src_addr: Array of DMA information (source of migrate) 2186 2177 * @dst_addr: Device physical address of VRAM (destination of migrate) 2178 + * @deps: struct dma_fence representing the dependencies that need 2179 + * to be signaled before migration. 2187 2180 * 2188 2181 * Copy from an array dma addresses to a VRAM device physical address 2189 2182 * ··· 2195 2184 struct dma_fence *xe_migrate_to_vram(struct xe_migrate *m, 2196 2185 unsigned long npages, 2197 2186 struct drm_pagemap_addr *src_addr, 2198 - u64 dst_addr) 2187 + u64 dst_addr, 2188 + struct dma_fence *deps) 2199 2189 { 2200 2190 return xe_migrate_vram(m, npages * PAGE_SIZE, 0, src_addr, dst_addr, 2201 - XE_MIGRATE_COPY_TO_VRAM); 2191 + deps, XE_MIGRATE_COPY_TO_VRAM); 2202 2192 } 2203 2193 2204 2194 /** ··· 2208 2196 * @npages: Number of pages to migrate. 2209 2197 * @src_addr: Device physical address of VRAM (source of migrate) 2210 2198 * @dst_addr: Array of DMA information (destination of migrate) 2199 + * @deps: struct dma_fence representing the dependencies that need 2200 + * to be signaled before migration. 2211 2201 * 2212 2202 * Copy from a VRAM device physical address to an array dma addresses 2213 2203 * ··· 2219 2205 struct dma_fence *xe_migrate_from_vram(struct xe_migrate *m, 2220 2206 unsigned long npages, 2221 2207 u64 src_addr, 2222 - struct drm_pagemap_addr *dst_addr) 2208 + struct drm_pagemap_addr *dst_addr, 2209 + struct dma_fence *deps) 2223 2210 { 2224 2211 return xe_migrate_vram(m, npages * PAGE_SIZE, 0, dst_addr, src_addr, 2225 - XE_MIGRATE_COPY_TO_SRAM); 2212 + deps, XE_MIGRATE_COPY_TO_SRAM); 2226 2213 } 2227 2214 2228 2215 static void xe_migrate_dma_unmap(struct xe_device *xe, ··· 2399 2384 __fence = xe_migrate_vram(m, current_bytes, 2400 2385 (unsigned long)buf & ~PAGE_MASK, 2401 2386 &pagemap_addr[current_page], 2402 - vram_addr, write ? 2387 + vram_addr, NULL, write ? 2403 2388 XE_MIGRATE_COPY_TO_VRAM : 2404 2389 XE_MIGRATE_COPY_TO_SRAM); 2405 2390 if (IS_ERR(__fence)) {
+4 -2
drivers/gpu/drm/xe/xe_migrate.h
··· 116 116 struct dma_fence *xe_migrate_to_vram(struct xe_migrate *m, 117 117 unsigned long npages, 118 118 struct drm_pagemap_addr *src_addr, 119 - u64 dst_addr); 119 + u64 dst_addr, 120 + struct dma_fence *deps); 120 121 121 122 struct dma_fence *xe_migrate_from_vram(struct xe_migrate *m, 122 123 unsigned long npages, 123 124 u64 src_addr, 124 - struct drm_pagemap_addr *dst_addr); 125 + struct drm_pagemap_addr *dst_addr, 126 + struct dma_fence *deps); 125 127 126 128 struct dma_fence *xe_migrate_copy(struct xe_migrate *m, 127 129 struct xe_bo *src_bo,
+38 -13
drivers/gpu/drm/xe/xe_svm.c
··· 476 476 477 477 static int xe_svm_copy(struct page **pages, 478 478 struct drm_pagemap_addr *pagemap_addr, 479 - unsigned long npages, const enum xe_svm_copy_dir dir) 479 + unsigned long npages, const enum xe_svm_copy_dir dir, 480 + struct dma_fence *pre_migrate_fence) 480 481 { 481 482 struct xe_vram_region *vr = NULL; 482 483 struct xe_gt *gt = NULL; ··· 566 565 __fence = xe_migrate_from_vram(vr->migrate, 567 566 i - pos + incr, 568 567 vram_addr, 569 - &pagemap_addr[pos]); 568 + &pagemap_addr[pos], 569 + pre_migrate_fence); 570 570 } else { 571 571 vm_dbg(&xe->drm, 572 572 "COPY TO VRAM - 0x%016llx -> 0x%016llx, NPAGES=%ld", ··· 576 574 __fence = xe_migrate_to_vram(vr->migrate, 577 575 i - pos + incr, 578 576 &pagemap_addr[pos], 579 - vram_addr); 577 + vram_addr, 578 + pre_migrate_fence); 580 579 } 581 580 if (IS_ERR(__fence)) { 582 581 err = PTR_ERR(__fence); 583 582 goto err_out; 584 583 } 585 - 584 + pre_migrate_fence = NULL; 586 585 dma_fence_put(fence); 587 586 fence = __fence; 588 587 } ··· 606 603 vram_addr, (u64)pagemap_addr[pos].addr, 1); 607 604 __fence = xe_migrate_from_vram(vr->migrate, 1, 608 605 vram_addr, 609 - &pagemap_addr[pos]); 606 + &pagemap_addr[pos], 607 + pre_migrate_fence); 610 608 } else { 611 609 vm_dbg(&xe->drm, 612 610 "COPY TO VRAM - 0x%016llx -> 0x%016llx, NPAGES=%d", 613 611 (u64)pagemap_addr[pos].addr, vram_addr, 1); 614 612 __fence = xe_migrate_to_vram(vr->migrate, 1, 615 613 &pagemap_addr[pos], 616 - vram_addr); 614 + vram_addr, 615 + pre_migrate_fence); 617 616 } 618 617 if (IS_ERR(__fence)) { 619 618 err = PTR_ERR(__fence); 620 619 goto err_out; 621 620 } 622 - 621 + pre_migrate_fence = NULL; 623 622 dma_fence_put(fence); 624 623 fence = __fence; 625 624 } ··· 634 629 dma_fence_wait(fence, false); 635 630 dma_fence_put(fence); 636 631 } 632 + if (pre_migrate_fence) 633 + dma_fence_wait(pre_migrate_fence, false); 637 634 638 635 /* 639 636 * XXX: We can't derive the GT here (or anywhere in this functions, but ··· 652 645 653 646 static int xe_svm_copy_to_devmem(struct page **pages, 654 647 struct drm_pagemap_addr *pagemap_addr, 655 - unsigned long npages) 648 + unsigned long npages, 649 + struct dma_fence *pre_migrate_fence) 656 650 { 657 - return xe_svm_copy(pages, pagemap_addr, npages, XE_SVM_COPY_TO_VRAM); 651 + return xe_svm_copy(pages, pagemap_addr, npages, XE_SVM_COPY_TO_VRAM, 652 + pre_migrate_fence); 658 653 } 659 654 660 655 static int xe_svm_copy_to_ram(struct page **pages, 661 656 struct drm_pagemap_addr *pagemap_addr, 662 - unsigned long npages) 657 + unsigned long npages, 658 + struct dma_fence *pre_migrate_fence) 663 659 { 664 - return xe_svm_copy(pages, pagemap_addr, npages, XE_SVM_COPY_TO_SRAM); 660 + return xe_svm_copy(pages, pagemap_addr, npages, XE_SVM_COPY_TO_SRAM, 661 + pre_migrate_fence); 665 662 } 666 663 667 664 static struct xe_bo *to_xe_bo(struct drm_pagemap_devmem *devmem_allocation) ··· 678 667 struct xe_bo *bo = to_xe_bo(devmem_allocation); 679 668 struct xe_device *xe = xe_bo_device(bo); 680 669 670 + dma_fence_put(devmem_allocation->pre_migrate_fence); 681 671 xe_bo_put_async(bo); 682 672 xe_pm_runtime_put(xe); 683 673 } ··· 873 861 unsigned long timeslice_ms) 874 862 { 875 863 struct xe_vram_region *vr = container_of(dpagemap, typeof(*vr), dpagemap); 864 + struct dma_fence *pre_migrate_fence = NULL; 876 865 struct xe_device *xe = vr->xe; 877 866 struct device *dev = xe->drm.dev; 878 867 struct drm_buddy_block *block; ··· 900 887 break; 901 888 } 902 889 890 + /* Ensure that any clearing or async eviction will complete before migration. */ 891 + if (!dma_resv_test_signaled(bo->ttm.base.resv, DMA_RESV_USAGE_KERNEL)) { 892 + err = dma_resv_get_singleton(bo->ttm.base.resv, DMA_RESV_USAGE_KERNEL, 893 + &pre_migrate_fence); 894 + if (err) 895 + dma_resv_wait_timeout(bo->ttm.base.resv, DMA_RESV_USAGE_KERNEL, 896 + false, MAX_SCHEDULE_TIMEOUT); 897 + else if (pre_migrate_fence) 898 + dma_fence_enable_sw_signaling(pre_migrate_fence); 899 + } 900 + 903 901 drm_pagemap_devmem_init(&bo->devmem_allocation, dev, mm, 904 - &dpagemap_devmem_ops, dpagemap, end - start); 902 + &dpagemap_devmem_ops, dpagemap, end - start, 903 + pre_migrate_fence); 905 904 906 905 blocks = &to_xe_ttm_vram_mgr_resource(bo->ttm.resource)->blocks; 907 906 list_for_each_entry(block, blocks, link) ··· 966 941 xe_assert(vm->xe, IS_DGFX(vm->xe)); 967 942 968 943 if (xe_svm_range_in_vram(range)) { 969 - drm_info(&vm->xe->drm, "Range is already in VRAM\n"); 944 + drm_dbg(&vm->xe->drm, "Range is already in VRAM\n"); 970 945 return false; 971 946 } 972 947
+4 -2
drivers/hid/bpf/progs/Makefile
··· 56 56 57 57 %.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT) 58 58 $(call msg,BPF,$@) 59 - $(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \ 60 - -c $(filter %.c,$^) -o $@ && \ 59 + $(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \ 60 + -Wno-microsoft-anon-tag \ 61 + -fms-extensions \ 62 + -c $(filter %.c,$^) -o $@ && \ 61 63 $(LLVM_STRIP) -g $@ 62 64 63 65 vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)
+13 -2
drivers/hid/hid-elecom.c
··· 77 77 break; 78 78 case USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB: 79 79 case USB_DEVICE_ID_ELECOM_M_XT3URBK_018F: 80 - case USB_DEVICE_ID_ELECOM_M_XT3DRBK: 80 + case USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC: 81 81 case USB_DEVICE_ID_ELECOM_M_XT4DRBK: 82 82 /* 83 83 * Report descriptor format: ··· 102 102 */ 103 103 mouse_button_fixup(hdev, rdesc, *rsize, 12, 30, 14, 20, 8); 104 104 break; 105 + case USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C: 106 + /* 107 + * Report descriptor format: 108 + * 22: button bit count 109 + * 30: padding bit count 110 + * 24: button report size 111 + * 16: button usage maximum 112 + */ 113 + mouse_button_fixup(hdev, rdesc, *rsize, 22, 30, 24, 16, 6); 114 + break; 105 115 case USB_DEVICE_ID_ELECOM_M_DT2DRBK: 106 116 case USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C: 107 117 /* ··· 132 122 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 133 123 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 134 124 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 135 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 125 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC) }, 126 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C) }, 136 127 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 137 128 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 138 129 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
+6 -1
drivers/hid/hid-ids.h
··· 317 317 #define USB_DEVICE_ID_CHICONY_ACER_SWITCH12 0x1421 318 318 #define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA 0xb824 319 319 #define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2 0xb82c 320 + #define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA3 0xb882 320 321 321 322 #define USB_VENDOR_ID_CHUNGHWAT 0x2247 322 323 #define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001 ··· 439 438 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001 440 439 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002 0xc002 441 440 441 + #define USB_VENDOR_ID_EDIFIER 0x2d99 442 + #define USB_DEVICE_ID_EDIFIER_QR30 0xa101 /* EDIFIER Hal0 2.0 SE */ 443 + 442 444 #define USB_VENDOR_ID_ELAN 0x04f3 443 445 #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401 444 446 #define USB_DEVICE_ID_HP_X2 0x074d ··· 455 451 #define USB_DEVICE_ID_ELECOM_M_XGL20DLBK 0x00e6 456 452 #define USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB 0x00fb 457 453 #define USB_DEVICE_ID_ELECOM_M_XT3URBK_018F 0x018f 458 - #define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc 454 + #define USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC 0x00fc 455 + #define USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C 0x018c 459 456 #define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd 460 457 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe 461 458 #define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff
+2
drivers/hid/hid-logitech-hidpp.c
··· 4662 4662 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb025) }, 4663 4663 { /* MX Master 3S mouse over Bluetooth */ 4664 4664 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb034) }, 4665 + { /* MX Anywhere 3S mouse over Bluetooth */ 4666 + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb037) }, 4665 4667 { /* MX Anywhere 3SB mouse over Bluetooth */ 4666 4668 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb038) }, 4667 4669 {}
+12 -1
drivers/hid/hid-multitouch.c
··· 81 81 #define MT_INPUTMODE_TOUCHPAD 0x03 82 82 83 83 #define MT_BUTTONTYPE_CLICKPAD 0 84 + #define MT_BUTTONTYPE_PRESSUREPAD 1 84 85 85 86 enum latency_mode { 86 87 HID_LATENCY_NORMAL = 0, ··· 180 179 __u8 inputmode_value; /* InputMode HID feature value */ 181 180 __u8 maxcontacts; 182 181 bool is_buttonpad; /* is this device a button pad? */ 182 + bool is_pressurepad; /* is this device a pressurepad? */ 183 183 bool is_haptic_touchpad; /* is this device a haptic touchpad? */ 184 184 bool serial_maybe; /* need to check for serial protocol */ 185 185 ··· 395 393 { .name = MT_CLS_VTL, 396 394 .quirks = MT_QUIRK_ALWAYS_VALID | 397 395 MT_QUIRK_CONTACT_CNT_ACCURATE | 396 + MT_QUIRK_STICKY_FINGERS | 398 397 MT_QUIRK_FORCE_GET_FEATURE, 399 398 }, 400 399 { .name = MT_CLS_GOOGLE, ··· 533 530 } 534 531 535 532 mt_get_feature(hdev, field->report); 536 - if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD) 533 + switch (field->value[usage->usage_index]) { 534 + case MT_BUTTONTYPE_CLICKPAD: 537 535 td->is_buttonpad = true; 536 + break; 537 + case MT_BUTTONTYPE_PRESSUREPAD: 538 + td->is_pressurepad = true; 539 + break; 540 + } 538 541 539 542 break; 540 543 case 0xff0000c5: ··· 1402 1393 1403 1394 if (td->is_buttonpad) 1404 1395 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 1396 + if (td->is_pressurepad) 1397 + __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit); 1405 1398 1406 1399 app->pending_palm_slots = devm_kcalloc(&hi->input->dev, 1407 1400 BITS_TO_LONGS(td->maxcontacts),
+5
drivers/hid/hid-playstation.c
··· 753 753 if (IS_ERR(gamepad)) 754 754 return ERR_CAST(gamepad); 755 755 756 + /* Set initial resting state for joysticks to 128 (center) */ 756 757 input_set_abs_params(gamepad, ABS_X, 0, 255, 0, 0); 758 + gamepad->absinfo[ABS_X].value = 128; 757 759 input_set_abs_params(gamepad, ABS_Y, 0, 255, 0, 0); 760 + gamepad->absinfo[ABS_Y].value = 128; 758 761 input_set_abs_params(gamepad, ABS_Z, 0, 255, 0, 0); 759 762 input_set_abs_params(gamepad, ABS_RX, 0, 255, 0, 0); 763 + gamepad->absinfo[ABS_RX].value = 128; 760 764 input_set_abs_params(gamepad, ABS_RY, 0, 255, 0, 0); 765 + gamepad->absinfo[ABS_RY].value = 128; 761 766 input_set_abs_params(gamepad, ABS_RZ, 0, 255, 0, 0); 762 767 763 768 input_set_abs_params(gamepad, ABS_HAT0X, -1, 1, 0, 0);
+13 -1
drivers/hid/hid-quirks.c
··· 81 81 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3), HID_QUIRK_MULTI_INPUT }, 82 82 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU), HID_QUIRK_MULTI_INPUT }, 83 83 { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER), HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET }, 84 + { HID_USB_DEVICE(USB_VENDOR_ID_EDIFIER, USB_DEVICE_ID_EDIFIER_QR30), HID_QUIRK_ALWAYS_POLL }, 84 85 { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_QUIRK_ALWAYS_POLL }, 85 86 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700), HID_QUIRK_NOGET }, 86 87 { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II), HID_QUIRK_MULTI_INPUT }, ··· 233 232 * used as a driver. See hid_scan_report(). 234 233 */ 235 234 static const struct hid_device_id hid_have_special_driver[] = { 235 + #if IS_ENABLED(CONFIG_APPLEDISPLAY) 236 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9218) }, 237 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9219) }, 238 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x921c) }, 239 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x921d) }, 240 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9222) }, 241 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9226) }, 242 + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9236) }, 243 + #endif 236 244 #if IS_ENABLED(CONFIG_HID_A4TECH) 237 245 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, 238 246 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) }, ··· 422 412 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 423 413 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 424 414 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 425 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 415 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC) }, 416 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C) }, 426 417 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 427 418 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 428 419 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, ··· 780 769 { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, 781 770 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA) }, 782 771 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2) }, 772 + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA3) }, 783 773 { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, 784 774 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, 785 775 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI4713) },
+1
drivers/hid/i2c-hid/i2c-hid-core.c
··· 286 286 * In addition to report data device will supply data length 287 287 * in the first 2 bytes of the response, so adjust . 288 288 */ 289 + recv_len = min(recv_len, ihid->bufsize - sizeof(__le16)); 289 290 error = i2c_hid_xfer(ihid, ihid->cmdbuf, length, 290 291 ihid->rawbuf, recv_len + sizeof(__le16)); 291 292 if (error) {
+1
drivers/hid/intel-ish-hid/ishtp-hid-client.c
··· 495 495 int rv; 496 496 497 497 /* Send HOSTIF_DM_ENUM_DEVICES */ 498 + client_data->enum_devices_done = false; 498 499 memset(&msg, 0, sizeof(struct hostif_msg)); 499 500 msg.hdr.command = HOSTIF_DM_ENUM_DEVICES; 500 501 rv = ishtp_cl_send(hid_ishtp_cl, (unsigned char *)&msg,
+10 -2
drivers/hid/intel-ish-hid/ishtp/bus.c
··· 240 240 { 241 241 struct ishtp_cl_device *device = to_ishtp_cl_device(dev); 242 242 struct ishtp_cl_driver *driver = to_ishtp_cl_driver(drv); 243 + struct ishtp_fw_client *client = device->fw_client; 244 + const struct ishtp_device_id *id; 243 245 244 - return(device->fw_client ? guid_equal(&driver->id[0].guid, 245 - &device->fw_client->props.protocol_name) : 0); 246 + if (client) { 247 + for (id = driver->id; !guid_is_null(&id->guid); id++) { 248 + if (guid_equal(&id->guid, &client->props.protocol_name)) 249 + return 1; 250 + } 251 + } 252 + 253 + return 0; 246 254 } 247 255 248 256 /**
+1
drivers/hid/intel-thc-hid/Kconfig
··· 7 7 config INTEL_THC_HID 8 8 tristate "Intel Touch Host Controller" 9 9 depends on ACPI 10 + select SGL_ALLOC 10 11 help 11 12 THC (Touch Host Controller) is the name of the IP block in PCH that 12 13 interfaces with Touch Devices (ex: touchscreen, touchpad etc.). It
+2 -2
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
··· 1593 1593 if (!max_rx_size) 1594 1594 return -EOPNOTSUPP; 1595 1595 1596 - ret = regmap_read(dev->thc_regmap, THC_M_PRT_SW_SEQ_STS_OFFSET, &val); 1596 + ret = regmap_read(dev->thc_regmap, THC_M_PRT_SPI_ICRRD_OPCODE_OFFSET, &val); 1597 1597 if (ret) 1598 1598 return ret; 1599 1599 ··· 1662 1662 if (!delay_us) 1663 1663 return -EOPNOTSUPP; 1664 1664 1665 - ret = regmap_read(dev->thc_regmap, THC_M_PRT_SW_SEQ_STS_OFFSET, &val); 1665 + ret = regmap_read(dev->thc_regmap, THC_M_PRT_SPI_ICRRD_OPCODE_OFFSET, &val); 1666 1666 if (ret) 1667 1667 return ret; 1668 1668
+8 -1
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c
··· 232 232 return 0; 233 233 234 234 memset(config->sgls, 0, sizeof(config->sgls)); 235 + memset(config->sgls_nent_pages, 0, sizeof(config->sgls_nent_pages)); 235 236 memset(config->sgls_nent, 0, sizeof(config->sgls_nent)); 236 237 237 238 cpu_addr = dma_alloc_coherent(dev->dev, prd_tbls_size, ··· 255 254 } 256 255 count = dma_map_sg(dev->dev, config->sgls[i], nent, dir); 257 256 257 + config->sgls_nent_pages[i] = nent; 258 258 config->sgls_nent[i] = count; 259 259 } 260 260 ··· 301 299 continue; 302 300 303 301 dma_unmap_sg(dev->dev, config->sgls[i], 304 - config->sgls_nent[i], 302 + config->sgls_nent_pages[i], 305 303 config->dir); 306 304 307 305 sgl_free(config->sgls[i]); ··· 572 570 573 571 if (prd_table_index >= read_config->prd_tbl_num) { 574 572 dev_err_once(dev->dev, "PRD table index %d too big\n", prd_table_index); 573 + return -EINVAL; 574 + } 575 + 576 + if (!read_config->prd_tbls || !read_config->sgls[prd_table_index]) { 577 + dev_err_once(dev->dev, "PRD tables are not ready yet\n"); 575 578 return -EINVAL; 576 579 } 577 580
+2
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.h
··· 91 91 * @dir: Direction of DMA for this config 92 92 * @prd_tbls: PRD tables for current DMA 93 93 * @sgls: Array of pointers to scatter-gather lists 94 + * @sgls_nent_pages: Number of pages per scatter-gather list 94 95 * @sgls_nent: Actual number of entries per scatter-gather list 95 96 * @prd_tbl_num: Actual number of PRD tables 96 97 * @max_packet_size: Size of the buffer needed for 1 DMA message (1 PRD table) ··· 108 107 109 108 struct thc_prd_table *prd_tbls; 110 109 struct scatterlist *sgls[PRD_TABLES_NUM]; 110 + u8 sgls_nent_pages[PRD_TABLES_NUM]; 111 111 u8 sgls_nent[PRD_TABLES_NUM]; 112 112 u8 prd_tbl_num; 113 113
+16 -1
drivers/hid/usbhid/hid-core.c
··· 985 985 struct usb_device *dev = interface_to_usbdev (intf); 986 986 struct hid_descriptor *hdesc; 987 987 struct hid_class_descriptor *hcdesc; 988 + __u8 fixed_opt_descriptors_size; 988 989 u32 quirks = 0; 989 990 unsigned int rsize = 0; 990 991 char *rdesc; ··· 1016 1015 (hdesc->bNumDescriptors - 1) * sizeof(*hcdesc)) { 1017 1016 dbg_hid("hid descriptor invalid, bLen=%hhu bNum=%hhu\n", 1018 1017 hdesc->bLength, hdesc->bNumDescriptors); 1019 - return -EINVAL; 1018 + 1019 + /* 1020 + * Some devices may expose a wrong number of descriptors compared 1021 + * to the provided length. 1022 + * However, we ignore the optional hid class descriptors entirely 1023 + * so we can safely recompute the proper field. 1024 + */ 1025 + if (hdesc->bLength >= sizeof(*hdesc)) { 1026 + fixed_opt_descriptors_size = hdesc->bLength - sizeof(*hdesc); 1027 + 1028 + hid_warn(intf, "fixing wrong optional hid class descriptors count\n"); 1029 + hdesc->bNumDescriptors = fixed_opt_descriptors_size / sizeof(*hcdesc) + 1; 1030 + } else { 1031 + return -EINVAL; 1032 + } 1020 1033 } 1021 1034 1022 1035 hid->version = le16_to_cpu(hdesc->bcdHID);
+10 -23
drivers/infiniband/core/addr.c
··· 80 80 .min = sizeof(struct rdma_nla_ls_gid)}, 81 81 }; 82 82 83 - static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh) 83 + static void ib_nl_process_ip_rsep(const struct nlmsghdr *nlh) 84 84 { 85 85 struct nlattr *tb[LS_NLA_TYPE_MAX] = {}; 86 + union ib_gid gid; 87 + struct addr_req *req; 88 + int found = 0; 86 89 int ret; 87 90 88 91 if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR) 89 - return false; 92 + return; 90 93 91 94 ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), 92 95 nlmsg_len(nlh), ib_nl_addr_policy, NULL); 93 96 if (ret) 94 - return false; 97 + return; 95 98 96 - return true; 97 - } 98 - 99 - static void ib_nl_process_good_ip_rsep(const struct nlmsghdr *nlh) 100 - { 101 - const struct nlattr *head, *curr; 102 - union ib_gid gid; 103 - struct addr_req *req; 104 - int len, rem; 105 - int found = 0; 106 - 107 - head = (const struct nlattr *)nlmsg_data(nlh); 108 - len = nlmsg_len(nlh); 109 - 110 - nla_for_each_attr(curr, head, len, rem) { 111 - if (curr->nla_type == LS_NLA_TYPE_DGID) 112 - memcpy(&gid, nla_data(curr), nla_len(curr)); 113 - } 99 + if (!tb[LS_NLA_TYPE_DGID]) 100 + return; 101 + memcpy(&gid, nla_data(tb[LS_NLA_TYPE_DGID]), sizeof(gid)); 114 102 115 103 spin_lock_bh(&lock); 116 104 list_for_each_entry(req, &req_list, list) { ··· 125 137 !(NETLINK_CB(skb).sk)) 126 138 return -EPERM; 127 139 128 - if (ib_nl_is_good_ip_resp(nlh)) 129 - ib_nl_process_good_ip_rsep(nlh); 140 + ib_nl_process_ip_rsep(nlh); 130 141 131 142 return 0; 132 143 }
+3
drivers/infiniband/core/cma.c
··· 2009 2009 ib_sa_free_multicast(mc->sa_mc); 2010 2010 2011 2011 if (rdma_protocol_roce(id_priv->id.device, id_priv->id.port_num)) { 2012 + struct rdma_cm_event *event = &mc->iboe_join.event; 2012 2013 struct rdma_dev_addr *dev_addr = 2013 2014 &id_priv->id.route.addr.dev_addr; 2014 2015 struct net_device *ndev = NULL; ··· 2032 2031 dev_put(ndev); 2033 2032 2034 2033 cancel_work_sync(&mc->iboe_join.work); 2034 + if (event->event == RDMA_CM_EVENT_MULTICAST_JOIN) 2035 + rdma_destroy_ah_attr(&event->param.ud.ah_attr); 2035 2036 } 2036 2037 kfree(mc); 2037 2038 }
+3 -1
drivers/infiniband/core/device.c
··· 2881 2881 { 2882 2882 struct ib_device *parent = sub->parent; 2883 2883 2884 - if (!parent) 2884 + if (!parent) { 2885 + ib_device_put(sub); 2885 2886 return -EOPNOTSUPP; 2887 + } 2886 2888 2887 2889 mutex_lock(&parent->subdev_lock); 2888 2890 list_del(&sub->subdev_list);
+1 -1
drivers/infiniband/core/verbs.c
··· 738 738 (struct in6_addr *)dgid); 739 739 return 0; 740 740 } else if (net_type == RDMA_NETWORK_IPV6 || 741 - net_type == RDMA_NETWORK_IB || RDMA_NETWORK_ROCE_V1) { 741 + net_type == RDMA_NETWORK_IB || net_type == RDMA_NETWORK_ROCE_V1) { 742 742 *dgid = hdr->ibgrh.dgid; 743 743 *sgid = hdr->ibgrh.sgid; 744 744 return 0;
+3 -3
drivers/infiniband/hw/bnxt_re/hw_counters.h
··· 89 89 BNXT_RE_RES_SRQ_LOAD_ERR, 90 90 BNXT_RE_RES_TX_PCI_ERR, 91 91 BNXT_RE_RES_RX_PCI_ERR, 92 + BNXT_RE_REQ_CQE_ERROR, 93 + BNXT_RE_RESP_CQE_ERROR, 94 + BNXT_RE_RESP_REMOTE_ACCESS_ERRS, 92 95 BNXT_RE_OUT_OF_SEQ_ERR, 93 96 BNXT_RE_TX_ATOMIC_REQ, 94 97 BNXT_RE_TX_READ_REQ, ··· 113 110 BNXT_RE_TX_CNP, 114 111 BNXT_RE_RX_CNP, 115 112 BNXT_RE_RX_ECN, 116 - BNXT_RE_REQ_CQE_ERROR, 117 - BNXT_RE_RESP_CQE_ERROR, 118 - BNXT_RE_RESP_REMOTE_ACCESS_ERRS, 119 113 BNXT_RE_NUM_EXT_COUNTERS 120 114 }; 121 115
+1 -6
drivers/infiniband/hw/bnxt_re/ib_verbs.c
··· 2919 2919 wqe.rawqp1.lflags |= 2920 2920 SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC; 2921 2921 } 2922 - switch (wr->send_flags) { 2923 - case IB_SEND_IP_CSUM: 2922 + if (wr->send_flags & IB_SEND_IP_CSUM) 2924 2923 wqe.rawqp1.lflags |= 2925 2924 SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM; 2926 - break; 2927 - default: 2928 - break; 2929 - } 2930 2925 fallthrough; 2931 2926 case IB_WR_SEND_WITH_INV: 2932 2927 rc = bnxt_re_build_send_wqe(qp, wr, &wqe);
+1 -1
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
··· 1112 1112 creq_db->dbinfo.flags = 0; 1113 1113 creq_db->reg.bar_id = RCFW_COMM_CONS_PCI_BAR_REGION; 1114 1114 creq_db->reg.bar_base = pci_resource_start(pdev, creq_db->reg.bar_id); 1115 - if (!creq_db->reg.bar_id) 1115 + if (!creq_db->reg.bar_base) 1116 1116 dev_err(&pdev->dev, 1117 1117 "QPLIB: CREQ BAR region %d resc start is 0!", 1118 1118 creq_db->reg.bar_id);
+3 -5
drivers/infiniband/hw/bnxt_re/qplib_res.c
··· 64 64 for (i = 0; i < pbl->pg_count; i++) { 65 65 if (pbl->pg_arr[i]) 66 66 dma_free_coherent(&pdev->dev, pbl->pg_size, 67 - (void *)((unsigned long) 68 - pbl->pg_arr[i] & 69 - PAGE_MASK), 67 + pbl->pg_arr[i], 70 68 pbl->pg_map_arr[i]); 71 69 else 72 70 dev_warn(&pdev->dev, ··· 235 237 if (npbl % BIT(MAX_PDL_LVL_SHIFT)) 236 238 npde++; 237 239 /* Alloc PDE pages */ 238 - sginfo.pgsize = npde * pg_size; 240 + sginfo.pgsize = npde * ROCE_PG_SIZE_4K; 239 241 sginfo.npages = 1; 240 242 rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], &sginfo); 241 243 if (rc) ··· 243 245 244 246 /* Alloc PBL pages */ 245 247 sginfo.npages = npbl; 246 - sginfo.pgsize = PAGE_SIZE; 248 + sginfo.pgsize = ROCE_PG_SIZE_4K; 247 249 rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_1], &sginfo); 248 250 if (rc) 249 251 goto fail;
-4
drivers/infiniband/hw/efa/efa_verbs.c
··· 1320 1320 u32 hp_cnt, 1321 1321 u8 hp_shift) 1322 1322 { 1323 - u32 pages_in_hp = BIT(hp_shift - PAGE_SHIFT); 1324 1323 struct ib_block_iter biter; 1325 1324 unsigned int hp_idx = 0; 1326 - 1327 - ibdev_dbg(&dev->ibdev, "hp_cnt[%u], pages_in_hp[%u]\n", 1328 - hp_cnt, pages_in_hp); 1329 1325 1330 1326 rdma_umem_for_each_dma_block(umem, &biter, BIT(hp_shift)) 1331 1327 page_list[hp_idx++] = rdma_block_iter_dma_address(&biter);
+2 -1
drivers/infiniband/hw/irdma/utils.c
··· 251 251 void *ptr) 252 252 { 253 253 struct neighbour *neigh = ptr; 254 - struct net_device *real_dev, *netdev = (struct net_device *)neigh->dev; 254 + struct net_device *real_dev, *netdev; 255 255 struct irdma_device *iwdev; 256 256 struct ib_device *ibdev; 257 257 __be32 *p; ··· 260 260 261 261 switch (event) { 262 262 case NETEVENT_NEIGH_UPDATE: 263 + netdev = neigh->dev; 263 264 real_dev = rdma_vlan_dev_real_dev(netdev); 264 265 if (!real_dev) 265 266 real_dev = netdev;
+4
drivers/infiniband/hw/mana/cq.c
··· 56 56 doorbell = mana_ucontext->doorbell; 57 57 } else { 58 58 is_rnic_cq = true; 59 + if (attr->cqe > U32_MAX / COMP_ENTRY_SIZE / 2 + 1) { 60 + ibdev_dbg(ibdev, "CQE %d exceeding limit\n", attr->cqe); 61 + return -EINVAL; 62 + } 59 63 buf_size = MANA_PAGE_ALIGN(roundup_pow_of_two(attr->cqe * COMP_ENTRY_SIZE)); 60 64 cq->cqe = buf_size / COMP_ENTRY_SIZE; 61 65 err = mana_ib_create_kernel_queue(mdev, buf_size, GDMA_CQ, &cq->queue);
+32
drivers/infiniband/sw/rxe/rxe_net.c
··· 64 64 break; 65 65 default: 66 66 WARN_ON_ONCE(1); 67 + return; 67 68 } 69 + /* 70 + * sock_lock_init_class_and_name() calls 71 + * sk_owner_set(sk, THIS_MODULE); in order 72 + * to make sure the referenced global 73 + * variables rxe_recv_slock_key and 74 + * rxe_recv_sk_key are not removed 75 + * before the socket is closed. 76 + * 77 + * However this prevents rxe_net_exit() 78 + * from being called and 'rmmod rdma_rxe' 79 + * is refused because of the references. 80 + * 81 + * For the global sockets in recv_sockets, 82 + * we are sure that rxe_net_exit() will call 83 + * rxe_release_udp_tunnel -> udp_tunnel_sock_release. 84 + * 85 + * So we don't need the additional reference to 86 + * our own (THIS_MODULE). 87 + */ 88 + sk_owner_put(sk); 89 + /* 90 + * We also call sk_owner_clear() otherwise 91 + * sk_owner_put(sk) in sk_prot_free will 92 + * fail, which is called via 93 + * sk_free -> __sk_free -> sk_destruct 94 + * and sk_destruct calls __sk_destruct 95 + * directly or via call_rcu() 96 + * so sk_prot_free() might be called 97 + * after rxe_net_exit(). 98 + */ 99 + sk_owner_clear(sk); 68 100 #endif /* CONFIG_DEBUG_LOCK_ALLOC */ 69 101 } 70 102
+3 -1
drivers/infiniband/sw/rxe/rxe_odp.c
··· 179 179 return err; 180 180 181 181 need_fault = rxe_check_pagefault(umem_odp, iova, length); 182 - if (need_fault) 182 + if (need_fault) { 183 + mutex_unlock(&umem_odp->umem_mutex); 183 184 return -EFAULT; 185 + } 184 186 } 185 187 186 188 return 0;
+1
drivers/infiniband/ulp/rtrs/rtrs-clt.c
··· 1464 1464 mr_page_shift = max(12, ffs(ib_dev->attrs.page_size_cap) - 1); 1465 1465 max_pages_per_mr = ib_dev->attrs.max_mr_size; 1466 1466 do_div(max_pages_per_mr, (1ull << mr_page_shift)); 1467 + max_pages_per_mr = min_not_zero((u32)max_pages_per_mr, U32_MAX); 1467 1468 clt_path->max_pages_per_mr = 1468 1469 min3(clt_path->max_pages_per_mr, (u32)max_pages_per_mr, 1469 1470 ib_dev->attrs.max_fast_reg_page_list_len);
+21 -11
drivers/infiniband/ulp/rtrs/rtrs-pri.h
··· 150 150 151 151 /** 152 152 * enum rtrs_msg_flags - RTRS message flags. 153 - * @RTRS_NEED_INVAL: Send invalidation in response. 153 + * @RTRS_MSG_NEED_INVAL_F: Send invalidation in response. 154 154 * @RTRS_MSG_NEW_RKEY_F: Send refreshed rkey in response. 155 155 */ 156 156 enum rtrs_msg_flags { ··· 179 179 * @recon_cnt: Reconnections counter 180 180 * @sess_uuid: UUID of a session (path) 181 181 * @paths_uuid: UUID of a group of sessions (paths) 182 - * 182 + * @first_conn: %1 if the connection request is the first for that session, 183 + * otherwise %0 183 184 * NOTE: max size 56 bytes, see man rdma_connect(). 184 185 */ 185 186 struct rtrs_msg_conn_req { 186 - /* Is set to 0 by cma.c in case of AF_IB, do not touch that. 187 - * see https://www.spinics.net/lists/linux-rdma/msg22397.html 187 + /** 188 + * @__cma_version: Is set to 0 by cma.c in case of AF_IB, do not touch 189 + * that. See https://www.spinics.net/lists/linux-rdma/msg22397.html 188 190 */ 189 191 u8 __cma_version; 190 - /* On sender side that should be set to 0, or cma_save_ip_info() 191 - * extract garbage and will fail. 192 + /** 193 + * @__ip_version: On sender side that should be set to 0, or 194 + * cma_save_ip_info() extract garbage and will fail. 192 195 */ 193 196 u8 __ip_version; 194 197 __le16 magic; ··· 202 199 uuid_t sess_uuid; 203 200 uuid_t paths_uuid; 204 201 u8 first_conn : 1; 202 + /* private: */ 205 203 u8 reserved_bits : 7; 206 204 u8 reserved[11]; 207 205 }; ··· 215 211 * @queue_depth: max inflight messages (queue-depth) in this session 216 212 * @max_io_size: max io size server supports 217 213 * @max_hdr_size: max msg header size server supports 214 + * @flags: RTRS message flags for this message 218 215 * 219 216 * NOTE: size is 56 bytes, max possible is 136 bytes, see man rdma_accept(). 220 217 */ ··· 227 222 __le32 max_io_size; 228 223 __le32 max_hdr_size; 229 224 __le32 flags; 225 + /* private: */ 230 226 u8 reserved[36]; 231 227 }; 232 228 233 229 /** 234 - * struct rtrs_msg_info_req 230 + * struct rtrs_msg_info_req - client additional info request 235 231 * @type: @RTRS_MSG_INFO_REQ 236 232 * @pathname: Path name chosen by client 237 233 */ 238 234 struct rtrs_msg_info_req { 239 235 __le16 type; 240 236 u8 pathname[NAME_MAX]; 237 + /* private: */ 241 238 u8 reserved[15]; 242 239 }; 243 240 244 241 /** 245 - * struct rtrs_msg_info_rsp 242 + * struct rtrs_msg_info_rsp - server additional info response 246 243 * @type: @RTRS_MSG_INFO_RSP 247 244 * @sg_cnt: Number of @desc entries 248 245 * @desc: RDMA buffers where the client can write to server ··· 252 245 struct rtrs_msg_info_rsp { 253 246 __le16 type; 254 247 __le16 sg_cnt; 248 + /* private: */ 255 249 u8 reserved[4]; 250 + /* public: */ 256 251 struct rtrs_sg_desc desc[]; 257 252 }; 258 253 259 254 /** 260 - * struct rtrs_msg_rkey_rsp 255 + * struct rtrs_msg_rkey_rsp - server refreshed rkey response 261 256 * @type: @RTRS_MSG_RKEY_RSP 262 257 * @buf_id: RDMA buf_id of the new rkey 263 258 * @rkey: new remote key for RDMA buffers id from server ··· 273 264 /** 274 265 * struct rtrs_msg_rdma_read - RDMA data transfer request from client 275 266 * @type: always @RTRS_MSG_READ 267 + * @flags: RTRS message flags (enum rtrs_msg_flags) 276 268 * @usr_len: length of user payload 277 269 * @sg_cnt: number of @desc entries 278 270 * @desc: RDMA buffers where the server can write the result to ··· 287 277 }; 288 278 289 279 /** 290 - * struct_msg_rdma_write - Message transferred to server with RDMA-Write 280 + * struct rtrs_msg_rdma_write - Message transferred to server with RDMA-Write 291 281 * @type: always @RTRS_MSG_WRITE 292 282 * @usr_len: length of user payload 293 283 */ ··· 297 287 }; 298 288 299 289 /** 300 - * struct_msg_rdma_hdr - header for read or write request 290 + * struct rtrs_msg_rdma_hdr - header for read or write request 301 291 * @type: @RTRS_MSG_WRITE | @RTRS_MSG_READ 302 292 */ 303 293 struct rtrs_msg_rdma_hdr {
+15 -9
drivers/infiniband/ulp/rtrs/rtrs.h
··· 24 24 25 25 /** 26 26 * enum rtrs_clt_link_ev - Events about connectivity state of a client 27 - * @RTRS_CLT_LINK_EV_RECONNECTED Client was reconnected. 28 - * @RTRS_CLT_LINK_EV_DISCONNECTED Client was disconnected. 27 + * @RTRS_CLT_LINK_EV_RECONNECTED: Client was reconnected. 28 + * @RTRS_CLT_LINK_EV_DISCONNECTED: Client was disconnected. 29 29 */ 30 30 enum rtrs_clt_link_ev { 31 31 RTRS_CLT_LINK_EV_RECONNECTED, ··· 33 33 }; 34 34 35 35 /** 36 - * Source and destination address of a path to be established 36 + * struct rtrs_addr - Source and destination address of a path to be established 37 + * @src: source address 38 + * @dst: destination address 37 39 */ 38 40 struct rtrs_addr { 39 41 struct sockaddr_storage *src; ··· 43 41 }; 44 42 45 43 /** 46 - * rtrs_clt_ops - it holds the link event callback and private pointer. 44 + * struct rtrs_clt_ops - it holds the link event callback and private pointer. 47 45 * @priv: User supplied private data. 48 46 * @link_ev: Event notification callback function for connection state changes 49 47 * @priv: User supplied data that was passed to rtrs_clt_open() ··· 69 67 }; 70 68 71 69 /** 72 - * enum rtrs_clt_con_type() type of ib connection to use with a given 70 + * enum rtrs_clt_con_type - type of ib connection to use with a given 73 71 * rtrs_permit 74 - * @ADMIN_CON - use connection reserved for "service" messages 75 - * @IO_CON - use a connection reserved for IO 72 + * @RTRS_ADMIN_CON: use connection reserved for "service" messages 73 + * @RTRS_IO_CON: use a connection reserved for IO 76 74 */ 77 75 enum rtrs_clt_con_type { 78 76 RTRS_ADMIN_CON, ··· 87 85 struct rtrs_permit *permit); 88 86 89 87 /** 90 - * rtrs_clt_req_ops - it holds the request confirmation callback 88 + * struct rtrs_clt_req_ops - it holds the request confirmation callback 91 89 * and a private pointer. 92 90 * @priv: User supplied private data. 93 91 * @conf_fn: callback function to be called as confirmation ··· 107 105 int rtrs_clt_rdma_cq_direct(struct rtrs_clt_sess *clt, unsigned int index); 108 106 109 107 /** 110 - * rtrs_attrs - RTRS session attributes 108 + * struct rtrs_attrs - RTRS session attributes 109 + * @queue_depth: queue_depth saved from rtrs_clt_sess message 110 + * @max_io_size: max_io_size from rtrs_clt_sess message, capped to 111 + * @max_segments * %SZ_4K 112 + * @max_segments: max_segments saved from rtrs_clt_sess message 111 113 */ 112 114 struct rtrs_attrs { 113 115 u32 queue_depth;
+50 -11
drivers/md/md.c
··· 1999 1999 mddev->layout = le32_to_cpu(sb->layout); 2000 2000 mddev->raid_disks = le32_to_cpu(sb->raid_disks); 2001 2001 mddev->dev_sectors = le64_to_cpu(sb->size); 2002 - mddev->logical_block_size = le32_to_cpu(sb->logical_block_size); 2003 2002 mddev->events = ev1; 2004 2003 mddev->bitmap_info.offset = 0; 2005 2004 mddev->bitmap_info.space = 0; ··· 2013 2014 memcpy(mddev->uuid, sb->set_uuid, 16); 2014 2015 2015 2016 mddev->max_disks = (4096-256)/2; 2017 + 2018 + if (!mddev->logical_block_size) 2019 + mddev->logical_block_size = le32_to_cpu(sb->logical_block_size); 2016 2020 2017 2021 if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET) && 2018 2022 mddev->bitmap_info.file == NULL) { ··· 3884 3882 3885 3883 static int analyze_sbs(struct mddev *mddev) 3886 3884 { 3887 - int i; 3888 3885 struct md_rdev *rdev, *freshest, *tmp; 3889 3886 3890 3887 freshest = NULL; ··· 3910 3909 super_types[mddev->major_version]. 3911 3910 validate_super(mddev, NULL/*freshest*/, freshest); 3912 3911 3913 - i = 0; 3914 3912 rdev_for_each_safe(rdev, tmp, mddev) { 3915 3913 if (mddev->max_disks && 3916 - (rdev->desc_nr >= mddev->max_disks || 3917 - i > mddev->max_disks)) { 3914 + rdev->desc_nr >= mddev->max_disks) { 3918 3915 pr_warn("md: %s: %pg: only %d devices permitted\n", 3919 3916 mdname(mddev), rdev->bdev, 3920 3917 mddev->max_disks); ··· 4406 4407 if (err < 0) 4407 4408 return err; 4408 4409 4409 - err = mddev_lock(mddev); 4410 + err = mddev_suspend_and_lock(mddev); 4410 4411 if (err) 4411 4412 return err; 4412 4413 if (mddev->pers) ··· 4431 4432 } else 4432 4433 mddev->raid_disks = n; 4433 4434 out_unlock: 4434 - mddev_unlock(mddev); 4435 + mddev_unlock_and_resume(mddev); 4435 4436 return err ? err : len; 4436 4437 } 4437 4438 static struct md_sysfs_entry md_raid_disks = ··· 5980 5981 if (mddev->major_version == 0) 5981 5982 return -EINVAL; 5982 5983 5983 - if (mddev->pers) 5984 - return -EBUSY; 5985 - 5986 5984 err = kstrtouint(buf, 10, &lbs); 5987 5985 if (err < 0) 5988 5986 return -EINVAL; 5987 + 5988 + if (mddev->pers) { 5989 + unsigned int curr_lbs; 5990 + 5991 + if (mddev->logical_block_size) 5992 + return -EBUSY; 5993 + /* 5994 + * To fix forward compatibility issues, LBS is not 5995 + * configured for arrays from old kernels (<=6.18) by default. 5996 + * If the user confirms no rollback to old kernels, 5997 + * enable LBS by writing current LBS — to prevent data 5998 + * loss from LBS changes. 5999 + */ 6000 + curr_lbs = queue_logical_block_size(mddev->gendisk->queue); 6001 + if (lbs != curr_lbs) 6002 + return -EINVAL; 6003 + 6004 + mddev->logical_block_size = curr_lbs; 6005 + set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags); 6006 + pr_info("%s: logical block size configured successfully, array will not be assembled in old kernels (<= 6.18)\n", 6007 + mdname(mddev)); 6008 + return len; 6009 + } 5989 6010 5990 6011 err = mddev_lock(mddev); 5991 6012 if (err) ··· 6182 6163 mdname(mddev)); 6183 6164 return -EINVAL; 6184 6165 } 6185 - mddev->logical_block_size = lim->logical_block_size; 6166 + 6167 + /* Only 1.x meta needs to set logical block size */ 6168 + if (mddev->major_version == 0) 6169 + return 0; 6170 + 6171 + /* 6172 + * Fix forward compatibility issue. Only set LBS by default for 6173 + * new arrays, mddev->events == 0 indicates the array was just 6174 + * created. When assembling an array, read LBS from the superblock 6175 + * instead — LBS is 0 in superblocks created by old kernels. 6176 + */ 6177 + if (!mddev->events) { 6178 + pr_info("%s: array will not be assembled in old kernels that lack configurable LBS support (<= 6.18)\n", 6179 + mdname(mddev)); 6180 + mddev->logical_block_size = lim->logical_block_size; 6181 + } 6182 + 6183 + if (!mddev->logical_block_size) 6184 + pr_warn("%s: echo current LBS to md/logical_block_size to prevent data loss issues from LBS changes.\n" 6185 + "\tNote: After setting, array will not be assembled in old kernels (<= 6.18)\n", 6186 + mdname(mddev)); 6186 6187 6187 6188 return 0; 6188 6189 }
+6 -4
drivers/md/raid5.c
··· 7187 7187 err = mddev_suspend_and_lock(mddev); 7188 7188 if (err) 7189 7189 return err; 7190 + conf = mddev->private; 7191 + if (!conf) { 7192 + mddev_unlock_and_resume(mddev); 7193 + return -ENODEV; 7194 + } 7190 7195 raid5_quiesce(mddev, true); 7191 7196 7192 - conf = mddev->private; 7193 - if (!conf) 7194 - err = -ENODEV; 7195 - else if (new != conf->worker_cnt_per_group) { 7197 + if (new != conf->worker_cnt_per_group) { 7196 7198 old_groups = conf->worker_groups; 7197 7199 if (old_groups) 7198 7200 flush_workqueue(raid5_wq);
-23
drivers/net/dsa/mv88e6xxx/chip.c
··· 3364 3364 3365 3365 static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) 3366 3366 { 3367 - struct device_node *phy_handle = NULL; 3368 3367 struct fwnode_handle *ports_fwnode; 3369 3368 struct fwnode_handle *port_fwnode; 3370 3369 struct dsa_switch *ds = chip->ds; 3371 3370 struct mv88e6xxx_port *p; 3372 - struct dsa_port *dp; 3373 - int tx_amp; 3374 3371 int err; 3375 3372 u16 reg; 3376 3373 u32 val; ··· 3577 3580 err = chip->info->ops->port_setup_message_port(chip, port); 3578 3581 if (err) 3579 3582 return err; 3580 - } 3581 - 3582 - if (chip->info->ops->serdes_set_tx_amplitude) { 3583 - dp = dsa_to_port(ds, port); 3584 - if (dp) 3585 - phy_handle = of_parse_phandle(dp->dn, "phy-handle", 0); 3586 - 3587 - if (phy_handle && !of_property_read_u32(phy_handle, 3588 - "tx-p2p-microvolt", 3589 - &tx_amp)) 3590 - err = chip->info->ops->serdes_set_tx_amplitude(chip, 3591 - port, tx_amp); 3592 - if (phy_handle) { 3593 - of_node_put(phy_handle); 3594 - if (err) 3595 - return err; 3596 - } 3597 3583 } 3598 3584 3599 3585 /* Port based VLAN map: give each port the same default address ··· 4748 4768 .serdes_irq_mapping = mv88e6352_serdes_irq_mapping, 4749 4769 .serdes_get_regs_len = mv88e6352_serdes_get_regs_len, 4750 4770 .serdes_get_regs = mv88e6352_serdes_get_regs, 4751 - .serdes_set_tx_amplitude = mv88e6352_serdes_set_tx_amplitude, 4752 4771 .gpio_ops = &mv88e6352_gpio_ops, 4753 4772 .phylink_get_caps = mv88e6352_phylink_get_caps, 4754 4773 .pcs_ops = &mv88e6352_pcs_ops, ··· 5023 5044 .serdes_irq_mapping = mv88e6352_serdes_irq_mapping, 5024 5045 .serdes_get_regs_len = mv88e6352_serdes_get_regs_len, 5025 5046 .serdes_get_regs = mv88e6352_serdes_get_regs, 5026 - .serdes_set_tx_amplitude = mv88e6352_serdes_set_tx_amplitude, 5027 5047 .gpio_ops = &mv88e6352_gpio_ops, 5028 5048 .avb_ops = &mv88e6352_avb_ops, 5029 5049 .ptp_ops = &mv88e6352_ptp_ops, ··· 5459 5481 .serdes_get_stats = mv88e6352_serdes_get_stats, 5460 5482 .serdes_get_regs_len = mv88e6352_serdes_get_regs_len, 5461 5483 .serdes_get_regs = mv88e6352_serdes_get_regs, 5462 - .serdes_set_tx_amplitude = mv88e6352_serdes_set_tx_amplitude, 5463 5484 .phylink_get_caps = mv88e6352_phylink_get_caps, 5464 5485 .pcs_ops = &mv88e6352_pcs_ops, 5465 5486 };
-4
drivers/net/dsa/mv88e6xxx/chip.h
··· 642 642 void (*serdes_get_regs)(struct mv88e6xxx_chip *chip, int port, 643 643 void *_p); 644 644 645 - /* SERDES SGMII/Fiber Output Amplitude */ 646 - int (*serdes_set_tx_amplitude)(struct mv88e6xxx_chip *chip, int port, 647 - int val); 648 - 649 645 /* Address Translation Unit operations */ 650 646 int (*atu_get_hash)(struct mv88e6xxx_chip *chip, u8 *hash); 651 647 int (*atu_set_hash)(struct mv88e6xxx_chip *chip, u8 hash);
-46
drivers/net/dsa/mv88e6xxx/serdes.c
··· 25 25 reg, val); 26 26 } 27 27 28 - static int mv88e6352_serdes_write(struct mv88e6xxx_chip *chip, int reg, 29 - u16 val) 30 - { 31 - return mv88e6xxx_phy_page_write(chip, MV88E6352_ADDR_SERDES, 32 - MV88E6352_SERDES_PAGE_FIBER, 33 - reg, val); 34 - } 35 - 36 28 static int mv88e6390_serdes_read(struct mv88e6xxx_chip *chip, 37 29 int lane, int device, int reg, u16 *val) 38 30 { ··· 497 505 if (!err) 498 506 p[i] = reg; 499 507 } 500 - } 501 - 502 - static const int mv88e6352_serdes_p2p_to_reg[] = { 503 - /* Index of value in microvolts corresponds to the register value */ 504 - 14000, 112000, 210000, 308000, 406000, 504000, 602000, 700000, 505 - }; 506 - 507 - int mv88e6352_serdes_set_tx_amplitude(struct mv88e6xxx_chip *chip, int port, 508 - int val) 509 - { 510 - bool found = false; 511 - u16 ctrl, reg; 512 - int err; 513 - int i; 514 - 515 - err = mv88e6352_g2_scratch_port_has_serdes(chip, port); 516 - if (err <= 0) 517 - return err; 518 - 519 - for (i = 0; i < ARRAY_SIZE(mv88e6352_serdes_p2p_to_reg); ++i) { 520 - if (mv88e6352_serdes_p2p_to_reg[i] == val) { 521 - reg = i; 522 - found = true; 523 - break; 524 - } 525 - } 526 - 527 - if (!found) 528 - return -EINVAL; 529 - 530 - err = mv88e6352_serdes_read(chip, MV88E6352_SERDES_SPEC_CTRL2, &ctrl); 531 - if (err) 532 - return err; 533 - 534 - ctrl &= ~MV88E6352_SERDES_OUT_AMP_MASK; 535 - ctrl |= reg; 536 - 537 - return mv88e6352_serdes_write(chip, MV88E6352_SERDES_SPEC_CTRL2, ctrl); 538 508 }
-5
drivers/net/dsa/mv88e6xxx/serdes.h
··· 29 29 #define MV88E6352_SERDES_INT_FIBRE_ENERGY BIT(4) 30 30 #define MV88E6352_SERDES_INT_STATUS 0x13 31 31 32 - #define MV88E6352_SERDES_SPEC_CTRL2 0x1a 33 - #define MV88E6352_SERDES_OUT_AMP_MASK 0x0007 34 32 35 33 #define MV88E6341_PORT5_LANE 0x15 36 34 ··· 137 139 void mv88e6352_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p); 138 140 int mv88e6390_serdes_get_regs_len(struct mv88e6xxx_chip *chip, int port); 139 141 void mv88e6390_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p); 140 - 141 - int mv88e6352_serdes_set_tx_amplitude(struct mv88e6xxx_chip *chip, int port, 142 - int val); 143 142 144 143 /* Return the (first) SERDES lane address a port is using, -errno otherwise. */ 145 144 static inline int mv88e6xxx_serdes_get_lane(struct mv88e6xxx_chip *chip,
+1 -1
drivers/net/ethernet/3com/3c59x.c
··· 1473 1473 return 0; 1474 1474 1475 1475 free_ring: 1476 - dma_free_coherent(&pdev->dev, 1476 + dma_free_coherent(gendev, 1477 1477 sizeof(struct boom_rx_desc) * RX_RING_SIZE + 1478 1478 sizeof(struct boom_tx_desc) * TX_RING_SIZE, 1479 1479 vp->rx_ring, vp->rx_ring_dma);
+6 -3
drivers/net/ethernet/airoha/airoha_ppe.c
··· 1547 1547 { 1548 1548 struct airoha_npu *npu; 1549 1549 1550 - rcu_read_lock(); 1551 - npu = rcu_dereference(eth->npu); 1550 + mutex_lock(&flow_offload_mutex); 1551 + 1552 + npu = rcu_replace_pointer(eth->npu, NULL, 1553 + lockdep_is_held(&flow_offload_mutex)); 1552 1554 if (npu) { 1553 1555 npu->ops.ppe_deinit(npu); 1554 1556 airoha_npu_put(npu); 1555 1557 } 1556 - rcu_read_unlock(); 1558 + 1559 + mutex_unlock(&flow_offload_mutex); 1557 1560 1558 1561 rhashtable_destroy(&eth->ppe->l2_flows); 1559 1562 rhashtable_destroy(&eth->flow_table);
+4
drivers/net/ethernet/amazon/ena/ena_devlink.c
··· 53 53 { 54 54 union devlink_param_value value; 55 55 56 + devl_lock(devlink); 56 57 value.vbool = false; 57 58 devl_param_driverinit_value_set(devlink, 58 59 DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC, 59 60 value); 61 + devl_unlock(devlink); 60 62 } 61 63 62 64 static void ena_devlink_port_register(struct devlink *devlink) ··· 147 145 return rc; 148 146 } 149 147 148 + devl_lock(devlink); 150 149 value.vbool = ena_phc_is_enabled(adapter); 151 150 devl_param_driverinit_value_set(devlink, 152 151 DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC, 153 152 value); 153 + devl_unlock(devlink); 154 154 155 155 return 0; 156 156 }
+1
drivers/net/ethernet/broadcom/Kconfig
··· 259 259 depends on PCI 260 260 select NET_DEVLINK 261 261 select PAGE_POOL 262 + select AUXILIARY_BUS 262 263 help 263 264 This driver supports Broadcom ThorUltra 50/100/200/400/800 gigabit 264 265 Ethernet cards. The module will be called bng_en. To compile this
+15 -6
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 1482 1482 struct bnxt_tpa_idx_map *map = rxr->rx_tpa_idx_map; 1483 1483 u16 idx = agg_id & MAX_TPA_P5_MASK; 1484 1484 1485 - if (test_bit(idx, map->agg_idx_bmap)) 1486 - idx = find_first_zero_bit(map->agg_idx_bmap, 1487 - BNXT_AGG_IDX_BMAP_SIZE); 1485 + if (test_bit(idx, map->agg_idx_bmap)) { 1486 + idx = find_first_zero_bit(map->agg_idx_bmap, MAX_TPA_P5); 1487 + if (idx >= MAX_TPA_P5) 1488 + return INVALID_HW_RING_ID; 1489 + } 1488 1490 __set_bit(idx, map->agg_idx_bmap); 1489 1491 map->agg_id_tbl[agg_id] = idx; 1490 1492 return idx; ··· 1550 1548 if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { 1551 1549 agg_id = TPA_START_AGG_ID_P5(tpa_start); 1552 1550 agg_id = bnxt_alloc_agg_idx(rxr, agg_id); 1551 + if (unlikely(agg_id == INVALID_HW_RING_ID)) { 1552 + netdev_warn(bp->dev, "Unable to allocate agg ID for ring %d, agg 0x%x\n", 1553 + rxr->bnapi->index, 1554 + TPA_START_AGG_ID_P5(tpa_start)); 1555 + bnxt_sched_reset_rxr(bp, rxr); 1556 + return; 1557 + } 1553 1558 } else { 1554 1559 agg_id = TPA_START_AGG_ID(tpa_start); 1555 1560 } ··· 16891 16882 16892 16883 init_err_pci_clean: 16893 16884 bnxt_hwrm_func_drv_unrgtr(bp); 16894 - bnxt_free_hwrm_resources(bp); 16895 - bnxt_hwmon_uninit(bp); 16896 - bnxt_ethtool_free(bp); 16897 16885 bnxt_ptp_clear(bp); 16898 16886 kfree(bp->ptp_cfg); 16899 16887 bp->ptp_cfg = NULL; 16888 + bnxt_free_hwrm_resources(bp); 16889 + bnxt_hwmon_uninit(bp); 16890 + bnxt_ethtool_free(bp); 16900 16891 kfree(bp->fw_health); 16901 16892 bp->fw_health = NULL; 16902 16893 bnxt_cleanup_pci(bp);
+1 -3
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 1080 1080 struct rx_agg_cmp *agg_arr; 1081 1081 }; 1082 1082 1083 - #define BNXT_AGG_IDX_BMAP_SIZE (MAX_TPA_P5 / BITS_PER_LONG) 1084 - 1085 1083 struct bnxt_tpa_idx_map { 1086 1084 u16 agg_id_tbl[1024]; 1087 - unsigned long agg_idx_bmap[BNXT_AGG_IDX_BMAP_SIZE]; 1085 + DECLARE_BITMAP(agg_idx_bmap, MAX_TPA_P5); 1088 1086 }; 1089 1087 1090 1088 struct bnxt_rx_ring_info {
+2 -2
drivers/net/ethernet/freescale/enetc/enetc.h
··· 79 79 #define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1) 80 80 #define ENETC_RXB_PAD NET_SKB_PAD /* add extra space if needed */ 81 81 #define ENETC_RXB_DMA_SIZE \ 82 - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD) 82 + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD, 0xffff) 83 83 #define ENETC_RXB_DMA_SIZE_XDP \ 84 - (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM) 84 + min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM, 0xffff) 85 85 86 86 struct enetc_rx_swbd { 87 87 dma_addr_t dma;
+3 -4
drivers/net/ethernet/intel/idpf/idpf.h
··· 284 284 285 285 struct idpf_fsteer_fltr { 286 286 struct list_head list; 287 - u32 loc; 288 - u32 q_index; 287 + struct ethtool_rx_flow_spec fs; 289 288 }; 290 289 291 290 /** ··· 423 424 * @rss_key: RSS hash key 424 425 * @rss_lut_size: Size of RSS lookup table 425 426 * @rss_lut: RSS lookup table 426 - * @cached_lut: Used to restore previously init RSS lut 427 427 */ 428 428 struct idpf_rss_data { 429 429 u16 rss_key_size; 430 430 u8 *rss_key; 431 431 u16 rss_lut_size; 432 432 u32 *rss_lut; 433 - u32 *cached_lut; 434 433 }; 435 434 436 435 /** ··· 555 558 * @max_q: Maximum possible queues 556 559 * @req_qs_chunks: Queue chunk data for requested queues 557 560 * @mac_filter_list_lock: Lock to protect mac filters 561 + * @flow_steer_list_lock: Lock to protect fsteer filters 558 562 * @flags: See enum idpf_vport_config_flags 559 563 */ 560 564 struct idpf_vport_config { ··· 563 565 struct idpf_vport_max_q max_q; 564 566 struct virtchnl2_add_queues *req_qs_chunks; 565 567 spinlock_t mac_filter_list_lock; 568 + spinlock_t flow_steer_list_lock; 566 569 DECLARE_BITMAP(flags, IDPF_VPORT_CONFIG_FLAGS_NBITS); 567 570 }; 568 571
+63 -29
drivers/net/ethernet/intel/idpf/idpf_ethtool.c
··· 37 37 { 38 38 struct idpf_netdev_priv *np = netdev_priv(netdev); 39 39 struct idpf_vport_user_config_data *user_config; 40 + struct idpf_vport_config *vport_config; 40 41 struct idpf_fsteer_fltr *f; 41 42 struct idpf_vport *vport; 42 43 unsigned int cnt = 0; ··· 45 44 46 45 idpf_vport_ctrl_lock(netdev); 47 46 vport = idpf_netdev_to_vport(netdev); 48 - user_config = &np->adapter->vport_config[np->vport_idx]->user_config; 47 + vport_config = np->adapter->vport_config[np->vport_idx]; 48 + user_config = &vport_config->user_config; 49 49 50 50 switch (cmd->cmd) { 51 51 case ETHTOOL_GRXCLSRLCNT: ··· 54 52 cmd->data = idpf_fsteer_max_rules(vport); 55 53 break; 56 54 case ETHTOOL_GRXCLSRULE: 57 - err = -EINVAL; 55 + err = -ENOENT; 56 + spin_lock_bh(&vport_config->flow_steer_list_lock); 58 57 list_for_each_entry(f, &user_config->flow_steer_list, list) 59 - if (f->loc == cmd->fs.location) { 60 - cmd->fs.ring_cookie = f->q_index; 58 + if (f->fs.location == cmd->fs.location) { 59 + /* Avoid infoleak from padding: zero first, 60 + * then assign fields 61 + */ 62 + memset(&cmd->fs, 0, sizeof(cmd->fs)); 63 + cmd->fs = f->fs; 61 64 err = 0; 62 65 break; 63 66 } 67 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 64 68 break; 65 69 case ETHTOOL_GRXCLSRLALL: 66 70 cmd->data = idpf_fsteer_max_rules(vport); 71 + spin_lock_bh(&vport_config->flow_steer_list_lock); 67 72 list_for_each_entry(f, &user_config->flow_steer_list, list) { 68 73 if (cnt == cmd->rule_cnt) { 69 74 err = -EMSGSIZE; 70 75 break; 71 76 } 72 - rule_locs[cnt] = f->loc; 77 + rule_locs[cnt] = f->fs.location; 73 78 cnt++; 74 79 } 75 80 if (!err) 76 81 cmd->rule_cnt = user_config->num_fsteer_fltrs; 82 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 77 83 break; 78 84 default: 79 85 break; ··· 178 168 struct idpf_vport *vport; 179 169 u32 flow_type, q_index; 180 170 u16 num_rxq; 181 - int err; 171 + int err = 0; 182 172 183 173 vport = idpf_netdev_to_vport(netdev); 184 174 vport_config = vport->adapter->vport_config[np->vport_idx]; ··· 203 193 rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL); 204 194 if (!rule) 205 195 return -ENOMEM; 196 + 197 + fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); 198 + if (!fltr) { 199 + err = -ENOMEM; 200 + goto out_free_rule; 201 + } 202 + 203 + /* detect duplicate entry and reject before adding rules */ 204 + spin_lock_bh(&vport_config->flow_steer_list_lock); 205 + list_for_each_entry(f, &user_config->flow_steer_list, list) { 206 + if (f->fs.location == fsp->location) { 207 + err = -EEXIST; 208 + break; 209 + } 210 + 211 + if (f->fs.location > fsp->location) 212 + break; 213 + parent = f; 214 + } 215 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 216 + 217 + if (err) 218 + goto out; 206 219 207 220 rule->vport_id = cpu_to_le32(vport->vport_id); 208 221 rule->count = cpu_to_le32(1); ··· 265 232 goto out; 266 233 } 267 234 268 - fltr = kzalloc(sizeof(*fltr), GFP_KERNEL); 269 - if (!fltr) { 270 - err = -ENOMEM; 271 - goto out; 272 - } 235 + /* Save a copy of the user's flow spec so ethtool can later retrieve it */ 236 + fltr->fs = *fsp; 273 237 274 - fltr->loc = fsp->location; 275 - fltr->q_index = q_index; 276 - list_for_each_entry(f, &user_config->flow_steer_list, list) { 277 - if (f->loc >= fltr->loc) 278 - break; 279 - parent = f; 280 - } 281 - 238 + spin_lock_bh(&vport_config->flow_steer_list_lock); 282 239 parent ? list_add(&fltr->list, &parent->list) : 283 240 list_add(&fltr->list, &user_config->flow_steer_list); 284 241 285 242 user_config->num_fsteer_fltrs++; 243 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 244 + goto out_free_rule; 286 245 287 246 out: 247 + kfree(fltr); 248 + out_free_rule: 288 249 kfree(rule); 289 250 return err; 290 251 } ··· 329 302 goto out; 330 303 } 331 304 305 + spin_lock_bh(&vport_config->flow_steer_list_lock); 332 306 list_for_each_entry_safe(f, iter, 333 307 &user_config->flow_steer_list, list) { 334 - if (f->loc == fsp->location) { 308 + if (f->fs.location == fsp->location) { 335 309 list_del(&f->list); 336 310 kfree(f); 337 311 user_config->num_fsteer_fltrs--; 338 - goto out; 312 + goto out_unlock; 339 313 } 340 314 } 341 - err = -EINVAL; 315 + err = -ENOENT; 342 316 317 + out_unlock: 318 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 343 319 out: 344 320 kfree(rule); 345 321 return err; ··· 411 381 * @netdev: network interface device structure 412 382 * @rxfh: pointer to param struct (indir, key, hfunc) 413 383 * 414 - * Reads the indirection table directly from the hardware. Always returns 0. 384 + * RSS LUT and Key information are read from driver's cached 385 + * copy. When rxhash is off, rss lut will be displayed as zeros. 386 + * 387 + * Return: 0 on success, -errno otherwise. 415 388 */ 416 389 static int idpf_get_rxfh(struct net_device *netdev, 417 390 struct ethtool_rxfh_param *rxfh) ··· 422 389 struct idpf_netdev_priv *np = netdev_priv(netdev); 423 390 struct idpf_rss_data *rss_data; 424 391 struct idpf_adapter *adapter; 392 + struct idpf_vport *vport; 393 + bool rxhash_ena; 425 394 int err = 0; 426 395 u16 i; 427 396 428 397 idpf_vport_ctrl_lock(netdev); 398 + vport = idpf_netdev_to_vport(netdev); 429 399 430 400 adapter = np->adapter; 431 401 ··· 438 402 } 439 403 440 404 rss_data = &adapter->vport_config[np->vport_idx]->user_config.rss_data; 441 - if (!test_bit(IDPF_VPORT_UP, np->state)) 442 - goto unlock_mutex; 443 405 406 + rxhash_ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH); 444 407 rxfh->hfunc = ETH_RSS_HASH_TOP; 445 408 446 409 if (rxfh->key) ··· 447 412 448 413 if (rxfh->indir) { 449 414 for (i = 0; i < rss_data->rss_lut_size; i++) 450 - rxfh->indir[i] = rss_data->rss_lut[i]; 415 + rxfh->indir[i] = rxhash_ena ? rss_data->rss_lut[i] : 0; 451 416 } 452 417 453 418 unlock_mutex: ··· 487 452 } 488 453 489 454 rss_data = &adapter->vport_config[vport->idx]->user_config.rss_data; 490 - if (!test_bit(IDPF_VPORT_UP, np->state)) 491 - goto unlock_mutex; 492 455 493 456 if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && 494 457 rxfh->hfunc != ETH_RSS_HASH_TOP) { ··· 502 469 rss_data->rss_lut[lut] = rxfh->indir[lut]; 503 470 } 504 471 505 - err = idpf_config_rss(vport); 472 + if (test_bit(IDPF_VPORT_UP, np->state)) 473 + err = idpf_config_rss(vport); 506 474 507 475 unlock_mutex: 508 476 idpf_vport_ctrl_unlock(netdev);
+1 -1
drivers/net/ethernet/intel/idpf/idpf_idc.c
··· 322 322 for (i = 0; i < adapter->num_alloc_vports; i++) { 323 323 struct idpf_vport *vport = adapter->vports[i]; 324 324 325 - if (!vport) 325 + if (!vport || !vport->vdev_info) 326 326 continue; 327 327 328 328 idpf_unplug_aux_dev(vport->vdev_info->adev);
+154 -120
drivers/net/ethernet/intel/idpf/idpf_lib.c
··· 443 443 } 444 444 445 445 /** 446 + * idpf_del_all_flow_steer_filters - Delete all flow steer filters in list 447 + * @vport: main vport struct 448 + * 449 + * Takes flow_steer_list_lock spinlock. Deletes all filters 450 + */ 451 + static void idpf_del_all_flow_steer_filters(struct idpf_vport *vport) 452 + { 453 + struct idpf_vport_config *vport_config; 454 + struct idpf_fsteer_fltr *f, *ftmp; 455 + 456 + vport_config = vport->adapter->vport_config[vport->idx]; 457 + 458 + spin_lock_bh(&vport_config->flow_steer_list_lock); 459 + list_for_each_entry_safe(f, ftmp, &vport_config->user_config.flow_steer_list, 460 + list) { 461 + list_del(&f->list); 462 + kfree(f); 463 + } 464 + vport_config->user_config.num_fsteer_fltrs = 0; 465 + spin_unlock_bh(&vport_config->flow_steer_list_lock); 466 + } 467 + 468 + /** 446 469 * idpf_find_mac_filter - Search filter list for specific mac filter 447 470 * @vconfig: Vport config structure 448 471 * @macaddr: The MAC address ··· 752 729 return 0; 753 730 } 754 731 732 + static void idpf_detach_and_close(struct idpf_adapter *adapter) 733 + { 734 + int max_vports = adapter->max_vports; 735 + 736 + for (int i = 0; i < max_vports; i++) { 737 + struct net_device *netdev = adapter->netdevs[i]; 738 + 739 + /* If the interface is in detached state, that means the 740 + * previous reset was not handled successfully for this 741 + * vport. 742 + */ 743 + if (!netif_device_present(netdev)) 744 + continue; 745 + 746 + /* Hold RTNL to protect racing with callbacks */ 747 + rtnl_lock(); 748 + netif_device_detach(netdev); 749 + if (netif_running(netdev)) { 750 + set_bit(IDPF_VPORT_UP_REQUESTED, 751 + adapter->vport_config[i]->flags); 752 + dev_close(netdev); 753 + } 754 + rtnl_unlock(); 755 + } 756 + } 757 + 758 + static void idpf_attach_and_open(struct idpf_adapter *adapter) 759 + { 760 + int max_vports = adapter->max_vports; 761 + 762 + for (int i = 0; i < max_vports; i++) { 763 + struct idpf_vport *vport = adapter->vports[i]; 764 + struct idpf_vport_config *vport_config; 765 + struct net_device *netdev; 766 + 767 + /* In case of a critical error in the init task, the vport 768 + * will be freed. Only continue to restore the netdevs 769 + * if the vport is allocated. 770 + */ 771 + if (!vport) 772 + continue; 773 + 774 + /* No need for RTNL on attach as this function is called 775 + * following detach and dev_close(). We do take RTNL for 776 + * dev_open() below as it can race with external callbacks 777 + * following the call to netif_device_attach(). 778 + */ 779 + netdev = adapter->netdevs[i]; 780 + netif_device_attach(netdev); 781 + vport_config = adapter->vport_config[vport->idx]; 782 + if (test_and_clear_bit(IDPF_VPORT_UP_REQUESTED, 783 + vport_config->flags)) { 784 + rtnl_lock(); 785 + dev_open(netdev, NULL); 786 + rtnl_unlock(); 787 + } 788 + } 789 + } 790 + 755 791 /** 756 792 * idpf_cfg_netdev - Allocate, configure and register a netdev 757 793 * @vport: main vport structure ··· 1073 991 u16 idx = vport->idx; 1074 992 1075 993 vport_config = adapter->vport_config[vport->idx]; 1076 - idpf_deinit_rss(vport); 994 + idpf_deinit_rss_lut(vport); 1077 995 rss_data = &vport_config->user_config.rss_data; 1078 996 kfree(rss_data->rss_key); 1079 997 rss_data->rss_key = NULL; ··· 1105 1023 kfree(adapter->vport_config[idx]->req_qs_chunks); 1106 1024 adapter->vport_config[idx]->req_qs_chunks = NULL; 1107 1025 } 1026 + kfree(vport->rx_ptype_lkup); 1027 + vport->rx_ptype_lkup = NULL; 1108 1028 kfree(vport); 1109 1029 adapter->num_alloc_vports--; 1110 1030 } ··· 1125 1041 idpf_idc_deinit_vport_aux_device(vport->vdev_info); 1126 1042 1127 1043 idpf_deinit_mac_addr(vport); 1128 - idpf_vport_stop(vport, true); 1129 1044 1130 - if (!test_bit(IDPF_HR_RESET_IN_PROG, adapter->flags)) 1045 + if (!test_bit(IDPF_HR_RESET_IN_PROG, adapter->flags)) { 1046 + idpf_vport_stop(vport, true); 1131 1047 idpf_decfg_netdev(vport); 1132 - if (test_bit(IDPF_REMOVE_IN_PROG, adapter->flags)) 1048 + } 1049 + if (test_bit(IDPF_REMOVE_IN_PROG, adapter->flags)) { 1133 1050 idpf_del_all_mac_filters(vport); 1051 + idpf_del_all_flow_steer_filters(vport); 1052 + } 1134 1053 1135 1054 if (adapter->netdevs[i]) { 1136 1055 struct idpf_netdev_priv *np = netdev_priv(adapter->netdevs[i]); ··· 1226 1139 u16 idx = adapter->next_vport; 1227 1140 struct idpf_vport *vport; 1228 1141 u16 num_max_q; 1142 + int err; 1229 1143 1230 1144 if (idx == IDPF_NO_FREE_SLOT) 1231 1145 return NULL; ··· 1277 1189 1278 1190 idpf_vport_init(vport, max_q); 1279 1191 1280 - /* This alloc is done separate from the LUT because it's not strictly 1281 - * dependent on how many queues we have. If we change number of queues 1282 - * and soft reset we'll need a new LUT but the key can remain the same 1283 - * for as long as the vport exists. 1192 + /* LUT and key are both initialized here. Key is not strictly dependent 1193 + * on how many queues we have. If we change number of queues and soft 1194 + * reset is initiated, LUT will be freed and a new LUT will be allocated 1195 + * as per the updated number of queues during vport bringup. However, 1196 + * the key remains the same for as long as the vport exists. 1284 1197 */ 1285 1198 rss_data = &adapter->vport_config[idx]->user_config.rss_data; 1286 1199 rss_data->rss_key = kzalloc(rss_data->rss_key_size, GFP_KERNEL); ··· 1290 1201 1291 1202 /* Initialize default rss key */ 1292 1203 netdev_rss_key_fill((void *)rss_data->rss_key, rss_data->rss_key_size); 1204 + 1205 + /* Initialize default rss LUT */ 1206 + err = idpf_init_rss_lut(vport); 1207 + if (err) 1208 + goto free_rss_key; 1293 1209 1294 1210 /* fill vport slot in the adapter struct */ 1295 1211 adapter->vports[idx] = vport; ··· 1306 1212 1307 1213 return vport; 1308 1214 1215 + free_rss_key: 1216 + kfree(rss_data->rss_key); 1309 1217 free_vector_idxs: 1310 1218 kfree(vport->q_vector_idxs); 1311 1219 free_vport: ··· 1484 1388 { 1485 1389 struct idpf_netdev_priv *np = netdev_priv(vport->netdev); 1486 1390 struct idpf_adapter *adapter = vport->adapter; 1487 - struct idpf_vport_config *vport_config; 1488 1391 int err; 1489 1392 1490 1393 if (test_bit(IDPF_VPORT_UP, np->state)) ··· 1524 1429 if (err) { 1525 1430 dev_err(&adapter->pdev->dev, "Failed to initialize queue registers for vport %u: %d\n", 1526 1431 vport->vport_id, err); 1527 - goto queues_rel; 1432 + goto intr_deinit; 1528 1433 } 1529 1434 1530 1435 err = idpf_rx_bufs_init_all(vport); 1531 1436 if (err) { 1532 1437 dev_err(&adapter->pdev->dev, "Failed to initialize RX buffers for vport %u: %d\n", 1533 1438 vport->vport_id, err); 1534 - goto queues_rel; 1439 + goto intr_deinit; 1535 1440 } 1536 1441 1537 1442 idpf_rx_init_buf_tail(vport); ··· 1577 1482 1578 1483 idpf_restore_features(vport); 1579 1484 1580 - vport_config = adapter->vport_config[vport->idx]; 1581 - if (vport_config->user_config.rss_data.rss_lut) 1582 - err = idpf_config_rss(vport); 1583 - else 1584 - err = idpf_init_rss(vport); 1485 + err = idpf_config_rss(vport); 1585 1486 if (err) { 1586 - dev_err(&adapter->pdev->dev, "Failed to initialize RSS for vport %u: %d\n", 1487 + dev_err(&adapter->pdev->dev, "Failed to configure RSS for vport %u: %d\n", 1587 1488 vport->vport_id, err); 1588 1489 goto disable_vport; 1589 1490 } ··· 1588 1497 if (err) { 1589 1498 dev_err(&adapter->pdev->dev, "Failed to complete interface up for vport %u: %d\n", 1590 1499 vport->vport_id, err); 1591 - goto deinit_rss; 1500 + goto disable_vport; 1592 1501 } 1593 1502 1594 1503 if (rtnl) ··· 1596 1505 1597 1506 return 0; 1598 1507 1599 - deinit_rss: 1600 - idpf_deinit_rss(vport); 1601 1508 disable_vport: 1602 1509 idpf_send_disable_vport_msg(vport); 1603 1510 disable_queues: ··· 1633 1544 struct idpf_vport_config *vport_config; 1634 1545 struct idpf_vport_max_q max_q; 1635 1546 struct idpf_adapter *adapter; 1636 - struct idpf_netdev_priv *np; 1637 1547 struct idpf_vport *vport; 1638 1548 u16 num_default_vports; 1639 1549 struct pci_dev *pdev; ··· 1667 1579 goto unwind_vports; 1668 1580 } 1669 1581 1582 + err = idpf_send_get_rx_ptype_msg(vport); 1583 + if (err) 1584 + goto unwind_vports; 1585 + 1670 1586 index = vport->idx; 1671 1587 vport_config = adapter->vport_config[index]; 1672 1588 1673 1589 spin_lock_init(&vport_config->mac_filter_list_lock); 1590 + spin_lock_init(&vport_config->flow_steer_list_lock); 1674 1591 1675 1592 INIT_LIST_HEAD(&vport_config->user_config.mac_filter_list); 1676 1593 INIT_LIST_HEAD(&vport_config->user_config.flow_steer_list); ··· 1683 1590 err = idpf_check_supported_desc_ids(vport); 1684 1591 if (err) { 1685 1592 dev_err(&pdev->dev, "failed to get required descriptor ids\n"); 1686 - goto cfg_netdev_err; 1593 + goto unwind_vports; 1687 1594 } 1688 1595 1689 1596 if (idpf_cfg_netdev(vport)) 1690 - goto cfg_netdev_err; 1691 - 1692 - err = idpf_send_get_rx_ptype_msg(vport); 1693 - if (err) 1694 - goto handle_err; 1695 - 1696 - /* Once state is put into DOWN, driver is ready for dev_open */ 1697 - np = netdev_priv(vport->netdev); 1698 - clear_bit(IDPF_VPORT_UP, np->state); 1699 - if (test_and_clear_bit(IDPF_VPORT_UP_REQUESTED, vport_config->flags)) 1700 - idpf_vport_open(vport, true); 1597 + goto unwind_vports; 1701 1598 1702 1599 /* Spawn and return 'idpf_init_task' work queue until all the 1703 1600 * default vports are created ··· 1718 1635 set_bit(IDPF_VPORT_REG_NETDEV, vport_config->flags); 1719 1636 } 1720 1637 1721 - /* As all the required vports are created, clear the reset flag 1722 - * unconditionally here in case we were in reset and the link was down. 1723 - */ 1638 + /* Clear the reset and load bits as all vports are created */ 1724 1639 clear_bit(IDPF_HR_RESET_IN_PROG, adapter->flags); 1640 + clear_bit(IDPF_HR_DRV_LOAD, adapter->flags); 1725 1641 /* Start the statistics task now */ 1726 1642 queue_delayed_work(adapter->stats_wq, &adapter->stats_task, 1727 1643 msecs_to_jiffies(10 * (pdev->devfn & 0x07))); 1728 1644 1729 1645 return; 1730 1646 1731 - handle_err: 1732 - idpf_decfg_netdev(vport); 1733 - cfg_netdev_err: 1734 - idpf_vport_rel(vport); 1735 - adapter->vports[index] = NULL; 1736 1647 unwind_vports: 1737 1648 if (default_vport) { 1738 1649 for (index = 0; index < adapter->max_vports; index++) { ··· 1734 1657 idpf_vport_dealloc(adapter->vports[index]); 1735 1658 } 1736 1659 } 1660 + /* Cleanup after vc_core_init, which has no way of knowing the 1661 + * init task failed on driver load. 1662 + */ 1663 + if (test_and_clear_bit(IDPF_HR_DRV_LOAD, adapter->flags)) { 1664 + cancel_delayed_work_sync(&adapter->serv_task); 1665 + cancel_delayed_work_sync(&adapter->mbx_task); 1666 + } 1667 + idpf_ptp_release(adapter); 1668 + 1737 1669 clear_bit(IDPF_HR_RESET_IN_PROG, adapter->flags); 1738 1670 } 1739 1671 ··· 1873 1787 } 1874 1788 1875 1789 /** 1876 - * idpf_set_vport_state - Set the vport state to be after the reset 1877 - * @adapter: Driver specific private structure 1878 - */ 1879 - static void idpf_set_vport_state(struct idpf_adapter *adapter) 1880 - { 1881 - u16 i; 1882 - 1883 - for (i = 0; i < adapter->max_vports; i++) { 1884 - struct idpf_netdev_priv *np; 1885 - 1886 - if (!adapter->netdevs[i]) 1887 - continue; 1888 - 1889 - np = netdev_priv(adapter->netdevs[i]); 1890 - if (test_bit(IDPF_VPORT_UP, np->state)) 1891 - set_bit(IDPF_VPORT_UP_REQUESTED, 1892 - adapter->vport_config[i]->flags); 1893 - } 1894 - } 1895 - 1896 - /** 1897 1790 * idpf_init_hard_reset - Initiate a hardware reset 1898 1791 * @adapter: Driver specific private structure 1899 1792 * ··· 1880 1815 * reallocate. Also reinitialize the mailbox. Return 0 on success, 1881 1816 * negative on failure. 1882 1817 */ 1883 - static int idpf_init_hard_reset(struct idpf_adapter *adapter) 1818 + static void idpf_init_hard_reset(struct idpf_adapter *adapter) 1884 1819 { 1885 1820 struct idpf_reg_ops *reg_ops = &adapter->dev_ops.reg_ops; 1886 1821 struct device *dev = &adapter->pdev->dev; 1887 - struct net_device *netdev; 1888 1822 int err; 1889 - u16 i; 1890 1823 1824 + idpf_detach_and_close(adapter); 1891 1825 mutex_lock(&adapter->vport_ctrl_lock); 1892 1826 1893 1827 dev_info(dev, "Device HW Reset initiated\n"); 1894 1828 1895 - /* Avoid TX hangs on reset */ 1896 - for (i = 0; i < adapter->max_vports; i++) { 1897 - netdev = adapter->netdevs[i]; 1898 - if (!netdev) 1899 - continue; 1900 - 1901 - netif_carrier_off(netdev); 1902 - netif_tx_disable(netdev); 1903 - } 1904 - 1905 1829 /* Prepare for reset */ 1906 - if (test_and_clear_bit(IDPF_HR_DRV_LOAD, adapter->flags)) { 1830 + if (test_bit(IDPF_HR_DRV_LOAD, adapter->flags)) { 1907 1831 reg_ops->trigger_reset(adapter, IDPF_HR_DRV_LOAD); 1908 1832 } else if (test_and_clear_bit(IDPF_HR_FUNC_RESET, adapter->flags)) { 1909 1833 bool is_reset = idpf_is_reset_detected(adapter); 1910 1834 1911 1835 idpf_idc_issue_reset_event(adapter->cdev_info); 1912 1836 1913 - idpf_set_vport_state(adapter); 1914 1837 idpf_vc_core_deinit(adapter); 1915 1838 if (!is_reset) 1916 1839 reg_ops->trigger_reset(adapter, IDPF_HR_FUNC_RESET); ··· 1945 1892 unlock_mutex: 1946 1893 mutex_unlock(&adapter->vport_ctrl_lock); 1947 1894 1948 - /* Wait until all vports are created to init RDMA CORE AUX */ 1949 - if (!err) 1950 - err = idpf_idc_init(adapter); 1951 - 1952 - return err; 1895 + /* Attempt to restore netdevs and initialize RDMA CORE AUX device, 1896 + * provided vc_core_init succeeded. It is still possible that 1897 + * vports are not allocated at this point if the init task failed. 1898 + */ 1899 + if (!err) { 1900 + idpf_attach_and_open(adapter); 1901 + idpf_idc_init(adapter); 1902 + } 1953 1903 } 1954 1904 1955 1905 /** ··· 2053 1997 idpf_vport_stop(vport, false); 2054 1998 } 2055 1999 2056 - idpf_deinit_rss(vport); 2057 2000 /* We're passing in vport here because we need its wait_queue 2058 2001 * to send a message and it should be getting all the vport 2059 2002 * config data out of the adapter but we need to be careful not ··· 2077 2022 err = idpf_set_real_num_queues(vport); 2078 2023 if (err) 2079 2024 goto err_open; 2025 + 2026 + if (reset_cause == IDPF_SR_Q_CHANGE && 2027 + !netif_is_rxfh_configured(vport->netdev)) 2028 + idpf_fill_dflt_rss_lut(vport); 2080 2029 2081 2030 if (vport_is_up) 2082 2031 err = idpf_vport_open(vport, false); ··· 2225 2166 } 2226 2167 2227 2168 /** 2228 - * idpf_vport_manage_rss_lut - disable/enable RSS 2229 - * @vport: the vport being changed 2230 - * 2231 - * In the event of disable request for RSS, this function will zero out RSS 2232 - * LUT, while in the event of enable request for RSS, it will reconfigure RSS 2233 - * LUT with the default LUT configuration. 2234 - */ 2235 - static int idpf_vport_manage_rss_lut(struct idpf_vport *vport) 2236 - { 2237 - bool ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH); 2238 - struct idpf_rss_data *rss_data; 2239 - u16 idx = vport->idx; 2240 - int lut_size; 2241 - 2242 - rss_data = &vport->adapter->vport_config[idx]->user_config.rss_data; 2243 - lut_size = rss_data->rss_lut_size * sizeof(u32); 2244 - 2245 - if (ena) { 2246 - /* This will contain the default or user configured LUT */ 2247 - memcpy(rss_data->rss_lut, rss_data->cached_lut, lut_size); 2248 - } else { 2249 - /* Save a copy of the current LUT to be restored later if 2250 - * requested. 2251 - */ 2252 - memcpy(rss_data->cached_lut, rss_data->rss_lut, lut_size); 2253 - 2254 - /* Zero out the current LUT to disable */ 2255 - memset(rss_data->rss_lut, 0, lut_size); 2256 - } 2257 - 2258 - return idpf_config_rss(vport); 2259 - } 2260 - 2261 - /** 2262 2169 * idpf_set_features - set the netdev feature flags 2263 2170 * @netdev: ptr to the netdev being adjusted 2264 2171 * @features: the feature set that the stack is suggesting ··· 2249 2224 } 2250 2225 2251 2226 if (changed & NETIF_F_RXHASH) { 2227 + struct idpf_netdev_priv *np = netdev_priv(netdev); 2228 + 2252 2229 netdev->features ^= NETIF_F_RXHASH; 2253 - err = idpf_vport_manage_rss_lut(vport); 2254 - if (err) 2255 - goto unlock_mutex; 2230 + 2231 + /* If the interface is not up when changing the rxhash, update 2232 + * to the HW is skipped. The updated LUT will be committed to 2233 + * the HW when the interface is brought up. 2234 + */ 2235 + if (test_bit(IDPF_VPORT_UP, np->state)) { 2236 + err = idpf_config_rss(vport); 2237 + if (err) 2238 + goto unlock_mutex; 2239 + } 2256 2240 } 2257 2241 2258 2242 if (changed & NETIF_F_GRO_HW) {
+19 -27
drivers/net/ethernet/intel/idpf/idpf_txrx.c
··· 695 695 static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq) 696 696 { 697 697 struct libeth_fq fq = { 698 - .count = rxq->desc_count, 699 - .type = LIBETH_FQE_MTU, 700 - .nid = idpf_q_vector_to_mem(rxq->q_vector), 698 + .count = rxq->desc_count, 699 + .type = LIBETH_FQE_MTU, 700 + .buf_len = IDPF_RX_MAX_BUF_SZ, 701 + .nid = idpf_q_vector_to_mem(rxq->q_vector), 701 702 }; 702 703 int ret; 703 704 ··· 755 754 .truesize = bufq->truesize, 756 755 .count = bufq->desc_count, 757 756 .type = type, 757 + .buf_len = IDPF_RX_MAX_BUF_SZ, 758 758 .hsplit = idpf_queue_has(HSPLIT_EN, bufq), 759 759 .xdp = idpf_xdp_enabled(bufq->q_vector->vport), 760 760 .nid = idpf_q_vector_to_mem(bufq->q_vector), ··· 4643 4641 * idpf_fill_dflt_rss_lut - Fill the indirection table with the default values 4644 4642 * @vport: virtual port structure 4645 4643 */ 4646 - static void idpf_fill_dflt_rss_lut(struct idpf_vport *vport) 4644 + void idpf_fill_dflt_rss_lut(struct idpf_vport *vport) 4647 4645 { 4648 4646 struct idpf_adapter *adapter = vport->adapter; 4649 4647 u16 num_active_rxq = vport->num_rxq; ··· 4652 4650 4653 4651 rss_data = &adapter->vport_config[vport->idx]->user_config.rss_data; 4654 4652 4655 - for (i = 0; i < rss_data->rss_lut_size; i++) { 4653 + for (i = 0; i < rss_data->rss_lut_size; i++) 4656 4654 rss_data->rss_lut[i] = i % num_active_rxq; 4657 - rss_data->cached_lut[i] = rss_data->rss_lut[i]; 4658 - } 4659 4655 } 4660 4656 4661 4657 /** 4662 - * idpf_init_rss - Allocate and initialize RSS resources 4658 + * idpf_init_rss_lut - Allocate and initialize RSS LUT 4663 4659 * @vport: virtual port 4664 4660 * 4665 - * Return 0 on success, negative on failure 4661 + * Return: 0 on success, negative on failure 4666 4662 */ 4667 - int idpf_init_rss(struct idpf_vport *vport) 4663 + int idpf_init_rss_lut(struct idpf_vport *vport) 4668 4664 { 4669 4665 struct idpf_adapter *adapter = vport->adapter; 4670 4666 struct idpf_rss_data *rss_data; 4671 - u32 lut_size; 4672 4667 4673 4668 rss_data = &adapter->vport_config[vport->idx]->user_config.rss_data; 4669 + if (!rss_data->rss_lut) { 4670 + u32 lut_size; 4674 4671 4675 - lut_size = rss_data->rss_lut_size * sizeof(u32); 4676 - rss_data->rss_lut = kzalloc(lut_size, GFP_KERNEL); 4677 - if (!rss_data->rss_lut) 4678 - return -ENOMEM; 4679 - 4680 - rss_data->cached_lut = kzalloc(lut_size, GFP_KERNEL); 4681 - if (!rss_data->cached_lut) { 4682 - kfree(rss_data->rss_lut); 4683 - rss_data->rss_lut = NULL; 4684 - 4685 - return -ENOMEM; 4672 + lut_size = rss_data->rss_lut_size * sizeof(u32); 4673 + rss_data->rss_lut = kzalloc(lut_size, GFP_KERNEL); 4674 + if (!rss_data->rss_lut) 4675 + return -ENOMEM; 4686 4676 } 4687 4677 4688 4678 /* Fill the default RSS lut values */ 4689 4679 idpf_fill_dflt_rss_lut(vport); 4690 4680 4691 - return idpf_config_rss(vport); 4681 + return 0; 4692 4682 } 4693 4683 4694 4684 /** 4695 - * idpf_deinit_rss - Release RSS resources 4685 + * idpf_deinit_rss_lut - Release RSS LUT 4696 4686 * @vport: virtual port 4697 4687 */ 4698 - void idpf_deinit_rss(struct idpf_vport *vport) 4688 + void idpf_deinit_rss_lut(struct idpf_vport *vport) 4699 4689 { 4700 4690 struct idpf_adapter *adapter = vport->adapter; 4701 4691 struct idpf_rss_data *rss_data; 4702 4692 4703 4693 rss_data = &adapter->vport_config[vport->idx]->user_config.rss_data; 4704 - kfree(rss_data->cached_lut); 4705 - rss_data->cached_lut = NULL; 4706 4694 kfree(rss_data->rss_lut); 4707 4695 rss_data->rss_lut = NULL; 4708 4696 }
+4 -2
drivers/net/ethernet/intel/idpf/idpf_txrx.h
··· 101 101 idx = 0; \ 102 102 } while (0) 103 103 104 + #define IDPF_RX_MAX_BUF_SZ (16384 - 128) 104 105 #define IDPF_RX_BUF_STRIDE 32 105 106 #define IDPF_RX_BUF_POST_STRIDE 16 106 107 #define IDPF_LOW_WATERMARK 64 ··· 1086 1085 void idpf_vport_intr_deinit(struct idpf_vport *vport); 1087 1086 int idpf_vport_intr_init(struct idpf_vport *vport); 1088 1087 void idpf_vport_intr_ena(struct idpf_vport *vport); 1088 + void idpf_fill_dflt_rss_lut(struct idpf_vport *vport); 1089 1089 int idpf_config_rss(struct idpf_vport *vport); 1090 - int idpf_init_rss(struct idpf_vport *vport); 1091 - void idpf_deinit_rss(struct idpf_vport *vport); 1090 + int idpf_init_rss_lut(struct idpf_vport *vport); 1091 + void idpf_deinit_rss_lut(struct idpf_vport *vport); 1092 1092 int idpf_rx_bufs_init_all(struct idpf_vport *vport); 1093 1093 1094 1094 struct idpf_q_vector *idpf_find_rxq_vec(const struct idpf_vport *vport,
+12 -1
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
··· 2804 2804 * @vport: virtual port data structure 2805 2805 * @get: flag to set or get rss look up table 2806 2806 * 2807 + * When rxhash is disabled, RSS LUT will be configured with zeros. If rxhash 2808 + * is enabled, the LUT values stored in driver's soft copy will be used to setup 2809 + * the HW. 2810 + * 2807 2811 * Returns 0 on success, negative on failure. 2808 2812 */ 2809 2813 int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport, bool get) ··· 2818 2814 struct idpf_rss_data *rss_data; 2819 2815 int buf_size, lut_buf_size; 2820 2816 ssize_t reply_sz; 2817 + bool rxhash_ena; 2821 2818 int i; 2822 2819 2823 2820 rss_data = 2824 2821 &vport->adapter->vport_config[vport->idx]->user_config.rss_data; 2822 + rxhash_ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH); 2825 2823 buf_size = struct_size(rl, lut, rss_data->rss_lut_size); 2826 2824 rl = kzalloc(buf_size, GFP_KERNEL); 2827 2825 if (!rl) ··· 2845 2839 } else { 2846 2840 rl->lut_entries = cpu_to_le16(rss_data->rss_lut_size); 2847 2841 for (i = 0; i < rss_data->rss_lut_size; i++) 2848 - rl->lut[i] = cpu_to_le32(rss_data->rss_lut[i]); 2842 + rl->lut[i] = rxhash_ena ? 2843 + cpu_to_le32(rss_data->rss_lut[i]) : 0; 2849 2844 2850 2845 xn_params.vc_op = VIRTCHNL2_OP_SET_RSS_LUT; 2851 2846 } ··· 3577 3570 */ 3578 3571 void idpf_vc_core_deinit(struct idpf_adapter *adapter) 3579 3572 { 3573 + struct idpf_hw *hw = &adapter->hw; 3580 3574 bool remove_in_prog; 3581 3575 3582 3576 if (!test_bit(IDPF_VC_CORE_INIT, adapter->flags)) ··· 3600 3592 cancel_delayed_work_sync(&adapter->mbx_task); 3601 3593 3602 3594 idpf_vport_params_buf_rel(adapter); 3595 + 3596 + kfree(hw->lan_regs); 3597 + hw->lan_regs = NULL; 3603 3598 3604 3599 kfree(adapter->vports); 3605 3600 adapter->vports = NULL;
+2
drivers/net/ethernet/marvell/prestera/prestera_devlink.c
··· 387 387 388 388 dl = devlink_alloc(&prestera_dl_ops, sizeof(struct prestera_switch), 389 389 dev->dev); 390 + if (!dl) 391 + return NULL; 390 392 391 393 return devlink_priv(dl); 392 394 }
+11 -3
drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c
··· 44 44 struct mlx5_flow_table *ft; 45 45 struct mlx5_flow_group *miss_group; 46 46 struct mlx5_flow_handle *miss_rule; 47 + struct mlx5_modify_hdr *rx_modify_hdr; 47 48 struct mlx5_flow_destination default_dest; 48 49 struct mlx5e_psp_rx_err rx_err; 49 50 u32 refcnt; ··· 287 286 return err; 288 287 } 289 288 290 - static void accel_psp_fs_rx_fs_destroy(struct mlx5e_accel_fs_psp_prot *fs_prot) 289 + static void accel_psp_fs_rx_fs_destroy(struct mlx5e_psp_fs *fs, 290 + struct mlx5e_accel_fs_psp_prot *fs_prot) 291 291 { 292 292 if (fs_prot->def_rule) { 293 293 mlx5_del_flow_rules(fs_prot->def_rule); 294 294 fs_prot->def_rule = NULL; 295 + } 296 + 297 + if (fs_prot->rx_modify_hdr) { 298 + mlx5_modify_header_dealloc(fs->mdev, fs_prot->rx_modify_hdr); 299 + fs_prot->rx_modify_hdr = NULL; 295 300 } 296 301 297 302 if (fs_prot->miss_rule) { ··· 403 396 modify_hdr = NULL; 404 397 goto out_err; 405 398 } 399 + fs_prot->rx_modify_hdr = modify_hdr; 406 400 407 401 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | 408 402 MLX5_FLOW_CONTEXT_ACTION_CRYPTO_DECRYPT | ··· 424 416 goto out; 425 417 426 418 out_err: 427 - accel_psp_fs_rx_fs_destroy(fs_prot); 419 + accel_psp_fs_rx_fs_destroy(fs, fs_prot); 428 420 out: 429 421 kvfree(flow_group_in); 430 422 kvfree(spec); ··· 441 433 /* The netdev unreg already happened, so all offloaded rule are already removed */ 442 434 fs_prot = &accel_psp->fs_prot[type]; 443 435 444 - accel_psp_fs_rx_fs_destroy(fs_prot); 436 + accel_psp_fs_rx_fs_destroy(fs, fs_prot); 445 437 446 438 accel_psp_fs_rx_err_destroy_ft(fs, &fs_prot->rx_err); 447 439
+5 -4
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
··· 1608 1608 { 1609 1609 int mode = fec_active_mode(priv->mdev); 1610 1610 1611 - if (mode == MLX5E_FEC_NOFEC || 1612 - !MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) 1611 + if (mode == MLX5E_FEC_NOFEC) 1613 1612 return; 1614 1613 1615 - fec_set_corrected_bits_total(priv, fec_stats); 1616 - fec_set_block_stats(priv, mode, fec_stats); 1614 + if (MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) { 1615 + fec_set_corrected_bits_total(priv, fec_stats); 1616 + fec_set_block_stats(priv, mode, fec_stats); 1617 + } 1617 1618 1618 1619 if (MLX5_CAP_PCAM_REG(priv->mdev, pphcr)) 1619 1620 fec_set_histograms_stats(priv, mode, hist);
+7 -2
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c
··· 173 173 } 174 174 175 175 /* Handle multipath entry with lower priority value */ 176 - if (mp->fib.mfi && mp->fib.mfi != fi && 176 + if (mp->fib.mfi && 177 177 (mp->fib.dst != fen_info->dst || mp->fib.dst_len != fen_info->dst_len) && 178 - fi->fib_priority >= mp->fib.priority) 178 + mp->fib.dst_len <= fen_info->dst_len && 179 + !(mp->fib.dst_len == fen_info->dst_len && 180 + fi->fib_priority < mp->fib.priority)) { 181 + mlx5_core_dbg(ldev->pf[idx].dev, 182 + "Multipath entry with lower priority was rejected\n"); 179 183 return; 184 + } 180 185 181 186 nh_dev0 = mlx5_lag_get_next_fib_dev(ldev, fi, NULL); 182 187 nh_dev1 = mlx5_lag_get_next_fib_dev(ldev, fi, nh_dev0);
+6 -3
drivers/net/ethernet/mellanox/mlx5/core/port.c
··· 393 393 if (err) 394 394 return err; 395 395 396 - *status = MLX5_GET(mcia_reg, out, status); 397 - if (*status) 396 + if (MLX5_GET(mcia_reg, out, status)) { 397 + if (status) 398 + *status = MLX5_GET(mcia_reg, out, status); 398 399 return -EIO; 400 + } 399 401 400 402 ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0); 401 403 memcpy(data, ptr, size); ··· 431 429 mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &offset); 432 430 break; 433 431 default: 434 - mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id); 432 + mlx5_core_dbg(dev, "Module ID not recognized: 0x%x\n", 433 + module_id); 435 434 return -EINVAL; 436 435 } 437 436
+4 -2
drivers/net/ethernet/mscc/ocelot.c
··· 2307 2307 2308 2308 /* Now, set PGIDs for each active LAG */ 2309 2309 for (lag = 0; lag < ocelot->num_phys_ports; lag++) { 2310 - struct net_device *bond = ocelot->ports[lag]->bond; 2310 + struct ocelot_port *ocelot_port = ocelot->ports[lag]; 2311 2311 int num_active_ports = 0; 2312 + struct net_device *bond; 2312 2313 unsigned long bond_mask; 2313 2314 u8 aggr_idx[16]; 2314 2315 2315 - if (!bond || (visited & BIT(lag))) 2316 + if (!ocelot_port || !ocelot_port->bond || (visited & BIT(lag))) 2316 2317 continue; 2317 2318 2319 + bond = ocelot_port->bond; 2318 2320 bond_mask = ocelot_get_bond_mask(ocelot, bond); 2319 2321 2320 2322 for_each_set_bit(port, &bond_mask, ocelot->num_phys_ports) {
+8
drivers/net/netdevsim/bus.c
··· 332 332 rcu_assign_pointer(nsim_a->peer, nsim_b); 333 333 rcu_assign_pointer(nsim_b->peer, nsim_a); 334 334 335 + if (netif_running(dev_a) && netif_running(dev_b)) { 336 + netif_carrier_on(dev_a); 337 + netif_carrier_on(dev_b); 338 + } 339 + 335 340 out_err: 336 341 put_net(ns_b); 337 342 put_net(ns_a); ··· 385 380 peer = rtnl_dereference(nsim->peer); 386 381 if (!peer) 387 382 goto out_put_netns; 383 + 384 + netif_carrier_off(dev); 385 + netif_carrier_off(peer->netdev); 388 386 389 387 err = 0; 390 388 RCU_INIT_POINTER(nsim->peer, NULL);
+3
drivers/net/phy/mxl-86110.c
··· 938 938 PHY_ID_MATCH_EXACT(PHY_ID_MXL86110), 939 939 .name = "MXL86110 Gigabit Ethernet", 940 940 .config_init = mxl86110_config_init, 941 + .suspend = genphy_suspend, 942 + .resume = genphy_resume, 943 + .soft_reset = genphy_soft_reset, 941 944 .get_wol = mxl86110_get_wol, 942 945 .set_wol = mxl86110_set_wol, 943 946 .led_brightness_set = mxl86110_led_brightness_set,
+1 -1
drivers/net/phy/sfp.c
··· 765 765 dev_addr++; 766 766 } 767 767 768 - return 0; 768 + return data - (u8 *)buf; 769 769 } 770 770 771 771 static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)
+2
drivers/net/usb/pegasus.c
··· 168 168 netif_device_detach(pegasus->net); 169 169 netif_err(pegasus, drv, pegasus->net, 170 170 "%s returned %d\n", __func__, ret); 171 + usb_free_urb(async_urb); 172 + kfree(req); 171 173 } 172 174 return ret; 173 175 }
+3 -3
drivers/net/virtio_net.c
··· 3791 3791 if (vi->has_rss && !netif_is_rxfh_configured(dev)) { 3792 3792 old_rss_hdr = vi->rss_hdr; 3793 3793 old_rss_trailer = vi->rss_trailer; 3794 - vi->rss_hdr = devm_kzalloc(&dev->dev, virtnet_rss_hdr_size(vi), GFP_KERNEL); 3794 + vi->rss_hdr = devm_kzalloc(&vi->vdev->dev, virtnet_rss_hdr_size(vi), GFP_KERNEL); 3795 3795 if (!vi->rss_hdr) { 3796 3796 vi->rss_hdr = old_rss_hdr; 3797 3797 return -ENOMEM; ··· 3802 3802 3803 3803 if (!virtnet_commit_rss_command(vi)) { 3804 3804 /* restore ctrl_rss if commit_rss_command failed */ 3805 - devm_kfree(&dev->dev, vi->rss_hdr); 3805 + devm_kfree(&vi->vdev->dev, vi->rss_hdr); 3806 3806 vi->rss_hdr = old_rss_hdr; 3807 3807 vi->rss_trailer = old_rss_trailer; 3808 3808 ··· 3810 3810 queue_pairs); 3811 3811 return -EINVAL; 3812 3812 } 3813 - devm_kfree(&dev->dev, old_rss_hdr); 3813 + devm_kfree(&vi->vdev->dev, old_rss_hdr); 3814 3814 goto succ; 3815 3815 } 3816 3816
+4 -8
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
··· 3019 3019 } 3020 3020 3021 3021 hdr = (const void *)(fw->data + fw->size - sizeof(*hdr)); 3022 - dev_info(dev->dev, "WM Firmware Version: %.10s, Build Time: %.15s\n", 3022 + dev_info(dev->dev, "WM Firmware Version: %.10s, Build Time: %.15s", 3023 3023 hdr->fw_ver, hdr->build_date); 3024 3024 3025 3025 ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, false); ··· 3048 3048 } 3049 3049 3050 3050 hdr = (const void *)(fw->data + fw->size - sizeof(*hdr)); 3051 - dev_info(dev->dev, "WA Firmware Version: %.10s, Build Time: %.15s\n", 3051 + dev_info(dev->dev, "WA Firmware Version: %.10s, Build Time: %.15s", 3052 3052 hdr->fw_ver, hdr->build_date); 3053 3053 3054 3054 ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, true); ··· 3101 3101 int i, ret, sem, max_len = mt76_is_sdio(dev) ? 2048 : 4096; 3102 3102 const struct mt76_connac2_patch_hdr *hdr; 3103 3103 const struct firmware *fw = NULL; 3104 - char build_date[17]; 3105 3104 3106 3105 sem = mt76_connac_mcu_patch_sem_ctrl(dev, true); 3107 3106 switch (sem) { ··· 3124 3125 } 3125 3126 3126 3127 hdr = (const void *)fw->data; 3127 - strscpy(build_date, hdr->build_date, sizeof(build_date)); 3128 - build_date[16] = '\0'; 3129 - strim(build_date); 3130 - dev_info(dev->dev, "HW/SW Version: 0x%x, Build Time: %.16s\n", 3131 - be32_to_cpu(hdr->hw_sw_ver), build_date); 3128 + dev_info(dev->dev, "HW/SW Version: 0x%x, Build Time: %.16s", 3129 + be32_to_cpu(hdr->hw_sw_ver), hdr->build_date); 3132 3130 3133 3131 for (i = 0; i < be32_to_cpu(hdr->desc.n_region); i++) { 3134 3132 struct mt76_connac2_patch_sec *sec;
+3 -3
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 4040 4040 ieee80211_vif_to_wdev(data->nan_device_vif); 4041 4041 4042 4042 if (data->nan_curr_dw_band == NL80211_BAND_5GHZ) 4043 - ch = ieee80211_get_channel(hw->wiphy, 5475); 4043 + ch = ieee80211_get_channel(hw->wiphy, 5745); 4044 4044 else 4045 4045 ch = ieee80211_get_channel(hw->wiphy, 2437); 4046 4046 ··· 4112 4112 hrtimer_cancel(&data->nan_timer); 4113 4113 data->nan_device_vif = NULL; 4114 4114 4115 - spin_lock(&hwsim_radio_lock); 4115 + spin_lock_bh(&hwsim_radio_lock); 4116 4116 list_for_each_entry(data2, &hwsim_radios, list) { 4117 4117 if (data2->nan_device_vif) { 4118 4118 nan_cluster_running = true; 4119 4119 break; 4120 4120 } 4121 4121 } 4122 - spin_unlock(&hwsim_radio_lock); 4122 + spin_unlock_bh(&hwsim_radio_lock); 4123 4123 4124 4124 if (!nan_cluster_running) 4125 4125 memset(hwsim_nan_cluster_id, 0, ETH_ALEN);
+6
drivers/net/wwan/iosm/iosm_ipc_mux.c
··· 456 456 struct sk_buff_head *free_list; 457 457 union mux_msg mux_msg; 458 458 struct sk_buff *skb; 459 + int i; 459 460 460 461 if (!ipc_mux->initialized) 461 462 return; ··· 478 477 if (ipc_mux->channel) { 479 478 ipc_mux->channel->ul_pipe.is_open = false; 480 479 ipc_mux->channel->dl_pipe.is_open = false; 480 + } 481 + 482 + if (ipc_mux->protocol != MUX_LITE) { 483 + for (i = 0; i < IPC_MEM_MUX_IP_SESSION_ENTRIES; i++) 484 + kfree(ipc_mux->ul_adb.pp_qlt[i]); 481 485 } 482 486 483 487 kfree(ipc_mux);
+3 -5
drivers/of/unittest.c
··· 1985 1985 */ 1986 1986 static int __init unittest_data_add(void) 1987 1987 { 1988 - void *unittest_data; 1989 1988 void *unittest_data_align; 1990 1989 struct device_node *unittest_data_node = NULL, *np; 1991 1990 /* ··· 2003 2004 } 2004 2005 2005 2006 /* creating copy */ 2006 - unittest_data = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL); 2007 + void *unittest_data __free(kfree) = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL); 2007 2008 if (!unittest_data) 2008 2009 return -ENOMEM; 2009 2010 ··· 2013 2014 ret = of_fdt_unflatten_tree(unittest_data_align, NULL, &unittest_data_node); 2014 2015 if (!ret) { 2015 2016 pr_warn("%s: unflatten testcases tree failed\n", __func__); 2016 - kfree(unittest_data); 2017 2017 return -ENODATA; 2018 2018 } 2019 2019 if (!unittest_data_node) { 2020 2020 pr_warn("%s: testcases tree is empty\n", __func__); 2021 - kfree(unittest_data); 2022 2021 return -ENODATA; 2023 2022 } 2024 2023 ··· 2035 2038 /* attach the sub-tree to live tree */ 2036 2039 if (!of_root) { 2037 2040 pr_warn("%s: no live tree to attach sub-tree\n", __func__); 2038 - kfree(unittest_data); 2039 2041 rc = -ENODEV; 2040 2042 goto unlock; 2041 2043 } ··· 2054 2058 2055 2059 EXPECT_END(KERN_INFO, 2056 2060 "Duplicate name in testcase-data, renamed to \"duplicate-name#1\""); 2061 + 2062 + retain_and_null_ptr(unittest_data); 2057 2063 2058 2064 unlock: 2059 2065 of_overlay_mutex_unlock();
+7 -7
drivers/platform/mellanox/mlxbf-pmc.c
··· 801 801 {11, "GDC_MISS_MACHINE_CHI_TXDAT"}, 802 802 {12, "GDC_MISS_MACHINE_CHI_RXDAT"}, 803 803 {13, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_0"}, 804 - {14, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_1 "}, 804 + {14, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_1"}, 805 805 {15, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_2"}, 806 - {16, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_3 "}, 807 - {17, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_0 "}, 808 - {18, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_1 "}, 809 - {19, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_2 "}, 810 - {20, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_3 "}, 806 + {16, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_3"}, 807 + {17, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_0"}, 808 + {18, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_1"}, 809 + {19, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_2"}, 810 + {20, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_3"}, 811 811 {21, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_0"}, 812 812 {22, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_1"}, 813 813 {23, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_2"}, 814 814 {24, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_3"}, 815 - {25, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_0 "}, 815 + {25, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_0"}, 816 816 {26, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_1"}, 817 817 {27, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_2"}, 818 818 {28, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_3"},
+173 -3
drivers/platform/x86/asus-armoury.h
··· 449 449 .ac_data = &(struct power_limits) { 450 450 .ppt_pl1_spl_min = 15, 451 451 .ppt_pl1_spl_max = 80, 452 - .ppt_pl2_sppt_min = 25, 452 + .ppt_pl2_sppt_min = 35, 453 453 .ppt_pl2_sppt_max = 80, 454 454 .ppt_pl3_fppt_min = 35, 455 - .ppt_pl3_fppt_max = 80 455 + .ppt_pl3_fppt_max = 80, 456 + .nv_dynamic_boost_min = 5, 457 + .nv_dynamic_boost_max = 25, 458 + .nv_temp_target_min = 75, 459 + .nv_temp_target_max = 87, 456 460 }, 457 - .dc_data = NULL, 461 + .dc_data = &(struct power_limits) { 462 + .ppt_pl1_spl_min = 15, 463 + .ppt_pl1_spl_def = 45, 464 + .ppt_pl1_spl_max = 65, 465 + .ppt_pl2_sppt_min = 35, 466 + .ppt_pl2_sppt_def = 54, 467 + .ppt_pl2_sppt_max = 65, 468 + .ppt_pl3_fppt_min = 35, 469 + .ppt_pl3_fppt_max = 65, 470 + .nv_temp_target_min = 75, 471 + .nv_temp_target_max = 87, 472 + }, 458 473 }, 459 474 }, 460 475 { ··· 562 547 .ppt_pl2_sppt_max = 80, 563 548 .ppt_pl3_fppt_min = 25, 564 549 .ppt_pl3_fppt_max = 80, 550 + .nv_temp_target_min = 75, 551 + .nv_temp_target_max = 87, 552 + }, 553 + }, 554 + }, 555 + { 556 + .matches = { 557 + DMI_MATCH(DMI_BOARD_NAME, "FA608UM"), 558 + }, 559 + .driver_data = &(struct power_data) { 560 + .ac_data = &(struct power_limits) { 561 + .ppt_pl1_spl_min = 15, 562 + .ppt_pl1_spl_def = 45, 563 + .ppt_pl1_spl_max = 90, 564 + .ppt_pl2_sppt_min = 35, 565 + .ppt_pl2_sppt_def = 54, 566 + .ppt_pl2_sppt_max = 90, 567 + .ppt_pl3_fppt_min = 35, 568 + .ppt_pl3_fppt_def = 90, 569 + .ppt_pl3_fppt_max = 65, 570 + .nv_dynamic_boost_min = 10, 571 + .nv_dynamic_boost_max = 15, 572 + .nv_temp_target_min = 75, 573 + .nv_temp_target_max = 87, 574 + .nv_tgp_min = 55, 575 + .nv_tgp_max = 100, 576 + }, 577 + .dc_data = &(struct power_limits) { 578 + .ppt_pl1_spl_min = 15, 579 + .ppt_pl1_spl_def = 45, 580 + .ppt_pl1_spl_max = 65, 581 + .ppt_pl2_sppt_min = 35, 582 + .ppt_pl2_sppt_def = 54, 583 + .ppt_pl2_sppt_max = 65, 584 + .ppt_pl3_fppt_min = 35, 585 + .ppt_pl3_fppt_max = 65, 565 586 .nv_temp_target_min = 75, 566 587 .nv_temp_target_max = 87, 567 588 }, ··· 875 824 }, 876 825 { 877 826 .matches = { 827 + DMI_MATCH(DMI_BOARD_NAME, "GA403WR"), 828 + }, 829 + .driver_data = &(struct power_data) { 830 + .ac_data = &(struct power_limits) { 831 + .ppt_pl1_spl_min = 15, 832 + .ppt_pl1_spl_max = 80, 833 + .ppt_pl2_sppt_min = 25, 834 + .ppt_pl2_sppt_max = 80, 835 + .ppt_pl3_fppt_min = 35, 836 + .ppt_pl3_fppt_max = 80, 837 + .nv_dynamic_boost_min = 0, 838 + .nv_dynamic_boost_max = 25, 839 + .nv_temp_target_min = 75, 840 + .nv_temp_target_max = 87, 841 + .nv_tgp_min = 80, 842 + .nv_tgp_max = 95, 843 + }, 844 + .dc_data = &(struct power_limits) { 845 + .ppt_pl1_spl_min = 15, 846 + .ppt_pl1_spl_max = 35, 847 + .ppt_pl2_sppt_min = 25, 848 + .ppt_pl2_sppt_max = 35, 849 + .ppt_pl3_fppt_min = 35, 850 + .ppt_pl3_fppt_max = 65, 851 + .nv_temp_target_min = 75, 852 + .nv_temp_target_max = 87, 853 + }, 854 + .requires_fan_curve = true, 855 + }, 856 + }, 857 + { 858 + .matches = { 878 859 DMI_MATCH(DMI_BOARD_NAME, "GA503QR"), 879 860 }, 880 861 .driver_data = &(struct power_data) { ··· 1031 948 .nv_temp_target_min = 75, 1032 949 .nv_temp_target_max = 87, 1033 950 }, 951 + }, 952 + }, 953 + { 954 + .matches = { 955 + DMI_MATCH(DMI_BOARD_NAME, "GU605CR"), 956 + }, 957 + .driver_data = &(struct power_data) { 958 + .ac_data = &(struct power_limits) { 959 + .ppt_pl1_spl_min = 30, 960 + .ppt_pl1_spl_max = 85, 961 + .ppt_pl2_sppt_min = 38, 962 + .ppt_pl2_sppt_max = 110, 963 + .nv_dynamic_boost_min = 5, 964 + .nv_dynamic_boost_max = 20, 965 + .nv_temp_target_min = 75, 966 + .nv_temp_target_max = 87, 967 + .nv_tgp_min = 80, 968 + .nv_tgp_def = 90, 969 + .nv_tgp_max = 105, 970 + }, 971 + .dc_data = &(struct power_limits) { 972 + .ppt_pl1_spl_min = 30, 973 + .ppt_pl1_spl_max = 85, 974 + .ppt_pl2_sppt_min = 38, 975 + .ppt_pl2_sppt_max = 110, 976 + .nv_temp_target_min = 75, 977 + .nv_temp_target_max = 87, 978 + }, 979 + .requires_fan_curve = true, 1034 980 }, 1035 981 }, 1036 982 { ··· 1374 1262 }, 1375 1263 { 1376 1264 .matches = { 1265 + DMI_MATCH(DMI_BOARD_NAME, "G615LR"), 1266 + }, 1267 + .driver_data = &(struct power_data) { 1268 + .ac_data = &(struct power_limits) { 1269 + .ppt_pl1_spl_min = 28, 1270 + .ppt_pl1_spl_def = 140, 1271 + .ppt_pl1_spl_max = 175, 1272 + .ppt_pl2_sppt_min = 28, 1273 + .ppt_pl2_sppt_max = 175, 1274 + .nv_temp_target_min = 75, 1275 + .nv_temp_target_max = 87, 1276 + .nv_dynamic_boost_min = 5, 1277 + .nv_dynamic_boost_max = 25, 1278 + .nv_tgp_min = 65, 1279 + .nv_tgp_max = 115, 1280 + }, 1281 + .dc_data = &(struct power_limits) { 1282 + .ppt_pl1_spl_min = 25, 1283 + .ppt_pl1_spl_max = 55, 1284 + .ppt_pl2_sppt_min = 25, 1285 + .ppt_pl2_sppt_max = 70, 1286 + .nv_temp_target_min = 75, 1287 + .nv_temp_target_max = 87, 1288 + }, 1289 + .requires_fan_curve = true, 1290 + }, 1291 + }, 1292 + { 1293 + .matches = { 1377 1294 DMI_MATCH(DMI_BOARD_NAME, "G634J"), 1378 1295 }, 1379 1296 .driver_data = &(struct power_data) { ··· 1555 1414 .nv_dynamic_boost_max = 25, 1556 1415 .nv_temp_target_min = 75, 1557 1416 .nv_temp_target_max = 87, 1417 + }, 1418 + .dc_data = &(struct power_limits) { 1419 + .ppt_pl1_spl_min = 25, 1420 + .ppt_pl1_spl_max = 55, 1421 + .ppt_pl2_sppt_min = 25, 1422 + .ppt_pl2_sppt_max = 70, 1423 + .nv_temp_target_min = 75, 1424 + .nv_temp_target_max = 87, 1425 + }, 1426 + .requires_fan_curve = true, 1427 + }, 1428 + }, 1429 + { 1430 + .matches = { 1431 + DMI_MATCH(DMI_BOARD_NAME, "G835LW"), 1432 + }, 1433 + .driver_data = &(struct power_data) { 1434 + .ac_data = &(struct power_limits) { 1435 + .ppt_pl1_spl_min = 28, 1436 + .ppt_pl1_spl_def = 140, 1437 + .ppt_pl1_spl_max = 175, 1438 + .ppt_pl2_sppt_min = 28, 1439 + .ppt_pl2_sppt_max = 175, 1440 + .nv_dynamic_boost_min = 5, 1441 + .nv_dynamic_boost_max = 25, 1442 + .nv_temp_target_min = 75, 1443 + .nv_temp_target_max = 87, 1444 + .nv_tgp_min = 80, 1445 + .nv_tgp_max = 150, 1558 1446 }, 1559 1447 .dc_data = &(struct power_limits) { 1560 1448 .ppt_pl1_spl_min = 25,
+1
drivers/platform/x86/asus-nb-wmi.c
··· 580 580 { KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } }, 581 581 { KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */ 582 582 { KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */ 583 + { KE_KEY, 0x2d, { KEY_DISPLAYTOGGLE } }, 583 584 { KE_KEY, 0x30, { KEY_VOLUMEUP } }, 584 585 { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, 585 586 { KE_KEY, 0x32, { KEY_MUTE } },
+32
drivers/platform/x86/dell/alienware-wmi-wmax.c
··· 90 90 91 91 static const struct dmi_system_id awcc_dmi_table[] __initconst = { 92 92 { 93 + .ident = "Alienware 16 Area-51", 94 + .matches = { 95 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 96 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16 Area-51"), 97 + }, 98 + .driver_data = &g_series_quirks, 99 + }, 100 + { 101 + .ident = "Alienware 16X Aurora", 102 + .matches = { 103 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 104 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16X Aurora"), 105 + }, 106 + .driver_data = &g_series_quirks, 107 + }, 108 + { 109 + .ident = "Alienware 18 Area-51", 110 + .matches = { 111 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 112 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 18 Area-51"), 113 + }, 114 + .driver_data = &g_series_quirks, 115 + }, 116 + { 93 117 .ident = "Alienware 16 Aurora", 94 118 .matches = { 95 119 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ··· 184 160 DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15"), 185 161 }, 186 162 .driver_data = &generic_quirks, 163 + }, 164 + { 165 + .ident = "Alienware x16", 166 + .matches = { 167 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 168 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x16"), 169 + }, 170 + .driver_data = &g_series_quirks, 187 171 }, 188 172 { 189 173 .ident = "Alienware x17",
+1
drivers/platform/x86/dell/dell-lis3lv02d.c
··· 44 44 /* 45 45 * Additional individual entries were added after verification. 46 46 */ 47 + DELL_LIS3LV02D_DMI_ENTRY("Latitude 5400", 0x29), 47 48 DELL_LIS3LV02D_DMI_ENTRY("Latitude 5480", 0x29), 48 49 DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500", 0x29), 49 50 DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330", 0x29),
+2 -2
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
··· 207 207 case PREREQUISITES: 208 208 size = min_t(u32, enum_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE); 209 209 for (reqs = 0; reqs < size; reqs++) { 210 - if (elem >= enum_obj_count) { 210 + if (elem + reqs >= enum_obj_count) { 211 211 pr_err("Error enum-objects package is too small\n"); 212 212 return -EINVAL; 213 213 } ··· 255 255 256 256 for (pos_values = 0; pos_values < size && pos_values < MAX_VALUES_SIZE; 257 257 pos_values++) { 258 - if (elem >= enum_obj_count) { 258 + if (elem + pos_values >= enum_obj_count) { 259 259 pr_err("Error enum-objects package is too small\n"); 260 260 return -EINVAL; 261 261 }
+1 -1
drivers/platform/x86/hp/hp-bioscfg/int-attributes.c
··· 227 227 size = min_t(u32, integer_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE); 228 228 229 229 for (reqs = 0; reqs < size; reqs++) { 230 - if (elem >= integer_obj_count) { 230 + if (elem + reqs >= integer_obj_count) { 231 231 pr_err("Error elem-objects package is too small\n"); 232 232 return -EINVAL; 233 233 }
+5
drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c
··· 216 216 size = min_t(u32, ordered_list_data->common.prerequisites_size, 217 217 MAX_PREREQUISITES_SIZE); 218 218 for (reqs = 0; reqs < size; reqs++) { 219 + if (elem + reqs >= order_obj_count) { 220 + pr_err("Error elem-objects package is too small\n"); 221 + return -EINVAL; 222 + } 223 + 219 224 ret = hp_convert_hexstr_to_str(order_obj[elem + reqs].string.pointer, 220 225 order_obj[elem + reqs].string.length, 221 226 &str_value, &value_len);
+5
drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
··· 303 303 MAX_PREREQUISITES_SIZE); 304 304 305 305 for (reqs = 0; reqs < size; reqs++) { 306 + if (elem + reqs >= password_obj_count) { 307 + pr_err("Error elem-objects package is too small\n"); 308 + return -EINVAL; 309 + } 310 + 306 311 ret = hp_convert_hexstr_to_str(password_obj[elem + reqs].string.pointer, 307 312 password_obj[elem + reqs].string.length, 308 313 &str_value, &value_len);
+1 -1
drivers/platform/x86/hp/hp-bioscfg/string-attributes.c
··· 217 217 MAX_PREREQUISITES_SIZE); 218 218 219 219 for (reqs = 0; reqs < size; reqs++) { 220 - if (elem >= string_obj_count) { 220 + if (elem + reqs >= string_obj_count) { 221 221 pr_err("Error elem-objects package is too small\n"); 222 222 return -EINVAL; 223 223 }
+1 -1
drivers/platform/x86/ibm_rtl.c
··· 273 273 /* search for the _RTL_ signature at the start of the table */ 274 274 for (i = 0 ; i < ebda_size/sizeof(unsigned int); i++) { 275 275 struct ibm_rtl_table __iomem * tmp; 276 - tmp = (struct ibm_rtl_table __iomem *) (ebda_map+i); 276 + tmp = (struct ibm_rtl_table __iomem *) (ebda_map + i*sizeof(unsigned int)); 277 277 if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) { 278 278 phys_addr_t addr; 279 279 unsigned int plen;
+5 -3
drivers/platform/x86/intel/pmt/discovery.c
··· 503 503 504 504 ret = kobject_init_and_add(&feature->kobj, ktype, &priv->dev->kobj, 505 505 "%s", pmt_feature_names[feature->id]); 506 - if (ret) 506 + if (ret) { 507 + kobject_put(&feature->kobj); 507 508 return ret; 509 + } 508 510 509 511 kobject_uevent(&feature->kobj, KOBJ_ADD); 510 512 pmt_features_add_feat(feature); ··· 548 546 priv->dev = device_create(&intel_pmt_class, &auxdev->dev, MKDEV(0, 0), priv, 549 547 "%s-%s", "features", dev_name(priv->parent)); 550 548 if (IS_ERR(priv->dev)) 551 - return dev_err_probe(priv->dev, PTR_ERR(priv->dev), 549 + return dev_err_probe(&auxdev->dev, PTR_ERR(priv->dev), 552 550 "Could not create %s-%s device node\n", 553 - "features", dev_name(priv->dev)); 551 + "features", dev_name(priv->parent)); 554 552 555 553 /* Initialize each feature */ 556 554 for (i = 0; i < ivdev->num_resources; i++) {
+1 -1
drivers/platform/x86/lenovo/ideapad-laptop.c
··· 1367 1367 /* Performance toggle also Fn+Q, handled inside ideapad_wmi_notify() */ 1368 1368 { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_PROG4 } }, 1369 1369 /* shift + prtsc */ 1370 - { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_CUT } }, 1370 + { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_SELECTIVE_SCREENSHOT } }, 1371 1371 { KE_KEY, 0x29 | IDEAPAD_WMI_KEY, { KEY_TOUCHPAD_TOGGLE } }, 1372 1372 { KE_KEY, 0x2a | IDEAPAD_WMI_KEY, { KEY_ROOT_MENU } }, 1373 1373
+5 -1
drivers/platform/x86/lenovo/think-lmi.c
··· 195 195 }; 196 196 197 197 static const struct tlmi_cert_guids thinkcenter_cert_guid = { 198 - .thumbprint = NULL, 198 + .thumbprint = LENOVO_CERT_THUMBPRINT_GUID, /* Same GUID as TP */ 199 199 .set_bios_setting = LENOVO_TC_SET_BIOS_SETTING_CERT_GUID, 200 200 .save_bios_setting = LENOVO_TC_SAVE_BIOS_SETTING_CERT_GUID, 201 201 .cert_to_password = LENOVO_TC_CERT_TO_PASSWORD_GUID, ··· 707 707 acpi_status status; 708 708 709 709 if (!tlmi_priv.cert_guid->thumbprint) 710 + return -EOPNOTSUPP; 711 + 712 + /* Older ThinkCenter BIOS may not have support */ 713 + if (!wmi_has_guid(tlmi_priv.cert_guid->thumbprint)) 710 714 return -EOPNOTSUPP; 711 715 712 716 status = wmi_evaluate_method(tlmi_priv.cert_guid->thumbprint, 0, 0, &input, &output);
+3
drivers/platform/x86/msi-laptop.c
··· 1130 1130 sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group); 1131 1131 if (!quirks->old_ec_model && threeg_exists) 1132 1132 device_remove_file(&msipf_device->dev, &dev_attr_threeg); 1133 + if (quirks->old_ec_model) 1134 + sysfs_remove_group(&msipf_device->dev.kobj, 1135 + &msipf_old_attribute_group); 1133 1136 platform_device_unregister(msipf_device); 1134 1137 platform_driver_unregister(&msipf_driver); 1135 1138 backlight_device_unregister(msibl_device);
+6 -3
drivers/platform/x86/samsung-galaxybook.c
··· 442 442 union power_supply_propval *val) 443 443 { 444 444 struct samsung_galaxybook *galaxybook = ext_data; 445 + u8 value; 445 446 int err; 446 447 447 448 if (psp != POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD) 448 449 return -EINVAL; 449 450 450 - err = charge_control_end_threshold_acpi_get(galaxybook, (u8 *)&val->intval); 451 + err = charge_control_end_threshold_acpi_get(galaxybook, &value); 451 452 if (err) 452 453 return err; 453 454 ··· 456 455 * device stores "no end threshold" as 0 instead of 100; 457 456 * if device has 0, report 100 458 457 */ 459 - if (val->intval == 0) 460 - val->intval = 100; 458 + if (value == 0) 459 + value = 100; 460 + 461 + val->intval = value; 461 462 462 463 return 0; 463 464 }
+7
drivers/platform/x86/uniwill/uniwill-acpi.c
··· 1845 1845 }, 1846 1846 }, 1847 1847 { 1848 + .ident = "TUXEDO Book BA15 Gen10 AMD", 1849 + .matches = { 1850 + DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), 1851 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5PU1G"), 1852 + }, 1853 + }, 1854 + { 1848 1855 .ident = "TUXEDO Pulse 14 Gen1 AMD", 1849 1856 .matches = { 1850 1857 DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
+2 -3
drivers/pmdomain/imx/gpc.c
··· 402 402 static int imx_gpc_probe(struct platform_device *pdev) 403 403 { 404 404 const struct imx_gpc_dt_data *of_id_data = device_get_match_data(&pdev->dev); 405 - struct device_node *pgc_node; 405 + struct device_node *pgc_node __free(device_node) 406 + = of_get_child_by_name(pdev->dev.of_node, "pgc"); 406 407 struct regmap *regmap; 407 408 void __iomem *base; 408 409 int ret; 409 - 410 - pgc_node = of_get_child_by_name(pdev->dev.of_node, "pgc"); 411 410 412 411 /* bail out if DT too old and doesn't provide the necessary info */ 413 412 if (!of_property_present(pdev->dev.of_node, "#power-domain-cells") &&
+6 -15
drivers/pmdomain/mediatek/mtk-pm-domains.c
··· 984 984 } 985 985 } 986 986 987 - static struct device_node *scpsys_get_legacy_regmap(struct device_node *np, const char *pn) 988 - { 989 - struct device_node *local_node; 990 - 991 - for_each_child_of_node(np, local_node) { 992 - if (of_property_present(local_node, pn)) 993 - return local_node; 994 - } 995 - 996 - return NULL; 997 - } 998 - 999 987 static int scpsys_get_bus_protection_legacy(struct device *dev, struct scpsys *scpsys) 1000 988 { 1001 989 const u8 bp_blocks[3] = { ··· 1005 1017 * this makes it then possible to allocate the array of bus_prot 1006 1018 * regmaps and convert all to the new style handling. 1007 1019 */ 1008 - node = scpsys_get_legacy_regmap(np, "mediatek,infracfg"); 1020 + of_node_get(np); 1021 + node = of_find_node_with_property(np, "mediatek,infracfg"); 1009 1022 if (node) { 1010 1023 regmap[0] = syscon_regmap_lookup_by_phandle(node, "mediatek,infracfg"); 1011 1024 of_node_put(node); ··· 1019 1030 regmap[0] = NULL; 1020 1031 } 1021 1032 1022 - node = scpsys_get_legacy_regmap(np, "mediatek,smi"); 1033 + of_node_get(np); 1034 + node = of_find_node_with_property(np, "mediatek,smi"); 1023 1035 if (node) { 1024 1036 smi_np = of_parse_phandle(node, "mediatek,smi", 0); 1025 1037 of_node_put(node); ··· 1038 1048 regmap[1] = NULL; 1039 1049 } 1040 1050 1041 - node = scpsys_get_legacy_regmap(np, "mediatek,infracfg-nao"); 1051 + of_node_get(np); 1052 + node = of_find_node_with_property(np, "mediatek,infracfg-nao"); 1042 1053 if (node) { 1043 1054 regmap[2] = syscon_regmap_lookup_by_phandle(node, "mediatek,infracfg-nao"); 1044 1055 num_regmaps++;
+2 -2
drivers/vfio/pci/nvgrace-gpu/main.c
··· 561 561 ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false, 562 562 nvdev->resmem.ioaddr, 563 563 buf, offset, mem_count, 564 - 0, 0, false); 564 + 0, 0, false, VFIO_PCI_IO_WIDTH_8); 565 565 } 566 566 567 567 return ret; ··· 693 693 ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false, 694 694 nvdev->resmem.ioaddr, 695 695 (char __user *)buf, pos, mem_count, 696 - 0, 0, true); 696 + 0, 0, true, VFIO_PCI_IO_WIDTH_8); 697 697 } 698 698 699 699 return ret;
+5 -2
drivers/vfio/pci/pds/dirty.c
··· 292 292 len = num_ranges * sizeof(*region_info); 293 293 294 294 node = interval_tree_iter_first(ranges, 0, ULONG_MAX); 295 - if (!node) 296 - return -EINVAL; 295 + if (!node) { 296 + err = -EINVAL; 297 + goto out_free_region_info; 298 + } 299 + 297 300 for (int i = 0; i < num_ranges; i++) { 298 301 struct pds_lm_dirty_region_info *ri = &region_info[i]; 299 302 u64 region_size = node->last - node->start + 1;
+18 -7
drivers/vfio/pci/vfio_pci_rdwr.c
··· 135 135 ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem, 136 136 void __iomem *io, char __user *buf, 137 137 loff_t off, size_t count, size_t x_start, 138 - size_t x_end, bool iswrite) 138 + size_t x_end, bool iswrite, 139 + enum vfio_pci_io_width max_width) 139 140 { 140 141 ssize_t done = 0; 141 142 int ret; ··· 151 150 else 152 151 fillable = 0; 153 152 154 - if (fillable >= 8 && !(off % 8)) { 153 + if (fillable >= 8 && !(off % 8) && max_width >= 8) { 155 154 ret = vfio_pci_iordwr64(vdev, iswrite, test_mem, 156 155 io, buf, off, &filled); 157 156 if (ret) 158 157 return ret; 159 158 160 - } else 161 - if (fillable >= 4 && !(off % 4)) { 159 + } else if (fillable >= 4 && !(off % 4) && max_width >= 4) { 162 160 ret = vfio_pci_iordwr32(vdev, iswrite, test_mem, 163 161 io, buf, off, &filled); 164 162 if (ret) 165 163 return ret; 166 164 167 - } else if (fillable >= 2 && !(off % 2)) { 165 + } else if (fillable >= 2 && !(off % 2) && max_width >= 2) { 168 166 ret = vfio_pci_iordwr16(vdev, iswrite, test_mem, 169 167 io, buf, off, &filled); 170 168 if (ret) ··· 234 234 void __iomem *io; 235 235 struct resource *res = &vdev->pdev->resource[bar]; 236 236 ssize_t done; 237 + enum vfio_pci_io_width max_width = VFIO_PCI_IO_WIDTH_8; 237 238 238 239 if (pci_resource_start(pdev, bar)) 239 240 end = pci_resource_len(pdev, bar); ··· 263 262 if (!io) 264 263 return -ENOMEM; 265 264 x_end = end; 265 + 266 + /* 267 + * Certain devices (e.g. Intel X710) don't support qword 268 + * access to the ROM bar. Otherwise PCI AER errors might be 269 + * triggered. 270 + * 271 + * Disable qword access to the ROM bar universally, which 272 + * worked reliably for years before qword access is enabled. 273 + */ 274 + max_width = VFIO_PCI_IO_WIDTH_4; 266 275 } else { 267 276 int ret = vfio_pci_core_setup_barmap(vdev, bar); 268 277 if (ret) { ··· 289 278 } 290 279 291 280 done = vfio_pci_core_do_io_rw(vdev, res->flags & IORESOURCE_MEM, io, buf, pos, 292 - count, x_start, x_end, iswrite); 281 + count, x_start, x_end, iswrite, max_width); 293 282 294 283 if (done >= 0) 295 284 *ppos += done; ··· 363 352 * to the memory enable bit in the command register. 364 353 */ 365 354 done = vfio_pci_core_do_io_rw(vdev, false, iomem, buf, off, count, 366 - 0, 0, iswrite); 355 + 0, 0, iswrite, VFIO_PCI_IO_WIDTH_4); 367 356 368 357 vga_put(vdev->pdev, rsrc); 369 358
+4 -1
drivers/vfio/pci/xe/main.c
··· 250 250 struct xe_vfio_pci_migration_file *migf; 251 251 const struct file_operations *fops; 252 252 int flags; 253 + int ret; 253 254 254 255 migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); 255 256 if (!migf) ··· 260 259 flags = type == XE_VFIO_FILE_SAVE ? O_RDONLY : O_WRONLY; 261 260 migf->filp = anon_inode_getfile("xe_vfio_mig", fops, migf, flags); 262 261 if (IS_ERR(migf->filp)) { 262 + ret = PTR_ERR(migf->filp); 263 263 kfree(migf); 264 - return ERR_CAST(migf->filp); 264 + return ERR_PTR(ret); 265 265 } 266 266 267 267 mutex_init(&migf->lock); ··· 506 504 .open_device = xe_vfio_pci_open_device, 507 505 .close_device = xe_vfio_pci_close_device, 508 506 .ioctl = vfio_pci_core_ioctl, 507 + .get_region_info_caps = vfio_pci_ioctl_get_region_info, 509 508 .device_feature = vfio_pci_core_ioctl_feature, 510 509 .read = vfio_pci_core_read, 511 510 .write = vfio_pci_core_write,
+17 -15
fs/btrfs/delayed-inode.c
··· 152 152 return ERR_PTR(-ENOMEM); 153 153 btrfs_init_delayed_node(node, root, ino); 154 154 155 + /* Cached in the inode and can be accessed. */ 156 + refcount_set(&node->refs, 2); 157 + btrfs_delayed_node_ref_tracker_alloc(node, tracker, GFP_NOFS); 158 + btrfs_delayed_node_ref_tracker_alloc(node, &node->inode_cache_tracker, GFP_NOFS); 159 + 155 160 /* Allocate and reserve the slot, from now it can return a NULL from xa_load(). */ 156 161 ret = xa_reserve(&root->delayed_nodes, ino, GFP_NOFS); 157 - if (ret == -ENOMEM) { 158 - btrfs_delayed_node_ref_tracker_dir_exit(node); 159 - kmem_cache_free(delayed_node_cache, node); 160 - return ERR_PTR(-ENOMEM); 161 - } 162 + if (ret == -ENOMEM) 163 + goto cleanup; 164 + 162 165 xa_lock(&root->delayed_nodes); 163 166 ptr = xa_load(&root->delayed_nodes, ino); 164 167 if (ptr) { 165 168 /* Somebody inserted it, go back and read it. */ 166 169 xa_unlock(&root->delayed_nodes); 167 - btrfs_delayed_node_ref_tracker_dir_exit(node); 168 - kmem_cache_free(delayed_node_cache, node); 169 - node = NULL; 170 - goto again; 170 + goto cleanup; 171 171 } 172 172 ptr = __xa_store(&root->delayed_nodes, ino, node, GFP_ATOMIC); 173 173 ASSERT(xa_err(ptr) != -EINVAL); 174 174 ASSERT(xa_err(ptr) != -ENOMEM); 175 175 ASSERT(ptr == NULL); 176 - 177 - /* Cached in the inode and can be accessed. */ 178 - refcount_set(&node->refs, 2); 179 - btrfs_delayed_node_ref_tracker_alloc(node, tracker, GFP_ATOMIC); 180 - btrfs_delayed_node_ref_tracker_alloc(node, &node->inode_cache_tracker, GFP_ATOMIC); 181 - 182 176 btrfs_inode->delayed_node = node; 183 177 xa_unlock(&root->delayed_nodes); 184 178 185 179 return node; 180 + cleanup: 181 + btrfs_delayed_node_ref_tracker_free(node, tracker); 182 + btrfs_delayed_node_ref_tracker_free(node, &node->inode_cache_tracker); 183 + btrfs_delayed_node_ref_tracker_dir_exit(node); 184 + kmem_cache_free(delayed_node_cache, node); 185 + if (ret) 186 + return ERR_PTR(ret); 187 + goto again; 186 188 } 187 189 188 190 /*
+4 -4
fs/btrfs/extent_io.c
··· 1728 1728 struct btrfs_ordered_extent *ordered; 1729 1729 1730 1730 ordered = btrfs_lookup_first_ordered_range(inode, cur, 1731 - folio_end - cur); 1731 + fs_info->sectorsize); 1732 1732 /* 1733 1733 * We have just run delalloc before getting here, so 1734 1734 * there must be an ordered extent. ··· 1742 1742 btrfs_put_ordered_extent(ordered); 1743 1743 1744 1744 btrfs_mark_ordered_io_finished(inode, folio, cur, 1745 - end - cur, true); 1745 + fs_info->sectorsize, true); 1746 1746 /* 1747 1747 * This range is beyond i_size, thus we don't need to 1748 1748 * bother writing back. ··· 1751 1751 * writeback the sectors with subpage dirty bits, 1752 1752 * causing writeback without ordered extent. 1753 1753 */ 1754 - btrfs_folio_clear_dirty(fs_info, folio, cur, end - cur); 1755 - break; 1754 + btrfs_folio_clear_dirty(fs_info, folio, cur, fs_info->sectorsize); 1755 + continue; 1756 1756 } 1757 1757 ret = submit_one_sector(inode, folio, cur, bio_ctrl, i_size); 1758 1758 if (unlikely(ret < 0)) {
+15 -7
fs/btrfs/inode.c
··· 618 618 struct btrfs_drop_extents_args drop_args = { 0 }; 619 619 struct btrfs_root *root = inode->root; 620 620 struct btrfs_fs_info *fs_info = root->fs_info; 621 - struct btrfs_trans_handle *trans; 621 + struct btrfs_trans_handle *trans = NULL; 622 622 u64 data_len = (compressed_size ?: size); 623 623 int ret; 624 624 struct btrfs_path *path; 625 625 626 626 path = btrfs_alloc_path(); 627 - if (!path) 628 - return -ENOMEM; 627 + if (!path) { 628 + ret = -ENOMEM; 629 + goto out; 630 + } 629 631 630 632 trans = btrfs_join_transaction(root); 631 633 if (IS_ERR(trans)) { 632 - btrfs_free_path(path); 633 - return PTR_ERR(trans); 634 + ret = PTR_ERR(trans); 635 + trans = NULL; 636 + goto out; 634 637 } 635 638 trans->block_rsv = &inode->block_rsv; 636 639 ··· 677 674 * it won't count as data extent, free them directly here. 678 675 * And at reserve time, it's always aligned to page size, so 679 676 * just free one page here. 677 + * 678 + * If we fallback to non-inline (ret == 1) due to -ENOSPC, then we need 679 + * to keep the data reservation. 680 680 */ 681 - btrfs_qgroup_free_data(inode, NULL, 0, fs_info->sectorsize, NULL); 681 + if (ret <= 0) 682 + btrfs_qgroup_free_data(inode, NULL, 0, fs_info->sectorsize, NULL); 682 683 btrfs_free_path(path); 683 - btrfs_end_transaction(trans); 684 + if (trans) 685 + btrfs_end_transaction(trans); 684 686 return ret; 685 687 } 686 688
+19 -2
fs/btrfs/qgroup.c
··· 3208 3208 { 3209 3209 struct btrfs_qgroup *src; 3210 3210 struct btrfs_qgroup *parent; 3211 + struct btrfs_qgroup *qgroup; 3211 3212 struct btrfs_qgroup_list *list; 3213 + LIST_HEAD(qgroup_list); 3214 + const u32 nodesize = fs_info->nodesize; 3212 3215 int nr_parents = 0; 3216 + 3217 + if (btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_FULL) 3218 + return 0; 3213 3219 3214 3220 src = find_qgroup_rb(fs_info, srcid); 3215 3221 if (!src) ··· 3251 3245 if (parent->excl != parent->rfer) 3252 3246 return 1; 3253 3247 3254 - parent->excl += fs_info->nodesize; 3255 - parent->rfer += fs_info->nodesize; 3248 + qgroup_iterator_add(&qgroup_list, parent); 3249 + list_for_each_entry(qgroup, &qgroup_list, iterator) { 3250 + qgroup->rfer += nodesize; 3251 + qgroup->rfer_cmpr += nodesize; 3252 + qgroup->excl += nodesize; 3253 + qgroup->excl_cmpr += nodesize; 3254 + qgroup_dirty(fs_info, qgroup); 3255 + 3256 + /* Append parent qgroups to @qgroup_list. */ 3257 + list_for_each_entry(list, &qgroup->groups, next_group) 3258 + qgroup_iterator_add(&qgroup_list, list->group); 3259 + } 3260 + qgroup_iterator_clean(&qgroup_list); 3256 3261 return 0; 3257 3262 } 3258 3263
+6 -5
fs/btrfs/transaction.c
··· 520 520 * when this is done, it is safe to start a new transaction, but the current 521 521 * transaction might not be fully on disk. 522 522 */ 523 - static void wait_current_trans(struct btrfs_fs_info *fs_info) 523 + static void wait_current_trans(struct btrfs_fs_info *fs_info, unsigned int type) 524 524 { 525 525 struct btrfs_transaction *cur_trans; 526 526 527 527 spin_lock(&fs_info->trans_lock); 528 528 cur_trans = fs_info->running_transaction; 529 - if (cur_trans && is_transaction_blocked(cur_trans)) { 529 + if (cur_trans && is_transaction_blocked(cur_trans) && 530 + (btrfs_blocked_trans_types[cur_trans->state] & type)) { 530 531 refcount_inc(&cur_trans->use_count); 531 532 spin_unlock(&fs_info->trans_lock); 532 533 ··· 702 701 sb_start_intwrite(fs_info->sb); 703 702 704 703 if (may_wait_transaction(fs_info, type)) 705 - wait_current_trans(fs_info); 704 + wait_current_trans(fs_info, type); 706 705 707 706 do { 708 707 ret = join_transaction(fs_info, type); 709 708 if (ret == -EBUSY) { 710 - wait_current_trans(fs_info); 709 + wait_current_trans(fs_info, type); 711 710 if (unlikely(type == TRANS_ATTACH || 712 711 type == TRANS_JOIN_NOSTART)) 713 712 ret = -ENOENT; ··· 1004 1003 1005 1004 void btrfs_throttle(struct btrfs_fs_info *fs_info) 1006 1005 { 1007 - wait_current_trans(fs_info); 1006 + wait_current_trans(fs_info, TRANS_START); 1008 1007 } 1009 1008 1010 1009 bool btrfs_should_end_transaction(struct btrfs_trans_handle *trans)
+2 -4
fs/btrfs/tree-log.c
··· 6341 6341 * and no keys greater than that, so bail out. 6342 6342 */ 6343 6343 break; 6344 - } else if ((min_key->type == BTRFS_INODE_REF_KEY || 6345 - min_key->type == BTRFS_INODE_EXTREF_KEY) && 6346 - (inode->generation == trans->transid || 6347 - ctx->logging_conflict_inodes)) { 6344 + } else if (min_key->type == BTRFS_INODE_REF_KEY || 6345 + min_key->type == BTRFS_INODE_EXTREF_KEY) { 6348 6346 u64 other_ino = 0; 6349 6347 u64 other_parent = 0; 6350 6348
+1 -3
fs/lockd/svc4proc.c
··· 97 97 struct nlm_args *argp = rqstp->rq_argp; 98 98 struct nlm_host *host; 99 99 struct nlm_file *file; 100 - struct nlm_lockowner *test_owner; 101 100 __be32 rc = rpc_success; 102 101 103 102 dprintk("lockd: TEST4 called\n"); ··· 106 107 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 107 108 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 108 109 109 - test_owner = argp->lock.fl.c.flc_owner; 110 110 /* Now check for conflicting locks */ 111 111 resp->status = nlmsvc_testlock(rqstp, file, host, &argp->lock, 112 112 &resp->lock); ··· 114 116 else 115 117 dprintk("lockd: TEST4 status %d\n", ntohl(resp->status)); 116 118 117 - nlmsvc_put_lockowner(test_owner); 119 + nlmsvc_release_lockowner(&argp->lock); 118 120 nlmsvc_release_host(host); 119 121 nlm_release_file(file); 120 122 return rc;
+12 -9
fs/lockd/svclock.c
··· 633 633 } 634 634 635 635 mode = lock_to_openmode(&lock->fl); 636 - error = vfs_test_lock(file->f_file[mode], &lock->fl); 636 + locks_init_lock(&conflock->fl); 637 + /* vfs_test_lock only uses start, end, and owner, but tests flc_file */ 638 + conflock->fl.c.flc_file = lock->fl.c.flc_file; 639 + conflock->fl.fl_start = lock->fl.fl_start; 640 + conflock->fl.fl_end = lock->fl.fl_end; 641 + conflock->fl.c.flc_owner = lock->fl.c.flc_owner; 642 + error = vfs_test_lock(file->f_file[mode], &conflock->fl); 637 643 if (error) { 638 644 /* We can't currently deal with deferred test requests */ 639 645 if (error == FILE_LOCK_DEFERRED) ··· 649 643 goto out; 650 644 } 651 645 652 - if (lock->fl.c.flc_type == F_UNLCK) { 646 + if (conflock->fl.c.flc_type == F_UNLCK) { 653 647 ret = nlm_granted; 654 648 goto out; 655 649 } 656 650 657 651 dprintk("lockd: conflicting lock(ty=%d, %Ld-%Ld)\n", 658 - lock->fl.c.flc_type, (long long)lock->fl.fl_start, 659 - (long long)lock->fl.fl_end); 652 + conflock->fl.c.flc_type, (long long)conflock->fl.fl_start, 653 + (long long)conflock->fl.fl_end); 660 654 conflock->caller = "somehost"; /* FIXME */ 661 655 conflock->len = strlen(conflock->caller); 662 656 conflock->oh.len = 0; /* don't return OH info */ 663 - conflock->svid = lock->fl.c.flc_pid; 664 - conflock->fl.c.flc_type = lock->fl.c.flc_type; 665 - conflock->fl.fl_start = lock->fl.fl_start; 666 - conflock->fl.fl_end = lock->fl.fl_end; 667 - locks_release_private(&lock->fl); 657 + conflock->svid = conflock->fl.c.flc_pid; 658 + locks_release_private(&conflock->fl); 668 659 669 660 ret = nlm_lck_denied; 670 661 out:
+1 -4
fs/lockd/svcproc.c
··· 117 117 struct nlm_args *argp = rqstp->rq_argp; 118 118 struct nlm_host *host; 119 119 struct nlm_file *file; 120 - struct nlm_lockowner *test_owner; 121 120 __be32 rc = rpc_success; 122 121 123 122 dprintk("lockd: TEST called\n"); ··· 125 126 /* Obtain client and file */ 126 127 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 127 128 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 128 - 129 - test_owner = argp->lock.fl.c.flc_owner; 130 129 131 130 /* Now check for conflicting locks */ 132 131 resp->status = cast_status(nlmsvc_testlock(rqstp, file, host, ··· 135 138 dprintk("lockd: TEST status %d vers %d\n", 136 139 ntohl(resp->status), rqstp->rq_vers); 137 140 138 - nlmsvc_put_lockowner(test_owner); 141 + nlmsvc_release_lockowner(&argp->lock); 139 142 nlmsvc_release_host(host); 140 143 nlm_release_file(file); 141 144 return rc;
+10 -2
fs/locks.c
··· 2236 2236 /** 2237 2237 * vfs_test_lock - test file byte range lock 2238 2238 * @filp: The file to test lock for 2239 - * @fl: The lock to test; also used to hold result 2239 + * @fl: The byte-range in the file to test; also used to hold result 2240 2240 * 2241 + * On entry, @fl does not contain a lock, but identifies a range (fl_start, fl_end) 2242 + * in the file (c.flc_file), and an owner (c.flc_owner) for whom existing locks 2243 + * should be ignored. c.flc_type and c.flc_flags are ignored. 2244 + * Both fl_lmops and fl_ops in @fl must be NULL. 2241 2245 * Returns -ERRNO on failure. Indicates presence of conflicting lock by 2242 - * setting conf->fl_type to something other than F_UNLCK. 2246 + * setting fl->fl_type to something other than F_UNLCK. 2247 + * 2248 + * If vfs_test_lock() does find a lock and return it, the caller must 2249 + * use locks_free_lock() or locks_release_private() on the returned lock. 2243 2250 */ 2244 2251 int vfs_test_lock(struct file *filp, struct file_lock *fl) 2245 2252 { 2253 + WARN_ON_ONCE(fl->fl_ops || fl->fl_lmops); 2246 2254 WARN_ON_ONCE(filp != fl->c.flc_file); 2247 2255 if (filp->f_op->lock) 2248 2256 return filp->f_op->lock(filp, F_GETLK, fl);
-1
fs/nfs_common/common.c
··· 17 17 { NFSERR_NOENT, -ENOENT }, 18 18 { NFSERR_IO, -EIO }, 19 19 { NFSERR_NXIO, -ENXIO }, 20 - /* { NFSERR_EAGAIN, -EAGAIN }, */ 21 20 { NFSERR_ACCES, -EACCES }, 22 21 { NFSERR_EXIST, -EEXIST }, 23 22 { NFSERR_XDEV, -EXDEV },
+2
fs/nfsd/netns.h
··· 66 66 67 67 struct lock_manager nfsd4_manager; 68 68 bool grace_ended; 69 + bool grace_end_forced; 70 + bool client_tracking_active; 69 71 time64_t boot_time; 70 72 71 73 struct dentry *nfsd_client_dir;
+1 -1
fs/nfsd/nfs4proc.c
··· 1502 1502 (schedule_timeout(20*HZ) == 0)) { 1503 1503 finish_wait(&nn->nfsd_ssc_waitq, &wait); 1504 1504 kfree(work); 1505 - return nfserr_eagain; 1505 + return nfserr_jukebox; 1506 1506 } 1507 1507 finish_wait(&nn->nfsd_ssc_waitq, &wait); 1508 1508 goto try_again;
+57 -12
fs/nfsd/nfs4state.c
··· 84 84 /* forward declarations */ 85 85 static bool check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner); 86 86 static void nfs4_free_ol_stateid(struct nfs4_stid *stid); 87 - void nfsd4_end_grace(struct nfsd_net *nn); 87 + static void nfsd4_end_grace(struct nfsd_net *nn); 88 88 static void _free_cpntf_state_locked(struct nfsd_net *nn, struct nfs4_cpntf_state *cps); 89 89 static void nfsd4_file_hash_remove(struct nfs4_file *fi); 90 90 static void deleg_reaper(struct nfsd_net *nn); ··· 1218 1218 1219 1219 if (nf) 1220 1220 nfsd_file_put(nf); 1221 - if (rnf) 1221 + if (rnf) { 1222 + nfsd_file_put(rnf); 1222 1223 nfs4_file_put_access(fp, NFS4_SHARE_ACCESS_READ); 1224 + } 1223 1225 } 1224 1226 1225 1227 static void nfsd4_finalize_deleg_timestamps(struct nfs4_delegation *dp, struct file *f) 1226 1228 { 1227 - struct iattr ia = { .ia_valid = ATTR_ATIME | ATTR_CTIME | ATTR_MTIME }; 1229 + struct iattr ia = { .ia_valid = ATTR_ATIME | ATTR_CTIME | ATTR_MTIME | ATTR_DELEG }; 1228 1230 struct inode *inode = file_inode(f); 1229 1231 int ret; 1230 1232 ··· 1759 1757 1760 1758 /** 1761 1759 * nfsd4_revoke_states - revoke all nfsv4 states associated with given filesystem 1762 - * @net: used to identify instance of nfsd (there is one per net namespace) 1760 + * @nn: used to identify instance of nfsd (there is one per net namespace) 1763 1761 * @sb: super_block used to identify target filesystem 1764 1762 * 1765 1763 * All nfs4 states (open, lock, delegation, layout) held by the server instance ··· 1771 1769 * The clients which own the states will subsequently being notified that the 1772 1770 * states have been "admin-revoked". 1773 1771 */ 1774 - void nfsd4_revoke_states(struct net *net, struct super_block *sb) 1772 + void nfsd4_revoke_states(struct nfsd_net *nn, struct super_block *sb) 1775 1773 { 1776 - struct nfsd_net *nn = net_generic(net, nfsd_net_id); 1777 1774 unsigned int idhashval; 1778 1775 unsigned int sc_types; 1779 1776 1780 1777 sc_types = SC_TYPE_OPEN | SC_TYPE_LOCK | SC_TYPE_DELEG | SC_TYPE_LAYOUT; 1781 1778 1782 1779 spin_lock(&nn->client_lock); 1783 - for (idhashval = 0; idhashval < CLIENT_HASH_MASK; idhashval++) { 1780 + for (idhashval = 0; idhashval < CLIENT_HASH_SIZE; idhashval++) { 1784 1781 struct list_head *head = &nn->conf_id_hashtbl[idhashval]; 1785 1782 struct nfs4_client *clp; 1786 1783 retry: ··· 3098 3097 return -ENXIO; 3099 3098 3100 3099 ret = seq_open(file, &states_seq_ops); 3101 - if (ret) 3100 + if (ret) { 3101 + drop_client(clp); 3102 3102 return ret; 3103 + } 3103 3104 s = file->private_data; 3104 3105 s->private = clp; 3105 3106 return 0; ··· 6234 6231 fp = stp->st_stid.sc_file; 6235 6232 spin_lock(&fp->fi_lock); 6236 6233 __nfs4_file_get_access(fp, NFS4_SHARE_ACCESS_READ); 6237 - fp = stp->st_stid.sc_file; 6238 - fp->fi_fds[O_RDONLY] = nf; 6239 - fp->fi_rdeleg_file = nf; 6234 + if (!fp->fi_fds[O_RDONLY]) { 6235 + fp->fi_fds[O_RDONLY] = nf; 6236 + nf = NULL; 6237 + } 6238 + fp->fi_rdeleg_file = nfsd_file_get(fp->fi_fds[O_RDONLY]); 6240 6239 spin_unlock(&fp->fi_lock); 6240 + if (nf) 6241 + nfsd_file_put(nf); 6241 6242 } 6242 6243 return true; 6243 6244 } ··· 6569 6562 return nfs_ok; 6570 6563 } 6571 6564 6572 - void 6565 + static void 6573 6566 nfsd4_end_grace(struct nfsd_net *nn) 6574 6567 { 6575 6568 /* do nothing if grace period already ended */ ··· 6602 6595 */ 6603 6596 } 6604 6597 6598 + /** 6599 + * nfsd4_force_end_grace - forcibly end the NFSv4 grace period 6600 + * @nn: network namespace for the server instance to be updated 6601 + * 6602 + * Forces bypass of normal grace period completion, then schedules 6603 + * the laundromat to end the grace period immediately. Does not wait 6604 + * for the grace period to fully terminate before returning. 6605 + * 6606 + * Return values: 6607 + * %true: Grace termination schedule 6608 + * %false: No action was taken 6609 + */ 6610 + bool nfsd4_force_end_grace(struct nfsd_net *nn) 6611 + { 6612 + if (!nn->client_tracking_ops) 6613 + return false; 6614 + spin_lock(&nn->client_lock); 6615 + if (nn->grace_ended || !nn->client_tracking_active) { 6616 + spin_unlock(&nn->client_lock); 6617 + return false; 6618 + } 6619 + WRITE_ONCE(nn->grace_end_forced, true); 6620 + mod_delayed_work(laundry_wq, &nn->laundromat_work, 0); 6621 + spin_unlock(&nn->client_lock); 6622 + return true; 6623 + } 6624 + 6605 6625 /* 6606 6626 * If we've waited a lease period but there are still clients trying to 6607 6627 * reclaim, wait a little longer to give them a chance to finish. ··· 6638 6604 time64_t double_grace_period_end = nn->boot_time + 6639 6605 2 * nn->nfsd4_lease; 6640 6606 6607 + if (READ_ONCE(nn->grace_end_forced)) 6608 + return false; 6641 6609 if (nn->track_reclaim_completes && 6642 6610 atomic_read(&nn->nr_reclaim_complete) == 6643 6611 nn->reclaim_str_hashtbl_size) ··· 8960 8924 nn->unconf_name_tree = RB_ROOT; 8961 8925 nn->boot_time = ktime_get_real_seconds(); 8962 8926 nn->grace_ended = false; 8927 + nn->grace_end_forced = false; 8928 + nn->client_tracking_active = false; 8963 8929 nn->nfsd4_manager.block_opens = true; 8964 8930 INIT_LIST_HEAD(&nn->nfsd4_manager.list); 8965 8931 INIT_LIST_HEAD(&nn->client_lru); ··· 9042 9004 return ret; 9043 9005 locks_start_grace(net, &nn->nfsd4_manager); 9044 9006 nfsd4_client_tracking_init(net); 9007 + /* safe for laundromat to run now */ 9008 + spin_lock(&nn->client_lock); 9009 + nn->client_tracking_active = true; 9010 + spin_unlock(&nn->client_lock); 9045 9011 if (nn->track_reclaim_completes && nn->reclaim_str_hashtbl_size == 0) 9046 9012 goto skip_grace; 9047 9013 printk(KERN_INFO "NFSD: starting %lld-second grace period (net %x)\n", ··· 9094 9052 9095 9053 shrinker_free(nn->nfsd_client_shrinker); 9096 9054 cancel_work_sync(&nn->nfsd_shrinker_work); 9055 + spin_lock(&nn->client_lock); 9056 + nn->client_tracking_active = false; 9057 + spin_unlock(&nn->client_lock); 9097 9058 cancel_delayed_work_sync(&nn->laundromat_work); 9098 9059 locks_end_grace(&nn->nfsd4_manager); 9099 9060
+9 -3
fs/nfsd/nfsctl.c
··· 259 259 struct path path; 260 260 char *fo_path; 261 261 int error; 262 + struct nfsd_net *nn; 262 263 263 264 /* sanity check */ 264 265 if (size == 0) ··· 286 285 * 3. Is that directory the root of an exported file system? 287 286 */ 288 287 error = nlmsvc_unlock_all_by_sb(path.dentry->d_sb); 289 - nfsd4_revoke_states(netns(file), path.dentry->d_sb); 288 + mutex_lock(&nfsd_mutex); 289 + nn = net_generic(netns(file), nfsd_net_id); 290 + if (nn->nfsd_serv) 291 + nfsd4_revoke_states(nn, path.dentry->d_sb); 292 + else 293 + error = -EINVAL; 294 + mutex_unlock(&nfsd_mutex); 290 295 291 296 path_put(&path); 292 297 return error; ··· 1089 1082 case 'Y': 1090 1083 case 'y': 1091 1084 case '1': 1092 - if (!nn->nfsd_serv) 1085 + if (!nfsd4_force_end_grace(nn)) 1093 1086 return -EBUSY; 1094 1087 trace_nfsd_end_grace(netns(file)); 1095 - nfsd4_end_grace(nn); 1096 1088 break; 1097 1089 default: 1098 1090 return -EINVAL;
-1
fs/nfsd/nfsd.h
··· 233 233 #define nfserr_noent cpu_to_be32(NFSERR_NOENT) 234 234 #define nfserr_io cpu_to_be32(NFSERR_IO) 235 235 #define nfserr_nxio cpu_to_be32(NFSERR_NXIO) 236 - #define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN) 237 236 #define nfserr_acces cpu_to_be32(NFSERR_ACCES) 238 237 #define nfserr_exist cpu_to_be32(NFSERR_EXIST) 239 238 #define nfserr_xdev cpu_to_be32(NFSERR_XDEV)
+14 -14
fs/nfsd/nfssvc.c
··· 406 406 { 407 407 struct nfsd_net *nn = net_generic(net, nfsd_net_id); 408 408 409 - if (!nn->nfsd_net_up) 410 - return; 409 + if (nn->nfsd_net_up) { 410 + percpu_ref_kill_and_confirm(&nn->nfsd_net_ref, nfsd_net_done); 411 + wait_for_completion(&nn->nfsd_net_confirm_done); 411 412 412 - percpu_ref_kill_and_confirm(&nn->nfsd_net_ref, nfsd_net_done); 413 - wait_for_completion(&nn->nfsd_net_confirm_done); 414 - 415 - nfsd_export_flush(net); 416 - nfs4_state_shutdown_net(net); 417 - nfsd_reply_cache_shutdown(nn); 418 - nfsd_file_cache_shutdown_net(net); 419 - if (nn->lockd_up) { 420 - lockd_down(net); 421 - nn->lockd_up = false; 413 + nfsd_export_flush(net); 414 + nfs4_state_shutdown_net(net); 415 + nfsd_reply_cache_shutdown(nn); 416 + nfsd_file_cache_shutdown_net(net); 417 + if (nn->lockd_up) { 418 + lockd_down(net); 419 + nn->lockd_up = false; 420 + } 421 + wait_for_completion(&nn->nfsd_net_free_done); 422 422 } 423 423 424 - wait_for_completion(&nn->nfsd_net_free_done); 425 424 percpu_ref_exit(&nn->nfsd_net_ref); 426 425 426 + if (nn->nfsd_net_up) 427 + nfsd_shutdown_generic(); 427 428 nn->nfsd_net_up = false; 428 - nfsd_shutdown_generic(); 429 429 } 430 430 431 431 static DEFINE_SPINLOCK(nfsd_notifier_lock);
+3 -3
fs/nfsd/state.h
··· 841 841 struct nfsd_file *find_any_file(struct nfs4_file *f); 842 842 843 843 #ifdef CONFIG_NFSD_V4 844 - void nfsd4_revoke_states(struct net *net, struct super_block *sb); 844 + void nfsd4_revoke_states(struct nfsd_net *nn, struct super_block *sb); 845 845 #else 846 - static inline void nfsd4_revoke_states(struct net *net, struct super_block *sb) 846 + static inline void nfsd4_revoke_states(struct nfsd_net *nn, struct super_block *sb) 847 847 { 848 848 } 849 849 #endif 850 850 851 851 /* grace period management */ 852 - void nfsd4_end_grace(struct nfsd_net *nn); 852 + bool nfsd4_force_end_grace(struct nfsd_net *nn); 853 853 854 854 /* nfs4recover operations */ 855 855 extern int nfsd4_client_tracking_init(struct net *net);
+2 -2
fs/nfsd/vfs.c
··· 2865 2865 2866 2866 /* Allow read access to binaries even when mode 111 */ 2867 2867 if (err == -EACCES && S_ISREG(inode->i_mode) && 2868 - (acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE) || 2869 - acc == (NFSD_MAY_READ | NFSD_MAY_READ_IF_EXEC))) 2868 + (((acc & NFSD_MAY_MASK) == NFSD_MAY_READ) && 2869 + (acc & (NFSD_MAY_OWNER_OVERRIDE | NFSD_MAY_READ_IF_EXEC)))) 2870 2870 err = inode_permission(&nop_mnt_idmap, inode, MAY_EXEC); 2871 2871 2872 2872 return err? nfserrno(err) : 0;
+3
fs/smb/client/ioctl.c
··· 588 588 break; 589 589 default: 590 590 cifs_dbg(FYI, "unsupported ioctl\n"); 591 + trace_smb3_unsupported_ioctl(xid, 592 + pSMBFile ? pSMBFile->fid.persistent_fid : 0, 593 + command); 591 594 break; 592 595 } 593 596 cifs_ioc_exit:
+6
fs/smb/client/smb2ops.c
··· 1905 1905 src_off_prev = src_off; 1906 1906 dst_off_prev = dst_off; 1907 1907 1908 + /* 1909 + * __counted_by_le(ChunkCount): set to allocated chunks before 1910 + * populating Chunks[] 1911 + */ 1912 + cc_req->ChunkCount = cpu_to_le32(chunk_count); 1913 + 1908 1914 chunks = 0; 1909 1915 copy_bytes = 0; 1910 1916 copy_bytes_left = umin(total_bytes_left, tcon->max_bytes_copy);
+1
fs/smb/client/trace.h
··· 1579 1579 TP_ARGS(xid, fid, command)) 1580 1580 1581 1581 DEFINE_SMB3_IOCTL_EVENT(ioctl); 1582 + DEFINE_SMB3_IOCTL_EVENT(unsupported_ioctl); 1582 1583 1583 1584 DECLARE_EVENT_CLASS(smb3_shutdown_class, 1584 1585 TP_PROTO(__u32 flags,
+9 -3
fs/smb/server/smb2pdu.c
··· 2281 2281 { 2282 2282 struct smb2_create_rsp *rsp; 2283 2283 struct smb2_create_req *req; 2284 - int id; 2284 + int id = -1; 2285 2285 int err; 2286 2286 char *name; 2287 2287 ··· 2337 2337 rsp->hdr.Status = STATUS_NO_MEMORY; 2338 2338 break; 2339 2339 } 2340 + 2341 + if (id >= 0) 2342 + ksmbd_session_rpc_close(work->sess, id); 2340 2343 2341 2344 if (!IS_ERR(name)) 2342 2345 kfree(name); ··· 2812 2809 SMB2_CLIENT_GUID_SIZE)) { 2813 2810 if (!(req->hdr.Flags & SMB2_FLAGS_REPLAY_OPERATION)) { 2814 2811 err = -ENOEXEC; 2812 + ksmbd_put_durable_fd(dh_info->fp); 2815 2813 goto out; 2816 2814 } 2817 2815 ··· 3010 3006 file_info = FILE_OPENED; 3011 3007 3012 3008 rc = ksmbd_vfs_getattr(&fp->filp->f_path, &stat); 3009 + ksmbd_put_durable_fd(fp); 3013 3010 if (rc) 3014 3011 goto err_out2; 3015 3012 3016 - ksmbd_put_durable_fd(fp); 3017 3013 goto reconnected_fp; 3018 3014 } 3019 3015 } else if (req_op_level == SMB2_OPLOCK_LEVEL_LEASE) ··· 4927 4923 4928 4924 ret = vfs_getattr(&fp->filp->f_path, &stat, STATX_BASIC_STATS, 4929 4925 AT_STATX_SYNC_AS_STAT); 4930 - if (ret) 4926 + if (ret) { 4927 + kfree(filename); 4931 4928 return ret; 4929 + } 4932 4930 4933 4931 ksmbd_debug(SMB, "filename = %s\n", filename); 4934 4932 delete_pending = ksmbd_inode_pending_delete(fp);
+14 -3
include/drm/drm_pagemap.h
··· 8 8 9 9 #define NR_PAGES(order) (1U << (order)) 10 10 11 + struct dma_fence; 11 12 struct drm_pagemap; 12 13 struct drm_pagemap_zdd; 13 14 struct device; ··· 175 174 * @pages: Pointer to array of device memory pages (destination) 176 175 * @pagemap_addr: Pointer to array of DMA information (source) 177 176 * @npages: Number of pages to copy 177 + * @pre_migrate_fence: dma-fence to wait for before migration start. 178 + * May be NULL. 178 179 * 179 180 * Copy pages to device memory. If the order of a @pagemap_addr entry 180 181 * is greater than 0, the entry is populated but subsequent entries ··· 186 183 */ 187 184 int (*copy_to_devmem)(struct page **pages, 188 185 struct drm_pagemap_addr *pagemap_addr, 189 - unsigned long npages); 186 + unsigned long npages, 187 + struct dma_fence *pre_migrate_fence); 190 188 191 189 /** 192 190 * @copy_to_ram: Copy to system RAM (required for migration) 193 191 * @pages: Pointer to array of device memory pages (source) 194 192 * @pagemap_addr: Pointer to array of DMA information (destination) 195 193 * @npages: Number of pages to copy 194 + * @pre_migrate_fence: dma-fence to wait for before migration start. 195 + * May be NULL. 196 196 * 197 197 * Copy pages to system RAM. If the order of a @pagemap_addr entry 198 198 * is greater than 0, the entry is populated but subsequent entries ··· 205 199 */ 206 200 int (*copy_to_ram)(struct page **pages, 207 201 struct drm_pagemap_addr *pagemap_addr, 208 - unsigned long npages); 202 + unsigned long npages, 203 + struct dma_fence *pre_migrate_fence); 209 204 }; 210 205 211 206 /** ··· 219 212 * @dpagemap: The struct drm_pagemap of the pages this allocation belongs to. 220 213 * @size: Size of device memory allocation 221 214 * @timeslice_expiration: Timeslice expiration in jiffies 215 + * @pre_migrate_fence: Fence to wait for or pipeline behind before migration starts. 216 + * (May be NULL). 222 217 */ 223 218 struct drm_pagemap_devmem { 224 219 struct device *dev; ··· 230 221 struct drm_pagemap *dpagemap; 231 222 size_t size; 232 223 u64 timeslice_expiration; 224 + struct dma_fence *pre_migrate_fence; 233 225 }; 234 226 235 227 int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation, ··· 248 238 void drm_pagemap_devmem_init(struct drm_pagemap_devmem *devmem_allocation, 249 239 struct device *dev, struct mm_struct *mm, 250 240 const struct drm_pagemap_devmem_ops *ops, 251 - struct drm_pagemap *dpagemap, size_t size); 241 + struct drm_pagemap *dpagemap, size_t size, 242 + struct dma_fence *pre_migrate_fence); 252 243 253 244 int drm_pagemap_populate_mm(struct drm_pagemap *dpagemap, 254 245 unsigned long start, unsigned long end,
+33 -20
include/kunit/run-in-irq-context.h
··· 20 20 bool task_func_reported_failure; 21 21 bool hardirq_func_reported_failure; 22 22 bool softirq_func_reported_failure; 23 - unsigned long hardirq_func_calls; 24 - unsigned long softirq_func_calls; 23 + atomic_t hardirq_func_calls; 24 + atomic_t softirq_func_calls; 25 25 struct hrtimer timer; 26 26 struct work_struct bh_work; 27 27 }; ··· 32 32 container_of(timer, typeof(*state), timer); 33 33 34 34 WARN_ON_ONCE(!in_hardirq()); 35 - state->hardirq_func_calls++; 35 + atomic_inc(&state->hardirq_func_calls); 36 36 37 37 if (!state->func(state->test_specific_state)) 38 38 state->hardirq_func_reported_failure = true; ··· 48 48 container_of(work, typeof(*state), bh_work); 49 49 50 50 WARN_ON_ONCE(!in_serving_softirq()); 51 - state->softirq_func_calls++; 51 + atomic_inc(&state->softirq_func_calls); 52 52 53 53 if (!state->func(state->test_specific_state)) 54 54 state->softirq_func_reported_failure = true; ··· 59 59 * hardirq context concurrently, and reports a failure to KUnit if any 60 60 * invocation of @func in any context returns false. @func is passed 61 61 * @test_specific_state as its argument. At most 3 invocations of @func will 62 - * run concurrently: one in each of task, softirq, and hardirq context. 62 + * run concurrently: one in each of task, softirq, and hardirq context. @func 63 + * will continue running until either @max_iterations calls have been made (so 64 + * long as at least one each runs in task, softirq, and hardirq contexts), or 65 + * one second has passed. 63 66 * 64 67 * The main purpose of this interrupt context testing is to validate fallback 65 68 * code paths that run in contexts where the normal code path cannot be used, ··· 88 85 .test_specific_state = test_specific_state, 89 86 }; 90 87 unsigned long end_jiffies; 88 + int hardirq_calls, softirq_calls; 89 + bool allctx = false; 91 90 92 91 /* 93 92 * Set up a hrtimer (the way we access hardirq context) and a work ··· 99 94 CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); 100 95 INIT_WORK_ONSTACK(&state.bh_work, kunit_irq_test_bh_work_func); 101 96 102 - /* Run for up to max_iterations or 1 second, whichever comes first. */ 97 + /* 98 + * Run for up to max_iterations (including at least one task, softirq, 99 + * and hardirq), or 1 second, whichever comes first. 100 + */ 103 101 end_jiffies = jiffies + HZ; 104 102 hrtimer_start(&state.timer, KUNIT_IRQ_TEST_HRTIMER_INTERVAL, 105 103 HRTIMER_MODE_REL_HARD); 106 - for (int i = 0; i < max_iterations && !time_after(jiffies, end_jiffies); 107 - i++) { 104 + for (int task_calls = 0, calls = 0; 105 + ((calls < max_iterations) || !allctx) && 106 + !time_after(jiffies, end_jiffies); 107 + task_calls++) { 108 108 if (!func(test_specific_state)) 109 109 state.task_func_reported_failure = true; 110 + 111 + hardirq_calls = atomic_read(&state.hardirq_func_calls); 112 + softirq_calls = atomic_read(&state.softirq_func_calls); 113 + calls = task_calls + hardirq_calls + softirq_calls; 114 + allctx = (task_calls > 0) && (hardirq_calls > 0) && 115 + (softirq_calls > 0); 110 116 } 111 117 112 118 /* Cancel the timer and work. */ ··· 125 109 flush_work(&state.bh_work); 126 110 127 111 /* Sanity check: the timer and BH functions should have been run. */ 128 - KUNIT_EXPECT_GT_MSG(test, state.hardirq_func_calls, 0, 112 + KUNIT_EXPECT_GT_MSG(test, atomic_read(&state.hardirq_func_calls), 0, 129 113 "Timer function was not called"); 130 - KUNIT_EXPECT_GT_MSG(test, state.softirq_func_calls, 0, 114 + KUNIT_EXPECT_GT_MSG(test, atomic_read(&state.softirq_func_calls), 0, 131 115 "BH work function was not called"); 132 116 133 - /* Check for incorrect hash values reported from any context. */ 134 - KUNIT_EXPECT_FALSE_MSG( 135 - test, state.task_func_reported_failure, 136 - "Incorrect hash values reported from task context"); 137 - KUNIT_EXPECT_FALSE_MSG( 138 - test, state.hardirq_func_reported_failure, 139 - "Incorrect hash values reported from hardirq context"); 140 - KUNIT_EXPECT_FALSE_MSG( 141 - test, state.softirq_func_reported_failure, 142 - "Incorrect hash values reported from softirq context"); 117 + /* Check for failure reported from any context. */ 118 + KUNIT_EXPECT_FALSE_MSG(test, state.task_func_reported_failure, 119 + "Failure reported from task context"); 120 + KUNIT_EXPECT_FALSE_MSG(test, state.hardirq_func_reported_failure, 121 + "Failure reported from hardirq context"); 122 + KUNIT_EXPECT_FALSE_MSG(test, state.softirq_func_reported_failure, 123 + "Failure reported from softirq context"); 143 124 } 144 125 145 126 #endif /* _KUNIT_RUN_IN_IRQ_CONTEXT_H */
+9 -8
include/linux/intel_vsec.h
··· 80 80 81 81 /** 82 82 * struct pmt_callbacks - Callback infrastructure for PMT devices 83 - * ->read_telem() when specified, called by client driver to access PMT data (instead 84 - * of direct copy). 85 - * @pdev: PCI device reference for the callback's use 86 - * @guid: ID of data to acccss 87 - * @data: buffer for the data to be copied 88 - * @off: offset into the requested buffer 89 - * @count: size of buffer 83 + * @read_telem: when specified, called by client driver to access PMT 84 + * data (instead of direct copy). 85 + * * pdev: PCI device reference for the callback's use 86 + * * guid: ID of data to acccss 87 + * * data: buffer for the data to be copied 88 + * * off: offset into the requested buffer 89 + * * count: size of buffer 90 90 */ 91 91 struct pmt_callbacks { 92 92 int (*read_telem)(struct pci_dev *pdev, u32 guid, u64 *data, loff_t off, u32 count); ··· 120 120 }; 121 121 122 122 /** 123 - * struct intel_sec_device - Auxbus specific device information 123 + * struct intel_vsec_device - Auxbus specific device information 124 124 * @auxdev: auxbus device struct for auxbus access 125 125 * @pcidev: pci device associated with the device 126 126 * @resource: any resources shared by the parent ··· 128 128 * @num_resources: number of resources 129 129 * @id: xarray id 130 130 * @priv_data: any private data needed 131 + * @priv_data_size: size of private data area 131 132 * @quirks: specified quirks 132 133 * @base_addr: base address of entries (if specified) 133 134 * @cap_id: the enumerated id of the vsec feature
+7 -1
include/linux/io_uring_types.h
··· 424 424 struct user_struct *user; 425 425 struct mm_struct *mm_account; 426 426 427 + /* 428 + * List of tctx nodes for this ctx, protected by tctx_lock. For 429 + * cancelation purposes, nests under uring_lock. 430 + */ 431 + struct list_head tctx_list; 432 + struct mutex tctx_lock; 433 + 427 434 /* ctx exit and cancelation */ 428 435 struct llist_head fallback_llist; 429 436 struct delayed_work fallback_work; 430 437 struct work_struct exit_work; 431 - struct list_head tctx_list; 432 438 struct completion ref_comp; 433 439 434 440 /* io-wq management, e.g. thread count */
+2 -2
include/linux/irq-entry-common.h
··· 110 110 static inline void local_irq_enable_exit_to_user(unsigned long ti_work); 111 111 112 112 #ifndef local_irq_enable_exit_to_user 113 - static inline void local_irq_enable_exit_to_user(unsigned long ti_work) 113 + static __always_inline void local_irq_enable_exit_to_user(unsigned long ti_work) 114 114 { 115 115 local_irq_enable(); 116 116 } ··· 125 125 static inline void local_irq_disable_exit_to_user(void); 126 126 127 127 #ifndef local_irq_disable_exit_to_user 128 - static inline void local_irq_disable_exit_to_user(void) 128 + static __always_inline void local_irq_disable_exit_to_user(void) 129 129 { 130 130 local_irq_disable(); 131 131 }
+2 -1
include/linux/netdevice.h
··· 5323 5323 static inline netdev_features_t netdev_add_tso_features(netdev_features_t features, 5324 5324 netdev_features_t mask) 5325 5325 { 5326 - return netdev_increment_features(features, NETIF_F_ALL_TSO, mask); 5326 + return netdev_increment_features(features, NETIF_F_ALL_TSO | 5327 + NETIF_F_ALL_FOR_ALL, mask); 5327 5328 } 5328 5329 5329 5330 int __netdev_update_features(struct net_device *dev);
+4 -4
include/linux/soc/airoha/airoha_offload.h
··· 71 71 #define NPU_RX1_DESC_NUM 512 72 72 73 73 /* CTRL */ 74 - #define NPU_RX_DMA_DESC_LAST_MASK BIT(29) 75 - #define NPU_RX_DMA_DESC_LEN_MASK GENMASK(28, 15) 76 - #define NPU_RX_DMA_DESC_CUR_LEN_MASK GENMASK(14, 1) 74 + #define NPU_RX_DMA_DESC_LAST_MASK BIT(27) 75 + #define NPU_RX_DMA_DESC_LEN_MASK GENMASK(26, 14) 76 + #define NPU_RX_DMA_DESC_CUR_LEN_MASK GENMASK(13, 1) 77 77 #define NPU_RX_DMA_DESC_DONE_MASK BIT(0) 78 78 /* INFO */ 79 - #define NPU_RX_DMA_PKT_COUNT_MASK GENMASK(31, 28) 79 + #define NPU_RX_DMA_PKT_COUNT_MASK GENMASK(31, 29) 80 80 #define NPU_RX_DMA_PKT_ID_MASK GENMASK(28, 26) 81 81 #define NPU_RX_DMA_SRC_PORT_MASK GENMASK(25, 21) 82 82 #define NPU_RX_DMA_CRSN_MASK GENMASK(20, 16)
+9 -1
include/linux/vfio_pci_core.h
··· 145 145 struct list_head dmabufs; 146 146 }; 147 147 148 + enum vfio_pci_io_width { 149 + VFIO_PCI_IO_WIDTH_1 = 1, 150 + VFIO_PCI_IO_WIDTH_2 = 2, 151 + VFIO_PCI_IO_WIDTH_4 = 4, 152 + VFIO_PCI_IO_WIDTH_8 = 8, 153 + }; 154 + 148 155 /* Will be exported for vfio pci drivers usage */ 149 156 int vfio_pci_core_register_dev_region(struct vfio_pci_core_device *vdev, 150 157 unsigned int type, unsigned int subtype, ··· 195 188 ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem, 196 189 void __iomem *io, char __user *buf, 197 190 loff_t off, size_t count, size_t x_start, 198 - size_t x_end, bool iswrite); 191 + size_t x_end, bool iswrite, 192 + enum vfio_pci_io_width max_width); 199 193 bool __vfio_pci_memory_enabled(struct vfio_pci_core_device *vdev); 200 194 bool vfio_pci_core_range_intersect_range(loff_t buf_start, size_t buf_cnt, 201 195 loff_t reg_start, size_t reg_cnt,
+2 -1
include/trace/events/btrfs.h
··· 224 224 __entry->generation = BTRFS_I(inode)->generation; 225 225 __entry->last_trans = BTRFS_I(inode)->last_trans; 226 226 __entry->logged_trans = BTRFS_I(inode)->logged_trans; 227 - __entry->root_objectid = btrfs_root_id(BTRFS_I(inode)->root); 227 + __entry->root_objectid = BTRFS_I(inode)->root ? 228 + btrfs_root_id(BTRFS_I(inode)->root) : 0; 228 229 ), 229 230 230 231 TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%llu blocks=%llu "
-2
include/trace/misc/nfs.h
··· 16 16 TRACE_DEFINE_ENUM(NFSERR_NOENT); 17 17 TRACE_DEFINE_ENUM(NFSERR_IO); 18 18 TRACE_DEFINE_ENUM(NFSERR_NXIO); 19 - TRACE_DEFINE_ENUM(NFSERR_EAGAIN); 20 19 TRACE_DEFINE_ENUM(NFSERR_ACCES); 21 20 TRACE_DEFINE_ENUM(NFSERR_EXIST); 22 21 TRACE_DEFINE_ENUM(NFSERR_XDEV); ··· 51 52 { NFSERR_NXIO, "NXIO" }, \ 52 53 { ECHILD, "CHILD" }, \ 53 54 { ETIMEDOUT, "TIMEDOUT" }, \ 54 - { NFSERR_EAGAIN, "AGAIN" }, \ 55 55 { NFSERR_ACCES, "ACCES" }, \ 56 56 { NFSERR_EXIST, "EXIST" }, \ 57 57 { NFSERR_XDEV, "XDEV" }, \
-1
include/uapi/linux/nfs.h
··· 49 49 NFSERR_NOENT = 2, /* v2 v3 v4 */ 50 50 NFSERR_IO = 5, /* v2 v3 v4 */ 51 51 NFSERR_NXIO = 6, /* v2 v3 v4 */ 52 - NFSERR_EAGAIN = 11, /* v2 v3 */ 53 52 NFSERR_ACCES = 13, /* v2 v3 v4 */ 54 53 NFSERR_EXIST = 17, /* v2 v3 v4 */ 55 54 NFSERR_XDEV = 18, /* v3 v4 */
+1 -1
include/uapi/rdma/irdma-abi.h
··· 57 57 __u8 rsvd2; 58 58 __aligned_u64 comp_mask; 59 59 __u16 min_hw_wq_size; 60 + __u8 revd3[2]; 60 61 __u32 max_hw_srq_quanta; 61 - __u8 rsvd3[2]; 62 62 }; 63 63 64 64 struct irdma_alloc_pd_resp {
+3 -1
include/uapi/rdma/rdma_user_cm.h
··· 192 192 193 193 struct rdma_ucm_query_ib_service_resp { 194 194 __u32 num_service_recs; 195 + __u32 reserved; 195 196 struct ib_user_service_rec recs[]; 196 197 }; 197 198 ··· 355 354 356 355 #define RDMA_USER_CM_IB_SERVICE_NAME_SIZE 64 357 356 struct rdma_ucm_ib_service { 358 - __u64 service_id; 357 + __aligned_u64 service_id; 359 358 __u8 service_name[RDMA_USER_CM_IB_SERVICE_NAME_SIZE]; 360 359 __u32 flags; 361 360 __u32 reserved; ··· 363 362 364 363 struct rdma_ucm_resolve_ib_service { 365 364 __u32 id; 365 + __u32 reserved; 366 366 struct rdma_ucm_ib_service ibs; 367 367 }; 368 368
+5
io_uring/cancel.c
··· 184 184 } while (1); 185 185 186 186 /* slow path, try all io-wq's */ 187 + __set_current_state(TASK_RUNNING); 187 188 io_ring_submit_lock(ctx, issue_flags); 189 + mutex_lock(&ctx->tctx_lock); 188 190 ret = -ENOENT; 189 191 list_for_each_entry(node, &ctx->tctx_list, ctx_node) { 190 192 ret = io_async_cancel_one(node->task->io_uring, cd); ··· 196 194 nr++; 197 195 } 198 196 } 197 + mutex_unlock(&ctx->tctx_lock); 199 198 io_ring_submit_unlock(ctx, issue_flags); 200 199 return all ? nr : ret; 201 200 } ··· 487 484 bool ret = false; 488 485 489 486 mutex_lock(&ctx->uring_lock); 487 + mutex_lock(&ctx->tctx_lock); 490 488 list_for_each_entry(node, &ctx->tctx_list, ctx_node) { 491 489 struct io_uring_task *tctx = node->task->io_uring; 492 490 ··· 500 496 cret = io_wq_cancel_cb(tctx->io_wq, io_cancel_ctx_cb, ctx, true); 501 497 ret |= (cret != IO_WQ_CANCEL_NOTFOUND); 502 498 } 499 + mutex_unlock(&ctx->tctx_lock); 503 500 mutex_unlock(&ctx->uring_lock); 504 501 505 502 return ret;
+6 -1
io_uring/io_uring.c
··· 340 340 INIT_LIST_HEAD(&ctx->ltimeout_list); 341 341 init_llist_head(&ctx->work_llist); 342 342 INIT_LIST_HEAD(&ctx->tctx_list); 343 + mutex_init(&ctx->tctx_lock); 343 344 ctx->submit_state.free_list.next = NULL; 344 345 INIT_HLIST_HEAD(&ctx->waitid_list); 345 346 xa_init_flags(&ctx->zcrx_ctxs, XA_FLAGS_ALLOC); ··· 865 864 { 866 865 struct io_overflow_cqe *ocqe; 867 866 868 - ocqe = io_alloc_ocqe(ctx, cqe, big_cqe, GFP_ATOMIC); 867 + ocqe = io_alloc_ocqe(ctx, cqe, big_cqe, GFP_NOWAIT); 869 868 return io_cqring_add_overflow(ctx, ocqe); 870 869 } 871 870 ··· 3046 3045 exit.ctx = ctx; 3047 3046 3048 3047 mutex_lock(&ctx->uring_lock); 3048 + mutex_lock(&ctx->tctx_lock); 3049 3049 while (!list_empty(&ctx->tctx_list)) { 3050 3050 WARN_ON_ONCE(time_after(jiffies, timeout)); 3051 3051 ··· 3058 3056 if (WARN_ON_ONCE(ret)) 3059 3057 continue; 3060 3058 3059 + mutex_unlock(&ctx->tctx_lock); 3061 3060 mutex_unlock(&ctx->uring_lock); 3062 3061 /* 3063 3062 * See comment above for ··· 3067 3064 */ 3068 3065 wait_for_completion_interruptible(&exit.completion); 3069 3066 mutex_lock(&ctx->uring_lock); 3067 + mutex_lock(&ctx->tctx_lock); 3070 3068 } 3069 + mutex_unlock(&ctx->tctx_lock); 3071 3070 mutex_unlock(&ctx->uring_lock); 3072 3071 spin_lock(&ctx->completion_lock); 3073 3072 spin_unlock(&ctx->completion_lock);
+4 -5
io_uring/memmap.c
··· 268 268 return io_region_get_ptr(mr); 269 269 } 270 270 271 - static void *io_uring_validate_mmap_request(struct file *file, loff_t pgoff, 272 - size_t sz) 271 + static void *io_uring_validate_mmap_request(struct file *file, loff_t pgoff) 273 272 { 274 273 struct io_ring_ctx *ctx = file->private_data; 275 274 struct io_mapped_region *region; ··· 303 304 304 305 guard(mutex)(&ctx->mmap_lock); 305 306 306 - ptr = io_uring_validate_mmap_request(file, vma->vm_pgoff, sz); 307 + ptr = io_uring_validate_mmap_request(file, vma->vm_pgoff); 307 308 if (IS_ERR(ptr)) 308 309 return PTR_ERR(ptr); 309 310 ··· 335 336 336 337 guard(mutex)(&ctx->mmap_lock); 337 338 338 - ptr = io_uring_validate_mmap_request(filp, pgoff, len); 339 + ptr = io_uring_validate_mmap_request(filp, pgoff); 339 340 if (IS_ERR(ptr)) 340 341 return -ENOMEM; 341 342 ··· 385 386 386 387 guard(mutex)(&ctx->mmap_lock); 387 388 388 - ptr = io_uring_validate_mmap_request(file, pgoff, len); 389 + ptr = io_uring_validate_mmap_request(file, pgoff); 389 390 if (IS_ERR(ptr)) 390 391 return PTR_ERR(ptr); 391 392
+2
io_uring/register.c
··· 320 320 return 0; 321 321 322 322 /* now propagate the restriction to all registered users */ 323 + mutex_lock(&ctx->tctx_lock); 323 324 list_for_each_entry(node, &ctx->tctx_list, ctx_node) { 324 325 tctx = node->task->io_uring; 325 326 if (WARN_ON_ONCE(!tctx->io_wq)) ··· 331 330 /* ignore errors, it always returns zero anyway */ 332 331 (void)io_wq_max_workers(tctx->io_wq, new_count); 333 332 } 333 + mutex_unlock(&ctx->tctx_lock); 334 334 return 0; 335 335 err: 336 336 if (sqd) {
+4 -4
io_uring/tctx.c
··· 136 136 return ret; 137 137 } 138 138 139 - mutex_lock(&ctx->uring_lock); 139 + mutex_lock(&ctx->tctx_lock); 140 140 list_add(&node->ctx_node, &ctx->tctx_list); 141 - mutex_unlock(&ctx->uring_lock); 141 + mutex_unlock(&ctx->tctx_lock); 142 142 } 143 143 return 0; 144 144 } ··· 176 176 WARN_ON_ONCE(current != node->task); 177 177 WARN_ON_ONCE(list_empty(&node->ctx_node)); 178 178 179 - mutex_lock(&node->ctx->uring_lock); 179 + mutex_lock(&node->ctx->tctx_lock); 180 180 list_del(&node->ctx_node); 181 - mutex_unlock(&node->ctx->uring_lock); 181 + mutex_unlock(&node->ctx->tctx_lock); 182 182 183 183 if (tctx->last == node->ctx) 184 184 tctx->last = NULL;
+6 -3
kernel/power/suspend.c
··· 349 349 if (pm_test_level == level) { 350 350 pr_info("suspend debug: Waiting for %d second(s).\n", 351 351 pm_test_delay); 352 - for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++) 353 - msleep(1000); 354 - 352 + for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++) { 353 + if (level > TEST_CORE) 354 + msleep(1000); 355 + else 356 + mdelay(1000); 357 + } 355 358 return 1; 356 359 } 357 360 #endif /* !CONFIG_PM_DEBUG */
+7 -4
net/bridge/br_vlan_tunnel.c
··· 189 189 IP_TUNNEL_DECLARE_FLAGS(flags) = { }; 190 190 struct metadata_dst *tunnel_dst; 191 191 __be64 tunnel_id; 192 - int err; 193 192 194 193 if (!vlan) 195 194 return 0; ··· 198 199 return 0; 199 200 200 201 skb_dst_drop(skb); 201 - err = skb_vlan_pop(skb); 202 - if (err) 203 - return err; 202 + /* For 802.1ad (QinQ), skb_vlan_pop() incorrectly moves the C-VLAN 203 + * from payload to hwaccel after clearing S-VLAN. We only need to 204 + * clear the hwaccel S-VLAN; the C-VLAN must stay in payload for 205 + * correct VXLAN encapsulation. This is also correct for 802.1Q 206 + * where no C-VLAN exists in payload. 207 + */ 208 + __vlan_hwaccel_clear_tag(skb); 204 209 205 210 if (BR_INPUT_SKB_CB(skb)->backup_nhid) { 206 211 __set_bit(IP_TUNNEL_KEY_BIT, flags);
+1 -1
net/bridge/netfilter/ebtables.c
··· 1299 1299 list_for_each_entry(tmpl, &template_tables, list) { 1300 1300 if (WARN_ON_ONCE(strcmp(t->name, tmpl->name) == 0)) { 1301 1301 mutex_unlock(&ebt_mutex); 1302 - return -EEXIST; 1302 + return -EBUSY; 1303 1303 } 1304 1304 } 1305 1305
+5 -3
net/core/skbuff.c
··· 4636 4636 { 4637 4637 struct sk_buff *list_skb = skb_shinfo(skb)->frag_list; 4638 4638 unsigned int tnl_hlen = skb_tnl_header_len(skb); 4639 - unsigned int delta_truesize = 0; 4640 4639 unsigned int delta_len = 0; 4641 4640 struct sk_buff *tail = NULL; 4642 4641 struct sk_buff *nskb, *tmp; 4643 4642 int len_diff, err; 4643 + 4644 + /* Only skb_gro_receive_list generated skbs arrive here */ 4645 + DEBUG_NET_WARN_ON_ONCE(!(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)); 4644 4646 4645 4647 skb_push(skb, -skb_network_offset(skb) + offset); 4646 4648 ··· 4657 4655 nskb = list_skb; 4658 4656 list_skb = list_skb->next; 4659 4657 4658 + DEBUG_NET_WARN_ON_ONCE(nskb->sk); 4659 + 4660 4660 err = 0; 4661 - delta_truesize += nskb->truesize; 4662 4661 if (skb_shared(nskb)) { 4663 4662 tmp = skb_clone(nskb, GFP_ATOMIC); 4664 4663 if (tmp) { ··· 4702 4699 goto err_linearize; 4703 4700 } 4704 4701 4705 - skb->truesize = skb->truesize - delta_truesize; 4706 4702 skb->data_len = skb->data_len - delta_len; 4707 4703 skb->len = skb->len - delta_len; 4708 4704
+4 -3
net/core/sock.c
··· 3896 3896 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, 3897 3897 int level, int type) 3898 3898 { 3899 - struct sock_exterr_skb *serr; 3899 + struct sock_extended_err ee; 3900 3900 struct sk_buff *skb; 3901 3901 int copied, err; 3902 3902 ··· 3916 3916 3917 3917 sock_recv_timestamp(msg, sk, skb); 3918 3918 3919 - serr = SKB_EXT_ERR(skb); 3920 - put_cmsg(msg, level, type, sizeof(serr->ee), &serr->ee); 3919 + /* We must use a bounce buffer for CONFIG_HARDENED_USERCOPY=y */ 3920 + ee = SKB_EXT_ERR(skb)->ee; 3921 + put_cmsg(msg, level, type, sizeof(ee), &ee); 3921 3922 3922 3923 msg->msg_flags |= MSG_ERRQUEUE; 3923 3924 err = copied;
+4 -3
net/ipv4/arp.c
··· 564 564 565 565 skb_reserve(skb, hlen); 566 566 skb_reset_network_header(skb); 567 - arp = skb_put(skb, arp_hdr_len(dev)); 567 + skb_put(skb, arp_hdr_len(dev)); 568 568 skb->dev = dev; 569 569 skb->protocol = htons(ETH_P_ARP); 570 570 if (!src_hw) ··· 572 572 if (!dest_hw) 573 573 dest_hw = dev->broadcast; 574 574 575 - /* 576 - * Fill the device header for the ARP frame 575 + /* Fill the device header for the ARP frame. 576 + * Note: skb->head can be changed. 577 577 */ 578 578 if (dev_hard_header(skb, dev, ptype, dest_hw, src_hw, skb->len) < 0) 579 579 goto out; 580 580 581 + arp = arp_hdr(skb); 581 582 /* 582 583 * Fill out the arp protocol part. 583 584 *
+2
net/ipv4/inet_fragment.c
··· 488 488 } 489 489 490 490 FRAG_CB(skb)->ip_defrag_offset = offset; 491 + if (offset) 492 + nf_reset_ct(skb); 491 493 492 494 return IPFRAG_OK; 493 495 }
+1 -3
net/ipv4/ping.c
··· 829 829 out_free: 830 830 if (free) 831 831 kfree(ipc.opt); 832 - if (!err) { 833 - icmp_out_count(sock_net(sk), user_icmph.type); 832 + if (!err) 834 833 return len; 835 - } 836 834 return err; 837 835 838 836 do_confirm:
+3 -5
net/ipv4/tcp.c
··· 2652 2652 if (sk->sk_state == TCP_LISTEN) 2653 2653 goto out; 2654 2654 2655 - if (tp->recvmsg_inq) { 2655 + if (tp->recvmsg_inq) 2656 2656 *cmsg_flags = TCP_CMSG_INQ; 2657 - msg->msg_get_inq = 1; 2658 - } 2659 2657 timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); 2660 2658 2661 2659 /* Urgent data needs to be handled specially. */ ··· 2927 2929 ret = tcp_recvmsg_locked(sk, msg, len, flags, &tss, &cmsg_flags); 2928 2930 release_sock(sk); 2929 2931 2930 - if ((cmsg_flags || msg->msg_get_inq) && ret >= 0) { 2932 + if ((cmsg_flags | msg->msg_get_inq) && ret >= 0) { 2931 2933 if (cmsg_flags & TCP_CMSG_TS) 2932 2934 tcp_recv_timestamp(msg, sk, &tss); 2933 - if (msg->msg_get_inq) { 2935 + if ((cmsg_flags & TCP_CMSG_INQ) | msg->msg_get_inq) { 2934 2936 msg->msg_inq = tcp_inq_hint(sk); 2935 2937 if (cmsg_flags & TCP_CMSG_INQ) 2936 2938 put_cmsg(msg, SOL_TCP, TCP_CM_INQ,
+1
net/ipv4/udp.c
··· 1852 1852 sk_peek_offset_bwd(sk, len); 1853 1853 1854 1854 if (!skb_shared(skb)) { 1855 + skb_orphan(skb); 1855 1856 skb_attempt_defer_free(skb); 1856 1857 return; 1857 1858 }
+3
net/mac80211/chan.c
··· 90 90 /* next (or first) interface */ 91 91 iter->sdata = list_prepare_entry(iter->sdata, &local->interfaces, list); 92 92 list_for_each_entry_continue(iter->sdata, &local->interfaces, list) { 93 + if (!ieee80211_sdata_running(iter->sdata)) 94 + continue; 95 + 93 96 /* AP_VLAN has a chanctx pointer but follows AP */ 94 97 if (iter->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 95 98 continue;
+4 -3
net/mac80211/sta_info.c
··· 1533 1533 } 1534 1534 } 1535 1535 1536 + sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); 1537 + if (sinfo) 1538 + sta_set_sinfo(sta, sinfo, true); 1539 + 1536 1540 if (sta->uploaded) { 1537 1541 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE, 1538 1542 IEEE80211_STA_NOTEXIST); ··· 1545 1541 1546 1542 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); 1547 1543 1548 - sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); 1549 - if (sinfo) 1550 - sta_set_sinfo(sta, sinfo, true); 1551 1544 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); 1552 1545 kfree(sinfo); 1553 1546
+2
net/mac80211/tx.c
··· 2397 2397 2398 2398 if (chanctx_conf) 2399 2399 chandef = &chanctx_conf->def; 2400 + else if (local->emulate_chanctx) 2401 + chandef = &local->hw.conf.chandef; 2400 2402 else 2401 2403 goto fail_rcu; 2402 2404
+1 -1
net/netfilter/nf_conncount.c
··· 229 229 230 230 nf_ct_put(found_ct); 231 231 } 232 + list->last_gc = (u32)jiffies; 232 233 233 234 add_new_node: 234 235 if (WARN_ON_ONCE(list->count > INT_MAX)) { ··· 249 248 conn->jiffies32 = (u32)jiffies; 250 249 list_add_tail(&conn->node, &list->head); 251 250 list->count++; 252 - list->last_gc = (u32)jiffies; 253 251 254 252 out_put: 255 253 if (refcounted)
+2 -2
net/netfilter/nf_log.c
··· 89 89 if (pf == NFPROTO_UNSPEC) { 90 90 for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) { 91 91 if (rcu_access_pointer(loggers[i][logger->type])) { 92 - ret = -EEXIST; 92 + ret = -EBUSY; 93 93 goto unlock; 94 94 } 95 95 } ··· 97 97 rcu_assign_pointer(loggers[i][logger->type], logger); 98 98 } else { 99 99 if (rcu_access_pointer(loggers[pf][logger->type])) { 100 - ret = -EEXIST; 100 + ret = -EBUSY; 101 101 goto unlock; 102 102 } 103 103 rcu_assign_pointer(loggers[pf][logger->type], logger);
+2 -1
net/netfilter/nf_tables_api.c
··· 4439 4439 4440 4440 if (!nft_use_inc(&chain->use)) { 4441 4441 err = -EMFILE; 4442 - goto err_release_rule; 4442 + goto err_destroy_flow; 4443 4443 } 4444 4444 4445 4445 if (info->nlh->nlmsg_flags & NLM_F_REPLACE) { ··· 4489 4489 4490 4490 err_destroy_flow_rule: 4491 4491 nft_use_dec_restore(&chain->use); 4492 + err_destroy_flow: 4492 4493 if (flow) 4493 4494 nft_flow_rule_destroy(flow); 4494 4495 err_release_rule:
+2 -2
net/netfilter/nft_set_pipapo.c
··· 1317 1317 else 1318 1318 dup_end = dup_key; 1319 1319 1320 - if (!memcmp(start, dup_key->data, sizeof(*dup_key->data)) && 1321 - !memcmp(end, dup_end->data, sizeof(*dup_end->data))) { 1320 + if (!memcmp(start, dup_key->data, set->klen) && 1321 + !memcmp(end, dup_end->data, set->klen)) { 1322 1322 *elem_priv = &dup->priv; 1323 1323 return -EEXIST; 1324 1324 }
+3 -3
net/netfilter/nft_synproxy.c
··· 48 48 struct tcphdr *_tcph, 49 49 struct synproxy_options *opts) 50 50 { 51 - struct nf_synproxy_info info = priv->info; 51 + struct nf_synproxy_info info = READ_ONCE(priv->info); 52 52 struct net *net = nft_net(pkt); 53 53 struct synproxy_net *snet = synproxy_pernet(net); 54 54 struct sk_buff *skb = pkt->skb; ··· 79 79 struct tcphdr *_tcph, 80 80 struct synproxy_options *opts) 81 81 { 82 - struct nf_synproxy_info info = priv->info; 82 + struct nf_synproxy_info info = READ_ONCE(priv->info); 83 83 struct net *net = nft_net(pkt); 84 84 struct synproxy_net *snet = synproxy_pernet(net); 85 85 struct sk_buff *skb = pkt->skb; ··· 340 340 struct nft_synproxy *newpriv = nft_obj_data(newobj); 341 341 struct nft_synproxy *priv = nft_obj_data(obj); 342 342 343 - priv->info = newpriv->info; 343 + WRITE_ONCE(priv->info, newpriv->info); 344 344 } 345 345 346 346 static struct nft_object_type nft_synproxy_obj_type;
+1 -1
net/netfilter/x_tables.c
··· 1764 1764 int xt_register_template(const struct xt_table *table, 1765 1765 int (*table_init)(struct net *net)) 1766 1766 { 1767 - int ret = -EEXIST, af = table->af; 1767 + int ret = -EBUSY, af = table->af; 1768 1768 struct xt_template *t; 1769 1769 1770 1770 mutex_lock(&xt[af].mutex);
+2
net/sched/act_api.c
··· 940 940 int ret; 941 941 942 942 idr_for_each_entry_ul(idr, p, tmp, id) { 943 + if (IS_ERR(p)) 944 + continue; 943 945 if (tc_act_in_hw(p) && !mutex_taken) { 944 946 rtnl_lock(); 945 947 mutex_taken = true;
+13 -13
net/sched/act_mirred.c
··· 266 266 goto err_cant_do; 267 267 } 268 268 269 - /* we could easily avoid the clone only if called by ingress and clsact; 270 - * since we can't easily detect the clsact caller, skip clone only for 271 - * ingress - that covers the TC S/W datapath. 272 - */ 273 - at_ingress = skb_at_tc_ingress(skb); 274 - dont_clone = skb_at_tc_ingress(skb) && is_redirect && 275 - tcf_mirred_can_reinsert(retval); 276 - if (!dont_clone) { 277 - skb_to_send = skb_clone(skb, GFP_ATOMIC); 278 - if (!skb_to_send) 279 - goto err_cant_do; 280 - } 281 - 282 269 want_ingress = tcf_mirred_act_wants_ingress(m_eaction); 283 270 271 + at_ingress = skb_at_tc_ingress(skb); 284 272 if (dev == skb->dev && want_ingress == at_ingress) { 285 273 pr_notice_once("tc mirred: Loop (%s:%s --> %s:%s)\n", 286 274 netdev_name(skb->dev), ··· 276 288 netdev_name(dev), 277 289 want_ingress ? "ingress" : "egress"); 278 290 goto err_cant_do; 291 + } 292 + 293 + /* we could easily avoid the clone only if called by ingress and clsact; 294 + * since we can't easily detect the clsact caller, skip clone only for 295 + * ingress - that covers the TC S/W datapath. 296 + */ 297 + dont_clone = skb_at_tc_ingress(skb) && is_redirect && 298 + tcf_mirred_can_reinsert(retval); 299 + if (!dont_clone) { 300 + skb_to_send = skb_clone(skb, GFP_ATOMIC); 301 + if (!skb_to_send) 302 + goto err_cant_do; 279 303 } 280 304 281 305 /* All mirred/redirected skbs should clear previous ct info */
+1 -1
net/sched/sch_qfq.c
··· 1481 1481 1482 1482 for (i = 0; i < q->clhash.hashsize; i++) { 1483 1483 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { 1484 - if (cl->qdisc->q.qlen > 0) 1484 + if (cl_is_active(cl)) 1485 1485 qfq_deactivate_class(q, cl); 1486 1486 1487 1487 qdisc_reset(cl->qdisc);
+3 -5
net/unix/af_unix.c
··· 2904 2904 unsigned int last_len; 2905 2905 struct unix_sock *u; 2906 2906 int copied = 0; 2907 - bool do_cmsg; 2908 2907 int err = 0; 2909 2908 long timeo; 2910 2909 int target; ··· 2929 2930 2930 2931 u = unix_sk(sk); 2931 2932 2932 - do_cmsg = READ_ONCE(u->recvmsg_inq); 2933 - if (do_cmsg) 2934 - msg->msg_get_inq = 1; 2935 2933 redo: 2936 2934 /* Lock the socket to prevent queue disordering 2937 2935 * while sleeps in memcpy_tomsg ··· 3086 3090 3087 3091 mutex_unlock(&u->iolock); 3088 3092 if (msg) { 3093 + bool do_cmsg = READ_ONCE(u->recvmsg_inq); 3094 + 3089 3095 scm_recv_unix(sock, msg, &scm, flags); 3090 3096 3091 - if (msg->msg_get_inq && (copied ?: err) >= 0) { 3097 + if ((do_cmsg | msg->msg_get_inq) && (copied ?: err) >= 0) { 3092 3098 msg->msg_inq = READ_ONCE(u->inq_len); 3093 3099 if (do_cmsg) 3094 3100 put_cmsg(msg, SOL_SOCKET, SCM_INQ,
+4
net/vmw_vsock/af_vsock.c
··· 1787 1787 } else { 1788 1788 newsock->state = SS_CONNECTED; 1789 1789 sock_graft(connected, newsock); 1790 + 1791 + set_bit(SOCK_CUSTOM_SOCKOPT, 1792 + &connected->sk_socket->flags); 1793 + 1790 1794 if (vsock_msgzerocopy_allow(vconnected->transport)) 1791 1795 set_bit(SOCK_SUPPORT_ZC, 1792 1796 &connected->sk_socket->flags);
+4
net/wireless/wext-core.c
··· 1101 1101 return ioctl_standard_call(dev, iwr, cmd, info, handler); 1102 1102 1103 1103 iwp_compat = (struct compat_iw_point *) &iwr->u.data; 1104 + 1105 + /* struct iw_point has a 32bit hole on 64bit arches. */ 1106 + memset(&iwp, 0, sizeof(iwp)); 1107 + 1104 1108 iwp.pointer = compat_ptr(iwp_compat->pointer); 1105 1109 iwp.length = iwp_compat->length; 1106 1110 iwp.flags = iwp_compat->flags;
+4
net/wireless/wext-priv.c
··· 228 228 struct iw_point iwp; 229 229 230 230 iwp_compat = (struct compat_iw_point *) &iwr->u.data; 231 + 232 + /* struct iw_point has a 32bit hole on 64bit arches. */ 233 + memset(&iwp, 0, sizeof(iwp)); 234 + 231 235 iwp.pointer = compat_ptr(iwp_compat->pointer); 232 236 iwp.length = iwp_compat->length; 233 237 iwp.flags = iwp_compat->flags;
+4 -4
samples/ftrace/ftrace-direct-modify.c
··· 176 176 " st.d $t0, $sp, 0\n" 177 177 " st.d $ra, $sp, 8\n" 178 178 " bl my_direct_func1\n" 179 - " ld.d $t0, $sp, 0\n" 180 - " ld.d $ra, $sp, 8\n" 179 + " ld.d $ra, $sp, 0\n" 180 + " ld.d $t0, $sp, 8\n" 181 181 " addi.d $sp, $sp, 16\n" 182 182 " jr $t0\n" 183 183 " .size my_tramp1, .-my_tramp1\n" ··· 189 189 " st.d $t0, $sp, 0\n" 190 190 " st.d $ra, $sp, 8\n" 191 191 " bl my_direct_func2\n" 192 - " ld.d $t0, $sp, 0\n" 193 - " ld.d $ra, $sp, 8\n" 192 + " ld.d $ra, $sp, 0\n" 193 + " ld.d $t0, $sp, 8\n" 194 194 " addi.d $sp, $sp, 16\n" 195 195 " jr $t0\n" 196 196 " .size my_tramp2, .-my_tramp2\n"
+4 -4
samples/ftrace/ftrace-direct-multi-modify.c
··· 199 199 " move $a0, $t0\n" 200 200 " bl my_direct_func1\n" 201 201 " ld.d $a0, $sp, 0\n" 202 - " ld.d $t0, $sp, 8\n" 203 - " ld.d $ra, $sp, 16\n" 202 + " ld.d $ra, $sp, 8\n" 203 + " ld.d $t0, $sp, 16\n" 204 204 " addi.d $sp, $sp, 32\n" 205 205 " jr $t0\n" 206 206 " .size my_tramp1, .-my_tramp1\n" ··· 215 215 " move $a0, $t0\n" 216 216 " bl my_direct_func2\n" 217 217 " ld.d $a0, $sp, 0\n" 218 - " ld.d $t0, $sp, 8\n" 219 - " ld.d $ra, $sp, 16\n" 218 + " ld.d $ra, $sp, 8\n" 219 + " ld.d $t0, $sp, 16\n" 220 220 " addi.d $sp, $sp, 32\n" 221 221 " jr $t0\n" 222 222 " .size my_tramp2, .-my_tramp2\n"
+2 -2
samples/ftrace/ftrace-direct-multi.c
··· 131 131 " move $a0, $t0\n" 132 132 " bl my_direct_func\n" 133 133 " ld.d $a0, $sp, 0\n" 134 - " ld.d $t0, $sp, 8\n" 135 - " ld.d $ra, $sp, 16\n" 134 + " ld.d $ra, $sp, 8\n" 135 + " ld.d $t0, $sp, 16\n" 136 136 " addi.d $sp, $sp, 32\n" 137 137 " jr $t0\n" 138 138 " .size my_tramp, .-my_tramp\n"
+2 -2
samples/ftrace/ftrace-direct-too.c
··· 143 143 " ld.d $a0, $sp, 0\n" 144 144 " ld.d $a1, $sp, 8\n" 145 145 " ld.d $a2, $sp, 16\n" 146 - " ld.d $t0, $sp, 24\n" 147 - " ld.d $ra, $sp, 32\n" 146 + " ld.d $ra, $sp, 24\n" 147 + " ld.d $t0, $sp, 32\n" 148 148 " addi.d $sp, $sp, 48\n" 149 149 " jr $t0\n" 150 150 " .size my_tramp, .-my_tramp\n"
+2 -2
samples/ftrace/ftrace-direct.c
··· 124 124 " st.d $ra, $sp, 16\n" 125 125 " bl my_direct_func\n" 126 126 " ld.d $a0, $sp, 0\n" 127 - " ld.d $t0, $sp, 8\n" 128 - " ld.d $ra, $sp, 16\n" 127 + " ld.d $ra, $sp, 8\n" 128 + " ld.d $t0, $sp, 16\n" 129 129 " addi.d $sp, $sp, 32\n" 130 130 " jr $t0\n" 131 131 " .size my_tramp, .-my_tramp\n"
+5 -5
sound/ac97/bus.c
··· 298 298 idr_remove(&ac97_adapter_idr, ac97_ctrl->nr); 299 299 dev_dbg(&ac97_ctrl->adap, "adapter unregistered by %s\n", 300 300 dev_name(ac97_ctrl->parent)); 301 + kfree(ac97_ctrl); 301 302 } 302 303 303 304 static const struct device_type ac97_adapter_type = { ··· 320 319 ret = device_register(&ac97_ctrl->adap); 321 320 if (ret) 322 321 put_device(&ac97_ctrl->adap); 323 - } 322 + } else 323 + kfree(ac97_ctrl); 324 + 324 325 if (!ret) { 325 326 list_add(&ac97_ctrl->controllers, &ac97_controllers); 326 327 dev_dbg(&ac97_ctrl->adap, "adapter registered by %s\n", ··· 364 361 ret = ac97_add_adapter(ac97_ctrl); 365 362 366 363 if (ret) 367 - goto err; 364 + return ERR_PTR(ret); 368 365 ac97_bus_reset(ac97_ctrl); 369 366 ac97_bus_scan(ac97_ctrl); 370 367 371 368 return ac97_ctrl; 372 - err: 373 - kfree(ac97_ctrl); 374 - return ERR_PTR(ret); 375 369 } 376 370 EXPORT_SYMBOL_GPL(snd_ac97_controller_register); 377 371
+2
sound/hda/codecs/realtek/alc269.c
··· 6321 6321 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 6322 6322 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 6323 6323 SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC), 6324 + SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC), 6324 6325 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 6325 6326 SND_PCI_QUIRK(0x1025, 0x1826, "Acer Helios ZPC", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2), 6326 6327 SND_PCI_QUIRK(0x1025, 0x182c, "Acer Helios ZPD", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2), ··· 6509 6508 SND_PCI_QUIRK(0x103c, 0x863e, "HP Spectre x360 15-df1xxx", ALC285_FIXUP_HP_SPECTRE_X360_DF1), 6510 6509 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 6511 6510 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), 6511 + SND_PCI_QUIRK(0x103c, 0x8706, "HP Laptop 15s-eq1xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 6512 6512 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 6513 6513 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 6514 6514 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
+3 -1
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
··· 111 111 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev)); 112 112 if (IS_ERR(sub)) { 113 113 /* No subsys id in older tas2563 projects. */ 114 - if (!strncmp(hid, "INT8866", sizeof("INT8866"))) 114 + if (!strncmp(hid, "INT8866", sizeof("INT8866"))) { 115 + p->speaker_id = -1; 115 116 goto end_2563; 117 + } 116 118 dev_err(p->dev, "Failed to get SUBSYS ID.\n"); 117 119 ret = PTR_ERR(sub); 118 120 goto err;
+2 -15
sound/soc/codecs/pm4125.c
··· 1505 1505 struct device_link *devlink; 1506 1506 int ret; 1507 1507 1508 - /* Initialize device pointers to NULL for safe cleanup */ 1509 - pm4125->rxdev = NULL; 1510 - pm4125->txdev = NULL; 1511 - 1512 1508 /* Give the soundwire subdevices some more time to settle */ 1513 1509 usleep_range(15000, 15010); 1514 1510 ··· 1533 1537 1534 1538 pm4125->sdw_priv[AIF1_CAP] = dev_get_drvdata(pm4125->txdev); 1535 1539 pm4125->sdw_priv[AIF1_CAP]->pm4125 = pm4125; 1536 - 1537 1540 pm4125->tx_sdw_dev = dev_to_sdw_dev(pm4125->txdev); 1538 - if (!pm4125->tx_sdw_dev) { 1539 - dev_err(dev, "could not get txslave with matching of dev\n"); 1540 - ret = -EINVAL; 1541 - goto error_put_tx; 1542 - } 1543 1541 1544 1542 /* 1545 1543 * As TX is the main CSR reg interface, which should not be suspended first. ··· 1614 1624 device_link_remove(dev, pm4125->rxdev); 1615 1625 device_link_remove(pm4125->rxdev, pm4125->txdev); 1616 1626 1617 - /* Release device references acquired in bind */ 1618 - if (pm4125->txdev) 1619 - put_device(pm4125->txdev); 1620 - if (pm4125->rxdev) 1621 - put_device(pm4125->rxdev); 1627 + put_device(pm4125->txdev); 1628 + put_device(pm4125->rxdev); 1622 1629 1623 1630 component_unbind_all(dev, pm4125); 1624 1631 }
-5
sound/soc/codecs/wcd937x.c
··· 2763 2763 wcd937x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd937x->txdev); 2764 2764 wcd937x->sdw_priv[AIF1_CAP]->wcd937x = wcd937x; 2765 2765 wcd937x->tx_sdw_dev = dev_to_sdw_dev(wcd937x->txdev); 2766 - if (!wcd937x->tx_sdw_dev) { 2767 - dev_err(dev, "could not get txslave with matching of dev\n"); 2768 - ret = -EINVAL; 2769 - goto err_put_txdev; 2770 - } 2771 2766 2772 2767 /* 2773 2768 * As TX is the main CSR reg interface, which should not be suspended first.
+3 -3
sound/soc/intel/boards/sof_sdw_common.h
··· 46 46 #define SOC_SDW_NO_AGGREGATION BIT(14) 47 47 48 48 /* BT audio offload: reserve 3 bits for future */ 49 - #define SOF_BT_OFFLOAD_SSP_SHIFT 15 50 - #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(17, 15)) 49 + #define SOF_BT_OFFLOAD_SSP_SHIFT 18 50 + #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(20, 18)) 51 51 #define SOF_BT_OFFLOAD_SSP(quirk) \ 52 52 (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) 53 - #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18) 53 + #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(21) 54 54 55 55 struct intel_mc_ctx { 56 56 struct sof_hdmi_private hdmi;
-4
sound/soc/sdw_utils/soc_sdw_utils.c
··· 1414 1414 } 1415 1415 1416 1416 slave = dev_to_sdw_dev(sdw_dev); 1417 - if (!slave) { 1418 - ret = -EINVAL; 1419 - goto put_device; 1420 - } 1421 1417 1422 1418 /* Make sure BIOS provides SDCA properties */ 1423 1419 if (!slave->sdca_data.interface_revision) {
+13 -1
sound/soc/sof/intel/hda.c
··· 1549 1549 * name string if quirk flag is set. 1550 1550 */ 1551 1551 if (mach) { 1552 + const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); 1552 1553 bool tplg_fixup = false; 1553 1554 bool dmic_fixup = false; 1554 1555 ··· 1599 1598 sof_pdata->tplg_filename = tplg_filename; 1600 1599 } 1601 1600 1601 + if (tplg_fixup && mach->mach_params.bt_link_mask && 1602 + chip->hw_ip_version >= SOF_INTEL_ACE_4_0) { 1603 + int bt_port = fls(mach->mach_params.bt_link_mask) - 1; 1604 + 1605 + tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, "%s-ssp%d-bt", 1606 + sof_pdata->tplg_filename, bt_port); 1607 + if (!tplg_filename) 1608 + return NULL; 1609 + 1610 + sof_pdata->tplg_filename = tplg_filename; 1611 + } 1612 + 1602 1613 if (mach->link_mask) { 1603 1614 mach->mach_params.links = mach->links; 1604 1615 mach->mach_params.link_mask = mach->link_mask; ··· 1622 1609 if (tplg_fixup && 1623 1610 mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER && 1624 1611 mach->mach_params.i2s_link_mask) { 1625 - const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata); 1626 1612 int ssp_num; 1627 1613 int mclk_mask; 1628 1614
+2
sound/soc/sunxi/sun4i-spdif.c
··· 171 171 * @reg_dac_txdata: TX FIFO offset for DMA config. 172 172 * @has_reset: SoC needs reset deasserted. 173 173 * @val_fctl_ftx: TX FIFO flush bitmask. 174 + * @mclk_multiplier: ratio of internal MCLK divider 175 + * @tx_clk_name: name of TX module clock if split clock design 174 176 */ 175 177 struct sun4i_spdif_quirks { 176 178 unsigned int reg_dac_txdata;
+5 -3
tools/arch/arm64/include/asm/cputype.h
··· 81 81 #define ARM_CPU_PART_CORTEX_A78AE 0xD42 82 82 #define ARM_CPU_PART_CORTEX_X1 0xD44 83 83 #define ARM_CPU_PART_CORTEX_A510 0xD46 84 - #define ARM_CPU_PART_CORTEX_X1C 0xD4C 85 84 #define ARM_CPU_PART_CORTEX_A520 0xD80 86 85 #define ARM_CPU_PART_CORTEX_A710 0xD47 87 86 #define ARM_CPU_PART_CORTEX_A715 0xD4D ··· 92 93 #define ARM_CPU_PART_NEOVERSE_V2 0xD4F 93 94 #define ARM_CPU_PART_CORTEX_A720 0xD81 94 95 #define ARM_CPU_PART_CORTEX_X4 0xD82 96 + #define ARM_CPU_PART_NEOVERSE_V3AE 0xD83 95 97 #define ARM_CPU_PART_NEOVERSE_V3 0xD84 96 98 #define ARM_CPU_PART_CORTEX_X925 0xD85 97 99 #define ARM_CPU_PART_CORTEX_A725 0xD87 ··· 130 130 131 131 #define NVIDIA_CPU_PART_DENVER 0x003 132 132 #define NVIDIA_CPU_PART_CARMEL 0x004 133 + #define NVIDIA_CPU_PART_OLYMPUS 0x010 133 134 134 135 #define FUJITSU_CPU_PART_A64FX 0x001 135 136 ··· 172 171 #define MIDR_CORTEX_A78AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78AE) 173 172 #define MIDR_CORTEX_X1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1) 174 173 #define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510) 175 - #define MIDR_CORTEX_X1C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1C) 176 174 #define MIDR_CORTEX_A520 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A520) 177 175 #define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710) 178 176 #define MIDR_CORTEX_A715 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A715) ··· 183 183 #define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2) 184 184 #define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720) 185 185 #define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4) 186 + #define MIDR_NEOVERSE_V3AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3AE) 186 187 #define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3) 187 188 #define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925) 188 189 #define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725) ··· 223 222 224 223 #define MIDR_NVIDIA_DENVER MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_DENVER) 225 224 #define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL) 225 + #define MIDR_NVIDIA_OLYMPUS MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_OLYMPUS) 226 226 #define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX) 227 227 #define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110) 228 228 #define MIDR_HISI_HIP09 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP09) ··· 247 245 /* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */ 248 246 #define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX 249 247 #define MIDR_FUJITSU_ERRATUM_010001_MASK (~MIDR_CPU_VAR_REV(1, 0)) 250 - #define TCR_CLEAR_FUJITSU_ERRATUM_010001 (TCR_NFD1 | TCR_NFD0) 248 + #define TCR_CLEAR_FUJITSU_ERRATUM_010001 (TCR_EL1_NFD1 | TCR_EL1_NFD0) 251 249 252 250 #ifndef __ASSEMBLER__ 253 251
+11
tools/arch/x86/include/asm/cpufeatures.h
··· 314 314 #define X86_FEATURE_SM4 (12*32+ 2) /* SM4 instructions */ 315 315 #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* "avx_vnni" AVX VNNI instructions */ 316 316 #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* "avx512_bf16" AVX512 BFLOAT16 instructions */ 317 + #define X86_FEATURE_LASS (12*32+ 6) /* "lass" Linear Address Space Separation */ 317 318 #define X86_FEATURE_CMPCCXADD (12*32+ 7) /* CMPccXADD instructions */ 318 319 #define X86_FEATURE_ARCH_PERFMON_EXT (12*32+ 8) /* Intel Architectural PerfMon Extension */ 319 320 #define X86_FEATURE_FZRM (12*32+10) /* Fast zero-length REP MOVSB */ ··· 339 338 #define X86_FEATURE_AMD_STIBP (13*32+15) /* Single Thread Indirect Branch Predictors */ 340 339 #define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* Single Thread Indirect Branch Predictors always-on preferred */ 341 340 #define X86_FEATURE_AMD_IBRS_SAME_MODE (13*32+19) /* Indirect Branch Restricted Speculation same mode protection*/ 341 + #define X86_FEATURE_EFER_LMSLE_MBZ (13*32+20) /* EFER.LMSLE must be zero */ 342 342 #define X86_FEATURE_AMD_PPIN (13*32+23) /* "amd_ppin" Protected Processor Inventory Number */ 343 343 #define X86_FEATURE_AMD_SSBD (13*32+24) /* Speculative Store Bypass Disable */ 344 344 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* "virt_ssbd" Virtualized Speculative Store Bypass Disable */ ··· 504 502 #define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14) /* Use IBPB on exit-to-userspace, see VMSCAPE bug */ 505 503 #define X86_FEATURE_ABMC (21*32+15) /* Assignable Bandwidth Monitoring Counters */ 506 504 #define X86_FEATURE_MSR_IMM (21*32+16) /* MSR immediate form instructions */ 505 + #define X86_FEATURE_SGX_EUPDATESVN (21*32+17) /* Support for ENCLS[EUPDATESVN] instruction */ 506 + 507 + #define X86_FEATURE_SDCIAE (21*32+18) /* L3 Smart Data Cache Injection Allocation Enforcement */ 508 + #define X86_FEATURE_CLEAR_CPU_BUF_VM_MMIO (21*32+19) /* 509 + * Clear CPU buffers before VM-Enter if the vCPU 510 + * can access host MMIO (ignored for all intents 511 + * and purposes if CLEAR_CPU_BUF_VM is set). 512 + */ 513 + #define X86_FEATURE_X2AVIC_EXT (21*32+20) /* AMD SVM x2AVIC support for 4k vCPUs */ 507 514 508 515 /* 509 516 * BUG word(s)
+30
tools/arch/x86/include/asm/msr-index.h
··· 166 166 * Processor MMIO stale data 167 167 * vulnerabilities. 168 168 */ 169 + #define ARCH_CAP_MCU_ENUM BIT(16) /* 170 + * Indicates the presence of microcode update 171 + * feature enumeration and status information. 172 + */ 169 173 #define ARCH_CAP_FB_CLEAR BIT(17) /* 170 174 * VERW clears CPU fill buffer 171 175 * even on MDS_NO CPUs. ··· 330 326 #define PERF_CAP_PEBS_MASK (PERF_CAP_PEBS_TRAP | PERF_CAP_ARCH_REG | \ 331 327 PERF_CAP_PEBS_FORMAT | PERF_CAP_PEBS_BASELINE | \ 332 328 PERF_CAP_PEBS_TIMING_INFO) 329 + 330 + /* Arch PEBS */ 331 + #define MSR_IA32_PEBS_BASE 0x000003f4 332 + #define MSR_IA32_PEBS_INDEX 0x000003f5 333 + #define ARCH_PEBS_OFFSET_MASK 0x7fffff 334 + #define ARCH_PEBS_INDEX_WR_SHIFT 4 335 + 336 + #define ARCH_PEBS_RELOAD 0xffffffff 337 + #define ARCH_PEBS_CNTR_ALLOW BIT_ULL(35) 338 + #define ARCH_PEBS_CNTR_GP BIT_ULL(36) 339 + #define ARCH_PEBS_CNTR_FIXED BIT_ULL(37) 340 + #define ARCH_PEBS_CNTR_METRICS BIT_ULL(38) 341 + #define ARCH_PEBS_LBR_SHIFT 40 342 + #define ARCH_PEBS_LBR (0x3ull << ARCH_PEBS_LBR_SHIFT) 343 + #define ARCH_PEBS_VECR_XMM BIT_ULL(49) 344 + #define ARCH_PEBS_GPR BIT_ULL(61) 345 + #define ARCH_PEBS_AUX BIT_ULL(62) 346 + #define ARCH_PEBS_EN BIT_ULL(63) 347 + #define ARCH_PEBS_CNTR_MASK (ARCH_PEBS_CNTR_GP | ARCH_PEBS_CNTR_FIXED | \ 348 + ARCH_PEBS_CNTR_METRICS) 333 349 334 350 #define MSR_IA32_RTIT_CTL 0x00000570 335 351 #define RTIT_CTL_TRACEEN BIT(0) ··· 953 929 #define MSR_IA32_APICBASE_BASE (0xfffff<<12) 954 930 955 931 #define MSR_IA32_UCODE_WRITE 0x00000079 932 + 933 + #define MSR_IA32_MCU_ENUMERATION 0x0000007b 934 + #define MCU_STAGING BIT(4) 935 + 956 936 #define MSR_IA32_UCODE_REV 0x0000008b 957 937 958 938 /* Intel SGX Launch Enclave Public Key Hash MSRs */ ··· 1253 1225 #define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x00000490 1254 1226 #define MSR_IA32_VMX_VMFUNC 0x00000491 1255 1227 #define MSR_IA32_VMX_PROCBASED_CTLS3 0x00000492 1228 + 1229 + #define MSR_IA32_MCU_STAGING_MBOX_ADDR 0x000007a5 1256 1230 1257 1231 /* Resctrl MSRs: */ 1258 1232 /* - Intel: */
+1
tools/arch/x86/include/uapi/asm/kvm.h
··· 502 502 /* vendor-specific groups and attributes for system fd */ 503 503 #define KVM_X86_GRP_SEV 1 504 504 # define KVM_X86_SEV_VMSA_FEATURES 0 505 + # define KVM_X86_SNP_POLICY_BITS 1 505 506 506 507 struct kvm_vmx_nested_state_data { 507 508 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
+4 -2
tools/build/Makefile.feature
··· 99 99 libzstd \ 100 100 disassembler-four-args \ 101 101 disassembler-init-styled \ 102 - file-handle 102 + file-handle \ 103 + libopenssl 103 104 104 105 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list 105 106 # of all feature tests ··· 148 147 lzma \ 149 148 bpf \ 150 149 libaio \ 151 - libzstd 150 + libzstd \ 151 + libopenssl 152 152 153 153 # 154 154 # Declare group members of a feature to display the logical OR of the detection
+7 -3
tools/build/feature/Makefile
··· 67 67 test-libopencsd.bin \ 68 68 test-clang.bin \ 69 69 test-llvm.bin \ 70 - test-llvm-perf.bin \ 70 + test-llvm-perf.bin \ 71 71 test-libaio.bin \ 72 72 test-libzstd.bin \ 73 73 test-clang-bpf-co-re.bin \ 74 74 test-file-handle.bin \ 75 - test-libpfm4.bin 75 + test-libpfm4.bin \ 76 + test-libopenssl.bin 76 77 77 78 FILES := $(addprefix $(OUTPUT),$(FILES)) 78 79 ··· 107 106 __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) 108 107 BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 109 108 BUILD_BFD = $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl 110 - BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -ldl -lz -llzma -lzstd 109 + BUILD_ALL = $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -ldl -lz -llzma -lzstd -lssl 111 110 112 111 __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS) 113 112 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1 ··· 381 380 382 381 $(OUTPUT)test-libpfm4.bin: 383 382 $(BUILD) -lpfm 383 + 384 + $(OUTPUT)test-libopenssl.bin: 385 + $(BUILD) -lssl 384 386 385 387 $(OUTPUT)test-bpftool-skeletons.bin: 386 388 $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
+5
tools/build/feature/test-all.c
··· 142 142 # include "test-libtraceevent.c" 143 143 #undef main 144 144 145 + #define main main_test_libopenssl 146 + # include "test-libopenssl.c" 147 + #undef main 148 + 145 149 int main(int argc, char *argv[]) 146 150 { 147 151 main_test_libpython(); ··· 177 173 main_test_reallocarray(); 178 174 main_test_libzstd(); 179 175 main_test_libtraceevent(); 176 + main_test_libopenssl(); 180 177 181 178 return 0; 182 179 }
+7
tools/build/feature/test-libopenssl.c
··· 1 + #include <openssl/ssl.h> 2 + #include <openssl/opensslv.h> 3 + 4 + int main(void) 5 + { 6 + return SSL_library_init(); 7 + }
-6
tools/include/linux/gfp_types.h
··· 55 55 #ifdef CONFIG_LOCKDEP 56 56 ___GFP_NOLOCKDEP_BIT, 57 57 #endif 58 - #ifdef CONFIG_SLAB_OBJ_EXT 59 58 ___GFP_NO_OBJ_EXT_BIT, 60 - #endif 61 59 ___GFP_LAST_BIT 62 60 }; 63 61 ··· 96 98 #else 97 99 #define ___GFP_NOLOCKDEP 0 98 100 #endif 99 - #ifdef CONFIG_SLAB_OBJ_EXT 100 101 #define ___GFP_NO_OBJ_EXT BIT(___GFP_NO_OBJ_EXT_BIT) 101 - #else 102 - #define ___GFP_NO_OBJ_EXT 0 103 - #endif 104 102 105 103 /* 106 104 * Physical address zone modifiers (see linux/mmzone.h - low four bits)
+8
tools/include/linux/types.h
··· 88 88 # define __aligned_u64 __u64 __attribute__((aligned(8))) 89 89 #endif 90 90 91 + #ifndef __aligned_be64 92 + # define __aligned_be64 __be64 __attribute__((aligned(8))) 93 + #endif 94 + 95 + #ifndef __aligned_le64 96 + # define __aligned_le64 __le64 __attribute__((aligned(8))) 97 + #endif 98 + 91 99 struct list_head { 92 100 struct list_head *next, *prev; 93 101 };
+3 -1
tools/include/uapi/asm-generic/unistd.h
··· 857 857 __SYSCALL(__NR_file_getattr, sys_file_getattr) 858 858 #define __NR_file_setattr 469 859 859 __SYSCALL(__NR_file_setattr, sys_file_setattr) 860 + #define __NR_listns 470 861 + __SYSCALL(__NR_listns, sys_listns) 860 862 861 863 #undef __NR_syscalls 862 - #define __NR_syscalls 470 864 + #define __NR_syscalls 471 863 865 864 866 /* 865 867 * 32 bit systems traditionally used different
+15
tools/include/uapi/drm/drm.h
··· 906 906 */ 907 907 #define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6 908 908 909 + /** 910 + * DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 911 + * 912 + * If set to 1 the DRM core will allow setting the COLOR_PIPELINE 913 + * property on a &drm_plane, as well as drm_colorop properties. 914 + * 915 + * Setting of these plane properties will be rejected when this client 916 + * cap is set: 917 + * - COLOR_ENCODING 918 + * - COLOR_RANGE 919 + * 920 + * The client must enable &DRM_CLIENT_CAP_ATOMIC first. 921 + */ 922 + #define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 7 923 + 909 924 /* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ 910 925 struct drm_set_client_cap { 911 926 __u64 capability;
+11
tools/include/uapi/linux/kvm.h
··· 179 179 #define KVM_EXIT_LOONGARCH_IOCSR 38 180 180 #define KVM_EXIT_MEMORY_FAULT 39 181 181 #define KVM_EXIT_TDX 40 182 + #define KVM_EXIT_ARM_SEA 41 182 183 183 184 /* For KVM_EXIT_INTERNAL_ERROR */ 184 185 /* Emulate instruction failed. */ ··· 474 473 } setup_event_notify; 475 474 }; 476 475 } tdx; 476 + /* KVM_EXIT_ARM_SEA */ 477 + struct { 478 + #define KVM_EXIT_ARM_SEA_FLAG_GPA_VALID (1ULL << 0) 479 + __u64 flags; 480 + __u64 esr; 481 + __u64 gva; 482 + __u64 gpa; 483 + } arm_sea; 477 484 /* Fix the size of the union. */ 478 485 char padding[256]; 479 486 }; ··· 972 963 #define KVM_CAP_RISCV_MP_STATE_RESET 242 973 964 #define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243 974 965 #define KVM_CAP_GUEST_MEMFD_FLAGS 244 966 + #define KVM_CAP_ARM_SEA_TO_USER 245 967 + #define KVM_CAP_S390_USER_OPEREXEC 246 975 968 976 969 struct kvm_irq_routing_irqchip { 977 970 __u32 irqchip;
-1
tools/net/ynl/Makefile
··· 51 51 @echo -e "\tINSTALL pyynl" 52 52 @pip install --prefix=$(DESTDIR)$(prefix) . 53 53 @make -C generated install 54 - @make -C tests install 55 54 56 55 run_tests: 57 56 @$(MAKE) -C tests run_tests
+8
tools/perf/Makefile.config
··· 701 701 endif 702 702 endif 703 703 704 + ifeq ($(feature-libopenssl), 1) 705 + $(call detected,CONFIG_LIBOPENSSL) 706 + CFLAGS += -DHAVE_LIBOPENSSL_SUPPORT 707 + endif 708 + 704 709 ifndef BUILD_BPF_SKEL 705 710 # BPF skeletons control a large number of perf features, by default 706 711 # they are enabled. ··· 721 716 BUILD_BPF_SKEL := 0 722 717 else ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),) 723 718 $(warning Warning: Disabled BPF skeletons as libbpf is required) 719 + BUILD_BPF_SKEL := 0 720 + else ifeq ($(filter -DHAVE_LIBOPENSSL_SUPPORT, $(CFLAGS)),) 721 + $(warning Warning: Disabled BPF skeletons as libopenssl is required) 724 722 BUILD_BPF_SKEL := 0 725 723 else ifeq ($(call get-executable,$(CLANG)),) 726 724 $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) is missing)
+1
tools/perf/arch/arm/entry/syscalls/syscall.tbl
··· 484 484 467 common open_tree_attr sys_open_tree_attr 485 485 468 common file_getattr sys_file_getattr 486 486 469 common file_setattr sys_file_setattr 487 + 470 common listns sys_listns
+1
tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
··· 384 384 467 n64 open_tree_attr sys_open_tree_attr 385 385 468 n64 file_getattr sys_file_getattr 386 386 469 n64 file_setattr sys_file_setattr 387 + 470 n64 listns sys_listns
+1
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
··· 560 560 467 common open_tree_attr sys_open_tree_attr 561 561 468 common file_getattr sys_file_getattr 562 562 469 common file_setattr sys_file_setattr 563 + 470 common listns sys_listns
+1
tools/perf/arch/s390/entry/syscalls/syscall.tbl
··· 472 472 467 common open_tree_attr sys_open_tree_attr sys_open_tree_attr 473 473 468 common file_getattr sys_file_getattr sys_file_getattr 474 474 469 common file_setattr sys_file_setattr sys_file_setattr 475 + 470 common listns sys_listns sys_listns
+1
tools/perf/arch/sh/entry/syscalls/syscall.tbl
··· 473 473 467 common open_tree_attr sys_open_tree_attr 474 474 468 common file_getattr sys_file_getattr 475 475 469 common file_setattr sys_file_setattr 476 + 470 common listns sys_listns
+1
tools/perf/arch/sparc/entry/syscalls/syscall.tbl
··· 515 515 467 common open_tree_attr sys_open_tree_attr 516 516 468 common file_getattr sys_file_getattr 517 517 469 common file_setattr sys_file_setattr 518 + 470 common listns sys_listns
+1
tools/perf/arch/x86/entry/syscalls/syscall_32.tbl
··· 475 475 467 i386 open_tree_attr sys_open_tree_attr 476 476 468 i386 file_getattr sys_file_getattr 477 477 469 i386 file_setattr sys_file_setattr 478 + 470 i386 listns sys_listns
+1
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
··· 394 394 467 common open_tree_attr sys_open_tree_attr 395 395 468 common file_getattr sys_file_getattr 396 396 469 common file_setattr sys_file_setattr 397 + 470 common listns sys_listns 397 398 398 399 # 399 400 # Due to a historical design error, certain syscalls are numbered differently
+1
tools/perf/arch/xtensa/entry/syscalls/syscall.tbl
··· 440 440 467 common open_tree_attr sys_open_tree_attr 441 441 468 common file_getattr sys_file_getattr 442 442 469 common file_setattr sys_file_setattr 443 + 470 common listns sys_listns
+4 -2
tools/perf/builtin-buildid-cache.c
··· 276 276 { 277 277 char filename[PATH_MAX]; 278 278 struct build_id bid = { .size = 0, }; 279 + int err; 279 280 280 281 if (!dso__build_id_filename(dso, filename, sizeof(filename), false)) 281 282 return true; 282 283 283 - if (filename__read_build_id(filename, &bid) == -1) { 284 - if (errno == ENOENT) 284 + err = filename__read_build_id(filename, &bid); 285 + if (err < 0) { 286 + if (err == -ENOENT) 285 287 return false; 286 288 287 289 pr_warning("Problems with %s file, consider removing it from the cache\n",
+1 -1
tools/perf/tests/shell/kvm.sh
··· 118 118 skip "/dev/kvm not accessible" 119 119 fi 120 120 121 - if ! perf kvm stat record -a sleep 0.01 >/dev/null 2>&1; then 121 + if ! perf kvm stat record -o /dev/null -a sleep 0.01 >/dev/null 2>&1; then 122 122 skip "No permission to record kvm events" 123 123 fi 124 124
+1 -1
tools/perf/tests/shell/top.sh
··· 1 1 #!/bin/bash 2 - # perf top tests 2 + # perf top tests (exclusive) 3 3 # SPDX-License-Identifier: GPL-2.0 4 4 5 5 set -e
+21 -3
tools/perf/trace/beauty/include/linux/socket.h
··· 32 32 * 1003.1g requires sa_family_t and that sa_data is char. 33 33 */ 34 34 35 + /* Deprecated for in-kernel use. Use struct sockaddr_unsized instead. */ 35 36 struct sockaddr { 36 37 sa_family_t sa_family; /* address family, AF_xxx */ 37 38 char sa_data[14]; /* 14 bytes of protocol address */ 39 + }; 40 + 41 + /** 42 + * struct sockaddr_unsized - Unspecified size sockaddr for callbacks 43 + * @sa_family: Address family (AF_UNIX, AF_INET, AF_INET6, etc.) 44 + * @sa_data: Flexible array for address data 45 + * 46 + * This structure is designed for callback interfaces where the 47 + * total size is known via the sockaddr_len parameter. Unlike struct 48 + * sockaddr which has a fixed 14-byte sa_data limit or struct 49 + * sockaddr_storage which has a fixed 128-byte sa_data limit, this 50 + * structure can accommodate addresses of any size, but must be used 51 + * carefully. 52 + */ 53 + struct sockaddr_unsized { 54 + __kernel_sa_family_t sa_family; /* address family, AF_xxx */ 55 + char sa_data[]; /* flexible address data */ 38 56 }; 39 57 40 58 struct linger { ··· 468 450 int addrlen); 469 451 extern int __sys_listen(int fd, int backlog); 470 452 extern int __sys_listen_socket(struct socket *sock, int backlog); 453 + extern int do_getsockname(struct socket *sock, int peer, 454 + struct sockaddr __user *usockaddr, int __user *usockaddr_len); 471 455 extern int __sys_getsockname(int fd, struct sockaddr __user *usockaddr, 472 - int __user *usockaddr_len); 473 - extern int __sys_getpeername(int fd, struct sockaddr __user *usockaddr, 474 - int __user *usockaddr_len); 456 + int __user *usockaddr_len, int peer); 475 457 extern int __sys_socketpair(int family, int type, int protocol, 476 458 int __user *usockvec); 477 459 extern int __sys_shutdown_sock(struct socket *sock, int how);
+12
tools/perf/trace/beauty/include/uapi/linux/fcntl.h
··· 4 4 5 5 #include <asm/fcntl.h> 6 6 #include <linux/openat2.h> 7 + #include <linux/types.h> 7 8 8 9 #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0) 9 10 #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1) ··· 79 78 * v4.13-rc1~212^2~51. 80 79 */ 81 80 #define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET 81 + 82 + /* Set/Get delegations */ 83 + #define F_GETDELEG (F_LINUX_SPECIFIC_BASE + 15) 84 + #define F_SETDELEG (F_LINUX_SPECIFIC_BASE + 16) 85 + 86 + /* Argument structure for F_GETDELEG and F_SETDELEG */ 87 + struct delegation { 88 + __u32 d_flags; /* Must be 0 */ 89 + __u16 d_type; /* F_RDLCK, F_WRLCK, F_UNLCK */ 90 + __u16 __pad; /* Must be 0 */ 91 + }; 82 92 83 93 /* 84 94 * Types of directory notifications that may be requested.
+2 -1
tools/perf/trace/beauty/include/uapi/linux/fs.h
··· 298 298 #define BLKROTATIONAL _IO(0x12,126) 299 299 #define BLKZEROOUT _IO(0x12,127) 300 300 #define BLKGETDISKSEQ _IOR(0x12,128,__u64) 301 - /* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */ 301 + /* 130-136 and 142 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */ 302 302 /* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */ 303 + #define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2) 303 304 304 305 #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 305 306 #define FIBMAP _IO(0x00,1) /* bmap access */
+1 -1
tools/perf/trace/beauty/include/uapi/linux/mount.h
··· 197 197 */ 198 198 struct mnt_id_req { 199 199 __u32 size; 200 - __u32 spare; 200 + __u32 mnt_ns_fd; 201 201 __u64 mnt_id; 202 202 __u64 param; 203 203 __u64 mnt_ns_id;
+1 -1
tools/perf/trace/beauty/include/uapi/sound/asound.h
··· 60 60 unsigned char db2_sf_ss; /* sample frequency and size */ 61 61 unsigned char db3; /* not used, all zeros */ 62 62 unsigned char db4_ca; /* channel allocation code */ 63 - unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */ 63 + unsigned char db5_dminh_lsv; /* downmix inhibit & level-shift values */ 64 64 }; 65 65 66 66 /****************************************************************************
+1
tools/perf/util/arm-spe.c
··· 587 587 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), 588 588 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2), 589 589 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3), 590 + MIDR_ALL_VERSIONS(MIDR_NVIDIA_OLYMPUS), 590 591 {}, 591 592 }; 592 593
+3 -1
tools/perf/util/libbfd.c
··· 426 426 427 427 if (!filename) 428 428 return -EFAULT; 429 + 430 + errno = 0; 429 431 if (!is_regular_file(filename)) 430 - return -EWOULDBLOCK; 432 + return errno == 0 ? -EWOULDBLOCK : -errno; 431 433 432 434 fd = open(filename, O_RDONLY); 433 435 if (fd < 0)
+3 -1
tools/perf/util/symbol-elf.c
··· 902 902 903 903 if (!filename) 904 904 return -EFAULT; 905 + 906 + errno = 0; 905 907 if (!is_regular_file(filename)) 906 - return -EWOULDBLOCK; 908 + return errno == 0 ? -EWOULDBLOCK : -errno; 907 909 908 910 err = kmod_path__parse(&m, filename); 909 911 if (err)
+3 -1
tools/perf/util/symbol-minimal.c
··· 104 104 105 105 if (!filename) 106 106 return -EFAULT; 107 + 108 + errno = 0; 107 109 if (!is_regular_file(filename)) 108 - return -EWOULDBLOCK; 110 + return errno == 0 ? -EWOULDBLOCK : -errno; 109 111 110 112 fd = open(filename, O_RDONLY); 111 113 if (fd < 0)
+1
tools/scripts/syscall.tbl
··· 410 410 467 common open_tree_attr sys_open_tree_attr 411 411 468 common file_getattr sys_file_getattr 412 412 469 common file_setattr sys_file_setattr 413 + 470 common listns sys_listns
+2 -2
tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
··· 22 22 NlError, RtnlFamily, DevlinkFamily, PSPFamily 23 23 from net.lib.py import CmdExitFailure 24 24 from net.lib.py import bkg, cmd, bpftool, bpftrace, defer, ethtool, \ 25 - fd_read_timeout, ip, rand_port, wait_port_listen, wait_file 25 + fd_read_timeout, ip, rand_port, wait_port_listen, wait_file, tool 26 26 from net.lib.py import KsftSkipEx, KsftFailEx, KsftXfailEx 27 27 from net.lib.py import ksft_disruptive, ksft_exit, ksft_pr, ksft_run, \ 28 28 ksft_setup, ksft_variants, KsftNamedVariant ··· 37 37 "CmdExitFailure", 38 38 "bkg", "cmd", "bpftool", "bpftrace", "defer", "ethtool", 39 39 "fd_read_timeout", "ip", "rand_port", 40 - "wait_port_listen", "wait_file", 40 + "wait_port_listen", "wait_file", "tool", 41 41 "KsftSkipEx", "KsftFailEx", "KsftXfailEx", 42 42 "ksft_disruptive", "ksft_exit", "ksft_pr", "ksft_run", 43 43 "ksft_setup", "ksft_variants", "KsftNamedVariant",
+59
tools/testing/selftests/drivers/net/netdevsim/peer.sh
··· 52 52 ip netns del nssv 53 53 } 54 54 55 + is_carrier_up() 56 + { 57 + local netns="$1" 58 + local nsim_dev="$2" 59 + 60 + test "$(ip netns exec "$netns" \ 61 + cat /sys/class/net/"$nsim_dev"/carrier 2>/dev/null)" -eq 1 62 + } 63 + 64 + assert_carrier_up() 65 + { 66 + local netns="$1" 67 + local nsim_dev="$2" 68 + 69 + if ! is_carrier_up "$netns" "$nsim_dev"; then 70 + echo "$nsim_dev's carrier should be UP, but it isn't" 71 + cleanup_ns 72 + exit 1 73 + fi 74 + } 75 + 76 + assert_carrier_down() 77 + { 78 + local netns="$1" 79 + local nsim_dev="$2" 80 + 81 + if is_carrier_up "$netns" "$nsim_dev"; then 82 + echo "$nsim_dev's carrier should be DOWN, but it isn't" 83 + cleanup_ns 84 + exit 1 85 + fi 86 + } 87 + 55 88 ### 56 89 ### Code start 57 90 ### ··· 145 112 cleanup_ns 146 113 exit 1 147 114 fi 115 + 116 + # netdevsim carrier state consistency checking 117 + assert_carrier_up nssv "$NSIM_DEV_1_NAME" 118 + assert_carrier_up nscl "$NSIM_DEV_2_NAME" 119 + 120 + echo "$NSIM_DEV_1_FD:$NSIM_DEV_1_IFIDX" > "$NSIM_DEV_SYS_UNLINK" 121 + 122 + assert_carrier_down nssv "$NSIM_DEV_1_NAME" 123 + assert_carrier_down nscl "$NSIM_DEV_2_NAME" 124 + 125 + ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" down 126 + ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" up 127 + 128 + assert_carrier_down nssv "$NSIM_DEV_1_NAME" 129 + assert_carrier_down nscl "$NSIM_DEV_2_NAME" 130 + 131 + echo "$NSIM_DEV_1_FD:$NSIM_DEV_1_IFIDX $NSIM_DEV_2_FD:$NSIM_DEV_2_IFIDX" > $NSIM_DEV_SYS_LINK 132 + 133 + assert_carrier_up nssv "$NSIM_DEV_1_NAME" 134 + assert_carrier_up nscl "$NSIM_DEV_2_NAME" 135 + 136 + ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" down 137 + ip netns exec nssv ip link set dev "$NSIM_DEV_1_NAME" up 138 + 139 + assert_carrier_up nssv "$NSIM_DEV_1_NAME" 140 + assert_carrier_up nscl "$NSIM_DEV_2_NAME" 148 141 149 142 # send/recv packets 150 143
+2 -1
tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # description: event tracing - enable/disable with top level files 4 - # requires: available_events set_event events/enable 4 + # requires: set_event events/enable 5 + # flags: instance 5 6 6 7 do_reset() { 7 8 echo > set_event
+3 -2
tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
··· 90 90 fail "Tracing is not off" 91 91 fi 92 92 93 - csum1=`md5sum trace` 93 + # Cannot rely on names being around as they are only cached, strip them 94 + csum1=`cat trace | sed -e 's/^ *[^ ]*\(-[0-9][0-9]*\)/\1/' | md5sum` 94 95 sleep $SLEEP_TIME 95 - csum2=`md5sum trace` 96 + csum2=`cat trace | sed -e 's/^ *[^ ]*\(-[0-9][0-9]*\)/\1/' | md5sum` 96 97 97 98 if [ "$csum1" != "$csum2" ]; then 98 99 fail "Tracing file is still changing"
+2
tools/testing/selftests/hid/Makefile
··· 184 184 185 185 CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) 186 186 BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ 187 + -Wno-microsoft-anon-tag \ 188 + -fms-extensions \ 187 189 -I$(INCLUDE_DIR) 188 190 189 191 CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
+14
tools/testing/selftests/hid/tests/conftest.py
··· 5 5 # Copyright (c) 2017 Benjamin Tissoires <benjamin.tissoires@gmail.com> 6 6 # Copyright (c) 2017 Red Hat, Inc. 7 7 8 + from packaging.version import Version 8 9 import platform 9 10 import pytest 10 11 import re ··· 13 12 import subprocess 14 13 from .base import HIDTestUdevRule 15 14 from pathlib import Path 15 + 16 + 17 + @pytest.fixture(autouse=True) 18 + def hidtools_version_check(): 19 + HIDTOOLS_VERSION = "0.12" 20 + try: 21 + import hidtools 22 + 23 + version = hidtools.__version__ # type: ignore 24 + if Version(version) < Version(HIDTOOLS_VERSION): 25 + pytest.skip(reason=f"have hidtools {version}, require >={HIDTOOLS_VERSION}") 26 + except Exception: 27 + pytest.skip(reason=f"hidtools >={HIDTOOLS_VERSION} required") 16 28 17 29 18 30 # See the comment in HIDTestUdevRule, this doesn't set up but it will clean
+48 -13
tools/testing/selftests/hid/tests/test_multitouch.py
··· 9 9 from . import base 10 10 from hidtools.hut import HUT 11 11 from hidtools.util import BusType 12 + import enum 12 13 import libevdev 13 14 import logging 14 15 import pytest ··· 233 232 return 0 234 233 235 234 235 + class HIDButtonType(enum.IntEnum): 236 + CLICKPAD = 0 237 + PRESSUREPAD = 1 238 + DISCRETE_BUTTONS = 2 239 + 240 + 236 241 class PTP(Digitizer): 237 242 def __init__( 238 243 self, 239 244 name, 240 - type="Click Pad", 245 + buttontype=HIDButtonType.CLICKPAD, 241 246 rdesc_str=None, 242 247 rdesc=None, 243 248 application="Touch Pad", ··· 251 244 max_contacts=None, 252 245 input_info=None, 253 246 ): 254 - self.type = type.lower().replace(" ", "") 255 - if self.type == "clickpad": 256 - self.buttontype = 0 257 - else: # pressurepad 258 - self.buttontype = 1 247 + self.buttontype = buttontype 248 + 259 249 self.clickpad_state = False 260 250 self.left_state = False 261 251 self.right_state = False ··· 979 975 assert libevdev.InputEvent(libevdev.EV_ABS.ABS_MT_ORIENTATION, 90) in events 980 976 981 977 class TestPTP(TestWin8Multitouch): 978 + def test_buttontype(self): 979 + """Check for the right ButtonType.""" 980 + uhdev = self.uhdev 981 + assert uhdev is not None 982 + evdev = uhdev.get_evdev() 983 + 984 + # If libevdev.so is not yet compiled with INPUT_PROP_PRESSUREPAD 985 + # python-libevdev won't have it either, let's fake it 986 + if not getattr(libevdev, "INPUT_PROP_PRESSUREPAD", None): 987 + prop = libevdev.InputProperty(name="INPUT_PROP_PRESSUREPAD", value=0x7) 988 + libevdev.INPUT_PROP_PRESSUREPAD = prop 989 + libevdev.props.append(prop) 990 + 991 + if uhdev.buttontype == HIDButtonType.CLICKPAD: 992 + assert libevdev.INPUT_PROP_BUTTONPAD in evdev.properties 993 + elif uhdev.buttontype == HIDButtonType.PRESSUREPAD: 994 + assert libevdev.INPUT_PROP_PRESSUREPAD in evdev.properties 995 + else: 996 + assert libevdev.INPUT_PROP_PRESSUREPAD not in evdev.properties 997 + assert libevdev.INPUT_PROP_BUTTONPAD not in evdev.properties 998 + 982 999 def test_ptp_buttons(self): 983 1000 """check for button reliability. 984 - There are 2 types of touchpads: the click pads and the pressure pads. 985 - Each should reliably report the BTN_LEFT events. 1001 + There are 3 types of touchpads: click pads + pressure pads and 1002 + those with discrete buttons. Each should reliably report the BTN_LEFT events. 986 1003 """ 987 1004 uhdev = self.uhdev 988 1005 evdev = uhdev.get_evdev() 989 1006 990 - if uhdev.type == "clickpad": 1007 + if uhdev.buttontype in [HIDButtonType.CLICKPAD, HIDButtonType.PRESSUREPAD]: 991 1008 r = uhdev.event(click=True) 992 1009 events = uhdev.next_sync_events() 993 1010 self.debug_reports(r, uhdev, events) ··· 1020 995 self.debug_reports(r, uhdev, events) 1021 996 assert libevdev.InputEvent(libevdev.EV_KEY.BTN_LEFT, 0) in events 1022 997 assert evdev.value[libevdev.EV_KEY.BTN_LEFT] == 0 1023 - else: 998 + elif uhdev.buttontype == HIDButtonType.DISCRETE_BUTTONS: 1024 999 r = uhdev.event(left=True) 1025 1000 events = uhdev.next_sync_events() 1026 1001 self.debug_reports(r, uhdev, events) ··· 1943 1918 def create_device(self): 1944 1919 return PTP( 1945 1920 "uhid test dell_044e_1220", 1946 - type="pressurepad", 1921 + buttontype=HIDButtonType.DISCRETE_BUTTONS, 1947 1922 rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 09 38 95 01 81 06 05 0c 0a 38 02 81 06 c0 c0 05 0d 09 05 a1 01 85 08 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 af 04 75 10 55 0e 65 11 09 30 35 00 46 e8 03 95 01 81 02 26 7b 02 46 12 02 09 31 81 02 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 05 0d 09 56 81 02 09 54 25 05 95 01 75 08 81 02 05 09 19 01 29 03 25 01 75 01 95 03 81 02 95 05 81 03 05 0d 85 09 09 55 75 08 95 01 25 05 b1 02 06 00 ff 85 0a 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 06 01 ff 09 01 a1 01 85 03 09 01 15 00 26 ff 00 95 1b 81 02 85 04 09 02 95 50 81 02 85 05 09 03 95 07 b1 02 85 06 09 04 81 02 c0 06 02 ff 09 01 a1 01 85 07 09 02 95 86 75 08 b1 02 c0 05 0d 09 0e a1 01 85 0b 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 0c 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0", 1948 1923 ) 1949 1924 ··· 2043 2018 def create_device(self): 2044 2019 return PTP( 2045 2020 "uhid test elan_04f3_313a", 2046 - type="touchpad", 2021 + buttontype=HIDButtonType.DISCRETE_BUTTONS, 2047 2022 input_info=(BusType.I2C, 0x04F3, 0x313A), 2048 2023 rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 75 08 95 05 81 03 c0 06 00 ff 09 01 85 0e 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0a 09 c6 15 00 26 ff 00 75 08 95 04 b1 02 c0 06 00 ff 09 01 a1 01 85 5c 09 01 95 0b 75 08 81 06 85 0d 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0c 09 c6 96 80 03 75 08 b1 02 85 0b 09 c7 95 82 75 08 b1 02 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 05 09 09 02 09 03 15 00 25 01 75 01 95 02 81 02 05 0d 95 01 75 04 25 0f 09 51 81 02 05 01 15 00 26 d7 0e 75 10 55 0d 65 11 09 30 35 00 46 44 2f 95 01 81 02 46 12 16 26 eb 06 26 eb 06 09 31 81 02 05 0d 15 00 25 64 95 03 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 25 01 75 01 95 08 81 03 09 c5 75 08 95 02 81 03 05 0d 85 02 09 55 09 59 75 04 95 02 25 0f b1 02 85 07 09 60 75 01 95 01 15 00 25 01 b1 02 95 0f b1 03 06 00 ff 06 00 ff 85 06 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 03 09 22 a1 00 09 52 15 00 25 0a 75 10 95 01 b1 02 c0 09 22 a1 00 85 05 09 57 09 58 75 01 95 02 25 01 b1 02 95 0e b1 03 c0 c0 05 01 09 02 a1 01 85 2a 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 35 81 45 7f 55 00 65 13 75 08 95 02 81 06 75 08 95 05 81 03 c0 c0", 2049 2024 ) ··· 2080 2055 rdesc="05 01 09 02 a1 01 85 02 09 01 a1 00 05 09 19 01 29 02 15 00 25 01 75 01 95 02 81 02 95 06 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 03 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 1b 04 75 10 55 0e 65 11 09 30 35 00 46 6c 03 95 01 81 02 46 db 01 26 3b 02 09 31 81 02 05 0d c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 05 09 09 01 25 01 75 01 95 01 81 02 95 07 81 03 05 0d 85 08 09 55 09 59 75 04 95 02 25 0f b1 02 85 0d 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 07 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 04 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 06 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 06 00 ff 09 01 a1 01 85 09 09 02 15 00 26 ff 00 75 08 95 14 91 02 85 0a 09 03 15 00 26 ff 00 75 08 95 14 91 02 85 0b 09 04 15 00 26 ff 00 75 08 95 1a 81 02 85 0c 09 05 15 00 26 ff 00 75 08 95 1a 81 02 85 0f 09 06 15 00 26 ff 00 75 08 95 01 b1 02 85 0e 09 07 15 00 26 ff 00 75 08 95 01 b1 02 c0", 2081 2056 max_contacts=5, 2082 2057 input_info=(0x3, 0x06CB, 0x2968), 2058 + ) 2059 + 2060 + 2061 + class Testven_0488_108c(BaseTest.TestPTP): 2062 + def create_device(self): 2063 + return PTP( 2064 + "uhid test ven_0488_108c", 2065 + rdesc="05 01 09 02 a1 01 85 06 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 03 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 81 06 c0 c0 05 0d 09 05 a1 01 85 01 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 05 0d 09 56 81 02 09 54 25 05 95 01 75 08 81 02 05 09 09 01 25 01 75 01 95 01 81 02 95 07 81 03 05 0d 85 02 09 55 75 08 95 01 25 05 b1 02 09 59 b1 02 06 00 ff 85 03 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 05 0e 09 01 a1 02 85 13 09 23 15 00 25 64 75 08 95 01 b1 02 c0 c0 05 0d 09 0e a1 01 85 04 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 05 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 06 01 ff 09 02 a1 01 09 00 85 07 15 00 26 ff 00 75 08 96 12 02 b1 02 c0 06 00 ff 09 01 a1 01 85 0d 15 00 26 ff 00 75 08 95 11 09 01 81 02 09 01 91 02 c0 05 0e 09 01 a1 01 85 11 09 35 15 00 26 ff 00 75 08 95 17 b1 02 c0 06 81 ff 09 01 a1 01 09 20 85 17 15 00 26 ff 00 75 08 95 3f 09 01 81 02 09 01 91 02 c0", 2066 + input_info=(0x18, 0x0488, 0x108C), 2067 + buttontype=HIDButtonType.PRESSUREPAD, 2083 2068 ) 2084 2069 2085 2070 ··· 2145 2110 def create_device(self): 2146 2111 return PTP( 2147 2112 "uhid test sipodev_0603_0002", 2148 - type="clickpad", 2113 + buttontype=HIDButtonType.CLICKPAD, 2149 2114 rdesc="05 01 09 02 a1 01 85 03 09 01 a1 00 05 09 19 01 29 02 25 01 75 01 95 02 81 02 95 06 81 03 05 01 09 30 09 31 15 80 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 75 01 95 02 81 03 95 01 75 04 25 05 09 51 81 02 05 01 15 00 26 44 0a 75 0c 55 0e 65 11 09 30 35 00 46 ac 03 95 01 81 02 46 fe 01 26 34 05 75 0c 09 31 81 02 05 0d c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 0a 95 01 75 04 81 02 75 01 95 03 81 03 05 09 09 01 25 01 75 01 95 01 81 02 05 0d 85 0a 09 55 09 59 75 04 95 02 25 0f b1 02 85 0b 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 09 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 06 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 07 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 05 01 09 0c a1 01 85 08 15 00 25 01 09 c6 75 01 95 01 81 06 75 07 81 03 c0 05 01 09 80 a1 01 85 01 15 00 25 01 75 01 0a 81 00 0a 82 00 0a 83 00 95 03 81 06 95 05 81 01 c0 06 0c 00 09 01 a1 01 85 02 25 01 15 00 75 01 0a b5 00 0a b6 00 0a b7 00 0a cd 00 0a e2 00 0a a2 00 0a e9 00 0a ea 00 95 08 81 02 0a 83 01 0a 6f 00 0a 70 00 0a 88 01 0a 8a 01 0a 92 01 0a a8 02 0a 24 02 95 08 81 02 0a 21 02 0a 23 02 0a 96 01 0a 25 02 0a 26 02 0a 27 02 0a 23 02 0a b1 02 95 08 81 02 c0 06 00 ff 09 01 a1 01 85 05 15 00 26 ff 00 19 01 29 02 75 08 95 05 b1 02 c0", 2150 2115 ) 2151 2116
+7 -1
tools/testing/selftests/kselftest_harness.h
··· 70 70 71 71 #include "kselftest.h" 72 72 73 + static inline void __kselftest_memset_safe(void *s, int c, size_t n) 74 + { 75 + if (n > 0) 76 + memset(s, c, n); 77 + } 78 + 73 79 #define TEST_TIMEOUT_DEFAULT 30 74 80 75 81 /* Utilities exposed to the test definitions */ ··· 422 416 self = mmap(NULL, sizeof(*self), PROT_READ | PROT_WRITE, \ 423 417 MAP_SHARED | MAP_ANONYMOUS, -1, 0); \ 424 418 } else { \ 425 - memset(&self_private, 0, sizeof(self_private)); \ 419 + __kselftest_memset_safe(&self_private, 0, sizeof(self_private)); \ 426 420 self = &self_private; \ 427 421 } \ 428 422 } \
+2 -2
tools/testing/selftests/net/lib/py/__init__.py
··· 13 13 from .netns import NetNS, NetNSEnter 14 14 from .nsim import NetdevSim, NetdevSimDev 15 15 from .utils import CmdExitFailure, fd_read_timeout, cmd, bkg, defer, \ 16 - bpftool, ip, ethtool, bpftrace, rand_port, wait_port_listen, wait_file 16 + bpftool, ip, ethtool, bpftrace, rand_port, wait_port_listen, wait_file, tool 17 17 from .ynl import NlError, YnlFamily, EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily 18 18 from .ynl import NetshaperFamily, DevlinkFamily, PSPFamily 19 19 ··· 26 26 "NetNS", "NetNSEnter", 27 27 "CmdExitFailure", "fd_read_timeout", "cmd", "bkg", "defer", 28 28 "bpftool", "ip", "ethtool", "bpftrace", "rand_port", 29 - "wait_port_listen", "wait_file", 29 + "wait_port_listen", "wait_file", "tool", 30 30 "NetdevSim", "NetdevSimDev", 31 31 "NetshaperFamily", "DevlinkFamily", "PSPFamily", "NlError", 32 32 "YnlFamily", "EthtoolFamily", "NetdevFamily", "RtnlFamily",
+1
tools/testing/selftests/net/mptcp/Makefile
··· 3 3 top_srcdir = ../../../../.. 4 4 5 5 CFLAGS += -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES) 6 + CFLAGS += -I$(top_srcdir)/tools/include 6 7 7 8 TEST_PROGS := \ 8 9 diag.sh \
+2 -1
tools/testing/selftests/net/mptcp/mptcp_connect.c
··· 33 33 #include <linux/tcp.h> 34 34 #include <linux/time_types.h> 35 35 #include <linux/sockios.h> 36 + #include <linux/compiler.h> 36 37 37 38 extern int optind; 38 39 ··· 141 140 exit(1); 142 141 } 143 142 144 - static void xerror(const char *fmt, ...) 143 + static void __noreturn xerror(const char *fmt, ...) 145 144 { 146 145 va_list ap; 147 146
+2 -1
tools/testing/selftests/net/mptcp/mptcp_diag.c
··· 5 5 #include <linux/rtnetlink.h> 6 6 #include <linux/inet_diag.h> 7 7 #include <linux/netlink.h> 8 + #include <linux/compiler.h> 8 9 #include <sys/socket.h> 9 10 #include <netinet/in.h> 10 11 #include <linux/tcp.h> ··· 88 87 89 88 #define rta_getattr(type, value) (*(type *)RTA_DATA(value)) 90 89 91 - static void die_perror(const char *msg) 90 + static void __noreturn die_perror(const char *msg) 92 91 { 93 92 perror(msg); 94 93 exit(1);
+3 -2
tools/testing/selftests/net/mptcp/mptcp_inq.c
··· 28 28 29 29 #include <linux/tcp.h> 30 30 #include <linux/sockios.h> 31 + #include <linux/compiler.h> 31 32 32 33 #ifndef IPPROTO_MPTCP 33 34 #define IPPROTO_MPTCP 262 ··· 41 40 static int proto_tx = IPPROTO_MPTCP; 42 41 static int proto_rx = IPPROTO_MPTCP; 43 42 44 - static void die_perror(const char *msg) 43 + static void __noreturn die_perror(const char *msg) 45 44 { 46 45 perror(msg); 47 46 exit(1); ··· 53 52 exit(r); 54 53 } 55 54 56 - static void xerror(const char *fmt, ...) 55 + static void __noreturn xerror(const char *fmt, ...) 57 56 { 58 57 va_list ap; 59 58
+3 -2
tools/testing/selftests/net/mptcp/mptcp_sockopt.c
··· 25 25 #include <netinet/in.h> 26 26 27 27 #include <linux/tcp.h> 28 + #include <linux/compiler.h> 28 29 29 30 static int pf = AF_INET; 30 31 ··· 128 127 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 129 128 #endif 130 129 131 - static void die_perror(const char *msg) 130 + static void __noreturn die_perror(const char *msg) 132 131 { 133 132 perror(msg); 134 133 exit(1); ··· 140 139 exit(r); 141 140 } 142 141 143 - static void xerror(const char *fmt, ...) 142 + static void __noreturn xerror(const char *fmt, ...) 144 143 { 145 144 va_list ap; 146 145
+44 -1
tools/testing/selftests/net/netfilter/nft_concat_range.sh
··· 29 29 net6_port_net6_port net_port_mac_proto_net" 30 30 31 31 # Reported bugs, also described by TYPE_ variables below 32 - BUGS="flush_remove_add reload net_port_proto_match avx2_mismatch doublecreate" 32 + BUGS="flush_remove_add reload net_port_proto_match avx2_mismatch doublecreate insert_overlap" 33 33 34 34 # List of possible paths to pktgen script from kernel tree for performance tests 35 35 PKTGEN_SCRIPT_PATHS=" ··· 410 410 411 411 TYPE_doublecreate=" 412 412 display cannot create same element twice 413 + type_spec ipv4_addr . ipv4_addr 414 + chain_spec ip saddr . ip daddr 415 + dst addr4 416 + proto icmp 417 + 418 + race_repeat 0 419 + 420 + perf_duration 0 421 + " 422 + 423 + TYPE_insert_overlap=" 424 + display reject overlapping range on add 413 425 type_spec ipv4_addr . ipv4_addr 414 426 chain_spec ip saddr . ip daddr 415 427 dst addr4 ··· 1962 1950 err "Could not flush and re-create element in one transaction" 1963 1951 return 1 1964 1952 fi 1953 + 1954 + return 0 1955 + } 1956 + 1957 + add_fail() 1958 + { 1959 + if nft add element inet filter test "$1" 2>/dev/null ; then 1960 + err "Returned success for add ${1} given set:" 1961 + err "$(nft -a list set inet filter test )" 1962 + return 1 1963 + fi 1964 + 1965 + return 0 1966 + } 1967 + 1968 + test_bug_insert_overlap() 1969 + { 1970 + local elements="1.2.3.4 . 1.2.4.1" 1971 + 1972 + setup veth send_"${proto}" set || return ${ksft_skip} 1973 + 1974 + add "{ $elements }" || return 1 1975 + 1976 + elements="1.2.3.0-1.2.3.4 . 1.2.4.1" 1977 + add_fail "{ $elements }" || return 1 1978 + 1979 + elements="1.2.3.0-1.2.3.4 . 1.2.4.2" 1980 + add "{ $elements }" || return 1 1981 + 1982 + elements="1.2.3.4 . 1.2.4.1-1.2.4.2" 1983 + add_fail "{ $elements }" || return 1 1965 1984 1966 1985 return 0 1967 1986 }
+47
tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
··· 1098 1098 "teardown": [ 1099 1099 "$TC qdisc del dev $DUMMY root" 1100 1100 ] 1101 + }, 1102 + { 1103 + "id": "4ed9", 1104 + "name": "Try to redirect to self on egress with clsact", 1105 + "category": [ 1106 + "filter", 1107 + "mirred" 1108 + ], 1109 + "plugins": { 1110 + "requires": [ 1111 + "nsPlugin" 1112 + ] 1113 + }, 1114 + "setup": [ 1115 + "$IP link set dev $DUMMY up || true", 1116 + "$IP addr add 10.10.10.10/24 dev $DUMMY || true", 1117 + "$TC qdisc add dev $DUMMY clsact", 1118 + "$TC filter add dev $DUMMY egress protocol ip prio 10 matchall action mirred egress redirect dev $DUMMY index 1" 1119 + ], 1120 + "cmdUnderTest": "ping -c1 -W0.01 -I $DUMMY 10.10.10.1", 1121 + "expExitCode": "1", 1122 + "verifyCmd": "$TC -j -s actions get action mirred index 1", 1123 + "matchJSON": [ 1124 + { 1125 + "total acts": 0 1126 + }, 1127 + { 1128 + "actions": [ 1129 + { 1130 + "order": 1, 1131 + "kind": "mirred", 1132 + "mirred_action": "redirect", 1133 + "direction": "egress", 1134 + "index": 1, 1135 + "stats": { 1136 + "packets": 1, 1137 + "overlimits": 1 1138 + }, 1139 + "not_in_hw": true 1140 + } 1141 + ] 1142 + } 1143 + ], 1144 + "teardown": [ 1145 + "$TC qdisc del dev $DUMMY clsact" 1146 + ] 1101 1147 } 1148 + 1102 1149 ]
+3 -2
tools/testing/selftests/ublk/Makefile
··· 22 22 TEST_PROGS += test_generic_12.sh 23 23 TEST_PROGS += test_generic_13.sh 24 24 TEST_PROGS += test_generic_14.sh 25 + TEST_PROGS += test_generic_15.sh 25 26 26 27 TEST_PROGS += test_null_01.sh 27 28 TEST_PROGS += test_null_02.sh ··· 51 50 52 51 TEST_GEN_PROGS_EXTENDED = kublk 53 52 53 + LOCAL_HDRS += $(wildcard *.h) 54 54 include ../lib.mk 55 55 56 - $(TEST_GEN_PROGS_EXTENDED): kublk.c null.c file_backed.c common.c stripe.c \ 57 - fault_inject.c 56 + $(TEST_GEN_PROGS_EXTENDED): $(wildcard *.c) 58 57 59 58 check: 60 59 shellcheck -x -f gcc *.sh
+12 -4
tools/testing/selftests/ublk/test_common.sh
··· 178 178 _create_ublk_dev() { 179 179 local dev_id; 180 180 local cmd=$1 181 + local settle=$2 181 182 182 - shift 1 183 + shift 2 183 184 184 185 if [ ! -c /dev/ublk-control ]; then 185 186 return ${UBLK_SKIP_CODE} ··· 195 194 echo "fail to add ublk dev $*" 196 195 return 255 197 196 fi 198 - udevadm settle 197 + 198 + if [ "$settle" = "yes" ]; then 199 + udevadm settle 200 + fi 199 201 200 202 if [[ "$dev_id" =~ ^[0-9]+$ ]]; then 201 203 echo "${dev_id}" ··· 208 204 } 209 205 210 206 _add_ublk_dev() { 211 - _create_ublk_dev "add" "$@" 207 + _create_ublk_dev "add" "yes" "$@" 208 + } 209 + 210 + _add_ublk_dev_no_settle() { 211 + _create_ublk_dev "add" "no" "$@" 212 212 } 213 213 214 214 _recover_ublk_dev() { 215 215 local dev_id 216 216 local state 217 217 218 - dev_id=$(_create_ublk_dev "recover" "$@") 218 + dev_id=$(_create_ublk_dev "recover" "yes" "$@") 219 219 for ((j=0;j<20;j++)); do 220 220 state=$(_get_ublk_dev_state "${dev_id}") 221 221 [ "$state" == "LIVE" ] && break
+68
tools/testing/selftests/ublk/test_generic_15.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="generic_15" 7 + ERR_CODE=0 8 + 9 + _test_partition_scan_no_hang() 10 + { 11 + local recovery_flag=$1 12 + local expected_state=$2 13 + local dev_id 14 + local state 15 + local daemon_pid 16 + local start_time 17 + local elapsed 18 + 19 + # Create ublk device with fault_inject target and very large delay 20 + # to simulate hang during partition table read 21 + # --delay_us 60000000 = 60 seconds delay 22 + # Use _add_ublk_dev_no_settle to avoid udevadm settle hang waiting 23 + # for partition scan events to complete 24 + if [ "$recovery_flag" = "yes" ]; then 25 + echo "Testing partition scan with recovery support..." 26 + dev_id=$(_add_ublk_dev_no_settle -t fault_inject -q 1 -d 1 --delay_us 60000000 -r 1) 27 + else 28 + echo "Testing partition scan without recovery..." 29 + dev_id=$(_add_ublk_dev_no_settle -t fault_inject -q 1 -d 1 --delay_us 60000000) 30 + fi 31 + 32 + _check_add_dev "$TID" $? 33 + 34 + # The add command should return quickly because partition scan is async. 35 + # Now sleep briefly to let the async partition scan work start and hit 36 + # the delay in the fault_inject handler. 37 + sleep 1 38 + 39 + # Kill the ublk daemon while partition scan is potentially blocked 40 + # And check state transitions properly 41 + start_time=${SECONDS} 42 + daemon_pid=$(_get_ublk_daemon_pid "${dev_id}") 43 + state=$(__ublk_kill_daemon "${dev_id}" "${expected_state}") 44 + elapsed=$((SECONDS - start_time)) 45 + 46 + # Verify the device transitioned to expected state 47 + if [ "$state" != "${expected_state}" ]; then 48 + echo "FAIL: Device state is $state, expected ${expected_state}" 49 + ERR_CODE=255 50 + ${UBLK_PROG} del -n "${dev_id}" > /dev/null 2>&1 51 + return 52 + fi 53 + echo "PASS: Device transitioned to ${expected_state} in ${elapsed}s without hanging" 54 + 55 + # Clean up the device 56 + ${UBLK_PROG} del -n "${dev_id}" > /dev/null 2>&1 57 + } 58 + 59 + _prep_test "partition_scan" "verify async partition scan prevents IO hang" 60 + 61 + # Test 1: Without recovery support - should transition to DEAD 62 + _test_partition_scan_no_hang "no" "DEAD" 63 + 64 + # Test 2: With recovery support - should transition to QUIESCED 65 + _test_partition_scan_no_hang "yes" "QUIESCED" 66 + 67 + _cleanup_test "partition_scan" 68 + _show_result $TID $ERR_CODE
-1
tools/testing/selftests/vfio/lib/include/libvfio/iova_allocator.h
··· 2 2 #ifndef SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H 3 3 #define SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H 4 4 5 - #include <uapi/linux/types.h> 6 5 #include <linux/list.h> 7 6 #include <linux/types.h> 8 7 #include <linux/iommufd.h>
-1
tools/testing/selftests/vfio/lib/iommu.c
··· 11 11 #include <sys/ioctl.h> 12 12 #include <sys/mman.h> 13 13 14 - #include <uapi/linux/types.h> 15 14 #include <linux/limits.h> 16 15 #include <linux/mman.h> 17 16 #include <linux/types.h>
-1
tools/testing/selftests/vfio/lib/iova_allocator.c
··· 11 11 #include <sys/ioctl.h> 12 12 #include <sys/mman.h> 13 13 14 - #include <uapi/linux/types.h> 15 14 #include <linux/iommufd.h> 16 15 #include <linux/limits.h> 17 16 #include <linux/mman.h>
-1
tools/testing/selftests/vfio/lib/vfio_pci_device.c
··· 11 11 #include <sys/ioctl.h> 12 12 #include <sys/mman.h> 13 13 14 - #include <uapi/linux/types.h> 15 14 #include <linux/iommufd.h> 16 15 #include <linux/limits.h> 17 16 #include <linux/mman.h>
-1
tools/testing/selftests/vfio/vfio_dma_mapping_test.c
··· 3 3 #include <sys/mman.h> 4 4 #include <unistd.h> 5 5 6 - #include <uapi/linux/types.h> 7 6 #include <linux/iommufd.h> 8 7 #include <linux/limits.h> 9 8 #include <linux/mman.h>
-1
tools/testing/selftests/vfio/vfio_iommufd_setup_test.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - #include <uapi/linux/types.h> 3 2 #include <linux/limits.h> 4 3 #include <linux/sizes.h> 5 4 #include <linux/vfio.h>
+32
tools/testing/vsock/vsock_test.c
··· 2192 2192 close(fd); 2193 2193 } 2194 2194 2195 + static void test_stream_accepted_setsockopt_client(const struct test_opts *opts) 2196 + { 2197 + int fd; 2198 + 2199 + fd = vsock_stream_connect(opts->peer_cid, opts->peer_port); 2200 + if (fd < 0) { 2201 + perror("connect"); 2202 + exit(EXIT_FAILURE); 2203 + } 2204 + 2205 + close(fd); 2206 + } 2207 + 2208 + static void test_stream_accepted_setsockopt_server(const struct test_opts *opts) 2209 + { 2210 + int fd; 2211 + 2212 + fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); 2213 + if (fd < 0) { 2214 + perror("accept"); 2215 + exit(EXIT_FAILURE); 2216 + } 2217 + 2218 + enable_so_zerocopy_check(fd); 2219 + close(fd); 2220 + } 2221 + 2195 2222 static struct test_case test_cases[] = { 2196 2223 { 2197 2224 .name = "SOCK_STREAM connection reset", ··· 2397 2370 .name = "SOCK_SEQPACKET ioctl(SIOCINQ) functionality", 2398 2371 .run_client = test_seqpacket_unread_bytes_client, 2399 2372 .run_server = test_seqpacket_unread_bytes_server, 2373 + }, 2374 + { 2375 + .name = "SOCK_STREAM accept()ed socket custom setsockopt()", 2376 + .run_client = test_stream_accepted_setsockopt_client, 2377 + .run_server = test_stream_accepted_setsockopt_server, 2400 2378 }, 2401 2379 {}, 2402 2380 };