diff -u linux-oem-6.1-6.1.0/Documentation/admin-guide/sysctl/kernel.rst linux-oem-6.1-6.1.0/Documentation/admin-guide/sysctl/kernel.rst --- linux-oem-6.1-6.1.0/Documentation/admin-guide/sysctl/kernel.rst +++ linux-oem-6.1-6.1.0/Documentation/admin-guide/sysctl/kernel.rst @@ -667,6 +667,15 @@ an oops event is detected. +oops_limit +========== + +Number of kernel oopses after which the kernel should panic when +``panic_on_oops`` is not set. Setting this to 0 disables checking +the count. Setting this to 1 has the same effect as setting +``panic_on_oops=1``. The default value is 10000. + + osrelease, ostype & version =========================== @@ -1523,6 +1532,16 @@ 2 Unprivileged calls to ``bpf()`` are disabled = ============================================================= + +warn_limit +========== + +Number of kernel warnings after which the kernel should panic when +``panic_on_warn`` is not set. Setting this to 0 disables checking +the warning count. Setting this to 1 has the same effect as setting +``panic_on_warn=1``. The default value is 0. + + watchdog ======== diff -u linux-oem-6.1-6.1.0/MAINTAINERS linux-oem-6.1-6.1.0/MAINTAINERS --- linux-oem-6.1-6.1.0/MAINTAINERS +++ linux-oem-6.1-6.1.0/MAINTAINERS @@ -3456,7 +3456,7 @@ AUDIT SUBSYSTEM M: Paul Moore M: Eric Paris -L: linux-audit@redhat.com (moderated for non-subscribers) +L: audit@vger.kernel.org S: Supported W: https://github.com/linux-audit T: git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git @@ -11124,6 +11124,8 @@ L: linux-hardening@vger.kernel.org S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening +F: Documentation/ABI/testing/sysfs-kernel-oops_count +F: Documentation/ABI/testing/sysfs-kernel-warn_count F: include/linux/overflow.h F: include/linux/randomize_kstack.h F: mm/usercopy.c diff -u linux-oem-6.1-6.1.0/Makefile linux-oem-6.1-6.1.0/Makefile --- linux-oem-6.1-6.1.0/Makefile +++ linux-oem-6.1-6.1.0/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 6 +SUBLEVEL = 14 EXTRAVERSION = NAME = Hurr durr I'ma ninja sloth @@ -538,7 +538,7 @@ CFLAGS_KERNEL = RUSTFLAGS_KERNEL = AFLAGS_KERNEL = -export LDFLAGS_vmlinux = +LDFLAGS_vmlinux = # Use USERINCLUDE when you must reference the UAPI directories only. USERINCLUDE := \ @@ -1235,6 +1235,18 @@ @: PHONY += vmlinux +# LDFLAGS_vmlinux in the top Makefile defines linker flags for the top vmlinux, +# not for decompressors. LDFLAGS_vmlinux in arch/*/boot/compressed/Makefile is +# unrelated; the decompressors just happen to have the same base name, +# arch/*/boot/compressed/vmlinux. +# Export LDFLAGS_vmlinux only to scripts/Makefile.vmlinux. +# +# _LDFLAGS_vmlinux is a workaround for the 'private export' bug: +# https://savannah.gnu.org/bugs/?61463 +# For Make > 4.4, the following simple code will work: +# vmlinux: private export LDFLAGS_vmlinux := $(LDFLAGS_vmlinux) +vmlinux: private _LDFLAGS_vmlinux := $(LDFLAGS_vmlinux) +vmlinux: export LDFLAGS_vmlinux = $(_LDFLAGS_vmlinux) vmlinux: vmlinux.o $(KBUILD_LDS) modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.vmlinux @@ -1521,6 +1533,7 @@ # *.ko are usually independent of vmlinux, but CONFIG_DEBUG_INFOBTF_MODULES # is an exception. ifdef CONFIG_DEBUG_INFO_BTF_MODULES +KBUILD_BUILTIN := 1 modules: vmlinux endif diff -u linux-oem-6.1-6.1.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi linux-oem-6.1-6.1.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi --- linux-oem-6.1-6.1.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -1966,7 +1966,7 @@ }; vdosys0: syscon@1c01a000 { - compatible = "mediatek,mt8195-mmsys", "syscon"; + compatible = "mediatek,mt8195-vdosys0", "mediatek,mt8195-mmsys", "syscon"; reg = <0 0x1c01a000 0 0x1000>; mboxes = <&gce0 0 CMDQ_THR_PRIO_4>; #clock-cells = <1>; @@ -2101,7 +2101,7 @@ }; vdosys1: syscon@1c100000 { - compatible = "mediatek,mt8195-mmsys", "syscon"; + compatible = "mediatek,mt8195-vdosys1", "syscon"; reg = <0 0x1c100000 0 0x1000>; #clock-cells = <1>; }; diff -u linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/sc8280xp.dtsi linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/sc8280xp.dtsi --- linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -1173,7 +1173,7 @@ clock-names = "aux", "ref_clk_src", "ref", "com_aux"; resets = <&gcc GCC_USB3_PHY_PRIM_BCR>, - <&gcc GCC_USB3_DP_PHY_PRIM_BCR>; + <&gcc GCC_USB4_DP_PHY_PRIM_BCR>; reset-names = "phy", "common"; power-domains = <&gcc USB30_PRIM_GDSC>; diff -u linux-oem-6.1-6.1.0/arch/arm64/kernel/stacktrace.c linux-oem-6.1-6.1.0/arch/arm64/kernel/stacktrace.c --- linux-oem-6.1-6.1.0/arch/arm64/kernel/stacktrace.c +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/stacktrace.c @@ -5,6 +5,7 @@ * Copyright (C) 2012 ARM Ltd. */ #include +#include #include #include #include @@ -12,6 +13,7 @@ #include #include +#include #include #include #include @@ -186,6 +188,13 @@ : stackinfo_get_unknown(); \ }) +#define STACKINFO_EFI \ + ({ \ + ((task == current) && current_in_efi()) \ + ? stackinfo_get_efi() \ + : stackinfo_get_unknown(); \ + }) + noinline noinstr void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, struct task_struct *task, struct pt_regs *regs) @@ -200,6 +209,9 @@ STACKINFO_SDEI(normal), STACKINFO_SDEI(critical), #endif +#ifdef CONFIG_EFI + STACKINFO_EFI, +#endif }; struct unwind_state state = { .stacks = stacks, diff -u linux-oem-6.1-6.1.0/arch/arm64/mm/fault.c linux-oem-6.1-6.1.0/arch/arm64/mm/fault.c --- linux-oem-6.1-6.1.0/arch/arm64/mm/fault.c +++ linux-oem-6.1-6.1.0/arch/arm64/mm/fault.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -397,6 +398,9 @@ msg = "paging request"; } + if (efi_runtime_fixup_exception(regs, msg)) + return; + die_kernel_fault(msg, addr, esr, regs); } diff -u linux-oem-6.1-6.1.0/arch/parisc/kernel/firmware.c linux-oem-6.1-6.1.0/arch/parisc/kernel/firmware.c --- linux-oem-6.1-6.1.0/arch/parisc/kernel/firmware.c +++ linux-oem-6.1-6.1.0/arch/parisc/kernel/firmware.c @@ -1303,7 +1303,7 @@ */ int pdc_iodc_print(const unsigned char *str, unsigned count) { - unsigned int i; + unsigned int i, found = 0; unsigned long flags; count = min_t(unsigned int, count, sizeof(iodc_dbuf)); @@ -1315,6 +1315,7 @@ iodc_dbuf[i+0] = '\r'; iodc_dbuf[i+1] = '\n'; i += 2; + found = 1; goto print; default: iodc_dbuf[i] = str[i]; @@ -1330,7 +1331,7 @@ __pa(pdc_result), 0, __pa(iodc_dbuf), i, 0); spin_unlock_irqrestore(&pdc_lock, flags); - return i; + return i - found; } #if !defined(BOOTLOADER) diff -u linux-oem-6.1-6.1.0/arch/riscv/boot/dts/sifive/fu740-c000.dtsi linux-oem-6.1-6.1.0/arch/riscv/boot/dts/sifive/fu740-c000.dtsi --- linux-oem-6.1-6.1.0/arch/riscv/boot/dts/sifive/fu740-c000.dtsi +++ linux-oem-6.1-6.1.0/arch/riscv/boot/dts/sifive/fu740-c000.dtsi @@ -328,7 +328,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x60080000 0x0 0x60080000 0x0 0x10000>, /* I/O */ <0x82000000 0x0 0x60090000 0x0 0x60090000 0x0 0xff70000>, /* mem */ - <0x82000000 0x0 0x70000000 0x0 0x70000000 0x0 0x1000000>, /* mem */ + <0x82000000 0x0 0x70000000 0x0 0x70000000 0x0 0x10000000>, /* mem */ <0xc3000000 0x20 0x00000000 0x20 0x00000000 0x20 0x00000000>; /* mem prefetchable */ num-lanes = <0x8>; interrupts = <56>, <57>, <58>, <59>, <60>, <61>, <62>, <63>, <64>; diff -u linux-oem-6.1-6.1.0/arch/riscv/kernel/stacktrace.c linux-oem-6.1-6.1.0/arch/riscv/kernel/stacktrace.c --- linux-oem-6.1-6.1.0/arch/riscv/kernel/stacktrace.c +++ linux-oem-6.1-6.1.0/arch/riscv/kernel/stacktrace.c @@ -30,6 +30,7 @@ fp = (unsigned long)__builtin_frame_address(0); sp = current_stack_pointer; pc = (unsigned long)walk_stackframe; + level = -1; } else { /* task blocked in __switch_to */ fp = task->thread.s[0]; @@ -41,7 +42,7 @@ unsigned long low, high; struct stackframe *frame; - if (unlikely(!__kernel_text_address(pc) || (level++ >= 1 && !fn(arg, pc)))) + if (unlikely(!__kernel_text_address(pc) || (level++ >= 0 && !fn(arg, pc)))) break; /* Validate frame pointer */ diff -u linux-oem-6.1-6.1.0/arch/s390/kernel/setup.c linux-oem-6.1-6.1.0/arch/s390/kernel/setup.c --- linux-oem-6.1-6.1.0/arch/s390/kernel/setup.c +++ linux-oem-6.1-6.1.0/arch/s390/kernel/setup.c @@ -508,6 +508,7 @@ { struct lowcore *abs_lc; unsigned long flags; + int i; __ctl_clear_bit(0, 28); S390_lowcore.external_new_psw.mask |= PSW_MASK_DAT; @@ -522,8 +523,8 @@ abs_lc = get_abs_lowcore(&flags); abs_lc->restart_flags = RESTART_FLAG_CTLREGS; abs_lc->program_new_psw = S390_lowcore.program_new_psw; - memcpy(abs_lc->cregs_save_area, S390_lowcore.cregs_save_area, - sizeof(abs_lc->cregs_save_area)); + for (i = 0; i < 16; i++) + abs_lc->cregs_save_area[i] = S390_lowcore.cregs_save_area[i]; put_abs_lowcore(abs_lc, flags); } diff -u linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/microcode/intel.c linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/microcode/intel.c --- linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/microcode/intel.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/microcode/intel.c @@ -902,7 +902,7 @@ kvec.iov_base = (void *)firmware->data; kvec.iov_len = firmware->size; - iov_iter_kvec(&iter, WRITE, &kvec, 1, firmware->size); + iov_iter_kvec(&iter, ITER_SOURCE, &kvec, 1, firmware->size); ret = generic_load_microcode(cpu, &iter); release_firmware(firmware); diff -u linux-oem-6.1-6.1.0/arch/x86/kernel/kprobes/core.c linux-oem-6.1-6.1.0/arch/x86/kernel/kprobes/core.c --- linux-oem-6.1-6.1.0/arch/x86/kernel/kprobes/core.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/kprobes/core.c @@ -471,50 +471,26 @@ } NOKPROBE_SYMBOL(kprobe_emulate_call); -static nokprobe_inline -void __kprobe_emulate_jmp(struct kprobe *p, struct pt_regs *regs, bool cond) +static void kprobe_emulate_jmp(struct kprobe *p, struct pt_regs *regs) { unsigned long ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; - if (cond) - ip += p->ainsn.rel32; + ip += p->ainsn.rel32; int3_emulate_jmp(regs, ip); } - -static void kprobe_emulate_jmp(struct kprobe *p, struct pt_regs *regs) -{ - __kprobe_emulate_jmp(p, regs, true); -} NOKPROBE_SYMBOL(kprobe_emulate_jmp); -static const unsigned long jcc_mask[6] = { - [0] = X86_EFLAGS_OF, - [1] = X86_EFLAGS_CF, - [2] = X86_EFLAGS_ZF, - [3] = X86_EFLAGS_CF | X86_EFLAGS_ZF, - [4] = X86_EFLAGS_SF, - [5] = X86_EFLAGS_PF, -}; - static void kprobe_emulate_jcc(struct kprobe *p, struct pt_regs *regs) { - bool invert = p->ainsn.jcc.type & 1; - bool match; + unsigned long ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; - if (p->ainsn.jcc.type < 0xc) { - match = regs->flags & jcc_mask[p->ainsn.jcc.type >> 1]; - } else { - match = ((regs->flags & X86_EFLAGS_SF) >> X86_EFLAGS_SF_BIT) ^ - ((regs->flags & X86_EFLAGS_OF) >> X86_EFLAGS_OF_BIT); - if (p->ainsn.jcc.type >= 0xe) - match = match || (regs->flags & X86_EFLAGS_ZF); - } - __kprobe_emulate_jmp(p, regs, (match && !invert) || (!match && invert)); + int3_emulate_jcc(regs, p->ainsn.jcc.type, ip, p->ainsn.rel32); } NOKPROBE_SYMBOL(kprobe_emulate_jcc); static void kprobe_emulate_loop(struct kprobe *p, struct pt_regs *regs) { + unsigned long ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; bool match; if (p->ainsn.loop.type != 3) { /* LOOP* */ @@ -542,7 +518,9 @@ else if (p->ainsn.loop.type == 1) /* LOOPE */ match = match && (regs->flags & X86_EFLAGS_ZF); - __kprobe_emulate_jmp(p, regs, match); + if (match) + ip += p->ainsn.rel32; + int3_emulate_jmp(regs, ip); } NOKPROBE_SYMBOL(kprobe_emulate_loop); diff -u linux-oem-6.1-6.1.0/arch/x86/kvm/vmx/nested.c linux-oem-6.1-6.1.0/arch/x86/kvm/vmx/nested.c --- linux-oem-6.1-6.1.0/arch/x86/kvm/vmx/nested.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/vmx/nested.c @@ -4767,6 +4767,17 @@ vmx_switch_vmcs(vcpu, &vmx->vmcs01); + /* + * If IBRS is advertised to the vCPU, KVM must flush the indirect + * branch predictors when transitioning from L2 to L1, as L1 expects + * hardware (KVM in this case) to provide separate predictor modes. + * Bare metal isolates VMX root (host) from VMX non-root (guest), but + * doesn't isolate different VMCSs, i.e. in this case, doesn't provide + * separate modes for L2 vs L1. + */ + if (guest_cpuid_has(vcpu, X86_FEATURE_SPEC_CTRL)) + indirect_branch_prediction_barrier(); + /* Update any VMCS fields that might have changed while L2 ran */ vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, vmx->msr_autoload.host.nr); vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, vmx->msr_autoload.guest.nr); diff -u linux-oem-6.1-6.1.0/arch/x86/kvm/x86.c linux-oem-6.1-6.1.0/arch/x86/kvm/x86.c --- linux-oem-6.1-6.1.0/arch/x86/kvm/x86.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/x86.c @@ -192,6 +192,10 @@ bool __read_mostly eager_page_split = true; module_param(eager_page_split, bool, 0644); +/* Enable/disable SMT_RSB bug mitigation */ +bool __read_mostly mitigate_smt_rsb; +module_param(mitigate_smt_rsb, bool, 0444); + /* * Restoring the host value for MSRs that are only consumed when running in * usermode, e.g. SYSCALL MSRs and TSC_AUX, can be deferred until the CPU @@ -4435,10 +4439,15 @@ r = KVM_CLOCK_VALID_FLAGS; break; case KVM_CAP_X86_DISABLE_EXITS: - r |= KVM_X86_DISABLE_EXITS_HLT | KVM_X86_DISABLE_EXITS_PAUSE | - KVM_X86_DISABLE_EXITS_CSTATE; - if(kvm_can_mwait_in_guest()) - r |= KVM_X86_DISABLE_EXITS_MWAIT; + r = KVM_X86_DISABLE_EXITS_PAUSE; + + if (!mitigate_smt_rsb) { + r |= KVM_X86_DISABLE_EXITS_HLT | + KVM_X86_DISABLE_EXITS_CSTATE; + + if (kvm_can_mwait_in_guest()) + r |= KVM_X86_DISABLE_EXITS_MWAIT; + } break; case KVM_CAP_X86_SMM: /* SMBASE is usually relocated above 1M on modern chipsets, @@ -5241,12 +5250,11 @@ { unsigned long val; + memset(dbgregs, 0, sizeof(*dbgregs)); memcpy(dbgregs->db, vcpu->arch.db, sizeof(vcpu->arch.db)); kvm_get_dr(vcpu, 6, &val); dbgregs->dr6 = val; dbgregs->dr7 = vcpu->arch.dr7; - dbgregs->flags = 0; - memset(&dbgregs->reserved, 0, sizeof(dbgregs->reserved)); } static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu, @@ -6214,15 +6222,26 @@ if (cap->args[0] & ~KVM_X86_DISABLE_VALID_EXITS) break; - if ((cap->args[0] & KVM_X86_DISABLE_EXITS_MWAIT) && - kvm_can_mwait_in_guest()) - kvm->arch.mwait_in_guest = true; - if (cap->args[0] & KVM_X86_DISABLE_EXITS_HLT) - kvm->arch.hlt_in_guest = true; if (cap->args[0] & KVM_X86_DISABLE_EXITS_PAUSE) kvm->arch.pause_in_guest = true; - if (cap->args[0] & KVM_X86_DISABLE_EXITS_CSTATE) - kvm->arch.cstate_in_guest = true; + +#define SMT_RSB_MSG "This processor is affected by the Cross-Thread Return Predictions vulnerability. " \ + "KVM_CAP_X86_DISABLE_EXITS should only be used with SMT disabled or trusted guests." + + if (!mitigate_smt_rsb) { + if (boot_cpu_has_bug(X86_BUG_SMT_RSB) && cpu_smt_possible() && + (cap->args[0] & ~KVM_X86_DISABLE_EXITS_PAUSE)) + pr_warn_once(SMT_RSB_MSG); + + if ((cap->args[0] & KVM_X86_DISABLE_EXITS_MWAIT) && + kvm_can_mwait_in_guest()) + kvm->arch.mwait_in_guest = true; + if (cap->args[0] & KVM_X86_DISABLE_EXITS_HLT) + kvm->arch.hlt_in_guest = true; + if (cap->args[0] & KVM_X86_DISABLE_EXITS_CSTATE) + kvm->arch.cstate_in_guest = true; + } + r = 0; break; case KVM_CAP_MSR_PLATFORM_INFO: @@ -8841,7 +8860,9 @@ write_fault_to_spt, emulation_type)) return 1; - if (ctxt->have_exception) { + + if (ctxt->have_exception && + !(emulation_type & EMULTYPE_SKIP)) { /* * #UD should result in just EMULATION_FAILED, and trap-like * exception should not be encountered during decode. @@ -13730,6 +13751,7 @@ static int __init kvm_x86_init(void) { kvm_mmu_x86_module_init(); + mitigate_smt_rsb &= boot_cpu_has_bug(X86_BUG_SMT_RSB) && cpu_smt_possible(); return 0; } module_init(kvm_x86_init); diff -u linux-oem-6.1-6.1.0/block/bfq-iosched.c linux-oem-6.1-6.1.0/block/bfq-iosched.c --- linux-oem-6.1-6.1.0/block/bfq-iosched.c +++ linux-oem-6.1-6.1.0/block/bfq-iosched.c @@ -3180,7 +3180,7 @@ /* * Merge queues (that is, let bic redirect its requests to new_bfqq) */ - bic_set_bfqq(bic, new_bfqq, 1); + bic_set_bfqq(bic, new_bfqq, true); bfq_mark_bfqq_coop(new_bfqq); /* * new_bfqq now belongs to at least two bics (it is a shared queue): @@ -5491,9 +5491,11 @@ bfqq = bic_to_bfqq(bic, false); if (bfqq) { - bfq_release_process_ref(bfqd, bfqq); + struct bfq_queue *old_bfqq = bfqq; + bfqq = bfq_get_queue(bfqd, bio, false, bic, true); bic_set_bfqq(bic, bfqq, false); + bfq_release_process_ref(bfqd, old_bfqq); } bfqq = bic_to_bfqq(bic, true); @@ -6627,7 +6629,7 @@ return bfqq; } - bic_set_bfqq(bic, NULL, 1); + bic_set_bfqq(bic, NULL, true); bfq_put_cooperator(bfqq); diff -u linux-oem-6.1-6.1.0/block/blk-cgroup.c linux-oem-6.1-6.1.0/block/blk-cgroup.c --- linux-oem-6.1-6.1.0/block/blk-cgroup.c +++ linux-oem-6.1-6.1.0/block/blk-cgroup.c @@ -1408,6 +1408,10 @@ list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) pol->pd_init_fn(blkg->pd[pol->plid]); + if (pol->pd_online_fn) + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) + pol->pd_online_fn(blkg->pd[pol->plid]); + __set_bit(pol->plid, q->blkcg_pols); ret = 0; diff -u linux-oem-6.1-6.1.0/block/blk-merge.c linux-oem-6.1-6.1.0/block/blk-merge.c --- linux-oem-6.1-6.1.0/block/blk-merge.c +++ linux-oem-6.1-6.1.0/block/blk-merge.c @@ -358,11 +358,13 @@ default: split = bio_split_rw(bio, lim, nr_segs, bs, get_max_io_size(bio, lim) << SECTOR_SHIFT); + if (IS_ERR(split)) + return NULL; break; } if (split) { - /* there isn't chance to merge the splitted bio */ + /* there isn't chance to merge the split bio */ split->bi_opf |= REQ_NOMERGE; blkcg_bio_issue_init(split); diff -u linux-oem-6.1-6.1.0/block/blk-mq.c linux-oem-6.1-6.1.0/block/blk-mq.c --- linux-oem-6.1-6.1.0/block/blk-mq.c +++ linux-oem-6.1-6.1.0/block/blk-mq.c @@ -2858,6 +2858,7 @@ struct blk_plug *plug, struct bio **bio, unsigned int nsegs) { struct request *rq; + enum hctx_type type, hctx_type; if (!plug) return NULL; @@ -2870,7 +2871,10 @@ return NULL; } - if (blk_mq_get_hctx_type((*bio)->bi_opf) != rq->mq_hctx->type) + type = blk_mq_get_hctx_type((*bio)->bi_opf); + hctx_type = rq->mq_hctx->type; + if (type != hctx_type && + !(type == HCTX_TYPE_READ && hctx_type == HCTX_TYPE_DEFAULT)) return NULL; if (op_is_flush(rq->cmd_flags) != op_is_flush((*bio)->bi_opf)) return NULL; @@ -2919,8 +2923,11 @@ blk_status_t ret; bio = blk_queue_bounce(bio, q); - if (bio_may_exceed_limits(bio, &q->limits)) + if (bio_may_exceed_limits(bio, &q->limits)) { bio = __bio_split_to_limits(bio, &q->limits, &nr_segs); + if (!bio) + return; + } if (!bio_integrity_prep(bio)) return; diff -u linux-oem-6.1-6.1.0/block/mq-deadline.c linux-oem-6.1-6.1.0/block/mq-deadline.c --- linux-oem-6.1-6.1.0/block/mq-deadline.c +++ linux-oem-6.1-6.1.0/block/mq-deadline.c @@ -294,7 +294,7 @@ /* * Check if rq has a sequential request preceding it. */ -static bool deadline_is_seq_writes(struct deadline_data *dd, struct request *rq) +static bool deadline_is_seq_write(struct deadline_data *dd, struct request *rq) { struct request *prev = deadline_earlier_request(rq); @@ -353,7 +353,7 @@ list_for_each_entry(rq, &per_prio->fifo_list[DD_WRITE], queuelist) { if (blk_req_can_dispatch_to_zone(rq) && (blk_queue_nonrot(rq->q) || - !deadline_is_seq_writes(dd, rq))) + !deadline_is_seq_write(dd, rq))) goto out; } rq = NULL; diff -u linux-oem-6.1-6.1.0/debian.oem/abi/abiname linux-oem-6.1-6.1.0/debian.oem/abi/abiname --- linux-oem-6.1-6.1.0/debian.oem/abi/abiname +++ linux-oem-6.1-6.1.0/debian.oem/abi/abiname @@ -1 +1 @@ -1006 +1007 diff -u linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem --- linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem +++ linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem @@ -143,6 +143,7 @@ EXPORT_SYMBOL crypto/sm4 0xf4fd3bd2 crypto_sm4_sbox EXPORT_SYMBOL crypto/xor 0x5b6c00e6 xor_blocks EXPORT_SYMBOL drivers/acpi/nfit/nfit 0x06848c60 to_nfit_uuid +EXPORT_SYMBOL drivers/acpi/video 0x103735ba acpi_video_report_nolcd EXPORT_SYMBOL drivers/acpi/video 0x267e6b3f acpi_video_get_edid EXPORT_SYMBOL drivers/acpi/video 0x45b61916 acpi_video_register_backlight EXPORT_SYMBOL drivers/acpi/video 0x7a45377b acpi_video_unregister @@ -4718,16 +4719,16 @@ EXPORT_SYMBOL drivers/thermal/intel/int340x_thermal/acpi_thermal_rel 0xf0f9fe0d acpi_parse_trt EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x3357387e ufshcd_runtime_suspend EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x5edbf1a9 ufshcd_system_resume -EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x6af833cd ufshcd_alloc_host -EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x7e8ed358 ufshcd_get_local_unipro_ver -EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xbeb68e76 ufshcd_shutdown +EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x734ee460 ufshcd_shutdown +EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0x9ca04a07 ufshcd_alloc_host +EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xa35aeaa6 ufshcd_map_desc_id_to_length +EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xaa7cbf9a ufshcd_get_local_unipro_ver EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xdb5eff44 ufshcd_runtime_resume EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xed6923b5 ufshcd_system_suspend -EXPORT_SYMBOL drivers/ufs/core/ufshcd-core 0xf62d035a ufshcd_map_desc_id_to_length -EXPORT_SYMBOL drivers/ufs/host/tc-dwc-g210 0x0f779da9 tc_dwc_g210_config_20_bit -EXPORT_SYMBOL drivers/ufs/host/tc-dwc-g210 0xb64a38f1 tc_dwc_g210_config_40_bit -EXPORT_SYMBOL drivers/ufs/host/ufshcd-dwc 0xe2e5e684 ufshcd_dwc_link_startup_notify -EXPORT_SYMBOL drivers/ufs/host/ufshcd-dwc 0xf6bd39c2 ufshcd_dwc_dme_set_attrs +EXPORT_SYMBOL drivers/ufs/host/tc-dwc-g210 0x37c9a67d tc_dwc_g210_config_20_bit +EXPORT_SYMBOL drivers/ufs/host/tc-dwc-g210 0xa2b9b17a tc_dwc_g210_config_40_bit +EXPORT_SYMBOL drivers/ufs/host/ufshcd-dwc 0x9c25348c ufshcd_dwc_dme_set_attrs +EXPORT_SYMBOL drivers/ufs/host/ufshcd-dwc 0xab3e09fb ufshcd_dwc_link_startup_notify EXPORT_SYMBOL drivers/usb/class/cdc-wdm 0xf7314ddd usb_cdc_wdm_register EXPORT_SYMBOL drivers/usb/gadget/libcomposite 0x953b0353 usb_os_desc_prepare_interf_dir EXPORT_SYMBOL drivers/usb/host/sl811-hcd 0xf3ddd9de sl811h_driver @@ -6324,7 +6325,6 @@ EXPORT_SYMBOL sound/usb/snd-usbmidi-lib 0xbed43a41 snd_usbmidi_suspend EXPORT_SYMBOL sound/usb/snd-usbmidi-lib 0xd9d2bb03 snd_usbmidi_disconnect EXPORT_SYMBOL vmlinux 0x00148653 vsnprintf -EXPORT_SYMBOL vmlinux 0x0020cc34 devm_devfreq_remove_device EXPORT_SYMBOL vmlinux 0x002771ac iommu_put_resv_regions EXPORT_SYMBOL vmlinux 0x00441fd2 iter_file_splice_write EXPORT_SYMBOL vmlinux 0x004a4d97 blk_queue_max_write_zeroes_sectors @@ -6361,6 +6361,7 @@ EXPORT_SYMBOL vmlinux 0x01bf55fc paddr_vmcoreinfo_note EXPORT_SYMBOL vmlinux 0x01c24b94 generic_set_encrypted_ci_d_ops EXPORT_SYMBOL vmlinux 0x01c2e950 uart_match_port +EXPORT_SYMBOL vmlinux 0x01d58682 devm_devfreq_unregister_opp_notifier EXPORT_SYMBOL vmlinux 0x01f43009 netdev_bonding_info_change EXPORT_SYMBOL vmlinux 0x0209f3a7 secure_ipv6_port_ephemeral EXPORT_SYMBOL vmlinux 0x020dbf27 bitmap_alloc @@ -6406,6 +6407,7 @@ EXPORT_SYMBOL vmlinux 0x038ec51e xp_alloc EXPORT_SYMBOL vmlinux 0x0397edd5 fb_edid_to_monspecs EXPORT_SYMBOL vmlinux 0x0398e78b udp_ioctl +EXPORT_SYMBOL vmlinux 0x03b6d7fc devfreq_update_interval EXPORT_SYMBOL vmlinux 0x03b7735c mipi_dsi_driver_unregister EXPORT_SYMBOL vmlinux 0x03b814ca bpf_dispatcher_xdp_func EXPORT_SYMBOL vmlinux 0x03bba38b gro_cells_receive @@ -6487,6 +6489,7 @@ EXPORT_SYMBOL vmlinux 0x071961f3 security_inode_notifysecctx EXPORT_SYMBOL vmlinux 0x071af663 __dev_direct_xmit EXPORT_SYMBOL vmlinux 0x072014e3 fscrypt_ioctl_set_policy +EXPORT_SYMBOL vmlinux 0x072f1d9d devfreq_remove_device EXPORT_SYMBOL vmlinux 0x072f901c vme_master_rmw EXPORT_SYMBOL vmlinux 0x0735cdd7 pci_biosrom_size EXPORT_SYMBOL vmlinux 0x0745a981 xa_erase @@ -6548,9 +6551,11 @@ EXPORT_SYMBOL vmlinux 0x09bdbe22 security_path_mkdir EXPORT_SYMBOL vmlinux 0x09c772f0 fs_param_is_s32 EXPORT_SYMBOL vmlinux 0x09d44df9 in_lock_functions +EXPORT_SYMBOL vmlinux 0x09d81c5a devfreq_monitor_stop EXPORT_SYMBOL vmlinux 0x09da0ba4 xa_set_mark EXPORT_SYMBOL vmlinux 0x09decbcb security_path_mknod EXPORT_SYMBOL vmlinux 0x09ea6c12 devm_alloc_etherdev_mqs +EXPORT_SYMBOL vmlinux 0x0a012f73 mb_cache_entry_touch EXPORT_SYMBOL vmlinux 0x0a05b90d tty_name EXPORT_SYMBOL vmlinux 0x0a08f960 tty_port_lower_dtr_rts EXPORT_SYMBOL vmlinux 0x0a0ebc08 __xa_cmpxchg @@ -6610,7 +6615,6 @@ EXPORT_SYMBOL vmlinux 0x0ccf8a9d kernel_bind EXPORT_SYMBOL vmlinux 0x0cd5835b ipv6_flowlabel_exclusive EXPORT_SYMBOL vmlinux 0x0cdce87c rfkill_set_hw_state_reason -EXPORT_SYMBOL vmlinux 0x0ce19729 mb_cache_entry_touch EXPORT_SYMBOL vmlinux 0x0ce5326b netdev_reset_tc EXPORT_SYMBOL vmlinux 0x0ce5efb1 __tracepoint_read_msr EXPORT_SYMBOL vmlinux 0x0d030d9c nd_region_acquire_lane @@ -6843,7 +6847,6 @@ EXPORT_SYMBOL vmlinux 0x185de86a register_tcf_proto_ops EXPORT_SYMBOL vmlinux 0x18613885 sock_wake_async EXPORT_SYMBOL vmlinux 0x186f0822 netdev_lower_get_next_private_rcu -EXPORT_SYMBOL vmlinux 0x1880abe9 devm_devfreq_register_opp_notifier EXPORT_SYMBOL vmlinux 0x18888d00 downgrade_write EXPORT_SYMBOL vmlinux 0x188ea314 jiffies_to_timespec64 EXPORT_SYMBOL vmlinux 0x18aeee66 kmalloc_node_trace @@ -6858,6 +6861,7 @@ EXPORT_SYMBOL vmlinux 0x1915aac7 pcim_iounmap_regions EXPORT_SYMBOL vmlinux 0x1918e29f __dst_destroy_metrics_generic EXPORT_SYMBOL vmlinux 0x19238bff __d_drop +EXPORT_SYMBOL vmlinux 0x19253469 devfreq_add_device EXPORT_SYMBOL vmlinux 0x192ea14f __SCT__tp_func_dma_fence_signaled EXPORT_SYMBOL vmlinux 0x1953c958 mempool_create EXPORT_SYMBOL vmlinux 0x19567d06 vfio_info_cap_shift @@ -6959,6 +6963,7 @@ EXPORT_SYMBOL vmlinux 0x1e0a0c24 mod_timer_pending EXPORT_SYMBOL vmlinux 0x1e0cd7fe acpi_detach_data EXPORT_SYMBOL vmlinux 0x1e25ad43 request_firmware_into_buf +EXPORT_SYMBOL vmlinux 0x1e361511 devm_devfreq_add_device EXPORT_SYMBOL vmlinux 0x1e3b7214 blk_integrity_unregister EXPORT_SYMBOL vmlinux 0x1e64f7e9 sockopt_release_sock EXPORT_SYMBOL vmlinux 0x1e6adaa0 bitmap_print_bitmask_to_buf @@ -7079,7 +7084,6 @@ EXPORT_SYMBOL vmlinux 0x23e43bdd pnp_start_dev EXPORT_SYMBOL vmlinux 0x23e45335 scsi_remove_target EXPORT_SYMBOL vmlinux 0x23eb3f42 scsi_host_lookup -EXPORT_SYMBOL vmlinux 0x23ee13fd mb_cache_entry_find_first EXPORT_SYMBOL vmlinux 0x23f1e529 inet_add_protocol EXPORT_SYMBOL vmlinux 0x23fd3028 vmalloc_node EXPORT_SYMBOL vmlinux 0x240e51d6 __dec_zone_page_state @@ -7096,7 +7100,6 @@ EXPORT_SYMBOL vmlinux 0x24a9acc1 pcie_get_readrq EXPORT_SYMBOL vmlinux 0x24bb72ce scsi_print_sense EXPORT_SYMBOL vmlinux 0x24c7ff67 override_creds -EXPORT_SYMBOL vmlinux 0x24c9258f devfreq_unregister_notifier EXPORT_SYMBOL vmlinux 0x24d273d1 add_timer EXPORT_SYMBOL vmlinux 0x24e1b558 seg6_hmac_compute EXPORT_SYMBOL vmlinux 0x24e8ecba bpf_link_get_from_fd @@ -7133,6 +7136,7 @@ EXPORT_SYMBOL vmlinux 0x2671b892 prepare_kernel_cred EXPORT_SYMBOL vmlinux 0x26787c48 netpoll_cleanup EXPORT_SYMBOL vmlinux 0x2688ec10 bitmap_zalloc +EXPORT_SYMBOL vmlinux 0x26897b52 mb_cache_entry_get EXPORT_SYMBOL vmlinux 0x268c5f1b tcf_em_tree_validate EXPORT_SYMBOL vmlinux 0x26975708 sdev_prefix_printk EXPORT_SYMBOL vmlinux 0x269a1048 sk_mc_loop @@ -7310,6 +7314,7 @@ EXPORT_SYMBOL vmlinux 0x2e0b1deb dma_fence_get_status EXPORT_SYMBOL vmlinux 0x2e1ca751 clk_put EXPORT_SYMBOL vmlinux 0x2e255e15 seq_read_iter +EXPORT_SYMBOL vmlinux 0x2e2571d3 devfreq_resume_device EXPORT_SYMBOL vmlinux 0x2e2b40d2 strncat EXPORT_SYMBOL vmlinux 0x2e2e5b30 pcie_capability_clear_and_set_word EXPORT_SYMBOL vmlinux 0x2e33e145 __vfs_removexattr @@ -7474,7 +7479,6 @@ EXPORT_SYMBOL vmlinux 0x3539f11b match_strlcpy EXPORT_SYMBOL vmlinux 0x354460c6 netpoll_poll_dev EXPORT_SYMBOL vmlinux 0x354b4a1e acpi_ut_trace -EXPORT_SYMBOL vmlinux 0x3556e693 __mb_cache_entry_free EXPORT_SYMBOL vmlinux 0x355b3ffc dev_mc_init EXPORT_SYMBOL vmlinux 0x356461c8 rtc_time64_to_tm EXPORT_SYMBOL vmlinux 0x35a88f28 zlib_inflateInit2 @@ -7669,6 +7673,7 @@ EXPORT_SYMBOL vmlinux 0x3d371380 may_umount_tree EXPORT_SYMBOL vmlinux 0x3d3c9b59 padata_set_cpumask EXPORT_SYMBOL vmlinux 0x3d518434 bpf_map_get +EXPORT_SYMBOL vmlinux 0x3d664a18 devfreq_register_notifier EXPORT_SYMBOL vmlinux 0x3d66c551 bdi_alloc EXPORT_SYMBOL vmlinux 0x3d9774aa may_setattr EXPORT_SYMBOL vmlinux 0x3da15465 __scsi_device_lookup_by_target @@ -7825,7 +7830,6 @@ EXPORT_SYMBOL vmlinux 0x44469a76 crc_ccitt_false_table EXPORT_SYMBOL vmlinux 0x4462d35e cpufreq_get_hw_max_freq EXPORT_SYMBOL vmlinux 0x447ef84d __tracepoint_kmem_cache_alloc -EXPORT_SYMBOL vmlinux 0x447f87ad devm_devfreq_add_governor EXPORT_SYMBOL vmlinux 0x448df6c0 dma_resv_iter_first_unlocked EXPORT_SYMBOL vmlinux 0x44902cff acpi_enable_event EXPORT_SYMBOL vmlinux 0x44951115 md_integrity_register @@ -7865,6 +7869,7 @@ EXPORT_SYMBOL vmlinux 0x4629ed32 kobject_get_unless_zero EXPORT_SYMBOL vmlinux 0x463cbcd1 simple_dentry_operations EXPORT_SYMBOL vmlinux 0x46451cee zstd_get_frame_header +EXPORT_SYMBOL vmlinux 0x464a66a3 devfreq_monitor_resume EXPORT_SYMBOL vmlinux 0x465c7b4b vlan_dev_vlan_id EXPORT_SYMBOL vmlinux 0x465e24ff ucs2_utf8size EXPORT_SYMBOL vmlinux 0x466c14a7 __delay @@ -7895,7 +7900,6 @@ EXPORT_SYMBOL vmlinux 0x47816be2 pcie_get_width_cap EXPORT_SYMBOL vmlinux 0x478e0392 phy_device_remove EXPORT_SYMBOL vmlinux 0x47960bc4 proc_do_large_bitmap -EXPORT_SYMBOL vmlinux 0x47a0cdcb mb_cache_entry_find_next EXPORT_SYMBOL vmlinux 0x47b7f076 param_ops_bint EXPORT_SYMBOL vmlinux 0x47c20f8a refcount_dec_not_one EXPORT_SYMBOL vmlinux 0x47c65bfc unregister_inet6addr_validator_notifier @@ -7906,8 +7910,10 @@ EXPORT_SYMBOL vmlinux 0x47e14081 ether_setup EXPORT_SYMBOL vmlinux 0x47e196a3 nf_hook_slow_list EXPORT_SYMBOL vmlinux 0x47f2e54e fault_in_iov_iter_readable +EXPORT_SYMBOL vmlinux 0x47fb864c devfreq_register_opp_notifier EXPORT_SYMBOL vmlinux 0x47fd8c8f pci_get_subsys EXPORT_SYMBOL vmlinux 0x48112d76 _raw_read_lock_irq +EXPORT_SYMBOL vmlinux 0x481814c4 mb_cache_entry_find_next EXPORT_SYMBOL vmlinux 0x48193639 acpi_lid_open EXPORT_SYMBOL vmlinux 0x4826969b nf_register_net_hooks EXPORT_SYMBOL vmlinux 0x4829a9e0 simple_empty @@ -7954,7 +7960,6 @@ EXPORT_SYMBOL vmlinux 0x49bdbfb6 __phy_write_mmd EXPORT_SYMBOL vmlinux 0x4a168c43 zap_page_range EXPORT_SYMBOL vmlinux 0x4a1fe2a0 from_kuid -EXPORT_SYMBOL vmlinux 0x4a2b0b6c devfreq_resume_device EXPORT_SYMBOL vmlinux 0x4a3ad70e wait_for_completion_timeout EXPORT_SYMBOL vmlinux 0x4a3fbfca phy_modify_paged_changed EXPORT_SYMBOL vmlinux 0x4a453f53 iowrite32 @@ -7989,6 +7994,7 @@ EXPORT_SYMBOL vmlinux 0x4bcc2662 mempool_init_node EXPORT_SYMBOL vmlinux 0x4bcfe1c6 __bforget EXPORT_SYMBOL vmlinux 0x4bef1c67 empty_name +EXPORT_SYMBOL vmlinux 0x4bf42efc devfreq_update_status EXPORT_SYMBOL vmlinux 0x4bff273e pmem_sector_size EXPORT_SYMBOL vmlinux 0x4c07a7e0 acpi_processor_unregister_performance EXPORT_SYMBOL vmlinux 0x4c08c499 blk_mq_tagset_busy_iter @@ -8108,8 +8114,10 @@ EXPORT_SYMBOL vmlinux 0x50944630 seq_list_start_head_rcu EXPORT_SYMBOL vmlinux 0x509b64ea acpi_has_method EXPORT_SYMBOL vmlinux 0x50a4698c fb_videomode_to_modelist +EXPORT_SYMBOL vmlinux 0x50ac23c8 update_devfreq EXPORT_SYMBOL vmlinux 0x50b69805 fib_notifier_ops_register EXPORT_SYMBOL vmlinux 0x50b73ce2 rfkill_find_type +EXPORT_SYMBOL vmlinux 0x50b80992 mb_cache_entry_find_first EXPORT_SYMBOL vmlinux 0x50be3b37 sched_autogroup_create_attach EXPORT_SYMBOL vmlinux 0x50be748d security_ib_free_security EXPORT_SYMBOL vmlinux 0x50c76126 sock_recvmsg @@ -8313,6 +8321,7 @@ EXPORT_SYMBOL vmlinux 0x5a0b73d0 zlib_deflateInit2 EXPORT_SYMBOL vmlinux 0x5a0f70fd locks_delete_block EXPORT_SYMBOL vmlinux 0x5a1c82ca mdio_device_register +EXPORT_SYMBOL vmlinux 0x5a25a2d6 devfreq_unregister_opp_notifier EXPORT_SYMBOL vmlinux 0x5a26de5f dev_mc_del_global EXPORT_SYMBOL vmlinux 0x5a290250 hdmi_drm_infoframe_pack_only EXPORT_SYMBOL vmlinux 0x5a3c801a blk_pre_runtime_resume @@ -8452,7 +8461,6 @@ EXPORT_SYMBOL vmlinux 0x601f665f dm_io_client_create EXPORT_SYMBOL vmlinux 0x60352082 register_inet6addr_notifier EXPORT_SYMBOL vmlinux 0x603803b1 pskb_extract -EXPORT_SYMBOL vmlinux 0x60578046 inet_twsk_deschedule_put EXPORT_SYMBOL vmlinux 0x605790dc fiemap_fill_next_extent EXPORT_SYMBOL vmlinux 0x606c631f blk_mq_init_queue EXPORT_SYMBOL vmlinux 0x606f30e4 pps_event @@ -8472,6 +8480,7 @@ EXPORT_SYMBOL vmlinux 0x61073e4a acpi_os_map_generic_address EXPORT_SYMBOL vmlinux 0x6118fc58 kill_block_super EXPORT_SYMBOL vmlinux 0x6128b5fc __printk_ratelimit +EXPORT_SYMBOL vmlinux 0x61347034 mb_cache_entry_delete_or_get EXPORT_SYMBOL vmlinux 0x615911d7 __bitmap_set EXPORT_SYMBOL vmlinux 0x61619df4 agp_copy_info EXPORT_SYMBOL vmlinux 0x6164afe8 km_new_mapping @@ -8523,6 +8532,7 @@ EXPORT_SYMBOL vmlinux 0x62fa704a fs_param_is_fd EXPORT_SYMBOL vmlinux 0x6301c01a generic_permission EXPORT_SYMBOL vmlinux 0x6309be36 fscrypt_free_inode +EXPORT_SYMBOL vmlinux 0x63150715 devm_devfreq_unregister_notifier EXPORT_SYMBOL vmlinux 0x63187451 pcie_aspm_support_enabled EXPORT_SYMBOL vmlinux 0x631d06aa cpu_rmap_put EXPORT_SYMBOL vmlinux 0x6327a5fb blk_queue_max_segments @@ -8565,7 +8575,6 @@ EXPORT_SYMBOL vmlinux 0x648d24ee regset_get_alloc EXPORT_SYMBOL vmlinux 0x648eb59d gc_inflight_list EXPORT_SYMBOL vmlinux 0x649eda35 dma_mmap_attrs -EXPORT_SYMBOL vmlinux 0x64a68aea devfreq_monitor_stop EXPORT_SYMBOL vmlinux 0x64a9c928 default_blu EXPORT_SYMBOL vmlinux 0x64b28961 netdev_err EXPORT_SYMBOL vmlinux 0x64b7e45b key_payload_reserve @@ -8577,7 +8586,6 @@ EXPORT_SYMBOL vmlinux 0x64e0617a setattr_copy EXPORT_SYMBOL vmlinux 0x64efe748 skb_clone_sk EXPORT_SYMBOL vmlinux 0x64f2c65a inet_stream_ops -EXPORT_SYMBOL vmlinux 0x64fb59b8 devm_devfreq_register_notifier EXPORT_SYMBOL vmlinux 0x64ffa184 bdev_check_media_change EXPORT_SYMBOL vmlinux 0x650d9f70 param_set_bool EXPORT_SYMBOL vmlinux 0x6513a3fa fb_get_color_depth @@ -8708,7 +8716,6 @@ EXPORT_SYMBOL vmlinux 0x6a03751f sgl_free_order EXPORT_SYMBOL vmlinux 0x6a037cf1 mempool_kfree EXPORT_SYMBOL vmlinux 0x6a1021f1 km_policy_expired -EXPORT_SYMBOL vmlinux 0x6a1101c8 devfreq_remove_governor EXPORT_SYMBOL vmlinux 0x6a140efc qdisc_hash_del EXPORT_SYMBOL vmlinux 0x6a167d5d neigh_seq_stop EXPORT_SYMBOL vmlinux 0x6a261b78 irq_stat @@ -8834,7 +8841,6 @@ EXPORT_SYMBOL vmlinux 0x6f5bd908 bio_copy_data EXPORT_SYMBOL vmlinux 0x6f65cd15 inet_accept EXPORT_SYMBOL vmlinux 0x6f7f833c end_page_writeback -EXPORT_SYMBOL vmlinux 0x6f8b5379 devfreq_add_governor EXPORT_SYMBOL vmlinux 0x6f915a45 dqstats EXPORT_SYMBOL vmlinux 0x6f9347fc fb_set_var EXPORT_SYMBOL vmlinux 0x6f955a49 pci_stop_and_remove_bus_device @@ -9073,6 +9079,7 @@ EXPORT_SYMBOL vmlinux 0x7a95e5ae do_settimeofday64 EXPORT_SYMBOL vmlinux 0x7aa1756e kvfree EXPORT_SYMBOL vmlinux 0x7abab516 netlink_broadcast +EXPORT_SYMBOL vmlinux 0x7ac23e45 fs_lookup_param EXPORT_SYMBOL vmlinux 0x7ac6f9b1 pid_task EXPORT_SYMBOL vmlinux 0x7ad050b9 qid_lt EXPORT_SYMBOL vmlinux 0x7adc0fbf rb_replace_node_rcu @@ -9095,6 +9102,7 @@ EXPORT_SYMBOL vmlinux 0x7b5fe307 input_set_abs_params EXPORT_SYMBOL vmlinux 0x7b626084 pci_unregister_driver EXPORT_SYMBOL vmlinux 0x7b6feba9 phy_validate_pause +EXPORT_SYMBOL vmlinux 0x7b76e529 devfreq_suspend_device EXPORT_SYMBOL vmlinux 0x7b82b9a1 idr_replace EXPORT_SYMBOL vmlinux 0x7bb50b88 acpi_write EXPORT_SYMBOL vmlinux 0x7bbccd05 nr_node_ids @@ -9192,14 +9200,12 @@ EXPORT_SYMBOL vmlinux 0x8064706a input_get_poll_interval EXPORT_SYMBOL vmlinux 0x806ca46d dquot_load_quota_sb EXPORT_SYMBOL vmlinux 0x806e616c call_fib_notifiers -EXPORT_SYMBOL vmlinux 0x8083bfc5 devfreq_remove_device EXPORT_SYMBOL vmlinux 0x80931981 __tracepoint_dma_fence_signaled EXPORT_SYMBOL vmlinux 0x809712ff hdmi_avi_infoframe_pack EXPORT_SYMBOL vmlinux 0x809e4d50 skb_copy_expand EXPORT_SYMBOL vmlinux 0x80a15b22 devm_memremap EXPORT_SYMBOL vmlinux 0x80a717a8 __percpu_counter_compare EXPORT_SYMBOL vmlinux 0x80b3c546 dev_uc_init -EXPORT_SYMBOL vmlinux 0x80c55d5e devfreq_unregister_opp_notifier EXPORT_SYMBOL vmlinux 0x80ca5026 _bin2bcd EXPORT_SYMBOL vmlinux 0x80ce7a93 i2c_put_adapter EXPORT_SYMBOL vmlinux 0x80d68d3e fb_register_client @@ -9258,7 +9264,6 @@ EXPORT_SYMBOL vmlinux 0x83466629 fbcon_update_vcs EXPORT_SYMBOL vmlinux 0x83552c7c phy_ethtool_get_stats EXPORT_SYMBOL vmlinux 0x83581089 gf128mul_init_4k_lle -EXPORT_SYMBOL vmlinux 0x836d40ec devm_devfreq_add_device EXPORT_SYMBOL vmlinux 0x8370bf8f set_security_override EXPORT_SYMBOL vmlinux 0x838d2bc8 siphash_3u32 EXPORT_SYMBOL vmlinux 0x83927a69 pci_reenable_device @@ -9438,6 +9443,7 @@ EXPORT_SYMBOL vmlinux 0x8bd3565e dev_open EXPORT_SYMBOL vmlinux 0x8bd577d0 acpi_ut_exit EXPORT_SYMBOL vmlinux 0x8bda2670 twl6040_set_pll +EXPORT_SYMBOL vmlinux 0x8bdfc47c __mb_cache_entry_free EXPORT_SYMBOL vmlinux 0x8bfdecd1 fwnode_graph_parse_endpoint EXPORT_SYMBOL vmlinux 0x8c03f866 inet6_add_protocol EXPORT_SYMBOL vmlinux 0x8c0c055d alloc_fddidev @@ -9511,6 +9517,7 @@ EXPORT_SYMBOL vmlinux 0x8f17e63e pci_bus_read_dev_vendor_id EXPORT_SYMBOL vmlinux 0x8f24488a jbd2_transaction_committed EXPORT_SYMBOL vmlinux 0x8f2703b7 wbinvd_on_all_cpus +EXPORT_SYMBOL vmlinux 0x8f3b596a devfreq_monitor_start EXPORT_SYMBOL vmlinux 0x8f568f65 dev_get_by_name EXPORT_SYMBOL vmlinux 0x8f635426 blkdev_get_by_path EXPORT_SYMBOL vmlinux 0x8f7b7935 crypto_sha256_update @@ -9730,7 +9737,6 @@ EXPORT_SYMBOL vmlinux 0x99002c72 rproc_coredump_add_segment EXPORT_SYMBOL vmlinux 0x9904e111 __tracepoint_spi_transfer_start EXPORT_SYMBOL vmlinux 0x99078b39 trace_print_flags_seq -EXPORT_SYMBOL vmlinux 0x990c0fe6 devfreq_suspend_device EXPORT_SYMBOL vmlinux 0x99117762 inc_nlink EXPORT_SYMBOL vmlinux 0x9917133c dma_sync_wait EXPORT_SYMBOL vmlinux 0x991ad0a6 tty_register_driver @@ -9757,7 +9763,6 @@ EXPORT_SYMBOL vmlinux 0x9a1dfd65 strpbrk EXPORT_SYMBOL vmlinux 0x9a22391e radix_tree_gang_lookup_tag_slot EXPORT_SYMBOL vmlinux 0x9a2b4daf dev_loopback_xmit -EXPORT_SYMBOL vmlinux 0x9a30466a update_devfreq EXPORT_SYMBOL vmlinux 0x9a36bbc8 sg_alloc_table_from_pages_segment EXPORT_SYMBOL vmlinux 0x9a583306 netlbl_bitmap_walk EXPORT_SYMBOL vmlinux 0x9a7154e8 jbd2_submit_inode_data @@ -9791,7 +9796,6 @@ EXPORT_SYMBOL vmlinux 0x9c0bd2a2 jbd2_journal_unlock_updates EXPORT_SYMBOL vmlinux 0x9c0e1eb5 eth_header_parse EXPORT_SYMBOL vmlinux 0x9c122bcf mempool_create_node -EXPORT_SYMBOL vmlinux 0x9c14bf55 fs_lookup_param EXPORT_SYMBOL vmlinux 0x9c254494 skb_coalesce_rx_frag EXPORT_SYMBOL vmlinux 0x9c3e6d5d msi_desc_to_pci_dev EXPORT_SYMBOL vmlinux 0x9c50a057 pci_enable_msix_range @@ -9822,10 +9826,10 @@ EXPORT_SYMBOL vmlinux 0x9d3d6916 jbd2_trans_will_send_data_barrier EXPORT_SYMBOL vmlinux 0x9d604e3f jbd2_journal_free_reserved EXPORT_SYMBOL vmlinux 0x9d61e994 ucs2_strncmp -EXPORT_SYMBOL vmlinux 0x9d6b0742 devfreq_monitor_start EXPORT_SYMBOL vmlinux 0x9d6cc733 kern_path EXPORT_SYMBOL vmlinux 0x9d70541a native_save_fl EXPORT_SYMBOL vmlinux 0x9d7f75b7 __set_page_dirty_nobuffers +EXPORT_SYMBOL vmlinux 0x9d8b95a9 devm_devfreq_register_opp_notifier EXPORT_SYMBOL vmlinux 0x9d926c6c mmc_cqe_post_req EXPORT_SYMBOL vmlinux 0x9d92f3ad __wait_on_bit_lock EXPORT_SYMBOL vmlinux 0x9d97ab2c audit_log_object_context @@ -9869,7 +9873,6 @@ EXPORT_SYMBOL vmlinux 0x9f4f2aa3 acpi_gbl_FADT EXPORT_SYMBOL vmlinux 0x9f50b770 keyring_restrict EXPORT_SYMBOL vmlinux 0x9f54ead7 gro_cells_destroy -EXPORT_SYMBOL vmlinux 0x9f5b4063 devfreq_add_device EXPORT_SYMBOL vmlinux 0x9f61e048 proc_symlink EXPORT_SYMBOL vmlinux 0x9f76baf4 _raw_write_unlock_irq EXPORT_SYMBOL vmlinux 0x9f88f6fa __netdev_notify_peers @@ -9990,6 +9993,7 @@ EXPORT_SYMBOL vmlinux 0xa4a03fe6 phy_ethtool_set_link_ksettings EXPORT_SYMBOL vmlinux 0xa4b94fea iowrite8_rep EXPORT_SYMBOL vmlinux 0xa4c8f0bd xfrm_state_free +EXPORT_SYMBOL vmlinux 0xa4ce6baa devfreq_update_target EXPORT_SYMBOL vmlinux 0xa4d4f0e6 global_cache_flush EXPORT_SYMBOL vmlinux 0xa4edf5a9 vme_irq_generate EXPORT_SYMBOL vmlinux 0xa4faf62a acpi_disable_gpe @@ -10057,7 +10061,6 @@ EXPORT_SYMBOL vmlinux 0xa7d5f92e ida_destroy EXPORT_SYMBOL vmlinux 0xa7dd1e04 genphy_restart_aneg EXPORT_SYMBOL vmlinux 0xa7eedcc4 call_usermodehelper -EXPORT_SYMBOL vmlinux 0xa7f7fad1 devfreq_monitor_resume EXPORT_SYMBOL vmlinux 0xa805ecfc acpi_release_global_lock EXPORT_SYMBOL vmlinux 0xa8181adf proc_dointvec EXPORT_SYMBOL vmlinux 0xa81b3a21 sync_blockdev @@ -10072,7 +10075,6 @@ EXPORT_SYMBOL vmlinux 0xa8590f3a simple_transaction_read EXPORT_SYMBOL vmlinux 0xa85a3e6d xa_load EXPORT_SYMBOL vmlinux 0xa8694ecd kblockd_schedule_work -EXPORT_SYMBOL vmlinux 0xa8760203 devfreq_register_notifier EXPORT_SYMBOL vmlinux 0xa896c0b5 __SetPageMovable EXPORT_SYMBOL vmlinux 0xa897e3e7 mempool_free EXPORT_SYMBOL vmlinux 0xa89a1cf1 ipmi_dmi_get_slave_addr @@ -10143,6 +10145,7 @@ EXPORT_SYMBOL vmlinux 0xab65ed80 set_memory_uc EXPORT_SYMBOL vmlinux 0xab67a0ac dql_init EXPORT_SYMBOL vmlinux 0xab6d5b3b hex_to_bin +EXPORT_SYMBOL vmlinux 0xab70984e inet_twsk_deschedule_put EXPORT_SYMBOL vmlinux 0xab77eb01 simple_transaction_set EXPORT_SYMBOL vmlinux 0xab781570 fb_get_options EXPORT_SYMBOL vmlinux 0xab7f0605 dma_resv_fini @@ -10162,7 +10165,6 @@ EXPORT_SYMBOL vmlinux 0xac5fcec0 in4_pton EXPORT_SYMBOL vmlinux 0xac779618 md_done_sync EXPORT_SYMBOL vmlinux 0xac82f3d7 folio_mapped -EXPORT_SYMBOL vmlinux 0xac8597d5 mb_cache_entry_get EXPORT_SYMBOL vmlinux 0xacaa4c72 dma_fence_match_context EXPORT_SYMBOL vmlinux 0xacab29b7 seq_hlist_start_percpu EXPORT_SYMBOL vmlinux 0xacae88ac dquot_quotactl_sysfile_ops @@ -10207,7 +10209,6 @@ EXPORT_SYMBOL vmlinux 0xae36250e vlan_ioctl_set EXPORT_SYMBOL vmlinux 0xae3aa710 page_pool_alloc_pages EXPORT_SYMBOL vmlinux 0xae5a04bb acpi_evaluate_dsm -EXPORT_SYMBOL vmlinux 0xae7e6cdd tcp_timewait_state_process EXPORT_SYMBOL vmlinux 0xae828e32 param_get_dyndbg_classes EXPORT_SYMBOL vmlinux 0xae9605b8 inode_nohighmem EXPORT_SYMBOL vmlinux 0xae9e749d n_tty_ioctl_helper @@ -10442,6 +10443,7 @@ EXPORT_SYMBOL vmlinux 0xb7c6db70 sysctl_max_skb_frags EXPORT_SYMBOL vmlinux 0xb7cd240f iov_iter_get_pages_alloc2 EXPORT_SYMBOL vmlinux 0xb7d3a13d udp_sk_rx_dst_set +EXPORT_SYMBOL vmlinux 0xb7e6a450 devm_devfreq_register_notifier EXPORT_SYMBOL vmlinux 0xb816ffe9 padata_do_parallel EXPORT_SYMBOL vmlinux 0xb81f8dbe pm860x_page_reg_write EXPORT_SYMBOL vmlinux 0xb823b83c crypto_sha1_update @@ -10507,6 +10509,7 @@ EXPORT_SYMBOL vmlinux 0xbb24f607 init_cdrom_command EXPORT_SYMBOL vmlinux 0xbb29e224 vif_device_init EXPORT_SYMBOL vmlinux 0xbb2af3bf phy_attached_print +EXPORT_SYMBOL vmlinux 0xbb43ef10 devfreq_add_governor EXPORT_SYMBOL vmlinux 0xbb47ef4c free_cgroup_ns EXPORT_SYMBOL vmlinux 0xbb4aeade path_get EXPORT_SYMBOL vmlinux 0xbb4f4766 simple_write_to_buffer @@ -10622,6 +10625,7 @@ EXPORT_SYMBOL vmlinux 0xc103922e bio_uninit EXPORT_SYMBOL vmlinux 0xc11002c4 kernel_read EXPORT_SYMBOL vmlinux 0xc1198662 __warn_flushing_systemwide_wq +EXPORT_SYMBOL vmlinux 0xc11c6e30 devfreq_unregister_notifier EXPORT_SYMBOL vmlinux 0xc12f37f8 _copy_from_iter_nocache EXPORT_SYMBOL vmlinux 0xc1365323 acpi_enable_all_wakeup_gpes EXPORT_SYMBOL vmlinux 0xc139a410 filemap_alloc_folio @@ -10644,7 +10648,6 @@ EXPORT_SYMBOL vmlinux 0xc1eaaaa4 pci_fixup_device EXPORT_SYMBOL vmlinux 0xc1f4c852 __lock_sock_fast EXPORT_SYMBOL vmlinux 0xc21ae620 jbd2_journal_begin_ordered_truncate -EXPORT_SYMBOL vmlinux 0xc226b040 mb_cache_entry_delete_or_get EXPORT_SYMBOL vmlinux 0xc232f97d folio_migrate_mapping EXPORT_SYMBOL vmlinux 0xc23b5aa8 vfs_iter_read EXPORT_SYMBOL vmlinux 0xc2424641 agp3_generic_cleanup @@ -10782,12 +10785,10 @@ EXPORT_SYMBOL vmlinux 0xc7c1107a LZ4_decompress_safe EXPORT_SYMBOL vmlinux 0xc7d094b5 dm_read_arg_group EXPORT_SYMBOL vmlinux 0xc7e3ebef tcf_exts_dump_stats -EXPORT_SYMBOL vmlinux 0xc7e40dfc devm_devfreq_unregister_opp_notifier EXPORT_SYMBOL vmlinux 0xc7ec46e3 mr_rtm_dumproute EXPORT_SYMBOL vmlinux 0xc804208c sock_i_uid EXPORT_SYMBOL vmlinux 0xc806d7f9 pci_read_vpd_any EXPORT_SYMBOL vmlinux 0xc80ab559 swake_up_one -EXPORT_SYMBOL vmlinux 0xc8199c23 devfreq_register_opp_notifier EXPORT_SYMBOL vmlinux 0xc832c443 fsync_bdev EXPORT_SYMBOL vmlinux 0xc839afed hdmi_audio_infoframe_check EXPORT_SYMBOL vmlinux 0xc841c92d vlan_filter_drop_vids @@ -10816,7 +10817,6 @@ EXPORT_SYMBOL vmlinux 0xc9634df9 in6addr_linklocal_allrouters EXPORT_SYMBOL vmlinux 0xc96e0e27 tty_port_put EXPORT_SYMBOL vmlinux 0xc972449f mempool_alloc_slab -EXPORT_SYMBOL vmlinux 0xc980d1fa devfreq_get_freq_range EXPORT_SYMBOL vmlinux 0xc98196c8 scsi_test_unit_ready EXPORT_SYMBOL vmlinux 0xc9822234 clk_register_clkdev EXPORT_SYMBOL vmlinux 0xc99d7999 blk_mq_end_request @@ -10870,7 +10870,6 @@ EXPORT_SYMBOL vmlinux 0xcbd45600 remap_pfn_range EXPORT_SYMBOL vmlinux 0xcbd4898c fortify_panic EXPORT_SYMBOL vmlinux 0xcbd842d4 __fput_sync -EXPORT_SYMBOL vmlinux 0xcbd913f1 devfreq_update_interval EXPORT_SYMBOL vmlinux 0xcbe3461d bpf_prog_get_type_path EXPORT_SYMBOL vmlinux 0xcbfb33e4 init_opal_dev EXPORT_SYMBOL vmlinux 0xcc0eb025 vfs_getattr_nosec @@ -10897,7 +10896,6 @@ EXPORT_SYMBOL vmlinux 0xccf47f30 tcf_block_put EXPORT_SYMBOL vmlinux 0xccfb9e07 dst_default_metrics EXPORT_SYMBOL vmlinux 0xccfd2ebc scsi_dev_info_list_del_keyed -EXPORT_SYMBOL vmlinux 0xccff402f devfreq_update_status EXPORT_SYMBOL vmlinux 0xcd01b8e6 acpi_attach_data EXPORT_SYMBOL vmlinux 0xcd02d25c fwnode_phy_find_device EXPORT_SYMBOL vmlinux 0xcd0a51d4 block_read_full_folio @@ -11073,6 +11071,7 @@ EXPORT_SYMBOL vmlinux 0xd5346bfc acpi_get_possible_resources EXPORT_SYMBOL vmlinux 0xd53a0dc7 get_watch_queue EXPORT_SYMBOL vmlinux 0xd53f07ba phy_attached_info_irq +EXPORT_SYMBOL vmlinux 0xd5478307 devfreq_get_freq_range EXPORT_SYMBOL vmlinux 0xd54cb790 netdev_set_sb_channel EXPORT_SYMBOL vmlinux 0xd55143dc adjust_managed_page_count EXPORT_SYMBOL vmlinux 0xd570d9d5 i2c_add_adapter @@ -11101,6 +11100,7 @@ EXPORT_SYMBOL vmlinux 0xd6b33026 cpu_khz EXPORT_SYMBOL vmlinux 0xd6b454ca devm_get_clk_from_child EXPORT_SYMBOL vmlinux 0xd6b9dcf9 blk_queue_virt_boundary +EXPORT_SYMBOL vmlinux 0xd6c5a994 devfreq_monitor_suspend EXPORT_SYMBOL vmlinux 0xd6e1cfe5 inet_get_local_port_range EXPORT_SYMBOL vmlinux 0xd6eaaea1 full_name_hash EXPORT_SYMBOL vmlinux 0xd6eda864 gro_find_complete_by_type @@ -11223,6 +11223,7 @@ EXPORT_SYMBOL vmlinux 0xdcdc0040 slhc_compress EXPORT_SYMBOL vmlinux 0xdcfe043b sock_no_sendpage_locked EXPORT_SYMBOL vmlinux 0xdd00447a acpi_resource_to_address64 +EXPORT_SYMBOL vmlinux 0xdd0fbd6f tcp_timewait_state_process EXPORT_SYMBOL vmlinux 0xdd114e0d mipi_dsi_dcs_set_display_on EXPORT_SYMBOL vmlinux 0xdd18a993 acpi_check_dsm EXPORT_SYMBOL vmlinux 0xdd2c169b mb_cache_create @@ -11391,6 +11392,7 @@ EXPORT_SYMBOL vmlinux 0xe4bc2c2f hdmi_drm_infoframe_pack EXPORT_SYMBOL vmlinux 0xe4c454ee locks_free_lock EXPORT_SYMBOL vmlinux 0xe4c9448f sock_no_sendpage +EXPORT_SYMBOL vmlinux 0xe4cf7078 devm_devfreq_add_governor EXPORT_SYMBOL vmlinux 0xe4d4c916 register_mii_tstamp_controller EXPORT_SYMBOL vmlinux 0xe4d80bf4 acpi_enable EXPORT_SYMBOL vmlinux 0xe4e0117e input_set_timestamp @@ -11427,7 +11429,6 @@ EXPORT_SYMBOL vmlinux 0xe5ae6ece sget EXPORT_SYMBOL vmlinux 0xe5c60bd2 percpu_counter_set EXPORT_SYMBOL vmlinux 0xe5c78a99 do_blank_screen -EXPORT_SYMBOL vmlinux 0xe5ce9fdd devfreq_monitor_suspend EXPORT_SYMBOL vmlinux 0xe5d720cf __skb_gro_checksum_complete EXPORT_SYMBOL vmlinux 0xe5eb05d6 ww_mutex_unlock EXPORT_SYMBOL vmlinux 0xe5eb4c32 sock_set_priority @@ -11498,7 +11499,6 @@ EXPORT_SYMBOL vmlinux 0xe909997a bitmap_print_list_to_buf EXPORT_SYMBOL vmlinux 0xe914e41e strcpy EXPORT_SYMBOL vmlinux 0xe92515e4 ethtool_rx_flow_rule_create -EXPORT_SYMBOL vmlinux 0xe92d3a18 devm_devfreq_unregister_notifier EXPORT_SYMBOL vmlinux 0xe9485c53 pcibios_bus_to_resource EXPORT_SYMBOL vmlinux 0xe953b21f get_next_ino EXPORT_SYMBOL vmlinux 0xe956719a pm860x_set_bits @@ -11721,6 +11721,7 @@ EXPORT_SYMBOL vmlinux 0xf3889797 clk_bulk_get EXPORT_SYMBOL vmlinux 0xf390f6f1 __bitmap_andnot EXPORT_SYMBOL vmlinux 0xf3916987 global_cursor_default +EXPORT_SYMBOL vmlinux 0xf3932313 mb_cache_entry_wait_unused EXPORT_SYMBOL vmlinux 0xf396f5cd __dev_get_by_name EXPORT_SYMBOL vmlinux 0xf3a025ac xfrm_trans_queue_net EXPORT_SYMBOL vmlinux 0xf3a57892 release_dentry_name_snapshot @@ -11776,8 +11777,10 @@ EXPORT_SYMBOL vmlinux 0xf5f4f5c1 sk_stream_wait_memory EXPORT_SYMBOL vmlinux 0xf5f5425c phy_loopback EXPORT_SYMBOL vmlinux 0xf60ab926 acpi_get_event_status +EXPORT_SYMBOL vmlinux 0xf6314a2d devfreq_remove_governor EXPORT_SYMBOL vmlinux 0xf643d104 hsiphash_4u32 EXPORT_SYMBOL vmlinux 0xf65ce913 give_up_console +EXPORT_SYMBOL vmlinux 0xf65f7a7c devm_devfreq_remove_device EXPORT_SYMBOL vmlinux 0xf6625612 file_open_root EXPORT_SYMBOL vmlinux 0xf665f74f sock_load_diag_module EXPORT_SYMBOL vmlinux 0xf66829cc dquot_release @@ -11828,6 +11831,7 @@ EXPORT_SYMBOL vmlinux 0xf8d07858 bitmap_from_arr32 EXPORT_SYMBOL vmlinux 0xf8d2bc2c zstd_find_frame_compressed_size EXPORT_SYMBOL vmlinux 0xf8e0f0cc genphy_update_link +EXPORT_SYMBOL vmlinux 0xf8efc1d9 mptcp_subflow_reqsk_alloc EXPORT_SYMBOL vmlinux 0xf8f064b6 __inet6_lookup_established EXPORT_SYMBOL vmlinux 0xf8f61ebc wake_up_var EXPORT_SYMBOL vmlinux 0xf902b978 mount_single @@ -11848,11 +11852,9 @@ EXPORT_SYMBOL vmlinux 0xf98fc1d3 phy_set_sym_pause EXPORT_SYMBOL vmlinux 0xf9a482f9 msleep EXPORT_SYMBOL vmlinux 0xf9adaa6f dma_async_device_register -EXPORT_SYMBOL vmlinux 0xf9be270f mb_cache_entry_wait_unused EXPORT_SYMBOL vmlinux 0xf9c0b663 strlcat EXPORT_SYMBOL vmlinux 0xf9c953e2 tcp_simple_retransmit EXPORT_SYMBOL vmlinux 0xf9ca2eb4 kstrtoint_from_user -EXPORT_SYMBOL vmlinux 0xf9f346d8 devfreq_update_target EXPORT_SYMBOL vmlinux 0xfa000485 vme_bus_type EXPORT_SYMBOL vmlinux 0xfa0010f8 tcf_idr_cleanup EXPORT_SYMBOL vmlinux 0xfa042227 gnet_stats_add_basic @@ -11894,6 +11896,7 @@ EXPORT_SYMBOL vmlinux 0xfb7c38b5 kern_unmount EXPORT_SYMBOL vmlinux 0xfb9a4497 mmc_register_driver EXPORT_SYMBOL vmlinux 0xfba3c0a4 devm_input_allocate_device +EXPORT_SYMBOL vmlinux 0xfba7a5f5 __get_random_u32_below EXPORT_SYMBOL vmlinux 0xfba7ddd2 match_u64 EXPORT_SYMBOL vmlinux 0xfbaaf01e console_lock EXPORT_SYMBOL vmlinux 0xfbab1bb1 ioread8_rep @@ -17027,35 +17030,35 @@ EXPORT_SYMBOL_GPL drivers/thunderbolt/thunderbolt 0xf1cfd1ff tb_register_property_dir EXPORT_SYMBOL_GPL drivers/thunderbolt/thunderbolt 0xf5ce1c49 tb_xdomain_find_by_uuid EXPORT_SYMBOL_GPL drivers/thunderbolt/thunderbolt 0xf76028c7 tb_unregister_protocol_handler -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x19f23061 ufshcd_uic_hibern8_enter -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x2d45ff24 ufshcd_hold +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x0afc5e57 ufshcd_update_evt_hist +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x0f161cba ufshcd_auto_hibern8_update +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x1bc965bf ufshcd_fixup_dev_quirks +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x22151fa9 ufshcd_hold +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x22d6478d ufshcd_hba_stop EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x2f8d81f1 ufshcd_clkgate_delay_set -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x2fc65d8e ufshcd_uic_hibern8_exit -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x40e6b25c ufshcd_dump_regs +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x3238817b ufshcd_init EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x44e49fa0 ufshcd_suspend_prepare -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x4efec16f ufshcd_make_hba_operational -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x613f4868 ufshcd_hba_stop -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x6a240d25 ufshcd_fixup_dev_quirks EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x723b1abf ufshcd_delay_us -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x78930ac2 ufshcd_remove -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x9af403e1 ufshcd_dealloc_host -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x9ec25b8d ufshcd_config_pwr_mode +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x7901a53b ufshcd_link_recovery +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x848575d5 ufshcd_release +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x8a02afca ufshcd_make_hba_operational +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0x94695a34 ufshcd_dme_get_attr EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xa3d34650 ufshcd_get_vreg -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xa6780c4a ufshcd_link_recovery -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xada0d89a ufshcd_auto_hibern8_update -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xb16d1e0c ufshcd_uic_change_pwr_mode +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xa89cf09a ufshcd_remove +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xa9ec7839 ufshcd_hba_enable +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xad8f2941 ufshcd_uic_hibern8_exit EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xb1c95be5 ufshcd_resume_complete -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xb29d2124 ufshcd_init -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xb7e4d563 ufshcd_hba_enable -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xb80e51a1 ufshcd_dme_set_attr -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xbbc28246 ufshcd_release -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xd2334b39 ufshcd_dme_get_attr -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xe4f1d287 ufshcd_update_evt_hist +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xcbf2962f ufshcd_uic_change_pwr_mode +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xd48f3490 ufshcd_dump_regs +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xd7e3e0b1 ufshcd_uic_hibern8_enter EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xe60ad670 __ufshcd_suspend_prepare -EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xf206dd82 ufshcd_dme_configure_adapt +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xf46e4b55 ufshcd_dme_configure_adapt +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xf602af33 ufshcd_dealloc_host +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xf780c390 ufshcd_config_pwr_mode +EXPORT_SYMBOL_GPL drivers/ufs/core/ufshcd-core 0xfaff510f ufshcd_dme_set_attr +EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0x10d1cfef ufshcd_pltfrm_init EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0x54c946de ufshcd_init_pwr_dev_param EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0x7a0460ff ufshcd_get_pwr_dev_param -EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0x93ace15a ufshcd_pltfrm_init EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0xba9f02e3 ufshcd_populate_vreg EXPORT_SYMBOL_GPL drivers/ufs/host/ufshcd-pltfrm 0xcb521479 ufshcd_pltfrm_shutdown EXPORT_SYMBOL_GPL drivers/uio/uio 0x1b67ef57 uio_event_notify @@ -18034,6 +18037,7 @@ EXPORT_SYMBOL_GPL net/dccp/dccp 0x55154810 dccp_sync_mss EXPORT_SYMBOL_GPL net/dccp/dccp 0x59814a84 dccp_statistics EXPORT_SYMBOL_GPL net/dccp/dccp 0x5c1429e6 dccp_ctl_make_reset +EXPORT_SYMBOL_GPL net/dccp/dccp 0x60d5d428 dccp_reqsk_init EXPORT_SYMBOL_GPL net/dccp/dccp 0x66ab65ec dccp_recvmsg EXPORT_SYMBOL_GPL net/dccp/dccp 0x684a6cb7 dccp_rcv_state_process EXPORT_SYMBOL_GPL net/dccp/dccp 0x746dcc37 dccp_disconnect @@ -18051,7 +18055,6 @@ EXPORT_SYMBOL_GPL net/dccp/dccp 0xc2693caa dccp_ioctl EXPORT_SYMBOL_GPL net/dccp/dccp 0xc4574ded dccp_insert_option EXPORT_SYMBOL_GPL net/dccp/dccp 0xc5916e94 dccp_send_ack -EXPORT_SYMBOL_GPL net/dccp/dccp 0xcb4bfd5e dccp_reqsk_init EXPORT_SYMBOL_GPL net/dccp/dccp 0xd1f64576 dccp_rcv_established EXPORT_SYMBOL_GPL net/dccp/dccp 0xd5f453aa dccp_done EXPORT_SYMBOL_GPL net/dccp/dccp 0xd7207c6a dccp_sendmsg @@ -18121,12 +18124,12 @@ EXPORT_SYMBOL_GPL net/ipv4/esp4 0xc08923c1 esp_output_head EXPORT_SYMBOL_GPL net/ipv4/gre 0x4ee9d358 gre_del_protocol EXPORT_SYMBOL_GPL net/ipv4/gre 0x86c18daa gre_add_protocol +EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x084f0886 inet_sk_diag_fill EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x0d2c9766 inet_diag_find_one_icsk EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x1463d599 inet_diag_msg_common_fill EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x1bcc14ad inet_diag_dump_icsk EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x20646504 inet_diag_unregister EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x7310ca05 inet_diag_msg_attrs_fill -EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0x8e379860 inet_sk_diag_fill EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0xa1113d9d inet_diag_dump_one_icsk EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0xb349fb83 inet_diag_register EXPORT_SYMBOL_GPL net/ipv4/inet_diag 0xe681cace inet_diag_bc_sk @@ -18471,26 +18474,29 @@ EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x0e5393fb nft_data_init EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x0ee78730 nft_chain_validate EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x1bce875c nft_meta_get_reduce +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x1dd0c96b nf_tables_bind_set EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x1f3dc93b nft_unregister_obj +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x2e9a9641 nft_set_lookup_global EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x2fb7f3ed nft_expr_reduce_bitwise EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x3251d762 nf_tables_trans_destroy_flush_work EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x328c9b86 nft_unregister_chain_type EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x34a68a8f nft_register_obj +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x36c0ce16 nft_set_catchall_gc EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x38ff44c9 nft_unregister_flowtable_type EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x41b71e65 nft_trace_enabled EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x4658bd16 nft_unregister_expr EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x49c4bf30 nft_meta_set_validate EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x4c9ee9e6 nft_meta_get_dump +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x4f1c6ddd nf_tables_deactivate_set EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x5d0f4059 nft_chain_validate_dependency EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x5f237da4 nft_parse_register_store EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x5fb53a4c nft_data_release -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x64adb4e6 nf_tables_bind_set -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x6c08c7ac nft_set_lookup_global EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x75f9d788 __nft_release_basechain EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x7c29e6ee nft_flowtable_lookup EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x7e96eb98 nft_request_module -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x81069303 nft_set_do_lookup +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x80585a76 nft_set_do_lookup EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x84ea6c4f nf_tables_deactivate_flowtable +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x8819b544 nft_set_catchall_lookup EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x9113f792 nft_obj_notify EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x92a5f74f nft_meta_get_eval EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0x932fed43 nft_register_flowtable_type @@ -18502,20 +18508,17 @@ EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xae47eb8d nft_chain_validate_hooks EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xaff37ab9 nft_dump_register EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xb2bc8481 nft_meta_get_init -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xbdae2d3a nf_tables_deactivate_set +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xb31a8ad8 nft_set_elem_destroy EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xc015c870 nft_meta_policy EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xc0fa1da6 nft_meta_set_destroy EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xc509eb4a nft_meta_set_init EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xc6bc6fe5 __nft_reg_track_cancel -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xc7a0858c nft_set_elem_destroy -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xd9a22cc9 nft_set_catchall_gc EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xdb3d58c7 nft_data_dump EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xde57b5f5 nft_parse_u32_check EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xe2b8cc13 nft_parse_register_load -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xe2fca211 nf_tables_destroy_set EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xe4f06dc7 nft_reg_track_cancel EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xf41d9b0e nft_register_chain_type -EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xf55bd57e nft_set_catchall_lookup +EXPORT_SYMBOL_GPL net/netfilter/nf_tables 0xf893ff97 nf_tables_destroy_set EXPORT_SYMBOL_GPL net/netfilter/nfnetlink 0x0a9210ca nfnetlink_set_err EXPORT_SYMBOL_GPL net/netfilter/nfnetlink 0x13e969f3 nfnetlink_broadcast EXPORT_SYMBOL_GPL net/netfilter/nfnetlink 0x303b6b54 nfnetlink_subsys_unregister @@ -20061,7 +20064,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x0145821e pci_cfg_access_trylock EXPORT_SYMBOL_GPL vmlinux 0x01485636 nvmem_device_cell_read EXPORT_SYMBOL_GPL vmlinux 0x0156845e gpiochip_remove -EXPORT_SYMBOL_GPL vmlinux 0x0156c79f __inet_twsk_schedule EXPORT_SYMBOL_GPL vmlinux 0x0157520a msi_lock_descs EXPORT_SYMBOL_GPL vmlinux 0x0157e517 __dev_forward_skb EXPORT_SYMBOL_GPL vmlinux 0x015d6ac4 __tracepoint_block_bio_complete @@ -20233,6 +20235,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x0855d6b0 pci_reset_bus EXPORT_SYMBOL_GPL vmlinux 0x0867b7fc __mnt_is_readonly EXPORT_SYMBOL_GPL vmlinux 0x087f5dc5 wm831x_of_match +EXPORT_SYMBOL_GPL vmlinux 0x0886b204 mptcp_pm_get_add_addr_signal_max EXPORT_SYMBOL_GPL vmlinux 0x08af7d64 devres_destroy EXPORT_SYMBOL_GPL vmlinux 0x08b25ebf disk_uevent EXPORT_SYMBOL_GPL vmlinux 0x08c78cf7 offline_and_remove_memory @@ -20340,6 +20343,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x0d6a49d4 tcp_memory_per_cpu_fw_alloc EXPORT_SYMBOL_GPL vmlinux 0x0d791005 __traceiter_neigh_event_send_dead EXPORT_SYMBOL_GPL vmlinux 0x0d960296 vring_transport_features +EXPORT_SYMBOL_GPL vmlinux 0x0dbf499e tcp_cong_avoid_ai EXPORT_SYMBOL_GPL vmlinux 0x0dc61143 sdio_set_host_pm_flags EXPORT_SYMBOL_GPL vmlinux 0x0dcb2b42 adp5520_write EXPORT_SYMBOL_GPL vmlinux 0x0dcb3ee8 divider_recalc_rate @@ -20828,6 +20832,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x20d07b55 nf_ct_hook EXPORT_SYMBOL_GPL vmlinux 0x20ef51dd ip6_local_out EXPORT_SYMBOL_GPL vmlinux 0x20f16626 sfp_bus_find_fwnode +EXPORT_SYMBOL_GPL vmlinux 0x20f58f86 mptcp_diag_fill_info EXPORT_SYMBOL_GPL vmlinux 0x20f630d5 clk_hw_set_parent EXPORT_SYMBOL_GPL vmlinux 0x20fc44ac serdev_acpi_get_uart_resource EXPORT_SYMBOL_GPL vmlinux 0x2142847f disk_set_zoned @@ -20852,6 +20857,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x22067dc9 balloon_page_alloc EXPORT_SYMBOL_GPL vmlinux 0x220a6212 clockevents_config_and_register EXPORT_SYMBOL_GPL vmlinux 0x221eab6d scatterwalk_copychunks +EXPORT_SYMBOL_GPL vmlinux 0x2221a04b devfreq_cooling_register EXPORT_SYMBOL_GPL vmlinux 0x2228b74e scsi_alloc_request EXPORT_SYMBOL_GPL vmlinux 0x222e4462 skb_consume_udp EXPORT_SYMBOL_GPL vmlinux 0x2231fc85 device_remove_software_node @@ -21344,7 +21350,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x34ed304e __synth_event_gen_cmd_start EXPORT_SYMBOL_GPL vmlinux 0x34eed355 ata_pci_sff_init_one EXPORT_SYMBOL_GPL vmlinux 0x34f00ff5 fscrypt_d_revalidate -EXPORT_SYMBOL_GPL vmlinux 0x34f4ce34 mptcp_pm_get_add_addr_signal_max EXPORT_SYMBOL_GPL vmlinux 0x34fe7edd tps6586x_update EXPORT_SYMBOL_GPL vmlinux 0x34fefffd usb_get_status EXPORT_SYMBOL_GPL vmlinux 0x35082936 xdp_rxq_info_unused @@ -21452,6 +21457,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x38b6a890 __SCT__tp_func_sched_util_est_cfs_tp EXPORT_SYMBOL_GPL vmlinux 0x38c3ff30 freq_qos_add_notifier EXPORT_SYMBOL_GPL vmlinux 0x38c929fd nf_nat_hook +EXPORT_SYMBOL_GPL vmlinux 0x38cf8523 mptcp_pm_get_add_addr_accept_max EXPORT_SYMBOL_GPL vmlinux 0x38e1fde7 mpi_set EXPORT_SYMBOL_GPL vmlinux 0x38e5bc5a clk_set_rate_range EXPORT_SYMBOL_GPL vmlinux 0x38ea9765 intel_pt_validate_hw_cap @@ -21516,8 +21522,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x3b360cca __tracepoint_sched_cpu_capacity_tp EXPORT_SYMBOL_GPL vmlinux 0x3b3bca29 __udp4_lib_lookup EXPORT_SYMBOL_GPL vmlinux 0x3b4c240a display_timings_release -EXPORT_SYMBOL_GPL vmlinux 0x3b4efd5e mptcp_token_get_sock -EXPORT_SYMBOL_GPL vmlinux 0x3b563020 tcp_cong_avoid_ai EXPORT_SYMBOL_GPL vmlinux 0x3b6cab7d init_uts_ns EXPORT_SYMBOL_GPL vmlinux 0x3b7a7163 __static_call_return0 EXPORT_SYMBOL_GPL vmlinux 0x3b91db5b intel_pt_handle_vmx @@ -21628,6 +21632,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x3f817fc5 devl_port_register EXPORT_SYMBOL_GPL vmlinux 0x3f84bcd7 dax_alive EXPORT_SYMBOL_GPL vmlinux 0x3f99dcfe thermal_zone_get_temp +EXPORT_SYMBOL_GPL vmlinux 0x3f9c9ada mptcp_pm_get_subflows_max EXPORT_SYMBOL_GPL vmlinux 0x3f9eb2c0 gnttab_dma_free_pages EXPORT_SYMBOL_GPL vmlinux 0x3f9feccf posix_acl_access_xattr_handler EXPORT_SYMBOL_GPL vmlinux 0x3fac5a68 nf_hook_entries_delete_raw @@ -21721,7 +21726,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x4229e219 relay_subbufs_consumed EXPORT_SYMBOL_GPL vmlinux 0x422e578a __SCT__tp_func_add_device_to_group EXPORT_SYMBOL_GPL vmlinux 0x4243daa8 ipv6_find_tlv -EXPORT_SYMBOL_GPL vmlinux 0x4248c1bb inet_twsk_put EXPORT_SYMBOL_GPL vmlinux 0x4249ebda __alloc_pages_bulk EXPORT_SYMBOL_GPL vmlinux 0x4255383a ima_file_check EXPORT_SYMBOL_GPL vmlinux 0x42635d55 pm_suspend_global_flags @@ -21950,6 +21954,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x4be2603a find_pid_ns EXPORT_SYMBOL_GPL vmlinux 0x4be53fcf ata_host_resume EXPORT_SYMBOL_GPL vmlinux 0x4bebfbc8 regulator_is_enabled +EXPORT_SYMBOL_GPL vmlinux 0x4befbdc2 of_devfreq_cooling_register_power EXPORT_SYMBOL_GPL vmlinux 0x4bf291dc irq_domain_xlate_onecell EXPORT_SYMBOL_GPL vmlinux 0x4bfd398d hwrng_msleep EXPORT_SYMBOL_GPL vmlinux 0x4c0ed753 __xdp_rxq_info_reg @@ -21971,7 +21976,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x4c8adfe1 hv_root_partition EXPORT_SYMBOL_GPL vmlinux 0x4c9ce602 gnttab_pages_clear_private EXPORT_SYMBOL_GPL vmlinux 0x4c9d2f69 sk_psock_tls_strp_read -EXPORT_SYMBOL_GPL vmlinux 0x4ca24a8e clean_acked_data_disable EXPORT_SYMBOL_GPL vmlinux 0x4ca5590e mas_prev EXPORT_SYMBOL_GPL vmlinux 0x4cb27100 ktime_get_snapshot EXPORT_SYMBOL_GPL vmlinux 0x4cc67ba1 vfio_unregister_group_dev @@ -22088,7 +22092,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x51425b80 dev_pm_clear_wake_irq EXPORT_SYMBOL_GPL vmlinux 0x51480df6 inode_sb_list_add EXPORT_SYMBOL_GPL vmlinux 0x515431b9 device_match_fwnode -EXPORT_SYMBOL_GPL vmlinux 0x5154491b mptcp_pm_get_local_addr_max EXPORT_SYMBOL_GPL vmlinux 0x515782b3 dw_pcie_ep_raise_legacy_irq EXPORT_SYMBOL_GPL vmlinux 0x51612cf8 sysfs_remove_file_ns EXPORT_SYMBOL_GPL vmlinux 0x51626c0e __fscrypt_prepare_setattr @@ -22097,7 +22100,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x51847574 raw_hash_sk EXPORT_SYMBOL_GPL vmlinux 0x5187ac4b xen_store_evtchn EXPORT_SYMBOL_GPL vmlinux 0x518c2fc6 hpet_rtc_dropped_irq -EXPORT_SYMBOL_GPL vmlinux 0x51974673 devfreq_get_devfreq_by_node EXPORT_SYMBOL_GPL vmlinux 0x519bbd01 virtqueue_enable_cb_prepare EXPORT_SYMBOL_GPL vmlinux 0x51a348cc usb_role_switch_set_drvdata EXPORT_SYMBOL_GPL vmlinux 0x51bf3490 inet_csk_route_child_sock @@ -22456,6 +22458,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x5fb4f9d9 fuse_send_init EXPORT_SYMBOL_GPL vmlinux 0x5fba469f __devm_clk_hw_register_gate EXPORT_SYMBOL_GPL vmlinux 0x5fd03789 pm_generic_restore_early +EXPORT_SYMBOL_GPL vmlinux 0x5fd60d12 inet_twsk_put EXPORT_SYMBOL_GPL vmlinux 0x5fdf7b32 smca_get_bank_type EXPORT_SYMBOL_GPL vmlinux 0x5fdfa2c1 amd_pmu_enable_virt EXPORT_SYMBOL_GPL vmlinux 0x5fea42fa nvdimm_region_delete @@ -23071,6 +23074,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x7674dc85 put_device EXPORT_SYMBOL_GPL vmlinux 0x7681946c unregister_pm_notifier EXPORT_SYMBOL_GPL vmlinux 0x768a81d2 led_blink_set +EXPORT_SYMBOL_GPL vmlinux 0x768bcd32 tcp_slow_start EXPORT_SYMBOL_GPL vmlinux 0x7696b56a ioc_find_get_icq EXPORT_SYMBOL_GPL vmlinux 0x769cefb5 percpu_ref_switch_to_atomic EXPORT_SYMBOL_GPL vmlinux 0x76a96737 tpm_chip_register @@ -23078,6 +23082,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x76ab386a platform_driver_unregister EXPORT_SYMBOL_GPL vmlinux 0x76bff4be of_icc_xlate_onecell EXPORT_SYMBOL_GPL vmlinux 0x76c002eb input_ff_erase +EXPORT_SYMBOL_GPL vmlinux 0x76d41316 vfs_inode_has_locks EXPORT_SYMBOL_GPL vmlinux 0x76d680f6 acpi_dev_resource_memory EXPORT_SYMBOL_GPL vmlinux 0x76d7adb2 device_add_software_node EXPORT_SYMBOL_GPL vmlinux 0x76d9b876 clk_set_rate @@ -23494,6 +23499,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x86b427ce clkdev_create EXPORT_SYMBOL_GPL vmlinux 0x86bbda37 perf_trace_run_bpf_submit EXPORT_SYMBOL_GPL vmlinux 0x86c43a8c cper_estatus_check +EXPORT_SYMBOL_GPL vmlinux 0x86c8a9b1 mptcp_pm_get_local_addr_max EXPORT_SYMBOL_GPL vmlinux 0x86d03b94 gpiochip_get_desc EXPORT_SYMBOL_GPL vmlinux 0x86de3654 genphy_c45_pma_suspend EXPORT_SYMBOL_GPL vmlinux 0x86e84bc9 __pm_runtime_suspend @@ -23611,7 +23617,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8b1a79a1 dma_get_slave_channel EXPORT_SYMBOL_GPL vmlinux 0x8b2131ae bpf_sk_storage_diag_put EXPORT_SYMBOL_GPL vmlinux 0x8b25429d genphy_c45_pma_baset1_setup_master_slave -EXPORT_SYMBOL_GPL vmlinux 0x8b318c2e inet_twsk_hashdance EXPORT_SYMBOL_GPL vmlinux 0x8b3f3737 devm_of_phy_get_by_index EXPORT_SYMBOL_GPL vmlinux 0x8b4149e4 cppc_perf_ctrs_in_pcc EXPORT_SYMBOL_GPL vmlinux 0x8b47ea1d __SCT__tp_func_extlog_mem_event @@ -23675,7 +23680,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x8d52ed1a crypto_alloc_tfm_node EXPORT_SYMBOL_GPL vmlinux 0x8d54f6f8 acpi_gpiochip_free_interrupts EXPORT_SYMBOL_GPL vmlinux 0x8d5a5c80 i2c_dw_adjust_bus_speed -EXPORT_SYMBOL_GPL vmlinux 0x8d65303d of_devfreq_cooling_register_power EXPORT_SYMBOL_GPL vmlinux 0x8d6ff398 wwan_unregister_ops EXPORT_SYMBOL_GPL vmlinux 0x8d79b536 __xenmem_reservation_va_mapping_reset EXPORT_SYMBOL_GPL vmlinux 0x8d7e3373 hwpoison_filter_dev_major @@ -23882,7 +23886,6 @@ EXPORT_SYMBOL_GPL vmlinux 0x9473c0b3 dev_pm_opp_put_opp_table EXPORT_SYMBOL_GPL vmlinux 0x947b40c6 cpu_smt_possible EXPORT_SYMBOL_GPL vmlinux 0x947f7d6d dev_pm_opp_set_opp -EXPORT_SYMBOL_GPL vmlinux 0x948b2aec clean_acked_data_enable EXPORT_SYMBOL_GPL vmlinux 0x949b5176 devlink_region_snapshot_create EXPORT_SYMBOL_GPL vmlinux 0x949f7342 __alloc_percpu EXPORT_SYMBOL_GPL vmlinux 0x94a56fe8 genphy_c45_read_status @@ -24070,6 +24073,7 @@ EXPORT_SYMBOL_GPL vmlinux 0x9b5e45b6 vfio_unregister_iommu_driver EXPORT_SYMBOL_GPL vmlinux 0x9b651e51 xenbus_teardown_ring EXPORT_SYMBOL_GPL vmlinux 0x9b698c42 ioasid_set_data +EXPORT_SYMBOL_GPL vmlinux 0x9b6b12e7 inet_twsk_alloc EXPORT_SYMBOL_GPL vmlinux 0x9b6ec967 ring_buffer_size EXPORT_SYMBOL_GPL vmlinux 0x9b75dbfc firmware_request_cache EXPORT_SYMBOL_GPL vmlinux 0x9b768201 modify_ftrace_direct_multi @@ -24363,7 +24367,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xa5efbf4c async_synchronize_full EXPORT_SYMBOL_GPL vmlinux 0xa6089365 kobject_rename EXPORT_SYMBOL_GPL vmlinux 0xa609ddde devm_regmap_del_irq_chip -EXPORT_SYMBOL_GPL vmlinux 0xa618df9e mptcp_token_iter_next EXPORT_SYMBOL_GPL vmlinux 0xa6205d41 debugfs_create_file_unsafe EXPORT_SYMBOL_GPL vmlinux 0xa63d0fc4 cpufreq_disable_fast_switch EXPORT_SYMBOL_GPL vmlinux 0xa644a433 mbox_chan_txdone @@ -24502,6 +24505,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xad091692 peernet2id_alloc EXPORT_SYMBOL_GPL vmlinux 0xad1f94b5 rio_add_device EXPORT_SYMBOL_GPL vmlinux 0xad395dd9 mm_account_pinned_pages +EXPORT_SYMBOL_GPL vmlinux 0xad399e03 devfreq_cooling_em_register EXPORT_SYMBOL_GPL vmlinux 0xad3af7d3 pcie_reset_flr EXPORT_SYMBOL_GPL vmlinux 0xad451922 devlink_port_health_reporter_create EXPORT_SYMBOL_GPL vmlinux 0xad4e6259 remove_cpu @@ -24519,7 +24523,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xade60973 devm_clk_get_enabled EXPORT_SYMBOL_GPL vmlinux 0xae05d08d regmap_multi_reg_write EXPORT_SYMBOL_GPL vmlinux 0xae0c4184 driver_remove_file -EXPORT_SYMBOL_GPL vmlinux 0xae0db212 devfreq_cooling_em_register EXPORT_SYMBOL_GPL vmlinux 0xae0ecf40 usb_bus_idr_lock EXPORT_SYMBOL_GPL vmlinux 0xae1051b0 net_cls_cgrp_subsys_enabled_key EXPORT_SYMBOL_GPL vmlinux 0xae35fa0d __netdev_watchdog_up @@ -24533,6 +24536,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xaea7f1ef devlink_sb_unregister EXPORT_SYMBOL_GPL vmlinux 0xaecaafde to_nvdimm_bus_dev EXPORT_SYMBOL_GPL vmlinux 0xaef15d50 device_unregister +EXPORT_SYMBOL_GPL vmlinux 0xaef2ffc6 devfreq_get_devfreq_by_phandle EXPORT_SYMBOL_GPL vmlinux 0xaf076aec nd_fletcher64 EXPORT_SYMBOL_GPL vmlinux 0xaf0b6ba7 blkg_rwstat_init EXPORT_SYMBOL_GPL vmlinux 0xaf172a10 iommu_sva_find @@ -24687,6 +24691,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb49fba8f ima_inode_hash EXPORT_SYMBOL_GPL vmlinux 0xb4a6435f mmu_interval_read_begin EXPORT_SYMBOL_GPL vmlinux 0xb4aef203 pci_generic_config_write32 +EXPORT_SYMBOL_GPL vmlinux 0xb4b44d27 mptcp_token_get_sock EXPORT_SYMBOL_GPL vmlinux 0xb4b97c90 pvclock_gtod_register_notifier EXPORT_SYMBOL_GPL vmlinux 0xb4dc093d crypto_ahash_digest EXPORT_SYMBOL_GPL vmlinux 0xb4ea69c3 __virtqueue_break @@ -24746,7 +24751,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xb6c5e614 acpi_processor_evaluate_cst EXPORT_SYMBOL_GPL vmlinux 0xb6c6667e sk_detach_filter EXPORT_SYMBOL_GPL vmlinux 0xb6e6d99d clk_disable -EXPORT_SYMBOL_GPL vmlinux 0xb6e8a474 tcp_slow_start EXPORT_SYMBOL_GPL vmlinux 0xb6eabe37 register_kprobes EXPORT_SYMBOL_GPL vmlinux 0xb6fefc6c iommu_fwspec_free EXPORT_SYMBOL_GPL vmlinux 0xb721940c crypto_alloc_aead @@ -24769,7 +24773,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xb7d7c12e hpet_set_alarm_time EXPORT_SYMBOL_GPL vmlinux 0xb7f3c42d devm_nvdimm_memremap EXPORT_SYMBOL_GPL vmlinux 0xb7f990e9 rht_bucket_nested -EXPORT_SYMBOL_GPL vmlinux 0xb7feff0a mptcp_pm_get_add_addr_accept_max EXPORT_SYMBOL_GPL vmlinux 0xb812ee1c kiocb_modified EXPORT_SYMBOL_GPL vmlinux 0xb81460ea edac_device_handle_ce_count EXPORT_SYMBOL_GPL vmlinux 0xb82434ec kobj_sysfs_ops @@ -24820,6 +24823,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xb9a0b878 regulator_allow_bypass EXPORT_SYMBOL_GPL vmlinux 0xb9a26c14 bio_iov_iter_get_pages EXPORT_SYMBOL_GPL vmlinux 0xb9ac012c dev_pm_opp_get_suspend_opp_freq +EXPORT_SYMBOL_GPL vmlinux 0xb9adb036 clean_acked_data_disable EXPORT_SYMBOL_GPL vmlinux 0xb9b3772d pci_hp_destroy EXPORT_SYMBOL_GPL vmlinux 0xb9b6dcc7 anon_transport_class_unregister EXPORT_SYMBOL_GPL vmlinux 0xb9b9df41 usb_amd_dev_put @@ -25319,7 +25323,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xcb186931 pkcs7_validate_trust EXPORT_SYMBOL_GPL vmlinux 0xcb1a5a05 klp_get_state EXPORT_SYMBOL_GPL vmlinux 0xcb2bfe2b nvmem_register_notifier -EXPORT_SYMBOL_GPL vmlinux 0xcb2c74f5 devfreq_get_devfreq_by_phandle EXPORT_SYMBOL_GPL vmlinux 0xcb2df795 devlink_to_dev EXPORT_SYMBOL_GPL vmlinux 0xcb347e36 power_supply_get_battery_info EXPORT_SYMBOL_GPL vmlinux 0xcb34fa5d platform_device_add_resources @@ -25330,6 +25333,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xcb618a4a crypto_req_done EXPORT_SYMBOL_GPL vmlinux 0xcb81bddb folio_mkclean EXPORT_SYMBOL_GPL vmlinux 0xcb8a461c hv_stimer_legacy_cleanup +EXPORT_SYMBOL_GPL vmlinux 0xcb8a9ea3 __inet_twsk_schedule EXPORT_SYMBOL_GPL vmlinux 0xcb8bbd15 blkcg_policy_unregister EXPORT_SYMBOL_GPL vmlinux 0xcb90311f fat_truncate_time EXPORT_SYMBOL_GPL vmlinux 0xcb970751 stop_machine @@ -25399,6 +25403,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xceb27f2d gpiod_unexport EXPORT_SYMBOL_GPL vmlinux 0xceb66bec sched_clock_cpu EXPORT_SYMBOL_GPL vmlinux 0xced07119 pci_cfg_access_lock +EXPORT_SYMBOL_GPL vmlinux 0xced6c72d devfreq_get_devfreq_by_node EXPORT_SYMBOL_GPL vmlinux 0xcee1641c kgdb_unregister_nmi_console EXPORT_SYMBOL_GPL vmlinux 0xcee90b66 encrypt_blob EXPORT_SYMBOL_GPL vmlinux 0xcef7ab90 regulator_desc_list_voltage_linear_range @@ -25449,6 +25454,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xd0b0d8d6 crypto_shash_digest EXPORT_SYMBOL_GPL vmlinux 0xd0b146ac led_set_brightness_nosleep EXPORT_SYMBOL_GPL vmlinux 0xd0b3b5fc regmap_test_bits +EXPORT_SYMBOL_GPL vmlinux 0xd0b54ce8 inet_twsk_hashdance EXPORT_SYMBOL_GPL vmlinux 0xd0ba608f irq_domain_create_simple EXPORT_SYMBOL_GPL vmlinux 0xd0c05159 emergency_restart EXPORT_SYMBOL_GPL vmlinux 0xd0d156e9 __rht_bucket_nested @@ -25641,7 +25647,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xd76bf0df crypto_unregister_rngs EXPORT_SYMBOL_GPL vmlinux 0xd7726c4a fat_time_fat2unix EXPORT_SYMBOL_GPL vmlinux 0xd774957d mpi_write_to_sgl -EXPORT_SYMBOL_GPL vmlinux 0xd7839339 devfreq_cooling_register EXPORT_SYMBOL_GPL vmlinux 0xd788d601 iomap_read_folio EXPORT_SYMBOL_GPL vmlinux 0xd799278c crypto_type_has_alg EXPORT_SYMBOL_GPL vmlinux 0xd7a86ea4 tcp_twsk_purge @@ -25907,6 +25912,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe1bd6c99 rio_init_mports EXPORT_SYMBOL_GPL vmlinux 0xe1c1a6bc simple_attr_write EXPORT_SYMBOL_GPL vmlinux 0xe1c87a2f kernel_can_power_off +EXPORT_SYMBOL_GPL vmlinux 0xe1d3e34b of_devfreq_cooling_register EXPORT_SYMBOL_GPL vmlinux 0xe1f49848 tcp_reno_cong_avoid EXPORT_SYMBOL_GPL vmlinux 0xe1f82b0c nf_queue_entry_free EXPORT_SYMBOL_GPL vmlinux 0xe1fa2375 bio_poll @@ -25935,6 +25941,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xe2ef5df5 cpu_subsys EXPORT_SYMBOL_GPL vmlinux 0xe2ff8c53 blk_mq_quiesce_queue_nowait EXPORT_SYMBOL_GPL vmlinux 0xe30867dd perf_event_refresh +EXPORT_SYMBOL_GPL vmlinux 0xe318b1d0 mptcp_token_iter_next EXPORT_SYMBOL_GPL vmlinux 0xe330afa5 device_release_driver EXPORT_SYMBOL_GPL vmlinux 0xe33c1acc mptcp_get_reset_option EXPORT_SYMBOL_GPL vmlinux 0xe34b624b pinctrl_enable @@ -26074,7 +26081,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xe7f57c5b tty_init_termios EXPORT_SYMBOL_GPL vmlinux 0xe80e8620 get_user_pages_fast EXPORT_SYMBOL_GPL vmlinux 0xe818b32b ata_bmdma_interrupt -EXPORT_SYMBOL_GPL vmlinux 0xe8305348 inet_twsk_alloc EXPORT_SYMBOL_GPL vmlinux 0xe83eba32 itlb_multihit_kvm_mitigation EXPORT_SYMBOL_GPL vmlinux 0xe84f6e5c pciserial_remove_ports EXPORT_SYMBOL_GPL vmlinux 0xe855e50b usb_acpi_power_manageable @@ -26249,7 +26255,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xef3d2edf msg_zerocopy_realloc EXPORT_SYMBOL_GPL vmlinux 0xef45c355 usb_set_configuration EXPORT_SYMBOL_GPL vmlinux 0xef464c28 getboottime64 -EXPORT_SYMBOL_GPL vmlinux 0xef49e92b mptcp_pm_get_subflows_max EXPORT_SYMBOL_GPL vmlinux 0xef5a2d28 ethnl_cable_test_finished EXPORT_SYMBOL_GPL vmlinux 0xef5db66d regulator_get_init_drvdata EXPORT_SYMBOL_GPL vmlinux 0xef62261f led_classdev_unregister @@ -26292,7 +26297,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xf15b398d iommu_detach_device EXPORT_SYMBOL_GPL vmlinux 0xf170197c iomap_ioend_try_merge EXPORT_SYMBOL_GPL vmlinux 0xf184d189 kernel_power_off -EXPORT_SYMBOL_GPL vmlinux 0xf185be72 mptcp_diag_fill_info EXPORT_SYMBOL_GPL vmlinux 0xf188a662 rhashtable_walk_exit EXPORT_SYMBOL_GPL vmlinux 0xf18f76b5 irq_set_default_host EXPORT_SYMBOL_GPL vmlinux 0xf1978f53 genphy_c45_aneg_done @@ -26412,7 +26416,6 @@ EXPORT_SYMBOL_GPL vmlinux 0xf531e3dd xenbus_dev_changed EXPORT_SYMBOL_GPL vmlinux 0xf54264f9 spi_add_device EXPORT_SYMBOL_GPL vmlinux 0xf54bd49b lcm -EXPORT_SYMBOL_GPL vmlinux 0xf551d723 of_devfreq_cooling_register EXPORT_SYMBOL_GPL vmlinux 0xf553318d cpuidle_pause_and_lock EXPORT_SYMBOL_GPL vmlinux 0xf566b81d crypto_stats_init EXPORT_SYMBOL_GPL vmlinux 0xf5779f45 fib_nexthop_info @@ -26495,6 +26498,7 @@ EXPORT_SYMBOL_GPL vmlinux 0xf7c3f273 xen_resume_notifier_register EXPORT_SYMBOL_GPL vmlinux 0xf7cc59cc devlink_net EXPORT_SYMBOL_GPL vmlinux 0xf7d961d8 clk_hw_unregister_composite +EXPORT_SYMBOL_GPL vmlinux 0xf7e41ff6 clean_acked_data_enable EXPORT_SYMBOL_GPL vmlinux 0xf7ed66e3 devm_pinctrl_unregister EXPORT_SYMBOL_GPL vmlinux 0xf80de79e dw_pcie_host_init EXPORT_SYMBOL_GPL vmlinux 0xf81dce70 thermal_genl_cpu_capability_event diff -u linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem.modules linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem.modules --- linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem.modules +++ linux-oem-6.1-6.1.0/debian.oem/abi/amd64/oem.modules @@ -5720,6 +5720,7 @@ uas ubi ubifs +ubuntu-host ucan ucb1400_core ucb1400_ts diff -u linux-oem-6.1-6.1.0/debian.oem/abi/version linux-oem-6.1-6.1.0/debian.oem/abi/version --- linux-oem-6.1-6.1.0/debian.oem/abi/version +++ linux-oem-6.1-6.1.0/debian.oem/abi/version @@ -1 +1 @@ -6.1.0-1006.6 +6.1.0-1007.7 diff -u linux-oem-6.1-6.1.0/debian.oem/changelog linux-oem-6.1-6.1.0/debian.oem/changelog --- linux-oem-6.1-6.1.0/debian.oem/changelog +++ linux-oem-6.1-6.1.0/debian.oem/changelog @@ -1,3 +1,1341 @@ +linux-oem-6.1 (6.1.0-1008.8) jammy; urgency=medium + + * jammy/linux-oem-6.1: 6.1.0-1008.8 -proposed tracker (LP: #2008352) + + * overlayfs mounts as R/O over idmapped mount (LP: #2009065) + - SAUCE: overlayfs: handle idmapped mounts in ovl_do_(set|remove)xattr + + * Some QHD panels fail to refresh when PSR2 enabled (LP: #2009014) + - SAUCE: drm/i915/psr: Use calculated io and fast wake lines + + * Fix mediatek wifi driver crash when loading wrong SAR table (LP: #2009118) + - wifi: mt76: mt7921: fix error code of return in mt7921_acpi_read + + * Packaging resync (LP: #1786013) + - [Packaging] update update.conf + + * Update dg2_dmc to 2.08 (LP: #1999375) + - drm/i915/dmc: Update DG2 DMC version to v2.08 + + * New DG2 workarounds (LP: #2006945) + - drm/i915/dg2: Introduce Wa_18017747507 + - drm/i915/dg2: Introduce Wa_18018764978 + - drm/i915/dg2: Introduce Wa_18019271663 + + * Screen backlight keeps in minimized and can't change it with amdgpu + (LP: #2008871) + - SAUCE: ACPI: video: Add backlight=native DMI quirk for Dell Vostro 15 3535 + + * Remove all other acpi_video backlight interface on Dell AIO platforms + (LP: #2008882) + - SAUCE: ACPI: video: Dell AIO UART backlight detection + + * screen flicker after PSR2 enabled (LP: #2007516) + - SAUCE: drm/i915/display/psr: Disable PSR2 sel fetch on panel SHP 5457 + + * rtcpie in timers from ubuntu_kernel_selftests randomly failing + (LP: #1814234) + - SAUCE: selftest: rtcpie: Force passing unreliable subtest + + * Fix HFP mSBC support on Realtek Bluetooth USB controller (LP: #2007331) + - Bluetooth: btrtl: Add btrealtek data struct + - Bluetooth: btusb: Ignore zero length of USB packets on ALT 6 for specific + chip + + * Jammy update: v6.1.14 upstream stable release (LP: #2008708) + - drm/etnaviv: don't truncate physical page address + - wifi: ath11k: fix warning in dma_free_coherent() of memory chunks while + recovery + - wifi: rtl8xxxu: gen2: Turn on the rate control + - drm/edid: Fix minimum bpc supported with DSC1.2 for HDMI sink + - clk: mxl: Switch from direct readl/writel based IO to regmap based IO + - clk: mxl: Remove redundant spinlocks + - clk: mxl: Add option to override gate clks + - clk: mxl: Fix a clk entry by adding relevant flags + - powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G + - clk: mxl: syscon_node_to_regmap() returns error pointers + - sched/psi: Stop relying on timer_pending() for poll_work rescheduling + - random: always mix cycle counter in add_latent_entropy() + - scsi: libsas: Add smp_ata_check_ready_type() + - scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset + - spi: mediatek: Enable irq when pdata is ready + - docs: perf: Fix PMU instance name of hisi-pcie-pmu + - KVM: x86: Fail emulation during EMULTYPE_SKIP on any exception + - KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid + - KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS + - can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len + - powerpc: dts: t208x: Disable 10G on MAC1 and MAC2 + - spi: mediatek: Enable irq before the spi registration + - drm/i915: Remove __maybe_unused from mtl_info + - KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET + - selftests: kvm: move declaration at the beginning of main() + - powerpc/64s/radix: Fix RWX mapping with relocated kernel + - nfp: ethtool: support reporting link modes + - nfp: ethtool: fix the bug of setting unsupported port speed + - uaccess: Add speculation barrier to copy_from_user() + - x86/alternatives: Introduce int3_emulate_jcc() + - x86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions + - x86/static_call: Add support for Jcc tail-calls + - Bluetooth: btusb: Add more device IDs for WCN6855 + - riscv: remove special treatment for the link order of head.o + - arm64: remove special treatment for the link order of head.o + - arch: fix broken BuildID for arm64 and riscv + - powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT + - powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds + - s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 + - sh: define RUNTIME_DISCARD_EXIT + - wifi: mwifiex: Add missing compatible string for SD8787 + - audit: update the mailing list in MAINTAINERS + - platform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY + - platform/x86: nvidia-wmi-ec-backlight: Add force module parameter + - ext4: Fix function prototype mismatch for ext4_feat_ktype + - randstruct: disable Clang 15 support + - bpf: add missing header file include + - Linux 6.1.14 + - upstream stable to v6.1.14 + + * Jammy update: v6.1.13 upstream stable release (LP: #2008707) + - mptcp: sockopt: make 'tcp_fastopen_connect' generic + - mptcp: fix locking for setsockopt corner-case + - mptcp: deduplicate error paths on endpoint creation + - mptcp: fix locking for in-kernel listener creation + - btrfs: move the auto defrag code to defrag.c + - btrfs: lock the inode in shared mode before starting fiemap + - ASoC: amd: yc: Add DMI support for new acer/emdoor platforms + - ASoC: SOF: sof-audio: start with the right widget type + - ALSA: usb-audio: Add FIXED_RATE quirk for JBL Quantum610 Wireless + - ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers + - selftests/bpf: Verify copy_register_state() preserves parent/live fields + - ALSA: hda: Do not unset preset when cleaning up codec + - ASoC: amd: yc: Add Xiaomi Redmi Book Pro 15 2022 into DMI table + - bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself + - ASoC: cs42l56: fix DT probe + - tools/virtio: fix the vringh test for virtio ring changes + - vdpa: ifcvf: Do proper cleanup if IFCVF init fails + - net/rose: Fix to not accept on connected socket + - selftest: net: Improve IPV6_TCLASS/IPV6_HOPLIMIT tests apparmor + compatibility + - net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC + - powerpc/64: Fix perf profiling asynchronous interrupt handlers + - fscache: Use clear_and_wake_up_bit() in fscache_create_volume_work() + - drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED + - net: ethernet: mtk_eth_soc: Avoid truncating allocation + - net: sched: sch: Bounds check priority + - s390/decompressor: specify __decompress() buf len to avoid overflow + - nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association + - nvme: clear the request_queue pointers on failure in + nvme_alloc_admin_tag_set + - nvme: clear the request_queue pointers on failure in nvme_alloc_io_tag_set + - drm/amd/display: Add missing brackets in calculation + - drm/amd/display: Adjust downscaling limits for dcn314 + - drm/amd/display: Unassign does_plane_fit_in_mall function from dcn3.2 + - drm/amd/display: Reset DMUB mailbox SW state after HW reset + - drm/amdgpu: enable HDP SD for gfx 11.0.3 + - drm/amdgpu: Enable vclk dclk node for gc11.0.3 + - drm/amd/display: Properly handle additional cases where DCN is not supported + - platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match + - ceph: move mount state enum to super.h + - ceph: blocklist the kclient when receiving corrupted snap trace + - selftests: mptcp: userspace: fix v4-v6 test in v6.1 + - of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem + - kasan: fix Oops due to missing calls to kasan_arch_is_ready() + - mm: shrinkers: fix deadlock in shrinker debugfs + - aio: fix mremap after fork null-deref + - vmxnet3: move rss code block under eop descriptor + - fbdev: Fix invalid page access after closing deferred I/O devices + - drm: Disable dynamic debug as broken + - drm/amd/amdgpu: fix warning during suspend + - drm/amd/display: Fail atomic_check early on normalize_zpos error + - drm/vmwgfx: Stop accessing buffer objects which failed init + - drm/vmwgfx: Do not drop the reference to the handle too soon + - mmc: jz4740: Work around bug on JZ4760(B) + - mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set + - mmc: sdio: fix possible resource leaks in some error paths + - mmc: mmc_spi: fix error handling in mmc_spi_probe() + - ALSA: hda: Fix codec device field initializan + - ALSA: hda/conexant: add a new hda codec SN6180 + - ALSA: hda/realtek - fixed wrong gpio assigned + - ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform. + - ALSA: hda/realtek: Enable mute/micmute LEDs and speaker support for HP + Laptops + - ata: ahci: Add Tiger Lake UP{3,4} AHCI controller + - ata: libata-core: Disable READ LOG DMA EXT for Samsung MZ7LH + - sched/psi: Fix use-after-free in ep_remove_wait_queue() + - hugetlb: check for undefined shift on 32 bit architectures + - nilfs2: fix underflow in second superblock position calculations + - mm/MADV_COLLAPSE: set EAGAIN on unexpected page refcount + - mm/filemap: fix page end in filemap_get_read_batch + - mm/migrate: fix wrongly apply write bit after mkdirty on sparc64 + - gpio: sim: fix a memory leak + - freezer,umh: Fix call_usermode_helper_exec() vs SIGKILL + - coredump: Move dump_emit_page() to kill unused warning + - Revert "mm: Always release pages to the buddy allocator in + memblock_free_late()." + - net: Fix unwanted sign extension in netdev_stats_to_stats64() + - revert "squashfs: harden sanity check in squashfs_read_xattr_id_table" + - drm/vc4: crtc: Increase setup cost in core clock calculation to handle + extreme reduced blanking + - drm/vc4: Fix YUV plane handling when planes are in different buffers + - drm/i915/gen11: Wa_1408615072/Wa_1407596294 should be on GT list + - ice: fix lost multicast packets in promisc mode + - ixgbe: allow to increase MTU to 3K with XDP enabled + - i40e: add double of VLAN header when computing the max MTU + - net: bgmac: fix BCM5358 support by setting correct flags + - net: ethernet: ti: am65-cpsw: Add RX DMA Channel Teardown Quirk + - sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list + - net/sched: tcindex: update imperfect hash filters respecting rcu + - ice: xsk: Fix cleaning of XDP_TX frames + - dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions. + - net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path + - net/sched: act_ctinfo: use percpu stats + - net: openvswitch: fix possible memory leak in ovs_meter_cmd_set() + - net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence + - bnxt_en: Fix mqprio and XDP ring checking logic + - tracing: Make trace_define_field_ext() static + - net: stmmac: Restrict warning on disabling DMA store and fwd mode + - net: use a bounce buffer for copying skb->mark + - tipc: fix kernel warning when sending SYN message + - net: mpls: fix stale pointer if allocation fails during device rename + - igb: conditionalize I2C bit banging on external thermal sensor support + - igb: Fix PPS input and output using 3rd and 4th SDP + - ixgbe: add double of VLAN header when computing the max MTU + - ipv6: Fix datagram socket connection with DSCP. + - ipv6: Fix tcp socket connection with DSCP. + - mm/gup: add folio to list when folio_isolate_lru() succeed + - mm: extend max struct page size for kmsan + - i40e: Add checking for null for nlmsg_find_attr() + - net/sched: tcindex: search key must be 16 bits + - nvme-tcp: stop auth work after tearing down queues in error recovery + - nvme-rdma: stop auth work after tearing down queues in error recovery + - KVM: x86/pmu: Disable vPMU support on hybrid CPUs (host PMUs) + - kvm: initialize all of the kvm_debugregs structure before sending it to + userspace + - perf/x86: Refuse to export capabilities for hybrid PMUs + - alarmtimer: Prevent starvation by small intervals and SIG_IGN + - nvme-pci: refresh visible attrs for cmb attributes + - ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak + - net: sched: sch: Fix off by one in htb_activate_prios() + - Linux 6.1.13 + - upstream stable to v6.1.13 + + * Jammy update: v6.1.12 upstream stable release (LP: #2007585) + - hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC + - btrfs: limit device extents to the device size + - btrfs: zlib: zero-initialize zlib workspace + - ALSA: hda/realtek: Add Positivo N14KP6-TG + - ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() + - ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro 360 + - ALSA: hda/realtek: Enable mute/micmute LEDs on HP Elitebook, 645 G9 + - ALSA: hda/realtek: Add quirk for ASUS UM3402 using CS35L41 + - ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform. + - Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume" + - Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming" + - tracing: Fix poll() and select() do not work on per_cpu trace_pipe and + trace_pipe_raw + - of/address: Return an error when no valid dma-ranges are found + - can: j1939: do not wait 250 ms if the same addr was already claimed + - HID: logitech: Disable hi-res scrolling on USB + - xfrm: compat: change expression for switch in xfrm_xlate64 + - IB/hfi1: Restore allocated resources on failed copyout + - xfrm/compat: prevent potential spectre v1 gadget in xfrm_xlate32_attr() + - IB/IPoIB: Fix legacy IPoIB due to wrong number of queues + - xfrm: annotate data-race around use_time + - RDMA/irdma: Fix potential NULL-ptr-dereference + - RDMA/usnic: use iommu_map_atomic() under spin_lock() + - xfrm: fix bug with DSCP copy to v6 from v4 tunnel + - of: Make OF framebuffer device names unique + - net: phylink: move phy_device_free() to correctly release phy device + - bonding: fix error checking in bond_debug_reregister() + - net: macb: Perform zynqmp dynamic configuration only for SGMII interface + - net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY + - ionic: clean interrupt before enabling queue to avoid credit race + - ionic: refactor use of ionic_rx_fill() + - ionic: missed doorbell workaround + - cpufreq: qcom-hw: Fix cpufreq_driver->get() for non-LMH systems + - uapi: add missing ip/ipv6 header dependencies for linux/stddef.h + - net: microchip: sparx5: fix PTP init/deinit not checking all ports + - HID: amd_sfh: if no sensors are enabled, clean up + - drm/i915: Don't do the WM0->WM1 copy w/a if WM1 is already enabled + - drm/virtio: exbuf->fence_fd unmodified on interrupted wait + - cpuset: Call set_cpus_allowed_ptr() with appropriate mask for task + - nvidiafb: detect the hardware support before removing console. + - ice: Do not use WQ_MEM_RECLAIM flag for workqueue + - ice: Fix disabling Rx VLAN filtering with port VLAN enabled + - ice: switch: fix potential memleak in ice_add_adv_recipe() + - net: dsa: mt7530: don't change PVC_EG_TAG when CPU port becomes VLAN-aware + - net: mscc: ocelot: fix VCAP filters not matching on MAC with "protocol + 802.1Q" + - net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change + - net/mlx5: Bridge, fix ageing of peer FDB entries + - net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode + - net/mlx5e: IPoIB, Show unknown speed instead of error + - net/mlx5: Store page counters in a single array + - net/mlx5: Expose SF firmware pages counter + - net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers + - net/mlx5: fw_tracer, Zero consumer index when reloading the tracer + - net/mlx5: Serialize module cleanup with reload and remove + - igc: Add ndo_tx_timeout support + - net: ethernet: mtk_eth_soc: fix wrong parameters order in + __xdp_rxq_info_reg() + - txhash: fix sk->sk_txrehash default + - selftests: Fix failing VXLAN VNI filtering test + - rds: rds_rm_zerocopy_callback() use list_first_entry() + - net: mscc: ocelot: fix all IPv6 getting trapped to CPU when PTP timestamping + is used + - selftests: forwarding: lib: quote the sysctl values + - arm64: dts: rockchip: fix input enable pinconf on rk3399 + - arm64: dts: rockchip: set sdmmc0 speed to sd-uhs-sdr50 on rock-3a + - ALSA: pci: lx6464es: fix a debug loop + - riscv: stacktrace: Fix missing the first frame + - arm64: dts: mediatek: mt8195: Fix vdosys* compatible strings + - ASoC: tas5805m: rework to avoid scheduling while atomic. + - ASoC: tas5805m: add missing page switch. + - ASoC: fsl_sai: fix getting version from VERID + - ASoC: topology: Return -ENOMEM on memory allocation failure + - clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted + strings + - pinctrl: mediatek: Fix the drive register definition of some Pins + - pinctrl: aspeed: Fix confusing types in return value + - pinctrl: single: fix potential NULL dereference + - spi: dw: Fix wrong FIFO level setting for long xfers + - pinctrl: aspeed: Revert "Force to disable the function's signal" + - pinctrl: intel: Restore the pins that used to be in Direct IRQ mode + - cifs: Fix use-after-free in rdata->read_into_pages() + - net: USB: Fix wrong-direction WARNING in plusb.c + - mptcp: do not wait for bare sockets' timeout + - mptcp: be careful on subflow status propagation on errors + - selftests: mptcp: allow more slack for slow test-case + - selftests: mptcp: stop tests earlier + - btrfs: simplify update of last_dir_index_offset when logging a directory + - btrfs: free device in btrfs_close_devices for a single device filesystem + - usb: core: add quirk for Alcor Link AK9563 smartcard reader + - usb: typec: altmodes/displayport: Fix probe pin assign check + - cxl/region: Fix null pointer dereference for resetting decoder + - cxl/region: Fix passthrough-decoder detection + - clk: ingenic: jz4760: Update M/N/OD calculation algorithm + - pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group + - drm/amd/pm: add SMU 13.0.7 missing GetPptLimit message mapping + - ceph: flush cap releases when the session is flushed + - nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE + - riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte + - riscv: kprobe: Fixup misaligned load text + - powerpc/64s/interrupt: Fix interrupt exit race with security mitigation + switch + - drm/amdgpu: Use the TGID for trace_amdgpu_vm_update_ptes + - tracing: Fix TASK_COMM_LEN in trace event format file + - rtmutex: Ensure that the top waiter is always woken up + - arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive + - arm64: dts: meson-g12-common: Make mmc host controller interrupts level- + sensitive + - arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive + - Fix page corruption caused by racy check in __free_pages + - arm64: efi: Force the use of SetVirtualAddressMap() on eMAG and Altra Max + machines + - drm/amd/pm: bump SMU 13.0.0 driver_if header version + - drm/amdgpu: Add unique_id support for GC 11.0.1/2 + - drm/amd/pm: bump SMU 13.0.7 driver_if header version + - drm/amdgpu/fence: Fix oops due to non-matching drm_sched init/fini + - drm/amdgpu/smu: skip pptable init under sriov + - drm/amd/display: properly handling AGP aperture in vm setup + - drm/amd/display: fix cursor offset on rotation 180 + - drm/i915: Move fd_install after last use of fence + - drm/i915: Initialize the obj flags for shmem objects + - drm/i915: Fix VBT DSI DVO port handling + - x86/speculation: Identify processors vulnerable to SMT RSB predictions + - KVM: x86: Mitigate the cross-thread return address predictions bug + - Documentation/hw-vuln: Add documentation for Cross-Thread Return Predictions + - Linux 6.1.12 + - upstream stable to v6.1.12 + + * Jammy update: v6.1.11 upstream stable release (LP: #2007584) + - firewire: fix memory leak for payload of request subaction to IEC 61883-1 + FCP region + - bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() + - arm64: dts: imx8m-venice: Remove incorrect 'uart-has-rtscts' + - arm64: dts: freescale: imx8dxl: fix sc_pwrkey's property name linux,keycode + - ASoC: amd: acp-es8336: Drop reference count of ACPI device after use + - ASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use + - ASoC: Intel: sof_es8336: Drop reference count of ACPI device after use + - ASoC: Intel: avs: Implement PCI shutdown + - bpf: Fix off-by-one error in bpf_mem_cache_idx() + - bpf: Fix a possible task gone issue with bpf_send_signal[_thread]() helpers + - ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path() + - bpf: Fix to preserve reg parent/live fields when copying range info + - selftests/filesystems: grant executable permission to run_fat_tests.sh + - ASoC: SOF: ipc4-mtrace: prevent underflow in + sof_ipc4_priority_mask_dfs_write() + - bpf: Add missing btf_put to register_btf_id_dtor_kfuncs + - media: v4l2-ctrls-api.c: move ctrl->is_new = 1 to the correct line + - bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener + - arm64: dts: imx8mm: Fix pad control for UART1_DTE_RX + - arm64: dts: imx8mm-verdin: Do not power down eth-phy + - drm/vc4: hdmi: make CEC adapter name unique + - drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command + - scsi: Revert "scsi: core: map PQ=1, PDT=other values to + SCSI_SCAN_TARGET_PRESENT" + - bpf: Fix the kernel crash caused by bpf_setsockopt(). + - ALSA: memalloc: Workaround for Xen PV + - vhost/net: Clear the pending messages when the backend is removed + - copy_oldmem_kernel() - WRITE is "data source", not destination + - WRITE is "data source", not destination... + - READ is "data destination", not source... + - zcore: WRITE is "data source", not destination... + - memcpy_real(): WRITE is "data source", not destination... + - fix iov_iter_bvec() "direction" argument + - fix 'direction' argument of iov_iter_{init,bvec}() + - fix "direction" argument of iov_iter_kvec() + - use less confusing names for iov_iter direction initializers + - vhost-scsi: unbreak any layout for response + - ice: Prevent set_channel from changing queues while RDMA active + - qede: execute xdp_do_flush() before napi_complete_done() + - virtio-net: execute xdp_do_flush() before napi_complete_done() + - dpaa_eth: execute xdp_do_flush() before napi_complete_done() + - dpaa2-eth: execute xdp_do_flush() before napi_complete_done() + - skb: Do mix page pool and page referenced frags in GRO + - sfc: correctly advertise tunneled IPv6 segmentation + - net: phy: dp83822: Fix null pointer access on DP83825/DP83826 devices + - net: wwan: t7xx: Fix Runtime PM initialization + - block, bfq: replace 0/1 with false/true in bic apis + - block, bfq: fix uaf for bfqq in bic_set_bfqq() + - netrom: Fix use-after-free caused by accept on already connected socket + - fscache: Use wait_on_bit() to wait for the freeing of relinquished volume + - platform/x86/amd/pmf: update to auto-mode limits only after AMT event + - platform/x86/amd/pmf: Add helper routine to update SPS thermals + - platform/x86/amd/pmf: Fix to update SPS default pprof thermals + - platform/x86/amd/pmf: Add helper routine to check pprof is balanced + - platform/x86/amd/pmf: Fix to update SPS thermals when power supply change + - platform/x86/amd/pmf: Ensure mutexes are initialized before use + - platform/x86: thinkpad_acpi: Fix thinklight LED brightness returning 255 + - drm/i915/guc: Fix locking when searching for a hung request + - drm/i915: Fix request ref counting during error capture & debugfs dump + - drm/i915: Fix up locking around dumping requests lists + - drm/i915/adlp: Fix typo for reference clock + - net/tls: tls_is_tx_ready() checked list_entry + - ALSA: firewire-motu: fix unreleased lock warning in hwdep device + - netfilter: br_netfilter: disable sabotage_in hook after first suppression + - block: ublk: extending queue_size to fix overflow + - kunit: fix kunit_test_init_section_suites(...) + - squashfs: harden sanity check in squashfs_read_xattr_id_table + - maple_tree: should get pivots boundary by type + - sctp: do not check hb_timer.expires when resetting hb_timer + - net: phy: meson-gxl: Add generic dummy stubs for MMD register access + - drm/panel: boe-tv101wum-nl6: Ensure DSI writes succeed during disable + - ip/ip6_gre: Fix changing addr gen mode not generating IPv6 link local + address + - ip/ip6_gre: Fix non-point-to-point tunnel not generating IPv6 link local + address + - riscv: kprobe: Fixup kernel panic when probing an illegal position + - igc: return an error if the mac type is unknown in + igc_ptp_systim_to_hwtstamp() + - octeontx2-af: Fix devlink unregister + - can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate + - can: raw: fix CAN FD frame transmissions over CAN XL devices + - can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing + tx_obj_num_coalesce_irq + - ata: libata: Fix sata_down_spd_limit() when no link speed is reported + - selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning + - selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided + - selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs + - selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy + benchmarking + - virtio-net: Keep stop() to follow mirror sequence of open() + - net: openvswitch: fix flow memory leak in ovs_flow_cmd_new + - efi: fix potential NULL deref in efi_mem_reserve_persistent + - rtc: sunplus: fix format string for printing resource + - certs: Fix build error when PKCS#11 URI contains semicolon + - kbuild: modinst: Fix build error when CONFIG_MODULE_SIG_KEY is a PKCS#11 URI + - i2c: designware-pci: Add new PCI IDs for AMD NAVI GPU + - i2c: mxs: suppress probe-deferral error message + - scsi: target: core: Fix warning on RT kernels + - x86/aperfmperf: Erase stale arch_freq_scale values when disabling frequency + invariance readings + - perf/x86/intel: Add Emerald Rapids + - perf/x86/intel/cstate: Add Emerald Rapids + - scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress + - scsi: iscsi_tcp: Fix UAF during login when accessing the shost ipaddress + - i2c: rk3x: fix a bunch of kernel-doc warnings + - Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one" + - x86/build: Move '-mindirect-branch-cs-prefix' out of GCC-only block + - platform/x86: hp-wmi: Handle Omen Key event + - platform/x86: gigabyte-wmi: add support for B450M DS3H WIFI-CF + - platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN + - net/x25: Fix to not accept on connected socket + - drm/amd/display: Fix timing not changning when freesync video is enabled + - bcache: Silence memcpy() run-time false positive warnings + - iio: adc: stm32-dfsdm: fill module aliases + - usb: dwc3: qcom: enable vbus override when in OTG dr-mode + - usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait + - vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF + - fbcon: Check font dimension limits + - cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask() + - hv_netvsc: Fix missed pagebuf entries in netvsc_dma_map/unmap() + - ARM: dts: imx7d-smegw01: Fix USB host over-current polarity + - net: qrtr: free memory on error path in radix_tree_insert() + - can: isotp: split tx timer into transmission and timeout + - can: isotp: handle wait_event_interruptible() return values + - watchdog: diag288_wdt: do not use stack buffers for hardware data + - watchdog: diag288_wdt: fix __diag288() inline assembly + - ALSA: hda/realtek: Add Acer Predator PH315-54 + - ALSA: hda/realtek: fix mute/micmute LEDs, speaker don't work for a HP + platform + - ASoC: codecs: wsa883x: correct playback min/max rates + - ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0 + - ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL + - ASoC: SOF: keep prepare/unprepare widgets in sink path + - efi: Accept version 2 of memory attributes table + - rtc: efi: Enable SET/GET WAKEUP services as optional + - iio: hid: fix the retval in accel_3d_capture_sample + - iio: hid: fix the retval in gyro_3d_capture_sample + - iio: adc: xilinx-ams: fix devm_krealloc() return value check + - iio: adc: berlin2-adc: Add missing of_node_put() in error path + - iio: imx8qxp-adc: fix irq flood when call imx8qxp_adc_read_raw() + - iio:adc:twl6030: Enable measurements of VUSB, VBAT and others + - iio: imu: fxos8700: fix ACCEL measurement range selection + - iio: imu: fxos8700: fix incomplete ACCEL and MAGN channels readback + - iio: imu: fxos8700: fix IMU data bits returned to user space + - iio: imu: fxos8700: fix map label of channel type to MAGN sensor + - iio: imu: fxos8700: fix swapped ACCEL and MAGN channels readback + - iio: imu: fxos8700: fix incorrect ODR mode readback + - iio: imu: fxos8700: fix failed initialization ODR mode assignment + - iio: imu: fxos8700: remove definition FXOS8700_CTRL_ODR_MIN + - iio: imu: fxos8700: fix MAGN sensor scale and unit + - nvmem: brcm_nvram: Add check for kzalloc + - nvmem: sunxi_sid: Always use 32-bit MMIO reads + - nvmem: qcom-spmi-sdam: fix module autoloading + - parisc: Fix return code of pdc_iodc_print() + - parisc: Replace hardcoded value with PRIV_USER constant in ptrace.c + - parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case + - riscv: disable generation of unwind tables + - Revert "mm: kmemleak: alloc gray object for reserved region with direct map" + - mm: multi-gen LRU: fix crash during cgroup migration + - mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps + - mm: memcg: fix NULL pointer in mem_cgroup_track_foreign_dirty_slowpath() + - usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints + - usb: typec: ucsi: Don't attempt to resume the ports before they exist + - usb: gadget: udc: do not clear gadget driver.bus + - kernel/irq/irqdomain.c: fix memory leak with using debugfs_lookup() + - HV: hv_balloon: fix memory leak with using debugfs_lookup() + - x86/debug: Fix stack recursion caused by wrongly ordered DR7 accesses + - fpga: m10bmc-sec: Fix probe rollback + - fpga: stratix10-soc: Fix return value check in s10_ops_write_init() + - mm/uffd: fix pte marker when fork() without fork event + - mm/swapfile: add cond_resched() in get_swap_pages() + - mm/khugepaged: fix ->anon_vma race + - mm, mremap: fix mremap() expanding for vma's with vm_ops->close() + - mm/MADV_COLLAPSE: catch !none !huge !bad pmd lookups + - highmem: round down the address passed to kunmap_flush_on_unmap() + - ia64: fix build error due to switch case label appearing next to declaration + - Squashfs: fix handling and sanity checking of xattr_ids count + - maple_tree: fix mas_empty_area_rev() lower bound validation + - migrate: hugetlb: check for hugetlb shared PMD in node migration + - dma-buf: actually set signaling bit for private stub fences + - serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ + handler + - drm/i915: Avoid potential vm use-after-free + - drm/i915: Fix potential bit_17 double-free + - drm/amd: Fix initialization for nbio 4.3.0 + - drm/amd/pm: drop unneeded dpm features disablement for SMU 13.0.4/11 + - drm/amdgpu: update wave data type to 3 for gfx11 + - nvmem: core: initialise nvmem->id early + - nvmem: core: remove nvmem_config wp_gpio + - nvmem: core: fix cleanup after dev_set_name() + - nvmem: core: fix registration vs use race + - nvmem: core: fix device node refcounting + - nvmem: core: fix cell removal on error + - nvmem: core: fix return value + - phy: qcom-qmp-combo: fix runtime suspend + - serial: 8250_dma: Fix DMA Rx completion race + - serial: 8250_dma: Fix DMA Rx rearm race + - platform/x86/amd: pmc: add CONFIG_SERIO dependency + - ASoC: SOF: sof-audio: prepare_widgets: Check swidget for NULL on sink + failure + - iio:adc:twl6030: Enable measurement of VAC + - powerpc/64s/radix: Fix crash with unaligned relocated kernel + - powerpc/64s: Fix local irq disable when PMIs are disabled + - powerpc/imc-pmu: Revert nest_init_lock to being a mutex + - fs/ntfs3: Validate attribute data and valid sizes + - ovl: Use "buf" flexible array for memcpy() destination + - f2fs: initialize locks earlier in f2fs_fill_super() + - fbdev: smscufx: fix error handling code in ufx_usb_probe + - f2fs: fix to do sanity check on i_extra_isize in is_alive() + - wifi: brcmfmac: Check the count value of channel spec to prevent out-of- + bounds reads + - gfs2: Cosmetic gfs2_dinode_{in,out} cleanup + - gfs2: Always check inode size of inline inodes + - bpf: Skip invalid kfunc call in backtrack_insn + - Linux 6.1.11 + - upstream stable to v6.1.11 + + * cm32181 module error blocking suspend (LP: #1988346) // Jammy update: + v6.1.11 upstream stable release (LP: #2007584) + - iio: light: cm32181: Fix PM support on system with 2 I2C resources + + * Jammy update: v6.1.10 upstream stable release (LP: #2007583) + - ARM: dts: imx: Fix pca9547 i2c-mux node name + - ARM: dts: vf610: Fix pca9548 i2c-mux node names + - arm64: dts: freescale: Fix pca954x i2c-mux node names + - arm64: dts: imx8mq-thor96: fix no-mmc property for SDHCI + - firmware: arm_scmi: Clear stale xfer->hdr.status + - bpf: Skip task with pid=1 in send_signal_common() + - erofs/zmap.c: Fix incorrect offset calculation + - mac80211: Fix MLO address translation for multiple bss case + - arm64: dts: msm8994-angler: fix the memory map + - ARM: omap1: fix building gpio15xx + - kselftest: Fix error message for unconfigured LLVM builds + - erofs: clean up parsing of fscache related options + - blk-cgroup: fix missing pd_online_fn() while activating policy + - LoongArch: Get frame info in unwind_start() when regs is not available + - ACPI: video: Add backlight=native DMI quirk for Acer Aspire 4810T + - block: fix hctx checks for batch allocation + - s390: workaround invalid gcc-11 out of bounds read warning + - HID: uclogic: Add support for XP-PEN Deco 01 V2 + - HID: playstation: sanity check DualSense calibration data. + - dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init + - gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI + - cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() + - nvme-apple: only reset the controller when RTKit is running + - gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU + - gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode + - net: fix NULL pointer in skb_segment_list + - rust: print: avoid evaluating arguments in `pr_*` macros in `unsafe` blocks + - net: mctp: purge receive queues on sk destruction + - Linux 6.1.10 + - upstream stable to v6.1.10 + + * Jammy update: v6.1.9 upstream stable release (LP: #2007578) + - memory: tegra: Remove clients SID override programming + - memory: atmel-sdramc: Fix missing clk_disable_unprepare in + atmel_ramc_probe() + - memory: mvebu-devbus: Fix missing clk_disable_unprepare in + mvebu_devbus_probe() + - arm64: dts: qcom: sc8280xp: fix primary USB-DP PHY reset + - dmaengine: qcom: gpi: Set link_rx bit on GO TRE for rx operation + - dmaengine: ti: k3-udma: Do conditional decrement of + UDMA_CHAN_RT_PEER_BCNT_REG + - soc: imx: imx8mp-blk-ctrl: enable global pixclk with HDMI_TX_PHY PD + - arm64: dts: imx8mp-phycore-som: Remove invalid PMIC property + - ARM: dts: imx6ul-pico-dwarf: Use 'clock-frequency' + - ARM: dts: imx7d-pico: Use 'clock-frequency' + - ARM: dts: imx6qdl-gw560x: Remove incorrect 'uart-has-rtscts' + - arm64: dts: verdin-imx8mm: fix dahlia audio playback + - arm64: dts: imx8mm-beacon: Fix ecspi2 pinmux + - arm64: dts: verdin-imx8mm: fix dev board audio playback + - arm64: dts: imx93-11x11-evk: correct clock and strobe pad setting + - ARM: imx: add missing of_node_put() + - soc: imx: imx8mp-blk-ctrl: don't set power device name + - arm64: dts: imx8mp: Fix missing GPC Interrupt + - arm64: dts: imx8mp: Fix power-domain typo + - arm64: dts: imx8mp-evk: pcie0-refclk cosmetic cleanup + - HID: intel_ish-hid: Add check for ishtp_dma_tx_map + - arm64: dts: imx8mm-venice-gw7901: fix USB2 controller OC polarity + - soc: imx8m: Fix incorrect check for of_clk_get_by_name() + - reset: ti-sci: honor TI_SCI_PROTOCOL setting when not COMPILE_TEST + - reset: uniphier-glue: Fix possible null-ptr-deref + - EDAC/highbank: Fix memory leak in highbank_mc_probe() + - firmware: arm_scmi: Harden shared memory access in fetch_response + - firmware: arm_scmi: Harden shared memory access in fetch_notification + - firmware: arm_scmi: Fix virtio channels cleanup on shutdown + - interconnect: qcom: msm8996: Provide UFS clocks to A2NoC + - interconnect: qcom: msm8996: Fix regmap max_register values + - HID: amd_sfh: Fix warning unwind goto + - tomoyo: fix broken dependency on *.conf.default + - RDMA/rxe: Fix inaccurate constants in rxe_type_info + - RDMA/rxe: Prevent faulty rkey generation + - erofs: fix kvcalloc() misuse with __GFP_NOFAIL + - arm64: dts: marvell: AC5/AC5X: Fix address for UART1 + - RDMA/core: Fix ib block iterator counter overflow + - IB/hfi1: Reject a zero-length user expected buffer + - IB/hfi1: Reserve user expected TIDs + - IB/hfi1: Fix expected receive setup error exit issues + - IB/hfi1: Immediately remove invalid memory from hardware + - IB/hfi1: Remove user expected buffer invalidate race + - affs: initialize fsdata in affs_truncate() + - PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() + - arm64: dts: qcom: msm8992: Don't use sfpb mutex + - arm64: dts: qcom: msm8992-libra: Fix the memory map + - kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux + - kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y + - phy: ti: fix Kconfig warning and operator precedence + - drm/msm/gpu: Fix potential double-free + - NFSD: fix use-after-free in nfsd4_ssc_setup_dul() + - ARM: dts: at91: sam9x60: fix the ddr clock for sam9x60 + - drm/vc4: bo: Fix drmm_mutex_init memory hog + - phy: usb: sunplus: Fix potential null-ptr-deref in sp_usb_phy_probe() + - bpf: hash map, avoid deadlock with suitable hash mask + - amd-xgbe: TX Flow Ctrl Registers are h/w ver dependent + - amd-xgbe: Delay AN timeout during KR training + - bpf: Fix pointer-leak due to insufficient speculative store bypass + mitigation + - drm/vc4: bo: Fix unused variable warning + - phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in + rockchip_usb2phy_power_on() + - net: nfc: Fix use-after-free in local_cleanup() + - net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs + - net: enetc: avoid deadlock in enetc_tx_onestep_tstamp() + - net: lan966x: add missing fwnode_handle_put() for ports node + - sch_htb: Avoid grafting on htb_destroy_class_offload when destroying htb + - gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock + - gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode + - wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid + - pinctrl: rockchip: fix reading pull type on rk3568 + - net: stmmac: Fix queue statistics reading + - net/sched: sch_taprio: fix possible use-after-free + - l2tp: convert l2tp_tunnel_list to idr + - l2tp: close all race conditions in l2tp_tunnel_register() + - net: usb: sr9700: Handle negative len + - net: mdio: validate parameter addr in mdiobus_get_phy() + - HID: check empty report_list in hid_validate_values() + - HID: check empty report_list in bigben_probe() + - net: stmmac: fix invalid call to mdiobus_get_phy() + - pinctrl: rockchip: fix mux route data for rk3568 + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcor-som + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcom-som + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp157c-emstamp-argon + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp151a-prtt1l + - HID: revert CHERRY_MOUSE_000C quirk + - block/rnbd-clt: fix wrong max ID in ida_alloc_max + - usb: ucsi: Ensure connector delayed work items are flushed + - usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait + - usb: gadget: f_fs: Ensure ep0req is dequeued before free_request + - netfilter: conntrack: handle tcp challenge acks during connection reuse + - Bluetooth: Fix a buffer overflow in mgmt_mesh_add() + - Bluetooth: hci_conn: Fix memory leaks + - Bluetooth: hci_sync: fix memory leak in hci_update_adv_data() + - Bluetooth: ISO: Avoid circular locking dependency + - Bluetooth: ISO: Fix possible circular locking dependency + - Bluetooth: hci_event: Fix Invalid wait context + - Bluetooth: Fix possible deadlock in rfcomm_sk_state_change + - net: ipa: disable ipa interrupt during suspend + - net/mlx5e: Avoid false lock dependency warning on tc_ht even more + - net/mlx5: E-switch, Fix setting of reserved fields on + MODIFY_SCHEDULING_ELEMENT + - net/mlx5e: QoS, Fix wrongfully setting parent_element_id on + MODIFY_SCHEDULING_ELEMENT + - net/mlx5e: Set decap action based on attr for sample + - net/mlx5: E-switch, Fix switchdev mode after devlink reload + - net: mlx5: eliminate anonymous module_init & module_exit + - drm/panfrost: fix GENERIC_ATOMIC64 dependency + - dmaengine: Fix double increment of client_count in dma_chan_get() + - net: macb: fix PTP TX timestamp failure due to packet padding + - virtio-net: correctly enable callback during start_xmit + - l2tp: prevent lockdep issue in l2tp_tunnel_register() + - HID: betop: check shape of output reports + - drm/i915/selftests: Unwind hugepages to drop wakeref on error + - cifs: fix potential deadlock in cache_refresh_path() + - dmaengine: xilinx_dma: call of_node_put() when breaking out of + for_each_child_of_node() + - dmaengine: tegra: Fix memory leak in terminate_all() + - phy: phy-can-transceiver: Skip warning if no "max-bitrate" + - drm/amd/display: fix issues with driver unload + - net: sched: gred: prevent races when adding offloads to stats + - nvme-pci: fix timeout request state check + - tcp: avoid the lookup process failing to get sk in ehash table + - usb: dwc3: fix extcon dependency + - ptdma: pt_core_execute_cmd() should use spinlock + - device property: fix of node refcount leak in + fwnode_graph_get_next_endpoint() + - w1: fix deadloop in __w1_remove_master_device() + - w1: fix WARNING after calling w1_process() + - driver core: Fix test_async_probe_init saves device in wrong array + - selftests/net: toeplitz: fix race on tpacket_v3 block close + - net: dsa: microchip: ksz9477: port map correction in ALU table entry + register + - thermal: Validate new state in cur_state_store() + - thermal/core: fix error code in __thermal_cooling_device_register() + - thermal: core: call put_device() only after device_register() fails + - net: stmmac: enable all safety features by default + - bnxt: Do not read past the end of test names + - tcp: fix rate_app_limited to default to 1 + - scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace + - ASoC: SOF: pm: Set target state earlier + - ASoC: SOF: pm: Always tear down pipelines before DSP suspend + - ASoC: SOF: Add FW state to debugfs + - ASoC: amd: yc: Add Razer Blade 14 2022 into DMI table + - spi: cadence: Fix busy cycles calculation + - cpufreq: CPPC: Add u64 casts to avoid overflowing + - cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist + - ASoC: mediatek: mt8186: support rt5682s_max98360 + - ASoC: mediatek: mt8186: Add machine support for max98357a + - ASoC: amd: yc: Add ASUS M5402RA into DMI table + - ASoC: support machine driver with max98360 + - kcsan: test: don't put the expect array on the stack + - cpufreq: Add SM6375 to cpufreq-dt-platdev blocklist + - ASoC: fsl_micfil: Correct the number of steps on SX controls + - drm/msm/a6xx: Avoid gx gbit halt during rpm suspend + - net: usb: cdc_ether: add support for Thales Cinterion PLS62-W modem + - drm: Add orientation quirk for Lenovo ideapad D330-10IGL + - s390/debug: add _ASM_S390_ prefix to header guard + - s390: expicitly align _edata and _end symbols on page boundary + - xen/pvcalls: free active map buffer on pvcalls_front_free_map + - perf/x86/cstate: Add Meteor Lake support + - perf/x86/msr: Add Meteor Lake support + - perf/x86/msr: Add Emerald Rapids + - perf/x86/intel/uncore: Add Emerald Rapids + - nolibc: fix fd_set type + - tools/nolibc: Fix S_ISxxx macros + - tools/nolibc: fix missing includes causing build issues at -O0 + - tools/nolibc: prevent gcc from making memset() loop over itself + - cpufreq: armada-37xx: stop using 0 as NULL pointer + - ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC + - ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets + - ACPI: resource: Skip IRQ override on Asus Expertbook B2402CBA + - drm/amdkfd: Add sync after creating vram bo + - drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU + - cifs: fix potential memory leaks in session setup + - spi: spidev: remove debug messages that access spidev->spi without locking + - KVM: s390: interrupt: use READ_ONCE() before cmpxchg() + - scsi: hisi_sas: Use abort task set to reset SAS disks when discovered + - scsi: hisi_sas: Set a port invalid only if there are no devices attached + when refreshing port id + - r8152: add vendor/device ID pair for Microsoft Devkit + - platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD + - platform/x86: asus-nb-wmi: Add alternate mapping for KEY_CAMERA + - platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK + - platform/x86: asus-wmi: Add quirk wmi_ignore_fan + - platform/x86: asus-wmi: Ignore fan on E410MA + - platform/x86: simatic-ipc: correct name of a model + - platform/x86: simatic-ipc: add another model + - lockref: stop doing cpu_relax in the cmpxchg loop + - ata: pata_cs5535: Don't build on UML + - firmware: coreboot: Check size of table entry and use flex-array + - btrfs: zoned: enable metadata over-commit for non-ZNS setup + - Revert "selftests/bpf: check null propagation only neither reg is + PTR_TO_BTF_ID" + - arm64: efi: Recover from synchronous exceptions occurring in firmware + - arm64: efi: Avoid workqueue to check whether EFI runtime is live + - arm64: efi: Account for the EFI runtime stack in stack unwinder + - Bluetooth: hci_sync: cancel cmd_timer if hci_open failed + - drm/i915: Allow panel fixed modes to have differing sync polarities + - drm/i915: Allow alternate fixed modes always for eDP + - drm/amdgpu: complete gfxoff allow signal during suspend without delay + - io_uring/msg_ring: fix remote queue to disabled ring + - wifi: mac80211: Proper mark iTXQs for resumption + - wifi: mac80211: Fix iTXQ AMPDU fragmentation handling + - sched/fair: Check if prev_cpu has highest spare cap in feec() + - sched/uclamp: Fix a uninitialized variable warnings + - vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp() + - scsi: hpsa: Fix allocation size for scsi_host_alloc() + - kvm/vfio: Fix potential deadlock on vfio group_lock + - nfsd: don't free files unconditionally in __nfsd_file_cache_purge + - module: Don't wait for GOING modules + - ftrace: Export ftrace_free_filter() to modules + - tracing: Make sure trace_printk() can output as soon as it can be used + - trace_events_hist: add check for return value of 'create_hist_field' + - ftrace/scripts: Update the instructions for ftrace-bisect.sh + - cifs: Fix oops due to uncleared server->smbd_conn in reconnect + - ksmbd: add max connections parameter + - ksmbd: do not sign response to session request for guest login + - ksmbd: downgrade ndr version error message to debug + - ksmbd: limit pdu length size according to connection status + - ovl: fix tmpfile leak + - ovl: fail on invalid uid/gid mapping at copy up + - io_uring/net: cache provided buffer group value for multishot receives + - KVM: x86/vmx: Do not skip segment attributes if unusable bit is set + - KVM: arm64: GICv4.1: Fix race with doorbell on VPE activation/deactivation + - scsi: ufs: core: Fix devfreq deadlocks + - riscv: fix -Wundef warning for CONFIG_RISCV_BOOT_SPINWAIT + - thermal: intel: int340x: Protect trip temperature from concurrent updates + - regulator: dt-bindings: samsung,s2mps14: add lost samsung,ext-control-gpios + - ipv6: fix reachability confirmation with proxy_ndp + - ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment + - EDAC/device: Respect any driver-supplied workqueue polling value + - EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info + - platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms + - drm/display/dp_mst: Correct the kref of port. + - drm/amd/pm: add missing AllowIHInterrupt message mapping for SMU13.0.0 + - drm/amdgpu: remove unconditional trap enable on add gfx11 queues + - drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments + - drm/amdgpu/display/mst: limit payload to be updated one by one + - drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD + - io_uring: inline io_req_task_work_add() + - io_uring: inline __io_req_complete_post() + - io_uring: hold locks for io_req_complete_failed + - io_uring: use io_req_task_complete() in timeout + - io_uring: remove io_req_tw_post_queue + - io_uring: inline __io_req_complete_put() + - net: mana: Fix IRQ name - add PCI and queue number + - io_uring: always prep_async for drain requests + - i2c: designware: use casting of u64 in clock multiplication to avoid + overflow + - i2c: designware: Fix unbalanced suspended flag + - drm/drm_vma_manager: Add drm_vma_node_allow_once() + - drm/i915: Fix a memory leak with reused mmap_offset + - iavf: fix temporary deadlock and failure to set MAC address + - iavf: schedule watchdog immediately when changing primary MAC + - netlink: prevent potential spectre v1 gadgets + - net: fix UaF in netns ops registration error path + - net: fec: Use page_pool_put_full_page when freeing rx buffers + - nvme: simplify transport specific device attribute handling + - nvme: consolidate setting the tagset flags + - nvme-fc: fix initialization order + - drm/i915/selftest: fix intel_selftest_modify_policy argument types + - ACPI: video: Add backlight=native DMI quirk for HP Pavilion g6-1d80nr + - ACPI: video: Add backlight=native DMI quirk for HP EliteBook 8460p + - ACPI: video: Add backlight=native DMI quirk for Asus U46E + - netfilter: nft_set_rbtree: Switch to node list walk for overlap detection + - netfilter: nft_set_rbtree: skip elements in transaction from garbage + collection + - netlink: annotate data races around nlk->portid + - netlink: annotate data races around dst_portid and dst_group + - netlink: annotate data races around sk_state + - ipv4: prevent potential spectre v1 gadget in ip_metrics_convert() + - ipv4: prevent potential spectre v1 gadget in fib_metrics_match() + - net: dsa: microchip: fix probe of I2C-connected KSZ8563 + - net: ethernet: adi: adin1110: Fix multicast offloading + - netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE + - netrom: Fix use-after-free of a listening socket. + - platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting + - platform/x86: apple-gmux: Move port defines to apple-gmux.h + - platform/x86: apple-gmux: Add apple_gmux_detect() helper + - ACPI: video: Fix apple gmux detection + - tracing/osnoise: Use built-in RCU list checking + - net/sched: sch_taprio: do not schedule in taprio_reset() + - sctp: fail if no bound addresses can be used for a given scope + - riscv/kprobe: Fix instruction simulation of JALR + - nvme: fix passthrough csi check + - gpio: mxc: Unlock on error path in mxc_flip_edge() + - gpio: ep93xx: Fix port F hwirq numbers in handler + - net: ravb: Fix lack of register setting after system resumed for Gen3 + - net: ravb: Fix possible hang if RIS2_QFF1 happen + - net: mctp: add an explicit reference from a mctp_sk_key to sock + - net: mctp: move expiry timer delete to unhash + - net: mctp: hold key reference when looking up a general key + - net: mctp: mark socks as dead on unhash, prevent re-add + - thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type() + - riscv: Move call to init_cpu_topology() to later initialization stage + - net/tg3: resolve deadlock in tg3_reset_task() during EEH + - tsnep: Fix TX queue stop/wake for multiple queues + - net: mdio-mux-meson-g12a: force internal PHY off on mux switch + - Partially revert "perf/arm-cmn: Optimise DTC counter accesses" + - block: ublk: move ublk_chr_class destroying after devices are removed + - treewide: fix up files incorrectly marked executable + - tools: gpio: fix -c option of gpio-event-mon + - Fix up more non-executable files marked executable + - Revert "mm/compaction: fix set skip in fast_find_migrateblock" + - Revert "Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI + mode" + - Input: i8042 - add Clevo PCX0DX to i8042 quirk table + - x86/sev: Add SEV-SNP guest feature negotiation support + - acpi: Fix suspend with Xen PV + - dt-bindings: riscv: fix underscore requirement for multi-letter extensions + - dt-bindings: riscv: fix single letter canonical order + - x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL + - dt-bindings: i2c: renesas,rzv2m: Fix SoC specific string + - netfilter: conntrack: unify established states for SCTP paths + - perf/x86/amd: fix potential integer overflow on shift of a int + - amdgpu: fix build on non-DCN platforms. + - Linux 6.1.9 + - upstream stable to v6.1.9 + + * Lunar update: v6.1.8 upstream stable release (LP: #2004147) + - dma-buf: fix dma_buf_export init order v2 + - btrfs: fix trace event name typo for FLUSH_DELAYED_REFS + - wifi: iwlwifi: fw: skip PPAG for JF + - pNFS/filelayout: Fix coalescing test for single DS + - selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID + - net: ethernet: marvell: octeontx2: Fix uninitialized variable warning + - tools/virtio: initialize spinlocks in vring_test.c + - vdpa/mlx5: Return error on vlan ctrl commands if not supported + - vdpa/mlx5: Avoid using reslock in event_handler + - vdpa/mlx5: Avoid overwriting CVQ iotlb + - virtio_pci: modify ENOENT to EINVAL + - vduse: Validate vq_num in vduse_validate_config() + - vdpa_sim_net: should not drop the multicast/broadcast packet + - net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats + - r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down() + - r8169: fix dmar pte write access is not set error + - bpf: keep a reference to the mm, in case the task is dead. + - RDMA/srp: Move large values to a new enum for gcc13 + - btrfs: always report error in run_one_delayed_ref() + - x86/asm: Fix an assembler warning with current binutils + - f2fs: let's avoid panic if extent_tree is not created + - perf/x86/rapl: Treat Tigerlake like Icelake + - cifs: fix race in assemble_neg_contexts() + - memblock tests: Fix compilation error. + - perf/x86/rapl: Add support for Intel Meteor Lake + - perf/x86/rapl: Add support for Intel Emerald Rapids + - of: fdt: Honor CONFIG_CMDLINE* even without /chosen node, take 2 + - fbdev: omapfb: avoid stack overflow warning + - Bluetooth: hci_sync: Fix use HCI_OP_LE_READ_BUFFER_SIZE_V2 + - Bluetooth: hci_qca: Fix driver shutdown on closed serdev + - wifi: brcmfmac: fix regression for Broadcom PCIe wifi devices + - wifi: mac80211: fix MLO + AP_VLAN check + - wifi: mac80211: reset multiple BSSID options in stop_ap() + - wifi: mac80211: sdata can be NULL during AMPDU start + - wifi: mac80211: fix initialization of rx->link and rx->link_sta + - nommu: fix memory leak in do_mmap() error path + - nommu: fix do_munmap() error path + - nommu: fix split_vma() map_count error + - proc: fix PIE proc-empty-vm, proc-pid-vm tests + - Add exception protection processing for vd in axi_chan_handle_err function + - LoongArch: Add HWCAP_LOONGARCH_CPUCFG to elf_hwcap + - zonefs: Detect append writes at invalid locations + - nilfs2: fix general protection fault in nilfs_btree_insert() + - mm/shmem: restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE + - hugetlb: unshare some PMDs when splitting VMAs + - mm/khugepaged: fix collapse_pte_mapped_thp() to allow anon_vma + - serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ + handler + - Revert "serial: stm32: Merge hard IRQ and threaded IRQ handling into single + IRQ handler" + - xhci-pci: set the dma max_seg_size + - usb: xhci: Check endpoint is valid before dereferencing it + - xhci: Fix null pointer dereference when host dies + - xhci: Add update_hub_device override for PCI xHCI hosts + - xhci: Add a flag to disable USB3 lpm on a xhci root port level. + - usb: acpi: add helper to check port lpm capability using acpi _DSM + - xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables + - prlimit: do_prlimit needs to have a speculation check + - USB: serial: option: add Quectel EM05-G (GR) modem + - USB: serial: option: add Quectel EM05-G (CS) modem + - USB: serial: option: add Quectel EM05-G (RS) modem + - USB: serial: option: add Quectel EC200U modem + - USB: serial: option: add Quectel EM05CN (SG) modem + - USB: serial: option: add Quectel EM05CN modem + - staging: vchiq_arm: fix enum vchiq_status return types + - USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100 + - usb: misc: onboard_hub: Invert driver registration order + - usb: misc: onboard_hub: Move 'attach' work to the driver + - misc: fastrpc: Fix use-after-free and race in fastrpc_map_find + - misc: fastrpc: Don't remove map on creater_process and device_release + - misc: fastrpc: Fix use-after-free race condition for maps + - usb: core: hub: disable autosuspend for TI TUSB8041 + - comedi: adv_pci1760: Fix PWM instruction handling + - ACPI: PRM: Check whether EFI runtime is available + - mmc: sunxi-mmc: Fix clock refcount imbalance during unbind + - mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting + - mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() + - mm/hugetlb: fix uffd-wp handling for migration entries in + hugetlb_change_protection() + - mm/hugetlb: pre-allocate pgtable pages for uffd wr-protects + - mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA + - mm/MADV_COLLAPSE: don't expand collapse when vm_end is past requested end + - btrfs: add extra error messages to cover non-ENOMEM errors from + device_add_list() + - btrfs: fix missing error handling when logging directory items + - btrfs: fix directory logging due to race with concurrent index key deletion + - btrfs: add missing setup of log for full commit at add_conflicting_inode() + - btrfs: do not abort transaction on failure to write log tree when syncing + log + - btrfs: do not abort transaction on failure to update log root + - btrfs: qgroup: do not warn on record without old_roots populated + - btrfs: fix invalid leaf access due to inline extent during lseek + - btrfs: fix race between quota rescan and disable leading to NULL pointer + deref + - cifs: do not include page data when checking signature + - thunderbolt: Disable XDomain lane 1 only in software connection manager + - thunderbolt: Use correct function to calculate maximum USB3 link rate + - thunderbolt: Do not report errors if on-board retimers are found + - thunderbolt: Do not call PM runtime functions in tb_retimer_scan() + - riscv: dts: sifive: fu740: fix size of pcie 32bit memory + - bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and + PERF_BPF_EVENT_PROG_UNLOAD + - tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer + - tty: fix possible null-ptr-defer in spk_ttyio_release + - pktcdvd: check for NULL returna fter calling bio_split_to_limits() + - io_uring/poll: don't reissue in case of poll race on multishot request + - mptcp: explicitly specify sock family at subflow creation time + - mptcp: netlink: respect v4/v6-only sockets + - selftests: mptcp: userspace: validate v4-v6 subflows mix + - USB: gadgetfs: Fix race between mounting and unmounting + - USB: serial: cp210x: add SCALANCE LPE-9000 device id + - usb: cdns3: remove fetched trb from cache before dequeuing + - usb: host: ehci-fsl: Fix module alias + - usb: musb: fix error return code in omap2430_probe() + - usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail + - usb: typec: altmodes/displayport: Add pin assignment helper + - usb: typec: altmodes/displayport: Fix pin assignment calculation + - usb: gadget: g_webcam: Send color matching descriptor per frame + - USB: gadget: Add ID numbers to configfs-gadget driver names + - usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate() + - usb-storage: apply IGNORE_UAS only for HIKSEMI MD202 on RTL9210 + - arm64: dts: imx8mp: correct usb clocks + - dt-bindings: phy: g12a-usb2-phy: fix compatible string documentation + - dt-bindings: phy: g12a-usb3-pcie-phy: fix compatible string documentation + - serial: pch_uart: Pass correct sg to dma_unmap_sg() + - dmaengine: lgm: Move DT parsing after initialization + - dmaengine: tegra210-adma: fix global intr clear + - dmaengine: idxd: Let probe fail when workqueue cannot be enabled + - dmaengine: idxd: Prevent use after free on completion memory + - dmaengine: idxd: Do not call DMX TX callbacks during workqueue disable + - serial: amba-pl011: fix high priority character transmission in rs486 mode + - serial: atmel: fix incorrect baudrate setup + - serial: exar: Add support for Sealevel 7xxxC serial cards + - gsmi: fix null-deref in gsmi_get_variable + - mei: bus: fix unlink on bus in error path + - mei: me: add meteor lake point M DID + - VMCI: Use threaded irqs instead of tasklets + - ARM: dts: qcom: apq8084-ifc6540: fix overriding SDHCI + - ARM: omap1: fix !ARCH_OMAP1_ANY link failures + - drm/amdgpu: fix amdgpu_job_free_resources v2 + - drm/amdgpu: allow multipipe policy on ASICs with one MEC + - drm/amdgpu: Correct the power calcultion for Renior/Cezanne. + - drm/i915: re-disable RC6p on Sandy Bridge + - drm/i915/display: Check source height is > 0 + - drm/i915: Allow switching away via vga-switcheroo if uninitialized + - drm/i915: Remove unused variable + - drm/amd/display: Fix set scaling doesn's work + - drm/amd/display: Calculate output_color_space after pixel encoding + adjustment + - drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix + - drm/amd/display: disable S/G display on DCN 3.1.5 + - drm/amd/display: disable S/G display on DCN 3.1.4 + - cifs: reduce roundtrips on create/qinfo requests + - fs/ntfs3: Fix attr_punch_hole() null pointer derenference + - arm64: efi: Execute runtime services from a dedicated stack + - efi: rt-wrapper: Add missing include + - panic: Separate sysctl logic from CONFIG_SMP + - exit: Put an upper limit on how often we can oops + - exit: Expose "oops_count" to sysfs + - exit: Allow oops_limit to be disabled + - panic: Consolidate open-coded panic_on_warn checks + - panic: Introduce warn_limit + - panic: Expose "warn_count" to sysfs + - docs: Fix path paste-o for /sys/kernel/warn_count + - exit: Use READ_ONCE() for all oops/warn limit reads + - x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN + - drm/amdgpu/discovery: enable soc21 common for GC 11.0.4 + - drm/amdgpu/discovery: enable gmc v11 for GC 11.0.4 + - drm/amdgpu/discovery: enable gfx v11 for GC 11.0.4 + - drm/amdgpu/discovery: enable mes support for GC v11.0.4 + - drm/amdgpu: set GC 11.0.4 family + - drm/amdgpu/discovery: set the APU flag for GC 11.0.4 + - drm/amdgpu: add gfx support for GC 11.0.4 + - drm/amdgpu: add gmc v11 support for GC 11.0.4 + - drm/amdgpu/discovery: add PSP IP v13.0.11 support + - drm/amdgpu/pm: enable swsmu for SMU IP v13.0.11 + - drm/amdgpu: add smu 13 support for smu 13.0.11 + - drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.11 + - drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.11 + - drm/amdgpu/pm: use the specific mailbox registers only for SMU IP v13.0.4 + - drm/amdgpu/discovery: enable nbio support for NBIO v7.7.1 + - drm/amdgpu: enable PSP IP v13.0.11 support + - drm/amdgpu: enable GFX IP v11.0.4 CG support + - drm/amdgpu: enable GFX Power Gating for GC IP v11.0.4 + - drm/amdgpu: enable GFX Clock Gating control for GC IP v11.0.4 + - drm/amdgpu: add tmz support for GC 11.0.1 + - drm/amdgpu: add tmz support for GC IP v11.0.4 + - drm/amdgpu: correct MEC number for gfx11 APUs + - octeontx2-pf: Avoid use of GFP_KERNEL in atomic context + - net/ulp: use consistent error code when blocking ULP + - octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt + - net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() + - block: mq-deadline: Rename deadline_is_seq_writes() + - Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()" + - soc: qcom: apr: Make qcom,protection-domain optional again + - Linux 6.1.8 + - upstream stable to v6.1.8 + + * Lunar update: v6.1.7 upstream stable release (LP: #2004146) + - Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing" + - ALSA: control-led: use strscpy in set_led_id() + - ALSA: usb-audio: Always initialize fixed_rate in + snd_usb_find_implicit_fb_sync_format() + - ALSA: hda/realtek - Turn on power early + - ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx + - KVM: x86: Do not return host topology information from + KVM_GET_SUPPORTED_CPUID + - KVM: arm64: Fix S1PTW handling on RO memslots + - efi: fix userspace infinite retry read efivars after EFI runtime services + page fault + - efi: tpm: Avoid READ_ONCE() for accessing the event log + - docs: Fix the docs build with Sphinx 6.0 + - io_uring/poll: add hash if ready poll request can't complete inline + - arm64: mte: Fix double-freeing of the temporary tag storage during coredump + - arm64: mte: Avoid the racy walk of the vma list during core dump + - arm64: cmpxchg_double*: hazard against entire exchange variable + - ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops + - net: stmmac: add aux timestamps fifo clearance wait + - perf auxtrace: Fix address filter duplicate symbol selection + - s390/kexec: fix ipl report address for kdump + - brcmfmac: Prefer DT board type over DMI board type + - ASoC: qcom: lpass-cpu: Fix fallback SD line index handling + - elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} + - cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering + - s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops + - s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple() + - drm/virtio: Fix GEM handle creation UAF + - drm/amd/pm/smu13: BACO is supported when it's in BACO state + - drm: Optimize drm buddy top-down allocation method + - drm/i915/gt: Reset twice + - drm/i915: Reserve enough fence slot for i915_vma_unbind_async + - drm/i915: Fix potential context UAFs + - drm/amdgpu: Fixed bug on error when unloading amdgpu + - drm/amd/pm: correct the reference clock for fan speed(rpm) calculation + - drm/amd/pm: add the missing mapping for PPT feature on SMU13.0.0 and 13.0.7 + - drm/amd/display: move remaining FPU code to dml folder + - Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 + properly"" + - cifs: Fix uninitialized memory read for smb311 posix symlink create + - cifs: fix file info setting in cifs_query_path_info() + - cifs: fix file info setting in cifs_open_file() + - cifs: do not query ifaces on smb1 mounts + - cifs: fix double free on failed kerberos auth + - io_uring/fdinfo: include locked hash table in fdinfo output + - ASoC: rt9120: Make dev PM runtime bind AsoC component PM + - ACPI: video: Allow selecting NVidia-WMI-EC or Apple GMUX backlight from the + cmdline + - platform/x86: dell-privacy: Only register SW_CAMERA_LENS_COVER if present + - platform/surface: aggregator: Ignore command messages not intended for us + - platform/x86: int3472/discrete: Ensure the clk/power enable pins are in + output mode + - platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode + - platform/x86: asus-wmi: Don't load fan curves without fan + - platform/x86: dell-privacy: Fix SW_CAMERA_LENS_COVER reporting + - dt-bindings: msm: dsi-controller-main: Fix operating-points-v2 constraint + - drm/msm: another fix for the headless Adreno GPU + - firmware/psci: Fix MEM_PROTECT_RANGE function numbers + - firmware/psci: Don't register with debugfs if PSCI isn't available + - drm/msm/adreno: Make adreno quirks not overwrite each other + - arm64/signal: Always allocate SVE signal frames on SME only systems + - dt-bindings: msm: dsi-controller-main: Fix power-domain constraint + - dt-bindings: msm: dsi-controller-main: Fix description of core clock + - arm64/signal: Always accept SVE signal frames on SME only systems + - arm64/mm: add pud_user_exec() check in pud_user_accessible_page() + - dt-bindings: msm: dsi-phy-28nm: Add missing qcom, dsi-phy-regulator-ldo-mode + - arm64: ptrace: Use ARM64_SME to guard the SME register enumerations + - arm64/mm: fix incorrect file_map_count for invalid pmd + - platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to + set_fn_lock_led_list[] + - drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux + transfer + - dt-bindings: msm/dsi: Don't require vdds-supply on 10nm PHY + - dt-bindings: msm/dsi: Don't require vcca-supply on 14nm PHY + - platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during + probe + - ixgbe: fix pci device refcount leak + - ipv6: raw: Deduct extension header length in rawv6_push_pending_frames + - iavf/iavf_main: actually log ->src mask when talking about it + - drm/i915/gt: Cleanup partial engine discovery failures + - usb: ulpi: defer ulpi_register on ulpi_read_id timeout + - drm/amd/pm: enable mode1 reset on smu_v13_0_10 + - drm/amd/pm: Enable bad memory page/channel recording support for smu v13_0_0 + - drm/amd/pm: enable GPO dynamic control support for SMU13.0.0 + - drm/amd/pm: enable GPO dynamic control support for SMU13.0.7 + - drm/amdgpu: add soc21 common ip block support for GC 11.0.4 + - drm/amdgpu: Enable pg/cg flags on GC11_0_4 for VCN + - drm/amdgpu: enable VCN DPG for GC IP v11.0.4 + - mm: Always release pages to the buddy allocator in memblock_free_late(). + - iommu/iova: Fix alloc iova overflows issue + - iommu/arm-smmu-v3: Don't unregister on shutdown + - iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() + - iommu/arm-smmu: Don't unregister on shutdown + - iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY even betterer + - sched/core: Fix use-after-free bug in dup_user_cpus_ptr() + - netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() + function. + - selftests: netfilter: fix transaction test script timeout handling + - powerpc/imc-pmu: Fix use of mutex in IRQs disabled section + - x86/boot: Avoid using Intel mnemonics in AT&T syntax asm + - EDAC/device: Fix period calculation in edac_device_reset_delay_period() + - x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case + - x86/resctrl: Fix task CLOSID/RMID update race + - x86/resctrl: Fix event counts regression in reused RMIDs + - regulator: da9211: Use irq handler when ready + - scsi: storvsc: Fix swiotlb bounce buffer leak in confidential VM + - scsi: mpi3mr: Refer CONFIG_SCSI_MPI3MR in Makefile + - scsi: ufs: core: WLUN suspend SSU/enter hibern8 fail recovery + - ASoC: Intel: fix sof-nau8825 link failure + - ASoC: Intel: sof_nau8825: support rt1015p speaker amplifier + - ASoC: Intel: sof-nau8825: fix module alias overflow + - drm/msm/dpu: Fix some kernel-doc comments + - drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path + - ASoC: wm8904: fix wrong outputs volume after power reactivation + - mtd: parsers: scpart: fix __udivdi3 undefined on mips + - mtd: cfi: allow building spi-intel standalone + - ALSA: usb-audio: Make sure to stop endpoints before closing EPs + - ALSA: usb-audio: Relax hw constraints for implicit fb sync + - stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed + - tipc: fix unexpected link reset due to discovery messages + - NFSD: Pass the target nfsd_file to nfsd_commit() + - NFSD: Revert "NFSD: NFSv4 CLOSE should release an nfsd_file immediately" + - NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection + - nfsd: remove the pages_flushed statistic from filecache + - nfsd: reorganize filecache.c + - NFSD: Add an nfsd_file_fsync tracepoint + - nfsd: rework refcounting in filecache + - nfsd: fix handling of cached open files in nfsd4_open codepath + - octeontx2-af: Fix LMAC config in cgx_lmac_rx_tx_enable + - sched/core: Fix arch_scale_freq_tick() on tickless systems + - hvc/xen: lock console list traversal + - nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() + - gro: avoid checking for a failed search + - gro: take care of DODGY packets + - af_unix: selftest: Fix the size of the parameter to connect() + - ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE + - tools/nolibc: restore mips branch ordering in the _start block + - tools/nolibc: fix the O_* fcntl/open macro definitions for riscv + - drm/amdgpu: Fix potential NULL dereference + - ice: Fix potential memory leak in ice_gnss_tty_write() + - ice: Add check for kzalloc + - drm/vmwgfx: Write the driver id registers + - drm/vmwgfx: Refactor resource manager's hashtable to use linux/hashtable + implementation. + - drm/vmwgfx: Remove ttm object hashtable + - drm/vmwgfx: Refactor resource validation hashtable to use linux/hashtable + implementation. + - drm/vmwgfx: Refactor ttm reference object hashtable to use linux/hashtable. + - drm/vmwgfx: Remove vmwgfx_hashtab + - drm/vmwgfx: Remove rcu locks from user resources + - net/sched: act_mpls: Fix warning during failed attribute validation + - Revert "r8169: disable detection of chip version 36" + - net/mlx5: check attr pointer validity before dereferencing it + - net/mlx5e: TC, Keep mod hdr actions after mod hdr alloc + - net/mlx5: Fix command stats access after free + - net/mlx5e: Verify dev is present for fix features ndo + - net/mlx5e: IPoIB, Block queue count configuration when sub interfaces are + present + - net/mlx5e: IPoIB, Block PKEY interfaces with less rx queues than parent + - net/mlx5e: IPoIB, Fix child PKEY interface stats on rx path + - net/mlx5: Fix ptp max frequency adjustment range + - net/mlx5e: Don't support encap rules with gbp option + - net/mlx5e: Fix macsec ssci attribute handling in offload path + - net/mlx5e: Fix macsec possible null dereference when updating MAC security + entity (SecY) + - selftests/net: l2_tos_ttl_inherit.sh: Set IPv6 addresses with "nodad". + - selftests/net: l2_tos_ttl_inherit.sh: Run tests in their own netns. + - selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure. + - octeontx2-pf: Fix resource leakage in VF driver unbind + - perf build: Properly guard libbpf includes + - perf kmem: Support legacy tracepoints + - perf kmem: Support field "node" in evsel__process_alloc_event() coping with + recent tracepoint restructuring + - igc: Fix PPS delta between two synchronized end-points + - net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() + - net: hns3: fix wrong use of rss size during VF rss config + - bnxt: make sure we return pages to the pool + - platform/surface: aggregator: Add missing call to ssam_request_sync_free() + - platform/x86/amd: Fix refcount leak in amd_pmc_probe + - ALSA: usb-audio: Fix possible NULL pointer dereference in + snd_usb_pcm_has_fixed_rate() + - efi: fix NULL-deref in init error path + - io_uring: lock overflowing for IOPOLL + - io_uring/poll: attempt request issue after racy poll wakeup + - drm/i915: Fix CFI violations in gt_sysfs + - io_uring/io-wq: free worker if task_work creation is canceled + - io_uring/io-wq: only free worker if it was allocated for creation + - block: handle bio_split_to_limits() NULL return + - Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout" + - pinctrl: amd: Add dynamic debugging for active GPIOs + - Linux 6.1.7 + - upstream stable to v6.1.7 + + * Move kernel ADT tests to python3 (LP: #2004429) + - [Debian] Use a python3 compatable kernel-testing repo + + * Miscellaneous Ubuntu changes + - [Packaging]: Sync annotations scripts from git + - [Config] Update annotations after syncing the scripts + - [Config] Update annotations after merging 6.1.13 + + -- Timo Aaltonen Fri, 03 Mar 2023 11:27:39 +0200 + linux-oem-6.1 (6.1.0-1007.7) jammy; urgency=medium * jammy/linux-oem-6.1: 6.1.0-1007.7 -proposed tracker (LP: #2006571) diff -u linux-oem-6.1-6.1.0/debian.oem/config/annotations linux-oem-6.1-6.1.0/debian.oem/config/annotations --- linux-oem-6.1-6.1.0/debian.oem/config/annotations +++ linux-oem-6.1-6.1.0/debian.oem/config/annotations @@ -3,6 +3,621 @@ # ARCH: amd64 # FLAVOUR: amd64-oem +CONFIG_ACCESSIBILITY policy<{'amd64': 'y'}> +CONFIG_ACCESSIBILITY note<'LP: #1967702'> + +CONFIG_ACPI_CUSTOM_METHOD policy<{'amd64': 'n'}> +CONFIG_ACPI_CUSTOM_METHOD note<'SECURITY: allows arbitrary execution'> + +CONFIG_AGP policy<{'amd64': 'y'}> +CONFIG_AGP note<'not autoloadable'> + +CONFIG_ASYMMETRIC_KEY_TYPE policy<{'amd64': 'y'}> +CONFIG_ASYMMETRIC_KEY_TYPE note<'module signing'> + +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE policy<{'amd64': 'y'}> +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE note<'module signing'> + +CONFIG_ATA_PIIX policy<{'amd64': 'y'}> +CONFIG_ATA_PIIX note<'LP: #1627324'> + +CONFIG_BINFMT_SCRIPT policy<{'amd64': 'y'}> +CONFIG_BINFMT_SCRIPT note<'required if init is a shell script such as in initramfs-tools'> + +CONFIG_BLK_DEV_DM policy<{'amd64': 'y'}> +CONFIG_BLK_DEV_DM note<'LP: #560717'> + +CONFIG_BLK_DEV_NVME policy<{'amd64': 'm'}> +CONFIG_BLK_DEV_NVME note<'LP: #1759893'> + +CONFIG_BLK_DEV_RAM policy<{'amd64': 'm'}> +CONFIG_BLK_DEV_RAM note<'LP: #1593293'> + +CONFIG_BLK_DEV_RAM_SIZE policy<{'amd64': '65536'}> +CONFIG_BLK_DEV_RAM_SIZE note<'Ramdisk size should be a minimum of 64M'> + +CONFIG_BLK_DEV_SD policy<{'amd64': 'y'}> +CONFIG_BLK_DEV_SD note<'LP: #1627330'> + +CONFIG_BLK_DEV_SR policy<{'amd64': 'y'}> +CONFIG_BLK_DEV_SR note<'LP: #1627330'> + +CONFIG_BLK_DEV_THROTTLING policy<{'amd64': 'y'}> +CONFIG_BLK_DEV_THROTTLING note<'CGROUP disk consumption control'> + +CONFIG_BPF_UNPRIV_DEFAULT_OFF policy<{'amd64': 'y'}> +CONFIG_BPF_UNPRIV_DEFAULT_OFF note<'security reason'> + +CONFIG_CHR_DEV_SG policy<{'amd64': 'y'}> +CONFIG_CHR_DEV_SG note<'not autoloadable'> + +CONFIG_CMA policy<{'amd64': 'n'}> +CONFIG_CMA note<'LP: #1803206'> + +CONFIG_COMPAT_BRK policy<{'amd64': 'n'}> +CONFIG_COMPAT_BRK note<'disables brk ASLR'> + +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE policy<{'amd64': 'n'}> +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE note<'for bootspeed'> + +CONFIG_CPU_FREQ_GOV_CONSERVATIVE policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_GOV_CONSERVATIVE note<'not autoloadable'> + +CONFIG_CPU_FREQ_GOV_ONDEMAND policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_GOV_ONDEMAND note<'not autoloadable'> + +CONFIG_CPU_FREQ_GOV_PERFORMANCE policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_GOV_PERFORMANCE note<'not autoloadable'> + +CONFIG_CPU_FREQ_GOV_POWERSAVE policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_GOV_POWERSAVE note<'not autoloadable'> + +CONFIG_CPU_FREQ_GOV_USERSPACE policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_GOV_USERSPACE note<'not autoloadable'> + +CONFIG_CPU_FREQ_STAT policy<{'amd64': 'y'}> +CONFIG_CPU_FREQ_STAT note<'dependancy of boot essential'> + +CONFIG_CRASH_DUMP policy<{'amd64': 'y'}> +CONFIG_CRASH_DUMP note<'LP: #1363180'> + +CONFIG_CRYPTO_SHA512 policy<{'amd64': 'y'}> +CONFIG_CRYPTO_SHA512 note<'module signing'> + +CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE policy<{'amd64': 'n'}> +CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE note<'Obsolete w/ no known userspace dependencies'> + +CONFIG_DEBUG_FS policy<{'amd64': 'y'}> +CONFIG_DEBUG_FS note<'required debug option'> + +CONFIG_DEBUG_INFO policy<{'amd64': 'y'}> +CONFIG_DEBUG_INFO note<'required for debug packages'> + +CONFIG_DEBUG_INFO_BTF policy<{'amd64': 'y'}> +CONFIG_DEBUG_INFO_BTF note<'Needs newer pahole for armhf'> + +CONFIG_DEBUG_INFO_SPLIT policy<{'amd64': 'n'}> +CONFIG_DEBUG_INFO_SPLIT note<'LP: #1413664'> + +CONFIG_DEBUG_KERNEL policy<{'amd64': 'y'}> +CONFIG_DEBUG_KERNEL note<'required debug option'> + +CONFIG_DEFAULT_MMAP_MIN_ADDR policy<{'amd64': '65536'}> +CONFIG_DEFAULT_MMAP_MIN_ADDR note<'LP: #1531327'> + +CONFIG_DEVTMPFS policy<{'amd64': 'y'}> +CONFIG_DEVTMPFS note<'upstart requirement'> + +CONFIG_DEVTMPFS_MOUNT policy<{'amd64': 'y'}> +CONFIG_DEVTMPFS_MOUNT note<'upstart requirement'> + +CONFIG_DRM_AMDGPU_CIK policy<{'amd64': 'y'}> +CONFIG_DRM_AMDGPU_CIK note<'for zesty'> + +CONFIG_DRM_LEGACY policy<{'amd64': 'n'}> +CONFIG_DRM_LEGACY note<'Consider re-enabling but not signing the modules'> + +CONFIG_DRM_MGAG200 policy<{'amd64': 'm'}> +CONFIG_DRM_MGAG200 note<'LP: #1693337'> + +CONFIG_DRM_VBOXVIDEO policy<{'amd64': 'm'}> +CONFIG_DRM_VBOXVIDEO note<'LP: #1718679'> + +CONFIG_DVB_DUMMY_FE policy<{'amd64': 'm'}> +CONFIG_DVB_DUMMY_FE note<'expert use only'> + +CONFIG_ECRYPT_FS policy<{'amd64': 'y'}> +CONFIG_ECRYPT_FS note<'not autoloadable'> + +CONFIG_EFIVAR_FS policy<{'amd64': 'y'}> +CONFIG_EFIVAR_FS note<'needed for variable EFI update'> + +CONFIG_EVM policy<{'amd64': 'y'}> +CONFIG_EVM note<'LP: #1643652'> + +CONFIG_EVM_ATTR_FSUUID policy<{'amd64': 'y'}> +CONFIG_EVM_ATTR_FSUUID note<'LP: #1643652'> + +CONFIG_EVM_LOAD_X509 policy<{'amd64': 'n'}> +CONFIG_EVM_LOAD_X509 note<'LP: #1643652'> + +CONFIG_EXT2_FS policy<{'amd64': 'n'}> +CONFIG_EXT2_FS note<'ext4 handling via EXT4_USE_FOR_EXT23'> + +CONFIG_EXT3_FS policy<{'amd64': 'n'}> +CONFIG_EXT3_FS note<'ext4 handling via EXT4_USE_FOR_EXT23'> + +CONFIG_FHANDLE policy<{'amd64': 'y'}> +CONFIG_FHANDLE note<'LP: #1412543'> + +CONFIG_FUSE_FS policy<{'amd64': 'y'}> +CONFIG_FUSE_FS note<'not autoloadable'> + +CONFIG_FW_LOADER_USER_HELPER_FALLBACK policy<{'amd64': 'n'}> +CONFIG_FW_LOADER_USER_HELPER_FALLBACK note<'LP: #1398458'> + +CONFIG_GPIO_CDEV_V1 policy<{'amd64': 'y'}> +CONFIG_GPIO_CDEV_V1 note<'LP: #1953613'> + +CONFIG_GPIO_TWL4030 policy<{'amd64': 'm'}> +CONFIG_GPIO_TWL4030 note<'LP: #921934'> + +CONFIG_HIBERNATION policy<{'amd64': 'y'}> +CONFIG_HIBERNATION note<'LP: #1867753'> + +CONFIG_HOTPLUG_PCI_PCIE policy<{'amd64': 'y'}> +CONFIG_HOTPLUG_PCI_PCIE note<'LP: #1374440'> + +CONFIG_HOTPLUG_PCI_SHPC policy<{'amd64': 'y'}> +CONFIG_HOTPLUG_PCI_SHPC note<'LP: #1374440'> + +CONFIG_I2C_CHARDEV policy<{'amd64': 'y'}> +CONFIG_I2C_CHARDEV note<'LP: #1417032'> + +CONFIG_IDLE_PAGE_TRACKING policy<{'amd64': 'y'}> +CONFIG_IDLE_PAGE_TRACKING note<'is there a cost associated with this?'> + +CONFIG_IIO_SIMPLE_DUMMY_BUFFER policy<{'amd64': 'n'}> +CONFIG_IIO_SIMPLE_DUMMY_BUFFER note<'dummy driver'> + +CONFIG_IIO_SIMPLE_DUMMY_EVENTS policy<{'amd64': 'n'}> +CONFIG_IIO_SIMPLE_DUMMY_EVENTS note<'dummy driver'> + +CONFIG_IMA policy<{'amd64': 'y'}> +CONFIG_IMA note<'LP: #1643652'> + +CONFIG_IMA_APPRAISE policy<{'amd64': 'y'}> +CONFIG_IMA_APPRAISE note<'LP: #1643652'> + +CONFIG_IMA_ARCH_POLICY policy<{'amd64': 'y'}> +CONFIG_IMA_ARCH_POLICY note<'LP: #1866909'> + +CONFIG_IMA_BLACKLIST_KEYRING policy<{'amd64': 'n'}> +CONFIG_IMA_BLACKLIST_KEYRING note<'LP: #1667490'> + +CONFIG_IMA_DEFAULT_HASH_SHA256 policy<{'amd64': 'n'}> +CONFIG_IMA_DEFAULT_HASH_SHA256 note<'LP: #1643652'> + +CONFIG_IMA_KEXEC policy<{'amd64': 'y'}> +CONFIG_IMA_KEXEC note<'LP: #1643652'> + +CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY policy<{'amd64': 'n'}> +CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY note<'LP: #1667490'> + +CONFIG_IMA_LOAD_X509 policy<{'amd64': 'n'}> +CONFIG_IMA_LOAD_X509 note<'LP: #1643652'> + +CONFIG_IMA_READ_POLICY policy<{'amd64': 'n'}> +CONFIG_IMA_READ_POLICY note<'LP: #1866909'> + +CONFIG_IMA_SIG_TEMPLATE policy<{'amd64': 'n'}> +CONFIG_IMA_SIG_TEMPLATE note<'LP: #1643652'> + +CONFIG_IMA_TRUSTED_KEYRING policy<{'amd64': 'y'}> +CONFIG_IMA_TRUSTED_KEYRING note<'LP: #1643652'> + +CONFIG_IMA_WRITE_POLICY policy<{'amd64': 'n'}> +CONFIG_IMA_WRITE_POLICY note<'LP: #1667490'> + +CONFIG_INPUT_UINPUT policy<{'amd64': 'y'}> +CONFIG_INPUT_UINPUT note<'LP: #584812'> + +CONFIG_INTEGRITY_PLATFORM_KEYRING policy<{'amd64': 'y'}> +CONFIG_INTEGRITY_PLATFORM_KEYRING note<'Required for lockdown'> + +CONFIG_INTEL_IOMMU_DEFAULT_ON policy<{'amd64': 'n'}> +CONFIG_INTEL_IOMMU_DEFAULT_ON note<'the IOMMU can trigger boot failures'> + +CONFIG_IOMMU_DEBUGFS policy<{'amd64': 'n'}> +CONFIG_IOMMU_DEBUGFS note<'LP: #1861057'> + +CONFIG_IPDDP policy<{'amd64': 'n'}> +CONFIG_IPDDP note<'LP: #1559772'> + +CONFIG_IPV6 policy<{'amd64': 'y'}> +CONFIG_IPV6 note<'if this is a module we get a module load for every ipv6 packet'> + +CONFIG_IP_PNP policy<{'amd64': 'n'}> +CONFIG_IP_PNP note<'LP: #1259861'> + +CONFIG_KERNEL_ZSTD policy<{'amd64': 'y'}> +CONFIG_KERNEL_ZSTD note<'LP: #1931725'> + +CONFIG_KEXEC_BZIMAGE_VERIFY_SIG policy<{'amd64': 'y'}> +CONFIG_KEXEC_BZIMAGE_VERIFY_SIG note<'Q: check this is in sync with the kexec/kdump userspace'> + +CONFIG_KFENCE_STATIC_KEYS policy<{'amd64': 'n'}> +CONFIG_KFENCE_STATIC_KEYS note<'LP: #1948038'> + +CONFIG_KGDB_SERIAL_CONSOLE policy<{'amd64': 'y'}> +CONFIG_KGDB_SERIAL_CONSOLE note<'early debugging support'> + +CONFIG_KVM policy<{'amd64': 'm'}> +CONFIG_KVM note<'LP: #1532886'> + +CONFIG_LATENCYTOP policy<{'amd64': 'n'}> +CONFIG_LATENCYTOP note<'LP: #1655986'> + +CONFIG_LOCALVERSION_AUTO policy<{'amd64': 'n'}> +CONFIG_LOCALVERSION_AUTO note<'triggers packaging failures'> + +CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE policy<{'amd64': 'y'}> +CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE note<'LP: #1848492'> + +CONFIG_MFD_SM501 policy<{'amd64': 'm'}> +CONFIG_MFD_SM501 note<'boot essential on OMAP4'> + +CONFIG_MMC_BLOCK policy<{'amd64': 'm'}> +CONFIG_MMC_BLOCK note<'boot essential on armhf/arm64'> + +CONFIG_MMC_SDHCI policy<{'amd64': 'm'}> +CONFIG_MMC_SDHCI note<'installation essential on omap/highbank'> + +CONFIG_MMC_SDHCI_PLTFM policy<{'amd64': 'm'}> +CONFIG_MMC_SDHCI_PLTFM note<'boot essential on highbank'> + +CONFIG_MODIFY_LDT_SYSCALL policy<{'amd64': 'y'}> +CONFIG_MODIFY_LDT_SYSCALL note<'Q: check this with security'> + +CONFIG_MODVERSIONS policy<{'amd64': 'y'}> +CONFIG_MODVERSIONS note<'required as we have a livepatch/drivers modules signing key'> + +CONFIG_MTD policy<{'amd64': 'm'}> +CONFIG_MTD note<'boot essential on arm'> + +CONFIG_MTD_BLOCK policy<{'amd64': 'm'}> +CONFIG_MTD_BLOCK note<'boot essential on arm'> + +CONFIG_MTD_DOCG3 policy<{'amd64': 'n'}> +CONFIG_MTD_DOCG3 note<'LP: #1792205'> + +CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE policy<{'amd64': 'n'}> +CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE note<'can be enabled at runtime'> + +CONFIG_MTD_ONENAND_VERIFY_WRITE policy<{'amd64': 'y'}> +CONFIG_MTD_ONENAND_VERIFY_WRITE note<'writes here are not checked in full without'> + +CONFIG_MTD_RAW_NAND policy<{'amd64': 'm'}> +CONFIG_MTD_RAW_NAND note<'boot essential on arm'> + +CONFIG_NETWORK_PHY_TIMESTAMPING policy<{'amd64': 'y'}> +CONFIG_NETWORK_PHY_TIMESTAMPING note<'LP: #1785816'> + +CONFIG_NET_9P policy<{'amd64': 'm'}> +CONFIG_NET_9P note<'LP: #1557994'> + +CONFIG_NET_DROP_MONITOR policy<{'amd64': 'y'}> +CONFIG_NET_DROP_MONITOR note<'LP: #1660634'> + +CONFIG_NET_SWITCHDEV policy<{'amd64': 'y'}> +CONFIG_NET_SWITCHDEV note<'updated to y for s390x starting with focal'> + +CONFIG_NET_VENDOR_EMULEX policy<{'amd64': 'y'}> +CONFIG_NET_VENDOR_EMULEX note<'LP: #1543165'> + +CONFIG_NLS policy<{'amd64': 'y'}> +CONFIG_NLS note<'dependancy of boot essential'> + +CONFIG_NOP_USB_XCEIV policy<{'amd64': 'm'}> +CONFIG_NOP_USB_XCEIV note<'boot essential on omap/highbank'> + +CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT policy<{'amd64': 'n'}> +CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT note<'Selects CONFIG_DRM_LEGACY which is not wanted'> + +CONFIG_NO_HZ_IDLE policy<{'amd64': 'y'}> +CONFIG_NO_HZ_IDLE note<'LP: #1413968'> + +CONFIG_NR_CPUS policy<{'amd64': '8192'}> +CONFIG_NR_CPUS note<'LP: #1864198'> + +CONFIG_NUMA policy<{'amd64': 'y'}> +CONFIG_NUMA note<'LP: #1557690'> + +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED policy<{'amd64': 'y'}> +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED note<'LP: #1557690'> + +CONFIG_NUMA_EMU policy<{'amd64': 'n'}> +CONFIG_NUMA_EMU note<'LP: #1864198'> + +CONFIG_NVMEM policy<{'amd64': 'y'}> +CONFIG_NVMEM note<'LP: #1543165'> + +CONFIG_NVRAM policy<{'amd64': 'm'}> +CONFIG_NVRAM note<'LP: #1837726'> + +CONFIG_N_GSM policy<{'amd64': 'm'}> +CONFIG_N_GSM note<'LP: #1404670'> + +CONFIG_PAGE_POISONING policy<{'amd64': 'y'}> +CONFIG_PAGE_POISONING note<'LP: #1783651'> + +CONFIG_PANIC_ON_OOPS policy<{'amd64': 'n'}> +CONFIG_PANIC_ON_OOPS note<'keep working if at all possible'> + +CONFIG_PATA_HPT3X3_DMA policy<{'amd64': 'n'}> +CONFIG_PATA_HPT3X3_DMA note<'DMA mode is documented problematic'> + +CONFIG_PCIEASPM_DEFAULT policy<{'amd64': 'y'}> +CONFIG_PCIEASPM_DEFAULT note<'LP: #1398544'> + +CONFIG_PCIEPORTBUS policy<{'amd64': 'y'}> +CONFIG_PCIEPORTBUS note<'LP: #1665404'> + +CONFIG_PINCTRL_CHERRYVIEW policy<{'amd64': 'y'}> +CONFIG_PINCTRL_CHERRYVIEW note<'LP: #1630238'> + +CONFIG_PM policy<{'amd64': 'y'}> +CONFIG_PM note<'LP: #1867753'> + +CONFIG_PREEMPT_NONE policy<{'amd64': 'n'}> +CONFIG_PREEMPT_NONE note<'LP: #1543165'> + +CONFIG_PSI_DEFAULT_DISABLED policy<{'amd64': 'n'}> +CONFIG_PSI_DEFAULT_DISABLED note<'LP: #1876044'> + +CONFIG_REGULATOR_FIXED_VOLTAGE policy<{'amd64': 'm'}> +CONFIG_REGULATOR_FIXED_VOLTAGE note<'boot essential on arm'> + +CONFIG_REGULATOR_TWL4030 policy<{'amd64': 'm'}> +CONFIG_REGULATOR_TWL4030 note<'boot requisite for omap4'> + +CONFIG_RTC_DRV_CMOS policy<{'amd64': 'y'}> +CONFIG_RTC_DRV_CMOS note<'boot essential on i386/amd64'> + +CONFIG_RT_GROUP_SCHED policy<{'amd64': 'n'}> +CONFIG_RT_GROUP_SCHED note<'LP: #1875665'> + +CONFIG_SAMPLE_TRACE_PRINTK policy<{'amd64': 'm'}> +CONFIG_SAMPLE_TRACE_PRINTK note<'Required for ftrace selftests'> + +CONFIG_SATA_AHCI_PLATFORM policy<{'amd64': 'm'}> +CONFIG_SATA_AHCI_PLATFORM note<'boot essential on highbank'> + +CONFIG_SCSI_IPR_DUMP policy<{'amd64': 'y'}> +CONFIG_SCSI_IPR_DUMP note<'LP: #1343109'> + +CONFIG_SCSI_IPR_TRACE policy<{'amd64': 'y'}> +CONFIG_SCSI_IPR_TRACE note<'LP: #1343109'> + +CONFIG_SCSI_VIRTIO policy<{'amd64': 'm'}> +CONFIG_SCSI_VIRTIO note<'tech preview of new feature'> + +CONFIG_SECURITY_SAFESETID policy<{'amd64': 'y'}> +CONFIG_SECURITY_SAFESETID note<'LP: #1845391'> + +CONFIG_SECURITY_SELINUX_DISABLE policy<{'amd64': 'n'}> +CONFIG_SECURITY_SELINUX_DISABLE note<'LP: #1680315'> + +CONFIG_SERIAL_DEV_BUS policy<{'amd64': 'y'}> +CONFIG_SERIAL_DEV_BUS note<'LP: #1739939'> + +CONFIG_SERIAL_DEV_CTRL_TTYPORT policy<{'amd64': 'y'}> +CONFIG_SERIAL_DEV_CTRL_TTYPORT note<'LP: #1739939'> + +CONFIG_SMC policy<{'amd64': 'm'}> +CONFIG_SMC note<'LP: #1789934'> + +CONFIG_SMC_DIAG policy<{'amd64': 'm'}> +CONFIG_SMC_DIAG note<'LP: #1789934'> + +CONFIG_SND policy<{'amd64': 'm'}> +CONFIG_SND note<'not autoloadable on omap'> + +CONFIG_SND_HDA_POWER_SAVE_DEFAULT policy<{'amd64': '1'}> +CONFIG_SND_HDA_POWER_SAVE_DEFAULT note<'LP: #1804265'> + +CONFIG_SND_HDA_RECONFIG policy<{'amd64': 'y'}> +CONFIG_SND_HDA_RECONFIG note<'allows fixes to be tested live'> + +CONFIG_SND_PCM_OSS policy<{'amd64': 'n'}> +CONFIG_SND_PCM_OSS note<'deprecated in favour of pulseaudio emulation'> + +CONFIG_SND_SOC policy<{'amd64': 'm'}> +CONFIG_SND_SOC note<'not autoloadable on omap'> + +CONFIG_SND_SOC_AMD_RENOIR policy<{'amd64': 'm'}> +CONFIG_SND_SOC_AMD_RENOIR note<'LP: #1881046'> + +CONFIG_SND_SOC_AMD_RENOIR_MACH policy<{'amd64': 'm'}> +CONFIG_SND_SOC_AMD_RENOIR_MACH note<'LP: #1881046'> + +CONFIG_SND_SOC_INTEL_CFL policy<{'amd64': 'n'}> +CONFIG_SND_SOC_INTEL_CFL note<'deprecated'> + +CONFIG_SND_SOC_INTEL_CML_H policy<{'amd64': 'n'}> +CONFIG_SND_SOC_INTEL_CML_H note<'deprecated'> + +CONFIG_SND_SOC_INTEL_CML_LP policy<{'amd64': 'n'}> +CONFIG_SND_SOC_INTEL_CML_LP note<'deprecated'> + +CONFIG_SND_SOC_INTEL_CNL policy<{'amd64': 'n'}> +CONFIG_SND_SOC_INTEL_CNL note<'deprecated'> + +CONFIG_SND_SOC_INTEL_SKYLAKE policy<{'amd64': 'n'}> +CONFIG_SND_SOC_INTEL_SKYLAKE note<'deprecated'> + +CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC policy<{'amd64': 'y'}> +CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC note<'LP: #1915117'> + +CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH policy<{'amd64': 'm'}> +CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH note<'LP: #1921632'> + +CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES policy<{'amd64': 'y'}> +CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES note<'LP: #1921632'> + +CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC policy<{'amd64': 'y'}> +CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC note<'LP: #1848490'> + +CONFIG_SND_SOC_SOF_HDA_LINK policy<{'amd64': 'y'}> +CONFIG_SND_SOC_SOF_HDA_LINK note<'LP: #1848490'> + +CONFIG_SOUND policy<{'amd64': 'm'}> +CONFIG_SOUND note<'not autoloadable on omap'> + +CONFIG_SOUNDWIRE policy<{'amd64': 'm'}> +CONFIG_SOUNDWIRE note<'LP: #1855685'> + +CONFIG_SOUND_OSS_CORE_PRECLAIM policy<{'amd64': 'n'}> +CONFIG_SOUND_OSS_CORE_PRECLAIM note<'LP: #1385510'> + +CONFIG_SQUASHFS policy<{'amd64': 'y'}> +CONFIG_SQUASHFS note<'LP: #1593134'> + +CONFIG_SQUASHFS_4K_DEVBLK_SIZE policy<{'amd64': 'n'}> +CONFIG_SQUASHFS_4K_DEVBLK_SIZE note<'non-default block size'> + +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU policy<{'amd64': 'y'}> +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU note<'LP: #1980861'> + +CONFIG_STACK_VALIDATION policy<{'amd64': 'y'}> +CONFIG_STACK_VALIDATION note<'needed for livepatch'> + +CONFIG_SYSFS_DEPRECATED policy<{'amd64': 'n'}> +CONFIG_SYSFS_DEPRECATED note<'ensure nothing is using these deprecated interfaces'> + +CONFIG_TCG_TIS_I2C_ATMEL policy<{'amd64': 'm'}> +CONFIG_TCG_TIS_I2C_ATMEL note<'LP: #1643652'> + +CONFIG_TCG_TIS_I2C_INFINEON policy<{'amd64': 'm'}> +CONFIG_TCG_TIS_I2C_INFINEON note<'LP: #1643652'> + +CONFIG_TCG_TIS_I2C_NUVOTON policy<{'amd64': 'm'}> +CONFIG_TCG_TIS_I2C_NUVOTON note<'LP: #1643652'> + +CONFIG_TCG_TPM policy<{'amd64': 'y'}> +CONFIG_TCG_TPM note<'needed for early validation'> + +CONFIG_TEST_BLACKHOLE_DEV policy<{'amd64': 'm'}> +CONFIG_TEST_BLACKHOLE_DEV note<'Used by net selftests'> + +CONFIG_TMPFS_POSIX_ACL policy<{'amd64': 'y'}> +CONFIG_TMPFS_POSIX_ACL note<'some /dev nodes require POSIX ACLs, like /dev/dsp'> + +CONFIG_TOUCHSCREEN_ELAN policy<{'amd64': 'y'}> +CONFIG_TOUCHSCREEN_ELAN note<'LP: #1630238'> + +CONFIG_UBSAN policy<{'amd64': 'y'}> +CONFIG_UBSAN note<'LP: #1942215'> + +CONFIG_UNWINDER_FRAME_POINTER policy<{'amd64': 'y'}> +CONFIG_UNWINDER_FRAME_POINTER note<'needed for livepatch'> + +CONFIG_USB_EHCI_HCD policy<{'amd64': 'y'}> +CONFIG_USB_EHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> + +CONFIG_USB_EHCI_HCD_PLATFORM policy<{'amd64': 'y'}> +CONFIG_USB_EHCI_HCD_PLATFORM note<'Dont use the generic ehci/ohci code on omap, it doesnt work'> + +CONFIG_USB_HCD_BCMA policy<{'amd64': 'm'}> +CONFIG_USB_HCD_BCMA note<'USB_{O,E}HCI_HCD_PLATFORM must be off on omap'> + +CONFIG_USB_HCD_SSB policy<{'amd64': 'm'}> +CONFIG_USB_HCD_SSB note<'USB_{O,E}HCI_HCD_PLATFORM must be off on omap'> + +CONFIG_USB_M66592 policy<{'amd64': 'n'}> +CONFIG_USB_M66592 note<'gadget device'> + +CONFIG_USB_MUSB_HDRC policy<{'amd64': 'm'}> +CONFIG_USB_MUSB_HDRC note<'not autoloadable on omap'> + +CONFIG_USB_OTG policy<{'amd64': 'n'}> +CONFIG_USB_OTG note<'LP: #1411295'> + +CONFIG_USB_SERIAL_DEBUG policy<{'amd64': 'm'}> +CONFIG_USB_SERIAL_DEBUG note<'not actually debug'> + +CONFIG_USB_UHCI_HCD policy<{'amd64': 'y'}> +CONFIG_USB_UHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> + +CONFIG_USB_XHCI_DBGCAP policy<{'amd64': 'y'}> +CONFIG_USB_XHCI_DBGCAP note<'LP: #1730832'> + +CONFIG_USB_XHCI_HCD policy<{'amd64': 'y'}> +CONFIG_USB_XHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> + +CONFIG_VFAT_FS policy<{'amd64': 'y'}> +CONFIG_VFAT_FS note<'needed on arm to ensure we can write the kernel when replacing'> + +CONFIG_VFIO policy<{'amd64': 'y'}> +CONFIG_VFIO note<'LP: #1636733'> + +CONFIG_VFIO_PCI policy<{'amd64': 'y'}> +CONFIG_VFIO_PCI note<'LP: #1636733'> + +CONFIG_VIDEO_VIMC policy<{'amd64': 'm'}> +CONFIG_VIDEO_VIMC note<'LP: #1831482'> + +CONFIG_VIRTIO_BLK policy<{'amd64': 'm'}> +CONFIG_VIRTIO_BLK note<'KVM paravirt support -- not autoloadable'> + +CONFIG_VIRTIO_MMIO policy<{'amd64': 'y'}> +CONFIG_VIRTIO_MMIO note<'LP: #1557689'> + +CONFIG_VIRTIO_NET policy<{'amd64': 'm'}> +CONFIG_VIRTIO_NET note<'KVM paravirt support -- not autoloadable'> + +CONFIG_X509_CERTIFICATE_PARSER policy<{'amd64': 'y'}> +CONFIG_X509_CERTIFICATE_PARSER note<'module signing'> + +CONFIG_X86_ACPI_CPUFREQ policy<{'amd64': 'y'}> +CONFIG_X86_ACPI_CPUFREQ note<'not autoloadable'> + +CONFIG_X86_KERNEL_IBT policy<{'amd64': 'n'}> +CONFIG_X86_KERNEL_IBT note<'LP: #1980484'> + +CONFIG_X86_PCC_CPUFREQ policy<{'amd64': 'y'}> +CONFIG_X86_PCC_CPUFREQ note<'not autoloadable'> + +CONFIG_X86_POWERNOW_K8 policy<{'amd64': 'y'}> +CONFIG_X86_POWERNOW_K8 note<'not autoloadable'> + +CONFIG_X86_SPEEDSTEP_CENTRINO policy<{'amd64': 'y'}> +CONFIG_X86_SPEEDSTEP_CENTRINO note<'not autoloadable'> + +CONFIG_X86_UV policy<{'amd64': 'y'}> +CONFIG_X86_UV note<'LP: #1863810'> + +CONFIG_XEN_512GB policy<{'amd64': 'y'}> +CONFIG_XEN_512GB note<'Q: is this related to the utlemming questions on memory size?'> + +CONFIG_XEN_ACPI_PROCESSOR policy<{'amd64': 'y'}> +CONFIG_XEN_ACPI_PROCESSOR note<'boot essential on XEN host'> + +CONFIG_XEN_BLKDEV_FRONTEND policy<{'amd64': 'y'}> +CONFIG_XEN_BLKDEV_FRONTEND note<'not autoloadable -- XEN paravirt support'> + +CONFIG_XEN_NETDEV_FRONTEND policy<{'amd64': 'y'}> +CONFIG_XEN_NETDEV_FRONTEND note<'not autoloadable -- XEN paravirt support'> + +CONFIG_XZ_DEC policy<{'amd64': 'y'}> +CONFIG_XZ_DEC note<'boot essential -- initramfs decompressor'> + +CONFIG_ZONE_DMA policy<{'amd64': 'y'}> +CONFIG_ZONE_DMA note<'LP: #1628523'> + + +# ---- Annotations without notes ---- + CONFIG_104_QUAD_8 policy<{'amd64': 'm'}> CONFIG_60XX_WDT policy<{'amd64': 'm'}> CONFIG_64BIT policy<{'amd64': 'y'}> @@ -38,9 +653,6 @@ CONFIG_A11Y_BRAILLE_CONSOLE policy<{'amd64': 'n'}> CONFIG_ABP060MG policy<{'amd64': 'm'}> CONFIG_AC97_BUS policy<{'amd64': 'm'}> -CONFIG_ACCESSIBILITY policy<{'amd64': 'y'}> -CONFIG_ACCESSIBILITY note<'LP: #1967702'> - CONFIG_ACENIC policy<{'amd64': 'm'}> CONFIG_ACENIC_OMIT_TIGON_I policy<{'amd64': 'n'}> CONFIG_ACERHDF policy<{'amd64': 'm'}> @@ -66,9 +678,6 @@ CONFIG_ACPI_CPPC_LIB policy<{'amd64': 'y'}> CONFIG_ACPI_CPU_FREQ_PSS policy<{'amd64': 'y'}> CONFIG_ACPI_CUSTOM_DSDT_FILE policy<{'amd64': '""'}> -CONFIG_ACPI_CUSTOM_METHOD policy<{'amd64': 'n'}> -CONFIG_ACPI_CUSTOM_METHOD note<'SECURITY: allows arbitrary execution'> - CONFIG_ACPI_DEBUG policy<{'amd64': 'y'}> CONFIG_ACPI_DEBUGGER policy<{'amd64': 'y'}> CONFIG_ACPI_DEBUGGER_USER policy<{'amd64': 'y'}> @@ -247,9 +856,6 @@ CONFIG_AF_RXRPC_INJECT_LOSS policy<{'amd64': 'n'}> CONFIG_AF_RXRPC_IPV6 policy<{'amd64': 'y'}> CONFIG_AF_UNIX_OOB policy<{'amd64': 'y'}> -CONFIG_AGP policy<{'amd64': 'y'}> -CONFIG_AGP note<'not autoloadable'> - CONFIG_AGP_AMD64 policy<{'amd64': 'y'}> CONFIG_AGP_INTEL policy<{'amd64': 'y'}> CONFIG_AGP_SIS policy<{'amd64': 'm'}> @@ -446,12 +1052,6 @@ CONFIG_ASUS_TF103C_DOCK policy<{'amd64': 'm'}> CONFIG_ASUS_WIRELESS policy<{'amd64': 'm'}> CONFIG_ASUS_WMI policy<{'amd64': 'm'}> -CONFIG_ASYMMETRIC_KEY_TYPE policy<{'amd64': 'y'}> -CONFIG_ASYMMETRIC_KEY_TYPE note<'module signing'> - -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE policy<{'amd64': 'y'}> -CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE note<'module signing'> - CONFIG_ASYNC_CORE policy<{'amd64': 'm'}> CONFIG_ASYNC_MEMCPY policy<{'amd64': 'm'}> CONFIG_ASYNC_PQ policy<{'amd64': 'm'}> @@ -476,9 +1076,6 @@ CONFIG_ATA_FORCE policy<{'amd64': 'y'}> CONFIG_ATA_GENERIC policy<{'amd64': 'y'}> CONFIG_ATA_OVER_ETH policy<{'amd64': 'm'}> -CONFIG_ATA_PIIX policy<{'amd64': 'y'}> -CONFIG_ATA_PIIX note<'LP: #1627324'> - CONFIG_ATA_SFF policy<{'amd64': 'y'}> CONFIG_ATA_VERBOSE_ERROR policy<{'amd64': 'y'}> CONFIG_ATH10K policy<{'amd64': 'm'}> @@ -738,9 +1335,6 @@ CONFIG_BINARY_PRINTF policy<{'amd64': 'y'}> CONFIG_BINFMT_ELF policy<{'amd64': 'y'}> CONFIG_BINFMT_MISC policy<{'amd64': 'm'}> -CONFIG_BINFMT_SCRIPT policy<{'amd64': 'y'}> -CONFIG_BINFMT_SCRIPT note<'required if init is a shell script such as in initramfs-tools'> - CONFIG_BITREVERSE policy<{'amd64': 'y'}> CONFIG_BLK_CGROUP policy<{'amd64': 'y'}> CONFIG_BLK_CGROUP_FC_APPID policy<{'amd64': 'y'}> @@ -755,9 +1349,6 @@ CONFIG_BLK_DEV_BSG policy<{'amd64': 'y'}> CONFIG_BLK_DEV_BSGLIB policy<{'amd64': 'y'}> CONFIG_BLK_DEV_BSG_COMMON policy<{'amd64': 'y'}> -CONFIG_BLK_DEV_DM policy<{'amd64': 'y'}> -CONFIG_BLK_DEV_DM note<'LP: #560717'> - CONFIG_BLK_DEV_DM_BUILTIN policy<{'amd64': 'y'}> CONFIG_BLK_DEV_DRBD policy<{'amd64': 'm'}> CONFIG_BLK_DEV_FD policy<{'amd64': 'm'}> @@ -771,31 +1362,13 @@ CONFIG_BLK_DEV_MD policy<{'amd64': 'y'}> CONFIG_BLK_DEV_NBD policy<{'amd64': 'm'}> CONFIG_BLK_DEV_NULL_BLK policy<{'amd64': 'm'}> -CONFIG_BLK_DEV_NVME policy<{'amd64': 'm'}> -CONFIG_BLK_DEV_NVME note<'LP: #1759893'> - CONFIG_BLK_DEV_PCIESSD_MTIP32XX policy<{'amd64': 'm'}> CONFIG_BLK_DEV_PMEM policy<{'amd64': 'm'}> -CONFIG_BLK_DEV_RAM policy<{'amd64': 'm'}> -CONFIG_BLK_DEV_RAM note<'LP: #1593293'> - CONFIG_BLK_DEV_RAM_COUNT policy<{'amd64': '16'}> -CONFIG_BLK_DEV_RAM_SIZE policy<{'amd64': '65536'}> -CONFIG_BLK_DEV_RAM_SIZE note<'Ramdisk size should be a minimum of 64M'> - CONFIG_BLK_DEV_RBD policy<{'amd64': 'm'}> CONFIG_BLK_DEV_RNBD policy<{'amd64': 'y'}> CONFIG_BLK_DEV_RNBD_CLIENT policy<{'amd64': 'm'}> CONFIG_BLK_DEV_RNBD_SERVER policy<{'amd64': 'm'}> -CONFIG_BLK_DEV_SD policy<{'amd64': 'y'}> -CONFIG_BLK_DEV_SD note<'LP: #1627330'> - -CONFIG_BLK_DEV_SR policy<{'amd64': 'y'}> -CONFIG_BLK_DEV_SR note<'LP: #1627330'> - -CONFIG_BLK_DEV_THROTTLING policy<{'amd64': 'y'}> -CONFIG_BLK_DEV_THROTTLING note<'CGROUP disk consumption control'> - CONFIG_BLK_DEV_THROTTLING_LOW policy<{'amd64': 'n'}> CONFIG_BLK_DEV_UBLK policy<{'amd64': 'n'}> CONFIG_BLK_DEV_ZONED policy<{'amd64': 'y'}> @@ -874,9 +1447,6 @@ CONFIG_BPF_PRELOAD policy<{'amd64': 'n'}> CONFIG_BPF_STREAM_PARSER policy<{'amd64': 'y'}> CONFIG_BPF_SYSCALL policy<{'amd64': 'y'}> -CONFIG_BPF_UNPRIV_DEFAULT_OFF policy<{'amd64': 'y'}> -CONFIG_BPF_UNPRIV_DEFAULT_OFF note<'security reason'> - CONFIG_BPQETHER policy<{'amd64': 'm'}> CONFIG_BQL policy<{'amd64': 'y'}> CONFIG_BRANCH_PROFILE_NONE policy<{'amd64': 'y'}> @@ -1221,9 +1791,6 @@ CONFIG_CHROMEOS_TBMC policy<{'amd64': 'm'}> CONFIG_CHROME_PLATFORMS policy<{'amd64': 'y'}> CONFIG_CHR_DEV_SCH policy<{'amd64': 'm'}> -CONFIG_CHR_DEV_SG policy<{'amd64': 'y'}> -CONFIG_CHR_DEV_SG note<'not autoloadable'> - CONFIG_CHR_DEV_ST policy<{'amd64': 'm'}> CONFIG_CHTCRC_PMIC_OPREGION policy<{'amd64': 'y'}> CONFIG_CHT_DC_TI_PMIC_OPREGION policy<{'amd64': 'y'}> @@ -1259,9 +1826,6 @@ CONFIG_CM3323 policy<{'amd64': 'm'}> CONFIG_CM3605 policy<{'amd64': 'm'}> CONFIG_CM36651 policy<{'amd64': 'm'}> -CONFIG_CMA policy<{'amd64': 'n'}> -CONFIG_CMA note<'LP: #1803206'> - CONFIG_CMDLINE_BOOL policy<{'amd64': 'n'}> CONFIG_CMDLINE_PARTITION policy<{'amd64': 'y'}> CONFIG_CNIC policy<{'amd64': 'm'}> @@ -1425,9 +1989,6 @@ CONFIG_COMPAT_32 policy<{'amd64': 'y'}> CONFIG_COMPAT_32BIT_TIME policy<{'amd64': 'y'}> CONFIG_COMPAT_BINFMT_ELF policy<{'amd64': 'y'}> -CONFIG_COMPAT_BRK policy<{'amd64': 'n'}> -CONFIG_COMPAT_BRK note<'disables brk ASLR'> - CONFIG_COMPAT_FOR_U64_ALIGNMENT policy<{'amd64': 'y'}> CONFIG_COMPAT_NETLINK_MESSAGES policy<{'amd64': 'y'}> CONFIG_COMPAT_OLD_SIGACTION policy<{'amd64': 'y'}> @@ -1453,33 +2014,12 @@ CONFIG_CPUMASK_OFFSTACK policy<{'amd64': 'y'}> CONFIG_CPUSETS policy<{'amd64': 'y'}> CONFIG_CPU_FREQ policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE policy<{'amd64': 'n'}> -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE note<'for bootspeed'> - CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE policy<{'amd64': 'n'}> CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL policy<{'amd64': 'y'}> CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE policy<{'amd64': 'n'}> CONFIG_CPU_FREQ_GOV_ATTR_SET policy<{'amd64': 'y'}> CONFIG_CPU_FREQ_GOV_COMMON policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_CONSERVATIVE policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_CONSERVATIVE note<'not autoloadable'> - -CONFIG_CPU_FREQ_GOV_ONDEMAND policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_ONDEMAND note<'not autoloadable'> - -CONFIG_CPU_FREQ_GOV_PERFORMANCE policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_PERFORMANCE note<'not autoloadable'> - -CONFIG_CPU_FREQ_GOV_POWERSAVE policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_POWERSAVE note<'not autoloadable'> - CONFIG_CPU_FREQ_GOV_SCHEDUTIL policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_USERSPACE policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_GOV_USERSPACE note<'not autoloadable'> - -CONFIG_CPU_FREQ_STAT policy<{'amd64': 'y'}> -CONFIG_CPU_FREQ_STAT note<'dependancy of boot essential'> - CONFIG_CPU_HOTPLUG_STATE_CONTROL policy<{'amd64': 'n'}> CONFIG_CPU_IBPB_ENTRY policy<{'amd64': 'y'}> CONFIG_CPU_IBRS_ENTRY policy<{'amd64': 'y'}> @@ -1500,9 +2040,6 @@ CONFIG_CRAMFS_BLOCKDEV policy<{'amd64': 'y'}> CONFIG_CRAMFS_MTD policy<{'amd64': 'y'}> CONFIG_CRASH_CORE policy<{'amd64': 'y'}> -CONFIG_CRASH_DUMP policy<{'amd64': 'y'}> -CONFIG_CRASH_DUMP note<'LP: #1363180'> - CONFIG_CRC16 policy<{'amd64': 'y'}> CONFIG_CRC32 policy<{'amd64': 'y'}> CONFIG_CRC32_BIT policy<{'amd64': 'n'}> @@ -1705,9 +2242,6 @@ CONFIG_CRYPTO_SHA256 policy<{'amd64': 'y'}> CONFIG_CRYPTO_SHA256_SSSE3 policy<{'amd64': 'm'}> CONFIG_CRYPTO_SHA3 policy<{'amd64': 'm'}> -CONFIG_CRYPTO_SHA512 policy<{'amd64': 'y'}> -CONFIG_CRYPTO_SHA512 note<'module signing'> - CONFIG_CRYPTO_SHA512_SSSE3 policy<{'amd64': 'm'}> CONFIG_CRYPTO_SIMD policy<{'amd64': 'm'}> CONFIG_CRYPTO_SKCIPHER policy<{'amd64': 'y'}> @@ -1731,9 +2265,6 @@ CONFIG_CRYPTO_USER policy<{'amd64': 'm'}> CONFIG_CRYPTO_USER_API policy<{'amd64': 'm'}> CONFIG_CRYPTO_USER_API_AEAD policy<{'amd64': 'm'}> -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE policy<{'amd64': 'n'}> -CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE note<'Obsolete w/ no known userspace dependencies'> - CONFIG_CRYPTO_USER_API_HASH policy<{'amd64': 'm'}> CONFIG_CRYPTO_USER_API_RNG policy<{'amd64': 'm'}> CONFIG_CRYPTO_USER_API_RNG_CAVP policy<{'amd64': 'n'}> @@ -1790,20 +2321,11 @@ CONFIG_DEBUG_ENTRY policy<{'amd64': 'n'}> CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B policy<{'amd64': 'n'}> CONFIG_DEBUG_FORCE_WEAK_PER_CPU policy<{'amd64': 'n'}> -CONFIG_DEBUG_FS policy<{'amd64': 'y'}> -CONFIG_DEBUG_FS note<'required debug option'> - CONFIG_DEBUG_FS_ALLOW_ALL policy<{'amd64': 'y'}> CONFIG_DEBUG_FS_ALLOW_NONE policy<{'amd64': 'n'}> CONFIG_DEBUG_FS_DISALLOW_MOUNT policy<{'amd64': 'n'}> CONFIG_DEBUG_GPIO policy<{'amd64': 'n'}> CONFIG_DEBUG_HOTPLUG_CPU0 policy<{'amd64': 'n'}> -CONFIG_DEBUG_INFO policy<{'amd64': 'y'}> -CONFIG_DEBUG_INFO note<'required for debug packages'> - -CONFIG_DEBUG_INFO_BTF policy<{'amd64': 'y'}> -CONFIG_DEBUG_INFO_BTF note<'Needs newer pahole for armhf'> - CONFIG_DEBUG_INFO_BTF_MODULES policy<{'amd64': 'y'}> CONFIG_DEBUG_INFO_COMPRESSED policy<{'amd64': 'n'}> CONFIG_DEBUG_INFO_DWARF4 policy<{'amd64': 'n'}> @@ -1811,13 +2333,7 @@ CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT policy<{'amd64': 'n'}> CONFIG_DEBUG_INFO_NONE policy<{'amd64': 'n'}> CONFIG_DEBUG_INFO_REDUCED policy<{'amd64': 'n'}> -CONFIG_DEBUG_INFO_SPLIT policy<{'amd64': 'n'}> -CONFIG_DEBUG_INFO_SPLIT note<'LP: #1413664'> - CONFIG_DEBUG_IRQFLAGS policy<{'amd64': 'n'}> -CONFIG_DEBUG_KERNEL policy<{'amd64': 'y'}> -CONFIG_DEBUG_KERNEL note<'required debug option'> - CONFIG_DEBUG_KERNEL_DC policy<{'amd64': 'n'}> CONFIG_DEBUG_KMEMLEAK policy<{'amd64': 'n'}> CONFIG_DEBUG_KOBJECT policy<{'amd64': 'n'}> @@ -1868,9 +2384,6 @@ CONFIG_DEFAULT_HOSTNAME policy<{'amd64': '"(none)"'}> CONFIG_DEFAULT_HUNG_TASK_TIMEOUT policy<{'amd64': '120'}> CONFIG_DEFAULT_INIT policy<{'amd64': '""'}> -CONFIG_DEFAULT_MMAP_MIN_ADDR policy<{'amd64': '65536'}> -CONFIG_DEFAULT_MMAP_MIN_ADDR note<'LP: #1531327'> - CONFIG_DEFAULT_RENO policy<{'amd64': 'n'}> CONFIG_DEFAULT_SECURITY_APPARMOR policy<{'amd64': 'y'}> CONFIG_DEFAULT_SECURITY_DAC policy<{'amd64': 'n'}> @@ -1905,12 +2418,6 @@ CONFIG_DEVICE_PRIVATE policy<{'amd64': 'y'}> CONFIG_DEVMEM policy<{'amd64': 'y'}> CONFIG_DEVPORT policy<{'amd64': 'y'}> -CONFIG_DEVTMPFS policy<{'amd64': 'y'}> -CONFIG_DEVTMPFS note<'upstart requirement'> - -CONFIG_DEVTMPFS_MOUNT policy<{'amd64': 'y'}> -CONFIG_DEVTMPFS_MOUNT note<'upstart requirement'> - CONFIG_DEVTMPFS_SAFE policy<{'amd64': 'y'}> CONFIG_DEV_APPLETALK policy<{'amd64': 'm'}> CONFIG_DEV_COREDUMP policy<{'amd64': 'y'}> @@ -2014,9 +2521,6 @@ CONFIG_DRBD_FAULT_INJECTION policy<{'amd64': 'n'}> CONFIG_DRM policy<{'amd64': 'm'}> CONFIG_DRM_AMDGPU policy<{'amd64': 'm'}> -CONFIG_DRM_AMDGPU_CIK policy<{'amd64': 'y'}> -CONFIG_DRM_AMDGPU_CIK note<'for zesty'> - CONFIG_DRM_AMDGPU_SI policy<{'amd64': 'y'}> CONFIG_DRM_AMDGPU_USERPTR policy<{'amd64': 'y'}> CONFIG_DRM_AMD_ACP policy<{'amd64': 'y'}> @@ -2081,13 +2585,7 @@ CONFIG_DRM_I915_USERPTR policy<{'amd64': 'y'}> CONFIG_DRM_I915_WERROR policy<{'amd64': 'n'}> CONFIG_DRM_KMS_HELPER policy<{'amd64': 'm'}> -CONFIG_DRM_LEGACY policy<{'amd64': 'n'}> -CONFIG_DRM_LEGACY note<'Consider re-enabling but not signing the modules'> - CONFIG_DRM_LOAD_EDID_FIRMWARE policy<{'amd64': 'y'}> -CONFIG_DRM_MGAG200 policy<{'amd64': 'm'}> -CONFIG_DRM_MGAG200 note<'LP: #1693337'> - CONFIG_DRM_MIPI_DBI policy<{'amd64': 'm'}> CONFIG_DRM_MIPI_DSI policy<{'amd64': 'y'}> CONFIG_DRM_NOMODESET policy<{'amd64': 'y'}> @@ -2112,10 +2610,6 @@ CONFIG_DRM_TTM policy<{'amd64': 'm'}> CONFIG_DRM_TTM_HELPER policy<{'amd64': 'm'}> CONFIG_DRM_UDL policy<{'amd64': 'm'}> -CONFIG_DRM_USE_DYNAMIC_DEBUG policy<{'amd64': 'n'}> -CONFIG_DRM_VBOXVIDEO policy<{'amd64': 'm'}> -CONFIG_DRM_VBOXVIDEO note<'LP: #1718679'> - CONFIG_DRM_VGEM policy<{'amd64': 'm'}> CONFIG_DRM_VIRTIO_GPU policy<{'amd64': 'm'}> CONFIG_DRM_VKMS policy<{'amd64': 'm'}> @@ -2177,9 +2671,6 @@ CONFIG_DVB_DRXD policy<{'amd64': 'm'}> CONFIG_DVB_DRXK policy<{'amd64': 'm'}> CONFIG_DVB_DS3000 policy<{'amd64': 'm'}> -CONFIG_DVB_DUMMY_FE policy<{'amd64': 'm'}> -CONFIG_DVB_DUMMY_FE note<'expert use only'> - CONFIG_DVB_DYNAMIC_MINORS policy<{'amd64': 'y'}> CONFIG_DVB_EC100 policy<{'amd64': 'm'}> CONFIG_DVB_FIREDTV policy<{'amd64': 'm'}> @@ -2359,9 +2850,6 @@ CONFIG_EARLY_PRINTK_USB_XDBC policy<{'amd64': 'y'}> CONFIG_EBC_C384_WDT policy<{'amd64': 'm'}> CONFIG_ECHO policy<{'amd64': 'm'}> -CONFIG_ECRYPT_FS policy<{'amd64': 'y'}> -CONFIG_ECRYPT_FS note<'not autoloadable'> - CONFIG_ECRYPT_FS_MESSAGING policy<{'amd64': 'y'}> CONFIG_EDAC policy<{'amd64': 'y'}> CONFIG_EDAC_AMD64 policy<{'amd64': 'm'}> @@ -2400,9 +2888,6 @@ CONFIG_EEPROM_LEGACY policy<{'amd64': 'm'}> CONFIG_EEPROM_MAX6875 policy<{'amd64': 'm'}> CONFIG_EFI policy<{'amd64': 'y'}> -CONFIG_EFIVAR_FS policy<{'amd64': 'y'}> -CONFIG_EFIVAR_FS note<'needed for variable EFI update'> - CONFIG_EFI_BOOTLOADER_CONTROL policy<{'amd64': 'm'}> CONFIG_EFI_CAPSULE_LOADER policy<{'amd64': 'm'}> CONFIG_EFI_COCO_SECRET policy<{'amd64': 'y'}> @@ -2464,17 +2949,8 @@ CONFIG_EUROTECH_WDT policy<{'amd64': 'm'}> CONFIG_EVENTFD policy<{'amd64': 'y'}> CONFIG_EVENT_TRACING policy<{'amd64': 'y'}> -CONFIG_EVM policy<{'amd64': 'y'}> -CONFIG_EVM note<'LP: #1643652'> - CONFIG_EVM_ADD_XATTRS policy<{'amd64': 'y'}> -CONFIG_EVM_ATTR_FSUUID policy<{'amd64': 'y'}> -CONFIG_EVM_ATTR_FSUUID note<'LP: #1643652'> - CONFIG_EVM_EXTRA_SMACK_XATTRS policy<{'amd64': 'y'}> -CONFIG_EVM_LOAD_X509 policy<{'amd64': 'n'}> -CONFIG_EVM_LOAD_X509 note<'LP: #1643652'> - CONFIG_EXAR_WDT policy<{'amd64': 'm'}> CONFIG_EXCLUSIVE_SYSTEM_RAM policy<{'amd64': 'y'}> CONFIG_EXFAT_DEFAULT_IOCHARSET policy<{'amd64': '"utf8"'}> @@ -2482,12 +2958,6 @@ CONFIG_EXPERT policy<{'amd64': 'y'}> CONFIG_EXPORTFS policy<{'amd64': 'y'}> CONFIG_EXPORTFS_BLOCK_OPS policy<{'amd64': 'y'}> -CONFIG_EXT2_FS policy<{'amd64': 'n'}> -CONFIG_EXT2_FS note<'ext4 handling via EXT4_USE_FOR_EXT23'> - -CONFIG_EXT3_FS policy<{'amd64': 'n'}> -CONFIG_EXT3_FS note<'ext4 handling via EXT4_USE_FOR_EXT23'> - CONFIG_EXT4_DEBUG policy<{'amd64': 'n'}> CONFIG_EXT4_FS policy<{'amd64': 'y'}> CONFIG_EXT4_FS_POSIX_ACL policy<{'amd64': 'y'}> @@ -2679,9 +3149,6 @@ CONFIG_FCOE_FNIC policy<{'amd64': 'm'}> CONFIG_FDDI policy<{'amd64': 'y'}> CONFIG_FEALNX policy<{'amd64': 'm'}> -CONFIG_FHANDLE policy<{'amd64': 'y'}> -CONFIG_FHANDLE note<'LP: #1412543'> - CONFIG_FIB_RULES policy<{'amd64': 'y'}> CONFIG_FIELDBUS_DEV policy<{'amd64': 'm'}> CONFIG_FILE_LOCKING policy<{'amd64': 'y'}> @@ -2776,9 +3243,6 @@ CONFIG_FUN_CORE policy<{'amd64': 'm'}> CONFIG_FUN_ETH policy<{'amd64': 'm'}> CONFIG_FUSE_DAX policy<{'amd64': 'y'}> -CONFIG_FUSE_FS policy<{'amd64': 'y'}> -CONFIG_FUSE_FS note<'not autoloadable'> - CONFIG_FUSION policy<{'amd64': 'y'}> CONFIG_FUSION_CTL policy<{'amd64': 'm'}> CONFIG_FUSION_FC policy<{'amd64': 'm'}> @@ -2801,9 +3265,6 @@ CONFIG_FW_LOADER_PAGED_BUF policy<{'amd64': 'y'}> CONFIG_FW_LOADER_SYSFS policy<{'amd64': 'y'}> CONFIG_FW_LOADER_USER_HELPER policy<{'amd64': 'y'}> -CONFIG_FW_LOADER_USER_HELPER_FALLBACK policy<{'amd64': 'n'}> -CONFIG_FW_LOADER_USER_HELPER_FALLBACK note<'LP: #1398458'> - CONFIG_FW_UPLOAD policy<{'amd64': 'n'}> CONFIG_FXAS21002C policy<{'amd64': 'm'}> CONFIG_FXAS21002C_I2C policy<{'amd64': 'm'}> @@ -2905,9 +3366,6 @@ CONFIG_GPIO_ARIZONA policy<{'amd64': 'm'}> CONFIG_GPIO_BD9571MWV policy<{'amd64': 'm'}> CONFIG_GPIO_CDEV policy<{'amd64': 'y'}> -CONFIG_GPIO_CDEV_V1 policy<{'amd64': 'y'}> -CONFIG_GPIO_CDEV_V1 note<'LP: #1953613'> - CONFIG_GPIO_CRYSTAL_COVE policy<{'amd64': 'y'}> CONFIG_GPIO_DA9052 policy<{'amd64': 'm'}> CONFIG_GPIO_DA9055 policy<{'amd64': 'm'}> @@ -2958,9 +3416,6 @@ CONFIG_GPIO_TPS65912 policy<{'amd64': 'm'}> CONFIG_GPIO_TPS68470 policy<{'amd64': 'm'}> CONFIG_GPIO_TQMX86 policy<{'amd64': 'm'}> -CONFIG_GPIO_TWL4030 policy<{'amd64': 'm'}> -CONFIG_GPIO_TWL4030 note<'LP: #921934'> - CONFIG_GPIO_TWL6040 policy<{'amd64': 'm'}> CONFIG_GPIO_UCB1400 policy<{'amd64': 'm'}> CONFIG_GPIO_VIPERBOARD policy<{'amd64': 'm'}> @@ -3174,9 +3629,6 @@ CONFIG_HFS_FS policy<{'amd64': 'm'}> CONFIG_HI8435 policy<{'amd64': 'm'}> CONFIG_HIBERNATE_CALLBACKS policy<{'amd64': 'y'}> -CONFIG_HIBERNATION policy<{'amd64': 'y'}> -CONFIG_HIBERNATION note<'LP: #1867753'> - CONFIG_HIBERNATION_SNAPSHOT_DEV policy<{'amd64': 'y'}> CONFIG_HID policy<{'amd64': 'm'}> CONFIG_HIDRAW policy<{'amd64': 'y'}> @@ -3332,12 +3784,6 @@ CONFIG_HOTPLUG_PCI_CPCI policy<{'amd64': 'y'}> CONFIG_HOTPLUG_PCI_CPCI_GENERIC policy<{'amd64': 'm'}> CONFIG_HOTPLUG_PCI_CPCI_ZT5550 policy<{'amd64': 'm'}> -CONFIG_HOTPLUG_PCI_PCIE policy<{'amd64': 'y'}> -CONFIG_HOTPLUG_PCI_PCIE note<'LP: #1374440'> - -CONFIG_HOTPLUG_PCI_SHPC policy<{'amd64': 'y'}> -CONFIG_HOTPLUG_PCI_SHPC note<'LP: #1374440'> - CONFIG_HOTPLUG_SMT policy<{'amd64': 'y'}> CONFIG_HP03 policy<{'amd64': 'm'}> CONFIG_HP206C policy<{'amd64': 'm'}> @@ -3423,9 +3869,6 @@ CONFIG_I2C_BOARDINFO policy<{'amd64': 'y'}> CONFIG_I2C_CBUS_GPIO policy<{'amd64': 'm'}> CONFIG_I2C_CCGX_UCSI policy<{'amd64': 'm'}> -CONFIG_I2C_CHARDEV policy<{'amd64': 'y'}> -CONFIG_I2C_CHARDEV note<'LP: #1417032'> - CONFIG_I2C_CHT_WC policy<{'amd64': 'm'}> CONFIG_I2C_COMPAT policy<{'amd64': 'y'}> CONFIG_I2C_CP2615 policy<{'amd64': 'm'}> @@ -3509,9 +3952,6 @@ CONFIG_ICS932S401 policy<{'amd64': 'm'}> CONFIG_IDEAPAD_LAPTOP policy<{'amd64': 'm'}> CONFIG_IDLE_INJECT policy<{'amd64': 'y'}> -CONFIG_IDLE_PAGE_TRACKING policy<{'amd64': 'y'}> -CONFIG_IDLE_PAGE_TRACKING note<'is there a cost associated with this?'> - CONFIG_IE6XX_WDT policy<{'amd64': 'm'}> CONFIG_IEEE802154 policy<{'amd64': 'm'}> CONFIG_IEEE802154_6LOWPAN policy<{'amd64': 'm'}> @@ -3558,12 +3998,6 @@ CONFIG_IIO_MUX policy<{'amd64': 'm'}> CONFIG_IIO_RESCALE policy<{'amd64': 'm'}> CONFIG_IIO_SIMPLE_DUMMY policy<{'amd64': 'm'}> -CONFIG_IIO_SIMPLE_DUMMY_BUFFER policy<{'amd64': 'n'}> -CONFIG_IIO_SIMPLE_DUMMY_BUFFER note<'dummy driver'> - -CONFIG_IIO_SIMPLE_DUMMY_EVENTS policy<{'amd64': 'n'}> -CONFIG_IIO_SIMPLE_DUMMY_EVENTS note<'dummy driver'> - CONFIG_IIO_SSP_SENSORHUB policy<{'amd64': 'm'}> CONFIG_IIO_SSP_SENSORS_COMMONS policy<{'amd64': 'm'}> CONFIG_IIO_ST_ACCEL_3AXIS policy<{'amd64': 'm'}> @@ -3598,56 +4032,20 @@ CONFIG_IKCONFIG policy<{'amd64': 'n'}> CONFIG_IKHEADERS policy<{'amd64': 'm'}> CONFIG_ILLEGAL_POINTER_VALUE policy<{'amd64': '0xdead000000000000'}> -CONFIG_IMA policy<{'amd64': 'y'}> -CONFIG_IMA note<'LP: #1643652'> - -CONFIG_IMA_APPRAISE policy<{'amd64': 'y'}> -CONFIG_IMA_APPRAISE note<'LP: #1643652'> - CONFIG_IMA_APPRAISE_BOOTPARAM policy<{'amd64': 'y'}> CONFIG_IMA_APPRAISE_BUILD_POLICY policy<{'amd64': 'n'}> CONFIG_IMA_APPRAISE_MODSIG policy<{'amd64': 'y'}> -CONFIG_IMA_ARCH_POLICY policy<{'amd64': 'y'}> -CONFIG_IMA_ARCH_POLICY note<'LP: #1866909'> - -CONFIG_IMA_BLACKLIST_KEYRING policy<{'amd64': 'n'}> -CONFIG_IMA_BLACKLIST_KEYRING note<'LP: #1667490'> - CONFIG_IMA_DEFAULT_HASH policy<{'amd64': '"sha1"'}> CONFIG_IMA_DEFAULT_HASH_SHA1 policy<{'amd64': 'y'}> -CONFIG_IMA_DEFAULT_HASH_SHA256 policy<{'amd64': 'n'}> -CONFIG_IMA_DEFAULT_HASH_SHA256 note<'LP: #1643652'> - CONFIG_IMA_DEFAULT_HASH_SHA512 policy<{'amd64': 'n'}> CONFIG_IMA_DEFAULT_TEMPLATE policy<{'amd64': '"ima-ng"'}> CONFIG_IMA_DISABLE_HTABLE policy<{'amd64': 'n'}> -CONFIG_IMA_KEXEC policy<{'amd64': 'y'}> -CONFIG_IMA_KEXEC note<'LP: #1643652'> - -CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY policy<{'amd64': 'n'}> -CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY note<'LP: #1667490'> - -CONFIG_IMA_LOAD_X509 policy<{'amd64': 'n'}> -CONFIG_IMA_LOAD_X509 note<'LP: #1643652'> - CONFIG_IMA_LSM_RULES policy<{'amd64': 'y'}> CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS policy<{'amd64': 'y'}> CONFIG_IMA_MEASURE_PCR_IDX policy<{'amd64': '10'}> CONFIG_IMA_NG_TEMPLATE policy<{'amd64': 'y'}> CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS policy<{'amd64': 'y'}> -CONFIG_IMA_READ_POLICY policy<{'amd64': 'n'}> -CONFIG_IMA_READ_POLICY note<'LP: #1866909'> - CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT policy<{'amd64': 'y'}> -CONFIG_IMA_SIG_TEMPLATE policy<{'amd64': 'n'}> -CONFIG_IMA_SIG_TEMPLATE note<'LP: #1643652'> - -CONFIG_IMA_TRUSTED_KEYRING policy<{'amd64': 'y'}> -CONFIG_IMA_TRUSTED_KEYRING note<'LP: #1643652'> - -CONFIG_IMA_WRITE_POLICY policy<{'amd64': 'n'}> -CONFIG_IMA_WRITE_POLICY note<'LP: #1667490'> - CONFIG_IMG_ASCII_LCD policy<{'amd64': 'm'}> CONFIG_INA2XX_ADC policy<{'amd64': 'm'}> CONFIG_INET policy<{'amd64': 'y'}> @@ -3794,9 +4192,6 @@ CONFIG_INPUT_TWL4030_PWRBUTTON policy<{'amd64': 'm'}> CONFIG_INPUT_TWL4030_VIBRA policy<{'amd64': 'm'}> CONFIG_INPUT_TWL6040_VIBRA policy<{'amd64': 'm'}> -CONFIG_INPUT_UINPUT policy<{'amd64': 'y'}> -CONFIG_INPUT_UINPUT note<'LP: #584812'> - CONFIG_INPUT_VIVALDIFMAP policy<{'amd64': 'y'}> CONFIG_INPUT_WM831X_ON policy<{'amd64': 'm'}> CONFIG_INPUT_XEN_KBDDEV_FRONTEND policy<{'amd64': 'm'}> @@ -3808,9 +4203,6 @@ CONFIG_INTEGRITY_ASYMMETRIC_KEYS policy<{'amd64': 'y'}> CONFIG_INTEGRITY_AUDIT policy<{'amd64': 'y'}> CONFIG_INTEGRITY_MACHINE_KEYRING policy<{'amd64': 'y'}> -CONFIG_INTEGRITY_PLATFORM_KEYRING policy<{'amd64': 'y'}> -CONFIG_INTEGRITY_PLATFORM_KEYRING note<'Required for lockdown'> - CONFIG_INTEGRITY_SIGNATURE policy<{'amd64': 'y'}> CONFIG_INTEGRITY_TRUSTED_KEYRING policy<{'amd64': 'y'}> CONFIG_INTEL_ATOMISP policy<{'amd64': 'y'}> @@ -3833,9 +4225,6 @@ CONFIG_INTEL_INT0002_VGPIO policy<{'amd64': 'm'}> CONFIG_INTEL_IOATDMA policy<{'amd64': 'm'}> CONFIG_INTEL_IOMMU policy<{'amd64': 'y'}> -CONFIG_INTEL_IOMMU_DEFAULT_ON policy<{'amd64': 'n'}> -CONFIG_INTEL_IOMMU_DEFAULT_ON note<'the IOMMU can trigger boot failures'> - CONFIG_INTEL_IOMMU_FLOPPY_WA policy<{'amd64': 'y'}> CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON policy<{'amd64': 'n'}> CONFIG_INTEL_IOMMU_SVM policy<{'amd64': 'y'}> @@ -3916,9 +4305,6 @@ CONFIG_IOASID policy<{'amd64': 'y'}> CONFIG_IOMMU_API policy<{'amd64': 'y'}> CONFIG_IOMMU_DEBUG policy<{'amd64': 'n'}> -CONFIG_IOMMU_DEBUGFS policy<{'amd64': 'n'}> -CONFIG_IOMMU_DEBUGFS note<'LP: #1861057'> - CONFIG_IOMMU_DEFAULT_DMA_LAZY policy<{'amd64': 'y'}> CONFIG_IOMMU_DEFAULT_DMA_STRICT policy<{'amd64': 'n'}> CONFIG_IOMMU_DEFAULT_PASSTHROUGH policy<{'amd64': 'n'}> @@ -3964,9 +4350,6 @@ CONFIG_IP6_NF_TARGET_SYNPROXY policy<{'amd64': 'm'}> CONFIG_IPACK_BUS policy<{'amd64': 'm'}> CONFIG_IPC_NS policy<{'amd64': 'y'}> -CONFIG_IPDDP policy<{'amd64': 'n'}> -CONFIG_IPDDP note<'LP: #1559772'> - CONFIG_IPMI_DEVICE_INTERFACE policy<{'amd64': 'm'}> CONFIG_IPMI_DMI_DECODE policy<{'amd64': 'y'}> CONFIG_IPMI_HANDLER policy<{'amd64': 'm'}> @@ -3976,9 +4359,6 @@ CONFIG_IPMI_SI policy<{'amd64': 'm'}> CONFIG_IPMI_SSIF policy<{'amd64': 'm'}> CONFIG_IPMI_WATCHDOG policy<{'amd64': 'm'}> -CONFIG_IPV6 policy<{'amd64': 'y'}> -CONFIG_IPV6 note<'if this is a module we get a module load for every ipv6 packet'> - CONFIG_IPV6_FOU policy<{'amd64': 'm'}> CONFIG_IPV6_FOU_TUNNEL policy<{'amd64': 'm'}> CONFIG_IPV6_GRE policy<{'amd64': 'm'}> @@ -4049,9 +4429,6 @@ CONFIG_IP_NF_TARGET_TTL policy<{'amd64': 'm'}> CONFIG_IP_PIMSM_V1 policy<{'amd64': 'y'}> CONFIG_IP_PIMSM_V2 policy<{'amd64': 'y'}> -CONFIG_IP_PNP policy<{'amd64': 'n'}> -CONFIG_IP_PNP note<'LP: #1259861'> - CONFIG_IP_ROUTE_CLASSID policy<{'amd64': 'y'}> CONFIG_IP_ROUTE_MULTIPATH policy<{'amd64': 'y'}> CONFIG_IP_ROUTE_VERBOSE policy<{'amd64': 'y'}> @@ -4272,14 +4649,8 @@ CONFIG_KERNEL_LZMA policy<{'amd64': 'n'}> CONFIG_KERNEL_LZO policy<{'amd64': 'n'}> CONFIG_KERNEL_XZ policy<{'amd64': 'n'}> -CONFIG_KERNEL_ZSTD policy<{'amd64': 'y'}> -CONFIG_KERNEL_ZSTD note<'LP: #1931725'> - CONFIG_KERNFS policy<{'amd64': 'y'}> CONFIG_KEXEC policy<{'amd64': 'y'}> -CONFIG_KEXEC_BZIMAGE_VERIFY_SIG policy<{'amd64': 'y'}> -CONFIG_KEXEC_BZIMAGE_VERIFY_SIG note<'Q: check this is in sync with the kexec/kdump userspace'> - CONFIG_KEXEC_CORE policy<{'amd64': 'y'}> CONFIG_KEXEC_FILE policy<{'amd64': 'y'}> CONFIG_KEXEC_JUMP policy<{'amd64': 'y'}> @@ -4327,17 +4698,11 @@ CONFIG_KFENCE_DEFERRABLE policy<{'amd64': 'n'}> CONFIG_KFENCE_NUM_OBJECTS policy<{'amd64': '255'}> CONFIG_KFENCE_SAMPLE_INTERVAL policy<{'amd64': '0'}> -CONFIG_KFENCE_STATIC_KEYS policy<{'amd64': 'n'}> -CONFIG_KFENCE_STATIC_KEYS note<'LP: #1948038'> - CONFIG_KFENCE_STRESS_TEST_FAULTS policy<{'amd64': '0'}> CONFIG_KGDB policy<{'amd64': 'y'}> CONFIG_KGDB_HONOUR_BLOCKLIST policy<{'amd64': 'y'}> CONFIG_KGDB_KDB policy<{'amd64': 'y'}> CONFIG_KGDB_LOW_LEVEL_TRAP policy<{'amd64': 'y'}> -CONFIG_KGDB_SERIAL_CONSOLE policy<{'amd64': 'y'}> -CONFIG_KGDB_SERIAL_CONSOLE note<'early debugging support'> - CONFIG_KGDB_TESTS policy<{'amd64': 'n'}> CONFIG_KMX61 policy<{'amd64': 'm'}> CONFIG_KPROBES policy<{'amd64': 'y'}> @@ -4357,9 +4722,6 @@ CONFIG_KSM policy<{'amd64': 'y'}> CONFIG_KSZ884X_PCI policy<{'amd64': 'm'}> CONFIG_KUNIT policy<{'amd64': 'n'}> -CONFIG_KVM policy<{'amd64': 'm'}> -CONFIG_KVM note<'LP: #1532886'> - CONFIG_KVM_AMD policy<{'amd64': 'm'}> CONFIG_KVM_AMD_SEV policy<{'amd64': 'y'}> CONFIG_KVM_ASYNC_PF policy<{'amd64': 'y'}> @@ -4385,9 +4747,6 @@ CONFIG_LAN743X policy<{'amd64': 'm'}> CONFIG_LAPB policy<{'amd64': 'm'}> CONFIG_LAPBETHER policy<{'amd64': 'm'}> -CONFIG_LATENCYTOP policy<{'amd64': 'n'}> -CONFIG_LATENCYTOP note<'LP: #1655986'> - CONFIG_LATTICE_ECP3_CONFIG policy<{'amd64': 'm'}> CONFIG_LCD2S policy<{'amd64': 'm'}> CONFIG_LCD_AMS369FG06 policy<{'amd64': 'm'}> @@ -4523,9 +4882,6 @@ CONFIG_LMP91000 policy<{'amd64': 'm'}> CONFIG_LOAD_UEFI_KEYS policy<{'amd64': 'y'}> CONFIG_LOCALVERSION policy<{'amd64': '""'}> -CONFIG_LOCALVERSION_AUTO policy<{'amd64': 'n'}> -CONFIG_LOCALVERSION_AUTO note<'triggers packaging failures'> - CONFIG_LOCKD policy<{'amd64': 'm'}> CONFIG_LOCKDEP_SUPPORT policy<{'amd64': 'y'}> CONFIG_LOCKD_V4 policy<{'amd64': 'y'}> @@ -4754,9 +5110,6 @@ CONFIG_MEMORY_BALLOON policy<{'amd64': 'y'}> CONFIG_MEMORY_FAILURE policy<{'amd64': 'y'}> CONFIG_MEMORY_HOTPLUG policy<{'amd64': 'y'}> -CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE policy<{'amd64': 'y'}> -CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE note<'LP: #1848492'> - CONFIG_MEMORY_HOTREMOVE policy<{'amd64': 'y'}> CONFIG_MEMORY_ISOLATION policy<{'amd64': 'y'}> CONFIG_MEMORY_NOTIFIER_ERROR_INJECT policy<{'amd64': 'm'}> @@ -4849,9 +5202,6 @@ CONFIG_MFD_SI476X_CORE policy<{'amd64': 'm'}> CONFIG_MFD_SIMPLE_MFD_I2C policy<{'amd64': 'm'}> CONFIG_MFD_SKY81452 policy<{'amd64': 'm'}> -CONFIG_MFD_SM501 policy<{'amd64': 'm'}> -CONFIG_MFD_SM501 note<'boot essential on OMAP4'> - CONFIG_MFD_SM501_GPIO policy<{'amd64': 'y'}> CONFIG_MFD_SY7636A policy<{'amd64': 'm'}> CONFIG_MFD_SYSCON policy<{'amd64': 'y'}> @@ -4983,9 +5333,6 @@ CONFIG_MMC35240 policy<{'amd64': 'm'}> CONFIG_MMCONF_FAM10H policy<{'amd64': 'y'}> CONFIG_MMC_ALCOR policy<{'amd64': 'm'}> -CONFIG_MMC_BLOCK policy<{'amd64': 'm'}> -CONFIG_MMC_BLOCK note<'boot essential on armhf/arm64'> - CONFIG_MMC_BLOCK_MINORS policy<{'amd64': '8'}> CONFIG_MMC_CB710 policy<{'amd64': 'm'}> CONFIG_MMC_CQHCI policy<{'amd64': 'm'}> @@ -4996,16 +5343,10 @@ CONFIG_MMC_REALTEK_PCI policy<{'amd64': 'm'}> CONFIG_MMC_REALTEK_USB policy<{'amd64': 'm'}> CONFIG_MMC_RICOH_MMC policy<{'amd64': 'y'}> -CONFIG_MMC_SDHCI policy<{'amd64': 'm'}> -CONFIG_MMC_SDHCI note<'installation essential on omap/highbank'> - CONFIG_MMC_SDHCI_ACPI policy<{'amd64': 'm'}> CONFIG_MMC_SDHCI_F_SDH30 policy<{'amd64': 'm'}> CONFIG_MMC_SDHCI_IO_ACCESSORS policy<{'amd64': 'y'}> CONFIG_MMC_SDHCI_PCI policy<{'amd64': 'm'}> -CONFIG_MMC_SDHCI_PLTFM policy<{'amd64': 'm'}> -CONFIG_MMC_SDHCI_PLTFM note<'boot essential on highbank'> - CONFIG_MMC_SDHCI_XENON policy<{'amd64': 'm'}> CONFIG_MMC_SDRICOH_CS policy<{'amd64': 'm'}> CONFIG_MMC_SPI policy<{'amd64': 'm'}> @@ -5024,9 +5365,6 @@ CONFIG_MMU_GATHER_RCU_TABLE_FREE policy<{'amd64': 'y'}> CONFIG_MMU_GATHER_TABLE_FREE policy<{'amd64': 'y'}> CONFIG_MMU_NOTIFIER policy<{'amd64': 'y'}> -CONFIG_MODIFY_LDT_SYSCALL policy<{'amd64': 'y'}> -CONFIG_MODIFY_LDT_SYSCALL note<'Q: check this with security'> - CONFIG_MODPROBE_PATH policy<{'amd64': '"/sbin/modprobe"'}> CONFIG_MODULES policy<{'amd64': 'y'}> CONFIG_MODULES_TREE_LOOKUP policy<{'amd64': 'y'}> @@ -5055,9 +5393,6 @@ CONFIG_MODULE_SRCVERSION_ALL policy<{'amd64': 'y'}> CONFIG_MODULE_UNLOAD policy<{'amd64': 'y'}> CONFIG_MODULE_UNLOAD_TAINT_TRACKING policy<{'amd64': 'n'}> -CONFIG_MODVERSIONS policy<{'amd64': 'y'}> -CONFIG_MODVERSIONS note<'required as we have a livepatch/drivers modules signing key'> - CONFIG_MOST policy<{'amd64': 'm'}> CONFIG_MOST_CDEV policy<{'amd64': 'm'}> CONFIG_MOST_COMPONENTS policy<{'amd64': 'm'}> @@ -5151,18 +5486,12 @@ CONFIG_MT7921S policy<{'amd64': 'm'}> CONFIG_MT7921U policy<{'amd64': 'm'}> CONFIG_MT7921_COMMON policy<{'amd64': 'm'}> -CONFIG_MTD policy<{'amd64': 'm'}> -CONFIG_MTD note<'boot essential on arm'> - CONFIG_MTDRAM_ERASE_SIZE policy<{'amd64': '128'}> CONFIG_MTDRAM_TOTAL_SIZE policy<{'amd64': '4096'}> CONFIG_MTD_ABSENT policy<{'amd64': 'm'}> CONFIG_MTD_AMD76XROM policy<{'amd64': 'm'}> CONFIG_MTD_AR7_PARTS policy<{'amd64': 'm'}> CONFIG_MTD_BLKDEVS policy<{'amd64': 'm'}> -CONFIG_MTD_BLOCK policy<{'amd64': 'm'}> -CONFIG_MTD_BLOCK note<'boot essential on arm'> - CONFIG_MTD_BLOCK2MTD policy<{'amd64': 'm'}> CONFIG_MTD_BLOCK_RO policy<{'amd64': 'm'}> CONFIG_MTD_CFI policy<{'amd64': 'm'}> @@ -5179,9 +5508,6 @@ CONFIG_MTD_DATAFLASH policy<{'amd64': 'm'}> CONFIG_MTD_DATAFLASH_OTP policy<{'amd64': 'y'}> CONFIG_MTD_DATAFLASH_WRITE_VERIFY policy<{'amd64': 'n'}> -CONFIG_MTD_DOCG3 policy<{'amd64': 'n'}> -CONFIG_MTD_DOCG3 note<'LP: #1792205'> - CONFIG_MTD_ESB2ROM policy<{'amd64': 'm'}> CONFIG_MTD_GEN_PROBE policy<{'amd64': 'm'}> CONFIG_MTD_HYPERBUS policy<{'amd64': 'm'}> @@ -5202,9 +5528,6 @@ CONFIG_MTD_NAND_DENALI policy<{'amd64': 'm'}> CONFIG_MTD_NAND_DENALI_PCI policy<{'amd64': 'm'}> CONFIG_MTD_NAND_DISKONCHIP policy<{'amd64': 'm'}> -CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE policy<{'amd64': 'n'}> -CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE note<'can be enabled at runtime'> - CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS policy<{'amd64': '0'}> CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED policy<{'amd64': 'n'}> CONFIG_MTD_NAND_ECC policy<{'amd64': 'y'}> @@ -5222,9 +5545,6 @@ CONFIG_MTD_ONENAND_2X_PROGRAM policy<{'amd64': 'y'}> CONFIG_MTD_ONENAND_GENERIC policy<{'amd64': 'm'}> CONFIG_MTD_ONENAND_OTP policy<{'amd64': 'n'}> -CONFIG_MTD_ONENAND_VERIFY_WRITE policy<{'amd64': 'y'}> -CONFIG_MTD_ONENAND_VERIFY_WRITE note<'writes here are not checked in full without'> - CONFIG_MTD_OOPS policy<{'amd64': 'm'}> CONFIG_MTD_PARTITIONED_MASTER policy<{'amd64': 'n'}> CONFIG_MTD_PCI policy<{'amd64': 'm'}> @@ -5241,9 +5561,6 @@ CONFIG_MTD_PSTORE policy<{'amd64': 'm'}> CONFIG_MTD_QINFO_PROBE policy<{'amd64': 'm'}> CONFIG_MTD_RAM policy<{'amd64': 'm'}> -CONFIG_MTD_RAW_NAND policy<{'amd64': 'm'}> -CONFIG_MTD_RAW_NAND note<'boot essential on arm'> - CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK policy<{'amd64': '-1'}> CONFIG_MTD_REDBOOT_PARTS policy<{'amd64': 'm'}> CONFIG_MTD_REDBOOT_PARTS_READONLY policy<{'amd64': 'n'}> @@ -5413,14 +5730,8 @@ CONFIG_NETPOLL policy<{'amd64': 'y'}> CONFIG_NETROM policy<{'amd64': 'm'}> CONFIG_NETWORK_FILESYSTEMS policy<{'amd64': 'y'}> -CONFIG_NETWORK_PHY_TIMESTAMPING policy<{'amd64': 'y'}> -CONFIG_NETWORK_PHY_TIMESTAMPING note<'LP: #1785816'> - CONFIG_NETWORK_SECMARK policy<{'amd64': 'y'}> CONFIG_NETXEN_NIC policy<{'amd64': 'm'}> -CONFIG_NET_9P policy<{'amd64': 'm'}> -CONFIG_NET_9P note<'LP: #1557994'> - CONFIG_NET_9P_DEBUG policy<{'amd64': 'n'}> CONFIG_NET_9P_FD policy<{'amd64': 'm'}> CONFIG_NET_9P_RDMA policy<{'amd64': 'm'}> @@ -5463,9 +5774,6 @@ CONFIG_NET_CORE policy<{'amd64': 'y'}> CONFIG_NET_DEVLINK policy<{'amd64': 'y'}> CONFIG_NET_DEV_REFCNT_TRACKER policy<{'amd64': 'n'}> -CONFIG_NET_DROP_MONITOR policy<{'amd64': 'y'}> -CONFIG_NET_DROP_MONITOR note<'LP: #1660634'> - CONFIG_NET_DSA policy<{'amd64': 'm'}> CONFIG_NET_DSA_AR9331 policy<{'amd64': 'm'}> CONFIG_NET_DSA_BCM_SF2 policy<{'amd64': 'm'}> @@ -5597,9 +5905,6 @@ CONFIG_NET_SCH_TEQL policy<{'amd64': 'm'}> CONFIG_NET_SELFTESTS policy<{'amd64': 'y'}> CONFIG_NET_SOCK_MSG policy<{'amd64': 'y'}> -CONFIG_NET_SWITCHDEV policy<{'amd64': 'y'}> -CONFIG_NET_SWITCHDEV note<'updated to y for s390x starting with focal'> - CONFIG_NET_TC_SKB_EXT policy<{'amd64': 'y'}> CONFIG_NET_TEAM policy<{'amd64': 'm'}> CONFIG_NET_TEAM_MODE_ACTIVEBACKUP policy<{'amd64': 'm'}> @@ -5633,9 +5938,6 @@ CONFIG_NET_VENDOR_DAVICOM policy<{'amd64': 'y'}> CONFIG_NET_VENDOR_DEC policy<{'amd64': 'y'}> CONFIG_NET_VENDOR_DLINK policy<{'amd64': 'y'}> -CONFIG_NET_VENDOR_EMULEX policy<{'amd64': 'y'}> -CONFIG_NET_VENDOR_EMULEX note<'LP: #1543165'> - CONFIG_NET_VENDOR_ENGLEDER policy<{'amd64': 'y'}> CONFIG_NET_VENDOR_EZCHIP policy<{'amd64': 'y'}> CONFIG_NET_VENDOR_FUJITSU policy<{'amd64': 'y'}> @@ -5874,9 +6176,6 @@ CONFIG_NL80211_TESTMODE policy<{'amd64': 'n'}> CONFIG_NLATTR policy<{'amd64': 'y'}> CONFIG_NLMON policy<{'amd64': 'm'}> -CONFIG_NLS policy<{'amd64': 'y'}> -CONFIG_NLS note<'dependancy of boot essential'> - CONFIG_NLS_ASCII policy<{'amd64': 'm'}> CONFIG_NLS_CODEPAGE_1250 policy<{'amd64': 'm'}> CONFIG_NLS_CODEPAGE_1251 policy<{'amd64': 'm'}> @@ -5930,28 +6229,16 @@ CONFIG_NOA1305 policy<{'amd64': 'm'}> CONFIG_NODES_SHIFT policy<{'amd64': '10'}> CONFIG_NOP_TRACER policy<{'amd64': 'y'}> -CONFIG_NOP_USB_XCEIV policy<{'amd64': 'm'}> -CONFIG_NOP_USB_XCEIV note<'boot essential on omap/highbank'> - CONFIG_NORTEL_HERMES policy<{'amd64': 'm'}> CONFIG_NOTIFIER_ERROR_INJECTION policy<{'amd64': 'm'}> CONFIG_NOUVEAU_DEBUG policy<{'amd64': '5'}> CONFIG_NOUVEAU_DEBUG_DEFAULT policy<{'amd64': '3'}> CONFIG_NOUVEAU_DEBUG_MMU policy<{'amd64': 'n'}> CONFIG_NOUVEAU_DEBUG_PUSH policy<{'amd64': 'n'}> -CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT policy<{'amd64': 'n'}> -CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT note<'Selects CONFIG_DRM_LEGACY which is not wanted'> - CONFIG_NOZOMI policy<{'amd64': 'm'}> CONFIG_NO_HZ policy<{'amd64': 'y'}> CONFIG_NO_HZ_COMMON policy<{'amd64': 'y'}> CONFIG_NO_HZ_FULL policy<{'amd64': 'n'}> -CONFIG_NO_HZ_IDLE policy<{'amd64': 'y'}> -CONFIG_NO_HZ_IDLE note<'LP: #1413968'> - -CONFIG_NR_CPUS policy<{'amd64': '8192'}> -CONFIG_NR_CPUS note<'LP: #1864198'> - CONFIG_NR_CPUS_DEFAULT policy<{'amd64': '8192'}> CONFIG_NR_CPUS_RANGE_BEGIN policy<{'amd64': '8192'}> CONFIG_NR_CPUS_RANGE_END policy<{'amd64': '8192'}> @@ -5977,24 +6264,12 @@ CONFIG_NTFS_FS policy<{'amd64': 'm'}> CONFIG_NTFS_RW policy<{'amd64': 'n'}> CONFIG_NULL_TTY policy<{'amd64': 'm'}> -CONFIG_NUMA policy<{'amd64': 'y'}> -CONFIG_NUMA note<'LP: #1557690'> - CONFIG_NUMA_BALANCING policy<{'amd64': 'y'}> -CONFIG_NUMA_BALANCING_DEFAULT_ENABLED policy<{'amd64': 'y'}> -CONFIG_NUMA_BALANCING_DEFAULT_ENABLED note<'LP: #1557690'> - -CONFIG_NUMA_EMU policy<{'amd64': 'n'}> -CONFIG_NUMA_EMU note<'LP: #1864198'> - CONFIG_NUMA_KEEP_MEMINFO policy<{'amd64': 'y'}> CONFIG_NVDIMM_DAX policy<{'amd64': 'y'}> CONFIG_NVDIMM_KEYS policy<{'amd64': 'y'}> CONFIG_NVDIMM_PFN policy<{'amd64': 'y'}> CONFIG_NVIDIA_WMI_EC_BACKLIGHT policy<{'amd64': 'm'}> -CONFIG_NVMEM policy<{'amd64': 'y'}> -CONFIG_NVMEM note<'LP: #1543165'> - CONFIG_NVMEM_RAVE_SP_EEPROM policy<{'amd64': 'm'}> CONFIG_NVMEM_RMEM policy<{'amd64': 'm'}> CONFIG_NVMEM_SPMI_SDAM policy<{'amd64': 'm'}> @@ -6017,16 +6292,10 @@ CONFIG_NVME_TARGET_TCP policy<{'amd64': 'm'}> CONFIG_NVME_TCP policy<{'amd64': 'm'}> CONFIG_NVME_VERBOSE_ERRORS policy<{'amd64': 'n'}> -CONFIG_NVRAM policy<{'amd64': 'm'}> -CONFIG_NVRAM note<'LP: #1837726'> - CONFIG_NVSW_SN2201 policy<{'amd64': 'm'}> CONFIG_NV_TCO policy<{'amd64': 'm'}> CONFIG_NXP_C45_TJA11XX_PHY policy<{'amd64': 'm'}> CONFIG_NXP_TJA11XX_PHY policy<{'amd64': 'm'}> -CONFIG_N_GSM policy<{'amd64': 'm'}> -CONFIG_N_GSM note<'LP: #1404670'> - CONFIG_N_HDLC policy<{'amd64': 'm'}> CONFIG_OBJAGG policy<{'amd64': 'm'}> CONFIG_OBJTOOL policy<{'amd64': 'y'}> @@ -6074,9 +6343,6 @@ CONFIG_PAGE_EXTENSION policy<{'amd64': 'n'}> CONFIG_PAGE_IDLE_FLAG policy<{'amd64': 'y'}> CONFIG_PAGE_OWNER policy<{'amd64': 'n'}> -CONFIG_PAGE_POISONING policy<{'amd64': 'y'}> -CONFIG_PAGE_POISONING note<'LP: #1783651'> - CONFIG_PAGE_POOL policy<{'amd64': 'y'}> CONFIG_PAGE_POOL_STATS policy<{'amd64': 'n'}> CONFIG_PAGE_REPORTING policy<{'amd64': 'y'}> @@ -6092,9 +6358,6 @@ CONFIG_PANEL_CHANGE_MESSAGE policy<{'amd64': 'n'}> CONFIG_PANEL_PARPORT policy<{'amd64': '0'}> CONFIG_PANEL_PROFILE policy<{'amd64': '5'}> -CONFIG_PANIC_ON_OOPS policy<{'amd64': 'n'}> -CONFIG_PANIC_ON_OOPS note<'keep working if at all possible'> - CONFIG_PANIC_ON_OOPS_VALUE policy<{'amd64': '0'}> CONFIG_PANIC_TIMEOUT policy<{'amd64': '0'}> CONFIG_PANTHERLORD_FF policy<{'amd64': 'y'}> @@ -6151,9 +6414,6 @@ CONFIG_PATA_HPT37X policy<{'amd64': 'm'}> CONFIG_PATA_HPT3X2N policy<{'amd64': 'm'}> CONFIG_PATA_HPT3X3 policy<{'amd64': 'm'}> -CONFIG_PATA_HPT3X3_DMA policy<{'amd64': 'n'}> -CONFIG_PATA_HPT3X3_DMA note<'DMA mode is documented problematic'> - CONFIG_PATA_IT8213 policy<{'amd64': 'm'}> CONFIG_PATA_IT821X policy<{'amd64': 'm'}> CONFIG_PATA_JMICRON policy<{'amd64': 'm'}> @@ -6195,16 +6455,10 @@ CONFIG_PCI200SYN policy<{'amd64': 'm'}> CONFIG_PCIEAER policy<{'amd64': 'y'}> CONFIG_PCIEAER_INJECT policy<{'amd64': 'n'}> -CONFIG_PCIEASPM policy<{'amd64': 'y'}> -CONFIG_PCIEASPM_DEFAULT policy<{'amd64': 'y'}> -CONFIG_PCIEASPM_DEFAULT note<'LP: #1398544'> - +CONFIG_PCIEASPM policy<{'amd64': 'y'}> CONFIG_PCIEASPM_PERFORMANCE policy<{'amd64': 'n'}> CONFIG_PCIEASPM_POWERSAVE policy<{'amd64': 'n'}> CONFIG_PCIEASPM_POWER_SUPERSAVE policy<{'amd64': 'n'}> -CONFIG_PCIEPORTBUS policy<{'amd64': 'y'}> -CONFIG_PCIEPORTBUS note<'LP: #1665404'> - CONFIG_PCIE_BUS_DEFAULT policy<{'amd64': 'y'}> CONFIG_PCIE_BUS_PEER2PEER policy<{'amd64': 'n'}> CONFIG_PCIE_BUS_PERFORMANCE policy<{'amd64': 'n'}> @@ -6322,9 +6576,6 @@ CONFIG_PINCTRL_BROXTON policy<{'amd64': 'm'}> CONFIG_PINCTRL_CANNONLAKE policy<{'amd64': 'm'}> CONFIG_PINCTRL_CEDARFORK policy<{'amd64': 'm'}> -CONFIG_PINCTRL_CHERRYVIEW policy<{'amd64': 'y'}> -CONFIG_PINCTRL_CHERRYVIEW note<'LP: #1630238'> - CONFIG_PINCTRL_CS47L15 policy<{'amd64': 'y'}> CONFIG_PINCTRL_CS47L35 policy<{'amd64': 'y'}> CONFIG_PINCTRL_CS47L85 policy<{'amd64': 'y'}> @@ -6362,9 +6613,6 @@ CONFIG_PLIP policy<{'amd64': 'm'}> CONFIG_PLX_DMA policy<{'amd64': 'm'}> CONFIG_PLX_HERMES policy<{'amd64': 'm'}> -CONFIG_PM policy<{'amd64': 'y'}> -CONFIG_PM note<'LP: #1867753'> - CONFIG_PMBUS policy<{'amd64': 'm'}> CONFIG_PMIC_ADP5520 policy<{'amd64': 'y'}> CONFIG_PMIC_DA903X policy<{'amd64': 'y'}> @@ -6437,9 +6685,6 @@ CONFIG_PREEMPT_BUILD policy<{'amd64': 'y'}> CONFIG_PREEMPT_COUNT policy<{'amd64': 'y'}> CONFIG_PREEMPT_DYNAMIC policy<{'amd64': 'y'}> -CONFIG_PREEMPT_NONE policy<{'amd64': 'n'}> -CONFIG_PREEMPT_NONE note<'LP: #1543165'> - CONFIG_PREEMPT_NOTIFIERS policy<{'amd64': 'y'}> CONFIG_PREEMPT_RCU policy<{'amd64': 'y'}> CONFIG_PREEMPT_TRACER policy<{'amd64': 'n'}> @@ -6478,9 +6723,6 @@ CONFIG_PSE_CONTROLLER policy<{'amd64': 'y'}> CONFIG_PSE_REGULATOR policy<{'amd64': 'm'}> CONFIG_PSI policy<{'amd64': 'y'}> -CONFIG_PSI_DEFAULT_DISABLED policy<{'amd64': 'n'}> -CONFIG_PSI_DEFAULT_DISABLED note<'LP: #1876044'> - CONFIG_PSTORE policy<{'amd64': 'y'}> CONFIG_PSTORE_842_COMPRESS policy<{'amd64': 'n'}> CONFIG_PSTORE_BLK policy<{'amd64': 'm'}> @@ -6698,9 +6940,6 @@ CONFIG_REGULATOR_DA9211 policy<{'amd64': 'm'}> CONFIG_REGULATOR_DEBUG policy<{'amd64': 'n'}> CONFIG_REGULATOR_FAN53555 policy<{'amd64': 'm'}> -CONFIG_REGULATOR_FIXED_VOLTAGE policy<{'amd64': 'm'}> -CONFIG_REGULATOR_FIXED_VOLTAGE note<'boot essential on arm'> - CONFIG_REGULATOR_GPIO policy<{'amd64': 'm'}> CONFIG_REGULATOR_ISL6271A policy<{'amd64': 'm'}> CONFIG_REGULATOR_ISL9305 policy<{'amd64': 'm'}> @@ -6778,9 +7017,6 @@ CONFIG_REGULATOR_TPS65910 policy<{'amd64': 'm'}> CONFIG_REGULATOR_TPS65912 policy<{'amd64': 'm'}> CONFIG_REGULATOR_TPS68470 policy<{'amd64': 'm'}> -CONFIG_REGULATOR_TWL4030 policy<{'amd64': 'm'}> -CONFIG_REGULATOR_TWL4030 note<'boot requisite for omap4'> - CONFIG_REGULATOR_USERSPACE_CONSUMER policy<{'amd64': 'm'}> CONFIG_REGULATOR_VIRTUAL_CONSUMER policy<{'amd64': 'm'}> CONFIG_REGULATOR_WM831X policy<{'amd64': 'm'}> @@ -6901,9 +7137,6 @@ CONFIG_RTC_DRV_ABX80X policy<{'amd64': 'm'}> CONFIG_RTC_DRV_BQ32K policy<{'amd64': 'm'}> CONFIG_RTC_DRV_BQ4802 policy<{'amd64': 'm'}> -CONFIG_RTC_DRV_CMOS policy<{'amd64': 'y'}> -CONFIG_RTC_DRV_CMOS note<'boot essential on i386/amd64'> - CONFIG_RTC_DRV_CROS_EC policy<{'amd64': 'm'}> CONFIG_RTC_DRV_DA9052 policy<{'amd64': 'm'}> CONFIG_RTC_DRV_DA9055 policy<{'amd64': 'm'}> @@ -7060,9 +7293,6 @@ CONFIG_RTW89_DEBUGFS policy<{'amd64': 'y'}> CONFIG_RTW89_DEBUGMSG policy<{'amd64': 'y'}> CONFIG_RTW89_PCI policy<{'amd64': 'm'}> -CONFIG_RT_GROUP_SCHED policy<{'amd64': 'n'}> -CONFIG_RT_GROUP_SCHED note<'LP: #1875665'> - CONFIG_RT_MUTEXES policy<{'amd64': 'y'}> CONFIG_RUNTIME_TESTING_MENU policy<{'amd64': 'y'}> CONFIG_RV policy<{'amd64': 'y'}> @@ -7089,9 +7319,6 @@ CONFIG_SAMPLE_TRACE_ARRAY policy<{'amd64': 'm'}> CONFIG_SAMPLE_TRACE_CUSTOM_EVENTS policy<{'amd64': 'n'}> CONFIG_SAMPLE_TRACE_EVENTS policy<{'amd64': 'n'}> -CONFIG_SAMPLE_TRACE_PRINTK policy<{'amd64': 'm'}> -CONFIG_SAMPLE_TRACE_PRINTK note<'Required for ftrace selftests'> - CONFIG_SAMPLE_VFIO_MDEV_MBOCHS policy<{'amd64': 'n'}> CONFIG_SAMPLE_VFIO_MDEV_MDPY policy<{'amd64': 'n'}> CONFIG_SAMPLE_VFIO_MDEV_MDPY_FB policy<{'amd64': 'n'}> @@ -7101,9 +7328,6 @@ CONFIG_SAMSUNG_Q10 policy<{'amd64': 'm'}> CONFIG_SATA_ACARD_AHCI policy<{'amd64': 'm'}> CONFIG_SATA_AHCI policy<{'amd64': 'm'}> -CONFIG_SATA_AHCI_PLATFORM policy<{'amd64': 'm'}> -CONFIG_SATA_AHCI_PLATFORM note<'boot essential on highbank'> - CONFIG_SATA_DWC policy<{'amd64': 'm'}> CONFIG_SATA_DWC_OLD_DMA policy<{'amd64': 'y'}> CONFIG_SATA_HOST policy<{'amd64': 'y'}> @@ -7193,12 +7417,6 @@ CONFIG_SCSI_INIA100 policy<{'amd64': 'm'}> CONFIG_SCSI_INITIO policy<{'amd64': 'm'}> CONFIG_SCSI_IPR policy<{'amd64': 'm'}> -CONFIG_SCSI_IPR_DUMP policy<{'amd64': 'y'}> -CONFIG_SCSI_IPR_DUMP note<'LP: #1343109'> - -CONFIG_SCSI_IPR_TRACE policy<{'amd64': 'y'}> -CONFIG_SCSI_IPR_TRACE note<'LP: #1343109'> - CONFIG_SCSI_IPS policy<{'amd64': 'm'}> CONFIG_SCSI_ISCI policy<{'amd64': 'm'}> CONFIG_SCSI_ISCSI_ATTRS policy<{'amd64': 'm'}> @@ -7256,9 +7474,6 @@ CONFIG_SCSI_UFS_DWC_TC_PLATFORM policy<{'amd64': 'm'}> CONFIG_SCSI_UFS_HPB policy<{'amd64': 'y'}> CONFIG_SCSI_UFS_HWMON policy<{'amd64': 'n'}> -CONFIG_SCSI_VIRTIO policy<{'amd64': 'm'}> -CONFIG_SCSI_VIRTIO note<'tech preview of new feature'> - CONFIG_SCSI_WD719X policy<{'amd64': 'm'}> CONFIG_SCTP_COOKIE_HMAC_MD5 policy<{'amd64': 'y'}> CONFIG_SCTP_COOKIE_HMAC_SHA1 policy<{'amd64': 'y'}> @@ -7296,17 +7511,11 @@ CONFIG_SECURITY_NETWORK_XFRM policy<{'amd64': 'y'}> CONFIG_SECURITY_PATH policy<{'amd64': 'y'}> CONFIG_SECURITY_PERF_EVENTS_RESTRICT policy<{'amd64': 'y'}> -CONFIG_SECURITY_SAFESETID policy<{'amd64': 'y'}> -CONFIG_SECURITY_SAFESETID note<'LP: #1845391'> - CONFIG_SECURITY_SELINUX policy<{'amd64': 'y'}> CONFIG_SECURITY_SELINUX_AVC_STATS policy<{'amd64': 'y'}> CONFIG_SECURITY_SELINUX_BOOTPARAM policy<{'amd64': 'y'}> CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE policy<{'amd64': '1'}> CONFIG_SECURITY_SELINUX_DEVELOP policy<{'amd64': 'y'}> -CONFIG_SECURITY_SELINUX_DISABLE policy<{'amd64': 'n'}> -CONFIG_SECURITY_SELINUX_DISABLE note<'LP: #1680315'> - CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE policy<{'amd64': '256'}> CONFIG_SECURITY_SELINUX_SIDTAB_HASH_BITS policy<{'amd64': '9'}> CONFIG_SECURITY_SMACK policy<{'amd64': 'y'}> @@ -7608,12 +7817,6 @@ CONFIG_SERIAL_ARC_NR_PORTS policy<{'amd64': '1'}> CONFIG_SERIAL_CORE policy<{'amd64': 'y'}> CONFIG_SERIAL_CORE_CONSOLE policy<{'amd64': 'y'}> -CONFIG_SERIAL_DEV_BUS policy<{'amd64': 'y'}> -CONFIG_SERIAL_DEV_BUS note<'LP: #1739939'> - -CONFIG_SERIAL_DEV_CTRL_TTYPORT policy<{'amd64': 'y'}> -CONFIG_SERIAL_DEV_CTRL_TTYPORT note<'LP: #1739939'> - CONFIG_SERIAL_EARLYCON policy<{'amd64': 'y'}> CONFIG_SERIAL_FSL_LINFLEXUART policy<{'amd64': 'm'}> CONFIG_SERIAL_FSL_LPUART policy<{'amd64': 'm'}> @@ -7723,12 +7926,6 @@ CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN policy<{'amd64': 'y'}> CONFIG_SMB_SERVER_KERBEROS5 policy<{'amd64': 'y'}> CONFIG_SMB_SERVER_SMBDIRECT policy<{'amd64': 'y'}> -CONFIG_SMC policy<{'amd64': 'm'}> -CONFIG_SMC note<'LP: #1789934'> - -CONFIG_SMC_DIAG policy<{'amd64': 'm'}> -CONFIG_SMC_DIAG note<'LP: #1789934'> - CONFIG_SMP policy<{'amd64': 'y'}> CONFIG_SMSC37B787_WDT policy<{'amd64': 'm'}> CONFIG_SMSC911X policy<{'amd64': 'm'}> @@ -7741,9 +7938,6 @@ CONFIG_SMS_SIANO_RC policy<{'amd64': 'y'}> CONFIG_SMS_USB_DRV policy<{'amd64': 'm'}> CONFIG_SM_FTL policy<{'amd64': 'm'}> -CONFIG_SND policy<{'amd64': 'm'}> -CONFIG_SND note<'not autoloadable on omap'> - CONFIG_SND_AC97_CODEC policy<{'amd64': 'm'}> CONFIG_SND_AC97_POWER_SAVE policy<{'amd64': 'y'}> CONFIG_SND_AC97_POWER_SAVE_DEFAULT policy<{'amd64': '0'}> @@ -7839,13 +8033,7 @@ CONFIG_SND_HDA_INTEL policy<{'amd64': 'm'}> CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM policy<{'amd64': 'n'}> CONFIG_SND_HDA_PATCH_LOADER policy<{'amd64': 'y'}> -CONFIG_SND_HDA_POWER_SAVE_DEFAULT policy<{'amd64': '1'}> -CONFIG_SND_HDA_POWER_SAVE_DEFAULT note<'LP: #1804265'> - CONFIG_SND_HDA_PREALLOC_SIZE policy<{'amd64': '0'}> -CONFIG_SND_HDA_RECONFIG policy<{'amd64': 'y'}> -CONFIG_SND_HDA_RECONFIG note<'allows fixes to be tested live'> - CONFIG_SND_HDA_SCODEC_CS35L41 policy<{'amd64': 'm'}> CONFIG_SND_HDA_SCODEC_CS35L41_I2C policy<{'amd64': 'm'}> CONFIG_SND_HDA_SCODEC_CS35L41_SPI policy<{'amd64': 'm'}> @@ -7898,9 +8086,6 @@ CONFIG_SND_PCMCIA policy<{'amd64': 'y'}> CONFIG_SND_PCM_ELD policy<{'amd64': 'y'}> CONFIG_SND_PCM_IEC958 policy<{'amd64': 'y'}> -CONFIG_SND_PCM_OSS policy<{'amd64': 'n'}> -CONFIG_SND_PCM_OSS note<'deprecated in favour of pulseaudio emulation'> - CONFIG_SND_PCM_TIMER policy<{'amd64': 'y'}> CONFIG_SND_PCSP policy<{'amd64': 'm'}> CONFIG_SND_PCXHR policy<{'amd64': 'm'}> @@ -7925,9 +8110,6 @@ CONFIG_SND_SERIAL_U16550 policy<{'amd64': 'm'}> CONFIG_SND_SIMPLE_CARD policy<{'amd64': 'm'}> CONFIG_SND_SIMPLE_CARD_UTILS policy<{'amd64': 'm'}> -CONFIG_SND_SOC policy<{'amd64': 'm'}> -CONFIG_SND_SOC note<'not autoloadable on omap'> - CONFIG_SND_SOC_AC97_BUS policy<{'amd64': 'y'}> CONFIG_SND_SOC_AC97_CODEC policy<{'amd64': 'm'}> CONFIG_SND_SOC_ACPI policy<{'amd64': 'm'}> @@ -7973,12 +8155,6 @@ CONFIG_SND_SOC_AMD_MACH_COMMON policy<{'amd64': 'm'}> CONFIG_SND_SOC_AMD_PS policy<{'amd64': 'm'}> CONFIG_SND_SOC_AMD_PS_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_AMD_RENOIR policy<{'amd64': 'm'}> -CONFIG_SND_SOC_AMD_RENOIR note<'LP: #1881046'> - -CONFIG_SND_SOC_AMD_RENOIR_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_AMD_RENOIR_MACH note<'LP: #1881046'> - CONFIG_SND_SOC_AMD_RPL_ACP6x policy<{'amd64': 'm'}> CONFIG_SND_SOC_AMD_RV_RT5682_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_AMD_SOF_MACH policy<{'amd64': 'm'}> @@ -8092,23 +8268,11 @@ CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH policy<{'amd64': 'n'}> CONFIG_SND_SOC_INTEL_CATPT policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_CFL policy<{'amd64': 'n'}> -CONFIG_SND_SOC_INTEL_CFL note<'deprecated'> - CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_CML_H policy<{'amd64': 'n'}> -CONFIG_SND_SOC_INTEL_CML_H note<'deprecated'> - -CONFIG_SND_SOC_INTEL_CML_LP policy<{'amd64': 'n'}> -CONFIG_SND_SOC_INTEL_CML_LP note<'deprecated'> - CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_CNL policy<{'amd64': 'n'}> -CONFIG_SND_SOC_INTEL_CNL note<'deprecated'> - CONFIG_SND_SOC_INTEL_DA7219_MAX98357A_GENERIC policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_GLK policy<{'amd64': 'm'}> @@ -8128,14 +8292,8 @@ CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SKL_RT286_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_SKYLAKE policy<{'amd64': 'n'}> -CONFIG_SND_SOC_INTEL_SKYLAKE note<'deprecated'> - CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC policy<{'amd64': 'y'}> -CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC note<'LP: #1915117'> - CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SOF_CIRRUS_COMMON policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH policy<{'amd64': 'm'}> @@ -8149,14 +8307,8 @@ CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SOF_SSP_AMP_MACH policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SOF_WM8804_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH policy<{'amd64': 'm'}> -CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH note<'LP: #1921632'> - CONFIG_SND_SOC_INTEL_SST policy<{'amd64': 'm'}> CONFIG_SND_SOC_INTEL_SST_TOPLEVEL policy<{'amd64': 'y'}> -CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES policy<{'amd64': 'y'}> -CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES note<'LP: #1921632'> - CONFIG_SND_SOC_LPASS_MACRO_COMMON policy<{'amd64': 'm'}> CONFIG_SND_SOC_LPASS_RX_MACRO policy<{'amd64': 'm'}> CONFIG_SND_SOC_LPASS_TX_MACRO policy<{'amd64': 'm'}> @@ -8276,13 +8428,7 @@ CONFIG_SND_SOC_SOF_ELKHARTLAKE policy<{'amd64': 'm'}> CONFIG_SND_SOC_SOF_GEMINILAKE policy<{'amd64': 'm'}> CONFIG_SND_SOC_SOF_HDA policy<{'amd64': 'm'}> -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC policy<{'amd64': 'y'}> -CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC note<'LP: #1848490'> - CONFIG_SND_SOC_SOF_HDA_COMMON policy<{'amd64': 'm'}> -CONFIG_SND_SOC_SOF_HDA_LINK policy<{'amd64': 'y'}> -CONFIG_SND_SOC_SOF_HDA_LINK note<'LP: #1848490'> - CONFIG_SND_SOC_SOF_HDA_LINK_BASELINE policy<{'amd64': 'm'}> CONFIG_SND_SOC_SOF_HDA_PROBES policy<{'amd64': 'm'}> CONFIG_SND_SOC_SOF_ICELAKE policy<{'amd64': 'm'}> @@ -8445,20 +8591,11 @@ CONFIG_SONYPI_COMPAT policy<{'amd64': 'y'}> CONFIG_SONY_FF policy<{'amd64': 'y'}> CONFIG_SONY_LAPTOP policy<{'amd64': 'm'}> -CONFIG_SOUND policy<{'amd64': 'm'}> -CONFIG_SOUND note<'not autoloadable on omap'> - -CONFIG_SOUNDWIRE policy<{'amd64': 'm'}> -CONFIG_SOUNDWIRE note<'LP: #1855685'> - CONFIG_SOUNDWIRE_CADENCE policy<{'amd64': 'm'}> CONFIG_SOUNDWIRE_GENERIC_ALLOCATION policy<{'amd64': 'm'}> CONFIG_SOUNDWIRE_INTEL policy<{'amd64': 'm'}> CONFIG_SOUNDWIRE_QCOM policy<{'amd64': 'm'}> CONFIG_SOUND_OSS_CORE policy<{'amd64': 'y'}> -CONFIG_SOUND_OSS_CORE_PRECLAIM policy<{'amd64': 'n'}> -CONFIG_SOUND_OSS_CORE_PRECLAIM note<'LP: #1385510'> - CONFIG_SP5100_TCO policy<{'amd64': 'm'}> CONFIG_SPARSEMEM policy<{'amd64': 'y'}> CONFIG_SPARSEMEM_EXTREME policy<{'amd64': 'y'}> @@ -8530,16 +8667,7 @@ CONFIG_SPS30 policy<{'amd64': 'm'}> CONFIG_SPS30_I2C policy<{'amd64': 'm'}> CONFIG_SPS30_SERIAL policy<{'amd64': 'm'}> -CONFIG_SQUASHFS policy<{'amd64': 'y'}> -CONFIG_SQUASHFS note<'LP: #1593134'> - -CONFIG_SQUASHFS_4K_DEVBLK_SIZE policy<{'amd64': 'n'}> -CONFIG_SQUASHFS_4K_DEVBLK_SIZE note<'non-default block size'> - CONFIG_SQUASHFS_DECOMP_MULTI policy<{'amd64': 'n'}> -CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU policy<{'amd64': 'y'}> -CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU note<'LP: #1980861'> - CONFIG_SQUASHFS_DECOMP_SINGLE policy<{'amd64': 'n'}> CONFIG_SQUASHFS_EMBEDDED policy<{'amd64': 'n'}> CONFIG_SQUASHFS_FILE_CACHE policy<{'amd64': 'n'}> @@ -8577,9 +8705,6 @@ CONFIG_STACKTRACE_BUILD_ID policy<{'amd64': 'n'}> CONFIG_STACKTRACE_SUPPORT policy<{'amd64': 'y'}> CONFIG_STACK_TRACER policy<{'amd64': 'y'}> -CONFIG_STACK_VALIDATION policy<{'amd64': 'y'}> -CONFIG_STACK_VALIDATION note<'needed for livepatch'> - CONFIG_STAGING policy<{'amd64': 'y'}> CONFIG_STAGING_MEDIA policy<{'amd64': 'y'}> CONFIG_STAGING_MEDIA_DEPRECATED policy<{'amd64': 'n'}> @@ -8672,9 +8797,6 @@ CONFIG_SYSFB policy<{'amd64': 'y'}> CONFIG_SYSFB_SIMPLEFB policy<{'amd64': 'n'}> CONFIG_SYSFS policy<{'amd64': 'y'}> -CONFIG_SYSFS_DEPRECATED policy<{'amd64': 'n'}> -CONFIG_SYSFS_DEPRECATED note<'ensure nothing is using these deprecated interfaces'> - CONFIG_SYSFS_SYSCALL policy<{'amd64': 'y'}> CONFIG_SYSTEM76_ACPI policy<{'amd64': 'm'}> CONFIG_SYSTEMPORT policy<{'amd64': 'm'}> @@ -8720,24 +8842,12 @@ CONFIG_TCG_TIS policy<{'amd64': 'y'}> CONFIG_TCG_TIS_CORE policy<{'amd64': 'y'}> CONFIG_TCG_TIS_I2C policy<{'amd64': 'm'}> -CONFIG_TCG_TIS_I2C_ATMEL policy<{'amd64': 'm'}> -CONFIG_TCG_TIS_I2C_ATMEL note<'LP: #1643652'> - CONFIG_TCG_TIS_I2C_CR50 policy<{'amd64': 'm'}> -CONFIG_TCG_TIS_I2C_INFINEON policy<{'amd64': 'm'}> -CONFIG_TCG_TIS_I2C_INFINEON note<'LP: #1643652'> - -CONFIG_TCG_TIS_I2C_NUVOTON policy<{'amd64': 'm'}> -CONFIG_TCG_TIS_I2C_NUVOTON note<'LP: #1643652'> - CONFIG_TCG_TIS_SPI policy<{'amd64': 'm'}> CONFIG_TCG_TIS_SPI_CR50 policy<{'amd64': 'y'}> CONFIG_TCG_TIS_ST33ZP24 policy<{'amd64': 'm'}> CONFIG_TCG_TIS_ST33ZP24_I2C policy<{'amd64': 'm'}> CONFIG_TCG_TIS_ST33ZP24_SPI policy<{'amd64': 'm'}> -CONFIG_TCG_TPM policy<{'amd64': 'y'}> -CONFIG_TCG_TPM note<'needed for early validation'> - CONFIG_TCG_VTPM_PROXY policy<{'amd64': 'm'}> CONFIG_TCG_XEN policy<{'amd64': 'm'}> CONFIG_TCM_FC policy<{'amd64': 'm'}> @@ -8774,9 +8884,6 @@ CONFIG_TEST_ASYNC_DRIVER_PROBE policy<{'amd64': 'n'}> CONFIG_TEST_BITMAP policy<{'amd64': 'n'}> CONFIG_TEST_BITOPS policy<{'amd64': 'n'}> -CONFIG_TEST_BLACKHOLE_DEV policy<{'amd64': 'm'}> -CONFIG_TEST_BLACKHOLE_DEV note<'Used by net selftests'> - CONFIG_TEST_BPF policy<{'amd64': 'm'}> CONFIG_TEST_CLOCKSOURCE_WATCHDOG policy<{'amd64': 'n'}> CONFIG_TEST_DIV64 policy<{'amd64': 'n'}> @@ -8904,9 +9011,6 @@ CONFIG_TMP117 policy<{'amd64': 'm'}> CONFIG_TMPFS policy<{'amd64': 'y'}> CONFIG_TMPFS_INODE64 policy<{'amd64': 'y'}> -CONFIG_TMPFS_POSIX_ACL policy<{'amd64': 'y'}> -CONFIG_TMPFS_POSIX_ACL note<'some /dev nodes require POSIX ACLs, like /dev/dsp'> - CONFIG_TMPFS_XATTR policy<{'amd64': 'y'}> CONFIG_TOPSTAR_LAPTOP policy<{'amd64': 'm'}> CONFIG_TOSHIBA_BT_RFKILL policy<{'amd64': 'm'}> @@ -8942,9 +9046,6 @@ CONFIG_TOUCHSCREEN_EETI policy<{'amd64': 'm'}> CONFIG_TOUCHSCREEN_EGALAX_SERIAL policy<{'amd64': 'm'}> CONFIG_TOUCHSCREEN_EKTF2127 policy<{'amd64': 'm'}> -CONFIG_TOUCHSCREEN_ELAN policy<{'amd64': 'y'}> -CONFIG_TOUCHSCREEN_ELAN note<'LP: #1630238'> - CONFIG_TOUCHSCREEN_ELO policy<{'amd64': 'm'}> CONFIG_TOUCHSCREEN_EXC3000 policy<{'amd64': 'm'}> CONFIG_TOUCHSCREEN_FUJITSU policy<{'amd64': 'm'}> @@ -9104,9 +9205,6 @@ CONFIG_UBIFS_FS_XATTR policy<{'amd64': 'y'}> CONFIG_UBIFS_FS_ZLIB policy<{'amd64': 'y'}> CONFIG_UBIFS_FS_ZSTD policy<{'amd64': 'y'}> -CONFIG_UBSAN policy<{'amd64': 'y'}> -CONFIG_UBSAN note<'LP: #1942215'> - CONFIG_UBSAN_ALIGNMENT policy<{'amd64': 'n'}> CONFIG_UBSAN_BOOL policy<{'amd64': 'y'}> CONFIG_UBSAN_BOUNDS policy<{'amd64': 'y'}> @@ -9159,9 +9257,6 @@ CONFIG_UNIXWARE_DISKLABEL policy<{'amd64': 'y'}> CONFIG_UNIX_DIAG policy<{'amd64': 'm'}> CONFIG_UNIX_SCM policy<{'amd64': 'y'}> -CONFIG_UNWINDER_FRAME_POINTER policy<{'amd64': 'y'}> -CONFIG_UNWINDER_FRAME_POINTER note<'needed for livepatch'> - CONFIG_UNWINDER_ORC policy<{'amd64': 'n'}> CONFIG_UPROBES policy<{'amd64': 'y'}> CONFIG_UPROBE_EVENTS policy<{'amd64': 'y'}> @@ -9258,12 +9353,6 @@ CONFIG_USB_DYNAMIC_MINORS policy<{'amd64': 'y'}> CONFIG_USB_EG20T policy<{'amd64': 'm'}> CONFIG_USB_EHCI_FSL policy<{'amd64': 'm'}> -CONFIG_USB_EHCI_HCD policy<{'amd64': 'y'}> -CONFIG_USB_EHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> - -CONFIG_USB_EHCI_HCD_PLATFORM policy<{'amd64': 'y'}> -CONFIG_USB_EHCI_HCD_PLATFORM note<'Dont use the generic ehci/ohci code on omap, it doesnt work'> - CONFIG_USB_EHCI_PCI policy<{'amd64': 'y'}> CONFIG_USB_EHCI_ROOT_HUB_TT policy<{'amd64': 'y'}> CONFIG_USB_EHCI_TT_NEWSCHED policy<{'amd64': 'y'}> @@ -9374,12 +9463,6 @@ CONFIG_USB_G_SERIAL policy<{'amd64': 'm'}> CONFIG_USB_G_WEBCAM policy<{'amd64': 'm'}> CONFIG_USB_HACKRF policy<{'amd64': 'm'}> -CONFIG_USB_HCD_BCMA policy<{'amd64': 'm'}> -CONFIG_USB_HCD_BCMA note<'USB_{O,E}HCI_HCD_PLATFORM must be off on omap'> - -CONFIG_USB_HCD_SSB policy<{'amd64': 'm'}> -CONFIG_USB_HCD_SSB note<'USB_{O,E}HCI_HCD_PLATFORM must be off on omap'> - CONFIG_USB_HCD_TEST_MODE policy<{'amd64': 'n'}> CONFIG_USB_HID policy<{'amd64': 'm'}> CONFIG_USB_HIDDEV policy<{'amd64': 'y'}> @@ -9413,9 +9496,6 @@ CONFIG_USB_LIBCOMPOSITE policy<{'amd64': 'm'}> CONFIG_USB_LINK_LAYER_TEST policy<{'amd64': 'm'}> CONFIG_USB_M5602 policy<{'amd64': 'm'}> -CONFIG_USB_M66592 policy<{'amd64': 'n'}> -CONFIG_USB_M66592 note<'gadget device'> - CONFIG_USB_MA901 policy<{'amd64': 'm'}> CONFIG_USB_MASS_STORAGE policy<{'amd64': 'm'}> CONFIG_USB_MAX3420_UDC policy<{'amd64': 'm'}> @@ -9429,9 +9509,6 @@ CONFIG_USB_MSI2500 policy<{'amd64': 'm'}> CONFIG_USB_MUSB_DUAL_ROLE policy<{'amd64': 'y'}> CONFIG_USB_MUSB_GADGET policy<{'amd64': 'n'}> -CONFIG_USB_MUSB_HDRC policy<{'amd64': 'm'}> -CONFIG_USB_MUSB_HDRC note<'not autoloadable on omap'> - CONFIG_USB_MUSB_HOST policy<{'amd64': 'n'}> CONFIG_USB_MV_U3D policy<{'amd64': 'm'}> CONFIG_USB_MV_UDC policy<{'amd64': 'm'}> @@ -9470,9 +9547,6 @@ CONFIG_USB_OHCI_HCD_PCI policy<{'amd64': 'y'}> CONFIG_USB_OHCI_HCD_PLATFORM policy<{'amd64': 'y'}> CONFIG_USB_OHCI_LITTLE_ENDIAN policy<{'amd64': 'y'}> -CONFIG_USB_OTG policy<{'amd64': 'n'}> -CONFIG_USB_OTG note<'LP: #1411295'> - CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB policy<{'amd64': 'n'}> CONFIG_USB_OTG_PRODUCTLIST policy<{'amd64': 'n'}> CONFIG_USB_OXU210HP_HCD policy<{'amd64': 'm'}> @@ -9504,9 +9578,6 @@ CONFIG_USB_SERIAL_CP210X policy<{'amd64': 'm'}> CONFIG_USB_SERIAL_CYBERJACK policy<{'amd64': 'm'}> CONFIG_USB_SERIAL_CYPRESS_M8 policy<{'amd64': 'm'}> -CONFIG_USB_SERIAL_DEBUG policy<{'amd64': 'm'}> -CONFIG_USB_SERIAL_DEBUG note<'not actually debug'> - CONFIG_USB_SERIAL_DIGI_ACCELEPORT policy<{'amd64': 'm'}> CONFIG_USB_SERIAL_EDGEPORT policy<{'amd64': 'm'}> CONFIG_USB_SERIAL_EDGEPORT_TI policy<{'amd64': 'm'}> @@ -9587,9 +9658,6 @@ CONFIG_USB_U132_HCD policy<{'amd64': 'm'}> CONFIG_USB_UAS policy<{'amd64': 'm'}> CONFIG_USB_UEAGLEATM policy<{'amd64': 'm'}> -CONFIG_USB_UHCI_HCD policy<{'amd64': 'y'}> -CONFIG_USB_UHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> - CONFIG_USB_ULPI_BUS policy<{'amd64': 'm'}> CONFIG_USB_USBNET policy<{'amd64': 'm'}> CONFIG_USB_USS720 policy<{'amd64': 'm'}> @@ -9601,12 +9669,6 @@ CONFIG_USB_VL600 policy<{'amd64': 'm'}> CONFIG_USB_WDM policy<{'amd64': 'm'}> CONFIG_USB_XEN_HCD policy<{'amd64': 'm'}> -CONFIG_USB_XHCI_DBGCAP policy<{'amd64': 'y'}> -CONFIG_USB_XHCI_DBGCAP note<'LP: #1730832'> - -CONFIG_USB_XHCI_HCD policy<{'amd64': 'y'}> -CONFIG_USB_XHCI_HCD note<'ensures USB 2.0/1.1 probe ordering'> - CONFIG_USB_XHCI_PCI policy<{'amd64': 'm'}> CONFIG_USB_XHCI_PCI_RENESAS policy<{'amd64': 'm'}> CONFIG_USB_XHCI_PLATFORM policy<{'amd64': 'm'}> @@ -9651,18 +9713,9 @@ CONFIG_VETH policy<{'amd64': 'm'}> CONFIG_VF610_ADC policy<{'amd64': 'm'}> CONFIG_VF610_DAC policy<{'amd64': 'm'}> -CONFIG_VFAT_FS policy<{'amd64': 'y'}> -CONFIG_VFAT_FS note<'needed on arm to ensure we can write the kernel when replacing'> - -CONFIG_VFIO policy<{'amd64': 'y'}> -CONFIG_VFIO note<'LP: #1636733'> - CONFIG_VFIO_IOMMU_TYPE1 policy<{'amd64': 'y'}> CONFIG_VFIO_MDEV policy<{'amd64': 'm'}> CONFIG_VFIO_NOIOMMU policy<{'amd64': 'y'}> -CONFIG_VFIO_PCI policy<{'amd64': 'y'}> -CONFIG_VFIO_PCI note<'LP: #1636733'> - CONFIG_VFIO_PCI_CORE policy<{'amd64': 'y'}> CONFIG_VFIO_PCI_IGD policy<{'amd64': 'y'}> CONFIG_VFIO_PCI_INTX policy<{'amd64': 'y'}> @@ -9911,9 +9964,6 @@ CONFIG_VIDEO_VIA_CAMERA policy<{'amd64': 'm'}> CONFIG_VIDEO_VICODEC policy<{'amd64': 'm'}> CONFIG_VIDEO_VIM2M policy<{'amd64': 'm'}> -CONFIG_VIDEO_VIMC policy<{'amd64': 'm'}> -CONFIG_VIDEO_VIMC note<'LP: #1831482'> - CONFIG_VIDEO_VIVID policy<{'amd64': 'm'}> CONFIG_VIDEO_VIVID_CEC policy<{'amd64': 'y'}> CONFIG_VIDEO_VIVID_MAX_DEVS policy<{'amd64': '64'}> @@ -9927,9 +9977,6 @@ CONFIG_VIRTIO policy<{'amd64': 'y'}> CONFIG_VIRTIO_ANCHOR policy<{'amd64': 'y'}> CONFIG_VIRTIO_BALLOON policy<{'amd64': 'y'}> -CONFIG_VIRTIO_BLK policy<{'amd64': 'm'}> -CONFIG_VIRTIO_BLK note<'KVM paravirt support -- not autoloadable'> - CONFIG_VIRTIO_CONSOLE policy<{'amd64': 'y'}> CONFIG_VIRTIO_DMA_SHARED_BUFFER policy<{'amd64': 'm'}> CONFIG_VIRTIO_FS policy<{'amd64': 'm'}> @@ -9937,13 +9984,7 @@ CONFIG_VIRTIO_IOMMU policy<{'amd64': 'y'}> CONFIG_VIRTIO_MEM policy<{'amd64': 'm'}> CONFIG_VIRTIO_MENU policy<{'amd64': 'y'}> -CONFIG_VIRTIO_MMIO policy<{'amd64': 'y'}> -CONFIG_VIRTIO_MMIO note<'LP: #1557689'> - CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES policy<{'amd64': 'y'}> -CONFIG_VIRTIO_NET policy<{'amd64': 'm'}> -CONFIG_VIRTIO_NET note<'KVM paravirt support -- not autoloadable'> - CONFIG_VIRTIO_PCI policy<{'amd64': 'y'}> CONFIG_VIRTIO_PCI_LEGACY policy<{'amd64': 'y'}> CONFIG_VIRTIO_PCI_LIB policy<{'amd64': 'y'}> @@ -10118,18 +10159,12 @@ CONFIG_WWAN_HWSIM policy<{'amd64': 'm'}> CONFIG_WW_MUTEX_SELFTEST policy<{'amd64': 'n'}> CONFIG_X25 policy<{'amd64': 'm'}> -CONFIG_X509_CERTIFICATE_PARSER policy<{'amd64': 'y'}> -CONFIG_X509_CERTIFICATE_PARSER note<'module signing'> - CONFIG_X86 policy<{'amd64': 'y'}> CONFIG_X86_16BIT policy<{'amd64': 'y'}> CONFIG_X86_5LEVEL policy<{'amd64': 'y'}> CONFIG_X86_64 policy<{'amd64': 'y'}> CONFIG_X86_64_ACPI_NUMA policy<{'amd64': 'y'}> CONFIG_X86_64_SMP policy<{'amd64': 'y'}> -CONFIG_X86_ACPI_CPUFREQ policy<{'amd64': 'y'}> -CONFIG_X86_ACPI_CPUFREQ note<'not autoloadable'> - CONFIG_X86_ACPI_CPUFREQ_CPB policy<{'amd64': 'y'}> CONFIG_X86_AMD_FREQ_SENSITIVITY policy<{'amd64': 'm'}> CONFIG_X86_AMD_PLATFORM_DEVICE policy<{'amd64': 'y'}> @@ -10162,9 +10197,6 @@ CONFIG_X86_INTERNODE_CACHE_SHIFT policy<{'amd64': '6'}> CONFIG_X86_IOPL_IOPERM policy<{'amd64': 'y'}> CONFIG_X86_IO_APIC policy<{'amd64': 'y'}> -CONFIG_X86_KERNEL_IBT policy<{'amd64': 'n'}> -CONFIG_X86_KERNEL_IBT note<'LP: #1980484'> - CONFIG_X86_L1_CACHE_SHIFT policy<{'amd64': '6'}> CONFIG_X86_LOCAL_APIC policy<{'amd64': 'y'}> CONFIG_X86_MCE policy<{'amd64': 'y'}> @@ -10181,32 +10213,20 @@ CONFIG_X86_NUMACHIP policy<{'amd64': 'y'}> CONFIG_X86_P4_CLOCKMOD policy<{'amd64': 'm'}> CONFIG_X86_PAT policy<{'amd64': 'y'}> -CONFIG_X86_PCC_CPUFREQ policy<{'amd64': 'y'}> -CONFIG_X86_PCC_CPUFREQ note<'not autoloadable'> - CONFIG_X86_PKG_TEMP_THERMAL policy<{'amd64': 'm'}> CONFIG_X86_PLATFORM_DEVICES policy<{'amd64': 'y'}> CONFIG_X86_PLATFORM_DRIVERS_DELL policy<{'amd64': 'y'}> CONFIG_X86_PMEM_LEGACY policy<{'amd64': 'y'}> CONFIG_X86_PMEM_LEGACY_DEVICE policy<{'amd64': 'y'}> CONFIG_X86_PM_TIMER policy<{'amd64': 'y'}> -CONFIG_X86_POWERNOW_K8 policy<{'amd64': 'y'}> -CONFIG_X86_POWERNOW_K8 note<'not autoloadable'> - CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS policy<{'amd64': 'y'}> CONFIG_X86_SGX policy<{'amd64': 'y'}> CONFIG_X86_SGX_KVM policy<{'amd64': 'y'}> -CONFIG_X86_SPEEDSTEP_CENTRINO policy<{'amd64': 'y'}> -CONFIG_X86_SPEEDSTEP_CENTRINO note<'not autoloadable'> - CONFIG_X86_SPEEDSTEP_LIB policy<{'amd64': 'm'}> CONFIG_X86_SUPPORTS_MEMORY_FAILURE policy<{'amd64': 'y'}> CONFIG_X86_THERMAL_VECTOR policy<{'amd64': 'y'}> CONFIG_X86_TSC policy<{'amd64': 'y'}> CONFIG_X86_UMIP policy<{'amd64': 'y'}> -CONFIG_X86_UV policy<{'amd64': 'y'}> -CONFIG_X86_UV note<'LP: #1863810'> - CONFIG_X86_VERBOSE_BOOTUP policy<{'amd64': 'n'}> CONFIG_X86_VMX_FEATURE_NAMES policy<{'amd64': 'y'}> CONFIG_X86_VSMP policy<{'amd64': 'n'}> @@ -10218,21 +10238,12 @@ CONFIG_XDP_SOCKETS_DIAG policy<{'amd64': 'm'}> CONFIG_XEN policy<{'amd64': 'y'}> CONFIG_XENFS policy<{'amd64': 'm'}> -CONFIG_XEN_512GB policy<{'amd64': 'y'}> -CONFIG_XEN_512GB note<'Q: is this related to the utlemming questions on memory size?'> - CONFIG_XEN_ACPI policy<{'amd64': 'y'}> -CONFIG_XEN_ACPI_PROCESSOR policy<{'amd64': 'y'}> -CONFIG_XEN_ACPI_PROCESSOR note<'boot essential on XEN host'> - CONFIG_XEN_AUTO_XLATE policy<{'amd64': 'y'}> CONFIG_XEN_BACKEND policy<{'amd64': 'y'}> CONFIG_XEN_BALLOON policy<{'amd64': 'y'}> CONFIG_XEN_BALLOON_MEMORY_HOTPLUG policy<{'amd64': 'y'}> CONFIG_XEN_BLKDEV_BACKEND policy<{'amd64': 'm'}> -CONFIG_XEN_BLKDEV_FRONTEND policy<{'amd64': 'y'}> -CONFIG_XEN_BLKDEV_FRONTEND note<'not autoloadable -- XEN paravirt support'> - CONFIG_XEN_COMPAT_XENFS policy<{'amd64': 'y'}> CONFIG_XEN_DEBUG_FS policy<{'amd64': 'n'}> CONFIG_XEN_DEV_EVTCHN policy<{'amd64': 'm'}> @@ -10250,9 +10261,6 @@ CONFIG_XEN_MCE_LOG policy<{'amd64': 'y'}> CONFIG_XEN_MEMORY_HOTPLUG_LIMIT policy<{'amd64': '512'}> CONFIG_XEN_NETDEV_BACKEND policy<{'amd64': 'm'}> -CONFIG_XEN_NETDEV_FRONTEND policy<{'amd64': 'y'}> -CONFIG_XEN_NETDEV_FRONTEND note<'not autoloadable -- XEN paravirt support'> - CONFIG_XEN_PCIDEV_BACKEND policy<{'amd64': 'm'}> CONFIG_XEN_PCIDEV_FRONTEND policy<{'amd64': 'm'}> CONFIG_XEN_PCI_STUB policy<{'amd64': 'y'}> @@ -10317,9 +10325,6 @@ CONFIG_XPOWER_PMIC_OPREGION policy<{'amd64': 'y'}> CONFIG_XPS policy<{'amd64': 'y'}> CONFIG_XXHASH policy<{'amd64': 'y'}> -CONFIG_XZ_DEC policy<{'amd64': 'y'}> -CONFIG_XZ_DEC note<'boot essential -- initramfs decompressor'> - CONFIG_XZ_DEC_ARM policy<{'amd64': 'y'}> CONFIG_XZ_DEC_ARMTHUMB policy<{'amd64': 'y'}> CONFIG_XZ_DEC_BCJ policy<{'amd64': 'y'}> @@ -10351,9 +10356,6 @@ CONFIG_ZLIB_INFLATE policy<{'amd64': 'y'}> CONFIG_ZONEFS_FS policy<{'amd64': 'm'}> CONFIG_ZONE_DEVICE policy<{'amd64': 'y'}> -CONFIG_ZONE_DMA policy<{'amd64': 'y'}> -CONFIG_ZONE_DMA note<'LP: #1628523'> - CONFIG_ZONE_DMA32 policy<{'amd64': 'y'}> CONFIG_ZOPT2201 policy<{'amd64': 'm'}> CONFIG_ZPA2326 policy<{'amd64': 'm'}> reverted: --- linux-oem-6.1-6.1.0/debian.oem/etc/update.conf +++ linux-oem-6.1-6.1.0.orig/debian.oem/etc/update.conf @@ -1,3 +0,0 @@ -RELEASE_REPO=git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/lunar -SOURCE_RELEASE_BRANCH=master-next -DEBIAN_MASTER=debian.master diff -u linux-oem-6.1-6.1.0/debian.oem/reconstruct linux-oem-6.1-6.1.0/debian.oem/reconstruct --- linux-oem-6.1-6.1.0/debian.oem/reconstruct +++ linux-oem-6.1-6.1.0/debian.oem/reconstruct @@ -1,5 +1,10 @@ # Recreate any symlinks created since the orig. # Remove any files deleted from the orig. +rm -f 'Documentation/devicetree/bindings/phy/amlogic,meson-g12a-usb2-phy.yaml' +rm -f 'Documentation/devicetree/bindings/phy/amlogic,meson-g12a-usb3-pcie-phy.yaml' +rm -f 'drivers/gpu/drm/vmwgfx/vmwgfx_hashtab.c' +rm -f 'drivers/gpu/drm/vmwgfx/vmwgfx_hashtab.h' +chmod +x 'Documentation/devicetree/bindings/sound/everest,es8326.yaml' chmod +x 'debian/cloud-tools/hv_get_dhcp_info' chmod +x 'debian/cloud-tools/hv_get_dns_info' chmod +x 'debian/cloud-tools/hv_set_ifconfig' @@ -48,7 +53,12 @@ chmod +x 'debian/tests-build/check-aliases' chmod +x 'debian/tests/rebuild' chmod +x 'debian/tests/ubuntu-regression-suite' +chmod +x 'drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h' chmod +x 'drivers/watchdog/f71808e_wdt.c' +chmod +x 'scripts/atomic/atomics.tbl' +chmod +x 'sound/soc/codecs/es8326.c' +chmod +x 'sound/soc/codecs/es8326.h' +chmod +x 'tools/testing/selftests/filesystems/fat/run_fat_tests.sh' chmod +x 'update-dkms-versions' chmod +x 'update-version-dkms' exit 0 diff -u linux-oem-6.1-6.1.0/debian.oem/tracking-bug linux-oem-6.1-6.1.0/debian.oem/tracking-bug --- linux-oem-6.1-6.1.0/debian.oem/tracking-bug +++ linux-oem-6.1-6.1.0/debian.oem/tracking-bug @@ -1 +1 @@ -2006571 2023.01.30-1 +2008352 2023.02.27-1 diff -u linux-oem-6.1-6.1.0/debian/changelog linux-oem-6.1-6.1.0/debian/changelog --- linux-oem-6.1-6.1.0/debian/changelog +++ linux-oem-6.1-6.1.0/debian/changelog @@ -1,3 +1,1341 @@ +linux-oem-6.1 (6.1.0-1008.8) jammy; urgency=medium + + * jammy/linux-oem-6.1: 6.1.0-1008.8 -proposed tracker (LP: #2008352) + + * overlayfs mounts as R/O over idmapped mount (LP: #2009065) + - SAUCE: overlayfs: handle idmapped mounts in ovl_do_(set|remove)xattr + + * Some QHD panels fail to refresh when PSR2 enabled (LP: #2009014) + - SAUCE: drm/i915/psr: Use calculated io and fast wake lines + + * Fix mediatek wifi driver crash when loading wrong SAR table (LP: #2009118) + - wifi: mt76: mt7921: fix error code of return in mt7921_acpi_read + + * Packaging resync (LP: #1786013) + - [Packaging] update update.conf + + * Update dg2_dmc to 2.08 (LP: #1999375) + - drm/i915/dmc: Update DG2 DMC version to v2.08 + + * New DG2 workarounds (LP: #2006945) + - drm/i915/dg2: Introduce Wa_18017747507 + - drm/i915/dg2: Introduce Wa_18018764978 + - drm/i915/dg2: Introduce Wa_18019271663 + + * Screen backlight keeps in minimized and can't change it with amdgpu + (LP: #2008871) + - SAUCE: ACPI: video: Add backlight=native DMI quirk for Dell Vostro 15 3535 + + * Remove all other acpi_video backlight interface on Dell AIO platforms + (LP: #2008882) + - SAUCE: ACPI: video: Dell AIO UART backlight detection + + * screen flicker after PSR2 enabled (LP: #2007516) + - SAUCE: drm/i915/display/psr: Disable PSR2 sel fetch on panel SHP 5457 + + * rtcpie in timers from ubuntu_kernel_selftests randomly failing + (LP: #1814234) + - SAUCE: selftest: rtcpie: Force passing unreliable subtest + + * Fix HFP mSBC support on Realtek Bluetooth USB controller (LP: #2007331) + - Bluetooth: btrtl: Add btrealtek data struct + - Bluetooth: btusb: Ignore zero length of USB packets on ALT 6 for specific + chip + + * Jammy update: v6.1.14 upstream stable release (LP: #2008708) + - drm/etnaviv: don't truncate physical page address + - wifi: ath11k: fix warning in dma_free_coherent() of memory chunks while + recovery + - wifi: rtl8xxxu: gen2: Turn on the rate control + - drm/edid: Fix minimum bpc supported with DSC1.2 for HDMI sink + - clk: mxl: Switch from direct readl/writel based IO to regmap based IO + - clk: mxl: Remove redundant spinlocks + - clk: mxl: Add option to override gate clks + - clk: mxl: Fix a clk entry by adding relevant flags + - powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G + - clk: mxl: syscon_node_to_regmap() returns error pointers + - sched/psi: Stop relying on timer_pending() for poll_work rescheduling + - random: always mix cycle counter in add_latent_entropy() + - scsi: libsas: Add smp_ata_check_ready_type() + - scsi: hisi_sas: Fix SATA devices missing issue during I_T nexus reset + - spi: mediatek: Enable irq when pdata is ready + - docs: perf: Fix PMU instance name of hisi-pcie-pmu + - KVM: x86: Fail emulation during EMULTYPE_SKIP on any exception + - KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid + - KVM: VMX: Execute IBPB on emulated VM-exit when guest has IBRS + - can: kvaser_usb: hydra: help gcc-13 to figure out cmd_len + - powerpc: dts: t208x: Disable 10G on MAC1 and MAC2 + - spi: mediatek: Enable irq before the spi registration + - drm/i915: Remove __maybe_unused from mtl_info + - KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET + - selftests: kvm: move declaration at the beginning of main() + - powerpc/64s/radix: Fix RWX mapping with relocated kernel + - nfp: ethtool: support reporting link modes + - nfp: ethtool: fix the bug of setting unsupported port speed + - uaccess: Add speculation barrier to copy_from_user() + - x86/alternatives: Introduce int3_emulate_jcc() + - x86/alternatives: Teach text_poke_bp() to patch Jcc.d32 instructions + - x86/static_call: Add support for Jcc tail-calls + - Bluetooth: btusb: Add more device IDs for WCN6855 + - riscv: remove special treatment for the link order of head.o + - arm64: remove special treatment for the link order of head.o + - arch: fix broken BuildID for arm64 and riscv + - powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT + - powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds + - s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36 + - sh: define RUNTIME_DISCARD_EXIT + - wifi: mwifiex: Add missing compatible string for SD8787 + - audit: update the mailing list in MAINTAINERS + - platform/x86/amd/pmf: Add depends on CONFIG_POWER_SUPPLY + - platform/x86: nvidia-wmi-ec-backlight: Add force module parameter + - ext4: Fix function prototype mismatch for ext4_feat_ktype + - randstruct: disable Clang 15 support + - bpf: add missing header file include + - Linux 6.1.14 + - upstream stable to v6.1.14 + + * Jammy update: v6.1.13 upstream stable release (LP: #2008707) + - mptcp: sockopt: make 'tcp_fastopen_connect' generic + - mptcp: fix locking for setsockopt corner-case + - mptcp: deduplicate error paths on endpoint creation + - mptcp: fix locking for in-kernel listener creation + - btrfs: move the auto defrag code to defrag.c + - btrfs: lock the inode in shared mode before starting fiemap + - ASoC: amd: yc: Add DMI support for new acer/emdoor platforms + - ASoC: SOF: sof-audio: start with the right widget type + - ALSA: usb-audio: Add FIXED_RATE quirk for JBL Quantum610 Wireless + - ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_nau8825: always set dpcm_capture for amplifiers + - ASoC: Intel: sof_ssp_amp: always set dpcm_capture for amplifiers + - selftests/bpf: Verify copy_register_state() preserves parent/live fields + - ALSA: hda: Do not unset preset when cleaning up codec + - ASoC: amd: yc: Add Xiaomi Redmi Book Pro 15 2022 into DMI table + - bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself + - ASoC: cs42l56: fix DT probe + - tools/virtio: fix the vringh test for virtio ring changes + - vdpa: ifcvf: Do proper cleanup if IFCVF init fails + - net/rose: Fix to not accept on connected socket + - selftest: net: Improve IPV6_TCLASS/IPV6_HOPLIMIT tests apparmor + compatibility + - net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC + - powerpc/64: Fix perf profiling asynchronous interrupt handlers + - fscache: Use clear_and_wake_up_bit() in fscache_create_volume_work() + - drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED + - net: ethernet: mtk_eth_soc: Avoid truncating allocation + - net: sched: sch: Bounds check priority + - s390/decompressor: specify __decompress() buf len to avoid overflow + - nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association + - nvme: clear the request_queue pointers on failure in + nvme_alloc_admin_tag_set + - nvme: clear the request_queue pointers on failure in nvme_alloc_io_tag_set + - drm/amd/display: Add missing brackets in calculation + - drm/amd/display: Adjust downscaling limits for dcn314 + - drm/amd/display: Unassign does_plane_fit_in_mall function from dcn3.2 + - drm/amd/display: Reset DMUB mailbox SW state after HW reset + - drm/amdgpu: enable HDP SD for gfx 11.0.3 + - drm/amdgpu: Enable vclk dclk node for gc11.0.3 + - drm/amd/display: Properly handle additional cases where DCN is not supported + - platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match + - ceph: move mount state enum to super.h + - ceph: blocklist the kclient when receiving corrupted snap trace + - selftests: mptcp: userspace: fix v4-v6 test in v6.1 + - of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem + - kasan: fix Oops due to missing calls to kasan_arch_is_ready() + - mm: shrinkers: fix deadlock in shrinker debugfs + - aio: fix mremap after fork null-deref + - vmxnet3: move rss code block under eop descriptor + - fbdev: Fix invalid page access after closing deferred I/O devices + - drm: Disable dynamic debug as broken + - drm/amd/amdgpu: fix warning during suspend + - drm/amd/display: Fail atomic_check early on normalize_zpos error + - drm/vmwgfx: Stop accessing buffer objects which failed init + - drm/vmwgfx: Do not drop the reference to the handle too soon + - mmc: jz4740: Work around bug on JZ4760(B) + - mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set + - mmc: sdio: fix possible resource leaks in some error paths + - mmc: mmc_spi: fix error handling in mmc_spi_probe() + - ALSA: hda: Fix codec device field initializan + - ALSA: hda/conexant: add a new hda codec SN6180 + - ALSA: hda/realtek - fixed wrong gpio assigned + - ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform. + - ALSA: hda/realtek: Enable mute/micmute LEDs and speaker support for HP + Laptops + - ata: ahci: Add Tiger Lake UP{3,4} AHCI controller + - ata: libata-core: Disable READ LOG DMA EXT for Samsung MZ7LH + - sched/psi: Fix use-after-free in ep_remove_wait_queue() + - hugetlb: check for undefined shift on 32 bit architectures + - nilfs2: fix underflow in second superblock position calculations + - mm/MADV_COLLAPSE: set EAGAIN on unexpected page refcount + - mm/filemap: fix page end in filemap_get_read_batch + - mm/migrate: fix wrongly apply write bit after mkdirty on sparc64 + - gpio: sim: fix a memory leak + - freezer,umh: Fix call_usermode_helper_exec() vs SIGKILL + - coredump: Move dump_emit_page() to kill unused warning + - Revert "mm: Always release pages to the buddy allocator in + memblock_free_late()." + - net: Fix unwanted sign extension in netdev_stats_to_stats64() + - revert "squashfs: harden sanity check in squashfs_read_xattr_id_table" + - drm/vc4: crtc: Increase setup cost in core clock calculation to handle + extreme reduced blanking + - drm/vc4: Fix YUV plane handling when planes are in different buffers + - drm/i915/gen11: Wa_1408615072/Wa_1407596294 should be on GT list + - ice: fix lost multicast packets in promisc mode + - ixgbe: allow to increase MTU to 3K with XDP enabled + - i40e: add double of VLAN header when computing the max MTU + - net: bgmac: fix BCM5358 support by setting correct flags + - net: ethernet: ti: am65-cpsw: Add RX DMA Channel Teardown Quirk + - sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list + - net/sched: tcindex: update imperfect hash filters respecting rcu + - ice: xsk: Fix cleaning of XDP_TX frames + - dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions. + - net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path + - net/sched: act_ctinfo: use percpu stats + - net: openvswitch: fix possible memory leak in ovs_meter_cmd_set() + - net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence + - bnxt_en: Fix mqprio and XDP ring checking logic + - tracing: Make trace_define_field_ext() static + - net: stmmac: Restrict warning on disabling DMA store and fwd mode + - net: use a bounce buffer for copying skb->mark + - tipc: fix kernel warning when sending SYN message + - net: mpls: fix stale pointer if allocation fails during device rename + - igb: conditionalize I2C bit banging on external thermal sensor support + - igb: Fix PPS input and output using 3rd and 4th SDP + - ixgbe: add double of VLAN header when computing the max MTU + - ipv6: Fix datagram socket connection with DSCP. + - ipv6: Fix tcp socket connection with DSCP. + - mm/gup: add folio to list when folio_isolate_lru() succeed + - mm: extend max struct page size for kmsan + - i40e: Add checking for null for nlmsg_find_attr() + - net/sched: tcindex: search key must be 16 bits + - nvme-tcp: stop auth work after tearing down queues in error recovery + - nvme-rdma: stop auth work after tearing down queues in error recovery + - KVM: x86/pmu: Disable vPMU support on hybrid CPUs (host PMUs) + - kvm: initialize all of the kvm_debugregs structure before sending it to + userspace + - perf/x86: Refuse to export capabilities for hybrid PMUs + - alarmtimer: Prevent starvation by small intervals and SIG_IGN + - nvme-pci: refresh visible attrs for cmb attributes + - ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak + - net: sched: sch: Fix off by one in htb_activate_prios() + - Linux 6.1.13 + - upstream stable to v6.1.13 + + * Jammy update: v6.1.12 upstream stable release (LP: #2007585) + - hv_netvsc: Allocate memory in netvsc_dma_map() with GFP_ATOMIC + - btrfs: limit device extents to the device size + - btrfs: zlib: zero-initialize zlib workspace + - ALSA: hda/realtek: Add Positivo N14KP6-TG + - ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() + - ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro 360 + - ALSA: hda/realtek: Enable mute/micmute LEDs on HP Elitebook, 645 G9 + - ALSA: hda/realtek: Add quirk for ASUS UM3402 using CS35L41 + - ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform. + - Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume" + - Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming" + - tracing: Fix poll() and select() do not work on per_cpu trace_pipe and + trace_pipe_raw + - of/address: Return an error when no valid dma-ranges are found + - can: j1939: do not wait 250 ms if the same addr was already claimed + - HID: logitech: Disable hi-res scrolling on USB + - xfrm: compat: change expression for switch in xfrm_xlate64 + - IB/hfi1: Restore allocated resources on failed copyout + - xfrm/compat: prevent potential spectre v1 gadget in xfrm_xlate32_attr() + - IB/IPoIB: Fix legacy IPoIB due to wrong number of queues + - xfrm: annotate data-race around use_time + - RDMA/irdma: Fix potential NULL-ptr-dereference + - RDMA/usnic: use iommu_map_atomic() under spin_lock() + - xfrm: fix bug with DSCP copy to v6 from v4 tunnel + - of: Make OF framebuffer device names unique + - net: phylink: move phy_device_free() to correctly release phy device + - bonding: fix error checking in bond_debug_reregister() + - net: macb: Perform zynqmp dynamic configuration only for SGMII interface + - net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY + - ionic: clean interrupt before enabling queue to avoid credit race + - ionic: refactor use of ionic_rx_fill() + - ionic: missed doorbell workaround + - cpufreq: qcom-hw: Fix cpufreq_driver->get() for non-LMH systems + - uapi: add missing ip/ipv6 header dependencies for linux/stddef.h + - net: microchip: sparx5: fix PTP init/deinit not checking all ports + - HID: amd_sfh: if no sensors are enabled, clean up + - drm/i915: Don't do the WM0->WM1 copy w/a if WM1 is already enabled + - drm/virtio: exbuf->fence_fd unmodified on interrupted wait + - cpuset: Call set_cpus_allowed_ptr() with appropriate mask for task + - nvidiafb: detect the hardware support before removing console. + - ice: Do not use WQ_MEM_RECLAIM flag for workqueue + - ice: Fix disabling Rx VLAN filtering with port VLAN enabled + - ice: switch: fix potential memleak in ice_add_adv_recipe() + - net: dsa: mt7530: don't change PVC_EG_TAG when CPU port becomes VLAN-aware + - net: mscc: ocelot: fix VCAP filters not matching on MAC with "protocol + 802.1Q" + - net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change + - net/mlx5: Bridge, fix ageing of peer FDB entries + - net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode + - net/mlx5e: IPoIB, Show unknown speed instead of error + - net/mlx5: Store page counters in a single array + - net/mlx5: Expose SF firmware pages counter + - net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers + - net/mlx5: fw_tracer, Zero consumer index when reloading the tracer + - net/mlx5: Serialize module cleanup with reload and remove + - igc: Add ndo_tx_timeout support + - net: ethernet: mtk_eth_soc: fix wrong parameters order in + __xdp_rxq_info_reg() + - txhash: fix sk->sk_txrehash default + - selftests: Fix failing VXLAN VNI filtering test + - rds: rds_rm_zerocopy_callback() use list_first_entry() + - net: mscc: ocelot: fix all IPv6 getting trapped to CPU when PTP timestamping + is used + - selftests: forwarding: lib: quote the sysctl values + - arm64: dts: rockchip: fix input enable pinconf on rk3399 + - arm64: dts: rockchip: set sdmmc0 speed to sd-uhs-sdr50 on rock-3a + - ALSA: pci: lx6464es: fix a debug loop + - riscv: stacktrace: Fix missing the first frame + - arm64: dts: mediatek: mt8195: Fix vdosys* compatible strings + - ASoC: tas5805m: rework to avoid scheduling while atomic. + - ASoC: tas5805m: add missing page switch. + - ASoC: fsl_sai: fix getting version from VERID + - ASoC: topology: Return -ENOMEM on memory allocation failure + - clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted + strings + - pinctrl: mediatek: Fix the drive register definition of some Pins + - pinctrl: aspeed: Fix confusing types in return value + - pinctrl: single: fix potential NULL dereference + - spi: dw: Fix wrong FIFO level setting for long xfers + - pinctrl: aspeed: Revert "Force to disable the function's signal" + - pinctrl: intel: Restore the pins that used to be in Direct IRQ mode + - cifs: Fix use-after-free in rdata->read_into_pages() + - net: USB: Fix wrong-direction WARNING in plusb.c + - mptcp: do not wait for bare sockets' timeout + - mptcp: be careful on subflow status propagation on errors + - selftests: mptcp: allow more slack for slow test-case + - selftests: mptcp: stop tests earlier + - btrfs: simplify update of last_dir_index_offset when logging a directory + - btrfs: free device in btrfs_close_devices for a single device filesystem + - usb: core: add quirk for Alcor Link AK9563 smartcard reader + - usb: typec: altmodes/displayport: Fix probe pin assign check + - cxl/region: Fix null pointer dereference for resetting decoder + - cxl/region: Fix passthrough-decoder detection + - clk: ingenic: jz4760: Update M/N/OD calculation algorithm + - pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group + - drm/amd/pm: add SMU 13.0.7 missing GetPptLimit message mapping + - ceph: flush cap releases when the session is flushed + - nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE + - riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte + - riscv: kprobe: Fixup misaligned load text + - powerpc/64s/interrupt: Fix interrupt exit race with security mitigation + switch + - drm/amdgpu: Use the TGID for trace_amdgpu_vm_update_ptes + - tracing: Fix TASK_COMM_LEN in trace event format file + - rtmutex: Ensure that the top waiter is always woken up + - arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive + - arm64: dts: meson-g12-common: Make mmc host controller interrupts level- + sensitive + - arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive + - Fix page corruption caused by racy check in __free_pages + - arm64: efi: Force the use of SetVirtualAddressMap() on eMAG and Altra Max + machines + - drm/amd/pm: bump SMU 13.0.0 driver_if header version + - drm/amdgpu: Add unique_id support for GC 11.0.1/2 + - drm/amd/pm: bump SMU 13.0.7 driver_if header version + - drm/amdgpu/fence: Fix oops due to non-matching drm_sched init/fini + - drm/amdgpu/smu: skip pptable init under sriov + - drm/amd/display: properly handling AGP aperture in vm setup + - drm/amd/display: fix cursor offset on rotation 180 + - drm/i915: Move fd_install after last use of fence + - drm/i915: Initialize the obj flags for shmem objects + - drm/i915: Fix VBT DSI DVO port handling + - x86/speculation: Identify processors vulnerable to SMT RSB predictions + - KVM: x86: Mitigate the cross-thread return address predictions bug + - Documentation/hw-vuln: Add documentation for Cross-Thread Return Predictions + - Linux 6.1.12 + - upstream stable to v6.1.12 + + * Jammy update: v6.1.11 upstream stable release (LP: #2007584) + - firewire: fix memory leak for payload of request subaction to IEC 61883-1 + FCP region + - bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() + - arm64: dts: imx8m-venice: Remove incorrect 'uart-has-rtscts' + - arm64: dts: freescale: imx8dxl: fix sc_pwrkey's property name linux,keycode + - ASoC: amd: acp-es8336: Drop reference count of ACPI device after use + - ASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use + - ASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use + - ASoC: Intel: sof_es8336: Drop reference count of ACPI device after use + - ASoC: Intel: avs: Implement PCI shutdown + - bpf: Fix off-by-one error in bpf_mem_cache_idx() + - bpf: Fix a possible task gone issue with bpf_send_signal[_thread]() helpers + - ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path() + - bpf: Fix to preserve reg parent/live fields when copying range info + - selftests/filesystems: grant executable permission to run_fat_tests.sh + - ASoC: SOF: ipc4-mtrace: prevent underflow in + sof_ipc4_priority_mask_dfs_write() + - bpf: Add missing btf_put to register_btf_id_dtor_kfuncs + - media: v4l2-ctrls-api.c: move ctrl->is_new = 1 to the correct line + - bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener + - arm64: dts: imx8mm: Fix pad control for UART1_DTE_RX + - arm64: dts: imx8mm-verdin: Do not power down eth-phy + - drm/vc4: hdmi: make CEC adapter name unique + - drm/ssd130x: Init display before the SSD130X_DISPLAY_ON command + - scsi: Revert "scsi: core: map PQ=1, PDT=other values to + SCSI_SCAN_TARGET_PRESENT" + - bpf: Fix the kernel crash caused by bpf_setsockopt(). + - ALSA: memalloc: Workaround for Xen PV + - vhost/net: Clear the pending messages when the backend is removed + - copy_oldmem_kernel() - WRITE is "data source", not destination + - WRITE is "data source", not destination... + - READ is "data destination", not source... + - zcore: WRITE is "data source", not destination... + - memcpy_real(): WRITE is "data source", not destination... + - fix iov_iter_bvec() "direction" argument + - fix 'direction' argument of iov_iter_{init,bvec}() + - fix "direction" argument of iov_iter_kvec() + - use less confusing names for iov_iter direction initializers + - vhost-scsi: unbreak any layout for response + - ice: Prevent set_channel from changing queues while RDMA active + - qede: execute xdp_do_flush() before napi_complete_done() + - virtio-net: execute xdp_do_flush() before napi_complete_done() + - dpaa_eth: execute xdp_do_flush() before napi_complete_done() + - dpaa2-eth: execute xdp_do_flush() before napi_complete_done() + - skb: Do mix page pool and page referenced frags in GRO + - sfc: correctly advertise tunneled IPv6 segmentation + - net: phy: dp83822: Fix null pointer access on DP83825/DP83826 devices + - net: wwan: t7xx: Fix Runtime PM initialization + - block, bfq: replace 0/1 with false/true in bic apis + - block, bfq: fix uaf for bfqq in bic_set_bfqq() + - netrom: Fix use-after-free caused by accept on already connected socket + - fscache: Use wait_on_bit() to wait for the freeing of relinquished volume + - platform/x86/amd/pmf: update to auto-mode limits only after AMT event + - platform/x86/amd/pmf: Add helper routine to update SPS thermals + - platform/x86/amd/pmf: Fix to update SPS default pprof thermals + - platform/x86/amd/pmf: Add helper routine to check pprof is balanced + - platform/x86/amd/pmf: Fix to update SPS thermals when power supply change + - platform/x86/amd/pmf: Ensure mutexes are initialized before use + - platform/x86: thinkpad_acpi: Fix thinklight LED brightness returning 255 + - drm/i915/guc: Fix locking when searching for a hung request + - drm/i915: Fix request ref counting during error capture & debugfs dump + - drm/i915: Fix up locking around dumping requests lists + - drm/i915/adlp: Fix typo for reference clock + - net/tls: tls_is_tx_ready() checked list_entry + - ALSA: firewire-motu: fix unreleased lock warning in hwdep device + - netfilter: br_netfilter: disable sabotage_in hook after first suppression + - block: ublk: extending queue_size to fix overflow + - kunit: fix kunit_test_init_section_suites(...) + - squashfs: harden sanity check in squashfs_read_xattr_id_table + - maple_tree: should get pivots boundary by type + - sctp: do not check hb_timer.expires when resetting hb_timer + - net: phy: meson-gxl: Add generic dummy stubs for MMD register access + - drm/panel: boe-tv101wum-nl6: Ensure DSI writes succeed during disable + - ip/ip6_gre: Fix changing addr gen mode not generating IPv6 link local + address + - ip/ip6_gre: Fix non-point-to-point tunnel not generating IPv6 link local + address + - riscv: kprobe: Fixup kernel panic when probing an illegal position + - igc: return an error if the mac type is unknown in + igc_ptp_systim_to_hwtstamp() + - octeontx2-af: Fix devlink unregister + - can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate + - can: raw: fix CAN FD frame transmissions over CAN XL devices + - can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing + tx_obj_num_coalesce_irq + - ata: libata: Fix sata_down_spd_limit() when no link speed is reported + - selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning + - selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided + - selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs + - selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy + benchmarking + - virtio-net: Keep stop() to follow mirror sequence of open() + - net: openvswitch: fix flow memory leak in ovs_flow_cmd_new + - efi: fix potential NULL deref in efi_mem_reserve_persistent + - rtc: sunplus: fix format string for printing resource + - certs: Fix build error when PKCS#11 URI contains semicolon + - kbuild: modinst: Fix build error when CONFIG_MODULE_SIG_KEY is a PKCS#11 URI + - i2c: designware-pci: Add new PCI IDs for AMD NAVI GPU + - i2c: mxs: suppress probe-deferral error message + - scsi: target: core: Fix warning on RT kernels + - x86/aperfmperf: Erase stale arch_freq_scale values when disabling frequency + invariance readings + - perf/x86/intel: Add Emerald Rapids + - perf/x86/intel/cstate: Add Emerald Rapids + - scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress + - scsi: iscsi_tcp: Fix UAF during login when accessing the shost ipaddress + - i2c: rk3x: fix a bunch of kernel-doc warnings + - Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one" + - x86/build: Move '-mindirect-branch-cs-prefix' out of GCC-only block + - platform/x86: hp-wmi: Handle Omen Key event + - platform/x86: gigabyte-wmi: add support for B450M DS3H WIFI-CF + - platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN + - net/x25: Fix to not accept on connected socket + - drm/amd/display: Fix timing not changning when freesync video is enabled + - bcache: Silence memcpy() run-time false positive warnings + - iio: adc: stm32-dfsdm: fill module aliases + - usb: dwc3: qcom: enable vbus override when in OTG dr-mode + - usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait + - vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF + - fbcon: Check font dimension limits + - cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask() + - hv_netvsc: Fix missed pagebuf entries in netvsc_dma_map/unmap() + - ARM: dts: imx7d-smegw01: Fix USB host over-current polarity + - net: qrtr: free memory on error path in radix_tree_insert() + - can: isotp: split tx timer into transmission and timeout + - can: isotp: handle wait_event_interruptible() return values + - watchdog: diag288_wdt: do not use stack buffers for hardware data + - watchdog: diag288_wdt: fix __diag288() inline assembly + - ALSA: hda/realtek: Add Acer Predator PH315-54 + - ALSA: hda/realtek: fix mute/micmute LEDs, speaker don't work for a HP + platform + - ASoC: codecs: wsa883x: correct playback min/max rates + - ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0 + - ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL + - ASoC: SOF: keep prepare/unprepare widgets in sink path + - efi: Accept version 2 of memory attributes table + - rtc: efi: Enable SET/GET WAKEUP services as optional + - iio: hid: fix the retval in accel_3d_capture_sample + - iio: hid: fix the retval in gyro_3d_capture_sample + - iio: adc: xilinx-ams: fix devm_krealloc() return value check + - iio: adc: berlin2-adc: Add missing of_node_put() in error path + - iio: imx8qxp-adc: fix irq flood when call imx8qxp_adc_read_raw() + - iio:adc:twl6030: Enable measurements of VUSB, VBAT and others + - iio: imu: fxos8700: fix ACCEL measurement range selection + - iio: imu: fxos8700: fix incomplete ACCEL and MAGN channels readback + - iio: imu: fxos8700: fix IMU data bits returned to user space + - iio: imu: fxos8700: fix map label of channel type to MAGN sensor + - iio: imu: fxos8700: fix swapped ACCEL and MAGN channels readback + - iio: imu: fxos8700: fix incorrect ODR mode readback + - iio: imu: fxos8700: fix failed initialization ODR mode assignment + - iio: imu: fxos8700: remove definition FXOS8700_CTRL_ODR_MIN + - iio: imu: fxos8700: fix MAGN sensor scale and unit + - nvmem: brcm_nvram: Add check for kzalloc + - nvmem: sunxi_sid: Always use 32-bit MMIO reads + - nvmem: qcom-spmi-sdam: fix module autoloading + - parisc: Fix return code of pdc_iodc_print() + - parisc: Replace hardcoded value with PRIV_USER constant in ptrace.c + - parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case + - riscv: disable generation of unwind tables + - Revert "mm: kmemleak: alloc gray object for reserved region with direct map" + - mm: multi-gen LRU: fix crash during cgroup migration + - mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps + - mm: memcg: fix NULL pointer in mem_cgroup_track_foreign_dirty_slowpath() + - usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints + - usb: typec: ucsi: Don't attempt to resume the ports before they exist + - usb: gadget: udc: do not clear gadget driver.bus + - kernel/irq/irqdomain.c: fix memory leak with using debugfs_lookup() + - HV: hv_balloon: fix memory leak with using debugfs_lookup() + - x86/debug: Fix stack recursion caused by wrongly ordered DR7 accesses + - fpga: m10bmc-sec: Fix probe rollback + - fpga: stratix10-soc: Fix return value check in s10_ops_write_init() + - mm/uffd: fix pte marker when fork() without fork event + - mm/swapfile: add cond_resched() in get_swap_pages() + - mm/khugepaged: fix ->anon_vma race + - mm, mremap: fix mremap() expanding for vma's with vm_ops->close() + - mm/MADV_COLLAPSE: catch !none !huge !bad pmd lookups + - highmem: round down the address passed to kunmap_flush_on_unmap() + - ia64: fix build error due to switch case label appearing next to declaration + - Squashfs: fix handling and sanity checking of xattr_ids count + - maple_tree: fix mas_empty_area_rev() lower bound validation + - migrate: hugetlb: check for hugetlb shared PMD in node migration + - dma-buf: actually set signaling bit for private stub fences + - serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ + handler + - drm/i915: Avoid potential vm use-after-free + - drm/i915: Fix potential bit_17 double-free + - drm/amd: Fix initialization for nbio 4.3.0 + - drm/amd/pm: drop unneeded dpm features disablement for SMU 13.0.4/11 + - drm/amdgpu: update wave data type to 3 for gfx11 + - nvmem: core: initialise nvmem->id early + - nvmem: core: remove nvmem_config wp_gpio + - nvmem: core: fix cleanup after dev_set_name() + - nvmem: core: fix registration vs use race + - nvmem: core: fix device node refcounting + - nvmem: core: fix cell removal on error + - nvmem: core: fix return value + - phy: qcom-qmp-combo: fix runtime suspend + - serial: 8250_dma: Fix DMA Rx completion race + - serial: 8250_dma: Fix DMA Rx rearm race + - platform/x86/amd: pmc: add CONFIG_SERIO dependency + - ASoC: SOF: sof-audio: prepare_widgets: Check swidget for NULL on sink + failure + - iio:adc:twl6030: Enable measurement of VAC + - powerpc/64s/radix: Fix crash with unaligned relocated kernel + - powerpc/64s: Fix local irq disable when PMIs are disabled + - powerpc/imc-pmu: Revert nest_init_lock to being a mutex + - fs/ntfs3: Validate attribute data and valid sizes + - ovl: Use "buf" flexible array for memcpy() destination + - f2fs: initialize locks earlier in f2fs_fill_super() + - fbdev: smscufx: fix error handling code in ufx_usb_probe + - f2fs: fix to do sanity check on i_extra_isize in is_alive() + - wifi: brcmfmac: Check the count value of channel spec to prevent out-of- + bounds reads + - gfs2: Cosmetic gfs2_dinode_{in,out} cleanup + - gfs2: Always check inode size of inline inodes + - bpf: Skip invalid kfunc call in backtrack_insn + - Linux 6.1.11 + - upstream stable to v6.1.11 + + * cm32181 module error blocking suspend (LP: #1988346) // Jammy update: + v6.1.11 upstream stable release (LP: #2007584) + - iio: light: cm32181: Fix PM support on system with 2 I2C resources + + * Jammy update: v6.1.10 upstream stable release (LP: #2007583) + - ARM: dts: imx: Fix pca9547 i2c-mux node name + - ARM: dts: vf610: Fix pca9548 i2c-mux node names + - arm64: dts: freescale: Fix pca954x i2c-mux node names + - arm64: dts: imx8mq-thor96: fix no-mmc property for SDHCI + - firmware: arm_scmi: Clear stale xfer->hdr.status + - bpf: Skip task with pid=1 in send_signal_common() + - erofs/zmap.c: Fix incorrect offset calculation + - mac80211: Fix MLO address translation for multiple bss case + - arm64: dts: msm8994-angler: fix the memory map + - ARM: omap1: fix building gpio15xx + - kselftest: Fix error message for unconfigured LLVM builds + - erofs: clean up parsing of fscache related options + - blk-cgroup: fix missing pd_online_fn() while activating policy + - LoongArch: Get frame info in unwind_start() when regs is not available + - ACPI: video: Add backlight=native DMI quirk for Acer Aspire 4810T + - block: fix hctx checks for batch allocation + - s390: workaround invalid gcc-11 out of bounds read warning + - HID: uclogic: Add support for XP-PEN Deco 01 V2 + - HID: playstation: sanity check DualSense calibration data. + - dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init + - gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI + - cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() + - nvme-apple: only reset the controller when RTKit is running + - gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU + - gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode + - net: fix NULL pointer in skb_segment_list + - rust: print: avoid evaluating arguments in `pr_*` macros in `unsafe` blocks + - net: mctp: purge receive queues on sk destruction + - Linux 6.1.10 + - upstream stable to v6.1.10 + + * Jammy update: v6.1.9 upstream stable release (LP: #2007578) + - memory: tegra: Remove clients SID override programming + - memory: atmel-sdramc: Fix missing clk_disable_unprepare in + atmel_ramc_probe() + - memory: mvebu-devbus: Fix missing clk_disable_unprepare in + mvebu_devbus_probe() + - arm64: dts: qcom: sc8280xp: fix primary USB-DP PHY reset + - dmaengine: qcom: gpi: Set link_rx bit on GO TRE for rx operation + - dmaengine: ti: k3-udma: Do conditional decrement of + UDMA_CHAN_RT_PEER_BCNT_REG + - soc: imx: imx8mp-blk-ctrl: enable global pixclk with HDMI_TX_PHY PD + - arm64: dts: imx8mp-phycore-som: Remove invalid PMIC property + - ARM: dts: imx6ul-pico-dwarf: Use 'clock-frequency' + - ARM: dts: imx7d-pico: Use 'clock-frequency' + - ARM: dts: imx6qdl-gw560x: Remove incorrect 'uart-has-rtscts' + - arm64: dts: verdin-imx8mm: fix dahlia audio playback + - arm64: dts: imx8mm-beacon: Fix ecspi2 pinmux + - arm64: dts: verdin-imx8mm: fix dev board audio playback + - arm64: dts: imx93-11x11-evk: correct clock and strobe pad setting + - ARM: imx: add missing of_node_put() + - soc: imx: imx8mp-blk-ctrl: don't set power device name + - arm64: dts: imx8mp: Fix missing GPC Interrupt + - arm64: dts: imx8mp: Fix power-domain typo + - arm64: dts: imx8mp-evk: pcie0-refclk cosmetic cleanup + - HID: intel_ish-hid: Add check for ishtp_dma_tx_map + - arm64: dts: imx8mm-venice-gw7901: fix USB2 controller OC polarity + - soc: imx8m: Fix incorrect check for of_clk_get_by_name() + - reset: ti-sci: honor TI_SCI_PROTOCOL setting when not COMPILE_TEST + - reset: uniphier-glue: Fix possible null-ptr-deref + - EDAC/highbank: Fix memory leak in highbank_mc_probe() + - firmware: arm_scmi: Harden shared memory access in fetch_response + - firmware: arm_scmi: Harden shared memory access in fetch_notification + - firmware: arm_scmi: Fix virtio channels cleanup on shutdown + - interconnect: qcom: msm8996: Provide UFS clocks to A2NoC + - interconnect: qcom: msm8996: Fix regmap max_register values + - HID: amd_sfh: Fix warning unwind goto + - tomoyo: fix broken dependency on *.conf.default + - RDMA/rxe: Fix inaccurate constants in rxe_type_info + - RDMA/rxe: Prevent faulty rkey generation + - erofs: fix kvcalloc() misuse with __GFP_NOFAIL + - arm64: dts: marvell: AC5/AC5X: Fix address for UART1 + - RDMA/core: Fix ib block iterator counter overflow + - IB/hfi1: Reject a zero-length user expected buffer + - IB/hfi1: Reserve user expected TIDs + - IB/hfi1: Fix expected receive setup error exit issues + - IB/hfi1: Immediately remove invalid memory from hardware + - IB/hfi1: Remove user expected buffer invalidate race + - affs: initialize fsdata in affs_truncate() + - PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() + - arm64: dts: qcom: msm8992: Don't use sfpb mutex + - arm64: dts: qcom: msm8992-libra: Fix the memory map + - kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux + - kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y + - phy: ti: fix Kconfig warning and operator precedence + - drm/msm/gpu: Fix potential double-free + - NFSD: fix use-after-free in nfsd4_ssc_setup_dul() + - ARM: dts: at91: sam9x60: fix the ddr clock for sam9x60 + - drm/vc4: bo: Fix drmm_mutex_init memory hog + - phy: usb: sunplus: Fix potential null-ptr-deref in sp_usb_phy_probe() + - bpf: hash map, avoid deadlock with suitable hash mask + - amd-xgbe: TX Flow Ctrl Registers are h/w ver dependent + - amd-xgbe: Delay AN timeout during KR training + - bpf: Fix pointer-leak due to insufficient speculative store bypass + mitigation + - drm/vc4: bo: Fix unused variable warning + - phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in + rockchip_usb2phy_power_on() + - net: nfc: Fix use-after-free in local_cleanup() + - net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs + - net: enetc: avoid deadlock in enetc_tx_onestep_tstamp() + - net: lan966x: add missing fwnode_handle_put() for ports node + - sch_htb: Avoid grafting on htb_destroy_class_offload when destroying htb + - gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock + - gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode + - wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid + - pinctrl: rockchip: fix reading pull type on rk3568 + - net: stmmac: Fix queue statistics reading + - net/sched: sch_taprio: fix possible use-after-free + - l2tp: convert l2tp_tunnel_list to idr + - l2tp: close all race conditions in l2tp_tunnel_register() + - net: usb: sr9700: Handle negative len + - net: mdio: validate parameter addr in mdiobus_get_phy() + - HID: check empty report_list in hid_validate_values() + - HID: check empty report_list in bigben_probe() + - net: stmmac: fix invalid call to mdiobus_get_phy() + - pinctrl: rockchip: fix mux route data for rk3568 + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcor-som + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcom-som + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp157c-emstamp-argon + - ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp151a-prtt1l + - HID: revert CHERRY_MOUSE_000C quirk + - block/rnbd-clt: fix wrong max ID in ida_alloc_max + - usb: ucsi: Ensure connector delayed work items are flushed + - usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait + - usb: gadget: f_fs: Ensure ep0req is dequeued before free_request + - netfilter: conntrack: handle tcp challenge acks during connection reuse + - Bluetooth: Fix a buffer overflow in mgmt_mesh_add() + - Bluetooth: hci_conn: Fix memory leaks + - Bluetooth: hci_sync: fix memory leak in hci_update_adv_data() + - Bluetooth: ISO: Avoid circular locking dependency + - Bluetooth: ISO: Fix possible circular locking dependency + - Bluetooth: hci_event: Fix Invalid wait context + - Bluetooth: Fix possible deadlock in rfcomm_sk_state_change + - net: ipa: disable ipa interrupt during suspend + - net/mlx5e: Avoid false lock dependency warning on tc_ht even more + - net/mlx5: E-switch, Fix setting of reserved fields on + MODIFY_SCHEDULING_ELEMENT + - net/mlx5e: QoS, Fix wrongfully setting parent_element_id on + MODIFY_SCHEDULING_ELEMENT + - net/mlx5e: Set decap action based on attr for sample + - net/mlx5: E-switch, Fix switchdev mode after devlink reload + - net: mlx5: eliminate anonymous module_init & module_exit + - drm/panfrost: fix GENERIC_ATOMIC64 dependency + - dmaengine: Fix double increment of client_count in dma_chan_get() + - net: macb: fix PTP TX timestamp failure due to packet padding + - virtio-net: correctly enable callback during start_xmit + - l2tp: prevent lockdep issue in l2tp_tunnel_register() + - HID: betop: check shape of output reports + - drm/i915/selftests: Unwind hugepages to drop wakeref on error + - cifs: fix potential deadlock in cache_refresh_path() + - dmaengine: xilinx_dma: call of_node_put() when breaking out of + for_each_child_of_node() + - dmaengine: tegra: Fix memory leak in terminate_all() + - phy: phy-can-transceiver: Skip warning if no "max-bitrate" + - drm/amd/display: fix issues with driver unload + - net: sched: gred: prevent races when adding offloads to stats + - nvme-pci: fix timeout request state check + - tcp: avoid the lookup process failing to get sk in ehash table + - usb: dwc3: fix extcon dependency + - ptdma: pt_core_execute_cmd() should use spinlock + - device property: fix of node refcount leak in + fwnode_graph_get_next_endpoint() + - w1: fix deadloop in __w1_remove_master_device() + - w1: fix WARNING after calling w1_process() + - driver core: Fix test_async_probe_init saves device in wrong array + - selftests/net: toeplitz: fix race on tpacket_v3 block close + - net: dsa: microchip: ksz9477: port map correction in ALU table entry + register + - thermal: Validate new state in cur_state_store() + - thermal/core: fix error code in __thermal_cooling_device_register() + - thermal: core: call put_device() only after device_register() fails + - net: stmmac: enable all safety features by default + - bnxt: Do not read past the end of test names + - tcp: fix rate_app_limited to default to 1 + - scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace + - ASoC: SOF: pm: Set target state earlier + - ASoC: SOF: pm: Always tear down pipelines before DSP suspend + - ASoC: SOF: Add FW state to debugfs + - ASoC: amd: yc: Add Razer Blade 14 2022 into DMI table + - spi: cadence: Fix busy cycles calculation + - cpufreq: CPPC: Add u64 casts to avoid overflowing + - cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist + - ASoC: mediatek: mt8186: support rt5682s_max98360 + - ASoC: mediatek: mt8186: Add machine support for max98357a + - ASoC: amd: yc: Add ASUS M5402RA into DMI table + - ASoC: support machine driver with max98360 + - kcsan: test: don't put the expect array on the stack + - cpufreq: Add SM6375 to cpufreq-dt-platdev blocklist + - ASoC: fsl_micfil: Correct the number of steps on SX controls + - drm/msm/a6xx: Avoid gx gbit halt during rpm suspend + - net: usb: cdc_ether: add support for Thales Cinterion PLS62-W modem + - drm: Add orientation quirk for Lenovo ideapad D330-10IGL + - s390/debug: add _ASM_S390_ prefix to header guard + - s390: expicitly align _edata and _end symbols on page boundary + - xen/pvcalls: free active map buffer on pvcalls_front_free_map + - perf/x86/cstate: Add Meteor Lake support + - perf/x86/msr: Add Meteor Lake support + - perf/x86/msr: Add Emerald Rapids + - perf/x86/intel/uncore: Add Emerald Rapids + - nolibc: fix fd_set type + - tools/nolibc: Fix S_ISxxx macros + - tools/nolibc: fix missing includes causing build issues at -O0 + - tools/nolibc: prevent gcc from making memset() loop over itself + - cpufreq: armada-37xx: stop using 0 as NULL pointer + - ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC + - ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets + - ACPI: resource: Skip IRQ override on Asus Expertbook B2402CBA + - drm/amdkfd: Add sync after creating vram bo + - drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU + - cifs: fix potential memory leaks in session setup + - spi: spidev: remove debug messages that access spidev->spi without locking + - KVM: s390: interrupt: use READ_ONCE() before cmpxchg() + - scsi: hisi_sas: Use abort task set to reset SAS disks when discovered + - scsi: hisi_sas: Set a port invalid only if there are no devices attached + when refreshing port id + - r8152: add vendor/device ID pair for Microsoft Devkit + - platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD + - platform/x86: asus-nb-wmi: Add alternate mapping for KEY_CAMERA + - platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK + - platform/x86: asus-wmi: Add quirk wmi_ignore_fan + - platform/x86: asus-wmi: Ignore fan on E410MA + - platform/x86: simatic-ipc: correct name of a model + - platform/x86: simatic-ipc: add another model + - lockref: stop doing cpu_relax in the cmpxchg loop + - ata: pata_cs5535: Don't build on UML + - firmware: coreboot: Check size of table entry and use flex-array + - btrfs: zoned: enable metadata over-commit for non-ZNS setup + - Revert "selftests/bpf: check null propagation only neither reg is + PTR_TO_BTF_ID" + - arm64: efi: Recover from synchronous exceptions occurring in firmware + - arm64: efi: Avoid workqueue to check whether EFI runtime is live + - arm64: efi: Account for the EFI runtime stack in stack unwinder + - Bluetooth: hci_sync: cancel cmd_timer if hci_open failed + - drm/i915: Allow panel fixed modes to have differing sync polarities + - drm/i915: Allow alternate fixed modes always for eDP + - drm/amdgpu: complete gfxoff allow signal during suspend without delay + - io_uring/msg_ring: fix remote queue to disabled ring + - wifi: mac80211: Proper mark iTXQs for resumption + - wifi: mac80211: Fix iTXQ AMPDU fragmentation handling + - sched/fair: Check if prev_cpu has highest spare cap in feec() + - sched/uclamp: Fix a uninitialized variable warnings + - vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp() + - scsi: hpsa: Fix allocation size for scsi_host_alloc() + - kvm/vfio: Fix potential deadlock on vfio group_lock + - nfsd: don't free files unconditionally in __nfsd_file_cache_purge + - module: Don't wait for GOING modules + - ftrace: Export ftrace_free_filter() to modules + - tracing: Make sure trace_printk() can output as soon as it can be used + - trace_events_hist: add check for return value of 'create_hist_field' + - ftrace/scripts: Update the instructions for ftrace-bisect.sh + - cifs: Fix oops due to uncleared server->smbd_conn in reconnect + - ksmbd: add max connections parameter + - ksmbd: do not sign response to session request for guest login + - ksmbd: downgrade ndr version error message to debug + - ksmbd: limit pdu length size according to connection status + - ovl: fix tmpfile leak + - ovl: fail on invalid uid/gid mapping at copy up + - io_uring/net: cache provided buffer group value for multishot receives + - KVM: x86/vmx: Do not skip segment attributes if unusable bit is set + - KVM: arm64: GICv4.1: Fix race with doorbell on VPE activation/deactivation + - scsi: ufs: core: Fix devfreq deadlocks + - riscv: fix -Wundef warning for CONFIG_RISCV_BOOT_SPINWAIT + - thermal: intel: int340x: Protect trip temperature from concurrent updates + - regulator: dt-bindings: samsung,s2mps14: add lost samsung,ext-control-gpios + - ipv6: fix reachability confirmation with proxy_ndp + - ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment + - EDAC/device: Respect any driver-supplied workqueue polling value + - EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info + - platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms + - drm/display/dp_mst: Correct the kref of port. + - drm/amd/pm: add missing AllowIHInterrupt message mapping for SMU13.0.0 + - drm/amdgpu: remove unconditional trap enable on add gfx11 queues + - drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments + - drm/amdgpu/display/mst: limit payload to be updated one by one + - drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD + - io_uring: inline io_req_task_work_add() + - io_uring: inline __io_req_complete_post() + - io_uring: hold locks for io_req_complete_failed + - io_uring: use io_req_task_complete() in timeout + - io_uring: remove io_req_tw_post_queue + - io_uring: inline __io_req_complete_put() + - net: mana: Fix IRQ name - add PCI and queue number + - io_uring: always prep_async for drain requests + - i2c: designware: use casting of u64 in clock multiplication to avoid + overflow + - i2c: designware: Fix unbalanced suspended flag + - drm/drm_vma_manager: Add drm_vma_node_allow_once() + - drm/i915: Fix a memory leak with reused mmap_offset + - iavf: fix temporary deadlock and failure to set MAC address + - iavf: schedule watchdog immediately when changing primary MAC + - netlink: prevent potential spectre v1 gadgets + - net: fix UaF in netns ops registration error path + - net: fec: Use page_pool_put_full_page when freeing rx buffers + - nvme: simplify transport specific device attribute handling + - nvme: consolidate setting the tagset flags + - nvme-fc: fix initialization order + - drm/i915/selftest: fix intel_selftest_modify_policy argument types + - ACPI: video: Add backlight=native DMI quirk for HP Pavilion g6-1d80nr + - ACPI: video: Add backlight=native DMI quirk for HP EliteBook 8460p + - ACPI: video: Add backlight=native DMI quirk for Asus U46E + - netfilter: nft_set_rbtree: Switch to node list walk for overlap detection + - netfilter: nft_set_rbtree: skip elements in transaction from garbage + collection + - netlink: annotate data races around nlk->portid + - netlink: annotate data races around dst_portid and dst_group + - netlink: annotate data races around sk_state + - ipv4: prevent potential spectre v1 gadget in ip_metrics_convert() + - ipv4: prevent potential spectre v1 gadget in fib_metrics_match() + - net: dsa: microchip: fix probe of I2C-connected KSZ8563 + - net: ethernet: adi: adin1110: Fix multicast offloading + - netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE + - netrom: Fix use-after-free of a listening socket. + - platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting + - platform/x86: apple-gmux: Move port defines to apple-gmux.h + - platform/x86: apple-gmux: Add apple_gmux_detect() helper + - ACPI: video: Fix apple gmux detection + - tracing/osnoise: Use built-in RCU list checking + - net/sched: sch_taprio: do not schedule in taprio_reset() + - sctp: fail if no bound addresses can be used for a given scope + - riscv/kprobe: Fix instruction simulation of JALR + - nvme: fix passthrough csi check + - gpio: mxc: Unlock on error path in mxc_flip_edge() + - gpio: ep93xx: Fix port F hwirq numbers in handler + - net: ravb: Fix lack of register setting after system resumed for Gen3 + - net: ravb: Fix possible hang if RIS2_QFF1 happen + - net: mctp: add an explicit reference from a mctp_sk_key to sock + - net: mctp: move expiry timer delete to unhash + - net: mctp: hold key reference when looking up a general key + - net: mctp: mark socks as dead on unhash, prevent re-add + - thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type() + - riscv: Move call to init_cpu_topology() to later initialization stage + - net/tg3: resolve deadlock in tg3_reset_task() during EEH + - tsnep: Fix TX queue stop/wake for multiple queues + - net: mdio-mux-meson-g12a: force internal PHY off on mux switch + - Partially revert "perf/arm-cmn: Optimise DTC counter accesses" + - block: ublk: move ublk_chr_class destroying after devices are removed + - treewide: fix up files incorrectly marked executable + - tools: gpio: fix -c option of gpio-event-mon + - Fix up more non-executable files marked executable + - Revert "mm/compaction: fix set skip in fast_find_migrateblock" + - Revert "Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI + mode" + - Input: i8042 - add Clevo PCX0DX to i8042 quirk table + - x86/sev: Add SEV-SNP guest feature negotiation support + - acpi: Fix suspend with Xen PV + - dt-bindings: riscv: fix underscore requirement for multi-letter extensions + - dt-bindings: riscv: fix single letter canonical order + - x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL + - dt-bindings: i2c: renesas,rzv2m: Fix SoC specific string + - netfilter: conntrack: unify established states for SCTP paths + - perf/x86/amd: fix potential integer overflow on shift of a int + - amdgpu: fix build on non-DCN platforms. + - Linux 6.1.9 + - upstream stable to v6.1.9 + + * Lunar update: v6.1.8 upstream stable release (LP: #2004147) + - dma-buf: fix dma_buf_export init order v2 + - btrfs: fix trace event name typo for FLUSH_DELAYED_REFS + - wifi: iwlwifi: fw: skip PPAG for JF + - pNFS/filelayout: Fix coalescing test for single DS + - selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID + - net: ethernet: marvell: octeontx2: Fix uninitialized variable warning + - tools/virtio: initialize spinlocks in vring_test.c + - vdpa/mlx5: Return error on vlan ctrl commands if not supported + - vdpa/mlx5: Avoid using reslock in event_handler + - vdpa/mlx5: Avoid overwriting CVQ iotlb + - virtio_pci: modify ENOENT to EINVAL + - vduse: Validate vq_num in vduse_validate_config() + - vdpa_sim_net: should not drop the multicast/broadcast packet + - net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats + - r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down() + - r8169: fix dmar pte write access is not set error + - bpf: keep a reference to the mm, in case the task is dead. + - RDMA/srp: Move large values to a new enum for gcc13 + - btrfs: always report error in run_one_delayed_ref() + - x86/asm: Fix an assembler warning with current binutils + - f2fs: let's avoid panic if extent_tree is not created + - perf/x86/rapl: Treat Tigerlake like Icelake + - cifs: fix race in assemble_neg_contexts() + - memblock tests: Fix compilation error. + - perf/x86/rapl: Add support for Intel Meteor Lake + - perf/x86/rapl: Add support for Intel Emerald Rapids + - of: fdt: Honor CONFIG_CMDLINE* even without /chosen node, take 2 + - fbdev: omapfb: avoid stack overflow warning + - Bluetooth: hci_sync: Fix use HCI_OP_LE_READ_BUFFER_SIZE_V2 + - Bluetooth: hci_qca: Fix driver shutdown on closed serdev + - wifi: brcmfmac: fix regression for Broadcom PCIe wifi devices + - wifi: mac80211: fix MLO + AP_VLAN check + - wifi: mac80211: reset multiple BSSID options in stop_ap() + - wifi: mac80211: sdata can be NULL during AMPDU start + - wifi: mac80211: fix initialization of rx->link and rx->link_sta + - nommu: fix memory leak in do_mmap() error path + - nommu: fix do_munmap() error path + - nommu: fix split_vma() map_count error + - proc: fix PIE proc-empty-vm, proc-pid-vm tests + - Add exception protection processing for vd in axi_chan_handle_err function + - LoongArch: Add HWCAP_LOONGARCH_CPUCFG to elf_hwcap + - zonefs: Detect append writes at invalid locations + - nilfs2: fix general protection fault in nilfs_btree_insert() + - mm/shmem: restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE + - hugetlb: unshare some PMDs when splitting VMAs + - mm/khugepaged: fix collapse_pte_mapped_thp() to allow anon_vma + - serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ + handler + - Revert "serial: stm32: Merge hard IRQ and threaded IRQ handling into single + IRQ handler" + - xhci-pci: set the dma max_seg_size + - usb: xhci: Check endpoint is valid before dereferencing it + - xhci: Fix null pointer dereference when host dies + - xhci: Add update_hub_device override for PCI xHCI hosts + - xhci: Add a flag to disable USB3 lpm on a xhci root port level. + - usb: acpi: add helper to check port lpm capability using acpi _DSM + - xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables + - prlimit: do_prlimit needs to have a speculation check + - USB: serial: option: add Quectel EM05-G (GR) modem + - USB: serial: option: add Quectel EM05-G (CS) modem + - USB: serial: option: add Quectel EM05-G (RS) modem + - USB: serial: option: add Quectel EC200U modem + - USB: serial: option: add Quectel EM05CN (SG) modem + - USB: serial: option: add Quectel EM05CN modem + - staging: vchiq_arm: fix enum vchiq_status return types + - USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100 + - usb: misc: onboard_hub: Invert driver registration order + - usb: misc: onboard_hub: Move 'attach' work to the driver + - misc: fastrpc: Fix use-after-free and race in fastrpc_map_find + - misc: fastrpc: Don't remove map on creater_process and device_release + - misc: fastrpc: Fix use-after-free race condition for maps + - usb: core: hub: disable autosuspend for TI TUSB8041 + - comedi: adv_pci1760: Fix PWM instruction handling + - ACPI: PRM: Check whether EFI runtime is available + - mmc: sunxi-mmc: Fix clock refcount imbalance during unbind + - mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting + - mm/hugetlb: fix PTE marker handling in hugetlb_change_protection() + - mm/hugetlb: fix uffd-wp handling for migration entries in + hugetlb_change_protection() + - mm/hugetlb: pre-allocate pgtable pages for uffd wr-protects + - mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA + - mm/MADV_COLLAPSE: don't expand collapse when vm_end is past requested end + - btrfs: add extra error messages to cover non-ENOMEM errors from + device_add_list() + - btrfs: fix missing error handling when logging directory items + - btrfs: fix directory logging due to race with concurrent index key deletion + - btrfs: add missing setup of log for full commit at add_conflicting_inode() + - btrfs: do not abort transaction on failure to write log tree when syncing + log + - btrfs: do not abort transaction on failure to update log root + - btrfs: qgroup: do not warn on record without old_roots populated + - btrfs: fix invalid leaf access due to inline extent during lseek + - btrfs: fix race between quota rescan and disable leading to NULL pointer + deref + - cifs: do not include page data when checking signature + - thunderbolt: Disable XDomain lane 1 only in software connection manager + - thunderbolt: Use correct function to calculate maximum USB3 link rate + - thunderbolt: Do not report errors if on-board retimers are found + - thunderbolt: Do not call PM runtime functions in tb_retimer_scan() + - riscv: dts: sifive: fu740: fix size of pcie 32bit memory + - bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and + PERF_BPF_EVENT_PROG_UNLOAD + - tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer + - tty: fix possible null-ptr-defer in spk_ttyio_release + - pktcdvd: check for NULL returna fter calling bio_split_to_limits() + - io_uring/poll: don't reissue in case of poll race on multishot request + - mptcp: explicitly specify sock family at subflow creation time + - mptcp: netlink: respect v4/v6-only sockets + - selftests: mptcp: userspace: validate v4-v6 subflows mix + - USB: gadgetfs: Fix race between mounting and unmounting + - USB: serial: cp210x: add SCALANCE LPE-9000 device id + - usb: cdns3: remove fetched trb from cache before dequeuing + - usb: host: ehci-fsl: Fix module alias + - usb: musb: fix error return code in omap2430_probe() + - usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail + - usb: typec: altmodes/displayport: Add pin assignment helper + - usb: typec: altmodes/displayport: Fix pin assignment calculation + - usb: gadget: g_webcam: Send color matching descriptor per frame + - USB: gadget: Add ID numbers to configfs-gadget driver names + - usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate() + - usb-storage: apply IGNORE_UAS only for HIKSEMI MD202 on RTL9210 + - arm64: dts: imx8mp: correct usb clocks + - dt-bindings: phy: g12a-usb2-phy: fix compatible string documentation + - dt-bindings: phy: g12a-usb3-pcie-phy: fix compatible string documentation + - serial: pch_uart: Pass correct sg to dma_unmap_sg() + - dmaengine: lgm: Move DT parsing after initialization + - dmaengine: tegra210-adma: fix global intr clear + - dmaengine: idxd: Let probe fail when workqueue cannot be enabled + - dmaengine: idxd: Prevent use after free on completion memory + - dmaengine: idxd: Do not call DMX TX callbacks during workqueue disable + - serial: amba-pl011: fix high priority character transmission in rs486 mode + - serial: atmel: fix incorrect baudrate setup + - serial: exar: Add support for Sealevel 7xxxC serial cards + - gsmi: fix null-deref in gsmi_get_variable + - mei: bus: fix unlink on bus in error path + - mei: me: add meteor lake point M DID + - VMCI: Use threaded irqs instead of tasklets + - ARM: dts: qcom: apq8084-ifc6540: fix overriding SDHCI + - ARM: omap1: fix !ARCH_OMAP1_ANY link failures + - drm/amdgpu: fix amdgpu_job_free_resources v2 + - drm/amdgpu: allow multipipe policy on ASICs with one MEC + - drm/amdgpu: Correct the power calcultion for Renior/Cezanne. + - drm/i915: re-disable RC6p on Sandy Bridge + - drm/i915/display: Check source height is > 0 + - drm/i915: Allow switching away via vga-switcheroo if uninitialized + - drm/i915: Remove unused variable + - drm/amd/display: Fix set scaling doesn's work + - drm/amd/display: Calculate output_color_space after pixel encoding + adjustment + - drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix + - drm/amd/display: disable S/G display on DCN 3.1.5 + - drm/amd/display: disable S/G display on DCN 3.1.4 + - cifs: reduce roundtrips on create/qinfo requests + - fs/ntfs3: Fix attr_punch_hole() null pointer derenference + - arm64: efi: Execute runtime services from a dedicated stack + - efi: rt-wrapper: Add missing include + - panic: Separate sysctl logic from CONFIG_SMP + - exit: Put an upper limit on how often we can oops + - exit: Expose "oops_count" to sysfs + - exit: Allow oops_limit to be disabled + - panic: Consolidate open-coded panic_on_warn checks + - panic: Introduce warn_limit + - panic: Expose "warn_count" to sysfs + - docs: Fix path paste-o for /sys/kernel/warn_count + - exit: Use READ_ONCE() for all oops/warn limit reads + - x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN + - drm/amdgpu/discovery: enable soc21 common for GC 11.0.4 + - drm/amdgpu/discovery: enable gmc v11 for GC 11.0.4 + - drm/amdgpu/discovery: enable gfx v11 for GC 11.0.4 + - drm/amdgpu/discovery: enable mes support for GC v11.0.4 + - drm/amdgpu: set GC 11.0.4 family + - drm/amdgpu/discovery: set the APU flag for GC 11.0.4 + - drm/amdgpu: add gfx support for GC 11.0.4 + - drm/amdgpu: add gmc v11 support for GC 11.0.4 + - drm/amdgpu/discovery: add PSP IP v13.0.11 support + - drm/amdgpu/pm: enable swsmu for SMU IP v13.0.11 + - drm/amdgpu: add smu 13 support for smu 13.0.11 + - drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.11 + - drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.11 + - drm/amdgpu/pm: use the specific mailbox registers only for SMU IP v13.0.4 + - drm/amdgpu/discovery: enable nbio support for NBIO v7.7.1 + - drm/amdgpu: enable PSP IP v13.0.11 support + - drm/amdgpu: enable GFX IP v11.0.4 CG support + - drm/amdgpu: enable GFX Power Gating for GC IP v11.0.4 + - drm/amdgpu: enable GFX Clock Gating control for GC IP v11.0.4 + - drm/amdgpu: add tmz support for GC 11.0.1 + - drm/amdgpu: add tmz support for GC IP v11.0.4 + - drm/amdgpu: correct MEC number for gfx11 APUs + - octeontx2-pf: Avoid use of GFP_KERNEL in atomic context + - net/ulp: use consistent error code when blocking ULP + - octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt + - net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() + - block: mq-deadline: Rename deadline_is_seq_writes() + - Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()" + - soc: qcom: apr: Make qcom,protection-domain optional again + - Linux 6.1.8 + - upstream stable to v6.1.8 + + * Lunar update: v6.1.7 upstream stable release (LP: #2004146) + - Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing" + - ALSA: control-led: use strscpy in set_led_id() + - ALSA: usb-audio: Always initialize fixed_rate in + snd_usb_find_implicit_fb_sync_format() + - ALSA: hda/realtek - Turn on power early + - ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx + - KVM: x86: Do not return host topology information from + KVM_GET_SUPPORTED_CPUID + - KVM: arm64: Fix S1PTW handling on RO memslots + - efi: fix userspace infinite retry read efivars after EFI runtime services + page fault + - efi: tpm: Avoid READ_ONCE() for accessing the event log + - docs: Fix the docs build with Sphinx 6.0 + - io_uring/poll: add hash if ready poll request can't complete inline + - arm64: mte: Fix double-freeing of the temporary tag storage during coredump + - arm64: mte: Avoid the racy walk of the vma list during core dump + - arm64: cmpxchg_double*: hazard against entire exchange variable + - ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops + - net: stmmac: add aux timestamps fifo clearance wait + - perf auxtrace: Fix address filter duplicate symbol selection + - s390/kexec: fix ipl report address for kdump + - brcmfmac: Prefer DT board type over DMI board type + - ASoC: qcom: lpass-cpu: Fix fallback SD line index handling + - elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} + - cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering + - s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops + - s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple() + - drm/virtio: Fix GEM handle creation UAF + - drm/amd/pm/smu13: BACO is supported when it's in BACO state + - drm: Optimize drm buddy top-down allocation method + - drm/i915/gt: Reset twice + - drm/i915: Reserve enough fence slot for i915_vma_unbind_async + - drm/i915: Fix potential context UAFs + - drm/amdgpu: Fixed bug on error when unloading amdgpu + - drm/amd/pm: correct the reference clock for fan speed(rpm) calculation + - drm/amd/pm: add the missing mapping for PPT feature on SMU13.0.0 and 13.0.7 + - drm/amd/display: move remaining FPU code to dml folder + - Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 + properly"" + - cifs: Fix uninitialized memory read for smb311 posix symlink create + - cifs: fix file info setting in cifs_query_path_info() + - cifs: fix file info setting in cifs_open_file() + - cifs: do not query ifaces on smb1 mounts + - cifs: fix double free on failed kerberos auth + - io_uring/fdinfo: include locked hash table in fdinfo output + - ASoC: rt9120: Make dev PM runtime bind AsoC component PM + - ACPI: video: Allow selecting NVidia-WMI-EC or Apple GMUX backlight from the + cmdline + - platform/x86: dell-privacy: Only register SW_CAMERA_LENS_COVER if present + - platform/surface: aggregator: Ignore command messages not intended for us + - platform/x86: int3472/discrete: Ensure the clk/power enable pins are in + output mode + - platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode + - platform/x86: asus-wmi: Don't load fan curves without fan + - platform/x86: dell-privacy: Fix SW_CAMERA_LENS_COVER reporting + - dt-bindings: msm: dsi-controller-main: Fix operating-points-v2 constraint + - drm/msm: another fix for the headless Adreno GPU + - firmware/psci: Fix MEM_PROTECT_RANGE function numbers + - firmware/psci: Don't register with debugfs if PSCI isn't available + - drm/msm/adreno: Make adreno quirks not overwrite each other + - arm64/signal: Always allocate SVE signal frames on SME only systems + - dt-bindings: msm: dsi-controller-main: Fix power-domain constraint + - dt-bindings: msm: dsi-controller-main: Fix description of core clock + - arm64/signal: Always accept SVE signal frames on SME only systems + - arm64/mm: add pud_user_exec() check in pud_user_accessible_page() + - dt-bindings: msm: dsi-phy-28nm: Add missing qcom, dsi-phy-regulator-ldo-mode + - arm64: ptrace: Use ARM64_SME to guard the SME register enumerations + - arm64/mm: fix incorrect file_map_count for invalid pmd + - platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to + set_fn_lock_led_list[] + - drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux + transfer + - dt-bindings: msm/dsi: Don't require vdds-supply on 10nm PHY + - dt-bindings: msm/dsi: Don't require vcca-supply on 14nm PHY + - platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during + probe + - ixgbe: fix pci device refcount leak + - ipv6: raw: Deduct extension header length in rawv6_push_pending_frames + - iavf/iavf_main: actually log ->src mask when talking about it + - drm/i915/gt: Cleanup partial engine discovery failures + - usb: ulpi: defer ulpi_register on ulpi_read_id timeout + - drm/amd/pm: enable mode1 reset on smu_v13_0_10 + - drm/amd/pm: Enable bad memory page/channel recording support for smu v13_0_0 + - drm/amd/pm: enable GPO dynamic control support for SMU13.0.0 + - drm/amd/pm: enable GPO dynamic control support for SMU13.0.7 + - drm/amdgpu: add soc21 common ip block support for GC 11.0.4 + - drm/amdgpu: Enable pg/cg flags on GC11_0_4 for VCN + - drm/amdgpu: enable VCN DPG for GC IP v11.0.4 + - mm: Always release pages to the buddy allocator in memblock_free_late(). + - iommu/iova: Fix alloc iova overflows issue + - iommu/arm-smmu-v3: Don't unregister on shutdown + - iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() + - iommu/arm-smmu: Don't unregister on shutdown + - iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY even betterer + - sched/core: Fix use-after-free bug in dup_user_cpus_ptr() + - netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() + function. + - selftests: netfilter: fix transaction test script timeout handling + - powerpc/imc-pmu: Fix use of mutex in IRQs disabled section + - x86/boot: Avoid using Intel mnemonics in AT&T syntax asm + - EDAC/device: Fix period calculation in edac_device_reset_delay_period() + - x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case + - x86/resctrl: Fix task CLOSID/RMID update race + - x86/resctrl: Fix event counts regression in reused RMIDs + - regulator: da9211: Use irq handler when ready + - scsi: storvsc: Fix swiotlb bounce buffer leak in confidential VM + - scsi: mpi3mr: Refer CONFIG_SCSI_MPI3MR in Makefile + - scsi: ufs: core: WLUN suspend SSU/enter hibern8 fail recovery + - ASoC: Intel: fix sof-nau8825 link failure + - ASoC: Intel: sof_nau8825: support rt1015p speaker amplifier + - ASoC: Intel: sof-nau8825: fix module alias overflow + - drm/msm/dpu: Fix some kernel-doc comments + - drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path + - ASoC: wm8904: fix wrong outputs volume after power reactivation + - mtd: parsers: scpart: fix __udivdi3 undefined on mips + - mtd: cfi: allow building spi-intel standalone + - ALSA: usb-audio: Make sure to stop endpoints before closing EPs + - ALSA: usb-audio: Relax hw constraints for implicit fb sync + - stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed + - tipc: fix unexpected link reset due to discovery messages + - NFSD: Pass the target nfsd_file to nfsd_commit() + - NFSD: Revert "NFSD: NFSv4 CLOSE should release an nfsd_file immediately" + - NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection + - nfsd: remove the pages_flushed statistic from filecache + - nfsd: reorganize filecache.c + - NFSD: Add an nfsd_file_fsync tracepoint + - nfsd: rework refcounting in filecache + - nfsd: fix handling of cached open files in nfsd4_open codepath + - octeontx2-af: Fix LMAC config in cgx_lmac_rx_tx_enable + - sched/core: Fix arch_scale_freq_tick() on tickless systems + - hvc/xen: lock console list traversal + - nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() + - gro: avoid checking for a failed search + - gro: take care of DODGY packets + - af_unix: selftest: Fix the size of the parameter to connect() + - ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE + - tools/nolibc: restore mips branch ordering in the _start block + - tools/nolibc: fix the O_* fcntl/open macro definitions for riscv + - drm/amdgpu: Fix potential NULL dereference + - ice: Fix potential memory leak in ice_gnss_tty_write() + - ice: Add check for kzalloc + - drm/vmwgfx: Write the driver id registers + - drm/vmwgfx: Refactor resource manager's hashtable to use linux/hashtable + implementation. + - drm/vmwgfx: Remove ttm object hashtable + - drm/vmwgfx: Refactor resource validation hashtable to use linux/hashtable + implementation. + - drm/vmwgfx: Refactor ttm reference object hashtable to use linux/hashtable. + - drm/vmwgfx: Remove vmwgfx_hashtab + - drm/vmwgfx: Remove rcu locks from user resources + - net/sched: act_mpls: Fix warning during failed attribute validation + - Revert "r8169: disable detection of chip version 36" + - net/mlx5: check attr pointer validity before dereferencing it + - net/mlx5e: TC, Keep mod hdr actions after mod hdr alloc + - net/mlx5: Fix command stats access after free + - net/mlx5e: Verify dev is present for fix features ndo + - net/mlx5e: IPoIB, Block queue count configuration when sub interfaces are + present + - net/mlx5e: IPoIB, Block PKEY interfaces with less rx queues than parent + - net/mlx5e: IPoIB, Fix child PKEY interface stats on rx path + - net/mlx5: Fix ptp max frequency adjustment range + - net/mlx5e: Don't support encap rules with gbp option + - net/mlx5e: Fix macsec ssci attribute handling in offload path + - net/mlx5e: Fix macsec possible null dereference when updating MAC security + entity (SecY) + - selftests/net: l2_tos_ttl_inherit.sh: Set IPv6 addresses with "nodad". + - selftests/net: l2_tos_ttl_inherit.sh: Run tests in their own netns. + - selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure. + - octeontx2-pf: Fix resource leakage in VF driver unbind + - perf build: Properly guard libbpf includes + - perf kmem: Support legacy tracepoints + - perf kmem: Support field "node" in evsel__process_alloc_event() coping with + recent tracepoint restructuring + - igc: Fix PPS delta between two synchronized end-points + - net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit() + - net: hns3: fix wrong use of rss size during VF rss config + - bnxt: make sure we return pages to the pool + - platform/surface: aggregator: Add missing call to ssam_request_sync_free() + - platform/x86/amd: Fix refcount leak in amd_pmc_probe + - ALSA: usb-audio: Fix possible NULL pointer dereference in + snd_usb_pcm_has_fixed_rate() + - efi: fix NULL-deref in init error path + - io_uring: lock overflowing for IOPOLL + - io_uring/poll: attempt request issue after racy poll wakeup + - drm/i915: Fix CFI violations in gt_sysfs + - io_uring/io-wq: free worker if task_work creation is canceled + - io_uring/io-wq: only free worker if it was allocated for creation + - block: handle bio_split_to_limits() NULL return + - Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout" + - pinctrl: amd: Add dynamic debugging for active GPIOs + - Linux 6.1.7 + - upstream stable to v6.1.7 + + * Move kernel ADT tests to python3 (LP: #2004429) + - [Debian] Use a python3 compatable kernel-testing repo + + * Miscellaneous Ubuntu changes + - [Packaging]: Sync annotations scripts from git + - [Config] Update annotations after syncing the scripts + - [Config] Update annotations after merging 6.1.13 + + -- Timo Aaltonen Fri, 03 Mar 2023 11:27:39 +0200 + linux-oem-6.1 (6.1.0-1007.7) jammy; urgency=medium * jammy/linux-oem-6.1: 6.1.0-1007.7 -proposed tracker (LP: #2006571) diff -u linux-oem-6.1-6.1.0/debian/control linux-oem-6.1-6.1.0/debian/control --- linux-oem-6.1-6.1.0/debian/control +++ linux-oem-6.1-6.1.0/debian/control @@ -62,7 +62,7 @@ XS-Testsuite: autopkgtest #XS-Testsuite-Depends: gcc-4.7 binutils -Package: linux-oem-6.1-headers-6.1.0-1007 +Package: linux-oem-6.1-headers-6.1.0-1008 Build-Profiles: Architecture: all Multi-Arch: foreign @@ -72,20 +72,20 @@ Description: Header files related to Linux kernel version 6.1.0 This package provides kernel header files for version 6.1.0, for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-oem-6.1-headers-6.1.0-1007/debian.README.gz for details + /usr/share/doc/linux-oem-6.1-headers-6.1.0-1008/debian.README.gz for details -Package: linux-oem-6.1-tools-6.1.0-1007 +Package: linux-oem-6.1-tools-6.1.0-1008 Build-Profiles: Architecture: amd64 Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common -Description: Linux kernel version specific tools for version 6.1.0-1007 +Description: Linux kernel version specific tools for version 6.1.0-1008 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.1.0-1007 on + version 6.1.0-1008 on 64 bit x86. - You probably want to install linux-tools-6.1.0-1007-. + You probably want to install linux-tools-6.1.0-1008-. Package: linux-oem-6.1-tools-host Build-Profiles: @@ -99,17 +99,17 @@ -Package: linux-image-unsigned-6.1.0-1007-oem +Package: linux-image-unsigned-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel Priority: optional Provides: linux-image, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules, virtualbox-guest-modules [amd64], ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.1.0-1007-oem +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.1.0-1008-oem Recommends: grub-pc [amd64] | grub-efi-amd64 [amd64] | grub-efi-ia32 [amd64] | grub [amd64] | lilo [amd64] | flash-kernel [armhf arm64] | grub-efi-arm64 [arm64] | grub-efi-arm [armhf] | grub-ieee1275 [ppc64el], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-6.1.0-1007-oem -Suggests: fdutils, linux-oem-6.1-tools, linux-headers-6.1.0-1007-oem +Conflicts: linux-image-6.1.0-1008-oem +Suggests: fdutils, linux-oem-6.1-tools, linux-headers-6.1.0-1008-oem Description: Linux kernel image for version 6.1.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 6.1.0 on 64 bit x86 SMP. @@ -122,7 +122,7 @@ the linux-oem meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-6.1.0-1007-oem +Package: linux-modules-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel @@ -142,12 +142,12 @@ the linux-oem meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-6.1.0-1007-oem +Package: linux-modules-extra-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.1.0-1007-oem, wireless-regdb +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.1.0-1008-oem, wireless-regdb Description: Linux kernel extra modules for version 6.1.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 6.1.0 on 64 bit x86 SMP. @@ -164,21 +164,21 @@ the linux-oem meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-6.1.0-1007-oem +Package: linux-headers-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-oem-6.1-headers-6.1.0-1007, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-oem-6.1-headers-6.1.0-1008, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 6.1.0 on 64 bit x86 SMP This package provides kernel header files for version 6.1.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.1.0-1007/debian.README.gz for details. + /usr/share/doc/linux-headers-6.1.0-1008/debian.README.gz for details. -Package: linux-image-unsigned-6.1.0-1007-oem-dbgsym +Package: linux-image-unsigned-6.1.0-1008-oem-dbgsym Build-Profiles: Architecture: amd64 Section: devel @@ -195,31 +195,31 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-6.1.0-1007-oem +Package: linux-tools-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-oem-6.1-tools-6.1.0-1007 -Description: Linux kernel version specific tools for version 6.1.0-1007 +Depends: ${misc:Depends}, linux-oem-6.1-tools-6.1.0-1008 +Description: Linux kernel version specific tools for version 6.1.0-1008 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.1.0-1007 on + version 6.1.0-1008 on 64 bit x86. -Package: linux-cloud-tools-6.1.0-1007-oem +Package: linux-cloud-tools-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-oem-6.1-cloud-tools-6.1.0-1007 -Description: Linux kernel version specific cloud tools for version 6.1.0-1007 +Depends: ${misc:Depends}, linux-oem-6.1-cloud-tools-6.1.0-1008 +Description: Linux kernel version specific cloud tools for version 6.1.0-1008 This package provides the architecture dependant parts for kernel - version locked tools for cloud for version 6.1.0-1007 on + version locked tools for cloud for version 6.1.0-1008 on 64 bit x86. -Package: linux-buildinfo-6.1.0-1007-oem +Package: linux-buildinfo-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel @@ -233,18 +233,18 @@ You likely do not want to install this package. -Package: linux-modules-ipu6-6.1.0-1007-oem +Package: linux-modules-ipu6-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.1.0-1007-oem | linux-image-unsigned-6.1.0-1007-oem, + linux-image-6.1.0-1008-oem | linux-image-unsigned-6.1.0-1008-oem, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ipu6 modules for version 6.1.0-1007 +Description: Linux kernel ipu6 modules for version 6.1.0-1008 This package provides the Linux kernel ipu6 modules for version - 6.1.0-1007. + 6.1.0-1008. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ipu6-oem* meta-packages, @@ -252,18 +252,18 @@ also installed. -Package: linux-modules-ivsc-6.1.0-1007-oem +Package: linux-modules-ivsc-6.1.0-1008-oem Build-Profiles: Architecture: amd64 Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.1.0-1007-oem | linux-image-unsigned-6.1.0-1007-oem, + linux-image-6.1.0-1008-oem | linux-image-unsigned-6.1.0-1008-oem, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ivsc modules for version 6.1.0-1007 +Description: Linux kernel ivsc modules for version 6.1.0-1008 This package provides the Linux kernel ivsc modules for version - 6.1.0-1007. + 6.1.0-1008. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ivsc-oem* meta-packages, diff -u linux-oem-6.1-6.1.0/debian/scripts/misc/annotations linux-oem-6.1-6.1.0/debian/scripts/misc/annotations --- linux-oem-6.1-6.1.0/debian/scripts/misc/annotations +++ linux-oem-6.1-6.1.0/debian/scripts/misc/annotations @@ -8,9 +8,10 @@ import os import argparse import json -from kconfig.annotations import Annotation, KConfig from signal import signal, SIGPIPE, SIG_DFL +from kconfig.annotations import Annotation, KConfig + VERSION = '0.1' SKIP_CONFIGS = ( @@ -28,6 +29,7 @@ 'CONFIG_BINDGEN_VERSION_TEXT', ) + def make_parser(): parser = argparse.ArgumentParser( description='Manage Ubuntu kernel .config and annotations', @@ -53,33 +55,37 @@ ga = parser.add_argument_group(title='Action').add_mutually_exclusive_group(required=False) ga.add_argument('--write', '-w', action='store', - metavar='VALUE', dest='value', - help='Set a specific config value in annotations (use \'null\' to remove)') + metavar='VALUE', dest='value', + help='Set a specific config value in annotations (use \'null\' to remove)') ga.add_argument('--export', '-e', action='store_true', - help='Convert annotations to .config format') + help='Convert annotations to .config format') ga.add_argument('--import', '-i', action='store', - metavar="FILE", dest='import_file', - help='Import a full .config for a specific arch and flavour into annotations') + metavar="FILE", dest='import_file', + help='Import a full .config for a specific arch and flavour into annotations') ga.add_argument('--update', '-u', action='store', - metavar="FILE", dest='update_file', - help='Import a partial .config into annotations (only resync configs specified in FILE)') + metavar="FILE", dest='update_file', + help='Import a partial .config into annotations (only resync configs specified in FILE)') ga.add_argument('--check', '-k', action='store', - metavar="FILE", dest='check_file', - help='Validate kernel .config with annotations') + metavar="FILE", dest='check_file', + help='Validate kernel .config with annotations') return parser + _ARGPARSER = make_parser() + def arg_fail(message): print(message) _ARGPARSER.print_usage() - exit(1) + sys.exit(1) + def print_result(config, res): if res is not None and config not in res: res = {config or '*': res} print(json.dumps(res, indent=4)) + def do_query(args): if args.arch is None and args.flavour is not None: arg_fail('error: --flavour requires --arch') @@ -87,19 +93,23 @@ res = a.search_config(config=args.config, arch=args.arch, flavour=args.flavour) print_result(args.config, res) + def do_autocomplete(args): a = Annotation(args.file) res = (c.removeprefix('CONFIG_') for c in a.search_config()) - print('complete -W "{}" annotations'.format(' '.join(res))) + res_str = ' '.join(res) + print(f'complete -W "{res_str}" annotations') + def do_source(args): if args.config is None: arg_fail('error: --source requires --config') if not os.path.exists('tags'): print('tags not found in the current directory, try: `make tags`') - exit(1) + sys.exit(1) os.system(f'vim -t {args.config}') + def do_note(args): if args.config is None: arg_fail('error: --note requires --config') @@ -116,6 +126,7 @@ res = a.search_config(config=args.config) print_result(args.config, res) + def do_write(args): if args.config is None: arg_fail('error: --write requires --config') @@ -135,6 +146,7 @@ res = a.search_config(config=args.config) print_result(args.config, res) + def do_export(args): if args.arch is None: arg_fail('error: --export requires --arch') @@ -143,6 +155,7 @@ if conf: print(a.to_config(conf)) + def do_import(args): if args.arch is None: arg_fail('error: --arch is required with --import') @@ -159,6 +172,7 @@ # Save back to annotations a.save(args.file) + def do_update(args): if args.arch is None: arg_fail('error: --arch is required with --update') @@ -174,6 +188,7 @@ # Save back to annotations a.save(args.file) + def do_check(args): # Determine arch and flavour if args.arch is None: @@ -208,7 +223,8 @@ total += 1 print(f"check-config: {good}/{total} checks passed -- exit {ret}") - exit(ret) + sys.exit(ret) + def autodetect_annotations(args): if args.file: @@ -216,11 +232,12 @@ # If --file/-f isn't specified try to automatically determine the right # location of the annotations file looking at debian/debian.env. try: - with open('debian/debian.env', 'rt') as fd: + with open('debian/debian.env', 'rt', encoding='utf-8') as fd: args.file = fd.read().rstrip().split('=')[1] + '/config/annotations' - except: + except (FileNotFoundError, IndexError): arg_fail('error: could not determine DEBDIR, try using: --file/-f') + def main(): # Prevent broken pipe errors when showing output in pipe to other tools # (less for example) @@ -253,4 +270,5 @@ do_query(args) + if __name__ == '__main__': main() diff -u linux-oem-6.1-6.1.0/debian/scripts/misc/kconfig/annotations.py linux-oem-6.1-6.1.0/debian/scripts/misc/kconfig/annotations.py --- linux-oem-6.1-6.1.0/debian/scripts/misc/kconfig/annotations.py +++ linux-oem-6.1-6.1.0/debian/scripts/misc/kconfig/annotations.py @@ -7,20 +7,26 @@ import re import shutil import tempfile + +from abc import abstractmethod from ast import literal_eval from os.path import dirname, abspath -class Config(object): - def __init__(self, fname: str, arch: str = None, flavour: str = None): + +class Config(): + def __init__(self, fname): """ Basic configuration file object """ self.fname = fname + self.config = {} + raw_data = self._load(fname) self._parse(raw_data) - def _load(self, fname: str) -> str: - with open(fname, 'rt') as fd: + @staticmethod + def _load(fname: str) -> str: + with open(fname, 'rt', encoding='utf-8') as fd: data = fd.read() return data.rstrip() @@ -28,12 +34,17 @@ """ Return a JSON representation of the config """ return json.dumps(self.config, indent=4) + @abstractmethod + def _parse(self, data: str): + pass + + class KConfig(Config): """ Parse a .config file, individual config options can be accessed via .config[] """ - def _parse(self, data: str) -> dict: + def _parse(self, data: str): self.config = {} for line in data.splitlines(): m = re.match(r'^# (CONFIG_.*) is not set$', line) @@ -45,59 +56,84 @@ self.config[m.group(1)] = literal_eval("'" + m.group(2) + "'") continue + class Annotation(Config): """ Parse body of annotations file """ def _parse_body(self, data: str): - # Skip comments - data = re.sub(r'(?m)^\s*#.*\n?', '', data) + for line in data.splitlines(): + # Replace tabs with spaces, squeeze multiple into singles and + # remove leading and trailing spaces + line = line.replace('\t', ' ') + line = re.sub(r' +', ' ', line) + line = line.strip() - # Convert multiple spaces to single space to simplifly parsing - data = re.sub(r' *', ' ', data) + # Ignore empty lines + if not line: + continue - # Handle includes (recursively) - for line in data.splitlines(): + # Catpure flavors of included files + if line.startswith('# FLAVOUR: '): + self.include_flavour += line.split(' ')[2:] + continue + + # Ignore comments + if line.startswith('#'): + continue + + # Handle includes (recursively) m = re.match(r'^include\s+"?([^"]*)"?', line) if m: self.include.append(m.group(1)) include_fname = dirname(abspath(self.fname)) + '/' + m.group(1) include_data = self._load(include_fname) self._parse_body(include_data) - else: - # Skip empty, non-policy and non-note lines - if re.match('.* policy<', line) or re.match('.* note<', line): - try: - # Parse single policy or note rule - conf = line.split(' ')[0] - if conf in self.config: - entry = self.config[conf] - else: - entry = {'policy': {}} - m = re.match(r'.*policy<(.*)>', line) - if m: - entry['policy'] |= literal_eval(m.group(1)) - else: - m = re.match(r'.*note<(.*?)>', line) - if m: - entry['note'] = "'" + m.group(1).replace("'", '') + "'" - else: - raise Exception('syntax error') - self.config[conf] = entry - except Exception as e: - raise Exception(str(e) + f', line = {line}') + continue - """ - Parse main annotations file, individual config options can be accessed via - self.config[] - """ - def _parse(self, data: str) -> dict: + # Handle policy and note lines + if re.match(r'.* (policy|note)<', line): + try: + conf = line.split(' ')[0] + if conf in self.config: + entry = self.config[conf] + else: + entry = {'policy': {}} + + match = False + m = re.match(r'.* policy<(.*?)>', line) + if m: + match = True + entry['policy'] |= literal_eval(m.group(1)) + + m = re.match(r'.* note<(.*?)>', line) + if m: + entry['oneline'] = match + match = True + entry['note'] = "'" + m.group(1).replace("'", '') + "'" + + if not match: + raise Exception('syntax error') + self.config[conf] = entry + except Exception as e: + raise Exception(str(e) + f', line = {line}') from e + continue + + # Invalid line + raise Exception(f'invalid line: {line}') + + def _parse(self, data: str): + """ + Parse main annotations file, individual config options can be accessed + via self.config[] + """ self.config = {} self.arch = [] self.flavour = [] self.flavour_dep = {} self.include = [] self.header = '' + self.include_flavour = [] # Parse header (only main header will considered, headers in includes # will be treated as comments) @@ -111,7 +147,7 @@ self.flavour = list(m.group(1).split(' ')) m = re.match(r'^# FLAVOUR_DEP: (.*)', line) if m: - self.flavour_dep = eval(m.group(1)) + self.flavour_dep = literal_eval(m.group(1)) self.header += line + "\n" else: break @@ -119,15 +155,18 @@ # Parse body (handle includes recursively) self._parse_body(data) - def _remove_entry(self, config : str): - if 'policy' in self.config[config]: - del self.config[config]['policy'] - if 'note' in self.config[config]: - del self.config[config]['note'] - if not self.config[config]: + # Sanity check: Verify that all FLAVOUR_DEP flavors are valid + for src, tgt in self.flavour_dep.items(): + if src not in self.flavour: + raise Exception(f'Invalid source flavour in FLAVOUR_DEP: {src}') + if tgt not in self.include_flavour: + raise Exception(f'Invalid target flavour in FLAVOUR_DEP: {tgt}') + + def _remove_entry(self, config: str): + if self.config[config]: del self.config[config] - def remove(self, config : str, arch: str = None, flavour: str = None): + def remove(self, config: str, arch: str = None, flavour: str = None): if config not in self.config: return if arch is not None: @@ -141,11 +180,11 @@ else: self._remove_entry(config) - def set(self, config : str, arch: str = None, flavour: str = None, - value : str = None, note : str = None): + def set(self, config: str, arch: str = None, flavour: str = None, + value: str = None, note: str = None): if value is not None: if config not in self.config: - self.config[config] = { 'policy': {} } + self.config[config] = {'policy': {}} if arch is not None: if flavour is not None: flavour = f'{arch}-{flavour}' @@ -153,12 +192,12 @@ flavour = arch self.config[config]['policy'][flavour] = value else: - for arch in self.arch: - self.config[config]['policy'][arch] = value + for a in self.arch: + self.config[config]['policy'][a] = value if note is not None: self.config[config]['note'] = "'" + note.replace("'", '') + "'" - def update(self, c: KConfig, arch: str, flavour: str = None, configs: list = []): + def update(self, c: KConfig, arch: str, flavour: str = None, configs: list = None): """ Merge configs from a Kconfig object into Annotation object """ # Determine if we need to import all configs or a single config @@ -214,9 +253,11 @@ if flavour not in list(set(self.arch + self.flavour)): del self.config[conf]['policy'][flavour] # Remove configs that are all undefined across all arches/flavours - if 'policy' in self.config[conf]: - if list(set(self.config[conf]['policy'].values())) == ['-']: - self.config[conf]['policy'] = {} + # (unless we have includes) + if not self.include: + if 'policy' in self.config[conf]: + if list(set(self.config[conf]['policy'].values())) == ['-']: + self.config[conf]['policy'] = {} # Drop empty rules if not self.config[conf]['policy']: del self.config[conf] @@ -228,7 +269,7 @@ for flavour in arch_flavours: if flavour not in self.config[conf]['policy']: break - elif value is None: + if value is None: value = self.config[conf]['policy'][flavour] elif value != self.config[conf]['policy'][flavour]: break @@ -236,6 +277,31 @@ for flavour in arch_flavours: del self.config[conf]['policy'][flavour] self.config[conf]['policy'][arch] = value + # After the first round of compaction we may end up having configs that + # are undefined across all arches, so do another round of compaction to + # drop these settings that are not needed anymore + # (unless we have includes). + if not self.include: + for conf in self.config.copy(): + # Remove configs that are all undefined across all arches/flavours + if 'policy' in self.config[conf]: + if list(set(self.config[conf]['policy'].values())) == ['-']: + self.config[conf]['policy'] = {} + # Drop empty rules + if not self.config[conf]['policy']: + del self.config[conf] + + @staticmethod + def _sorted(config): + """ Sort configs alphabetically but return configs with a note first """ + w_note = [] + wo_note = [] + for c in sorted(config): + if 'note' in config[c]: + w_note.append(c) + else: + wo_note.append(c) + return w_note + wo_note def save(self, fname: str): """ Save annotations data to the annotation file """ @@ -259,21 +325,36 @@ tmp_a = Annotation(fname) # Only save local differences (preserve includes) - for conf in sorted(self.config): - old_val = tmp_a.config[conf] if conf in tmp_a.config else None + marker = False + for conf in self._sorted(self.config): new_val = self.config[conf] + if 'policy' not in new_val: + continue + # If new_val is a subset of old_val, skip it - if old_val and 'policy' in old_val and 'policy' in new_val: + old_val = tmp_a.config.get(conf) + if old_val and 'policy' in old_val: if old_val['policy'] == old_val['policy'] | new_val['policy']: continue - if 'policy' in new_val: - val = dict(sorted(new_val['policy'].items())) - line = f"{conf : <47} policy<{val}>" - tmp.write(line + "\n") - if 'note' in new_val: - val = new_val['note'] - line = f"{conf : <47} note<{val}>" - tmp.write(line + "\n\n") + + # Write out the policy (and note) line(s) + val = dict(sorted(new_val['policy'].items())) + line = f"{conf : <47} policy<{val}>" + if 'note' in new_val: + val = new_val['note'] + if new_val.get('oneline', False): + # Single line + line += f' note<{val}>' + else: + # Separate policy and note lines, + # followed by an empty line + line += f'\n{conf : <47} note<{val}>\n' + elif not marker: + # Write out a marker indicating the start of annotations + # without notes + tmp.write('\n# ---- Annotations without notes ----\n\n') + marker = True + tmp.write(line + "\n") # Replace annotations with the updated version tmp.flush() @@ -291,31 +372,31 @@ if config is None and arch is None: # Get all config options for all architectures return self.config - elif config is None and arch is not None: + if config is None and arch is not None: # Get config options of a specific architecture ret = {} - for c in self.config: - if not 'policy' in self.config[c]: + for c, val in self.config.items(): + if 'policy' not in val: continue - if flavour in self.config[c]['policy']: - ret[c] = self.config[c]['policy'][flavour] - elif generic != flavour and generic in self.config[c]['policy']: - ret[c] = self.config[c]['policy'][generic] - elif arch in self.config[c]['policy']: - ret[c] = self.config[c]['policy'][arch] + if flavour in val['policy']: + ret[c] = val['policy'][flavour] + elif generic != flavour and generic in val['policy']: + ret[c] = val['policy'][generic] + elif arch in val['policy']: + ret[c] = val['policy'][arch] return ret - elif config is not None and arch is None: + if config is not None and arch is None: # Get a specific config option for all architectures return self.config[config] if config in self.config else None - elif config is not None and arch is not None: + if config is not None and arch is not None: # Get a specific config option for a specific architecture if config in self.config: if 'policy' in self.config[config]: if flavour in self.config[config]['policy']: return {config: self.config[config]['policy'][flavour]} - elif generic != flavour and generic in self.config[config]['policy']: + if generic != flavour and generic in self.config[config]['policy']: return {config: self.config[config]['policy'][generic]} - elif arch in self.config[config]['policy']: + if arch in self.config[config]['policy']: return {config: self.config[config]['policy'][arch]} return None diff -u linux-oem-6.1-6.1.0/debian/tests/control linux-oem-6.1-6.1.0/debian/tests/control --- linux-oem-6.1-6.1.0/debian/tests/control +++ linux-oem-6.1-6.1.0/debian/tests/control @@ -5,3 +5,3 @@ Tests: ubuntu-regression-suite -Depends: build-essential, gcc-multilib [amd64 armhf i386], gdb, git, python2 | python, bzr +Depends: build-essential, gcc-multilib [amd64 armhf i386], gdb, git, python3 Restrictions: allow-stderr, isolation-machine, breaks-testbed, skippable diff -u linux-oem-6.1-6.1.0/debian/tests/ubuntu-regression-suite linux-oem-6.1-6.1.0/debian/tests/ubuntu-regression-suite --- linux-oem-6.1-6.1.0/debian/tests/ubuntu-regression-suite +++ linux-oem-6.1-6.1.0/debian/tests/ubuntu-regression-suite @@ -43,3 +43,4 @@ -git clone --depth=1 git://git.launchpad.net/~canonical-kernel-team/+git/kernel-testing +git clone --depth=1 -b autotest3 git://git.launchpad.net/~canonical-kernel-team/+git/kernel-testing +git -C kernel-testing/ show HEAD -q kernel-testing/run-dep8-tests diff -u linux-oem-6.1-6.1.0/drivers/acpi/pfr_update.c linux-oem-6.1-6.1.0/drivers/acpi/pfr_update.c --- linux-oem-6.1-6.1.0/drivers/acpi/pfr_update.c +++ linux-oem-6.1-6.1.0/drivers/acpi/pfr_update.c @@ -455,7 +455,7 @@ iov.iov_base = (void __user *)buf; iov.iov_len = len; - iov_iter_init(&iter, WRITE, &iov, 1, len); + iov_iter_init(&iter, ITER_SOURCE, &iov, 1, len); /* map the communication buffer */ phy_addr = (phys_addr_t)((buf_info.addr_hi << 32) | buf_info.addr_lo); diff -u linux-oem-6.1-6.1.0/drivers/acpi/resource.c linux-oem-6.1-6.1.0/drivers/acpi/resource.c --- linux-oem-6.1-6.1.0/drivers/acpi/resource.c +++ linux-oem-6.1-6.1.0/drivers/acpi/resource.c @@ -433,6 +433,13 @@ }, }, { + .ident = "Asus ExpertBook B2402CBA", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"), + }, + }, + { .ident = "Asus ExpertBook B2502", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), diff -u linux-oem-6.1-6.1.0/drivers/acpi/video_detect.c linux-oem-6.1-6.1.0/drivers/acpi/video_detect.c --- linux-oem-6.1-6.1.0/drivers/acpi/video_detect.c +++ linux-oem-6.1-6.1.0/drivers/acpi/video_detect.c @@ -50,6 +50,10 @@ acpi_backlight_cmdline = acpi_backlight_video; if (!strcmp("native", acpi_video_backlight_string)) acpi_backlight_cmdline = acpi_backlight_native; + if (!strcmp("nvidia_wmi_ec", acpi_video_backlight_string)) + acpi_backlight_cmdline = acpi_backlight_nvidia_wmi_ec; + if (!strcmp("apple_gmux", acpi_video_backlight_string)) + acpi_backlight_cmdline = acpi_backlight_apple_gmux; if (!strcmp("none", acpi_video_backlight_string)) acpi_backlight_cmdline = acpi_backlight_none; } @@ -106,26 +110,6 @@ } #endif -static bool apple_gmux_backlight_present(void) -{ - struct acpi_device *adev; - struct device *dev; - - adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1); - if (!adev) - return false; - - dev = acpi_get_first_physical_node(adev); - if (!dev) - return false; - - /* - * drivers/platform/x86/apple-gmux.c only supports old style - * Apple GMUX with an IO-resource. - */ - return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL; -} - /* Force to use vendor driver when the ACPI device is known to be * buggy */ static int video_detect_force_vendor(const struct dmi_system_id *d) @@ -511,6 +495,14 @@ }, { .callback = video_detect_force_native, + /* Acer Aspire 4810T */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4810T"), + }, + }, + { + .callback = video_detect_force_native, /* Acer Aspire 5738z */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Acer"), @@ -598,6 +590,14 @@ }, { .callback = video_detect_force_native, + /* Asus U46E */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "U46E"), + }, + }, + { + .callback = video_detect_force_native, /* Asus UX303UB */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), @@ -606,6 +606,23 @@ }, { .callback = video_detect_force_native, + /* HP EliteBook 8460p */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8460p"), + }, + }, + { + .callback = video_detect_force_native, + /* HP Pavilion g6-1d80nr / B4U19UA */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion g6 Notebook PC"), + DMI_MATCH(DMI_PRODUCT_SKU, "B4U19UA"), + }, + }, + { + .callback = video_detect_force_native, /* Samsung N150P */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), @@ -697,6 +714,13 @@ DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"), }, }, + { + .callback = video_detect_force_native, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 15 3535"), + }, + }, /* * Desktops which falsely report a backlight and which our heuristics @@ -752,6 +776,8 @@ { static DEFINE_MUTEX(init_mutex); static bool nvidia_wmi_ec_present; + static bool apple_gmux_present; + static bool dell_uart_backlight_present; static bool native_available; static bool init_done; static long video_caps; @@ -765,6 +791,8 @@ ACPI_UINT32_MAX, find_video, NULL, &video_caps, NULL); nvidia_wmi_ec_present = nvidia_wmi_ec_supported(); + apple_gmux_present = apple_gmux_detect(NULL, NULL); + dell_uart_backlight_present = acpi_dev_found("DELL0501"); init_done = true; } if (native) @@ -786,9 +814,12 @@ if (nvidia_wmi_ec_present) return acpi_backlight_nvidia_wmi_ec; - if (apple_gmux_backlight_present()) + if (apple_gmux_present) return acpi_backlight_apple_gmux; + if (dell_uart_backlight_present) + return acpi_backlight_native; + /* Use ACPI video if available, except when native should be preferred. */ if ((video_caps & ACPI_VIDEO_BACKLIGHT) && !(native_available && prefer_native_over_acpi_video())) diff -u linux-oem-6.1-6.1.0/drivers/ata/ahci.c linux-oem-6.1-6.1.0/drivers/ata/ahci.c --- linux-oem-6.1-6.1.0/drivers/ata/ahci.c +++ linux-oem-6.1-6.1.0/drivers/ata/ahci.c @@ -422,6 +422,7 @@ { PCI_VDEVICE(INTEL, 0x34d3), board_ahci_low_power }, /* Ice Lake LP AHCI */ { PCI_VDEVICE(INTEL, 0x02d3), board_ahci_low_power }, /* Comet Lake PCH-U AHCI */ { PCI_VDEVICE(INTEL, 0x02d7), board_ahci_low_power }, /* Comet Lake PCH RAID */ + { PCI_VDEVICE(INTEL, 0xa0d3), board_ahci_low_power }, /* Tiger Lake UP{3,4} AHCI */ /* JMicron 360/1/3/5/6, match class to avoid IDE function */ { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, diff -u linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_main.c linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_main.c --- linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_main.c +++ linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_main.c @@ -1816,7 +1816,7 @@ /* THINK if (signal_pending) return ... ? */ - iov_iter_kvec(&msg.msg_iter, WRITE, &iov, 1, size); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iov, 1, size); if (sock == connection->data.socket) { rcu_read_lock(); diff -u linux-oem-6.1-6.1.0/drivers/block/loop.c linux-oem-6.1-6.1.0/drivers/block/loop.c --- linux-oem-6.1-6.1.0/drivers/block/loop.c +++ linux-oem-6.1-6.1.0/drivers/block/loop.c @@ -243,7 +243,7 @@ struct iov_iter i; ssize_t bw; - iov_iter_bvec(&i, WRITE, bvec, 1, bvec->bv_len); + iov_iter_bvec(&i, ITER_SOURCE, bvec, 1, bvec->bv_len); file_start_write(file); bw = vfs_iter_write(file, &i, ppos, 0); @@ -286,7 +286,7 @@ ssize_t len; rq_for_each_segment(bvec, rq, iter) { - iov_iter_bvec(&i, READ, &bvec, 1, bvec.bv_len); + iov_iter_bvec(&i, ITER_DEST, &bvec, 1, bvec.bv_len); len = vfs_iter_read(lo->lo_backing_file, &i, &pos, 0); if (len < 0) return len; @@ -392,7 +392,7 @@ } static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, - loff_t pos, bool rw) + loff_t pos, int rw) { struct iov_iter iter; struct req_iterator rq_iter; @@ -448,7 +448,7 @@ cmd->iocb.ki_flags = IOCB_DIRECT; cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0); - if (rw == WRITE) + if (rw == ITER_SOURCE) ret = call_write_iter(file, &cmd->iocb, &iter); else ret = call_read_iter(file, &cmd->iocb, &iter); @@ -490,12 +490,12 @@ return lo_fallocate(lo, rq, pos, FALLOC_FL_PUNCH_HOLE); case REQ_OP_WRITE: if (cmd->use_aio) - return lo_rw_aio(lo, cmd, pos, WRITE); + return lo_rw_aio(lo, cmd, pos, ITER_SOURCE); else return lo_write_simple(lo, rq, pos); case REQ_OP_READ: if (cmd->use_aio) - return lo_rw_aio(lo, cmd, pos, READ); + return lo_rw_aio(lo, cmd, pos, ITER_DEST); else return lo_read_simple(lo, rq, pos); default: diff -u linux-oem-6.1-6.1.0/drivers/block/nbd.c linux-oem-6.1-6.1.0/drivers/block/nbd.c --- linux-oem-6.1-6.1.0/drivers/block/nbd.c +++ linux-oem-6.1-6.1.0/drivers/block/nbd.c @@ -563,7 +563,7 @@ u32 nbd_cmd_flags = 0; int sent = nsock->sent, skip = 0; - iov_iter_kvec(&from, WRITE, &iov, 1, sizeof(request)); + iov_iter_kvec(&from, ITER_SOURCE, &iov, 1, sizeof(request)); type = req_to_nbd_cmd_type(req); if (type == U32_MAX) @@ -649,7 +649,7 @@ dev_dbg(nbd_to_dev(nbd), "request %p: sending %d bytes data\n", req, bvec.bv_len); - iov_iter_bvec(&from, WRITE, &bvec, 1, bvec.bv_len); + iov_iter_bvec(&from, ITER_SOURCE, &bvec, 1, bvec.bv_len); if (skip) { if (skip >= iov_iter_count(&from)) { skip -= iov_iter_count(&from); @@ -701,7 +701,7 @@ int result; reply->magic = 0; - iov_iter_kvec(&to, READ, &iov, 1, sizeof(*reply)); + iov_iter_kvec(&to, ITER_DEST, &iov, 1, sizeof(*reply)); result = sock_xmit(nbd, index, 0, &to, MSG_WAITALL, NULL); if (result < 0) { if (!nbd_disconnected(nbd->config)) @@ -790,7 +790,7 @@ struct iov_iter to; rq_for_each_segment(bvec, req, iter) { - iov_iter_bvec(&to, READ, &bvec, 1, bvec.bv_len); + iov_iter_bvec(&to, ITER_DEST, &bvec, 1, bvec.bv_len); result = sock_xmit(nbd, index, 0, &to, MSG_WAITALL, NULL); if (result < 0) { dev_err(disk_to_dev(nbd->disk), "Receive data failed (result %d)\n", @@ -1267,7 +1267,7 @@ for (i = 0; i < config->num_connections; i++) { struct nbd_sock *nsock = config->socks[i]; - iov_iter_kvec(&from, WRITE, &iov, 1, sizeof(request)); + iov_iter_kvec(&from, ITER_SOURCE, &iov, 1, sizeof(request)); mutex_lock(&nsock->tx_lock); ret = sock_xmit(nbd, i, 1, &from, 0, NULL); if (ret < 0) diff -u linux-oem-6.1-6.1.0/drivers/block/ublk_drv.c linux-oem-6.1-6.1.0/drivers/block/ublk_drv.c --- linux-oem-6.1-6.1.0/drivers/block/ublk_drv.c +++ linux-oem-6.1-6.1.0/drivers/block/ublk_drv.c @@ -137,7 +137,7 @@ char *__queues; - unsigned short queue_size; + unsigned int queue_size; struct ublksrv_ctrl_dev_info dev_info; struct blk_mq_tag_set tag_set; @@ -2092,13 +2092,12 @@ struct ublk_device *ub; int id; - class_destroy(ublk_chr_class); - - misc_deregister(&ublk_misc); - idr_for_each_entry(&ublk_index_idr, ub, id) ublk_remove(ub); + class_destroy(ublk_chr_class); + misc_deregister(&ublk_misc); + idr_destroy(&ublk_index_idr); unregister_chrdev_region(ublk_chr_devt, UBLK_MINORS); } diff -u linux-oem-6.1-6.1.0/drivers/bluetooth/btusb.c linux-oem-6.1-6.1.0/drivers/bluetooth/btusb.c --- linux-oem-6.1-6.1.0/drivers/bluetooth/btusb.c +++ linux-oem-6.1-6.1.0/drivers/bluetooth/btusb.c @@ -317,6 +317,90 @@ { USB_DEVICE(0x0489, 0xe0d0), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9108), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9109), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9208), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9209), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9308), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9408), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9508), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9509), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9608), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9609), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x10ab, 0x9f09), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3022), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0c7), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0c9), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0ca), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0cb), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0ce), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0de), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0df), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0e1), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0ea), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0ec), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3023), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3024), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3a22), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3a24), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3a26), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3a27), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, /* QCA WCN785x chipset */ { USB_DEVICE(0x0cf3, 0xe700), .driver_info = BTUSB_QCA_WCN6855 | @@ -647,6 +731,7 @@ #define BTUSB_TX_WAIT_VND_EVT 13 #define BTUSB_WAKEUP_AUTOSUSPEND 14 #define BTUSB_USE_ALT3_FOR_WBS 15 +#define BTUSB_ALT6_CONTINUOUS_TX 16 struct btusb_data { struct hci_dev *hdev; @@ -1291,11 +1376,17 @@ static inline void __fill_isoc_descriptor_msbc(struct urb *urb, int len, int mtu, struct btusb_data *data) { - int i, offset = 0; + int i = 0, offset = 0; unsigned int interval; BT_DBG("len %d mtu %d", len, mtu); + /* For mSBC ALT 6 settings some chips need to transmit the data + * continuously without the zero length of USB packets. + */ + if (test_bit(BTUSB_ALT6_CONTINUOUS_TX, &data->flags)) + goto ignore_usb_alt6_packet_flow; + /* For mSBC ALT 6 setting the host will send the packet at continuous * flow. As per core spec 5, vol 4, part B, table 2.1. For ALT setting * 6 the HCI PACKET INTERVAL should be 7.5ms for every usb packets. @@ -1315,6 +1406,7 @@ urb->iso_frame_desc[i].length = offset; } +ignore_usb_alt6_packet_flow: if (len && i < BTUSB_MAX_ISOC_FRAMES) { urb->iso_frame_desc[i].offset = offset; urb->iso_frame_desc[i].length = len; @@ -2336,6 +2428,19 @@ return -EILSEQ; } +static int btusb_setup_realtek(struct hci_dev *hdev) +{ + struct btusb_data *data = hci_get_drvdata(hdev); + int ret; + + ret = btrtl_setup_realtek(hdev); + + if (btrealtek_test_flag(data->hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP)) + set_bit(BTUSB_ALT6_CONTINUOUS_TX, &data->flags); + + return ret; +} + /* UHW CR mapping */ #define MTK_BT_MISC 0x70002510 #define MTK_BT_SUBSYS_RST 0x70002610 @@ -3805,6 +3910,9 @@ /* Override the rx handlers */ data->recv_event = btusb_recv_event_intel; data->recv_bulk = btusb_recv_bulk_intel; + } else if (id->driver_info & BTUSB_REALTEK) { + /* Allocate extra space for Realtek device */ + priv_size += sizeof(struct btrealtek_data); } data->recv_acl = hci_recv_frame; @@ -3973,7 +4081,7 @@ if (IS_ENABLED(CONFIG_BT_HCIBTUSB_RTL) && (id->driver_info & BTUSB_REALTEK)) { - hdev->setup = btrtl_setup_realtek; + hdev->setup = btusb_setup_realtek; hdev->shutdown = btrtl_shutdown_realtek; hdev->cmd_timeout = btusb_rtl_cmd_timeout; diff -u linux-oem-6.1-6.1.0/drivers/bluetooth/hci_qca.c linux-oem-6.1-6.1.0/drivers/bluetooth/hci_qca.c --- linux-oem-6.1-6.1.0/drivers/bluetooth/hci_qca.c +++ linux-oem-6.1-6.1.0/drivers/bluetooth/hci_qca.c @@ -2157,10 +2157,17 @@ int timeout = msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS); struct serdev_device *serdev = to_serdev_device(dev); struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev); + struct hci_uart *hu = &qcadev->serdev_hu; + struct hci_dev *hdev = hu->hdev; + struct qca_data *qca = hu->priv; const u8 ibs_wake_cmd[] = { 0xFD }; const u8 edl_reset_soc_cmd[] = { 0x01, 0x00, 0xFC, 0x01, 0x05 }; if (qcadev->btsoc_type == QCA_QCA6390) { + if (test_bit(QCA_BT_OFF, &qca->flags) || + !test_bit(HCI_RUNNING, &hdev->flags)) + return; + serdev_device_write_flush(serdev); ret = serdev_device_write_buf(serdev, ibs_wake_cmd, sizeof(ibs_wake_cmd)); diff -u linux-oem-6.1-6.1.0/drivers/char/random.c linux-oem-6.1-6.1.0/drivers/char/random.c --- linux-oem-6.1-6.1.0/drivers/char/random.c +++ linux-oem-6.1-6.1.0/drivers/char/random.c @@ -1329,7 +1329,7 @@ return ret; } - ret = import_single_range(READ, ubuf, len, &iov, &iter); + ret = import_single_range(ITER_DEST, ubuf, len, &iov, &iter); if (unlikely(ret)) return ret; return get_random_bytes_user(&iter); @@ -1447,7 +1447,7 @@ return -EINVAL; if (get_user(len, p++)) return -EFAULT; - ret = import_single_range(WRITE, p, len, &iov, &iter); + ret = import_single_range(ITER_SOURCE, p, len, &iov, &iter); if (unlikely(ret)) return ret; ret = write_pool_user(&iter); diff -u linux-oem-6.1-6.1.0/drivers/clk/microchip/clk-mpfs-ccc.c linux-oem-6.1-6.1.0/drivers/clk/microchip/clk-mpfs-ccc.c --- linux-oem-6.1-6.1.0/drivers/clk/microchip/clk-mpfs-ccc.c +++ linux-oem-6.1-6.1.0/drivers/clk/microchip/clk-mpfs-ccc.c @@ -164,12 +164,11 @@ for (unsigned int i = 0; i < num_clks; i++) { struct mpfs_ccc_out_hw_clock *out_hw = &out_hws[i]; - char *name = devm_kzalloc(dev, 23, GFP_KERNEL); + char *name = devm_kasprintf(dev, GFP_KERNEL, "%s_out%u", parent->name, i); if (!name) return -ENOMEM; - snprintf(name, 23, "%s_out%u", parent->name, i); out_hw->divider.hw.init = CLK_HW_INIT_HW(name, &parent->hw, &clk_divider_ops, 0); out_hw->divider.reg = data->pll_base[i / MPFS_CCC_OUTPUTS_PER_PLL] + out_hw->reg_offset; @@ -201,14 +200,13 @@ for (unsigned int i = 0; i < num_clks; i++) { struct mpfs_ccc_pll_hw_clock *pll_hw = &pll_hws[i]; - char *name = devm_kzalloc(dev, 18, GFP_KERNEL); - if (!name) + pll_hw->name = devm_kasprintf(dev, GFP_KERNEL, "ccc%s_pll%u", + strchrnul(dev->of_node->full_name, '@'), i); + if (!pll_hw->name) return -ENOMEM; pll_hw->base = data->pll_base[i]; - snprintf(name, 18, "ccc%s_pll%u", strchrnul(dev->of_node->full_name, '@'), i); - pll_hw->name = (const char *)name; pll_hw->hw.init = CLK_HW_INIT_PARENTS_DATA_FIXED_SIZE(pll_hw->name, pll_hw->parents, &mpfs_ccc_pll_ops, 0); diff -u linux-oem-6.1-6.1.0/drivers/cpufreq/qcom-cpufreq-hw.c linux-oem-6.1-6.1.0/drivers/cpufreq/qcom-cpufreq-hw.c --- linux-oem-6.1-6.1.0/drivers/cpufreq/qcom-cpufreq-hw.c +++ linux-oem-6.1-6.1.0/drivers/cpufreq/qcom-cpufreq-hw.c @@ -137,21 +137,6 @@ return lval * xo_rate; } -/* Get the current frequency of the CPU (after throttling) */ -static unsigned int qcom_cpufreq_hw_get(unsigned int cpu) -{ - struct qcom_cpufreq_data *data; - struct cpufreq_policy *policy; - - policy = cpufreq_cpu_get_raw(cpu); - if (!policy) - return 0; - - data = policy->driver_data; - - return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ; -} - /* Get the frequency requested by the cpufreq core for the CPU */ static unsigned int qcom_cpufreq_get_freq(unsigned int cpu) { @@ -173,6 +158,23 @@ return policy->freq_table[index].frequency; } +static unsigned int qcom_cpufreq_hw_get(unsigned int cpu) +{ + struct qcom_cpufreq_data *data; + struct cpufreq_policy *policy; + + policy = cpufreq_cpu_get_raw(cpu); + if (!policy) + return 0; + + data = policy->driver_data; + + if (data->throttle_irq >= 0) + return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ; + + return qcom_cpufreq_get_freq(cpu); +} + static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq) { diff -u linux-oem-6.1-6.1.0/drivers/cxl/core/region.c linux-oem-6.1-6.1.0/drivers/cxl/core/region.c --- linux-oem-6.1-6.1.0/drivers/cxl/core/region.c +++ linux-oem-6.1-6.1.0/drivers/cxl/core/region.c @@ -131,7 +131,7 @@ struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); struct cxl_port *iter = cxled_to_port(cxled); struct cxl_ep *ep; - int rc; + int rc = 0; while (!is_cxl_root(to_cxl_port(iter->dev.parent))) iter = to_cxl_port(iter->dev.parent); @@ -143,7 +143,8 @@ cxl_rr = cxl_rr_load(iter, cxlr); cxld = cxl_rr->decoder; - rc = cxld->reset(cxld); + if (cxld->reset) + rc = cxld->reset(cxld); if (rc) return rc; } @@ -186,7 +187,8 @@ iter = ep->next, ep = cxl_ep_load(iter, cxlmd)) { cxl_rr = cxl_rr_load(iter, cxlr); cxld = cxl_rr->decoder; - cxld->reset(cxld); + if (cxld->reset) + cxld->reset(cxld); } cxled->cxld.reset(&cxled->cxld); @@ -991,10 +993,10 @@ int i, distance; /* - * Passthrough ports impose no distance requirements between + * Passthrough decoders impose no distance requirements between * peers */ - if (port->nr_dports == 1) + if (cxl_rr->nr_targets == 1) distance = 0; else distance = p->nr_targets / cxl_rr->nr_targets; diff -u linux-oem-6.1-6.1.0/drivers/firmware/efi/efi.c linux-oem-6.1-6.1.0/drivers/firmware/efi/efi.c --- linux-oem-6.1-6.1.0/drivers/firmware/efi/efi.c +++ linux-oem-6.1-6.1.0/drivers/firmware/efi/efi.c @@ -375,8 +375,8 @@ efi_kobj = kobject_create_and_add("efi", firmware_kobj); if (!efi_kobj) { pr_err("efi: Firmware registration failed.\n"); - destroy_workqueue(efi_rts_wq); - return -ENOMEM; + error = -ENOMEM; + goto err_destroy_wq; } if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE | @@ -424,7 +424,10 @@ generic_ops_unregister(); err_put: kobject_put(efi_kobj); - destroy_workqueue(efi_rts_wq); +err_destroy_wq: + if (efi_rts_wq) + destroy_workqueue(efi_rts_wq); + return error; } @@ -1043,6 +1046,8 @@ /* first try to find a slot in an existing linked list entry */ for (prsv = efi_memreserve_root->next; prsv; ) { rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); + if (!rsv) + return -ENOMEM; index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); if (index < rsv->size) { rsv->entry[index].base = addr; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -2130,7 +2130,7 @@ } amdgpu_amdkfd_remove_eviction_fence( - bo, bo->kfd_bo->process_info->eviction_fence); + bo, bo->vm_bo->vm->process_info->eviction_fence); amdgpu_bo_unreserve(bo); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4248,6 +4248,9 @@ #endif adev->in_suspend = false; + if (adev->enable_mes) + amdgpu_mes_self_test(adev); + if (amdgpu_acpi_smart_shift_update(dev, AMDGPU_SS_DEV_D0)) DRM_WARN("smart shift update failed\n"); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -468,8 +468,9 @@ return true; fail: - DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size, - man->size); + if (man) + DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size, + man->size); return false; } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c @@ -192,7 +192,6 @@ mes_add_queue_pkt.trap_handler_addr = input->tba_addr; mes_add_queue_pkt.tma_addr = input->tma_addr; mes_add_queue_pkt.is_kfd_process = input->is_kfd_process; - mes_add_queue_pkt.trap_en = 1; /* For KFD, gds_size is re-used for queue size (needed in MES for AQL queues) */ mes_add_queue_pkt.is_aql_queue = input->is_aql_queue; @@ -1340,7 +1339,7 @@ struct amdgpu_device *adev = (struct amdgpu_device *)handle; /* it's only intended for use in mes_self_test case, not for s0ix and reset */ - if (!amdgpu_in_reset(adev) && !adev->in_s0ix && + if (!amdgpu_in_reset(adev) && !adev->in_s0ix && !adev->in_suspend && (adev->ip_versions[GC_HWIP][0] != IP_VERSION(11, 0, 3))) amdgpu_mes_self_test(adev); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/soc21.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/soc21.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/soc21.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/soc21.c @@ -322,8 +322,10 @@ switch (adev->ip_versions[MP1_HWIP][0]) { case IP_VERSION(13, 0, 0): case IP_VERSION(13, 0, 7): + case IP_VERSION(13, 0, 10): return AMD_RESET_METHOD_MODE1; case IP_VERSION(13, 0, 4): + case IP_VERSION(13, 0, 11): return AMD_RESET_METHOD_MODE2; default: if (amdgpu_dpm_is_baco_supported(adev)) @@ -641,7 +643,8 @@ AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS | AMD_CG_SUPPORT_REPEATER_FGCG | - AMD_CG_SUPPORT_GFX_MGCG; + AMD_CG_SUPPORT_GFX_MGCG | + AMD_CG_SUPPORT_HDP_SD; adev->pg_flags = AMD_PG_SUPPORT_VCN | AMD_PG_SUPPORT_VCN_DPG | AMD_PG_SUPPORT_JPEG; @@ -652,6 +655,32 @@ } adev->external_rev_id = adev->rev_id + 0x20; break; + case IP_VERSION(11, 0, 4): + adev->cg_flags = + AMD_CG_SUPPORT_GFX_CGCG | + AMD_CG_SUPPORT_GFX_CGLS | + AMD_CG_SUPPORT_GFX_MGCG | + AMD_CG_SUPPORT_GFX_FGCG | + AMD_CG_SUPPORT_REPEATER_FGCG | + AMD_CG_SUPPORT_GFX_PERF_CLK | + AMD_CG_SUPPORT_MC_MGCG | + AMD_CG_SUPPORT_MC_LS | + AMD_CG_SUPPORT_HDP_MGCG | + AMD_CG_SUPPORT_HDP_LS | + AMD_CG_SUPPORT_ATHUB_MGCG | + AMD_CG_SUPPORT_ATHUB_LS | + AMD_CG_SUPPORT_IH_CG | + AMD_CG_SUPPORT_BIF_MGCG | + AMD_CG_SUPPORT_BIF_LS | + AMD_CG_SUPPORT_VCN_MGCG | + AMD_CG_SUPPORT_JPEG_MGCG; + adev->pg_flags = AMD_PG_SUPPORT_VCN | + AMD_PG_SUPPORT_VCN_DPG | + AMD_PG_SUPPORT_GFX_PG | + AMD_PG_SUPPORT_JPEG; + adev->external_rev_id = adev->rev_id + 0x1; + break; + default: /* FIXME: not supported yet */ return -EINVAL; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1193,24 +1193,38 @@ memset(pa_config, 0, sizeof(*pa_config)); - logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18; - pt_base = amdgpu_gmc_pd_addr(adev->gart.bo); - - if (adev->apu_flags & AMD_APU_IS_RAVEN2) - /* - * Raven2 has a HW issue that it is unable to use the vram which - * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the - * workaround that increase system aperture high address (add 1) - * to get rid of the VM fault and hardware hang. - */ - logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18); - else - logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18; - agp_base = 0; agp_bot = adev->gmc.agp_start >> 24; agp_top = adev->gmc.agp_end >> 24; + /* AGP aperture is disabled */ + if (agp_bot == agp_top) { + logical_addr_low = adev->gmc.vram_start >> 18; + if (adev->apu_flags & AMD_APU_IS_RAVEN2) + /* + * Raven2 has a HW issue that it is unable to use the vram which + * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the + * workaround that increase system aperture high address (add 1) + * to get rid of the VM fault and hardware hang. + */ + logical_addr_high = (adev->gmc.fb_end >> 18) + 0x1; + else + logical_addr_high = adev->gmc.vram_end >> 18; + } else { + logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18; + if (adev->apu_flags & AMD_APU_IS_RAVEN2) + /* + * Raven2 has a HW issue that it is unable to use the vram which + * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the + * workaround that increase system aperture high address (add 1) + * to get rid of the VM fault and hardware hang. + */ + logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18); + else + logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18; + } + + pt_base = amdgpu_gmc_pd_addr(adev->gart.bo); page_table_start.high_part = (u32)(adev->gmc.gart_start >> 44) & 0xF; page_table_start.low_part = (u32)(adev->gmc.gart_start >> 12); @@ -1512,8 +1526,6 @@ case IP_VERSION(3, 0, 1): case IP_VERSION(3, 1, 2): case IP_VERSION(3, 1, 3): - case IP_VERSION(3, 1, 4): - case IP_VERSION(3, 1, 5): case IP_VERSION(3, 1, 6): init_data.flags.gpu_vm_support = true; break; @@ -1739,10 +1751,6 @@ adev->dm.vblank_control_workqueue = NULL; } - for (i = 0; i < adev->dm.display_indexes_num; i++) { - drm_encoder_cleanup(&adev->dm.mst_encoders[i].base); - } - amdgpu_dm_destroy_drm_device(&adev->dm); #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) @@ -4518,6 +4526,17 @@ static int dm_early_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + struct amdgpu_mode_info *mode_info = &adev->mode_info; + struct atom_context *ctx = mode_info->atom_context; + int index = GetIndexIntoMasterTable(DATA, Object_Header); + u16 data_offset; + + /* if there is no object header, skip DM */ + if (!amdgpu_atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset)) { + adev->harvest_ip_mask |= AMD_HARVEST_IP_DMU_MASK; + dev_info(adev->dev, "No object header, skipping DM\n"); + return -ENOENT; + } switch (adev->asic_type) { #if defined(CONFIG_DRM_AMD_DC_SI) @@ -5283,8 +5302,6 @@ timing_out->aspect_ratio = get_aspect_ratio(mode_in); - stream->output_color_space = get_output_color_space(timing_out); - stream->out_transfer_func->type = TF_TYPE_PREDEFINED; stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { @@ -5295,6 +5312,8 @@ adjust_colour_depth_from_display_info(timing_out, info); } } + + stream->output_color_space = get_output_color_space(timing_out); } static void fill_audio_info(struct audio_info *audio_info, @@ -8790,6 +8809,13 @@ if (!dm_old_crtc_state->stream) goto skip_modeset; + /* Unset freesync video if it was active before */ + if (dm_old_crtc_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED) { + dm_new_crtc_state->freesync_config.state = VRR_STATE_INACTIVE; + dm_new_crtc_state->freesync_config.fixed_refresh_in_uhz = 0; + } + + /* Now check if we should set freesync video mode */ if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream && is_timing_unchanged_for_freesync(new_crtc_state, old_crtc_state)) { @@ -9406,6 +9432,8 @@ bool lock_and_validation_needed = false; struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state; #if defined(CONFIG_DRM_AMD_DC_DCN) + struct drm_dp_mst_topology_mgr *mgr; + struct drm_dp_mst_topology_state *mst_state; struct dsc_mst_fairness_vars vars[MAX_PIPES]; #endif @@ -9433,8 +9461,8 @@ goto fail; } - if (dm_old_con_state->abm_level != - dm_new_con_state->abm_level) + if (dm_old_con_state->abm_level != dm_new_con_state->abm_level || + dm_old_con_state->scaling != dm_new_con_state->scaling) new_crtc_state->connectors_changed = true; } @@ -9528,7 +9556,11 @@ * `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in * atomic state, so call drm helper to normalize zpos. */ - drm_atomic_normalize_zpos(dev, state); + ret = drm_atomic_normalize_zpos(dev, state); + if (ret) { + drm_dbg(dev, "drm_atomic_normalize_zpos() failed\n"); + goto fail; + } /* Remove exiting planes if they are modified */ for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) { @@ -9654,6 +9686,28 @@ lock_and_validation_needed = true; } +#if defined(CONFIG_DRM_AMD_DC_DCN) + /* set the slot info for each mst_state based on the link encoding format */ + for_each_new_mst_mgr_in_state(state, mgr, mst_state, i) { + struct amdgpu_dm_connector *aconnector; + struct drm_connector *connector; + struct drm_connector_list_iter iter; + u8 link_coding_cap; + + drm_connector_list_iter_begin(dev, &iter); + drm_for_each_connector_iter(connector, &iter) { + if (connector->index == mst_state->mgr->conn_base_id) { + aconnector = to_amdgpu_dm_connector(connector); + link_coding_cap = dc_link_dp_mst_decide_link_encoding_format(aconnector->dc_link); + drm_dp_mst_update_slots(mst_state, link_coding_cap); + + break; + } + } + drm_connector_list_iter_end(&iter); + } +#endif + /** * Streams and planes are reset when there are changes that affect * bandwidth. Anything that affects bandwidth needs to go through diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -120,23 +120,50 @@ } static void -fill_dc_mst_payload_table_from_drm(struct drm_dp_mst_topology_state *mst_state, - struct amdgpu_dm_connector *aconnector, +fill_dc_mst_payload_table_from_drm(struct dc_link *link, + bool enable, + struct drm_dp_mst_atomic_payload *target_payload, struct dc_dp_mst_stream_allocation_table *table) { struct dc_dp_mst_stream_allocation_table new_table = { 0 }; struct dc_dp_mst_stream_allocation *sa; - struct drm_dp_mst_atomic_payload *payload; + struct link_mst_stream_allocation_table copy_of_link_table = + link->mst_stream_alloc_table; + + int i; + int current_hw_table_stream_cnt = copy_of_link_table.stream_count; + struct link_mst_stream_allocation *dc_alloc; + + /* TODO: refactor to set link->mst_stream_alloc_table directly if possible.*/ + if (enable) { + dc_alloc = + ©_of_link_table.stream_allocations[current_hw_table_stream_cnt]; + dc_alloc->vcp_id = target_payload->vcpi; + dc_alloc->slot_count = target_payload->time_slots; + } else { + for (i = 0; i < copy_of_link_table.stream_count; i++) { + dc_alloc = + ©_of_link_table.stream_allocations[i]; + + if (dc_alloc->vcp_id == target_payload->vcpi) { + dc_alloc->vcp_id = 0; + dc_alloc->slot_count = 0; + break; + } + } + ASSERT(i != copy_of_link_table.stream_count); + } /* Fill payload info*/ - list_for_each_entry(payload, &mst_state->payloads, next) { - if (payload->delete) - continue; - - sa = &new_table.stream_allocations[new_table.stream_count]; - sa->slot_count = payload->time_slots; - sa->vcp_id = payload->vcpi; - new_table.stream_count++; + for (i = 0; i < MAX_CONTROLLER_NUM; i++) { + dc_alloc = + ©_of_link_table.stream_allocations[i]; + if (dc_alloc->vcp_id > 0 && dc_alloc->slot_count > 0) { + sa = &new_table.stream_allocations[new_table.stream_count]; + sa->slot_count = dc_alloc->slot_count; + sa->vcp_id = dc_alloc->vcp_id; + new_table.stream_count++; + } } /* Overwrite the old table */ @@ -185,7 +212,7 @@ * AUX message. The sequence is slot 1-63 allocated sequence for each * stream. AMD ASIC stream slot allocation should follow the same * sequence. copy DRM MST allocation to dc */ - fill_dc_mst_payload_table_from_drm(mst_state, aconnector, proposed_table); + fill_dc_mst_payload_table_from_drm(stream->link, enable, payload, proposed_table); return true; } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -3612,7 +3612,7 @@ (int)hubp->curs_attr.width || pos_cpy.x <= (int)hubp->curs_attr.width + pipe_ctx->plane_state->src_rect.x) { - pos_cpy.x = temp_x + viewport_width; + pos_cpy.x = 2 * viewport_width - temp_x; } } } else { diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c @@ -1919,8 +1919,9 @@ timing = &pipe->stream->timing; pipes[pipe_cnt].pipe.src.gpuvm = true; - pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0; - pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0; + DC_FP_START(); + dcn32_zero_pipe_dcc_fraction(pipes, pipe_cnt); + DC_FP_END(); pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch; pipes[pipe_cnt].pipe.src.gpuvm_min_page_size_kbytes = 256; // according to spreadsheet pipes[pipe_cnt].pipe.src.unbounded_req_mode = false; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -2548,0 +2549,8 @@ +void dcn32_zero_pipe_dcc_fraction(display_e2e_pipe_params_st *pipes, + int pipe_cnt) +{ + dc_assert_fp_enabled(); + + pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_luma = 0; + pipes[pipe_cnt].pipe.src.dcc_fraction_of_zs_req_chroma = 0; +} reverted: --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +++ linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c @@ -67,22 +67,21 @@ int vega10_fan_ctrl_get_fan_speed_pwm(struct pp_hwmgr *hwmgr, uint32_t *speed) { + struct amdgpu_device *adev = hwmgr->adev; + uint32_t duty100, duty; + uint64_t tmp64; - uint32_t current_rpm; - uint32_t percent = 0; + duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1), + CG_FDO_CTRL1, FMAX_DUTY100); + duty = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_THERMAL_STATUS), + CG_THERMAL_STATUS, FDO_PWM_DUTY); - if (hwmgr->thermal_controller.fanInfo.bNoFan) - return 0; + if (!duty100) + return -EINVAL; - if (vega10_get_current_rpm(hwmgr, ¤t_rpm)) - return -1; + tmp64 = (uint64_t)duty * 255; + do_div(tmp64, duty100); + *speed = MIN((uint32_t)tmp64, 255); - if (hwmgr->thermal_controller. - advanceFanControlParameters.usMaxFanRPM != 0) - percent = current_rpm * 255 / - hwmgr->thermal_controller. - advanceFanControlParameters.usMaxFanRPM; - - *speed = MIN(percent, 255); return 0; } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h @@ -123,7 +123,8 @@ (1 << FEATURE_DS_FCLK_BIT) | \ (1 << FEATURE_DS_LCLK_BIT) | \ (1 << FEATURE_DS_DCFCLK_BIT) | \ - (1 << FEATURE_DS_UCLK_BIT)) + (1 << FEATURE_DS_UCLK_BIT) | \ + (1ULL << FEATURE_DS_VCN_BIT)) //For use with feature control messages typedef enum { @@ -522,9 +523,9 @@ TEMP_HOTSPOT_M, TEMP_MEM, TEMP_VR_GFX, - TEMP_VR_SOC, TEMP_VR_MEM0, TEMP_VR_MEM1, + TEMP_VR_SOC, TEMP_VR_U, TEMP_LIQUID0, TEMP_LIQUID1, diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -28,11 +28,11 @@ #define SMU13_DRIVER_IF_VERSION_INV 0xFFFFFFFF #define SMU13_DRIVER_IF_VERSION_YELLOW_CARP 0x04 #define SMU13_DRIVER_IF_VERSION_ALDE 0x08 -#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_0 0x34 +#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_0 0x37 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x07 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_10 0x32 -#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x35 +#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x37 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_10 0x1D #define SMU13_MODE1_RESET_WAIT_TIME_IN_MS 500 //500ms @@ -273,6 +273,9 @@ int smu_v13_0_run_btc(struct smu_context *smu); +int smu_v13_0_gpo_control(struct smu_context *smu, + bool enablement); + int smu_v13_0_deep_sleep_control(struct smu_context *smu, bool enablement); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -250,6 +250,7 @@ switch (adev->ip_versions[MP1_HWIP][0]) { case IP_VERSION(13, 0, 4): + case IP_VERSION(13, 0, 11): mp1_fw_flags = RREG32_PCIE(MP1_Public | (smnMP1_V13_0_4_FIRMWARE_FLAGS & 0xffffffff)); break; @@ -303,6 +304,7 @@ smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_YELLOW_CARP; break; case IP_VERSION(13, 0, 4): + case IP_VERSION(13, 0, 11): smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_SMU_V13_0_4; break; case IP_VERSION(13, 0, 5): @@ -843,6 +845,7 @@ case IP_VERSION(13, 0, 7): case IP_VERSION(13, 0, 8): case IP_VERSION(13, 0, 10): + case IP_VERSION(13, 0, 11): if (!(adev->pm.pp_feature & PP_GFXOFF_MASK)) return 0; if (enable) @@ -1258,7 +1261,8 @@ uint32_t speed) { struct amdgpu_device *adev = smu->adev; - uint32_t tach_period, crystal_clock_freq; + uint32_t crystal_clock_freq = 2500; + uint32_t tach_period; int ret; if (!speed) @@ -1268,7 +1272,6 @@ if (ret) return ret; - crystal_clock_freq = amdgpu_asic_get_xclk(adev); tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed); WREG32_SOC15(THM, 0, regCG_TACH_CTRL, REG_SET_FIELD(RREG32_SOC15(THM, 0, regCG_TACH_CTRL), @@ -2148,6 +2151,21 @@ return res; } +int smu_v13_0_gpo_control(struct smu_context *smu, + bool enablement) +{ + int res; + + res = smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_AllowGpo, + enablement ? 1 : 0, + NULL); + if (res) + dev_err(smu->adev->dev, "SetGpoAllow %d failed!\n", enablement); + + return res; +} + int smu_v13_0_deep_sleep_control(struct smu_context *smu, bool enablement) { @@ -2249,6 +2267,10 @@ !smu_baco->platform_support) return false; + /* return true if ASIC is in BACO state already */ + if (smu_v13_0_baco_get_state(smu) == SMU_BACO_STATE_ENTER) + return true; + if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT) && !smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) return false; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -70,6 +70,26 @@ #define MP0_MP1_DATA_REGION_SIZE_COMBOPPTABLE 0x4000 +#define mmMP1_SMN_C2PMSG_66 0x0282 +#define mmMP1_SMN_C2PMSG_66_BASE_IDX 0 + +#define mmMP1_SMN_C2PMSG_82 0x0292 +#define mmMP1_SMN_C2PMSG_82_BASE_IDX 0 + +#define mmMP1_SMN_C2PMSG_90 0x029a +#define mmMP1_SMN_C2PMSG_90_BASE_IDX 0 + +#define mmMP1_SMN_C2PMSG_75 0x028b +#define mmMP1_SMN_C2PMSG_75_BASE_IDX 0 + +#define mmMP1_SMN_C2PMSG_53 0x0275 +#define mmMP1_SMN_C2PMSG_53_BASE_IDX 0 + +#define mmMP1_SMN_C2PMSG_54 0x0276 +#define mmMP1_SMN_C2PMSG_54_BASE_IDX 0 + +#define DEBUGSMC_MSG_Mode1Reset 2 + static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] = { MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1), MSG_MAP(GetSmuVersion, PPSMC_MSG_GetSmuVersion, 1), @@ -121,6 +141,11 @@ MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), + MSG_MAP(SetNumBadMemoryPagesRetired, PPSMC_MSG_SetNumBadMemoryPagesRetired, 0), + MSG_MAP(SetBadMemoryPagesRetiredFlagsPerChannel, + PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel, 0), + MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0), + MSG_MAP(AllowIHHostInterrupt, PPSMC_MSG_AllowIHHostInterrupt, 0), }; static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = { @@ -189,6 +214,7 @@ FEA_MAP(SOC_PCC), [SMU_FEATURE_DPM_VCLK_BIT] = {1, FEATURE_MM_DPM_BIT}, [SMU_FEATURE_DPM_DCLK_BIT] = {1, FEATURE_MM_DPM_BIT}, + [SMU_FEATURE_PPT_BIT] = {1, FEATURE_THROTTLERS_BIT}, }; static struct cmn2asic_mapping smu_v13_0_0_table_map[SMU_TABLE_COUNT] = { @@ -381,6 +407,9 @@ struct amdgpu_device *adev = smu->adev; int ret = 0; + if (amdgpu_sriov_vf(smu->adev)) + return 0; + ret = smu_v13_0_0_get_pptable_from_pmfw(smu, &smu_table->power_play_table, &smu_table->power_play_table_size); @@ -1231,6 +1260,9 @@ table_context->power_play_table; PPTable_t *pptable = smu->smu_table.driver_pptable; + if (amdgpu_sriov_vf(smu->adev)) + return 0; + if (!range) return -EINVAL; @@ -1878,6 +1910,69 @@ NULL); } +static int smu_v13_0_0_mode1_reset(struct smu_context *smu) +{ + int ret; + struct amdgpu_device *adev = smu->adev; + + if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 10)) + ret = smu_cmn_send_debug_smc_msg(smu, DEBUGSMC_MSG_Mode1Reset); + else + ret = smu_cmn_send_smc_msg(smu, SMU_MSG_Mode1Reset, NULL); + + if (!ret) + msleep(SMU13_MODE1_RESET_WAIT_TIME_IN_MS); + + return ret; +} + +static void smu_v13_0_0_set_smu_mailbox_registers(struct smu_context *smu) +{ + struct amdgpu_device *adev = smu->adev; + + smu->param_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_82); + smu->msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_66); + smu->resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90); + + smu->debug_param_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_53); + smu->debug_msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_75); + smu->debug_resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_54); +} + +static int smu_v13_0_0_smu_send_bad_mem_page_num(struct smu_context *smu, + uint32_t size) +{ + int ret = 0; + + /* message SMU to update the bad page number on SMUBUS */ + ret = smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_SetNumBadMemoryPagesRetired, + size, NULL); + if (ret) + dev_err(smu->adev->dev, + "[%s] failed to message SMU to update bad memory pages number\n", + __func__); + + return ret; +} + +static int smu_v13_0_0_send_bad_mem_channel_flag(struct smu_context *smu, + uint32_t size) +{ + int ret = 0; + + /* message SMU to update the bad channel info on SMUBUS */ + ret = smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_SetBadMemoryPagesRetiredFlagsPerChannel, + size, NULL); + if (ret) + dev_err(smu->adev->dev, + "[%s] failed to message SMU to update bad memory pages channel info\n", + __func__); + + return ret; +} + static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table, @@ -1945,9 +2040,12 @@ .baco_enter = smu_v13_0_0_baco_enter, .baco_exit = smu_v13_0_0_baco_exit, .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported, - .mode1_reset = smu_v13_0_mode1_reset, + .mode1_reset = smu_v13_0_0_mode1_reset, .set_mp1_state = smu_v13_0_0_set_mp1_state, .set_df_cstate = smu_v13_0_0_set_df_cstate, + .send_hbm_bad_pages_num = smu_v13_0_0_smu_send_bad_mem_page_num, + .send_hbm_bad_channel_flag = smu_v13_0_0_send_bad_mem_channel_flag, + .gpo_control = smu_v13_0_gpo_control, }; void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu) @@ -1961,3 +2059,3 @@ smu->workload_map = smu_v13_0_0_workload_map; - smu_v13_0_set_smu_mailbox_registers(smu); + smu_v13_0_0_set_smu_mailbox_registers(smu); } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c @@ -123,6 +123,8 @@ MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0), MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), + MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0), + MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0), }; static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = { @@ -191,6 +193,7 @@ FEA_MAP(SOC_PCC), [SMU_FEATURE_DPM_VCLK_BIT] = {1, FEATURE_MM_DPM_BIT}, [SMU_FEATURE_DPM_DCLK_BIT] = {1, FEATURE_MM_DPM_BIT}, + [SMU_FEATURE_PPT_BIT] = {1, FEATURE_THROTTLERS_BIT}, }; static struct cmn2asic_mapping smu_v13_0_7_table_map[SMU_TABLE_COUNT] = { @@ -1711,6 +1714,7 @@ .mode1_reset = smu_v13_0_mode1_reset, .set_mp1_state = smu_v13_0_7_set_mp1_state, .set_df_cstate = smu_v13_0_7_set_df_cstate, + .gpo_control = smu_v13_0_gpo_control, }; void smu_v13_0_7_set_ppt_funcs(struct smu_context *smu) diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_edid.c linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_edid.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_edid.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_edid.c @@ -5827,7 +5827,8 @@ else if (hf_scds[11] & DRM_EDID_DSC_10BPC) hdmi_dsc->bpc_supported = 10; else - hdmi_dsc->bpc_supported = 0; + /* Supports min 8 BPC if DSC 1.2 is supported*/ + hdmi_dsc->bpc_supported = 8; dsc_max_frl_rate = (hf_scds[12] & DRM_EDID_DSC_MAX_FRL_RATE_MASK) >> 4; drm_get_max_frl_rate(dsc_max_frl_rate, &hdmi_dsc->max_lanes, diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/etnaviv/etnaviv_mmu.c linux-oem-6.1-6.1.0/drivers/gpu/drm/etnaviv/etnaviv_mmu.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/etnaviv/etnaviv_mmu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/etnaviv/etnaviv_mmu.c @@ -80,10 +80,10 @@ return -EINVAL; for_each_sgtable_dma_sg(sgt, sg, i) { - u32 pa = sg_dma_address(sg) - sg->offset; + phys_addr_t pa = sg_dma_address(sg) - sg->offset; size_t bytes = sg_dma_len(sg) + sg->offset; - VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes); + VERB("map[%d]: %08x %pap(%zx)", i, iova, &pa, bytes); ret = etnaviv_context_map(context, da, pa, bytes, prot); if (ret) diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_bios.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_bios.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_bios.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_bios.c @@ -2467,6 +2467,22 @@ dvo_port); } +static enum port +dsi_dvo_port_to_port(struct drm_i915_private *i915, u8 dvo_port) +{ + switch (dvo_port) { + case DVO_PORT_MIPIA: + return PORT_A; + case DVO_PORT_MIPIC: + if (DISPLAY_VER(i915) >= 11) + return PORT_B; + else + return PORT_C; + default: + return PORT_NONE; + } +} + static int parse_bdb_230_dp_max_link_rate(const int vbt_max_link_rate) { switch (vbt_max_link_rate) { @@ -3434,19 +3450,16 @@ dvo_port = child->dvo_port; - if (dvo_port == DVO_PORT_MIPIA || - (dvo_port == DVO_PORT_MIPIB && DISPLAY_VER(i915) >= 11) || - (dvo_port == DVO_PORT_MIPIC && DISPLAY_VER(i915) < 11)) { - if (port) - *port = dvo_port - DVO_PORT_MIPIA; - return true; - } else if (dvo_port == DVO_PORT_MIPIB || - dvo_port == DVO_PORT_MIPIC || - dvo_port == DVO_PORT_MIPID) { + if (dsi_dvo_port_to_port(i915, dvo_port) == PORT_NONE) { drm_dbg_kms(&i915->drm, "VBT has unsupported DSI port %c\n", port_name(dvo_port - DVO_PORT_MIPIA)); + continue; } + + if (port) + *port = dsi_dvo_port_to_port(i915, dvo_port); + return true; } return false; @@ -3531,7 +3544,7 @@ if (!(child->device_type & DEVICE_TYPE_MIPI_OUTPUT)) continue; - if (child->dvo_port - DVO_PORT_MIPIA == encoder->port) { + if (dsi_dvo_port_to_port(i915, child->dvo_port) == encoder->port) { if (!devdata->dsc) return false; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_display_types.h linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_display_types.h --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_display_types.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1612,6 +1612,8 @@ bool psr2_sel_fetch_cff_enabled; bool req_psr2_sdp_prior_scanline; u8 sink_sync_latency; + u8 io_wake_lines; + u8 fast_wake_lines; ktime_t last_entry_attempt; ktime_t last_exit; bool sink_not_reliable; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dp.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dp.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dp.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dp.c @@ -4410,7 +4410,7 @@ return is_connected; } -static struct edid * +struct edid * intel_dp_get_edid(struct intel_dp *intel_dp) { struct intel_connector *intel_connector = intel_dp->attached_connector; @@ -5226,9 +5226,7 @@ intel_bios_init_panel_late(dev_priv, &intel_connector->panel, encoder->devdata, IS_ERR(edid) ? NULL : edid); - intel_panel_add_edid_fixed_modes(intel_connector, - intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE || - intel_vrr_is_capable(intel_connector)); + intel_panel_add_edid_fixed_modes(intel_connector, true); /* MSO requires information from the EDID */ intel_edp_mso_init(intel_dp); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_panel.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_panel.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_panel.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_panel.c @@ -85,9 +85,10 @@ static bool is_alt_fixed_mode(const struct drm_display_mode *mode, const struct drm_display_mode *preferred_mode) { - return drm_mode_match(mode, preferred_mode, - DRM_MODE_MATCH_FLAGS | - DRM_MODE_MATCH_3D_FLAGS) && + u32 sync_flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NHSYNC | + DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC; + + return (mode->flags & ~sync_flags) == (preferred_mode->flags & ~sync_flags) && mode->hdisplay == preferred_mode->hdisplay && mode->vdisplay == preferred_mode->vdisplay; } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_psr.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_psr.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_psr.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_psr.c @@ -23,6 +23,7 @@ #include #include +#include #include "display/intel_dp.h" @@ -542,6 +543,14 @@ val |= EDP_PSR2_FRAME_BEFORE_SU(max_t(u8, intel_dp->psr.sink_sync_latency + 1, 2)); val |= intel_psr2_get_tp_time(intel_dp); + if (DISPLAY_VER(dev_priv) >= 12) { + if (intel_dp->psr.io_wake_lines < 9 && + intel_dp->psr.fast_wake_lines < 9) + val |= TGL_EDP_PSR2_BLOCK_COUNT_NUM_2; + else + val |= TGL_EDP_PSR2_BLOCK_COUNT_NUM_3; + } + /* Wa_22012278275:adl-p */ if (IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_E0)) { static const u8 map[] = { @@ -558,31 +567,21 @@ * Still using the default IO_BUFFER_WAKE and FAST_WAKE, see * comments bellow for more information */ - u32 tmp, lines = 7; + u32 tmp; - val |= TGL_EDP_PSR2_BLOCK_COUNT_NUM_2; - - tmp = map[lines - TGL_EDP_PSR2_IO_BUFFER_WAKE_MIN_LINES]; + tmp = map[intel_dp->psr.io_wake_lines - TGL_EDP_PSR2_IO_BUFFER_WAKE_MIN_LINES]; tmp = tmp << TGL_EDP_PSR2_IO_BUFFER_WAKE_SHIFT; val |= tmp; - tmp = map[lines - TGL_EDP_PSR2_FAST_WAKE_MIN_LINES]; + tmp = map[intel_dp->psr.fast_wake_lines - TGL_EDP_PSR2_FAST_WAKE_MIN_LINES]; tmp = tmp << TGL_EDP_PSR2_FAST_WAKE_MIN_SHIFT; val |= tmp; } else if (DISPLAY_VER(dev_priv) >= 12) { - /* - * TODO: 7 lines of IO_BUFFER_WAKE and FAST_WAKE are default - * values from BSpec. In order to setting an optimal power - * consumption, lower than 4k resolution mode needs to decrease - * IO_BUFFER_WAKE and FAST_WAKE. And higher than 4K resolution - * mode needs to increase IO_BUFFER_WAKE and FAST_WAKE. - */ - val |= TGL_EDP_PSR2_BLOCK_COUNT_NUM_2; - val |= TGL_EDP_PSR2_IO_BUFFER_WAKE(7); - val |= TGL_EDP_PSR2_FAST_WAKE(7); + val |= TGL_EDP_PSR2_IO_BUFFER_WAKE(intel_dp->psr.io_wake_lines); + val |= TGL_EDP_PSR2_FAST_WAKE(intel_dp->psr.fast_wake_lines); } else if (DISPLAY_VER(dev_priv) >= 9) { - val |= EDP_PSR2_IO_BUFFER_WAKE(7); - val |= EDP_PSR2_FAST_WAKE(7); + val |= EDP_PSR2_IO_BUFFER_WAKE(intel_dp->psr.io_wake_lines); + val |= EDP_PSR2_FAST_WAKE(intel_dp->psr.fast_wake_lines); } if (intel_dp->psr.req_psr2_sdp_prior_scanline) @@ -751,6 +750,24 @@ struct intel_crtc_state *crtc_state) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); + struct edid *edid; + + edid = intel_dp_get_edid(intel_dp); + + /* The mfg:prod can be obtained from EDID byte [8-11]. + * For instance, if the first bytes of EDID are + * "00 ff ff ff ff ff ff 00 4d 10 51 15 00 00 00 00", + * the mfg:prod is "4d 10 51 15". + * + * TODO: If the list grows more than three quirks, please make a quirk + * table. + */ + if (edid && edid->mfg_id[0] == 0x4d && edid->mfg_id[1] == 0x10 && + edid->prod_code[0] == 0x51 && edid->prod_code[1] == 0x15) { + drm_info_once(&dev_priv->drm, + "PSR2 sel fetch disabled\n"); + return false; + } if (!dev_priv->params.enable_psr2_sel_fetch && intel_dp->psr.debug != I915_PSR_DEBUG_ENABLE_SEL_FETCH) { @@ -837,6 +854,46 @@ return true; } +static bool _compute_psr2_wake_times(struct intel_dp *intel_dp, + struct intel_crtc_state *crtc_state) +{ + struct drm_i915_private *i915 = dp_to_i915(intel_dp); + int io_wake_lines, io_wake_time, fast_wake_lines, fast_wake_time; + u8 max_wake_lines; + + if (DISPLAY_VER(i915) >= 12) { + io_wake_time = 42; + /* + * According to Bspec it's 42us, but based on testing + * it is not enough -> use 45 us. + */ + fast_wake_time = 45; + max_wake_lines = 12; + } else { + io_wake_time = 50; + fast_wake_time = 32; + max_wake_lines = 8; + } + + io_wake_lines = intel_usecs_to_scanlines( + &crtc_state->uapi.adjusted_mode, io_wake_time); + fast_wake_lines = intel_usecs_to_scanlines( + &crtc_state->uapi.adjusted_mode, fast_wake_time); + + if (io_wake_lines > max_wake_lines || + fast_wake_lines > max_wake_lines) + return false; + + if (i915->params.psr_safest_params) + io_wake_lines = fast_wake_lines = max_wake_lines; + + /* According to Bspec lower limit should be set as 7 lines. */ + intel_dp->psr.io_wake_lines = max(io_wake_lines, 7); + intel_dp->psr.fast_wake_lines = max(fast_wake_lines, 7); + + return true; +} + static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state) { @@ -930,6 +987,12 @@ return false; } + if (!_compute_psr2_wake_times(intel_dp, crtc_state)) { + drm_dbg_kms(&dev_priv->drm, + "PSR2 not enabled, Unable to use long enough wake times\n"); + return false; + } + if (HAS_PSR2_SEL_FETCH(dev_priv)) { if (!intel_psr2_sel_fetch_config_valid(intel_dp, crtc_state) && !HAS_PSR_HW_TRACKING(dev_priv)) { diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -3473,6 +3473,13 @@ eb.composite_fence : &eb.requests[0]->fence); + if (unlikely(eb.gem_context->syncobj)) { + drm_syncobj_replace_fence(eb.gem_context->syncobj, + eb.composite_fence ? + eb.composite_fence : + &eb.requests[0]->fence); + } + if (out_fence) { if (err == 0) { fd_install(out_fence_fd, out_fence->file); @@ -3484,13 +3491,6 @@ } } - if (unlikely(eb.gem_context->syncobj)) { - drm_syncobj_replace_fence(eb.gem_context->syncobj, - eb.composite_fence ? - eb.composite_fence : - &eb.requests[0]->fence); - } - if (!out_fence && eb.composite_fence) dma_fence_put(eb.composite_fence); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_mman.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_mman.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -697,7 +697,7 @@ GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo); out: if (file) - drm_vma_node_allow(&mmo->vma_node, file); + drm_vma_node_allow_once(&mmo->vma_node, file); return mmo; err: diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine.h linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine.h --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine.h @@ -248,8 +248,8 @@ ktime_t intel_engine_get_busy_time(struct intel_engine_cs *engine, ktime_t *now); -struct i915_request * -intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine); +void intel_engine_get_hung_entity(struct intel_engine_cs *engine, + struct intel_context **ce, struct i915_request **rq); u32 intel_engine_context_size(struct intel_gt *gt, u8 class); struct intel_context * diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine_cs.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine_cs.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -1343,8 +1343,13 @@ return err; err = setup(engine); - if (err) + if (err) { + intel_engine_cleanup_common(engine); return err; + } + + /* The backend should now be responsible for cleanup */ + GEM_BUG_ON(engine->release == NULL); err = engine_init_common(engine); if (err) @@ -2073,17 +2078,6 @@ } } -static unsigned long list_count(struct list_head *list) -{ - struct list_head *pos; - unsigned long count = 0; - - list_for_each(pos, list) - count++; - - return count; -} - static unsigned long read_ul(void *p, size_t x) { return *(unsigned long *)(p + x); @@ -2175,11 +2169,11 @@ } } -static void engine_dump_active_requests(struct intel_engine_cs *engine, struct drm_printer *m) +static void engine_dump_active_requests(struct intel_engine_cs *engine, + struct drm_printer *m) { + struct intel_context *hung_ce = NULL; struct i915_request *hung_rq = NULL; - struct intel_context *ce; - bool guc; /* * No need for an engine->irq_seqno_barrier() before the seqno reads. @@ -2188,27 +2182,22 @@ * But the intention here is just to report an instantaneous snapshot * so that's fine. */ - lockdep_assert_held(&engine->sched_engine->lock); + intel_engine_get_hung_entity(engine, &hung_ce, &hung_rq); drm_printf(m, "\tRequests:\n"); - guc = intel_uc_uses_guc_submission(&engine->gt->uc); - if (guc) { - ce = intel_engine_get_hung_context(engine); - if (ce) - hung_rq = intel_context_find_active_request(ce); - } else { - hung_rq = intel_engine_execlist_find_hung_request(engine); - } - if (hung_rq) engine_dump_request(hung_rq, m, "\t\thung"); + else if (hung_ce) + drm_printf(m, "\t\tGot hung ce but no hung rq!\n"); - if (guc) + if (intel_uc_uses_guc_submission(&engine->gt->uc)) intel_guc_dump_active_requests(engine, hung_rq, m); else - intel_engine_dump_active_requests(&engine->sched_engine->requests, - hung_rq, m); + intel_execlists_dump_active_requests(engine, hung_rq, m); + + if (hung_rq) + i915_request_put(hung_rq); } void intel_engine_dump(struct intel_engine_cs *engine, @@ -2218,7 +2207,6 @@ struct i915_gpu_error * const error = &engine->i915->gpu_error; struct i915_request *rq; intel_wakeref_t wakeref; - unsigned long flags; ktime_t dummy; if (header) { @@ -2255,13 +2243,8 @@ i915_reset_count(error)); print_properties(engine, m); - spin_lock_irqsave(&engine->sched_engine->lock, flags); engine_dump_active_requests(engine, m); - drm_printf(m, "\tOn hold?: %lu\n", - list_count(&engine->sched_engine->hold)); - spin_unlock_irqrestore(&engine->sched_engine->lock, flags); - drm_printf(m, "\tMMIO base: 0x%08x\n", engine->mmio_base); wakeref = intel_runtime_pm_get_if_in_use(engine->uncore->rpm); if (wakeref) { @@ -2307,8 +2290,7 @@ return siblings[0]->cops->create_virtual(siblings, count, flags); } -struct i915_request * -intel_engine_execlist_find_hung_request(struct intel_engine_cs *engine) +static struct i915_request *engine_execlist_find_hung_request(struct intel_engine_cs *engine) { struct i915_request *request, *active = NULL; @@ -2360,6 +2342,33 @@ return active; } +void intel_engine_get_hung_entity(struct intel_engine_cs *engine, + struct intel_context **ce, struct i915_request **rq) +{ + unsigned long flags; + + *ce = intel_engine_get_hung_context(engine); + if (*ce) { + intel_engine_clear_hung_context(engine); + + *rq = intel_context_get_active_request(*ce); + return; + } + + /* + * Getting here with GuC enabled means it is a forced error capture + * with no actual hang. So, no need to attempt the execlist search. + */ + if (intel_uc_uses_guc_submission(&engine->gt->uc)) + return; + + spin_lock_irqsave(&engine->sched_engine->lock, flags); + *rq = engine_execlist_find_hung_request(engine); + if (*rq) + *rq = i915_request_get_rcu(*rq); + spin_unlock_irqrestore(&engine->sched_engine->lock, flags); +} + void xehp_enable_ccs_engines(struct intel_engine_cs *engine) { /* diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_workarounds.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_workarounds.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_workarounds.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_workarounds.c @@ -688,11 +688,19 @@ /* Wa_14014947963:dg2 */ if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_B0, STEP_FOREVER) || - IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) + IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) wa_masked_field_set(wal, VF_PREEMPTION, PREEMPTION_VERTEX_COUNT, 0x4000); + /* Wa_18018764978:dg2 */ + if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_C0, STEP_FOREVER) || + IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) + wa_masked_en(wal, PSS_MODE2, SCOREBOARD_STALL_FLUSH_CONTROL); + /* Wa_15010599737:dg2 */ wa_masked_en(wal, CHICKEN_RASTER_1, DIS_SF_ROUND_NEAREST_EVEN); + + /* Wa_18019271663:dg2 */ + wa_masked_en(wal, CACHE_MODE_1, MSAA_OPTIMIZATION_REDUC_DISABLE); } static void fakewa_disable_nestedbb_mode(struct intel_engine_cs *engine, @@ -1249,6 +1257,13 @@ GAMT_CHKN_BIT_REG, GAMT_CHKN_DISABLE_L3_COH_PIPE); + /* + * Wa_1408615072:icl,ehl (vsunit) + * Wa_1407596294:icl,ehl (hsunit) + */ + wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE, + VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS); + /* Wa_1407352427:icl,ehl */ wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2, PSDUNIT_CLKGATE_DIS); @@ -2366,13 +2381,6 @@ GEN11_ENABLE_32_PLANE_MODE); /* - * Wa_1408615072:icl,ehl (vsunit) - * Wa_1407596294:icl,ehl (hsunit) - */ - wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE, - VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS); - - /* * Wa_1408767742:icl[a2..forever],ehl[all] * Wa_1605460711:icl[a0..c0] */ @@ -2784,6 +2792,9 @@ * Wa_22015475538:dg2 */ wa_write_or(wal, LSC_CHICKEN_BIT_0_UDW, DIS_CHAIN_2XSIMD8); + + /* Wa_18017747507:dg2 */ + wa_masked_en(wal, VFG_PREEMPTION_CHICKEN, POLYGON_TRIFAN_LINELOOP_DISABLE); } } diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -1685,7 +1685,7 @@ goto next_context; guilty = false; - rq = intel_context_find_active_request(ce); + rq = intel_context_get_active_request(ce); if (!rq) { head = ce->ring->tail; goto out_replay; @@ -1698,6 +1698,7 @@ head = intel_ring_wrap(ce->ring, rq->head); __i915_request_reset(rq, guilty); + i915_request_put(rq); out_replay: guc_reset_state(ce, head, guilty); next_context: @@ -4680,6 +4681,8 @@ xa_lock_irqsave(&guc->context_lookup, flags); xa_for_each(&guc->context_lookup, index, ce) { + bool found; + if (!kref_get_unless_zero(&ce->ref)) continue; @@ -4696,10 +4699,18 @@ goto next; } + found = false; + spin_lock(&ce->guc_state.lock); list_for_each_entry(rq, &ce->guc_state.requests, sched.link) { if (i915_test_request_state(rq) != I915_REQUEST_ACTIVE) continue; + found = true; + break; + } + spin_unlock(&ce->guc_state.lock); + + if (found) { intel_engine_set_hung_context(engine, ce); /* Can only cope with one hang at a time... */ @@ -4707,6 +4718,7 @@ xa_lock(&guc->context_lookup); goto done; } + next: intel_context_put(ce); xa_lock(&guc->context_lookup); diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_driver.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_driver.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_driver.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_driver.c @@ -1070,12 +1070,9 @@ */ static void i915_driver_lastclose(struct drm_device *dev) { - struct drm_i915_private *i915 = to_i915(dev); - intel_fbdev_restore_mode(dev); - if (HAS_DISPLAY(i915)) - vga_switcheroo_process_delayed_switch(); + vga_switcheroo_process_delayed_switch(); } static void i915_driver_postclose(struct drm_device *dev, struct drm_file *file) diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_pci.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_pci.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_pci.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_pci.c @@ -423,7 +423,8 @@ .has_coherent_ggtt = true, \ .has_llc = 1, \ .has_rc6 = 1, \ - .has_rc6p = 1, \ + /* snb does support rc6p, but enabling it causes various issues */ \ + .has_rc6p = 0, \ .has_rps = true, \ .dma_mask_size = 40, \ .__runtime.ppgtt_type = INTEL_PPGTT_ALIASING, \ @@ -1128,7 +1129,6 @@ {} }; -__maybe_unused static const struct intel_device_info mtl_info = { XE_HP_FEATURES, XE_LPDP_FEATURES, diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_vma.c linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_vma.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_vma.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_vma.c @@ -2114,7 +2114,7 @@ if (!obj->mm.rsgt) return -EBUSY; - err = dma_resv_reserve_fences(obj->base.resv, 1); + err = dma_resv_reserve_fences(obj->base.resv, 2); if (err) return -EBUSY; diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gpu.c linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gpu.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1277,6 +1277,12 @@ if (hang_debug) a6xx_dump(gpu); + /* + * To handle recovery specific sequences during the rpm suspend we are + * about to trigger + */ + a6xx_gpu->hung = true; + /* Halt SQE first */ gpu_write(gpu, REG_A6XX_CP_SQE_CNTL, 3); @@ -1319,6 +1325,7 @@ mutex_unlock(&gpu->active_lock); msm_gpu_hw_init(gpu); + a6xx_gpu->hung = false; } static const char *a6xx_uche_fault_block(struct msm_gpu *gpu, u32 mid) diff -u linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c --- linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1669,8 +1669,10 @@ err_out: /* vmw_user_lookup_handle takes one ref so does new_fb */ - if (bo) + if (bo) { vmw_bo_unreference(&bo); + drm_gem_object_put(&bo->base.base); + } if (surface) vmw_surface_unreference(&surface); diff -u linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/amd_sfh_client.c linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/amd_sfh_client.c --- linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/amd_sfh_client.c +++ linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/amd_sfh_client.c @@ -227,6 +227,7 @@ cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]); if (cl_data->num_hid_devices == 0) return -ENODEV; + cl_data->is_any_sensor_enabled = false; INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); @@ -282,11 +283,12 @@ } rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); if (rc) - return rc; + goto cleanup; mp2_ops->start(privdata, info); status = amd_sfh_wait_for_response (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); if (status == SENSOR_ENABLED) { + cl_data->is_any_sensor_enabled = true; cl_data->sensor_sts[i] = SENSOR_ENABLED; rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data); if (rc) { @@ -301,19 +303,26 @@ cl_data->sensor_sts[i]); goto cleanup; } + } else { + cl_data->sensor_sts[i] = SENSOR_DISABLED; + dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", + cl_data->sensor_idx[i], + get_sensor_name(cl_data->sensor_idx[i]), + cl_data->sensor_sts[i]); } dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), cl_data->sensor_sts[i]); } - if (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0) { + if (!cl_data->is_any_sensor_enabled || + (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) { amd_sfh_hid_client_deinit(privdata); for (i = 0; i < cl_data->num_hid_devices; i++) { devm_kfree(dev, cl_data->feature_report[i]); devm_kfree(dev, in_data->input_report[i]); devm_kfree(dev, cl_data->report_descr[i]); } - dev_warn(dev, "Failed to discover, sensors not enabled\n"); + dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled); return -EOPNOTSUPP; } schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); diff -u linux-oem-6.1-6.1.0/drivers/hid/hid-ids.h linux-oem-6.1-6.1.0/drivers/hid/hid-ids.h --- linux-oem-6.1-6.1.0/drivers/hid/hid-ids.h +++ linux-oem-6.1-6.1.0/drivers/hid/hid-ids.h @@ -274,7 +274,6 @@ #define USB_DEVICE_ID_CH_AXIS_295 0x001c #define USB_VENDOR_ID_CHERRY 0x046a -#define USB_DEVICE_ID_CHERRY_MOUSE_000C 0x000c #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 #define USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR 0x0027 @@ -1295,6 +1294,7 @@ #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540 0x0075 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 0x0094 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01 0x0042 +#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2 0x0905 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L 0x0935 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S 0x0909 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06 0x0078 diff -u linux-oem-6.1-6.1.0/drivers/hid/hid-logitech-hidpp.c linux-oem-6.1-6.1.0/drivers/hid/hid-logitech-hidpp.c --- linux-oem-6.1-6.1.0/drivers/hid/hid-logitech-hidpp.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-logitech-hidpp.c @@ -3978,7 +3978,8 @@ } hidpp_initialize_battery(hidpp); - hidpp_initialize_hires_scroll(hidpp); + if (!hid_is_usb(hidpp->hid_dev)) + hidpp_initialize_hires_scroll(hidpp); /* forward current battery state */ if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP10_BATTERY) { diff -u linux-oem-6.1-6.1.0/drivers/hid/hid-uclogic-params.c linux-oem-6.1-6.1.0/drivers/hid/hid-uclogic-params.c --- linux-oem-6.1-6.1.0/drivers/hid/hid-uclogic-params.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-uclogic-params.c @@ -1656,6 +1656,8 @@ case VID_PID(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_PARBLO_A610_PRO): case VID_PID(USB_VENDOR_ID_UGEE, + USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2): + case VID_PID(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L): case VID_PID(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S): diff -u linux-oem-6.1-6.1.0/drivers/md/dm.c linux-oem-6.1-6.1.0/drivers/md/dm.c --- linux-oem-6.1-6.1.0/drivers/md/dm.c +++ linux-oem-6.1-6.1.0/drivers/md/dm.c @@ -1755,6 +1755,8 @@ * otherwise associated queue_limits won't be imposed. */ bio = bio_split_to_limits(bio); + if (!bio) + return; } init_clone_info(&ci, md, map, bio, is_abnormal); diff -u linux-oem-6.1-6.1.0/drivers/md/md.c linux-oem-6.1-6.1.0/drivers/md/md.c --- linux-oem-6.1-6.1.0/drivers/md/md.c +++ linux-oem-6.1-6.1.0/drivers/md/md.c @@ -443,6 +443,8 @@ } bio = bio_split_to_limits(bio); + if (!bio) + return; if (mddev->ro == 1 && unlikely(rw == WRITE)) { if (bio_sectors(bio) != 0) diff -u linux-oem-6.1-6.1.0/drivers/media/v4l2-core/v4l2-ctrls-api.c linux-oem-6.1-6.1.0/drivers/media/v4l2-core/v4l2-ctrls-api.c --- linux-oem-6.1-6.1.0/drivers/media/v4l2-core/v4l2-ctrls-api.c +++ linux-oem-6.1-6.1.0/drivers/media/v4l2-core/v4l2-ctrls-api.c @@ -150,8 +150,8 @@ * then return an error. */ if (strlen(ctrl->p_new.p_char) == ctrl->maximum && last) - ctrl->is_new = 1; return -ERANGE; + ctrl->is_new = 1; } return ret; default: diff -u linux-oem-6.1-6.1.0/drivers/misc/mei/pci-me.c linux-oem-6.1-6.1.0/drivers/misc/mei/pci-me.c --- linux-oem-6.1-6.1.0/drivers/misc/mei/pci-me.c +++ linux-oem-6.1-6.1.0/drivers/misc/mei/pci-me.c @@ -121,6 +121,8 @@ {MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_MTL_M, MEI_ME_PCH15_CFG)}, + /* required last entry */ {0, } }; diff -u linux-oem-6.1-6.1.0/drivers/mmc/host/meson-gx-mmc.c linux-oem-6.1-6.1.0/drivers/mmc/host/meson-gx-mmc.c --- linux-oem-6.1-6.1.0/drivers/mmc/host/meson-gx-mmc.c +++ linux-oem-6.1-6.1.0/drivers/mmc/host/meson-gx-mmc.c @@ -435,7 +435,8 @@ clk_reg |= FIELD_PREP(CLK_CORE_PHASE_MASK, CLK_PHASE_180); clk_reg |= FIELD_PREP(CLK_TX_PHASE_MASK, CLK_PHASE_0); clk_reg |= FIELD_PREP(CLK_RX_PHASE_MASK, CLK_PHASE_0); - clk_reg |= CLK_IRQ_SDIO_SLEEP(host); + if (host->mmc->caps & MMC_CAP_SDIO_IRQ) + clk_reg |= CLK_IRQ_SDIO_SLEEP(host); writel(clk_reg, host->regs + SD_EMMC_CLOCK); /* get the mux parents */ @@ -948,16 +949,18 @@ { struct meson_host *host = dev_id; struct mmc_command *cmd; - u32 status, raw_status; + u32 status, raw_status, irq_mask = IRQ_EN_MASK; irqreturn_t ret = IRQ_NONE; + if (host->mmc->caps & MMC_CAP_SDIO_IRQ) + irq_mask |= IRQ_SDIO; raw_status = readl(host->regs + SD_EMMC_STATUS); - status = raw_status & (IRQ_EN_MASK | IRQ_SDIO); + status = raw_status & irq_mask; if (!status) { dev_dbg(host->dev, - "Unexpected IRQ! irq_en 0x%08lx - status 0x%08x\n", - IRQ_EN_MASK | IRQ_SDIO, raw_status); + "Unexpected IRQ! irq_en 0x%08x - status 0x%08x\n", + irq_mask, raw_status); return IRQ_NONE; } @@ -1204,6 +1207,11 @@ goto free_host; } + mmc->caps |= MMC_CAP_CMD23; + + if (mmc->caps & MMC_CAP_SDIO_IRQ) + mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; + host->data = (struct meson_mmc_data *) of_device_get_match_data(&pdev->dev); if (!host->data) { @@ -1277,11 +1285,6 @@ spin_lock_init(&host->lock); - mmc->caps |= MMC_CAP_CMD23; - - if (mmc->caps & MMC_CAP_SDIO_IRQ) - mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; - if (host->dram_access_quirk) { /* Limit segments to 1 due to low available sram memory */ mmc->max_segs = 1; diff -u linux-oem-6.1-6.1.0/drivers/mtd/spi-nor/core.c linux-oem-6.1-6.1.0/drivers/mtd/spi-nor/core.c --- linux-oem-6.1-6.1.0/drivers/mtd/spi-nor/core.c +++ linux-oem-6.1-6.1.0/drivers/mtd/spi-nor/core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff -u linux-oem-6.1-6.1.0/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c linux-oem-6.1-6.1.0/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c --- linux-oem-6.1-6.1.0/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ linux-oem-6.1-6.1.0/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -545,6 +545,7 @@ u8 cmd_no, int channel) { struct kvaser_cmd *cmd; + size_t cmd_len; int err; cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); @@ -552,6 +553,7 @@ return -ENOMEM; cmd->header.cmd_no = cmd_no; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); if (channel < 0) { kvaser_usb_hydra_set_cmd_dest_he (cmd, KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL); @@ -568,7 +570,7 @@ kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); if (err) goto end; @@ -584,6 +586,7 @@ { struct kvaser_cmd *cmd; struct kvaser_usb *dev = priv->dev; + size_t cmd_len; int err; cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); @@ -591,14 +594,14 @@ return -ENOMEM; cmd->header.cmd_no = cmd_no; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); kvaser_usb_hydra_set_cmd_dest_he (cmd, dev->card_data.hydra.channel_to_he[priv->channel]); kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd_async(priv, cmd, - kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd_async(priv, cmd, cmd_len); if (err) kfree(cmd); @@ -742,6 +745,7 @@ { struct kvaser_usb_dev_card_data *card_data = &dev->card_data; struct kvaser_cmd *cmd; + size_t cmd_len; u32 value = 0; u32 mask = 0; u16 cap_cmd_res; @@ -753,13 +757,14 @@ return -ENOMEM; cmd->header.cmd_no = CMD_GET_CAPABILITIES_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); cmd->cap_req.cap_cmd = cpu_to_le16(cap_cmd_req); kvaser_usb_hydra_set_cmd_dest_he(cmd, card_data->hydra.sysdbg_he); kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); if (err) goto end; @@ -1578,6 +1583,7 @@ struct kvaser_usb *dev = priv->dev; struct kvaser_usb_net_hydra_priv *hydra = priv->sub_priv; struct kvaser_cmd *cmd; + size_t cmd_len; int err; if (!hydra) @@ -1588,6 +1594,7 @@ return -ENOMEM; cmd->header.cmd_no = CMD_GET_BUSPARAMS_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); kvaser_usb_hydra_set_cmd_dest_he (cmd, dev->card_data.hydra.channel_to_he[priv->channel]); kvaser_usb_hydra_set_cmd_transid @@ -1597,7 +1604,7 @@ reinit_completion(&priv->get_busparams_comp); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); if (err) return err; @@ -1624,6 +1631,7 @@ struct kvaser_cmd *cmd; struct kvaser_usb_net_priv *priv = netdev_priv(netdev); struct kvaser_usb *dev = priv->dev; + size_t cmd_len; int err; cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); @@ -1631,6 +1639,7 @@ return -ENOMEM; cmd->header.cmd_no = CMD_SET_BUSPARAMS_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); memcpy(&cmd->set_busparams_req.busparams_nominal, busparams, sizeof(cmd->set_busparams_req.busparams_nominal)); @@ -1639,7 +1648,7 @@ kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); kfree(cmd); @@ -1652,6 +1661,7 @@ struct kvaser_cmd *cmd; struct kvaser_usb_net_priv *priv = netdev_priv(netdev); struct kvaser_usb *dev = priv->dev; + size_t cmd_len; int err; cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); @@ -1659,6 +1669,7 @@ return -ENOMEM; cmd->header.cmd_no = CMD_SET_BUSPARAMS_FD_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); memcpy(&cmd->set_busparams_req.busparams_data, busparams, sizeof(cmd->set_busparams_req.busparams_data)); @@ -1676,7 +1687,7 @@ kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); kfree(cmd); @@ -1804,6 +1815,7 @@ static int kvaser_usb_hydra_get_software_details(struct kvaser_usb *dev) { struct kvaser_cmd *cmd; + size_t cmd_len; int err; u32 flags; struct kvaser_usb_dev_card_data *card_data = &dev->card_data; @@ -1813,6 +1825,7 @@ return -ENOMEM; cmd->header.cmd_no = CMD_GET_SOFTWARE_DETAILS_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); cmd->sw_detail_req.use_ext_cmd = 1; kvaser_usb_hydra_set_cmd_dest_he (cmd, KVASER_USB_HYDRA_HE_ADDRESS_ILLEGAL); @@ -1820,7 +1833,7 @@ kvaser_usb_hydra_set_cmd_transid (cmd, kvaser_usb_hydra_get_next_transid(dev)); - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); if (err) goto end; @@ -1938,6 +1951,7 @@ { struct kvaser_usb *dev = priv->dev; struct kvaser_cmd *cmd; + size_t cmd_len; int err; if ((priv->can.ctrlmode & @@ -1953,6 +1967,7 @@ return -ENOMEM; cmd->header.cmd_no = CMD_SET_DRIVERMODE_REQ; + cmd_len = kvaser_usb_hydra_cmd_size(cmd); kvaser_usb_hydra_set_cmd_dest_he (cmd, dev->card_data.hydra.channel_to_he[priv->channel]); kvaser_usb_hydra_set_cmd_transid @@ -1962,7 +1977,7 @@ else cmd->set_ctrlmode.mode = KVASER_USB_HYDRA_CTRLMODE_NORMAL; - err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd)); + err = kvaser_usb_send_cmd(dev, cmd, cmd_len); kfree(cmd); return err; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/adi/adin1110.c linux-oem-6.1-6.1.0/drivers/net/ethernet/adi/adin1110.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/adi/adin1110.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/adi/adin1110.c @@ -356,7 +356,7 @@ if ((port_priv->flags & IFF_ALLMULTI && rxb->pkt_type == PACKET_MULTICAST) || (port_priv->flags & IFF_BROADCAST && rxb->pkt_type == PACKET_BROADCAST)) - rxb->offload_fwd_mark = 1; + rxb->offload_fwd_mark = port_priv->priv->forwarding; netif_rx(rxb); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c @@ -496,6 +496,7 @@ reg |= XGBE_KR_TRAINING_ENABLE; reg |= XGBE_KR_TRAINING_START; XMDIO_WRITE(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_PMD_CTRL, reg); + pdata->kr_start_time = jiffies; netif_dbg(pdata, link, pdata->netdev, "KR training initiated\n"); @@ -632,6 +633,8 @@ xgbe_switch_mode(pdata); + pdata->an_result = XGBE_AN_READY; + xgbe_an_restart(pdata); return XGBE_AN_INCOMPAT_LINK; @@ -1275,9 +1278,30 @@ static void xgbe_check_link_timeout(struct xgbe_prv_data *pdata) { unsigned long link_timeout; + unsigned long kr_time; + int wait; link_timeout = pdata->link_check + (XGBE_LINK_TIMEOUT * HZ); if (time_after(jiffies, link_timeout)) { + if ((xgbe_cur_mode(pdata) == XGBE_MODE_KR) && + pdata->phy.autoneg == AUTONEG_ENABLE) { + /* AN restart should not happen while KR training is in progress. + * The while loop ensures no AN restart during KR training, + * waits up to 500ms and AN restart is triggered only if KR + * training is failed. + */ + wait = XGBE_KR_TRAINING_WAIT_ITER; + while (wait--) { + kr_time = pdata->kr_start_time + + msecs_to_jiffies(XGBE_AN_MS_TIMEOUT); + if (time_after(jiffies, kr_time)) + break; + /* AN restart is not required, if AN result is COMPLETE */ + if (pdata->an_result == XGBE_AN_COMPLETE) + return; + usleep_range(10000, 11000); + } + } netif_dbg(pdata, link, pdata->netdev, "AN link timeout\n"); xgbe_phy_config_aneg(pdata); } diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -990,7 +990,7 @@ DMA_ATTR_WEAK_ORDERING); skb = build_skb(page_address(page), PAGE_SIZE); if (!skb) { - __free_page(page); + page_pool_recycle_direct(rxr->page_pool, page); return NULL; } skb_mark_for_recycle(skb); @@ -1028,7 +1028,7 @@ skb = napi_alloc_skb(&rxr->bnapi->napi, payload); if (!skb) { - __free_page(page); + page_pool_recycle_direct(rxr->page_pool, page); return NULL; } @@ -9239,10 +9239,14 @@ netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc); return rc; } - if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) { + if (tcs && (bp->tx_nr_rings_per_tc * tcs != + bp->tx_nr_rings - bp->tx_nr_rings_xdp)) { netdev_err(bp->dev, "tx ring reservation failure\n"); netdev_reset_tc(bp->dev); - bp->tx_nr_rings_per_tc = bp->tx_nr_rings; + if (bp->tx_nr_rings_xdp) + bp->tx_nr_rings_per_tc = bp->tx_nr_rings_xdp; + else + bp->tx_nr_rings_per_tc = bp->tx_nr_rings; return -ENOMEM; } return 0; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/enetc/enetc.c linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/enetc/enetc.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/enetc/enetc.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2290,14 +2290,14 @@ priv = container_of(work, struct enetc_ndev_priv, tx_onestep_tstamp); - netif_tx_lock(priv->ndev); + netif_tx_lock_bh(priv->ndev); clear_bit_unlock(ENETC_TX_ONESTEP_TSTAMP_IN_PROGRESS, &priv->flags); skb = skb_dequeue(&priv->tx_skbs); if (skb) enetc_start_xmit(skb, priv->ndev); - netif_tx_unlock(priv->ndev); + netif_tx_unlock_bh(priv->ndev); } static void enetc_tx_onestep_tstamp_init(struct enetc_ndev_priv *priv) diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/fec_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/fec_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/fec_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/fec_main.c @@ -3089,7 +3089,7 @@ for (q = 0; q < fep->num_rx_queues; q++) { rxq = fep->rx_queue[q]; for (i = 0; i < rxq->bd.ring_size; i++) - page_pool_release_page(rxq->page_pool, rxq->rx_skb_info[i].page); + page_pool_put_full_page(rxq->page_pool, rxq->rx_skb_info[i].page, false); if (xdp_rxq_info_is_reg(&rxq->xdp_rxq)) xdp_rxq_info_unreg(&rxq->xdp_rxq); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -3130,7 +3130,7 @@ hclgevf_update_rss_size(handle, new_tqps_num); - hclge_comm_get_rss_tc_info(cur_rss_size, hdev->hw_tc_map, + hclge_comm_get_rss_tc_info(kinfo->rss_size, hdev->hw_tc_map, tc_offset, tc_valid, tc_size); ret = hclge_comm_set_rss_tc_mode(&hdev->hw.hw, tc_offset, tc_valid, tc_size); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/i40e/i40e_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/i40e/i40e_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/i40e/i40e_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -2921,7 +2921,7 @@ struct i40e_pf *pf = vsi->back; if (i40e_enabled_xdp_vsi(vsi)) { - int frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + int frame_size = new_mtu + I40E_PACKET_HDR_PAD; if (frame_size > i40e_max_xdp_frame_size(vsi)) return -EINVAL; @@ -13140,6 +13140,8 @@ } br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC); + if (!br_spec) + return -EINVAL; nla_for_each_nested(attr, br_spec, rem) { __u16 mode; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_xsk.c linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_xsk.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_xsk.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -789,6 +789,7 @@ struct ice_tx_desc *tx_desc; u16 cnt = xdp_ring->count; struct ice_tx_buf *tx_buf; + u16 completed_frames = 0; u16 xsk_frames = 0; u16 last_rs; int i; @@ -798,19 +799,21 @@ if ((tx_desc->cmd_type_offset_bsz & cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) { if (last_rs >= ntc) - xsk_frames = last_rs - ntc + 1; + completed_frames = last_rs - ntc + 1; else - xsk_frames = last_rs + cnt - ntc + 1; + completed_frames = last_rs + cnt - ntc + 1; } - if (!xsk_frames) + if (!completed_frames) return; - if (likely(!xdp_ring->xdp_tx_active)) + if (likely(!xdp_ring->xdp_tx_active)) { + xsk_frames = completed_frames; goto skip; + } ntc = xdp_ring->next_to_clean; - for (i = 0; i < xsk_frames; i++) { + for (i = 0; i < completed_frames; i++) { tx_buf = &xdp_ring->tx_buf[ntc]; if (tx_buf->raw_buf) { @@ -826,7 +829,7 @@ } skip: tx_desc->cmd_type_offset_bsz = 0; - xdp_ring->next_to_clean += xsk_frames; + xdp_ring->next_to_clean += completed_frames; if (xdp_ring->next_to_clean >= cnt) xdp_ring->next_to_clean -= cnt; if (xsk_frames) diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igb/igb_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igb/igb_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igb/igb_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igb/igb_main.c @@ -2256,6 +2256,30 @@ } } +#ifdef CONFIG_IGB_HWMON +/** + * igb_set_i2c_bb - Init I2C interface + * @hw: pointer to hardware structure + **/ +static void igb_set_i2c_bb(struct e1000_hw *hw) +{ + u32 ctrl_ext; + s32 i2cctl; + + ctrl_ext = rd32(E1000_CTRL_EXT); + ctrl_ext |= E1000_CTRL_I2C_ENA; + wr32(E1000_CTRL_EXT, ctrl_ext); + wrfl(); + + i2cctl = rd32(E1000_I2CPARAMS); + i2cctl |= E1000_I2CBB_EN + | E1000_I2C_CLK_OE_N + | E1000_I2C_DATA_OE_N; + wr32(E1000_I2CPARAMS, i2cctl); + wrfl(); +} +#endif + void igb_reset(struct igb_adapter *adapter) { struct pci_dev *pdev = adapter->pdev; @@ -2400,7 +2424,8 @@ * interface. */ if (adapter->ets) - mac->ops.init_thermal_sensor_thresh(hw); + igb_set_i2c_bb(hw); + mac->ops.init_thermal_sensor_thresh(hw); } } #endif @@ -3117,21 +3142,12 @@ **/ static s32 igb_init_i2c(struct igb_adapter *adapter) { - struct e1000_hw *hw = &adapter->hw; s32 status = 0; - s32 i2cctl; /* I2C interface supported on i350 devices */ if (adapter->hw.mac.type != e1000_i350) return 0; - i2cctl = rd32(E1000_I2CPARAMS); - i2cctl |= E1000_I2CBB_EN - | E1000_I2C_CLK_OUT | E1000_I2C_CLK_OE_N - | E1000_I2C_DATA_OUT | E1000_I2C_DATA_OE_N; - wr32(E1000_I2CPARAMS, i2cctl); - wrfl(); - /* Initialize the i2c bus which is controlled by the registers. * This bus will use the i2c_algo_bit structure that implements * the protocol through toggling of the 4 bits in the register. @@ -3521,6 +3537,12 @@ adapter->ets = true; else adapter->ets = false; + /* Only enable I2C bit banging if an external thermal + * sensor is supported. + */ + if (adapter->ets) + igb_set_i2c_bb(hw); + hw->mac.ops.init_thermal_sensor_thresh(hw); if (igb_sysfs_init(adapter)) dev_err(&pdev->dev, "failed to allocate sysfs resources\n"); @@ -6794,7 +6816,7 @@ struct timespec64 ts; u32 tsauxc; - if (pin < 0 || pin >= IGB_N_PEROUT) + if (pin < 0 || pin >= IGB_N_SDP) return; spin_lock(&adapter->tmreg_lock); @@ -6802,7 +6824,7 @@ if (hw->mac.type == e1000_82580 || hw->mac.type == e1000_i354 || hw->mac.type == e1000_i350) { - s64 ns = timespec64_to_ns(&adapter->perout[pin].period); + s64 ns = timespec64_to_ns(&adapter->perout[tsintr_tt].period); u32 systiml, systimh, level_mask, level, rem; u64 systim, now; @@ -6850,8 +6872,8 @@ ts.tv_nsec = (u32)systim; ts.tv_sec = ((u32)(systim >> 32)) & 0xFF; } else { - ts = timespec64_add(adapter->perout[pin].start, - adapter->perout[pin].period); + ts = timespec64_add(adapter->perout[tsintr_tt].start, + adapter->perout[tsintr_tt].period); } /* u32 conversion of tv_sec is safe until y2106 */ @@ -6860,7 +6882,7 @@ tsauxc = rd32(E1000_TSAUXC); tsauxc |= TSAUXC_EN_TT0; wr32(E1000_TSAUXC, tsauxc); - adapter->perout[pin].start = ts; + adapter->perout[tsintr_tt].start = ts; spin_unlock(&adapter->tmreg_lock); } @@ -6874,7 +6896,7 @@ struct ptp_clock_event event; struct timespec64 ts; - if (pin < 0 || pin >= IGB_N_EXTTS) + if (pin < 0 || pin >= IGB_N_SDP) return; if (hw->mac.type == e1000_82580 || diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_defines.h linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_defines.h --- linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_defines.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_defines.h @@ -466,7 +466,9 @@ #define IGC_TSAUXC_EN_TT0 BIT(0) /* Enable target time 0. */ #define IGC_TSAUXC_EN_TT1 BIT(1) /* Enable target time 1. */ #define IGC_TSAUXC_EN_CLK0 BIT(2) /* Enable Configurable Frequency Clock 0. */ +#define IGC_TSAUXC_ST0 BIT(4) /* Start Clock 0 Toggle on Target Time 0. */ #define IGC_TSAUXC_EN_CLK1 BIT(5) /* Enable Configurable Frequency Clock 1. */ +#define IGC_TSAUXC_ST1 BIT(7) /* Start Clock 1 Toggle on Target Time 1. */ #define IGC_TSAUXC_EN_TS0 BIT(8) /* Enable hardware timestamp 0. */ #define IGC_TSAUXC_AUTT0 BIT(9) /* Auxiliary Timestamp Taken. */ #define IGC_TSAUXC_EN_TS1 BIT(10) /* Enable hardware timestamp 0. */ diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_main.c @@ -2942,7 +2942,9 @@ if (tx_buffer->next_to_watch && time_after(jiffies, tx_buffer->time_stamp + (adapter->tx_timeout_factor * HZ)) && - !(rd32(IGC_STATUS) & IGC_STATUS_TXOFF)) { + !(rd32(IGC_STATUS) & IGC_STATUS_TXOFF) && + (rd32(IGC_TDH(tx_ring->reg_idx)) != + readl(tx_ring->tail))) { /* detected Tx unit hang */ netdev_err(tx_ring->netdev, "Detected Tx Unit Hang\n" @@ -5069,6 +5071,24 @@ } /** + * igc_tx_timeout - Respond to a Tx Hang + * @netdev: network interface device structure + * @txqueue: queue number that timed out + **/ +static void igc_tx_timeout(struct net_device *netdev, + unsigned int __always_unused txqueue) +{ + struct igc_adapter *adapter = netdev_priv(netdev); + struct igc_hw *hw = &adapter->hw; + + /* Do the reset outside of interrupt context */ + adapter->tx_timeout_count++; + schedule_work(&adapter->reset_task); + wr32(IGC_EICS, + (adapter->eims_enable_mask & ~adapter->eims_other)); +} + +/** * igc_get_stats64 - Get System Network Statistics * @netdev: network interface device structure * @stats: rtnl_link_stats64 pointer @@ -5495,7 +5515,7 @@ case SPEED_100: case SPEED_1000: case SPEED_2500: - adapter->tx_timeout_factor = 7; + adapter->tx_timeout_factor = 1; break; } @@ -6313,6 +6333,7 @@ .ndo_set_rx_mode = igc_set_rx_mode, .ndo_set_mac_address = igc_set_mac, .ndo_change_mtu = igc_change_mtu, + .ndo_tx_timeout = igc_tx_timeout, .ndo_get_stats64 = igc_get_stats64, .ndo_fix_features = igc_fix_features, .ndo_set_features = igc_set_features, diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -1012,7 +1012,6 @@ rbpool = cq->rbpool; free_ptrs = cq->pool_ptrs; - get_cpu(); while (cq->pool_ptrs) { if (otx2_alloc_rbuf(pfvf, rbpool, &bufptr)) { /* Schedule a WQ if we fails to free atleast half of the @@ -1032,7 +1031,6 @@ pfvf->hw_ops->aura_freeptr(pfvf, qidx, bufptr + OTX2_HEAD_ROOM); cq->pool_ptrs--; } - put_cpu(); cq->refill_task_sched = false; } @@ -1370,7 +1368,6 @@ if (err) goto fail; - get_cpu(); /* Allocate pointers and free them to aura/pool */ for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) { pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx); @@ -1394,7 +1391,6 @@ } err_mem: - put_cpu(); return err ? -ENOMEM : 0; fail: @@ -1435,21 +1431,18 @@ if (err) goto fail; - get_cpu(); /* Allocate pointers and free them to aura/pool */ for (pool_id = 0; pool_id < hw->rqpool_cnt; pool_id++) { pool = &pfvf->qset.pool[pool_id]; for (ptr = 0; ptr < num_ptrs; ptr++) { err = otx2_alloc_rbuf(pfvf, pool, &bufptr); if (err) - goto err_mem; + return -ENOMEM; pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr + OTX2_HEAD_ROOM); } } -err_mem: - put_cpu(); - return err ? -ENOMEM : 0; + return 0; fail: otx2_mbox_reset(&pfvf->mbox.mbox, 0); otx2_aura_pool_free(pfvf); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_eth_soc.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1495,8 +1495,8 @@ if (IS_ERR(pp)) return pp; - err = __xdp_rxq_info_reg(xdp_q, ð->dummy_dev, eth->rx_napi.napi_id, - id, PAGE_SIZE); + err = __xdp_rxq_info_reg(xdp_q, ð->dummy_dev, id, + eth->rx_napi.napi_id, PAGE_SIZE); if (err < 0) goto err_free_pp; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -591,7 +591,8 @@ rq->ix = c->ix; rq->channel = c; rq->mdev = mdev; - rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); + rq->hw_mtu = + MLX5E_SW2HW_MTU(params, params->sw_mtu) - ETH_FCS_LEN * !params->scatter_fcs_en; rq->xdpsq = &c->rq_xdpsq; rq->stats = &c->priv->channel_stats[c->ix]->rq; rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev); @@ -1014,35 +1015,6 @@ return mlx5e_rq_to_ready(rq, curr_state); } -static int mlx5e_modify_rq_scatter_fcs(struct mlx5e_rq *rq, bool enable) -{ - struct mlx5_core_dev *mdev = rq->mdev; - - void *in; - void *rqc; - int inlen; - int err; - - inlen = MLX5_ST_SZ_BYTES(modify_rq_in); - in = kvzalloc(inlen, GFP_KERNEL); - if (!in) - return -ENOMEM; - - rqc = MLX5_ADDR_OF(modify_rq_in, in, ctx); - - MLX5_SET(modify_rq_in, in, rq_state, MLX5_RQC_STATE_RDY); - MLX5_SET64(modify_rq_in, in, modify_bitmask, - MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_SCATTER_FCS); - MLX5_SET(rqc, rqc, scatter_fcs, enable); - MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RDY); - - err = mlx5_core_modify_rq(mdev, rq->rqn, in); - - kvfree(in); - - return err; -} - static int mlx5e_modify_rq_vsd(struct mlx5e_rq *rq, bool vsd) { struct mlx5_core_dev *mdev = rq->mdev; @@ -3301,20 +3273,6 @@ mlx5e_destroy_tises(priv); } -static int mlx5e_modify_channels_scatter_fcs(struct mlx5e_channels *chs, bool enable) -{ - int err = 0; - int i; - - for (i = 0; i < chs->num; i++) { - err = mlx5e_modify_rq_scatter_fcs(&chs->c[i]->rq, enable); - if (err) - return err; - } - - return 0; -} - static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd) { int err; @@ -3890,41 +3848,27 @@ return mlx5_set_ports_check(mdev, in, sizeof(in)); } +static int mlx5e_set_rx_port_ts_wrap(struct mlx5e_priv *priv, void *ctx) +{ + struct mlx5_core_dev *mdev = priv->mdev; + bool enable = *(bool *)ctx; + + return mlx5e_set_rx_port_ts(mdev, enable); +} + static int set_feature_rx_fcs(struct net_device *netdev, bool enable) { struct mlx5e_priv *priv = netdev_priv(netdev); struct mlx5e_channels *chs = &priv->channels; - struct mlx5_core_dev *mdev = priv->mdev; + struct mlx5e_params new_params; int err; mutex_lock(&priv->state_lock); - if (enable) { - err = mlx5e_set_rx_port_ts(mdev, false); - if (err) - goto out; - - chs->params.scatter_fcs_en = true; - err = mlx5e_modify_channels_scatter_fcs(chs, true); - if (err) { - chs->params.scatter_fcs_en = false; - mlx5e_set_rx_port_ts(mdev, true); - } - } else { - chs->params.scatter_fcs_en = false; - err = mlx5e_modify_channels_scatter_fcs(chs, false); - if (err) { - chs->params.scatter_fcs_en = true; - goto out; - } - err = mlx5e_set_rx_port_ts(mdev, true); - if (err) { - mlx5_core_warn(mdev, "Failed to set RX port timestamp %d\n", err); - err = 0; - } - } - -out: + new_params = chs->params; + new_params.scatter_fcs_en = enable; + err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap, + &new_params.scatter_fcs_en, true); mutex_unlock(&priv->state_lock); return err; } @@ -4061,6 +4005,10 @@ if (netdev->features & NETIF_F_GRO_HW) netdev_warn(netdev, "Disabling HW_GRO, not supported in switchdev mode\n"); + features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; + if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) + netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n"); + return features; } @@ -4071,6 +4019,9 @@ struct mlx5e_vlan_table *vlan; struct mlx5e_params *params; + if (!netif_device_present(netdev)) + return features; + vlan = mlx5e_fs_get_vlan(priv->fs); mutex_lock(&priv->state_lock); params = &priv->channels.params; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1421,6 +1421,7 @@ mlx5_lag_disable_change(esw->dev); down_write(&esw->mode_lock); mlx5_eswitch_disable_locked(esw); + esw->mode = MLX5_ESWITCH_LEGACY; up_write(&esw->mode_lock); mlx5_lag_enable_change(esw->dev); } diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/health.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/health.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/health.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/health.c @@ -677,6 +677,7 @@ mutex_lock(&dev->intf_state_mutex); if (test_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags)) { mlx5_core_err(dev, "health works are not permitted at this stage\n"); + mutex_unlock(&dev->intf_state_mutex); return; } mutex_unlock(&dev->intf_state_mutex); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c @@ -160,6 +160,44 @@ stats->tx_dropped = sstats->tx_queue_dropped; } +struct net_device *mlx5i_parent_get(struct net_device *netdev) +{ + struct mlx5e_priv *priv = mlx5i_epriv(netdev); + struct mlx5i_priv *ipriv, *parent_ipriv; + struct net_device *parent_dev; + int parent_ifindex; + + ipriv = priv->ppriv; + + parent_ifindex = netdev->netdev_ops->ndo_get_iflink(netdev); + parent_dev = dev_get_by_index(dev_net(netdev), parent_ifindex); + if (!parent_dev) + return NULL; + + parent_ipriv = netdev_priv(parent_dev); + + ASSERT_RTNL(); + parent_ipriv->num_sub_interfaces++; + + ipriv->parent_dev = parent_dev; + + return parent_dev; +} + +void mlx5i_parent_put(struct net_device *netdev) +{ + struct mlx5e_priv *priv = mlx5i_epriv(netdev); + struct mlx5i_priv *ipriv, *parent_ipriv; + + ipriv = priv->ppriv; + parent_ipriv = netdev_priv(ipriv->parent_dev); + + ASSERT_RTNL(); + parent_ipriv->num_sub_interfaces--; + + dev_put(ipriv->parent_dev); +} + int mlx5i_init_underlay_qp(struct mlx5e_priv *priv) { struct mlx5_core_dev *mdev = priv->mdev; diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -2082,7 +2082,7 @@ } } -static int __init init(void) +static int __init mlx5_init(void) { int err; @@ -2094,7 +2094,7 @@ mlx5_core_verify_params(); mlx5_register_debugfs(); - err = pci_register_driver(&mlx5_core_driver); + err = mlx5e_init(); if (err) goto err_debug; @@ -2105,25 +2105,25 @@ - err = mlx5e_init(); + err = pci_register_driver(&mlx5_core_driver); if (err) - goto err_en; + goto err_pci; return 0; -err_en: +err_pci: mlx5_sf_driver_unregister(); err_sf: - pci_unregister_driver(&mlx5_core_driver); + mlx5e_cleanup(); err_debug: mlx5_unregister_debugfs(); return err; } -static void __exit cleanup(void) +static void __exit mlx5_cleanup(void) { - mlx5e_cleanup(); - mlx5_sf_driver_unregister(); pci_unregister_driver(&mlx5_core_driver); + mlx5_sf_driver_unregister(); + mlx5e_cleanup(); mlx5_unregister_debugfs(); } -module_init(init); -module_exit(cleanup); +module_init(mlx5_init); +module_exit(mlx5_cleanup); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/realtek/r8169_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/realtek/r8169_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/realtek/r8169_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/realtek/r8169_main.c @@ -2003,10 +2003,7 @@ /* 8168F family. */ { 0x7c8, 0x488, RTL_GIGA_MAC_VER_38 }, - /* It seems this chip version never made it to - * the wild. Let's disable detection. - * { 0x7cf, 0x481, RTL_GIGA_MAC_VER_36 }, - */ + { 0x7cf, 0x481, RTL_GIGA_MAC_VER_36 }, { 0x7cf, 0x480, RTL_GIGA_MAC_VER_35 }, /* 8168E family. */ @@ -2217,28 +2214,6 @@ return 0; } -static void rtl_wol_enable_rx(struct rtl8169_private *tp) -{ - if (tp->mac_version >= RTL_GIGA_MAC_VER_25) - RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | - AcceptBroadcast | AcceptMulticast | AcceptMyPhys); -} - -static void rtl_prepare_power_down(struct rtl8169_private *tp) -{ - if (tp->dash_type != RTL_DASH_NONE) - return; - - if (tp->mac_version == RTL_GIGA_MAC_VER_32 || - tp->mac_version == RTL_GIGA_MAC_VER_33) - rtl_ephy_write(tp, 0x19, 0xff64); - - if (device_may_wakeup(tp_to_dev(tp))) { - phy_speed_down(tp->phydev, false); - rtl_wol_enable_rx(tp); - } -} - static void rtl_init_rxcfg(struct rtl8169_private *tp) { switch (tp->mac_version) { @@ -2462,6 +2437,31 @@ rtl_wait_txrx_fifo_empty(tp); } +static void rtl_wol_enable_rx(struct rtl8169_private *tp) +{ + if (tp->mac_version >= RTL_GIGA_MAC_VER_25) + RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | + AcceptBroadcast | AcceptMulticast | AcceptMyPhys); + + if (tp->mac_version >= RTL_GIGA_MAC_VER_40) + rtl_disable_rxdvgate(tp); +} + +static void rtl_prepare_power_down(struct rtl8169_private *tp) +{ + if (tp->dash_type != RTL_DASH_NONE) + return; + + if (tp->mac_version == RTL_GIGA_MAC_VER_32 || + tp->mac_version == RTL_GIGA_MAC_VER_33) + rtl_ephy_write(tp, 0x19, 0xff64); + + if (device_may_wakeup(tp_to_dev(tp))) { + phy_speed_down(tp->phydev, false); + rtl_wol_enable_rx(tp); + } +} + static void rtl_set_tx_config_registers(struct rtl8169_private *tp) { u32 val = TX_DMA_BURST << TxDMAShift | @@ -3887,7 +3887,7 @@ netdev_reset_queue(tp->dev); } -static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down) +static void rtl8169_cleanup(struct rtl8169_private *tp) { napi_disable(&tp->napi); @@ -3899,9 +3899,6 @@ rtl_rx_close(tp); - if (going_down && tp->dev->wol_enabled) - goto no_reset; - switch (tp->mac_version) { case RTL_GIGA_MAC_VER_28: case RTL_GIGA_MAC_VER_31: @@ -3922,7 +3919,7 @@ } rtl_hw_reset(tp); -no_reset: + rtl8169_tx_clear(tp); rtl8169_init_ring_indexes(tp); } @@ -3933,7 +3930,7 @@ netif_stop_queue(tp->dev); - rtl8169_cleanup(tp, false); + rtl8169_cleanup(tp); for (i = 0; i < NUM_RX_DESC; i++) rtl8169_mark_to_asic(tp->RxDescArray + i); @@ -4653,7 +4650,7 @@ pci_clear_master(tp->pci_dev); rtl_pci_commit(tp); - rtl8169_cleanup(tp, true); + rtl8169_cleanup(tp); rtl_disable_exit_l1(tp); rtl_prepare_power_down(tp); } diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/renesas/ravb_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/renesas/ravb_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/renesas/ravb_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/renesas/ravb_main.c @@ -1101,14 +1101,14 @@ ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS); if (eis & EIS_QFS) { ris2 = ravb_read(ndev, RIS2); - ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED), + ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED), RIS2); /* Receive Descriptor Empty int */ if (ris2 & RIS2_QFF0) priv->stats[RAVB_BE].rx_over_errors++; - /* Receive Descriptor Empty int */ + /* Receive Descriptor Empty int */ if (ris2 & RIS2_QFF1) priv->stats[RAVB_NC].rx_over_errors++; @@ -2973,6 +2973,9 @@ else ret = ravb_close(ndev); + if (priv->info->ccc_gac) + ravb_ptp_stop(ndev); + return ret; } @@ -3011,6 +3014,9 @@ /* Restore descriptor base address table */ ravb_write(ndev, priv->desc_bat_dma, DBAT); + if (priv->info->ccc_gac) + ravb_ptp_init(ndev, priv->pdev); + if (netif_running(ndev)) { if (priv->wol_enabled) { ret = ravb_wol_restore(ndev); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1077,7 +1077,8 @@ stmmac_mac_set(priv, priv->ioaddr, true); if (phy && priv->dma_cap.eee) { - priv->eee_active = phy_init_eee(phy, 1) >= 0; + priv->eee_active = + phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0; priv->eee_enabled = stmmac_eee_init(priv); priv->tx_lpi_enabled = priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true); @@ -1148,6 +1149,11 @@ int addr = priv->plat->phy_addr; struct phy_device *phydev; + if (addr < 0) { + netdev_err(priv->dev, "no phy found\n"); + return -ENODEV; + } + phydev = mdiobus_get_phy(priv->mii, addr); if (!phydev) { netdev_err(priv->dev, "no phy at addr %d\n", addr); diff -u linux-oem-6.1-6.1.0/drivers/net/ethernet/ti/am65-cpsw-nuss.c linux-oem-6.1-6.1.0/drivers/net/ethernet/ti/am65-cpsw-nuss.c --- linux-oem-6.1-6.1.0/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -500,7 +500,15 @@ k3_udma_glue_disable_tx_chn(common->tx_chns[i].tx_chn); } + reinit_completion(&common->tdown_complete); k3_udma_glue_tdown_rx_chn(common->rx_chns.rx_chn, true); + + if (common->pdata.quirks & AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ) { + i = wait_for_completion_timeout(&common->tdown_complete, msecs_to_jiffies(1000)); + if (!i) + dev_err(common->dev, "rx teardown timeout\n"); + } + napi_disable(&common->napi_rx); for (i = 0; i < AM65_CPSW_MAX_RX_FLOWS; i++) @@ -704,6 +712,8 @@ if (cppi5_desc_is_tdcm(desc_dma)) { dev_dbg(dev, "%s RX tdown flow: %u\n", __func__, flow_idx); + if (common->pdata.quirks & AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ) + complete(&common->tdown_complete); return 0; } @@ -2634,7 +2644,7 @@ }; static const struct am65_cpsw_pdata am64x_cpswxg_pdata = { - .quirks = 0, + .quirks = AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ, .ale_dev_id = "am64-cpswxg", .fdqring_mode = K3_RINGACC_RING_MODE_RING, }; diff -u linux-oem-6.1-6.1.0/drivers/net/ppp/ppp_generic.c linux-oem-6.1-6.1.0/drivers/net/ppp/ppp_generic.c --- linux-oem-6.1-6.1.0/drivers/net/ppp/ppp_generic.c +++ linux-oem-6.1-6.1.0/drivers/net/ppp/ppp_generic.c @@ -480,7 +480,7 @@ ret = -EFAULT; iov.iov_base = buf; iov.iov_len = count; - iov_iter_init(&to, READ, &iov, 1, count); + iov_iter_init(&to, ITER_DEST, &iov, 1, count); if (skb_copy_datagram_iter(skb, 0, &to, skb->len)) goto outf; ret = skb->len; diff -u linux-oem-6.1-6.1.0/drivers/net/vmxnet3/vmxnet3_drv.c linux-oem-6.1-6.1.0/drivers/net/vmxnet3/vmxnet3_drv.c --- linux-oem-6.1-6.1.0/drivers/net/vmxnet3/vmxnet3_drv.c +++ linux-oem-6.1-6.1.0/drivers/net/vmxnet3/vmxnet3_drv.c @@ -1546,31 +1546,6 @@ rxd->len = rbi->len; } -#ifdef VMXNET3_RSS - if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE && - (adapter->netdev->features & NETIF_F_RXHASH)) { - enum pkt_hash_types hash_type; - - switch (rcd->rssType) { - case VMXNET3_RCD_RSS_TYPE_IPV4: - case VMXNET3_RCD_RSS_TYPE_IPV6: - hash_type = PKT_HASH_TYPE_L3; - break; - case VMXNET3_RCD_RSS_TYPE_TCPIPV4: - case VMXNET3_RCD_RSS_TYPE_TCPIPV6: - case VMXNET3_RCD_RSS_TYPE_UDPIPV4: - case VMXNET3_RCD_RSS_TYPE_UDPIPV6: - hash_type = PKT_HASH_TYPE_L4; - break; - default: - hash_type = PKT_HASH_TYPE_L3; - break; - } - skb_set_hash(ctx->skb, - le32_to_cpu(rcd->rssHash), - hash_type); - } -#endif skb_record_rx_queue(ctx->skb, rq->qid); skb_put(ctx->skb, rcd->len); @@ -1653,6 +1628,31 @@ u32 mtu = adapter->netdev->mtu; skb->len += skb->data_len; +#ifdef VMXNET3_RSS + if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE && + (adapter->netdev->features & NETIF_F_RXHASH)) { + enum pkt_hash_types hash_type; + + switch (rcd->rssType) { + case VMXNET3_RCD_RSS_TYPE_IPV4: + case VMXNET3_RCD_RSS_TYPE_IPV6: + hash_type = PKT_HASH_TYPE_L3; + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV4: + case VMXNET3_RCD_RSS_TYPE_TCPIPV6: + case VMXNET3_RCD_RSS_TYPE_UDPIPV4: + case VMXNET3_RCD_RSS_TYPE_UDPIPV6: + hash_type = PKT_HASH_TYPE_L4; + break; + default: + hash_type = PKT_HASH_TYPE_L3; + break; + } + skb_set_hash(skb, + le32_to_cpu(rcd->rssHash), + hash_type); + } +#endif vmxnet3_rx_csum(adapter, skb, (union Vmxnet3_GenericDesc *)rcd); skb->protocol = eth_type_trans(skb, adapter->netdev); diff -u linux-oem-6.1-6.1.0/drivers/net/wireless/ath/ath11k/qmi.c linux-oem-6.1-6.1.0/drivers/net/wireless/ath/ath11k/qmi.c --- linux-oem-6.1-6.1.0/drivers/net/wireless/ath/ath11k/qmi.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/ath/ath11k/qmi.c @@ -1964,7 +1964,7 @@ continue; dma_free_coherent(ab->dev, - ab->qmi.target_mem[i].size, + ab->qmi.target_mem[i].prev_size, ab->qmi.target_mem[i].vaddr, ab->qmi.target_mem[i].paddr); ab->qmi.target_mem[i].vaddr = NULL; @@ -1985,12 +1985,12 @@ * in such case, no need to allocate memory for FW again. */ if (chunk->vaddr) { - if (chunk->prev_type == chunk->type || + if (chunk->prev_type == chunk->type && chunk->prev_size == chunk->size) continue; /* cannot reuse the existing chunk */ - dma_free_coherent(ab->dev, chunk->size, + dma_free_coherent(ab->dev, chunk->prev_size, chunk->vaddr, chunk->paddr); chunk->vaddr = NULL; } diff -u linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c --- linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1218,7 +1218,7 @@ BRCMF_NROF_H2D_COMMON_MSGRINGS; max_completionrings = BRCMF_NROF_D2H_COMMON_MSGRINGS; } - if (max_flowrings > 256) { + if (max_flowrings > 512) { brcmf_err(bus, "invalid max_flowrings(%d)\n", max_flowrings); return -EIO; } diff -u linux-oem-6.1-6.1.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c linux-oem-6.1-6.1.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c --- linux-oem-6.1-6.1.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4389,12 +4389,9 @@ void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, u8 macid, bool connect) { -#ifdef RTL8XXXU_GEN2_REPORT_CONNECT /* - * Barry Day reports this causes issues with 8192eu and 8723bu - * devices reconnecting. The reason for this is unclear, but - * until it is better understood, leave the code in place but - * disabled, so it is not lost. + * The firmware turns on the rate control when it knows it's + * connected to a network. */ struct h2c_cmd h2c; @@ -4407,7 +4404,6 @@ h2c.media_status_rpt.parm &= ~BIT(0); rtl8xxxu_gen2_h2c_cmd(priv, &h2c, sizeof(h2c.media_status_rpt)); -#endif } void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv) diff -u linux-oem-6.1-6.1.0/drivers/net/wwan/t7xx/t7xx_pci.c linux-oem-6.1-6.1.0/drivers/net/wwan/t7xx/t7xx_pci.c --- linux-oem-6.1-6.1.0/drivers/net/wwan/t7xx/t7xx_pci.c +++ linux-oem-6.1-6.1.0/drivers/net/wwan/t7xx/t7xx_pci.c @@ -123,6 +123,8 @@ iowrite32(T7XX_L1_BIT(0), IREG_BASE(t7xx_dev) + ENABLE_ASPM_LOWPWR); atomic_set(&t7xx_dev->md_pm_state, MTK_PM_RESUMED); + pm_runtime_mark_last_busy(&t7xx_dev->pdev->dev); + pm_runtime_allow(&t7xx_dev->pdev->dev); pm_runtime_put_noidle(&t7xx_dev->pdev->dev); } diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/core.c linux-oem-6.1-6.1.0/drivers/nvme/host/core.c --- linux-oem-6.1-6.1.0/drivers/nvme/host/core.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/core.c @@ -1088,7 +1088,7 @@ if (ns) { if (ns->head->effects) effects = le32_to_cpu(ns->head->effects->iocs[opcode]); - if (ns->head->ids.csi == NVME_CAP_CSS_NVM) + if (ns->head->ids.csi == NVME_CSI_NVM) effects |= nvme_known_nvm_effects(opcode); if (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC)) dev_warn_once(ctrl->device, @@ -3903,10 +3903,11 @@ return a->mode; } -static const struct attribute_group nvme_dev_attrs_group = { +const struct attribute_group nvme_dev_attrs_group = { .attrs = nvme_dev_attrs, .is_visible = nvme_dev_attrs_are_visible, }; +EXPORT_SYMBOL_GPL(nvme_dev_attrs_group); static const struct attribute_group *nvme_dev_attr_groups[] = { &nvme_dev_attrs_group, @@ -4839,8 +4840,7 @@ EXPORT_SYMBOL_GPL(nvme_complete_async_event); int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, - const struct blk_mq_ops *ops, unsigned int flags, - unsigned int cmd_size) + const struct blk_mq_ops *ops, unsigned int cmd_size) { int ret; @@ -4850,7 +4850,9 @@ if (ctrl->ops->flags & NVME_F_FABRICS) set->reserved_tags = NVMF_RESERVED_TAGS; set->numa_node = ctrl->numa_node; - set->flags = flags; + set->flags = BLK_MQ_F_NO_SCHED; + if (ctrl->ops->flags & NVME_F_BLOCKING) + set->flags |= BLK_MQ_F_BLOCKING; set->cmd_size = cmd_size; set->driver_data = ctrl; set->nr_hw_queues = 1; @@ -4879,7 +4881,9 @@ out_cleanup_admin_q: blk_mq_destroy_queue(ctrl->admin_q); out_free_tagset: - blk_mq_free_tag_set(ctrl->admin_tagset); + blk_mq_free_tag_set(set); + ctrl->admin_q = NULL; + ctrl->fabrics_q = NULL; return ret; } EXPORT_SYMBOL_GPL(nvme_alloc_admin_tag_set); @@ -4894,8 +4898,8 @@ EXPORT_SYMBOL_GPL(nvme_remove_admin_tag_set); int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, - const struct blk_mq_ops *ops, unsigned int flags, - unsigned int nr_maps, unsigned int cmd_size) + const struct blk_mq_ops *ops, unsigned int nr_maps, + unsigned int cmd_size) { int ret; @@ -4904,7 +4908,9 @@ set->queue_depth = ctrl->sqsize + 1; set->reserved_tags = NVMF_RESERVED_TAGS; set->numa_node = ctrl->numa_node; - set->flags = flags; + set->flags = BLK_MQ_F_SHOULD_MERGE; + if (ctrl->ops->flags & NVME_F_BLOCKING) + set->flags |= BLK_MQ_F_BLOCKING; set->cmd_size = cmd_size, set->driver_data = ctrl; set->nr_hw_queues = ctrl->queue_count - 1; @@ -4927,6 +4933,7 @@ out_free_tag_set: blk_mq_free_tag_set(set); + ctrl->connect_q = NULL; return ret; } EXPORT_SYMBOL_GPL(nvme_alloc_io_tag_set); @@ -5080,7 +5087,10 @@ ctrl->instance); ctrl->device->class = nvme_class; ctrl->device->parent = ctrl->dev; - ctrl->device->groups = nvme_dev_attr_groups; + if (ops->dev_attr_groups) + ctrl->device->groups = ops->dev_attr_groups; + else + ctrl->device->groups = nvme_dev_attr_groups; ctrl->device->release = nvme_free_ctrl; dev_set_drvdata(ctrl->device, ctrl); ret = dev_set_name(ctrl->device, "nvme%d", ctrl->instance); diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/fc.c linux-oem-6.1-6.1.0/drivers/nvme/host/fc.c --- linux-oem-6.1-6.1.0/drivers/nvme/host/fc.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/fc.c @@ -2903,7 +2903,7 @@ nvme_fc_init_io_queues(ctrl); ret = nvme_alloc_io_tag_set(&ctrl->ctrl, &ctrl->tag_set, - &nvme_fc_mq_ops, BLK_MQ_F_SHOULD_MERGE, 1, + &nvme_fc_mq_ops, 1, struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv, ctrl->lport->ops->fcprqst_priv_sz)); if (ret) @@ -3508,13 +3508,6 @@ nvme_fc_init_queue(ctrl, 0); - ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set, - &nvme_fc_admin_mq_ops, BLK_MQ_F_NO_SCHED, - struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv, - ctrl->lport->ops->fcprqst_priv_sz)); - if (ret) - goto out_free_queues; - /* * Would have been nice to init io queues tag set as well. * However, we require interaction from the controller @@ -3524,10 +3517,17 @@ ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_fc_ctrl_ops, 0); if (ret) - goto out_cleanup_tagset; + goto out_free_queues; /* at this point, teardown path changes to ref counting on nvme ctrl */ + ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set, + &nvme_fc_admin_mq_ops, + struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv, + ctrl->lport->ops->fcprqst_priv_sz)); + if (ret) + goto fail_ctrl; + spin_lock_irqsave(&rport->lock, flags); list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list); spin_unlock_irqrestore(&rport->lock, flags); @@ -3579,8 +3579,6 @@ return ERR_PTR(-EIO); -out_cleanup_tagset: - nvme_remove_admin_tag_set(&ctrl->ctrl); out_free_queues: kfree(ctrl->queues); out_free_ida: diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/nvme.h linux-oem-6.1-6.1.0/drivers/nvme/host/nvme.h --- linux-oem-6.1-6.1.0/drivers/nvme/host/nvme.h +++ linux-oem-6.1-6.1.0/drivers/nvme/host/nvme.h @@ -508,6 +508,9 @@ unsigned int flags; #define NVME_F_FABRICS (1 << 0) #define NVME_F_METADATA_SUPPORTED (1 << 1) +#define NVME_F_BLOCKING (1 << 2) + + const struct attribute_group **dev_attr_groups; int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val); int (*reg_write32)(struct nvme_ctrl *ctrl, u32 off, u32 val); int (*reg_read64)(struct nvme_ctrl *ctrl, u32 off, u64 *val); @@ -738,12 +741,11 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl); int nvme_init_ctrl_finish(struct nvme_ctrl *ctrl); int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, - const struct blk_mq_ops *ops, unsigned int flags, - unsigned int cmd_size); + const struct blk_mq_ops *ops, unsigned int cmd_size); void nvme_remove_admin_tag_set(struct nvme_ctrl *ctrl); int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, - const struct blk_mq_ops *ops, unsigned int flags, - unsigned int nr_maps, unsigned int cmd_size); + const struct blk_mq_ops *ops, unsigned int nr_maps, + unsigned int cmd_size); void nvme_remove_io_tag_set(struct nvme_ctrl *ctrl); void nvme_remove_namespaces(struct nvme_ctrl *ctrl); @@ -857,6 +859,7 @@ extern const struct attribute_group *nvme_ns_id_attr_groups[]; extern const struct pr_ops nvme_pr_ops; extern const struct block_device_operations nvme_ns_head_ops; +extern const struct attribute_group nvme_dev_attrs_group; struct nvme_ns *nvme_find_path(struct nvme_ns_head *head); #ifdef CONFIG_NVME_MULTIPATH diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/pci.c linux-oem-6.1-6.1.0/drivers/nvme/host/pci.c --- linux-oem-6.1-6.1.0/drivers/nvme/host/pci.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/pci.c @@ -109,6 +109,7 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown); static bool __nvme_disable_io_queues(struct nvme_dev *dev, u8 opcode); +static void nvme_update_attrs(struct nvme_dev *dev); /* * Represents an NVM Express device. Each nvme_dev is a PCI function. @@ -158,8 +159,6 @@ unsigned int nr_allocated_queues; unsigned int nr_write_queues; unsigned int nr_poll_queues; - - bool attrs_added; }; static int io_queue_depth_set(const char *val, const struct kernel_param *kp) @@ -1367,7 +1366,7 @@ else nvme_poll_irqdisable(nvmeq); - if (blk_mq_request_completed(req)) { + if (blk_mq_rq_state(req) != MQ_RQ_IN_FLIGHT) { dev_warn(dev->ctrl.device, "I/O %d QID %d timeout, completion polled\n", req->tag, nvmeq->qid); @@ -1969,6 +1968,8 @@ if ((dev->cmbsz & (NVME_CMBSZ_WDS | NVME_CMBSZ_RDS)) == (NVME_CMBSZ_WDS | NVME_CMBSZ_RDS)) pci_p2pmem_publish(pdev, true); + + nvme_update_attrs(dev); } static int nvme_set_host_mem(struct nvme_dev *dev, u32 bits) @@ -2241,11 +2242,22 @@ NULL, }; -static const struct attribute_group nvme_pci_attr_group = { +static const struct attribute_group nvme_pci_dev_attrs_group = { .attrs = nvme_pci_attrs, .is_visible = nvme_pci_attrs_are_visible, }; +static const struct attribute_group *nvme_pci_dev_attr_groups[] = { + &nvme_dev_attrs_group, + &nvme_pci_dev_attrs_group, + NULL, +}; + +static void nvme_update_attrs(struct nvme_dev *dev) +{ + sysfs_update_group(&dev->ctrl.device->kobj, &nvme_pci_dev_attrs_group); +} + /* * nirqs is the number of interrupts available for write and read * queues. The core already reserved an interrupt for the admin queue. @@ -2935,10 +2947,6 @@ goto out; } - if (!dev->attrs_added && !sysfs_create_group(&dev->ctrl.device->kobj, - &nvme_pci_attr_group)) - dev->attrs_added = true; - nvme_start_ctrl(&dev->ctrl); return; @@ -3011,6 +3019,7 @@ .name = "pcie", .module = THIS_MODULE, .flags = NVME_F_METADATA_SUPPORTED, + .dev_attr_groups = nvme_pci_dev_attr_groups, .reg_read32 = nvme_pci_reg_read32, .reg_write32 = nvme_pci_reg_write32, .reg_read64 = nvme_pci_reg_read64, @@ -3209,13 +3218,6 @@ nvme_disable_prepare_reset(dev, true); } -static void nvme_remove_attrs(struct nvme_dev *dev) -{ - if (dev->attrs_added) - sysfs_remove_group(&dev->ctrl.device->kobj, - &nvme_pci_attr_group); -} - /* * The driver's remove may be called on a device in a partially initialized * state. This function must not have any dependencies on the device state in @@ -3237,7 +3239,6 @@ nvme_stop_ctrl(&dev->ctrl); nvme_remove_namespaces(&dev->ctrl); nvme_dev_disable(dev, true); - nvme_remove_attrs(dev); nvme_free_host_mem(dev); nvme_dev_remove_admin(dev); nvme_free_queues(dev, 0); diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/rdma.c linux-oem-6.1-6.1.0/drivers/nvme/host/rdma.c --- linux-oem-6.1-6.1.0/drivers/nvme/host/rdma.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/rdma.c @@ -798,7 +798,7 @@ NVME_RDMA_METADATA_SGL_SIZE; return nvme_alloc_io_tag_set(ctrl, &to_rdma_ctrl(ctrl)->tag_set, - &nvme_rdma_mq_ops, BLK_MQ_F_SHOULD_MERGE, + &nvme_rdma_mq_ops, ctrl->opts->nr_poll_queues ? HCTX_MAX_TYPES : 2, cmd_size); } @@ -848,7 +848,6 @@ if (new) { error = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set, &nvme_rdma_admin_mq_ops, - BLK_MQ_F_NO_SCHED, sizeof(struct nvme_rdma_request) + NVME_RDMA_DATA_SGL_SIZE); if (error) @@ -1155,13 +1154,13 @@ struct nvme_rdma_ctrl *ctrl = container_of(work, struct nvme_rdma_ctrl, err_work); - nvme_auth_stop(&ctrl->ctrl); nvme_stop_keep_alive(&ctrl->ctrl); flush_work(&ctrl->ctrl.async_event_work); nvme_rdma_teardown_io_queues(ctrl, false); nvme_start_queues(&ctrl->ctrl); nvme_rdma_teardown_admin_queue(ctrl, false); nvme_start_admin_queue(&ctrl->ctrl); + nvme_auth_stop(&ctrl->ctrl); if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { /* state change failure is ok if we started ctrl delete */ diff -u linux-oem-6.1-6.1.0/drivers/nvme/host/tcp.c linux-oem-6.1-6.1.0/drivers/nvme/host/tcp.c --- linux-oem-6.1-6.1.0/drivers/nvme/host/tcp.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/tcp.c @@ -301,7 +301,7 @@ if (!iov_iter_count(&req->iter) && req->data_sent < req->data_len) { req->curr_bio = req->curr_bio->bi_next; - nvme_tcp_init_iter(req, WRITE); + nvme_tcp_init_iter(req, ITER_SOURCE); } } @@ -781,7 +781,7 @@ nvme_tcp_init_recv_ctx(queue); return -EIO; } - nvme_tcp_init_iter(req, READ); + nvme_tcp_init_iter(req, ITER_DEST); } /* we can read only from what is left in this bio */ @@ -1867,7 +1867,6 @@ if (new) { ret = nvme_alloc_io_tag_set(ctrl, &to_tcp_ctrl(ctrl)->tag_set, &nvme_tcp_mq_ops, - BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING, ctrl->opts->nr_poll_queues ? HCTX_MAX_TYPES : 2, sizeof(struct nvme_tcp_request)); if (ret) @@ -1943,7 +1942,7 @@ if (new) { error = nvme_alloc_admin_tag_set(ctrl, &to_tcp_ctrl(ctrl)->admin_tag_set, - &nvme_tcp_admin_mq_ops, BLK_MQ_F_BLOCKING, + &nvme_tcp_admin_mq_ops, sizeof(struct nvme_tcp_request)); if (error) goto out_free_queue; @@ -2129,7 +2128,6 @@ struct nvme_tcp_ctrl, err_work); struct nvme_ctrl *ctrl = &tcp_ctrl->ctrl; - nvme_auth_stop(ctrl); nvme_stop_keep_alive(ctrl); flush_work(&ctrl->async_event_work); nvme_tcp_teardown_io_queues(ctrl, false); @@ -2137,6 +2135,7 @@ nvme_start_queues(ctrl); nvme_tcp_teardown_admin_queue(ctrl, false); nvme_start_admin_queue(ctrl); + nvme_auth_stop(ctrl); if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING)) { /* state change failure is ok if we started ctrl delete */ @@ -2524,7 +2523,7 @@ static const struct nvme_ctrl_ops nvme_tcp_ctrl_ops = { .name = "tcp", .module = THIS_MODULE, - .flags = NVME_F_FABRICS, + .flags = NVME_F_FABRICS | NVME_F_BLOCKING, .reg_read32 = nvmf_reg_read32, .reg_read64 = nvmf_reg_read64, .reg_write32 = nvmf_reg_write32, diff -u linux-oem-6.1-6.1.0/drivers/nvme/target/io-cmd-file.c linux-oem-6.1-6.1.0/drivers/nvme/target/io-cmd-file.c --- linux-oem-6.1-6.1.0/drivers/nvme/target/io-cmd-file.c +++ linux-oem-6.1-6.1.0/drivers/nvme/target/io-cmd-file.c @@ -92,10 +92,10 @@ if (req->cmd->rw.control & cpu_to_le16(NVME_RW_FUA)) ki_flags |= IOCB_DSYNC; call_iter = req->ns->file->f_op->write_iter; - rw = WRITE; + rw = ITER_SOURCE; } else { call_iter = req->ns->file->f_op->read_iter; - rw = READ; + rw = ITER_DEST; } iov_iter_bvec(&iter, rw, req->f.bvec, nr_segs, count); diff -u linux-oem-6.1-6.1.0/drivers/nvme/target/loop.c linux-oem-6.1-6.1.0/drivers/nvme/target/loop.c --- linux-oem-6.1-6.1.0/drivers/nvme/target/loop.c +++ linux-oem-6.1-6.1.0/drivers/nvme/target/loop.c @@ -353,7 +353,7 @@ ctrl->ctrl.queue_count = 1; error = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set, - &nvme_loop_admin_mq_ops, BLK_MQ_F_NO_SCHED, + &nvme_loop_admin_mq_ops, sizeof(struct nvme_loop_iod) + NVME_INLINE_SG_CNT * sizeof(struct scatterlist)); if (error) @@ -494,7 +494,7 @@ return ret; ret = nvme_alloc_io_tag_set(&ctrl->ctrl, &ctrl->tag_set, - &nvme_loop_mq_ops, BLK_MQ_F_SHOULD_MERGE, 1, + &nvme_loop_mq_ops, 1, sizeof(struct nvme_loop_iod) + NVME_INLINE_SG_CNT * sizeof(struct scatterlist)); if (ret) diff -u linux-oem-6.1-6.1.0/drivers/of/fdt.c linux-oem-6.1-6.1.0/drivers/of/fdt.c --- linux-oem-6.1-6.1.0/drivers/of/fdt.c +++ linux-oem-6.1-6.1.0/drivers/of/fdt.c @@ -26,7 +26,6 @@ #include #include #include -#include #include /* for COMMAND_LINE_SIZE */ #include @@ -525,12 +524,9 @@ size = dt_mem_next_cell(dt_root_size_cells, &prop); if (size && - early_init_dt_reserve_memory(base, size, nomap) == 0) { + early_init_dt_reserve_memory(base, size, nomap) == 0) pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M)); - if (!nomap) - kmemleak_alloc_phys(base, size, 0); - } else pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M)); @@ -1163,18 +1159,32 @@ if (node < 0) node = fdt_path_offset(fdt, "/chosen@0"); if (node < 0) - return -ENOENT; + /* Handle the cmdline config options even if no /chosen node */ + goto handle_cmdline; chosen_node_offset = node; early_init_dt_check_for_initrd(node); early_init_dt_check_for_elfcorehdr(node); + rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l); + if (rng_seed && l > 0) { + add_bootloader_randomness(rng_seed, l); + + /* try to clear seed so it won't be found. */ + fdt_nop_property(initial_boot_params, node, "rng-seed"); + + /* update CRC check value */ + of_fdt_crc32 = crc32_be(~0, initial_boot_params, + fdt_totalsize(initial_boot_params)); + } + /* Retrieve command line */ p = of_get_flat_dt_prop(node, "bootargs", &l); if (p != NULL && l > 0) strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE)); +handle_cmdline: /* * CONFIG_CMDLINE is meant to be a default in case nothing else * managed to set the command line, unless CONFIG_CMDLINE_FORCE @@ -1195,18 +1205,6 @@ pr_debug("Command line is: %s\n", (char *)cmdline); - rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l); - if (rng_seed && l > 0) { - add_bootloader_randomness(rng_seed, l); - - /* try to clear seed so it won't be found. */ - fdt_nop_property(initial_boot_params, node, "rng-seed"); - - /* update CRC check value */ - of_fdt_crc32 = crc32_be(~0, initial_boot_params, - fdt_totalsize(initial_boot_params)); - } - return 0; } diff -u linux-oem-6.1-6.1.0/drivers/pci/pci.c linux-oem-6.1-6.1.0/drivers/pci/pci.c --- linux-oem-6.1-6.1.0/drivers/pci/pci.c +++ linux-oem-6.1-6.1.0/drivers/pci/pci.c @@ -1665,7 +1665,6 @@ return i; pci_save_ltr_state(dev); - pci_save_aspm_l1ss_state(dev); pci_save_dpc_state(dev); pci_save_aer_state(dev); pci_save_ptm_state(dev); @@ -1772,7 +1771,6 @@ * LTR itself (in the PCIe capability). */ pci_restore_ltr_state(dev); - pci_restore_aspm_l1ss_state(dev); pci_restore_pcie_state(dev); pci_restore_pasid_state(dev); @@ -3465,11 +3463,6 @@ if (error) pci_err(dev, "unable to allocate suspend buffer for LTR\n"); - error = pci_add_ext_cap_save_buffer(dev, PCI_EXT_CAP_ID_L1SS, - 2 * sizeof(u32)); - if (error) - pci_err(dev, "unable to allocate suspend buffer for ASPM-L1SS\n"); - pci_allocate_vc_save_buffers(dev); } diff -u linux-oem-6.1-6.1.0/drivers/pci/pcie/aspm.c linux-oem-6.1-6.1.0/drivers/pci/pcie/aspm.c --- linux-oem-6.1-6.1.0/drivers/pci/pcie/aspm.c +++ linux-oem-6.1-6.1.0/drivers/pci/pcie/aspm.c @@ -470,31 +470,6 @@ pci_write_config_dword(pdev, pos, val); } -static void aspm_program_l1ss(struct pci_dev *dev, u32 ctl1, u32 ctl2) -{ - u16 l1ss = dev->l1ss; - u32 l1_2_enable; - - /* - * Per PCIe r6.0, sec 5.5.4, T_POWER_ON in PCI_L1SS_CTL2 must be - * programmed prior to setting the L1.2 enable bits in PCI_L1SS_CTL1. - */ - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL2, ctl2); - - /* - * In addition, Common_Mode_Restore_Time and LTR_L1.2_THRESHOLD in - * PCI_L1SS_CTL1 must be programmed *before* setting the L1.2 - * enable bits, even though they're all in PCI_L1SS_CTL1. - */ - l1_2_enable = ctl1 & PCI_L1SS_CTL1_L1_2_MASK; - ctl1 &= ~PCI_L1SS_CTL1_L1_2_MASK; - - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL1, ctl1); - if (l1_2_enable) - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL1, - ctl1 | l1_2_enable); -} - /* Calculate L1.2 PM substate timing parameters */ static void aspm_calc_l1ss_info(struct pcie_link_state *link, u32 parent_l1ss_cap, u32 child_l1ss_cap) @@ -504,6 +479,7 @@ u32 t_common_mode, t_power_on, l1_2_threshold, scale, value; u32 ctl1 = 0, ctl2 = 0; u32 pctl1, pctl2, cctl1, cctl2; + u32 pl1_2_enables, cl1_2_enables; if (!(link->aspm_support & ASPM_STATE_L1_2_MASK)) return; @@ -552,21 +528,39 @@ ctl2 == pctl2 && ctl2 == cctl2) return; - pctl1 &= ~(PCI_L1SS_CTL1_CM_RESTORE_TIME | - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | - PCI_L1SS_CTL1_LTR_L12_TH_SCALE); - pctl1 |= (ctl1 & (PCI_L1SS_CTL1_CM_RESTORE_TIME | - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | - PCI_L1SS_CTL1_LTR_L12_TH_SCALE)); - aspm_program_l1ss(parent, pctl1, ctl2); - - cctl1 &= ~(PCI_L1SS_CTL1_CM_RESTORE_TIME | - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | - PCI_L1SS_CTL1_LTR_L12_TH_SCALE); - cctl1 |= (ctl1 & (PCI_L1SS_CTL1_CM_RESTORE_TIME | - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | - PCI_L1SS_CTL1_LTR_L12_TH_SCALE)); - aspm_program_l1ss(child, cctl1, ctl2); + /* Disable L1.2 while updating. See PCIe r5.0, sec 5.5.4, 7.8.3.3 */ + pl1_2_enables = pctl1 & PCI_L1SS_CTL1_L1_2_MASK; + cl1_2_enables = cctl1 & PCI_L1SS_CTL1_L1_2_MASK; + + if (pl1_2_enables || cl1_2_enables) { + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, + PCI_L1SS_CTL1_L1_2_MASK, 0); + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, + PCI_L1SS_CTL1_L1_2_MASK, 0); + } + + /* Program T_POWER_ON times in both ports */ + pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, ctl2); + pci_write_config_dword(child, child->l1ss + PCI_L1SS_CTL2, ctl2); + + /* Program Common_Mode_Restore_Time in upstream device */ + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, + PCI_L1SS_CTL1_CM_RESTORE_TIME, ctl1); + + /* Program LTR_L1.2_THRESHOLD time in both ports */ + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, + PCI_L1SS_CTL1_LTR_L12_TH_VALUE | + PCI_L1SS_CTL1_LTR_L12_TH_SCALE, ctl1); + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, + PCI_L1SS_CTL1_LTR_L12_TH_VALUE | + PCI_L1SS_CTL1_LTR_L12_TH_SCALE, ctl1); + + if (pl1_2_enables || cl1_2_enables) { + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, 0, + pl1_2_enables); + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, 0, + cl1_2_enables); + } } static void aspm_l1ss_init(struct pcie_link_state *link) @@ -758,43 +752,6 @@ PCI_L1SS_CTL1_L1SS_MASK, val); } -void pci_save_aspm_l1ss_state(struct pci_dev *dev) -{ - struct pci_cap_saved_state *save_state; - u16 l1ss = dev->l1ss; - u32 *cap; - - if (!l1ss) - return; - - save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_L1SS); - if (!save_state) - return; - - cap = (u32 *)&save_state->cap.data[0]; - pci_read_config_dword(dev, l1ss + PCI_L1SS_CTL2, cap++); - pci_read_config_dword(dev, l1ss + PCI_L1SS_CTL1, cap++); -} - -void pci_restore_aspm_l1ss_state(struct pci_dev *dev) -{ - struct pci_cap_saved_state *save_state; - u32 *cap, ctl1, ctl2; - u16 l1ss = dev->l1ss; - - if (!l1ss) - return; - - save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_L1SS); - if (!save_state) - return; - - cap = (u32 *)&save_state->cap.data[0]; - ctl2 = *cap++; - ctl1 = *cap; - aspm_program_l1ss(dev, ctl1, ctl2); -} - static void pcie_config_aspm_dev(struct pci_dev *pdev, u32 val) { pcie_capability_clear_and_set_word(pdev, PCI_EXP_LNKCTL, diff -u linux-oem-6.1-6.1.0/drivers/phy/qualcomm/phy-qcom-qmp-combo.c linux-oem-6.1-6.1.0/drivers/phy/qualcomm/phy-qcom-qmp-combo.c --- linux-oem-6.1-6.1.0/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ linux-oem-6.1-6.1.0/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2296,15 +2296,11 @@ static int __maybe_unused qmp_combo_runtime_suspend(struct device *dev) { struct qcom_qmp *qmp = dev_get_drvdata(dev); - struct qmp_phy *qphy = qmp->phys[0]; + struct qmp_phy *qphy = qmp->usb_phy; const struct qmp_phy_cfg *cfg = qphy->cfg; dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qphy->mode); - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type != PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; @@ -2321,16 +2317,12 @@ static int __maybe_unused qmp_combo_runtime_resume(struct device *dev) { struct qcom_qmp *qmp = dev_get_drvdata(dev); - struct qmp_phy *qphy = qmp->phys[0]; + struct qmp_phy *qphy = qmp->usb_phy; const struct qmp_phy_cfg *cfg = qphy->cfg; int ret = 0; dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qphy->mode); - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type != PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; diff -u linux-oem-6.1-6.1.0/drivers/platform/x86/asus-wmi.c linux-oem-6.1-6.1.0/drivers/platform/x86/asus-wmi.c --- linux-oem-6.1-6.1.0/drivers/platform/x86/asus-wmi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/asus-wmi.c @@ -225,6 +225,7 @@ int tablet_switch_event_code; u32 tablet_switch_dev_id; + bool tablet_switch_inverted; enum fan_type fan_type; enum fan_type gpu_fan_type; @@ -493,6 +494,13 @@ } /* Input **********************************************************************/ +static void asus_wmi_tablet_sw_report(struct asus_wmi *asus, bool value) +{ + input_report_switch(asus->inputdev, SW_TABLET_MODE, + asus->tablet_switch_inverted ? !value : value); + input_sync(asus->inputdev); +} + static void asus_wmi_tablet_sw_init(struct asus_wmi *asus, u32 dev_id, int event_code) { struct device *dev = &asus->platform_device->dev; @@ -501,7 +509,7 @@ result = asus_wmi_get_devstate_simple(asus, dev_id); if (result >= 0) { input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); - input_report_switch(asus->inputdev, SW_TABLET_MODE, result); + asus_wmi_tablet_sw_report(asus, result); asus->tablet_switch_dev_id = dev_id; asus->tablet_switch_event_code = event_code; } else if (result == -ENODEV) { @@ -534,6 +542,7 @@ case asus_wmi_no_tablet_switch: break; case asus_wmi_kbd_dock_devid: + asus->tablet_switch_inverted = true; asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_KBD_DOCK, NOTIFY_KBD_DOCK_CHANGE); break; case asus_wmi_lid_flip_devid: @@ -573,10 +582,8 @@ return; result = asus_wmi_get_devstate_simple(asus, asus->tablet_switch_dev_id); - if (result >= 0) { - input_report_switch(asus->inputdev, SW_TABLET_MODE, result); - input_sync(asus->inputdev); - } + if (result >= 0) + asus_wmi_tablet_sw_report(asus, result); } /* dGPU ********************************************************************/ @@ -2243,7 +2250,9 @@ asus->fan_type = FAN_TYPE_NONE; asus->agfn_pwm = -1; - if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL)) + if (asus->driver->quirks->wmi_ignore_fan) + asus->fan_type = FAN_TYPE_NONE; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL)) asus->fan_type = FAN_TYPE_SPEC83; else if (asus_wmi_has_agfn_fan(asus)) asus->fan_type = FAN_TYPE_AGFN; @@ -2436,6 +2445,9 @@ *available = false; + if (asus->fan_type == FAN_TYPE_NONE) + return 0; + err = fan_curve_get_factory_default(asus, fan_dev); if (err) { return 0; diff -u linux-oem-6.1-6.1.0/drivers/platform/x86/ideapad-laptop.c linux-oem-6.1-6.1.0/drivers/platform/x86/ideapad-laptop.c --- linux-oem-6.1-6.1.0/drivers/platform/x86/ideapad-laptop.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/ideapad-laptop.c @@ -1615,6 +1615,12 @@ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion R7000P2020H"), } }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion 5 15ARH05"), + } + }, {} }; diff -u linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/clk_and_regulator.c linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/clk_and_regulator.c --- linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/clk_and_regulator.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/clk_and_regulator.c @@ -181,6 +181,9 @@ return PTR_ERR(int3472->regulator.gpio); } + /* Ensure the pin is in output mode and non-active state */ + gpiod_direction_output(int3472->regulator.gpio, 0); + cfg.dev = &int3472->adev->dev; cfg.init_data = &init_data; cfg.ena_gpiod = int3472->regulator.gpio; diff -u linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/discrete.c linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/discrete.c --- linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/discrete.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/intel/int3472/discrete.c @@ -174,6 +174,8 @@ return (PTR_ERR(gpio)); int3472->clock.ena_gpio = gpio; + /* Ensure the pin is in output mode and non-active state */ + gpiod_direction_output(int3472->clock.ena_gpio, 0); break; case INT3472_GPIO_TYPE_PRIVACY_LED: gpio = acpi_get_and_request_gpiod(path, pin, "int3472,privacy-led"); @@ -181,6 +183,8 @@ return (PTR_ERR(gpio)); int3472->clock.led_gpio = gpio; + /* Ensure the pin is in output mode and non-active state */ + gpiod_direction_output(int3472->clock.led_gpio, 0); break; default: dev_err(int3472->dev, "Invalid GPIO type 0x%02x for clock\n", type); diff -u linux-oem-6.1-6.1.0/drivers/platform/x86/thinkpad_acpi.c linux-oem-6.1-6.1.0/drivers/platform/x86/thinkpad_acpi.c --- linux-oem-6.1-6.1.0/drivers/platform/x86/thinkpad_acpi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/thinkpad_acpi.c @@ -5566,7 +5566,7 @@ static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev) { - return (light_get_status() == 1) ? LED_FULL : LED_OFF; + return (light_get_status() == 1) ? LED_ON : LED_OFF; } static struct tpacpi_led_classdev tpacpi_led_thinklight = { @@ -10315,9 +10315,11 @@ static int dytc_capabilities; static bool dytc_mmc_get_available; -static int convert_dytc_to_profile(int dytcmode, enum platform_profile_option *profile) +static int convert_dytc_to_profile(int funcmode, int dytcmode, + enum platform_profile_option *profile) { - if (dytc_capabilities & BIT(DYTC_FC_MMC)) { + switch (funcmode) { + case DYTC_FUNCTION_MMC: switch (dytcmode) { case DYTC_MODE_MMC_LOWPOWER: *profile = PLATFORM_PROFILE_LOW_POWER; @@ -10333,8 +10335,7 @@ return -EINVAL; } return 0; - } - if (dytc_capabilities & BIT(DYTC_FC_PSC)) { + case DYTC_FUNCTION_PSC: switch (dytcmode) { case DYTC_MODE_PSC_LOWPOWER: *profile = PLATFORM_PROFILE_LOW_POWER; @@ -10348,6 +10349,14 @@ default: /* Unknown mode */ return -EINVAL; } + return 0; + case DYTC_FUNCTION_AMT: + /* For now return balanced. It's the closest we have to 'auto' */ + *profile = PLATFORM_PROFILE_BALANCED; + return 0; + default: + /* Unknown function */ + return -EOPNOTSUPP; } return 0; } @@ -10491,11 +10500,11 @@ if (err) goto unlock; } - } - if (dytc_capabilities & BIT(DYTC_FC_PSC)) { + } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output); if (err) goto unlock; + /* system supports AMT, activate it when on balanced */ if (dytc_capabilities & BIT(DYTC_FC_AMT)) dytc_control_amt(profile == PLATFORM_PROFILE_BALANCED); @@ -10511,7 +10520,7 @@ { enum platform_profile_option profile; int output, err = 0; - int perfmode; + int perfmode, funcmode; mutex_lock(&dytc_mutex); if (dytc_capabilities & BIT(DYTC_FC_MMC)) { @@ -10519,15 +10528,18 @@ err = dytc_command(DYTC_CMD_MMC_GET, &output); else err = dytc_cql_command(DYTC_CMD_GET, &output); - } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) + funcmode = DYTC_FUNCTION_MMC; + } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { err = dytc_command(DYTC_CMD_GET, &output); - + /* Check if we are PSC mode, or have AMT enabled */ + funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF; + } mutex_unlock(&dytc_mutex); if (err) return; perfmode = (output >> DYTC_GET_MODE_BIT) & 0xF; - convert_dytc_to_profile(perfmode, &profile); + convert_dytc_to_profile(funcmode, perfmode, &profile); if (profile != dytc_current_profile) { dytc_current_profile = profile; platform_profile_notify(); diff -u linux-oem-6.1-6.1.0/drivers/scsi/hpsa.c linux-oem-6.1-6.1.0/drivers/scsi/hpsa.c --- linux-oem-6.1-6.1.0/drivers/scsi/hpsa.c +++ linux-oem-6.1-6.1.0/drivers/scsi/hpsa.c @@ -5850,7 +5850,7 @@ { struct Scsi_Host *sh; - sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h)); + sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info)); if (sh == NULL) { dev_err(&h->pdev->dev, "scsi_host_alloc failed\n"); return -ENOMEM; diff -u linux-oem-6.1-6.1.0/drivers/soc/qcom/apr.c linux-oem-6.1-6.1.0/drivers/soc/qcom/apr.c --- linux-oem-6.1-6.1.0/drivers/soc/qcom/apr.c +++ linux-oem-6.1-6.1.0/drivers/soc/qcom/apr.c @@ -461,9 +461,10 @@ goto out; } + /* Protection domain is optional, it does not exist on older platforms */ ret = of_property_read_string_index(np, "qcom,protection-domain", 1, &adev->service_path); - if (ret < 0) { + if (ret < 0 && ret != -EINVAL) { dev_err(dev, "Failed to read second value of qcom,protection-domain\n"); goto out; } diff -u linux-oem-6.1-6.1.0/drivers/spi/spidev.c linux-oem-6.1-6.1.0/drivers/spi/spidev.c --- linux-oem-6.1-6.1.0/drivers/spi/spidev.c +++ linux-oem-6.1-6.1.0/drivers/spi/spidev.c @@ -601,7 +601,6 @@ if (!spidev->tx_buffer) { spidev->tx_buffer = kmalloc(bufsiz, GFP_KERNEL); if (!spidev->tx_buffer) { - dev_dbg(&spidev->spi->dev, "open/ENOMEM\n"); status = -ENOMEM; goto err_find_dev; } @@ -610,7 +609,6 @@ if (!spidev->rx_buffer) { spidev->rx_buffer = kmalloc(bufsiz, GFP_KERNEL); if (!spidev->rx_buffer) { - dev_dbg(&spidev->spi->dev, "open/ENOMEM\n"); status = -ENOMEM; goto err_alloc_rx_buf; } diff -u linux-oem-6.1-6.1.0/drivers/thermal/thermal_core.c linux-oem-6.1-6.1.0/drivers/thermal/thermal_core.c --- linux-oem-6.1-6.1.0/drivers/thermal/thermal_core.c +++ linux-oem-6.1-6.1.0/drivers/thermal/thermal_core.c @@ -603,8 +603,7 @@ struct thermal_instance *pos; struct thermal_zone_device *pos1; struct thermal_cooling_device *pos2; - unsigned long max_state; - int result, ret; + int result; if (trip >= tz->num_trips || trip < 0) return -EINVAL; @@ -621,15 +620,11 @@ if (tz != pos1 || cdev != pos2) return -EINVAL; - ret = cdev->ops->get_max_state(cdev, &max_state); - if (ret) - return ret; - /* lower default 0, upper default max_state */ lower = lower == THERMAL_NO_LIMIT ? 0 : lower; - upper = upper == THERMAL_NO_LIMIT ? max_state : upper; + upper = upper == THERMAL_NO_LIMIT ? cdev->max_state : upper; - if (lower > upper || upper > max_state) + if (lower > upper || upper > cdev->max_state) return -EINVAL; dev = kzalloc(sizeof(*dev), GFP_KERNEL); @@ -896,12 +891,22 @@ cdev->updated = false; cdev->device.class = &thermal_class; cdev->devdata = devdata; + + ret = cdev->ops->get_max_state(cdev, &cdev->max_state); + if (ret) { + kfree(cdev->type); + goto out_ida_remove; + } + thermal_cooling_device_setup_sysfs(cdev); + ret = dev_set_name(&cdev->device, "cooling_device%d", cdev->id); if (ret) { + kfree(cdev->type); thermal_cooling_device_destroy_sysfs(cdev); - goto out_kfree_type; + goto out_ida_remove; } + ret = device_register(&cdev->device); if (ret) goto out_kfree_type; @@ -927,6 +932,8 @@ thermal_cooling_device_destroy_sysfs(cdev); kfree(cdev->type); put_device(&cdev->device); + + /* thermal_release() takes care of the rest */ cdev = NULL; out_ida_remove: ida_free(&thermal_cdev_ida, id); diff -u linux-oem-6.1-6.1.0/drivers/tty/serial/amba-pl011.c linux-oem-6.1-6.1.0/drivers/tty/serial/amba-pl011.c --- linux-oem-6.1-6.1.0/drivers/tty/serial/amba-pl011.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/amba-pl011.c @@ -1467,6 +1467,10 @@ struct circ_buf *xmit = &uap->port.state->xmit; int count = uap->fifosize >> 1; + if ((uap->port.rs485.flags & SER_RS485_ENABLED) && + !uap->rs485_tx_started) + pl011_rs485_tx_start(uap); + if (uap->port.x_char) { if (!pl011_tx_char(uap, uap->port.x_char, from_irq)) return true; @@ -1478,10 +1482,6 @@ return false; } - if ((uap->port.rs485.flags & SER_RS485_ENABLED) && - !uap->rs485_tx_started) - pl011_rs485_tx_start(uap); - /* If we are using DMA mode, try to send some characters. */ if (pl011_dma_tx_irq(uap)) return true; diff -u linux-oem-6.1-6.1.0/drivers/tty/serial/pch_uart.c linux-oem-6.1-6.1.0/drivers/tty/serial/pch_uart.c --- linux-oem-6.1-6.1.0/drivers/tty/serial/pch_uart.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/pch_uart.c @@ -752,7 +752,7 @@ } xmit->tail &= UART_XMIT_SIZE - 1; async_tx_ack(priv->desc_tx); - dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); + dma_unmap_sg(port->dev, priv->sg_tx_p, priv->orig_nent, DMA_TO_DEVICE); priv->tx_dma_use = 0; priv->nent = 0; priv->orig_nent = 0; diff -u linux-oem-6.1-6.1.0/drivers/tty/serial/stm32-usart.c linux-oem-6.1-6.1.0/drivers/tty/serial/stm32-usart.c --- linux-oem-6.1-6.1.0/drivers/tty/serial/stm32-usart.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/stm32-usart.c @@ -798,25 +798,11 @@ spin_unlock(&port->lock); } - if (stm32_usart_rx_dma_enabled(port)) - return IRQ_WAKE_THREAD; - else - return IRQ_HANDLED; -} - -static irqreturn_t stm32_usart_threaded_interrupt(int irq, void *ptr) -{ - struct uart_port *port = ptr; - struct tty_port *tport = &port->state->port; - struct stm32_port *stm32_port = to_stm32_port(port); - unsigned int size; - unsigned long flags; - /* Receiver timeout irq for DMA RX */ - if (!stm32_port->throttled) { - spin_lock_irqsave(&port->lock, flags); + if (stm32_usart_rx_dma_enabled(port) && !stm32_port->throttled) { + spin_lock(&port->lock); size = stm32_usart_receive_chars(port, false); - uart_unlock_and_check_sysrq_irqrestore(port, flags); + uart_unlock_and_check_sysrq(port); if (size) tty_flip_buffer_push(tport); } @@ -1016,10 +1002,8 @@ u32 val; int ret; - ret = request_threaded_irq(port->irq, stm32_usart_interrupt, - stm32_usart_threaded_interrupt, - IRQF_ONESHOT | IRQF_NO_SUSPEND, - name, port); + ret = request_irq(port->irq, stm32_usart_interrupt, + IRQF_NO_SUSPEND, name, port); if (ret) return ret; @@ -1602,13 +1586,6 @@ struct dma_slave_config config; int ret; - /* - * Using DMA and threaded handler for the console could lead to - * deadlocks. - */ - if (uart_console(port)) - return -ENODEV; - stm32port->rx_buf = dma_alloc_coherent(dev, RX_BUF_L, &stm32port->rx_dma_buf, GFP_KERNEL); diff -u linux-oem-6.1-6.1.0/drivers/ufs/core/ufshcd.c linux-oem-6.1-6.1.0/drivers/ufs/core/ufshcd.c --- linux-oem-6.1-6.1.0/drivers/ufs/core/ufshcd.c +++ linux-oem-6.1-6.1.0/drivers/ufs/core/ufshcd.c @@ -1231,12 +1231,14 @@ * clock scaling is in progress */ ufshcd_scsi_block_requests(hba); + mutex_lock(&hba->wb_mutex); down_write(&hba->clk_scaling_lock); if (!hba->clk_scaling.is_allowed || ufshcd_wait_for_doorbell_clr(hba, DOORBELL_CLR_TOUT_US)) { ret = -EBUSY; up_write(&hba->clk_scaling_lock); + mutex_unlock(&hba->wb_mutex); ufshcd_scsi_unblock_requests(hba); goto out; } @@ -1248,12 +1250,16 @@ return ret; } -static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, bool writelock) +static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, int err, bool scale_up) { - if (writelock) - up_write(&hba->clk_scaling_lock); - else - up_read(&hba->clk_scaling_lock); + up_write(&hba->clk_scaling_lock); + + /* Enable Write Booster if we have scaled up else disable it */ + if (ufshcd_enable_wb_if_scaling_up(hba) && !err) + ufshcd_wb_toggle(hba, scale_up); + + mutex_unlock(&hba->wb_mutex); + ufshcd_scsi_unblock_requests(hba); ufshcd_release(hba); } @@ -1270,7 +1276,6 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up) { int ret = 0; - bool is_writelock = true; ret = ufshcd_clock_scaling_prepare(hba); if (ret) @@ -1299,15 +1304,8 @@ } } - /* Enable Write Booster if we have scaled up else disable it */ - if (ufshcd_enable_wb_if_scaling_up(hba)) { - downgrade_write(&hba->clk_scaling_lock); - is_writelock = false; - ufshcd_wb_toggle(hba, scale_up); - } - out_unprepare: - ufshcd_clock_scaling_unprepare(hba, is_writelock); + ufshcd_clock_scaling_unprepare(hba, ret, scale_up); return ret; } @@ -6094,11 +6092,21 @@ } } +static void ufshcd_force_error_recovery(struct ufs_hba *hba) +{ + spin_lock_irq(hba->host->host_lock); + hba->force_reset = true; + ufshcd_schedule_eh_work(hba); + spin_unlock_irq(hba->host->host_lock); +} + static void ufshcd_clk_scaling_allow(struct ufs_hba *hba, bool allow) { + mutex_lock(&hba->wb_mutex); down_write(&hba->clk_scaling_lock); hba->clk_scaling.is_allowed = allow; up_write(&hba->clk_scaling_lock); + mutex_unlock(&hba->wb_mutex); } static void ufshcd_clk_scaling_suspend(struct ufs_hba *hba, bool suspend) @@ -9066,6 +9074,15 @@ if (!hba->dev_info.b_rpm_dev_flush_capable) { ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode); + if (ret && pm_op != UFS_SHUTDOWN_PM) { + /* + * If return err in suspend flow, IO will hang. + * Trigger error handler and break suspend for + * error recovery. + */ + ufshcd_force_error_recovery(hba); + ret = -EBUSY; + } if (ret) goto enable_scaling; } @@ -9077,6 +9094,15 @@ */ check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba); ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops); + if (ret && pm_op != UFS_SHUTDOWN_PM) { + /* + * If return err in suspend flow, IO will hang. + * Trigger error handler and break suspend for + * error recovery. + */ + ufshcd_force_error_recovery(hba); + ret = -EBUSY; + } if (ret) goto set_dev_active; @@ -9747,6 +9773,7 @@ /* Initialize mutex for exception event control */ mutex_init(&hba->ee_ctrl_mutex); + mutex_init(&hba->wb_mutex); init_rwsem(&hba->clk_scaling_lock); ufshcd_init_clk_gating(hba); diff -u linux-oem-6.1-6.1.0/drivers/usb/dwc3/dwc3-qcom.c linux-oem-6.1-6.1.0/drivers/usb/dwc3/dwc3-qcom.c --- linux-oem-6.1-6.1.0/drivers/usb/dwc3/dwc3-qcom.c +++ linux-oem-6.1-6.1.0/drivers/usb/dwc3/dwc3-qcom.c @@ -901,7 +901,7 @@ qcom->mode = usb_get_dr_mode(&qcom->dwc3->dev); /* enable vbus override for device mode */ - if (qcom->mode == USB_DR_MODE_PERIPHERAL) + if (qcom->mode != USB_DR_MODE_HOST) dwc3_qcom_vbus_override_enable(qcom, true); /* register extcon to override sw_vbus on Vbus change later */ diff -u linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fotg210-udc.c linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fotg210-udc.c --- linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fotg210-udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fotg210-udc.c @@ -1009,7 +1009,6 @@ u32 value; /* hook up the driver */ - driver->driver.bus = NULL; fotg210->driver = driver; /* enable device global interrupt */ diff -u linux-oem-6.1-6.1.0/drivers/usb/host/xhci-pci.c linux-oem-6.1-6.1.0/drivers/usb/host/xhci-pci.c --- linux-oem-6.1-6.1.0/drivers/usb/host/xhci-pci.c +++ linux-oem-6.1-6.1.0/drivers/usb/host/xhci-pci.c @@ -78,9 +78,12 @@ static struct hc_driver __read_mostly xhci_pci_hc_driver; static int xhci_pci_setup(struct usb_hcd *hcd); +static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, + struct usb_tt *tt, gfp_t mem_flags); static const struct xhci_driver_overrides xhci_pci_overrides __initconst = { .reset = xhci_pci_setup, + .update_hub_device = xhci_pci_update_hub_device, }; /* called after powerup, by probe or system-pm "wakeup" */ @@ -352,8 +355,38 @@ NULL); ACPI_FREE(obj); } + +static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) +{ + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct xhci_hub *rhub = &xhci->usb3_rhub; + int ret; + int i; + + /* This is not the usb3 roothub we are looking for */ + if (hcd != rhub->hcd) + return; + + if (hdev->maxchild > rhub->num_ports) { + dev_err(&hdev->dev, "USB3 roothub port number mismatch\n"); + return; + } + + for (i = 0; i < hdev->maxchild; i++) { + ret = usb_acpi_port_lpm_incapable(hdev, i); + + dev_dbg(&hdev->dev, "port-%d disable U1/U2 _DSM: %d\n", i + 1, ret); + + if (ret >= 0) { + rhub->ports[i]->lpm_incapable = ret; + continue; + } + } +} + #else static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } +static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) { } #endif /* CONFIG_ACPI */ /* called during probe() after chip reset completes */ @@ -386,6 +419,16 @@ return xhci_pci_reinit(xhci, pdev); } +static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, + struct usb_tt *tt, gfp_t mem_flags) +{ + /* Check if acpi claims some USB3 roothub ports are lpm incapable */ + if (!hdev->parent) + xhci_find_lpm_incapable_ports(hcd, hdev); + + return xhci_update_hub_device(hcd, hdev, tt, mem_flags); +} + /* * We need to register our own PCI probe function (instead of the USB core's * function) in order to create a second roothub under xHCI. @@ -455,6 +498,8 @@ if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) pm_runtime_allow(&dev->dev); + dma_set_max_seg_size(&dev->dev, UINT_MAX); + return 0; put_usb3_hcd: diff -u linux-oem-6.1-6.1.0/drivers/usb/host/xhci-ring.c linux-oem-6.1-6.1.0/drivers/usb/host/xhci-ring.c --- linux-oem-6.1-6.1.0/drivers/usb/host/xhci-ring.c +++ linux-oem-6.1-6.1.0/drivers/usb/host/xhci-ring.c @@ -1170,7 +1170,10 @@ struct xhci_virt_ep *ep; struct xhci_ring *ring; - ep = &xhci->devs[slot_id]->eps[ep_index]; + ep = xhci_get_virt_ep(xhci, slot_id, ep_index); + if (!ep) + return; + if ((ep->ep_state & EP_HAS_STREAMS) || (ep->ep_state & EP_GETTING_NO_STREAMS)) { int stream_id; diff -u linux-oem-6.1-6.1.0/drivers/usb/host/xhci.h linux-oem-6.1-6.1.0/drivers/usb/host/xhci.h --- linux-oem-6.1-6.1.0/drivers/usb/host/xhci.h +++ linux-oem-6.1-6.1.0/drivers/usb/host/xhci.h @@ -1735,6 +1735,7 @@ int hcd_portnum; struct xhci_hub *rhub; struct xhci_port_cap *port_cap; + unsigned int lpm_incapable:1; }; struct xhci_hub { @@ -1943,6 +1944,8 @@ struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*update_hub_device)(struct usb_hcd *hcd, struct usb_device *hdev, + struct usb_tt *tt, gfp_t mem_flags); }; #define XHCI_CFC_DELAY 10 @@ -2122,6 +2125,8 @@ struct usb_host_endpoint *ep); int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); +int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, + struct usb_tt *tt, gfp_t mem_flags); int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); int xhci_ext_cap_init(struct xhci_hcd *xhci); diff -u linux-oem-6.1-6.1.0/drivers/usb/musb/omap2430.c linux-oem-6.1-6.1.0/drivers/usb/musb/omap2430.c --- linux-oem-6.1-6.1.0/drivers/usb/musb/omap2430.c +++ linux-oem-6.1-6.1.0/drivers/usb/musb/omap2430.c @@ -411,8 +411,10 @@ memset(musb_res, 0, sizeof(*musb_res) * ARRAY_SIZE(musb_res)); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) + if (!res) { + ret = -EINVAL; goto err2; + } musb_res[i].start = res->start; musb_res[i].end = res->end; diff -u linux-oem-6.1-6.1.0/drivers/usb/serial/cp210x.c linux-oem-6.1-6.1.0/drivers/usb/serial/cp210x.c --- linux-oem-6.1-6.1.0/drivers/usb/serial/cp210x.c +++ linux-oem-6.1-6.1.0/drivers/usb/serial/cp210x.c @@ -60,6 +60,7 @@ { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */ { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ + { USB_DEVICE(0x0908, 0x0070) }, /* Siemens SCALANCE LPE-9000 USB Serial Console */ { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */ { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */ diff -u linux-oem-6.1-6.1.0/drivers/usb/serial/option.c linux-oem-6.1-6.1.0/drivers/usb/serial/option.c --- linux-oem-6.1-6.1.0/drivers/usb/serial/option.c +++ linux-oem-6.1-6.1.0/drivers/usb/serial/option.c @@ -255,10 +255,16 @@ #define QUECTEL_PRODUCT_EP06 0x0306 #define QUECTEL_PRODUCT_EM05G 0x030a #define QUECTEL_PRODUCT_EM060K 0x030b +#define QUECTEL_PRODUCT_EM05G_CS 0x030c +#define QUECTEL_PRODUCT_EM05CN_SG 0x0310 #define QUECTEL_PRODUCT_EM05G_SG 0x0311 +#define QUECTEL_PRODUCT_EM05CN 0x0312 +#define QUECTEL_PRODUCT_EM05G_GR 0x0313 +#define QUECTEL_PRODUCT_EM05G_RS 0x0314 #define QUECTEL_PRODUCT_EM12 0x0512 #define QUECTEL_PRODUCT_RM500Q 0x0800 #define QUECTEL_PRODUCT_RM520N 0x0801 +#define QUECTEL_PRODUCT_EC200U 0x0901 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 #define QUECTEL_PRODUCT_EC200T 0x6026 #define QUECTEL_PRODUCT_RM500K 0x7001 @@ -1159,8 +1165,18 @@ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN, 0xff), + .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN_SG, 0xff), + .driver_info = RSVD(6) | ZLP }, { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_GR, 0xff), + .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff), + .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_RS, 0xff), + .driver_info = RSVD(6) | ZLP }, { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff), .driver_info = RSVD(6) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, @@ -1180,6 +1196,7 @@ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) }, diff -u linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.c linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.c --- linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.c +++ linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.c @@ -187,6 +187,7 @@ struct ucsi_work { struct delayed_work work; + struct list_head node; unsigned long delay; unsigned int count; struct ucsi_connector *con; @@ -202,6 +203,7 @@ mutex_lock(&con->lock); if (!con->partner) { + list_del(&uwork->node); mutex_unlock(&con->lock); kfree(uwork); return; @@ -209,10 +211,12 @@ ret = uwork->cb(con); - if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) + if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) { queue_delayed_work(con->wq, &uwork->work, uwork->delay); - else + } else { + list_del(&uwork->node); kfree(uwork); + } mutex_unlock(&con->lock); } @@ -236,6 +240,7 @@ uwork->con = con; uwork->cb = cb; + list_add_tail(&uwork->node, &con->partner_tasks); queue_delayed_work(con->wq, &uwork->work, delay); return 0; @@ -1056,6 +1061,7 @@ INIT_WORK(&con->work, ucsi_handle_connector_change); init_completion(&con->complete); mutex_init(&con->lock); + INIT_LIST_HEAD(&con->partner_tasks); con->num = index + 1; con->ucsi = ucsi; @@ -1263,6 +1269,9 @@ con->port = NULL; } + kfree(ucsi->connector); + ucsi->connector = NULL; + err_reset: memset(&ucsi->cap, 0, sizeof(ucsi->cap)); ucsi_reset_ppm(ucsi); @@ -1294,7 +1303,8 @@ int ucsi_resume(struct ucsi *ucsi) { - queue_work(system_long_wq, &ucsi->resume_work); + if (ucsi->connector) + queue_work(system_long_wq, &ucsi->resume_work); return 0; } EXPORT_SYMBOL_GPL(ucsi_resume); @@ -1414,14 +1424,29 @@ /* Disable notifications */ ucsi->ops->async_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd)); + if (!ucsi->connector) + return; + for (i = 0; i < ucsi->cap.num_connectors; i++) { cancel_work_sync(&ucsi->connector[i].work); ucsi_unregister_partner(&ucsi->connector[i]); ucsi_unregister_altmodes(&ucsi->connector[i], UCSI_RECIPIENT_CON); ucsi_unregister_port_psy(&ucsi->connector[i]); - if (ucsi->connector[i].wq) + + if (ucsi->connector[i].wq) { + struct ucsi_work *uwork; + + mutex_lock(&ucsi->connector[i].lock); + /* + * queue delayed items immediately so they can execute + * and free themselves before the wq is destroyed + */ + list_for_each_entry(uwork, &ucsi->connector[i].partner_tasks, node) + mod_delayed_work(ucsi->connector[i].wq, &uwork->work, 0); + mutex_unlock(&ucsi->connector[i].lock); destroy_workqueue(ucsi->connector[i].wq); + } typec_unregister_port(ucsi->connector[i].port); } diff -u linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.h linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.h --- linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.h +++ linux-oem-6.1-6.1.0/drivers/usb/typec/ucsi/ucsi.h @@ -322,6 +322,7 @@ struct work_struct work; struct completion complete; struct workqueue_struct *wq; + struct list_head partner_tasks; struct typec_port *port; struct typec_partner *partner; diff -u linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/net/mlx5_vnet.c linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/net/mlx5_vnet.c --- linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1823,6 +1823,9 @@ size_t read; u16 id; + if (!(ndev->mvdev.actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VLAN))) + return status; + switch (cmd) { case VIRTIO_NET_CTRL_VLAN_ADD: read = vringh_iov_pull_iotlb(&cvq->vring, &cvq->riov, &vlan, sizeof(vlan)); @@ -2391,7 +2394,8 @@ } } -static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) +static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, + struct vhost_iotlb *iotlb, unsigned int asid) { struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); int err; @@ -2403,7 +2407,7 @@ teardown_driver(ndev); mlx5_vdpa_destroy_mr(mvdev); - err = mlx5_vdpa_create_mr(mvdev, iotlb); + err = mlx5_vdpa_create_mr(mvdev, iotlb, asid); if (err) goto err_mr; @@ -2584,7 +2588,7 @@ ++mvdev->generation; if (MLX5_CAP_GEN(mvdev->mdev, umem_uid_0)) { - if (mlx5_vdpa_create_mr(mvdev, NULL)) + if (mlx5_vdpa_create_mr(mvdev, NULL, 0)) mlx5_vdpa_warn(mvdev, "create MR failed\n"); } up_write(&ndev->reslock); @@ -2620,41 +2624,20 @@ return mvdev->generation; } -static int set_map_control(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) -{ - u64 start = 0ULL, last = 0ULL - 1; - struct vhost_iotlb_map *map; - int err = 0; - - spin_lock(&mvdev->cvq.iommu_lock); - vhost_iotlb_reset(mvdev->cvq.iotlb); - - for (map = vhost_iotlb_itree_first(iotlb, start, last); map; - map = vhost_iotlb_itree_next(map, start, last)) { - err = vhost_iotlb_add_range(mvdev->cvq.iotlb, map->start, - map->last, map->addr, map->perm); - if (err) - goto out; - } - -out: - spin_unlock(&mvdev->cvq.iommu_lock); - return err; -} - -static int set_map_data(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) +static int set_map_data(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, + unsigned int asid) { bool change_map; int err; - err = mlx5_vdpa_handle_set_map(mvdev, iotlb, &change_map); + err = mlx5_vdpa_handle_set_map(mvdev, iotlb, &change_map, asid); if (err) { mlx5_vdpa_warn(mvdev, "set map failed(%d)\n", err); return err; } if (change_map) - err = mlx5_vdpa_change_map(mvdev, iotlb); + err = mlx5_vdpa_change_map(mvdev, iotlb, asid); return err; } @@ -2667,16 +2650,7 @@ int err = -EINVAL; down_write(&ndev->reslock); - if (mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP] == asid) { - err = set_map_data(mvdev, iotlb); - if (err) - goto out; - } - - if (mvdev->group2asid[MLX5_VDPA_CVQ_GROUP] == asid) - err = set_map_control(mvdev, iotlb); - -out: + err = set_map_data(mvdev, iotlb, asid); up_write(&ndev->reslock); return err; } @@ -2842,8 +2816,8 @@ int i; down_write(&ndev->reslock); - mlx5_notifier_unregister(mvdev->mdev, &ndev->nb); ndev->nb_registered = false; + mlx5_notifier_unregister(mvdev->mdev, &ndev->nb); flush_workqueue(ndev->mvdev.wq); for (i = 0; i < ndev->cur_num_vqs; i++) { mvq = &ndev->vqs[i]; @@ -3021,7 +2995,7 @@ else ndev->config.status &= cpu_to_mlx5vdpa16(mvdev, ~VIRTIO_NET_S_LINK_UP); - if (ndev->config_cb.callback) + if (ndev->nb_registered && ndev->config_cb.callback) ndev->config_cb.callback(ndev->config_cb.private); kfree(wqent); @@ -3038,21 +3012,13 @@ switch (eqe->sub_type) { case MLX5_PORT_CHANGE_SUBTYPE_DOWN: case MLX5_PORT_CHANGE_SUBTYPE_ACTIVE: - down_read(&ndev->reslock); - if (!ndev->nb_registered) { - up_read(&ndev->reslock); - return NOTIFY_DONE; - } wqent = kzalloc(sizeof(*wqent), GFP_ATOMIC); - if (!wqent) { - up_read(&ndev->reslock); + if (!wqent) return NOTIFY_DONE; - } wqent->mvdev = &ndev->mvdev; INIT_WORK(&wqent->work, update_carrier); queue_work(ndev->mvdev.wq, &wqent->work); - up_read(&ndev->reslock); ret = NOTIFY_OK; break; default: @@ -3187,7 +3153,7 @@ goto err_mpfs; if (MLX5_CAP_GEN(mvdev->mdev, umem_uid_0)) { - err = mlx5_vdpa_create_mr(mvdev, NULL); + err = mlx5_vdpa_create_mr(mvdev, NULL, 0); if (err) goto err_res; } @@ -3239,8 +3205,8 @@ struct workqueue_struct *wq; if (ndev->nb_registered) { - mlx5_notifier_unregister(mvdev->mdev, &ndev->nb); ndev->nb_registered = false; + mlx5_notifier_unregister(mvdev->mdev, &ndev->nb); } wq = mvdev->wq; mvdev->wq = NULL; diff -u linux-oem-6.1-6.1.0/drivers/vdpa/vdpa_sim/vdpa_sim_net.c linux-oem-6.1-6.1.0/drivers/vdpa/vdpa_sim/vdpa_sim_net.c --- linux-oem-6.1-6.1.0/drivers/vdpa/vdpa_sim/vdpa_sim_net.c +++ linux-oem-6.1-6.1.0/drivers/vdpa/vdpa_sim/vdpa_sim_net.c @@ -62,6 +62,9 @@ if (len < ETH_ALEN + hdr_len) return false; + if (is_broadcast_ether_addr(vdpasim->buffer + hdr_len) || + is_multicast_ether_addr(vdpasim->buffer + hdr_len)) + return true; if (!strncmp(vdpasim->buffer + hdr_len, vio_config->mac, ETH_ALEN)) return true; diff -u linux-oem-6.1-6.1.0/drivers/vhost/vhost.c linux-oem-6.1-6.1.0/drivers/vhost/vhost.c --- linux-oem-6.1-6.1.0/drivers/vhost/vhost.c +++ linux-oem-6.1-6.1.0/drivers/vhost/vhost.c @@ -661,7 +661,7 @@ } EXPORT_SYMBOL_GPL(vhost_dev_stop); -static void vhost_clear_msg(struct vhost_dev *dev) +void vhost_clear_msg(struct vhost_dev *dev) { struct vhost_msg_node *node, *n; @@ -679,6 +679,7 @@ spin_unlock(&dev->iotlb_lock); } +EXPORT_SYMBOL_GPL(vhost_clear_msg); void vhost_dev_cleanup(struct vhost_dev *dev) { @@ -832,7 +833,7 @@ VHOST_ACCESS_WO); if (ret < 0) goto out; - iov_iter_init(&t, WRITE, vq->iotlb_iov, ret, size); + iov_iter_init(&t, ITER_DEST, vq->iotlb_iov, ret, size); ret = copy_to_iter(from, size, &t); if (ret == size) ret = 0; @@ -871,7 +872,7 @@ (unsigned long long) size); goto out; } - iov_iter_init(&f, READ, vq->iotlb_iov, ret, size); + iov_iter_init(&f, ITER_SOURCE, vq->iotlb_iov, ret, size); ret = copy_from_iter(to, size, &f); if (ret == size) ret = 0; @@ -2135,7 +2136,7 @@ vq_err(vq, "Translation failure %d in indirect.\n", ret); return ret; } - iov_iter_init(&from, READ, vq->indirect, ret, len); + iov_iter_init(&from, ITER_SOURCE, vq->indirect, ret, len); count = len / sizeof desc; /* Buffers are chained via a 16 bit next field, so * we can have at most 2^16 of these. */ diff -u linux-oem-6.1-6.1.0/drivers/vhost/vringh.c linux-oem-6.1-6.1.0/drivers/vhost/vringh.c --- linux-oem-6.1-6.1.0/drivers/vhost/vringh.c +++ linux-oem-6.1-6.1.0/drivers/vhost/vringh.c @@ -1161,7 +1161,7 @@ else if (ret < 0) return ret; - iov_iter_bvec(&iter, READ, iov, ret, translated); + iov_iter_bvec(&iter, ITER_SOURCE, iov, ret, translated); ret = copy_from_iter(dst, translated, &iter); if (ret < 0) @@ -1194,7 +1194,7 @@ else if (ret < 0) return ret; - iov_iter_bvec(&iter, WRITE, iov, ret, translated); + iov_iter_bvec(&iter, ITER_DEST, iov, ret, translated); ret = copy_to_iter(src, translated, &iter); if (ret < 0) diff -u linux-oem-6.1-6.1.0/drivers/vhost/vsock.c linux-oem-6.1-6.1.0/drivers/vhost/vsock.c --- linux-oem-6.1-6.1.0/drivers/vhost/vsock.c +++ linux-oem-6.1-6.1.0/drivers/vhost/vsock.c @@ -165,7 +165,7 @@ break; } - iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len); + iov_iter_init(&iov_iter, ITER_DEST, &vq->iov[out], in, iov_len); payload_len = pkt->len - pkt->off; /* If the packet is greater than the space available in the @@ -371,7 +371,7 @@ return NULL; len = iov_length(vq->iov, out); - iov_iter_init(&iov_iter, WRITE, vq->iov, out, len); + iov_iter_init(&iov_iter, ITER_SOURCE, vq->iov, out, len); nbytes = copy_from_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); if (nbytes != sizeof(pkt->hdr)) { diff -u linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fbcon.c linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fbcon.c --- linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fbcon.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fbcon.c @@ -2495,9 +2495,12 @@ h > FBCON_SWAP(info->var.rotate, info->var.yres, info->var.xres)) return -EINVAL; + if (font->width > 32 || font->height > 32) + return -EINVAL; + /* Make sure drawing engine can handle the font */ - if (!(info->pixmap.blit_x & (1 << (font->width - 1))) || - !(info->pixmap.blit_y & (1 << (font->height - 1)))) + if (!(info->pixmap.blit_x & BIT(font->width - 1)) || + !(info->pixmap.blit_y & BIT(font->height - 1))) return -EINVAL; /* Make sure driver can handle the font length */ diff -u linux-oem-6.1-6.1.0/fs/binfmt_elf_fdpic.c linux-oem-6.1-6.1.0/fs/binfmt_elf_fdpic.c --- linux-oem-6.1-6.1.0/fs/binfmt_elf_fdpic.c +++ linux-oem-6.1-6.1.0/fs/binfmt_elf_fdpic.c @@ -1509,7 +1509,7 @@ tmp->next = thread_list; thread_list = tmp; - segs = cprm->vma_count + elf_core_extra_phdrs(); + segs = cprm->vma_count + elf_core_extra_phdrs(cprm); /* for notes section */ segs++; @@ -1555,7 +1555,7 @@ dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); offset += cprm->vma_data_size; - offset += elf_core_extra_data_size(); + offset += elf_core_extra_data_size(cprm); e_shoff = offset; if (e_phnum == PN_XNUM) { diff -u linux-oem-6.1-6.1.0/fs/btrfs/disk-io.c linux-oem-6.1-6.1.0/fs/btrfs/disk-io.c --- linux-oem-6.1-6.1.0/fs/btrfs/disk-io.c +++ linux-oem-6.1-6.1.0/fs/btrfs/disk-io.c @@ -344,7 +344,14 @@ btrfs_print_tree(eb, 0); btrfs_err(fs_info, "block=%llu write time tree block corruption detected", eb->start); - WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG)); + /* + * Be noisy if this is an extent buffer from a log tree. We don't abort + * a transaction in case there's a bad log tree extent buffer, we just + * fallback to a transaction commit. Still we want to know when there is + * a bad log tree extent buffer, as that may signal a bug somewhere. + */ + WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG) || + btrfs_header_owner(eb) == BTRFS_TREE_LOG_OBJECTID); return ret; } diff -u linux-oem-6.1-6.1.0/fs/btrfs/extent_io.c linux-oem-6.1-6.1.0/fs/btrfs/extent_io.c --- linux-oem-6.1-6.1.0/fs/btrfs/extent_io.c +++ linux-oem-6.1-6.1.0/fs/btrfs/extent_io.c @@ -3938,6 +3938,7 @@ lockend = round_up(start + len, root->fs_info->sectorsize); prev_extent_end = lockstart; + btrfs_inode_lock(&inode->vfs_inode, BTRFS_ILOCK_SHARED); lock_extent(&inode->io_tree, lockstart, lockend, &cached_state); ret = fiemap_find_last_extent_offset(inode, path, &last_extent_end); @@ -4129,6 +4130,7 @@ out_unlock: unlock_extent(&inode->io_tree, lockstart, lockend, &cached_state); + btrfs_inode_unlock(&inode->vfs_inode, BTRFS_ILOCK_SHARED); out: kfree(backref_cache); btrfs_free_path(path); diff -u linux-oem-6.1-6.1.0/fs/btrfs/file.c linux-oem-6.1-6.1.0/fs/btrfs/file.c --- linux-oem-6.1-6.1.0/fs/btrfs/file.c +++ linux-oem-6.1-6.1.0/fs/btrfs/file.c @@ -31,329 +31,6 @@ #include "reflink.h" #include "subpage.h" -static struct kmem_cache *btrfs_inode_defrag_cachep; -/* - * when auto defrag is enabled we - * queue up these defrag structs to remember which - * inodes need defragging passes - */ -struct inode_defrag { - struct rb_node rb_node; - /* objectid */ - u64 ino; - /* - * transid where the defrag was added, we search for - * extents newer than this - */ - u64 transid; - - /* root objectid */ - u64 root; - - /* - * The extent size threshold for autodefrag. - * - * This value is different for compressed/non-compressed extents, - * thus needs to be passed from higher layer. - * (aka, inode_should_defrag()) - */ - u32 extent_thresh; -}; - -static int __compare_inode_defrag(struct inode_defrag *defrag1, - struct inode_defrag *defrag2) -{ - if (defrag1->root > defrag2->root) - return 1; - else if (defrag1->root < defrag2->root) - return -1; - else if (defrag1->ino > defrag2->ino) - return 1; - else if (defrag1->ino < defrag2->ino) - return -1; - else - return 0; -} - -/* pop a record for an inode into the defrag tree. The lock - * must be held already - * - * If you're inserting a record for an older transid than an - * existing record, the transid already in the tree is lowered - * - * If an existing record is found the defrag item you - * pass in is freed - */ -static int __btrfs_add_inode_defrag(struct btrfs_inode *inode, - struct inode_defrag *defrag) -{ - struct btrfs_fs_info *fs_info = inode->root->fs_info; - struct inode_defrag *entry; - struct rb_node **p; - struct rb_node *parent = NULL; - int ret; - - p = &fs_info->defrag_inodes.rb_node; - while (*p) { - parent = *p; - entry = rb_entry(parent, struct inode_defrag, rb_node); - - ret = __compare_inode_defrag(defrag, entry); - if (ret < 0) - p = &parent->rb_left; - else if (ret > 0) - p = &parent->rb_right; - else { - /* if we're reinserting an entry for - * an old defrag run, make sure to - * lower the transid of our existing record - */ - if (defrag->transid < entry->transid) - entry->transid = defrag->transid; - entry->extent_thresh = min(defrag->extent_thresh, - entry->extent_thresh); - return -EEXIST; - } - } - set_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags); - rb_link_node(&defrag->rb_node, parent, p); - rb_insert_color(&defrag->rb_node, &fs_info->defrag_inodes); - return 0; -} - -static inline int __need_auto_defrag(struct btrfs_fs_info *fs_info) -{ - if (!btrfs_test_opt(fs_info, AUTO_DEFRAG)) - return 0; - - if (btrfs_fs_closing(fs_info)) - return 0; - - return 1; -} - -/* - * insert a defrag record for this inode if auto defrag is - * enabled - */ -int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, - struct btrfs_inode *inode, u32 extent_thresh) -{ - struct btrfs_root *root = inode->root; - struct btrfs_fs_info *fs_info = root->fs_info; - struct inode_defrag *defrag; - u64 transid; - int ret; - - if (!__need_auto_defrag(fs_info)) - return 0; - - if (test_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags)) - return 0; - - if (trans) - transid = trans->transid; - else - transid = inode->root->last_trans; - - defrag = kmem_cache_zalloc(btrfs_inode_defrag_cachep, GFP_NOFS); - if (!defrag) - return -ENOMEM; - - defrag->ino = btrfs_ino(inode); - defrag->transid = transid; - defrag->root = root->root_key.objectid; - defrag->extent_thresh = extent_thresh; - - spin_lock(&fs_info->defrag_inodes_lock); - if (!test_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags)) { - /* - * If we set IN_DEFRAG flag and evict the inode from memory, - * and then re-read this inode, this new inode doesn't have - * IN_DEFRAG flag. At the case, we may find the existed defrag. - */ - ret = __btrfs_add_inode_defrag(inode, defrag); - if (ret) - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); - } else { - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); - } - spin_unlock(&fs_info->defrag_inodes_lock); - return 0; -} - -/* - * pick the defragable inode that we want, if it doesn't exist, we will get - * the next one. - */ -static struct inode_defrag * -btrfs_pick_defrag_inode(struct btrfs_fs_info *fs_info, u64 root, u64 ino) -{ - struct inode_defrag *entry = NULL; - struct inode_defrag tmp; - struct rb_node *p; - struct rb_node *parent = NULL; - int ret; - - tmp.ino = ino; - tmp.root = root; - - spin_lock(&fs_info->defrag_inodes_lock); - p = fs_info->defrag_inodes.rb_node; - while (p) { - parent = p; - entry = rb_entry(parent, struct inode_defrag, rb_node); - - ret = __compare_inode_defrag(&tmp, entry); - if (ret < 0) - p = parent->rb_left; - else if (ret > 0) - p = parent->rb_right; - else - goto out; - } - - if (parent && __compare_inode_defrag(&tmp, entry) > 0) { - parent = rb_next(parent); - if (parent) - entry = rb_entry(parent, struct inode_defrag, rb_node); - else - entry = NULL; - } -out: - if (entry) - rb_erase(parent, &fs_info->defrag_inodes); - spin_unlock(&fs_info->defrag_inodes_lock); - return entry; -} - -void btrfs_cleanup_defrag_inodes(struct btrfs_fs_info *fs_info) -{ - struct inode_defrag *defrag; - struct rb_node *node; - - spin_lock(&fs_info->defrag_inodes_lock); - node = rb_first(&fs_info->defrag_inodes); - while (node) { - rb_erase(node, &fs_info->defrag_inodes); - defrag = rb_entry(node, struct inode_defrag, rb_node); - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); - - cond_resched_lock(&fs_info->defrag_inodes_lock); - - node = rb_first(&fs_info->defrag_inodes); - } - spin_unlock(&fs_info->defrag_inodes_lock); -} - -#define BTRFS_DEFRAG_BATCH 1024 - -static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, - struct inode_defrag *defrag) -{ - struct btrfs_root *inode_root; - struct inode *inode; - struct btrfs_ioctl_defrag_range_args range; - int ret = 0; - u64 cur = 0; - -again: - if (test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state)) - goto cleanup; - if (!__need_auto_defrag(fs_info)) - goto cleanup; - - /* get the inode */ - inode_root = btrfs_get_fs_root(fs_info, defrag->root, true); - if (IS_ERR(inode_root)) { - ret = PTR_ERR(inode_root); - goto cleanup; - } - - inode = btrfs_iget(fs_info->sb, defrag->ino, inode_root); - btrfs_put_root(inode_root); - if (IS_ERR(inode)) { - ret = PTR_ERR(inode); - goto cleanup; - } - - if (cur >= i_size_read(inode)) { - iput(inode); - goto cleanup; - } - - /* do a chunk of defrag */ - clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); - memset(&range, 0, sizeof(range)); - range.len = (u64)-1; - range.start = cur; - range.extent_thresh = defrag->extent_thresh; - - sb_start_write(fs_info->sb); - ret = btrfs_defrag_file(inode, NULL, &range, defrag->transid, - BTRFS_DEFRAG_BATCH); - sb_end_write(fs_info->sb); - iput(inode); - - if (ret < 0) - goto cleanup; - - cur = max(cur + fs_info->sectorsize, range.start); - goto again; - -cleanup: - kmem_cache_free(btrfs_inode_defrag_cachep, defrag); - return ret; -} - -/* - * run through the list of inodes in the FS that need - * defragging - */ -int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) -{ - struct inode_defrag *defrag; - u64 first_ino = 0; - u64 root_objectid = 0; - - atomic_inc(&fs_info->defrag_running); - while (1) { - /* Pause the auto defragger. */ - if (test_bit(BTRFS_FS_STATE_REMOUNTING, - &fs_info->fs_state)) - break; - - if (!__need_auto_defrag(fs_info)) - break; - - /* find an inode to defrag */ - defrag = btrfs_pick_defrag_inode(fs_info, root_objectid, - first_ino); - if (!defrag) { - if (root_objectid || first_ino) { - root_objectid = 0; - first_ino = 0; - continue; - } else { - break; - } - } - - first_ino = defrag->ino + 1; - root_objectid = defrag->root; - - __btrfs_run_defrag_inode(fs_info, defrag); - } - atomic_dec(&fs_info->defrag_running); - - /* - * during unmount, we use the transaction_wait queue to - * wait for the defragger to stop - */ - wake_up(&fs_info->transaction_wait); - return 0; -} - /* simple helper to fault in pages and copy. This should go away * and be replaced with calls into generic code. */ @@ -3838,6 +3515,7 @@ struct extent_buffer *leaf = path->nodes[0]; struct btrfs_file_extent_item *extent; u64 extent_end; + u8 type; if (path->slots[0] >= btrfs_header_nritems(leaf)) { ret = btrfs_next_leaf(root, path); @@ -3892,10 +3570,16 @@ extent = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); + type = btrfs_file_extent_type(leaf, extent); - if (btrfs_file_extent_disk_bytenr(leaf, extent) == 0 || - btrfs_file_extent_type(leaf, extent) == - BTRFS_FILE_EXTENT_PREALLOC) { + /* + * Can't access the extent's disk_bytenr field if this is an + * inline extent, since at that offset, it's where the extent + * data starts. + */ + if (type == BTRFS_FILE_EXTENT_PREALLOC || + (type == BTRFS_FILE_EXTENT_REG && + btrfs_file_extent_disk_bytenr(leaf, extent) == 0)) { /* * Explicit hole or prealloc extent, search for delalloc. * A prealloc extent is treated like a hole. @@ -4123,23 +3807,6 @@ .remap_file_range = btrfs_remap_file_range, }; -void __cold btrfs_auto_defrag_exit(void) -{ - kmem_cache_destroy(btrfs_inode_defrag_cachep); -} - -int __init btrfs_auto_defrag_init(void) -{ - btrfs_inode_defrag_cachep = kmem_cache_create("btrfs_inode_defrag", - sizeof(struct inode_defrag), 0, - SLAB_MEM_SPREAD, - NULL); - if (!btrfs_inode_defrag_cachep) - return -ENOMEM; - - return 0; -} - int btrfs_fdatawrite_range(struct inode *inode, loff_t start, loff_t end) { int ret; diff -u linux-oem-6.1-6.1.0/fs/btrfs/ioctl.c linux-oem-6.1-6.1.0/fs/btrfs/ioctl.c --- linux-oem-6.1-6.1.0/fs/btrfs/ioctl.c +++ linux-oem-6.1-6.1.0/fs/btrfs/ioctl.c @@ -5283,7 +5283,7 @@ goto out_acct; } - ret = import_iovec(READ, args.iov, args.iovcnt, ARRAY_SIZE(iovstack), + ret = import_iovec(ITER_DEST, args.iov, args.iovcnt, ARRAY_SIZE(iovstack), &iov, &iter); if (ret < 0) goto out_acct; @@ -5382,7 +5382,7 @@ if (args.len > args.unencoded_len - args.unencoded_offset) goto out_acct; - ret = import_iovec(WRITE, args.iov, args.iovcnt, ARRAY_SIZE(iovstack), + ret = import_iovec(ITER_SOURCE, args.iov, args.iovcnt, ARRAY_SIZE(iovstack), &iov, &iter); if (ret < 0) goto out_acct; diff -u linux-oem-6.1-6.1.0/fs/btrfs/tree-defrag.c linux-oem-6.1-6.1.0/fs/btrfs/tree-defrag.c --- linux-oem-6.1-6.1.0/fs/btrfs/tree-defrag.c +++ linux-oem-6.1-6.1.0/fs/btrfs/tree-defrag.c @@ -10,6 +10,326 @@ #include "transaction.h" #include "locking.h" +static struct kmem_cache *btrfs_inode_defrag_cachep; + +/* + * When auto defrag is enabled we queue up these defrag structs to remember + * which inodes need defragging passes. + */ +struct inode_defrag { + struct rb_node rb_node; + /* Inode number */ + u64 ino; + /* + * Transid where the defrag was added, we search for extents newer than + * this. + */ + u64 transid; + + /* Root objectid */ + u64 root; + + /* + * The extent size threshold for autodefrag. + * + * This value is different for compressed/non-compressed extents, thus + * needs to be passed from higher layer. + * (aka, inode_should_defrag()) + */ + u32 extent_thresh; +}; + +static int __compare_inode_defrag(struct inode_defrag *defrag1, + struct inode_defrag *defrag2) +{ + if (defrag1->root > defrag2->root) + return 1; + else if (defrag1->root < defrag2->root) + return -1; + else if (defrag1->ino > defrag2->ino) + return 1; + else if (defrag1->ino < defrag2->ino) + return -1; + else + return 0; +} + +/* + * Pop a record for an inode into the defrag tree. The lock must be held + * already. + * + * If you're inserting a record for an older transid than an existing record, + * the transid already in the tree is lowered. + * + * If an existing record is found the defrag item you pass in is freed. + */ +static int __btrfs_add_inode_defrag(struct btrfs_inode *inode, + struct inode_defrag *defrag) +{ + struct btrfs_fs_info *fs_info = inode->root->fs_info; + struct inode_defrag *entry; + struct rb_node **p; + struct rb_node *parent = NULL; + int ret; + + p = &fs_info->defrag_inodes.rb_node; + while (*p) { + parent = *p; + entry = rb_entry(parent, struct inode_defrag, rb_node); + + ret = __compare_inode_defrag(defrag, entry); + if (ret < 0) + p = &parent->rb_left; + else if (ret > 0) + p = &parent->rb_right; + else { + /* + * If we're reinserting an entry for an old defrag run, + * make sure to lower the transid of our existing + * record. + */ + if (defrag->transid < entry->transid) + entry->transid = defrag->transid; + entry->extent_thresh = min(defrag->extent_thresh, + entry->extent_thresh); + return -EEXIST; + } + } + set_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags); + rb_link_node(&defrag->rb_node, parent, p); + rb_insert_color(&defrag->rb_node, &fs_info->defrag_inodes); + return 0; +} + +static inline int __need_auto_defrag(struct btrfs_fs_info *fs_info) +{ + if (!btrfs_test_opt(fs_info, AUTO_DEFRAG)) + return 0; + + if (btrfs_fs_closing(fs_info)) + return 0; + + return 1; +} + +/* + * Insert a defrag record for this inode if auto defrag is enabled. + */ +int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, + struct btrfs_inode *inode, u32 extent_thresh) +{ + struct btrfs_root *root = inode->root; + struct btrfs_fs_info *fs_info = root->fs_info; + struct inode_defrag *defrag; + u64 transid; + int ret; + + if (!__need_auto_defrag(fs_info)) + return 0; + + if (test_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags)) + return 0; + + if (trans) + transid = trans->transid; + else + transid = inode->root->last_trans; + + defrag = kmem_cache_zalloc(btrfs_inode_defrag_cachep, GFP_NOFS); + if (!defrag) + return -ENOMEM; + + defrag->ino = btrfs_ino(inode); + defrag->transid = transid; + defrag->root = root->root_key.objectid; + defrag->extent_thresh = extent_thresh; + + spin_lock(&fs_info->defrag_inodes_lock); + if (!test_bit(BTRFS_INODE_IN_DEFRAG, &inode->runtime_flags)) { + /* + * If we set IN_DEFRAG flag and evict the inode from memory, + * and then re-read this inode, this new inode doesn't have + * IN_DEFRAG flag. At the case, we may find the existed defrag. + */ + ret = __btrfs_add_inode_defrag(inode, defrag); + if (ret) + kmem_cache_free(btrfs_inode_defrag_cachep, defrag); + } else { + kmem_cache_free(btrfs_inode_defrag_cachep, defrag); + } + spin_unlock(&fs_info->defrag_inodes_lock); + return 0; +} + +/* + * Pick the defragable inode that we want, if it doesn't exist, we will get the + * next one. + */ +static struct inode_defrag *btrfs_pick_defrag_inode( + struct btrfs_fs_info *fs_info, u64 root, u64 ino) +{ + struct inode_defrag *entry = NULL; + struct inode_defrag tmp; + struct rb_node *p; + struct rb_node *parent = NULL; + int ret; + + tmp.ino = ino; + tmp.root = root; + + spin_lock(&fs_info->defrag_inodes_lock); + p = fs_info->defrag_inodes.rb_node; + while (p) { + parent = p; + entry = rb_entry(parent, struct inode_defrag, rb_node); + + ret = __compare_inode_defrag(&tmp, entry); + if (ret < 0) + p = parent->rb_left; + else if (ret > 0) + p = parent->rb_right; + else + goto out; + } + + if (parent && __compare_inode_defrag(&tmp, entry) > 0) { + parent = rb_next(parent); + if (parent) + entry = rb_entry(parent, struct inode_defrag, rb_node); + else + entry = NULL; + } +out: + if (entry) + rb_erase(parent, &fs_info->defrag_inodes); + spin_unlock(&fs_info->defrag_inodes_lock); + return entry; +} + +void btrfs_cleanup_defrag_inodes(struct btrfs_fs_info *fs_info) +{ + struct inode_defrag *defrag; + struct rb_node *node; + + spin_lock(&fs_info->defrag_inodes_lock); + node = rb_first(&fs_info->defrag_inodes); + while (node) { + rb_erase(node, &fs_info->defrag_inodes); + defrag = rb_entry(node, struct inode_defrag, rb_node); + kmem_cache_free(btrfs_inode_defrag_cachep, defrag); + + cond_resched_lock(&fs_info->defrag_inodes_lock); + + node = rb_first(&fs_info->defrag_inodes); + } + spin_unlock(&fs_info->defrag_inodes_lock); +} + +#define BTRFS_DEFRAG_BATCH 1024 + +static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, + struct inode_defrag *defrag) +{ + struct btrfs_root *inode_root; + struct inode *inode; + struct btrfs_ioctl_defrag_range_args range; + int ret = 0; + u64 cur = 0; + +again: + if (test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state)) + goto cleanup; + if (!__need_auto_defrag(fs_info)) + goto cleanup; + + /* Get the inode */ + inode_root = btrfs_get_fs_root(fs_info, defrag->root, true); + if (IS_ERR(inode_root)) { + ret = PTR_ERR(inode_root); + goto cleanup; + } + + inode = btrfs_iget(fs_info->sb, defrag->ino, inode_root); + btrfs_put_root(inode_root); + if (IS_ERR(inode)) { + ret = PTR_ERR(inode); + goto cleanup; + } + + if (cur >= i_size_read(inode)) { + iput(inode); + goto cleanup; + } + + /* Do a chunk of defrag */ + clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); + memset(&range, 0, sizeof(range)); + range.len = (u64)-1; + range.start = cur; + range.extent_thresh = defrag->extent_thresh; + + sb_start_write(fs_info->sb); + ret = btrfs_defrag_file(inode, NULL, &range, defrag->transid, + BTRFS_DEFRAG_BATCH); + sb_end_write(fs_info->sb); + iput(inode); + + if (ret < 0) + goto cleanup; + + cur = max(cur + fs_info->sectorsize, range.start); + goto again; + +cleanup: + kmem_cache_free(btrfs_inode_defrag_cachep, defrag); + return ret; +} + +/* + * Run through the list of inodes in the FS that need defragging. + */ +int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) +{ + struct inode_defrag *defrag; + u64 first_ino = 0; + u64 root_objectid = 0; + + atomic_inc(&fs_info->defrag_running); + while (1) { + /* Pause the auto defragger. */ + if (test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state)) + break; + + if (!__need_auto_defrag(fs_info)) + break; + + /* find an inode to defrag */ + defrag = btrfs_pick_defrag_inode(fs_info, root_objectid, first_ino); + if (!defrag) { + if (root_objectid || first_ino) { + root_objectid = 0; + first_ino = 0; + continue; + } else { + break; + } + } + + first_ino = defrag->ino + 1; + root_objectid = defrag->root; + + __btrfs_run_defrag_inode(fs_info, defrag); + } + atomic_dec(&fs_info->defrag_running); + + /* + * During unmount, we use the transaction_wait queue to wait for the + * defragger to stop. + */ + wake_up(&fs_info->transaction_wait); + return 0; +} + /* * Defrag all the leaves in a given btree. * Read all the leaves and try to get key order to @@ -134,0 +455,17 @@ + +void __cold btrfs_auto_defrag_exit(void) +{ + kmem_cache_destroy(btrfs_inode_defrag_cachep); +} + +int __init btrfs_auto_defrag_init(void) +{ + btrfs_inode_defrag_cachep = kmem_cache_create("btrfs_inode_defrag", + sizeof(struct inode_defrag), 0, + SLAB_MEM_SPREAD, + NULL); + if (!btrfs_inode_defrag_cachep) + return -ENOMEM; + + return 0; +} diff -u linux-oem-6.1-6.1.0/fs/btrfs/volumes.c linux-oem-6.1-6.1.0/fs/btrfs/volumes.c --- linux-oem-6.1-6.1.0/fs/btrfs/volumes.c +++ linux-oem-6.1-6.1.0/fs/btrfs/volumes.c @@ -408,6 +408,7 @@ static void free_fs_devices(struct btrfs_fs_devices *fs_devices) { struct btrfs_device *device; + WARN_ON(fs_devices->opened); while (!list_empty(&fs_devices->devices)) { device = list_entry(fs_devices->devices.next, @@ -770,8 +771,11 @@ BTRFS_SUPER_FLAG_CHANGING_FSID_V2); error = lookup_bdev(path, &path_devt); - if (error) + if (error) { + btrfs_err(NULL, "failed to lookup block device for path %s: %d", + path, error); return ERR_PTR(error); + } if (fsid_change_in_progress) { if (!has_metadata_uuid) @@ -836,6 +840,9 @@ if (!device) { if (fs_devices->opened) { + btrfs_err(NULL, + "device %s belongs to fsid %pU, and the fs is already mounted", + path, fs_devices->fsid); mutex_unlock(&fs_devices->device_list_mutex); return ERR_PTR(-EBUSY); } @@ -910,6 +917,9 @@ * generation are equal. */ mutex_unlock(&fs_devices->device_list_mutex); + btrfs_err(NULL, +"device %s already registered with a higher generation, found %llu expect %llu", + path, found_transid, device->generation); return ERR_PTR(-EEXIST); } @@ -1185,9 +1195,22 @@ mutex_lock(&uuid_mutex); close_fs_devices(fs_devices); - if (!fs_devices->opened) + if (!fs_devices->opened) { list_splice_init(&fs_devices->seed_list, &list); + /* + * If the struct btrfs_fs_devices is not assembled with any + * other device, it can be re-initialized during the next mount + * without the needing device-scan step. Therefore, it can be + * fully freed. + */ + if (fs_devices->num_devices == 1) { + list_del(&fs_devices->fs_list); + free_fs_devices(fs_devices); + } + } + + list_for_each_entry_safe(fs_devices, tmp, &list, seed_list) { close_fs_devices(fs_devices); list_del(&fs_devices->seed_list); @@ -1603,7 +1626,7 @@ if (ret < 0) goto out; - while (1) { + while (search_start < search_end) { l = path->nodes[0]; slot = path->slots[0]; if (slot >= btrfs_header_nritems(l)) { @@ -1626,6 +1649,9 @@ if (key.type != BTRFS_DEV_EXTENT_KEY) goto next; + if (key.offset > search_end) + break; + if (key.offset > search_start) { hole_size = key.offset - search_start; dev_extent_hole_check(device, &search_start, &hole_size, @@ -1686,6 +1712,7 @@ else ret = 0; + ASSERT(max_hole_start + max_hole_size <= search_end); out: btrfs_free_path(path); *start = max_hole_start; diff -u linux-oem-6.1-6.1.0/fs/ceph/caps.c linux-oem-6.1-6.1.0/fs/ceph/caps.c --- linux-oem-6.1-6.1.0/fs/ceph/caps.c +++ linux-oem-6.1-6.1.0/fs/ceph/caps.c @@ -4081,6 +4081,7 @@ void *p, *end; struct cap_extra_info extra_info = {}; bool queue_trunc; + bool close_sessions = false; dout("handle_caps from mds%d\n", session->s_mds); @@ -4218,9 +4219,13 @@ realm = NULL; if (snaptrace_len) { down_write(&mdsc->snap_rwsem); - ceph_update_snap_trace(mdsc, snaptrace, - snaptrace + snaptrace_len, - false, &realm); + if (ceph_update_snap_trace(mdsc, snaptrace, + snaptrace + snaptrace_len, + false, &realm)) { + up_write(&mdsc->snap_rwsem); + close_sessions = true; + goto done; + } downgrade_write(&mdsc->snap_rwsem); } else { down_read(&mdsc->snap_rwsem); @@ -4280,6 +4285,11 @@ iput(inode); out: ceph_put_string(extra_info.pool_ns); + + /* Defer closing the sessions after s_mutex lock being released */ + if (close_sessions) + ceph_mdsc_close_sessions(mdsc); + return; flush_cap_releases: diff -u linux-oem-6.1-6.1.0/fs/ceph/super.h linux-oem-6.1-6.1.0/fs/ceph/super.h --- linux-oem-6.1-6.1.0/fs/ceph/super.h +++ linux-oem-6.1-6.1.0/fs/ceph/super.h @@ -100,6 +100,17 @@ char *mon_addr; }; +/* mount state */ +enum { + CEPH_MOUNT_MOUNTING, + CEPH_MOUNT_MOUNTED, + CEPH_MOUNT_UNMOUNTING, + CEPH_MOUNT_UNMOUNTED, + CEPH_MOUNT_SHUTDOWN, + CEPH_MOUNT_RECOVER, + CEPH_MOUNT_FENCE_IO, +}; + #define CEPH_ASYNC_CREATE_CONFLICT_BITS 8 struct ceph_fs_client { diff -u linux-oem-6.1-6.1.0/fs/cifs/connect.c linux-oem-6.1-6.1.0/fs/cifs/connect.c --- linux-oem-6.1-6.1.0/fs/cifs/connect.c +++ linux-oem-6.1-6.1.0/fs/cifs/connect.c @@ -761,7 +761,7 @@ { struct msghdr smb_msg = {}; struct kvec iov = {.iov_base = buf, .iov_len = to_read}; - iov_iter_kvec(&smb_msg.msg_iter, READ, &iov, 1, to_read); + iov_iter_kvec(&smb_msg.msg_iter, ITER_DEST, &iov, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); } @@ -776,7 +776,7 @@ * and cifs_readv_from_socket sets msg_control and msg_controllen * so little to initialize in struct msghdr */ - iov_iter_discard(&smb_msg.msg_iter, READ, to_read); + iov_iter_discard(&smb_msg.msg_iter, ITER_DEST, to_read); return cifs_readv_from_socket(server, &smb_msg); } @@ -788,7 +788,7 @@ struct msghdr smb_msg = {}; struct bio_vec bv = { .bv_page = page, .bv_len = to_read, .bv_offset = page_offset}; - iov_iter_bvec(&smb_msg.msg_iter, READ, &bv, 1, to_read); + iov_iter_bvec(&smb_msg.msg_iter, ITER_DEST, &bv, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); } @@ -2609,11 +2609,14 @@ INIT_LIST_HEAD(&tcon->pending_opens); tcon->status = TID_GOOD; - /* schedule query interfaces poll */ INIT_DELAYED_WORK(&tcon->query_interfaces, smb2_query_server_interfaces); - queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, - (SMB_INTERFACE_POLL_INTERVAL * HZ)); + if (ses->server->dialect >= SMB30_PROT_ID && + (ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { + /* schedule query interfaces poll */ + queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, + (SMB_INTERFACE_POLL_INTERVAL * HZ)); + } spin_lock(&cifs_tcp_ses_lock); list_add(&tcon->tcon_list, &ses->tcon_list); @@ -3551,9 +3554,6 @@ struct cifs_tcon *tcon = mnt_ctx->tcon; struct smb3_fs_context *ctx = mnt_ctx->fs_ctx; char *full_path; -#ifdef CONFIG_CIFS_DFS_UPCALL - bool nodfs = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS; -#endif if (!server->ops->is_path_accessible) return -EOPNOTSUPP; @@ -3570,19 +3570,6 @@ rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, full_path); -#ifdef CONFIG_CIFS_DFS_UPCALL - if (nodfs) { - if (rc == -EREMOTE) - rc = -EOPNOTSUPP; - goto out; - } - - /* path *might* exist with non-ASCII characters in DFS root - * try again with full path (only if nodfs is not set) */ - if (rc == -ENOENT && is_tcon_dfs(tcon)) - rc = cifs_dfs_query_info_nonascii_quirk(xid, tcon, cifs_sb, - full_path); -#endif if (rc != 0 && rc != -EREMOTE) goto out; diff -u linux-oem-6.1-6.1.0/fs/cifs/misc.c linux-oem-6.1-6.1.0/fs/cifs/misc.c --- linux-oem-6.1-6.1.0/fs/cifs/misc.c +++ linux-oem-6.1-6.1.0/fs/cifs/misc.c @@ -1316,47 +1316,2 @@ } - -/** cifs_dfs_query_info_nonascii_quirk - * Handle weird Windows SMB server behaviour. It responds with - * STATUS_OBJECT_NAME_INVALID code to SMB2 QUERY_INFO request - * for "\\\" DFS reference, - * where contains non-ASCII unicode symbols. - * - * Check such DFS reference. - */ -int cifs_dfs_query_info_nonascii_quirk(const unsigned int xid, - struct cifs_tcon *tcon, - struct cifs_sb_info *cifs_sb, - const char *linkpath) -{ - char *treename, *dfspath, sep; - int treenamelen, linkpathlen, rc; - - treename = tcon->tree_name; - /* MS-DFSC: All paths in REQ_GET_DFS_REFERRAL and RESP_GET_DFS_REFERRAL - * messages MUST be encoded with exactly one leading backslash, not two - * leading backslashes. - */ - sep = CIFS_DIR_SEP(cifs_sb); - if (treename[0] == sep && treename[1] == sep) - treename++; - linkpathlen = strlen(linkpath); - treenamelen = strnlen(treename, MAX_TREE_SIZE + 1); - dfspath = kzalloc(treenamelen + linkpathlen + 1, GFP_KERNEL); - if (!dfspath) - return -ENOMEM; - if (treenamelen) - memcpy(dfspath, treename, treenamelen); - memcpy(dfspath + treenamelen, linkpath, linkpathlen); - rc = dfs_cache_find(xid, tcon->ses, cifs_sb->local_nls, - cifs_remap(cifs_sb), dfspath, NULL, NULL); - if (rc == 0) { - cifs_dbg(FYI, "DFS ref '%s' is found, emulate -EREMOTE\n", - dfspath); - rc = -EREMOTE; - } else { - cifs_dbg(FYI, "%s: dfs_cache_find returned %d\n", __func__, rc); - } - kfree(dfspath); - return rc; -} #endif diff -u linux-oem-6.1-6.1.0/fs/cifs/sess.c linux-oem-6.1-6.1.0/fs/cifs/sess.c --- linux-oem-6.1-6.1.0/fs/cifs/sess.c +++ linux-oem-6.1-6.1.0/fs/cifs/sess.c @@ -815,6 +815,7 @@ return -EINVAL; } if (tilen) { + kfree_sensitive(ses->auth_key.response); ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen, GFP_KERNEL); if (!ses->auth_key.response) { @@ -1428,6 +1429,7 @@ goto out_put_spnego_key; } + kfree_sensitive(ses->auth_key.response); ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, GFP_KERNEL); if (!ses->auth_key.response) { diff -u linux-oem-6.1-6.1.0/fs/cifs/smb2ops.c linux-oem-6.1-6.1.0/fs/cifs/smb2ops.c --- linux-oem-6.1-6.1.0/fs/cifs/smb2ops.c +++ linux-oem-6.1-6.1.0/fs/cifs/smb2ops.c @@ -797,7 +797,9 @@ int rc; __le16 *utf16_path; __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; + int err_buftype = CIFS_NO_BUFFER; struct cifs_open_parms oparms; + struct kvec err_iov = {}; struct cifs_fid fid; struct cached_fid *cfid; @@ -821,14 +823,32 @@ oparms.fid = &fid; oparms.reconnect = false; - rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL, - NULL); + rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, + &err_iov, &err_buftype); if (rc) { - kfree(utf16_path); - return rc; + struct smb2_hdr *hdr = err_iov.iov_base; + + if (unlikely(!hdr || err_buftype == CIFS_NO_BUFFER)) + goto out; + /* + * Handle weird Windows SMB server behaviour. It responds with + * STATUS_OBJECT_NAME_INVALID code to SMB2 QUERY_INFO request + * for "\\\" DFS reference, + * where contains non-ASCII unicode symbols. + */ + if (rc != -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && + hdr->Status == STATUS_OBJECT_NAME_INVALID) + rc = -EREMOTE; + if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && cifs_sb && + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS)) + rc = -EOPNOTSUPP; + goto out; } rc = SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); + +out: + free_rsp_buf(err_buftype, err_iov.iov_base); kfree(utf16_path); return rc; } @@ -4717,13 +4737,13 @@ return 0; } - iov_iter_bvec(&iter, WRITE, bvec, npages, data_len); + iov_iter_bvec(&iter, ITER_SOURCE, bvec, npages, data_len); } else if (buf_len >= data_offset + data_len) { /* read response payload is in buf */ WARN_ONCE(npages > 0, "read data can be either in buf or in pages"); iov.iov_base = buf + data_offset; iov.iov_len = data_len; - iov_iter_kvec(&iter, WRITE, &iov, 1, data_len); + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, data_len); } else { /* read response payload cannot be in both buf and pages */ WARN_ONCE(1, "buf can not contain only a part of read data"); diff -u linux-oem-6.1-6.1.0/fs/erofs/fscache.c linux-oem-6.1-6.1.0/fs/erofs/fscache.c --- linux-oem-6.1-6.1.0/fs/erofs/fscache.c +++ linux-oem-6.1-6.1.0/fs/erofs/fscache.c @@ -194,7 +194,7 @@ atomic_inc(&rreq->nr_outstanding); - iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, + iov_iter_xarray(&iter, ITER_DEST, &rreq->mapping->i_pages, start + done, subreq->len); ret = fscache_read(cres, subreq->start, &iter, @@ -290,7 +290,7 @@ if (IS_ERR(src)) return PTR_ERR(src); - iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, PAGE_SIZE); + iov_iter_xarray(&iter, ITER_DEST, &mapping->i_pages, pos, PAGE_SIZE); if (copy_to_iter(src + offset, size, &iter) != size) { erofs_put_metabuf(&buf); return -EFAULT; @@ -302,7 +302,7 @@ if (!(map.m_flags & EROFS_MAP_MAPPED)) { count = len; - iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, count); + iov_iter_xarray(&iter, ITER_DEST, &mapping->i_pages, pos, count); iov_iter_zero(count, &iter); return count; } diff -u linux-oem-6.1-6.1.0/fs/erofs/super.c linux-oem-6.1-6.1.0/fs/erofs/super.c --- linux-oem-6.1-6.1.0/fs/erofs/super.c +++ linux-oem-6.1-6.1.0/fs/erofs/super.c @@ -577,26 +577,25 @@ } ++ctx->devs->extra_devices; break; - case Opt_fsid: #ifdef CONFIG_EROFS_FS_ONDEMAND + case Opt_fsid: kfree(ctx->fsid); ctx->fsid = kstrdup(param->string, GFP_KERNEL); if (!ctx->fsid) return -ENOMEM; -#else - errorfc(fc, "fsid option not supported"); -#endif break; case Opt_domain_id: -#ifdef CONFIG_EROFS_FS_ONDEMAND kfree(ctx->domain_id); ctx->domain_id = kstrdup(param->string, GFP_KERNEL); if (!ctx->domain_id) return -ENOMEM; + break; #else - errorfc(fc, "domain_id option not supported"); -#endif + case Opt_fsid: + case Opt_domain_id: + errorfc(fc, "%s option not supported", erofs_fs_parameters[opt].name); break; +#endif default: return -ENOPARAM; } diff -u linux-oem-6.1-6.1.0/fs/erofs/zdata.c linux-oem-6.1-6.1.0/fs/erofs/zdata.c --- linux-oem-6.1-6.1.0/fs/erofs/zdata.c +++ linux-oem-6.1-6.1.0/fs/erofs/zdata.c @@ -1047,12 +1047,12 @@ if (!be->decompressed_pages) be->decompressed_pages = - kvcalloc(be->nr_pages, sizeof(struct page *), - GFP_KERNEL | __GFP_NOFAIL); + kcalloc(be->nr_pages, sizeof(struct page *), + GFP_KERNEL | __GFP_NOFAIL); if (!be->compressed_pages) be->compressed_pages = - kvcalloc(pclusterpages, sizeof(struct page *), - GFP_KERNEL | __GFP_NOFAIL); + kcalloc(pclusterpages, sizeof(struct page *), + GFP_KERNEL | __GFP_NOFAIL); z_erofs_parse_out_bvecs(be); err2 = z_erofs_parse_in_bvecs(be, &overlapped); @@ -1100,7 +1100,7 @@ } if (be->compressed_pages < be->onstack_pages || be->compressed_pages >= be->onstack_pages + Z_EROFS_ONSTACK_PAGES) - kvfree(be->compressed_pages); + kfree(be->compressed_pages); z_erofs_fill_other_copies(be, err); for (i = 0; i < be->nr_pages; ++i) { @@ -1119,7 +1119,7 @@ } if (be->decompressed_pages != be->onstack_pages) - kvfree(be->decompressed_pages); + kfree(be->decompressed_pages); pcl->length = 0; pcl->partial = true; diff -u linux-oem-6.1-6.1.0/fs/erofs/zmap.c linux-oem-6.1-6.1.0/fs/erofs/zmap.c --- linux-oem-6.1-6.1.0/fs/erofs/zmap.c +++ linux-oem-6.1-6.1.0/fs/erofs/zmap.c @@ -793,12 +793,16 @@ iomap->type = IOMAP_HOLE; iomap->addr = IOMAP_NULL_ADDR; /* - * No strict rule how to describe extents for post EOF, yet - * we need do like below. Otherwise, iomap itself will get + * No strict rule on how to describe extents for post EOF, yet + * we need to do like below. Otherwise, iomap itself will get * into an endless loop on post EOF. + * + * Calculate the effective offset by subtracting extent start + * (map.m_la) from the requested offset, and add it to length. + * (NB: offset >= map.m_la always) */ if (iomap->offset >= inode->i_size) - iomap->length = length + map.m_la - offset; + iomap->length = length + offset - map.m_la; } iomap->flags = 0; return 0; diff -u linux-oem-6.1-6.1.0/fs/f2fs/gc.c linux-oem-6.1-6.1.0/fs/f2fs/gc.c --- linux-oem-6.1-6.1.0/fs/f2fs/gc.c +++ linux-oem-6.1-6.1.0/fs/f2fs/gc.c @@ -1078,7 +1078,7 @@ { struct page *node_page; nid_t nid; - unsigned int ofs_in_node, max_addrs; + unsigned int ofs_in_node, max_addrs, base; block_t source_blkaddr; nid = le32_to_cpu(sum->nid); @@ -1104,11 +1104,17 @@ return false; } - max_addrs = IS_INODE(node_page) ? DEF_ADDRS_PER_INODE : - DEF_ADDRS_PER_BLOCK; - if (ofs_in_node >= max_addrs) { - f2fs_err(sbi, "Inconsistent ofs_in_node:%u in summary, ino:%u, nid:%u, max:%u", - ofs_in_node, dni->ino, dni->nid, max_addrs); + if (IS_INODE(node_page)) { + base = offset_in_addr(F2FS_INODE(node_page)); + max_addrs = DEF_ADDRS_PER_INODE; + } else { + base = 0; + max_addrs = DEF_ADDRS_PER_BLOCK; + } + + if (base + ofs_in_node >= max_addrs) { + f2fs_err(sbi, "Inconsistent blkaddr offset: base:%u, ofs_in_node:%u, max:%u, ino:%u, nid:%u", + base, ofs_in_node, max_addrs, dni->ino, dni->nid); f2fs_put_page(node_page, 1); return false; } diff -u linux-oem-6.1-6.1.0/fs/f2fs/super.c linux-oem-6.1-6.1.0/fs/f2fs/super.c --- linux-oem-6.1-6.1.0/fs/f2fs/super.c +++ linux-oem-6.1-6.1.0/fs/f2fs/super.c @@ -4095,6 +4095,24 @@ sbi->sb = sb; + /* initialize locks within allocated memory */ + init_f2fs_rwsem(&sbi->gc_lock); + mutex_init(&sbi->writepages); + init_f2fs_rwsem(&sbi->cp_global_sem); + init_f2fs_rwsem(&sbi->node_write); + init_f2fs_rwsem(&sbi->node_change); + spin_lock_init(&sbi->stat_lock); + init_f2fs_rwsem(&sbi->cp_rwsem); + init_f2fs_rwsem(&sbi->quota_sem); + init_waitqueue_head(&sbi->cp_wait); + spin_lock_init(&sbi->error_lock); + + for (i = 0; i < NR_INODE_TYPE; i++) { + INIT_LIST_HEAD(&sbi->inode_list[i]); + spin_lock_init(&sbi->inode_lock[i]); + } + mutex_init(&sbi->flush_lock); + /* Load the checksum driver */ sbi->s_chksum_driver = crypto_alloc_shash("crc32", 0, 0); if (IS_ERR(sbi->s_chksum_driver)) { @@ -4118,6 +4136,8 @@ sb->s_fs_info = sbi; sbi->raw_super = raw_super; + memcpy(sbi->errors, raw_super->s_errors, MAX_F2FS_ERRORS); + /* precompute checksum seed for metadata */ if (f2fs_sb_has_inode_chksum(sbi)) sbi->s_chksum_seed = f2fs_chksum(sbi, ~0, raw_super->uuid, @@ -4174,26 +4194,14 @@ /* init f2fs-specific super block info */ sbi->valid_super_block = valid_super_block; - init_f2fs_rwsem(&sbi->gc_lock); - mutex_init(&sbi->writepages); - init_f2fs_rwsem(&sbi->cp_global_sem); - init_f2fs_rwsem(&sbi->node_write); - init_f2fs_rwsem(&sbi->node_change); /* disallow all the data/node/meta page writes */ set_sbi_flag(sbi, SBI_POR_DOING); - spin_lock_init(&sbi->stat_lock); err = f2fs_init_write_merge_io(sbi); if (err) goto free_bio_info; - spin_lock_init(&sbi->error_lock); - memcpy(sbi->errors, raw_super->s_errors, MAX_F2FS_ERRORS); - - init_f2fs_rwsem(&sbi->cp_rwsem); - init_f2fs_rwsem(&sbi->quota_sem); - init_waitqueue_head(&sbi->cp_wait); init_sb_info(sbi); err = f2fs_init_iostat(sbi); @@ -4271,12 +4279,6 @@ limit_reserve_root(sbi); adjust_unusable_cap_perc(sbi); - for (i = 0; i < NR_INODE_TYPE; i++) { - INIT_LIST_HEAD(&sbi->inode_list[i]); - spin_lock_init(&sbi->inode_lock[i]); - } - mutex_init(&sbi->flush_lock); - f2fs_init_extent_cache_info(sbi); f2fs_init_ino_entry_info(sbi); diff -u linux-oem-6.1-6.1.0/fs/ksmbd/connection.c linux-oem-6.1-6.1.0/fs/ksmbd/connection.c --- linux-oem-6.1-6.1.0/fs/ksmbd/connection.c +++ linux-oem-6.1-6.1.0/fs/ksmbd/connection.c @@ -280,7 +280,7 @@ { struct ksmbd_conn *conn = (struct ksmbd_conn *)p; struct ksmbd_transport *t = conn->transport; - unsigned int pdu_size; + unsigned int pdu_size, max_allowed_pdu_size; char hdr_buf[4] = {0,}; int size; @@ -305,13 +305,26 @@ pdu_size = get_rfc1002_len(hdr_buf); ksmbd_debug(CONN, "RFC1002 header %u bytes\n", pdu_size); + if (conn->status == KSMBD_SESS_GOOD) + max_allowed_pdu_size = + SMB3_MAX_MSGSIZE + conn->vals->max_write_size; + else + max_allowed_pdu_size = SMB3_MAX_MSGSIZE; + + if (pdu_size > max_allowed_pdu_size) { + pr_err_ratelimited("PDU length(%u) excceed maximum allowed pdu size(%u) on connection(%d)\n", + pdu_size, max_allowed_pdu_size, + conn->status); + break; + } + /* * Check if pdu size is valid (min : smb header size, * max : 0x00FFFFFF). */ if (pdu_size < __SMB2_HEADER_STRUCTURE_SIZE || pdu_size > MAX_STREAM_PROT_LEN) { - continue; + break; } /* 4 for rfc1002 length field */ diff -u linux-oem-6.1-6.1.0/fs/ksmbd/smb2pdu.c linux-oem-6.1-6.1.0/fs/ksmbd/smb2pdu.c --- linux-oem-6.1-6.1.0/fs/ksmbd/smb2pdu.c +++ linux-oem-6.1-6.1.0/fs/ksmbd/smb2pdu.c @@ -8657,6 +8657,7 @@ bool smb3_11_final_sess_setup_resp(struct ksmbd_work *work) { struct ksmbd_conn *conn = work->conn; + struct ksmbd_session *sess = work->sess; struct smb2_hdr *rsp = smb2_get_msg(work->response_buf); if (conn->dialect < SMB30_PROT_ID) @@ -8666,6 +8667,7 @@ rsp = ksmbd_resp_buf_next(work); if (le16_to_cpu(rsp->Command) == SMB2_SESSION_SETUP_HE && + sess->user && !user_guest(sess->user) && rsp->Status == STATUS_SUCCESS) return true; return false; diff -u linux-oem-6.1-6.1.0/fs/ksmbd/transport_tcp.c linux-oem-6.1-6.1.0/fs/ksmbd/transport_tcp.c --- linux-oem-6.1-6.1.0/fs/ksmbd/transport_tcp.c +++ linux-oem-6.1-6.1.0/fs/ksmbd/transport_tcp.c @@ -15,6 +15,8 @@ #define IFACE_STATE_DOWN BIT(0) #define IFACE_STATE_CONFIGURED BIT(1) +static atomic_t active_num_conn; + struct interface { struct task_struct *ksmbd_kthread; struct socket *ksmbd_socket; @@ -185,8 +187,10 @@ struct tcp_transport *t; t = alloc_transport(client_sk); - if (!t) + if (!t) { + sock_release(client_sk); return -ENOMEM; + } csin = KSMBD_TCP_PEER_SOCKADDR(KSMBD_TRANS(t)->conn); if (kernel_getpeername(client_sk, csin) < 0) { @@ -239,6 +243,15 @@ continue; } + if (server_conf.max_connections && + atomic_inc_return(&active_num_conn) >= server_conf.max_connections) { + pr_info_ratelimited("Limit the maximum number of connections(%u)\n", + atomic_read(&active_num_conn)); + atomic_dec(&active_num_conn); + sock_release(client_sk); + continue; + } + ksmbd_debug(CONN, "connect success: accepted new connection\n"); client_sk->sk->sk_rcvtimeo = KSMBD_TCP_RECV_TIMEOUT; client_sk->sk->sk_sndtimeo = KSMBD_TCP_SEND_TIMEOUT; @@ -368,6 +381,8 @@ static void ksmbd_tcp_disconnect(struct ksmbd_transport *t) { free_transport(TCP_TRANS(t)); + if (server_conf.max_connections) + atomic_dec(&active_num_conn); } static void tcp_destroy_socket(struct socket *ksmbd_socket) diff -u linux-oem-6.1-6.1.0/fs/nfsd/nfs4proc.c linux-oem-6.1-6.1.0/fs/nfsd/nfs4proc.c --- linux-oem-6.1-6.1.0/fs/nfsd/nfs4proc.c +++ linux-oem-6.1-6.1.0/fs/nfsd/nfs4proc.c @@ -731,10 +731,19 @@ union nfsd4_op_u *u) { struct nfsd4_commit *commit = &u->commit; + struct nfsd_file *nf; + __be32 status; - return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, + status = nfsd_file_acquire(rqstp, &cstate->current_fh, NFSD_MAY_WRITE | + NFSD_MAY_NOT_BREAK_LEASE, &nf); + if (status != nfs_ok) + return status; + + status = nfsd_commit(rqstp, &cstate->current_fh, nf, commit->co_offset, commit->co_count, (__be32 *)commit->co_verf.data); + nfsd_file_put(nf); + return status; } static __be32 @@ -1322,6 +1331,7 @@ /* allow 20secs for mount/unmount for now - revisit */ if (signal_pending(current) || (schedule_timeout(20*HZ) == 0)) { + finish_wait(&nn->nfsd_ssc_waitq, &wait); kfree(work); return nfserr_eagain; } diff -u linux-oem-6.1-6.1.0/fs/nfsd/nfs4state.c linux-oem-6.1-6.1.0/fs/nfsd/nfs4state.c --- linux-oem-6.1-6.1.0/fs/nfsd/nfs4state.c +++ linux-oem-6.1-6.1.0/fs/nfsd/nfs4state.c @@ -842,9 +842,9 @@ swap(f2, fp->fi_fds[O_RDWR]); spin_unlock(&fp->fi_lock); if (f1) - nfsd_file_close(f1); + nfsd_file_put(f1); if (f2) - nfsd_file_close(f2); + nfsd_file_put(f2); } } @@ -5211,18 +5211,10 @@ if (!fp->fi_fds[oflag]) { spin_unlock(&fp->fi_lock); - if (!open->op_filp) { - status = nfsd_file_acquire(rqstp, cur_fh, access, &nf); - if (status != nfs_ok) - goto out_put_access; - } else { - status = nfsd_file_create(rqstp, cur_fh, access, &nf); - if (status != nfs_ok) - goto out_put_access; - nf->nf_file = open->op_filp; - open->op_filp = NULL; - trace_nfsd_file_create(rqstp, access, nf); - } + status = nfsd_file_acquire_opened(rqstp, cur_fh, access, + open->op_filp, &nf); + if (status != nfs_ok) + goto out_put_access; spin_lock(&fp->fi_lock); if (!fp->fi_fds[oflag]) { diff -u linux-oem-6.1-6.1.0/fs/nilfs2/the_nilfs.c linux-oem-6.1-6.1.0/fs/nilfs2/the_nilfs.c --- linux-oem-6.1-6.1.0/fs/nilfs2/the_nilfs.c +++ linux-oem-6.1-6.1.0/fs/nilfs2/the_nilfs.c @@ -544,9 +544,15 @@ { struct nilfs_super_block **sbp = nilfs->ns_sbp; struct buffer_head **sbh = nilfs->ns_sbh; - u64 sb2off = NILFS_SB2_OFFSET_BYTES(bdev_nr_bytes(nilfs->ns_bdev)); + u64 sb2off, devsize = bdev_nr_bytes(nilfs->ns_bdev); int valid[2], swp = 0; + if (devsize < NILFS_SEG_MIN_BLOCKS * NILFS_MIN_BLOCK_SIZE + 4096) { + nilfs_err(sb, "device size too small"); + return -EINVAL; + } + sb2off = NILFS_SB2_OFFSET_BYTES(devsize); + sbp[0] = nilfs_read_super_block(sb, NILFS_SB_OFFSET_BYTES, blocksize, &sbh[0]); sbp[1] = nilfs_read_super_block(sb, sb2off, blocksize, &sbh[1]); diff -u linux-oem-6.1-6.1.0/fs/ntfs3/attrib.c linux-oem-6.1-6.1.0/fs/ntfs3/attrib.c --- linux-oem-6.1-6.1.0/fs/ntfs3/attrib.c +++ linux-oem-6.1-6.1.0/fs/ntfs3/attrib.c @@ -2038,7 +2038,7 @@ return -ENOENT; if (!attr_b->non_res) { - u32 data_size = le32_to_cpu(attr->res.data_size); + u32 data_size = le32_to_cpu(attr_b->res.data_size); u32 from, to; if (vbo > data_size) diff -u linux-oem-6.1-6.1.0/fs/ntfs3/inode.c linux-oem-6.1-6.1.0/fs/ntfs3/inode.c --- linux-oem-6.1-6.1.0/fs/ntfs3/inode.c +++ linux-oem-6.1-6.1.0/fs/ntfs3/inode.c @@ -132,6 +132,13 @@ if (le16_to_cpu(attr->name_off) + attr->name_len > asize) goto out; + if (attr->non_res) { + t64 = le64_to_cpu(attr->nres.alloc_size); + if (le64_to_cpu(attr->nres.data_size) > t64 || + le64_to_cpu(attr->nres.valid_size) > t64) + goto out; + } + switch (attr->type) { case ATTR_STD: if (attr->non_res || diff -u linux-oem-6.1-6.1.0/fs/overlayfs/overlayfs.h linux-oem-6.1-6.1.0/fs/overlayfs/overlayfs.h --- linux-oem-6.1-6.1.0/fs/overlayfs/overlayfs.h +++ linux-oem-6.1-6.1.0/fs/overlayfs/overlayfs.h @@ -108,7 +108,7 @@ u8 padding[3]; /* make sure fb.fid is 32bit aligned */ union { struct ovl_fb fb; - u8 buf[0]; + DECLARE_FLEX_ARRAY(u8, buf); }; } __packed; @@ -253,7 +253,7 @@ int err; inode_lock(inode); - err = __vfs_setxattr_noperm(&init_user_ns, dentry, name, value, size, flags); + err = __vfs_setxattr_noperm(ovl_upper_mnt_userns(ofs), dentry, name, value, size, flags); inode_unlock(inode); pr_debug("setxattr(%pd2, \"%s\", \"%*pE\", %zu, %d) = %i\n", @@ -275,7 +275,7 @@ int err; inode_lock(inode); - err = __vfs_removexattr_noperm(&init_user_ns, dentry, name); + err = __vfs_removexattr_noperm(ovl_upper_mnt_userns(ofs), dentry, name); inode_unlock(inode); pr_debug("removexattr(%pd2, \"%s\") = %i\n", dentry, name, err); diff -u linux-oem-6.1-6.1.0/fs/proc/task_mmu.c linux-oem-6.1-6.1.0/fs/proc/task_mmu.c --- linux-oem-6.1-6.1.0/fs/proc/task_mmu.c +++ linux-oem-6.1-6.1.0/fs/proc/task_mmu.c @@ -740,9 +740,7 @@ page = pfn_swap_entry_to_page(swpent); } if (page) { - int mapcount = page_mapcount(page); - - if (mapcount >= 2) + if (page_mapcount(page) >= 2 || hugetlb_pmd_shared(pte)) mss->shared_hugetlb += huge_page_size(hstate_vma(vma)); else mss->private_hugetlb += huge_page_size(hstate_vma(vma)); diff -u linux-oem-6.1-6.1.0/fs/splice.c linux-oem-6.1-6.1.0/fs/splice.c --- linux-oem-6.1-6.1.0/fs/splice.c +++ linux-oem-6.1-6.1.0/fs/splice.c @@ -303,7 +303,7 @@ struct kiocb kiocb; int ret; - iov_iter_pipe(&to, READ, pipe, len); + iov_iter_pipe(&to, ITER_DEST, pipe, len); init_sync_kiocb(&kiocb, in); kiocb.ki_pos = *ppos; ret = call_read_iter(in, &kiocb, &to); @@ -682,7 +682,7 @@ n++; } - iov_iter_bvec(&from, WRITE, array, n, sd.total_len - left); + iov_iter_bvec(&from, ITER_SOURCE, array, n, sd.total_len - left); ret = vfs_iter_write(out, &from, &sd.pos, 0); if (ret <= 0) break; @@ -1265,9 +1265,9 @@ if (!f.file) return -EBADF; if (f.file->f_mode & FMODE_WRITE) { - *type = WRITE; + *type = ITER_SOURCE; } else if (f.file->f_mode & FMODE_READ) { - *type = READ; + *type = ITER_DEST; } else { fdput(f); return -EBADF; @@ -1316,7 +1316,7 @@ if (!iov_iter_count(&iter)) error = 0; - else if (iov_iter_rw(&iter) == WRITE) + else if (type == ITER_SOURCE) error = vmsplice_to_pipe(f.file, &iter, flags); else error = vmsplice_to_user(f.file, &iter, flags); diff -u linux-oem-6.1-6.1.0/include/linux/efi.h linux-oem-6.1-6.1.0/include/linux/efi.h --- linux-oem-6.1-6.1.0/include/linux/efi.h +++ linux-oem-6.1-6.1.0/include/linux/efi.h @@ -670,7 +670,8 @@ #define EFI_RT_SUPPORTED_ALL 0x3fff -#define EFI_RT_SUPPORTED_TIME_SERVICES 0x000f +#define EFI_RT_SUPPORTED_TIME_SERVICES 0x0003 +#define EFI_RT_SUPPORTED_WAKEUP_SERVICES 0x000c #define EFI_RT_SUPPORTED_VARIABLE_SERVICES 0x0070 extern struct mm_struct efi_mm; diff -u linux-oem-6.1-6.1.0/include/linux/mm.h linux-oem-6.1-6.1.0/include/linux/mm.h --- linux-oem-6.1-6.1.0/include/linux/mm.h +++ linux-oem-6.1-6.1.0/include/linux/mm.h @@ -136,7 +136,7 @@ * define their own version of this macro in */ #if BITS_PER_LONG == 64 -/* This function must be updated when the size of struct page grows above 80 +/* This function must be updated when the size of struct page grows above 96 * or reduces below 56. The idea that compiler optimizes out switch() * statement, and only leaves move/store instructions. Also the compiler can * combine write statements if they are both assignments and can be reordered, @@ -147,12 +147,18 @@ { unsigned long *_pp = (void *)page; - /* Check that struct page is either 56, 64, 72, or 80 bytes */ + /* Check that struct page is either 56, 64, 72, 80, 88 or 96 bytes */ BUILD_BUG_ON(sizeof(struct page) & 7); BUILD_BUG_ON(sizeof(struct page) < 56); - BUILD_BUG_ON(sizeof(struct page) > 80); + BUILD_BUG_ON(sizeof(struct page) > 96); switch (sizeof(struct page)) { + case 96: + _pp[11] = 0; + fallthrough; + case 88: + _pp[10] = 0; + fallthrough; case 80: _pp[9] = 0; fallthrough; diff -u linux-oem-6.1-6.1.0/include/linux/random.h linux-oem-6.1-6.1.0/include/linux/random.h --- linux-oem-6.1-6.1.0/include/linux/random.h +++ linux-oem-6.1-6.1.0/include/linux/random.h @@ -19,14 +19,14 @@ void add_interrupt_randomness(int irq) __latent_entropy; void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy); -#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) static inline void add_latent_entropy(void) { +#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy)); -} #else -static inline void add_latent_entropy(void) { } + add_device_randomness(NULL, 0); #endif +} #if IS_ENABLED(CONFIG_VMGENID) void add_vmfork_randomness(const void *unique_vm_id, size_t len); diff -u linux-oem-6.1-6.1.0/include/net/mac80211.h linux-oem-6.1-6.1.0/include/net/mac80211.h --- linux-oem-6.1-6.1.0/include/net/mac80211.h +++ linux-oem-6.1-6.1.0/include/net/mac80211.h @@ -1858,8 +1858,6 @@ bool probe_req_reg; bool rx_mcast_action_reg; - bool txqs_stopped[IEEE80211_NUM_ACS]; - struct ieee80211_vif *mbssid_tx_vif; /* must be last */ diff -u linux-oem-6.1-6.1.0/io_uring/io_uring.c linux-oem-6.1-6.1.0/io_uring/io_uring.c --- linux-oem-6.1-6.1.0/io_uring/io_uring.c +++ linux-oem-6.1-6.1.0/io_uring/io_uring.c @@ -823,15 +823,19 @@ return filled; } -static void __io_req_complete_put(struct io_kiocb *req) +void io_req_complete_post(struct io_kiocb *req) { + struct io_ring_ctx *ctx = req->ctx; + + io_cq_lock(ctx); + if (!(req->flags & REQ_F_CQE_SKIP)) + __io_fill_cqe_req(ctx, req); + /* * If we're the last reference to this request, add to our locked * free_list cache. */ if (req_ref_put_and_test(req)) { - struct io_ring_ctx *ctx = req->ctx; - if (req->flags & IO_REQ_LINK_FLAGS) { if (req->flags & IO_DISARM_MASK) io_disarm_next(req); @@ -852,21 +856,6 @@ wq_list_add_head(&req->comp_list, &ctx->locked_free_list); ctx->locked_free_nr++; } -} - -void __io_req_complete_post(struct io_kiocb *req) -{ - if (!(req->flags & REQ_F_CQE_SKIP)) - __io_fill_cqe_req(req->ctx, req); - __io_req_complete_put(req); -} - -void io_req_complete_post(struct io_kiocb *req) -{ - struct io_ring_ctx *ctx = req->ctx; - - io_cq_lock(ctx); - __io_req_complete_post(req); io_cq_unlock_post(ctx); } @@ -876,9 +865,12 @@ } void io_req_complete_failed(struct io_kiocb *req, s32 res) + __must_hold(&ctx->uring_lock) { const struct io_op_def *def = &io_op_defs[req->opcode]; + lockdep_assert_held(&req->ctx->uring_lock); + req_set_fail(req); io_req_set_res(req, res, io_put_kbuf(req, IO_URING_F_UNLOCKED)); if (def->fail) @@ -1133,7 +1125,7 @@ percpu_ref_put(&ctx->refs); } -static inline void __io_req_task_work_add(struct io_kiocb *req, bool allow_local) +void __io_req_task_work_add(struct io_kiocb *req, bool allow_local) { struct io_uring_task *tctx = req->task->io_uring; struct io_ring_ctx *ctx = req->ctx; @@ -1165,11 +1157,6 @@ } } -void io_req_task_work_add(struct io_kiocb *req) -{ - __io_req_task_work_add(req, true); -} - static void __cold io_move_task_work_from_local(struct io_ring_ctx *ctx) { struct llist_node *node; @@ -1243,18 +1230,6 @@ return ret; } -static void io_req_tw_post(struct io_kiocb *req, bool *locked) -{ - io_req_complete_post(req); -} - -void io_req_tw_post_queue(struct io_kiocb *req, s32 res, u32 cflags) -{ - io_req_set_res(req, res, cflags); - req->io_task_work.func = io_req_tw_post; - io_req_task_work_add(req); -} - static void io_req_task_cancel(struct io_kiocb *req, bool *locked) { /* not needed for normal modes, but SQPOLL depends on it */ @@ -1641,6 +1616,7 @@ } static __cold void io_drain_req(struct io_kiocb *req) + __must_hold(&ctx->uring_lock) { struct io_ring_ctx *ctx = req->ctx; struct io_defer_entry *de; @@ -1658,17 +1634,12 @@ } spin_unlock(&ctx->completion_lock); - ret = io_req_prep_async(req); - if (ret) { -fail: - io_req_complete_failed(req, ret); - return; - } io_prep_async_link(req); de = kmalloc(sizeof(*de), GFP_KERNEL); if (!de) { ret = -ENOMEM; - goto fail; + io_req_complete_failed(req, ret); + return; } spin_lock(&ctx->completion_lock); @@ -1942,13 +1913,16 @@ req->flags &= ~REQ_F_HARDLINK; req->flags |= REQ_F_LINK; io_req_complete_failed(req, req->cqe.res); - } else if (unlikely(req->ctx->drain_active)) { - io_drain_req(req); } else { int ret = io_req_prep_async(req); - if (unlikely(ret)) + if (unlikely(ret)) { io_req_complete_failed(req, ret); + return; + } + + if (unlikely(req->ctx->drain_active)) + io_drain_req(req); else io_queue_iowq(req, NULL); } @@ -2877,7 +2851,7 @@ while (!list_empty(&list)) { de = list_first_entry(&list, struct io_defer_entry, list); list_del_init(&de->list); - io_req_complete_failed(de->req, -ECANCELED); + io_req_task_queue_fail(de->req, -ECANCELED); kfree(de); } return true; diff -u linux-oem-6.1-6.1.0/io_uring/io_uring.h linux-oem-6.1-6.1.0/io_uring/io_uring.h --- linux-oem-6.1-6.1.0/io_uring/io_uring.h +++ linux-oem-6.1-6.1.0/io_uring/io_uring.h @@ -33,7 +33,6 @@ void io_req_complete_failed(struct io_kiocb *req, s32 res); void __io_req_complete(struct io_kiocb *req, unsigned issue_flags); void io_req_complete_post(struct io_kiocb *req); -void __io_req_complete_post(struct io_kiocb *req); bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags, bool allow_overflow); bool io_fill_cqe_aux(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags, @@ -51,10 +50,9 @@ return req->flags & REQ_F_FIXED_FILE; } +void __io_req_task_work_add(struct io_kiocb *req, bool allow_local); bool io_is_uring_fops(struct file *file); bool io_alloc_async_data(struct io_kiocb *req); -void io_req_task_work_add(struct io_kiocb *req); -void io_req_tw_post_queue(struct io_kiocb *req, s32 res, u32 cflags); void io_req_task_queue(struct io_kiocb *req); void io_queue_iowq(struct io_kiocb *req, bool *dont_use); void io_req_task_complete(struct io_kiocb *req, bool *locked); @@ -83,6 +81,11 @@ bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task, bool cancel_all); +static inline void io_req_task_work_add(struct io_kiocb *req) +{ + __io_req_task_work_add(req, true); +} + #define io_for_each_link(pos, head) \ for (pos = (head); pos; pos = pos->link) @@ -378,2 +381,9 @@ +static inline void io_req_queue_tw_complete(struct io_kiocb *req, s32 res) +{ + io_req_set_res(req, res, 0); + req->io_task_work.func = io_req_task_complete; + io_req_task_work_add(req); +} + #endif diff -u linux-oem-6.1-6.1.0/io_uring/msg_ring.c linux-oem-6.1-6.1.0/io_uring/msg_ring.c --- linux-oem-6.1-6.1.0/io_uring/msg_ring.c +++ linux-oem-6.1-6.1.0/io_uring/msg_ring.c @@ -30,6 +30,8 @@ if (msg->src_fd || msg->dst_fd || msg->flags) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0, true)) return 0; @@ -84,6 +86,8 @@ if (target_ctx == ctx) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; ret = io_double_lock_ctx(ctx, target_ctx, issue_flags); if (unlikely(ret)) diff -u linux-oem-6.1-6.1.0/io_uring/net.c linux-oem-6.1-6.1.0/io_uring/net.c --- linux-oem-6.1-6.1.0/io_uring/net.c +++ linux-oem-6.1-6.1.0/io_uring/net.c @@ -62,6 +62,7 @@ u16 flags; /* initialised and used only by !msg send variants */ u16 addr_len; + u16 buf_group; void __user *addr; /* used only for send zerocopy */ struct io_kiocb *notif; @@ -363,7 +364,7 @@ if (unlikely(!sock)) return -ENOTSOCK; - ret = import_single_range(WRITE, sr->buf, sr->len, &iov, &msg.msg_iter); + ret = import_single_range(ITER_SOURCE, sr->buf, sr->len, &iov, &msg.msg_iter); if (unlikely(ret)) return ret; @@ -449,7 +450,7 @@ } } else { iomsg->free_iov = iomsg->fast_iov; - ret = __import_iovec(READ, msg.msg_iov, msg.msg_iovlen, UIO_FASTIOV, + ret = __import_iovec(ITER_DEST, msg.msg_iov, msg.msg_iovlen, UIO_FASTIOV, &iomsg->free_iov, &iomsg->msg.msg_iter, false); if (ret > 0) @@ -502,7 +503,7 @@ } } else { iomsg->free_iov = iomsg->fast_iov; - ret = __import_iovec(READ, (struct iovec __user *)uiov, msg.msg_iovlen, + ret = __import_iovec(ITER_DEST, (struct iovec __user *)uiov, msg.msg_iovlen, UIO_FASTIOV, &iomsg->free_iov, &iomsg->msg.msg_iter, true); if (ret < 0) @@ -565,6 +566,15 @@ if (req->opcode == IORING_OP_RECV && sr->len) return -EINVAL; req->flags |= REQ_F_APOLL_MULTISHOT; + /* + * Store the buffer group for this multishot receive separately, + * as if we end up doing an io-wq based issue that selects a + * buffer, it has to be committed immediately and that will + * clear ->buf_list. This means we lose the link to the buffer + * list, and the eventual buffer put on completion then cannot + * restore it. + */ + sr->buf_group = req->buf_index; } #ifdef CONFIG_COMPAT @@ -581,6 +591,7 @@ sr->done_io = 0; sr->len = 0; /* get from the provided buffer */ + req->buf_index = sr->buf_group; } /* @@ -752,7 +763,7 @@ kmsg->fast_iov[0].iov_base = buf; kmsg->fast_iov[0].iov_len = len; - iov_iter_init(&kmsg->msg.msg_iter, READ, kmsg->fast_iov, 1, + iov_iter_init(&kmsg->msg.msg_iter, ITER_DEST, kmsg->fast_iov, 1, len); } @@ -846,7 +857,7 @@ sr->buf = buf; } - ret = import_single_range(READ, sr->buf, len, &iov, &msg.msg_iter); + ret = import_single_range(ITER_DEST, sr->buf, len, &iov, &msg.msg_iter); if (unlikely(ret)) goto out_free; @@ -1086,13 +1097,13 @@ return io_setup_async_addr(req, &__address, issue_flags); if (zc->flags & IORING_RECVSEND_FIXED_BUF) { - ret = io_import_fixed(WRITE, &msg.msg_iter, req->imu, + ret = io_import_fixed(ITER_SOURCE, &msg.msg_iter, req->imu, (u64)(uintptr_t)zc->buf, zc->len); if (unlikely(ret)) return ret; msg.sg_from_iter = io_sg_from_iter; } else { - ret = import_single_range(WRITE, zc->buf, zc->len, &iov, + ret = import_single_range(ITER_SOURCE, zc->buf, zc->len, &iov, &msg.msg_iter); if (unlikely(ret)) return ret; diff -u linux-oem-6.1-6.1.0/io_uring/poll.c linux-oem-6.1-6.1.0/io_uring/poll.c --- linux-oem-6.1-6.1.0/io_uring/poll.c +++ linux-oem-6.1-6.1.0/io_uring/poll.c @@ -223,22 +223,23 @@ IOU_POLL_DONE = 0, IOU_POLL_NO_ACTION = 1, IOU_POLL_REMOVE_POLL_USE_RES = 2, + IOU_POLL_REISSUE = 3, }; /* * All poll tw should go through this. Checks for poll events, manages * references, does rewait, etc. * - * Returns a negative error on failure. IOU_POLL_NO_ACTION when no action require, - * which is either spurious wakeup or multishot CQE is served. - * IOU_POLL_DONE when it's done with the request, then the mask is stored in req->cqe.res. - * IOU_POLL_REMOVE_POLL_USE_RES indicates to remove multishot poll and that the result - * is stored in req->cqe. + * Returns a negative error on failure. IOU_POLL_NO_ACTION when no action + * require, which is either spurious wakeup or multishot CQE is served. + * IOU_POLL_DONE when it's done with the request, then the mask is stored in + * req->cqe.res. IOU_POLL_REMOVE_POLL_USE_RES indicates to remove multishot + * poll and that the result is stored in req->cqe. */ static int io_poll_check_events(struct io_kiocb *req, bool *locked) { struct io_ring_ctx *ctx = req->ctx; - int v, ret; + int v; /* req->task == current here, checking PF_EXITING is safe */ if (unlikely(req->task->flags & PF_EXITING)) @@ -274,10 +275,19 @@ if (!req->cqe.res) { struct poll_table_struct pt = { ._key = req->apoll_events }; req->cqe.res = vfs_poll(req->file, &pt) & req->apoll_events; + /* + * We got woken with a mask, but someone else got to + * it first. The above vfs_poll() doesn't add us back + * to the waitqueue, so if we get nothing back, we + * should be safe and attempt a reissue. + */ + if (unlikely(!req->cqe.res)) { + /* Multishot armed need not reissue */ + if (!(req->apoll_events & EPOLLONESHOT)) + continue; + return IOU_POLL_REISSUE; + } } - - if ((unlikely(!req->cqe.res))) - continue; if (req->apoll_events & EPOLLONESHOT) return IOU_POLL_DONE; if (io_is_uring_fops(req->file)) @@ -294,7 +304,7 @@ return IOU_POLL_REMOVE_POLL_USE_RES; } } else { - ret = io_poll_issue(req, locked); + int ret = io_poll_issue(req, locked); if (ret == IOU_STOP_MULTISHOT) return IOU_POLL_REMOVE_POLL_USE_RES; if (ret < 0) @@ -325,6 +335,11 @@ if (ret == IOU_POLL_DONE) { struct io_poll *poll = io_kiocb_to_cmd(req, struct io_poll); req->cqe.res = mangle_poll(req->cqe.res & poll->events); + } else if (ret == IOU_POLL_REISSUE) { + io_poll_remove_entries(req); + io_poll_tw_hash_eject(req, locked); + io_req_task_submit(req, locked); + return; } else if (ret != IOU_POLL_REMOVE_POLL_USE_RES) { req->cqe.res = ret; req_set_fail(req); @@ -350,7 +365,7 @@ if (ret == IOU_POLL_REMOVE_POLL_USE_RES) io_req_complete_post(req); - else if (ret == IOU_POLL_DONE) + else if (ret == IOU_POLL_DONE || ret == IOU_POLL_REISSUE) io_req_task_submit(req, locked); else io_req_complete_failed(req, ret); @@ -549,6 +564,14 @@ return pt->owning || io_poll_get_ownership(req); } +static void io_poll_add_hash(struct io_kiocb *req) +{ + if (req->flags & REQ_F_HASH_LOCKED) + io_poll_req_insert_locked(req); + else + io_poll_req_insert(req); +} + /* * Returns 0 when it's handed over for polling. The caller owns the requests if * it returns non-zero, but otherwise should not touch it. Negative values @@ -607,18 +630,17 @@ if (mask && ((poll->events & (EPOLLET|EPOLLONESHOT)) == (EPOLLET|EPOLLONESHOT))) { - if (!io_poll_can_finish_inline(req, ipt)) + if (!io_poll_can_finish_inline(req, ipt)) { + io_poll_add_hash(req); return 0; + } io_poll_remove_entries(req); ipt->result_mask = mask; /* no one else has access to the req, forget about the ref */ return 1; } - if (req->flags & REQ_F_HASH_LOCKED) - io_poll_req_insert_locked(req); - else - io_poll_req_insert(req); + io_poll_add_hash(req); if (mask && (poll->events & EPOLLET) && io_poll_can_finish_inline(req, ipt)) { diff -u linux-oem-6.1-6.1.0/io_uring/timeout.c linux-oem-6.1-6.1.0/io_uring/timeout.c --- linux-oem-6.1-6.1.0/io_uring/timeout.c +++ linux-oem-6.1-6.1.0/io_uring/timeout.c @@ -63,7 +63,7 @@ atomic_set(&req->ctx->cq_timeouts, atomic_read(&req->ctx->cq_timeouts) + 1); list_del_init(&timeout->list); - io_req_tw_post_queue(req, status, 0); + io_req_queue_tw_complete(req, status); return true; } return false; @@ -161,7 +161,7 @@ req->flags &= ~REQ_F_ARM_LTIMEOUT; if (link && link->opcode == IORING_OP_LINK_TIMEOUT) { io_remove_next_linked(req); - io_req_tw_post_queue(link, -ECANCELED, 0); + io_req_queue_tw_complete(link, -ECANCELED); } } else if (req->flags & REQ_F_LINK_TIMEOUT) { struct io_ring_ctx *ctx = req->ctx; @@ -170,7 +170,7 @@ link = io_disarm_linked_timeout(req); spin_unlock_irq(&ctx->timeout_lock); if (link) - io_req_tw_post_queue(link, -ECANCELED, 0); + io_req_queue_tw_complete(link, -ECANCELED); } if (unlikely((req->flags & REQ_F_FAIL) && !(req->flags & REQ_F_HARDLINK))) @@ -284,11 +284,11 @@ ret = io_try_cancel(req->task->io_uring, &cd, issue_flags); } io_req_set_res(req, ret ?: -ETIME, 0); - io_req_complete_post(req); + io_req_task_complete(req, locked); io_put_req(prev); } else { io_req_set_res(req, -ETIME, 0); - io_req_complete_post(req); + io_req_task_complete(req, locked); } } diff -u linux-oem-6.1-6.1.0/kernel/bpf/btf.c linux-oem-6.1-6.1.0/kernel/bpf/btf.c --- linux-oem-6.1-6.1.0/kernel/bpf/btf.c +++ linux-oem-6.1-6.1.0/kernel/bpf/btf.c @@ -7607,9 +7607,9 @@ sort(tab->dtors, tab->cnt, sizeof(tab->dtors[0]), btf_id_cmp_func, NULL); - return 0; end: - btf_free_dtor_kfunc_tab(btf); + if (ret) + btf_free_dtor_kfunc_tab(btf); btf_put(btf); return ret; } diff -u linux-oem-6.1-6.1.0/kernel/bpf/core.c linux-oem-6.1-6.1.0/kernel/bpf/core.c --- linux-oem-6.1-6.1.0/kernel/bpf/core.c +++ linux-oem-6.1-6.1.0/kernel/bpf/core.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -1908,9 +1909,7 @@ * reuse preexisting logic from Spectre v1 mitigation that * happens to produce the required code on x86 for v4 as well. */ -#ifdef CONFIG_X86 barrier_nospec(); -#endif CONT; #define LDST(SIZEOP, SIZE) \ STX_MEM_##SIZEOP: \ diff -u linux-oem-6.1-6.1.0/kernel/bpf/syscall.c linux-oem-6.1-6.1.0/kernel/bpf/syscall.c --- linux-oem-6.1-6.1.0/kernel/bpf/syscall.c +++ linux-oem-6.1-6.1.0/kernel/bpf/syscall.c @@ -1958,7 +1958,7 @@ return; if (audit_enabled == AUDIT_OFF) return; - if (op == BPF_AUDIT_LOAD) + if (!in_irq() && !irqs_disabled()) ctx = audit_context(); ab = audit_log_start(ctx, GFP_ATOMIC, AUDIT_BPF); if (unlikely(!ab)) @@ -2053,6 +2053,7 @@ prog = aux->prog; perf_event_bpf_event(prog, PERF_BPF_EVENT_PROG_UNLOAD, 0); bpf_audit_prog(prog, BPF_AUDIT_UNLOAD); + bpf_prog_free_id(prog, true); __bpf_prog_put_noref(prog, true); } @@ -2061,9 +2062,6 @@ struct bpf_prog_aux *aux = prog->aux; if (atomic64_dec_and_test(&aux->refcnt)) { - /* bpf_prog_free_id() must be called first */ - bpf_prog_free_id(prog, do_idr_lock); - if (in_irq() || irqs_disabled()) { INIT_WORK(&aux->work, bpf_prog_put_deferred); schedule_work(&aux->work); diff -u linux-oem-6.1-6.1.0/kernel/bpf/verifier.c linux-oem-6.1-6.1.0/kernel/bpf/verifier.c --- linux-oem-6.1-6.1.0/kernel/bpf/verifier.c +++ linux-oem-6.1-6.1.0/kernel/bpf/verifier.c @@ -2664,6 +2664,12 @@ if (opcode == BPF_CALL) { if (insn->src_reg == BPF_PSEUDO_CALL) return -ENOTSUPP; + /* kfunc with imm==0 is invalid and fixup_kfunc_call will + * catch this error later. Make backtracking conservative + * with ENOTSUPP. + */ + if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL && insn->imm == 0) + return -ENOTSUPP; /* regular helper call sets R0 */ *reg_mask &= ~1; if (*reg_mask & 0x3f) { @@ -3011,13 +3017,24 @@ return reg->type != SCALAR_VALUE; } +/* Copy src state preserving dst->parent and dst->live fields */ +static void copy_register_state(struct bpf_reg_state *dst, const struct bpf_reg_state *src) +{ + struct bpf_reg_state *parent = dst->parent; + enum bpf_reg_liveness live = dst->live; + + *dst = *src; + dst->parent = parent; + dst->live = live; +} + static void save_register_state(struct bpf_func_state *state, int spi, struct bpf_reg_state *reg, int size) { int i; - state->stack[spi].spilled_ptr = *reg; + copy_register_state(&state->stack[spi].spilled_ptr, reg); if (size == BPF_REG_SIZE) state->stack[spi].spilled_ptr.live |= REG_LIVE_WRITTEN; @@ -3063,7 +3080,9 @@ bool sanitize = reg && is_spillable_regtype(reg->type); for (i = 0; i < size; i++) { - if (state->stack[spi].slot_type[i] == STACK_INVALID) { + u8 type = state->stack[spi].slot_type[i]; + + if (type != STACK_MISC && type != STACK_ZERO) { sanitize = true; break; } @@ -3343,7 +3362,7 @@ */ s32 subreg_def = state->regs[dst_regno].subreg_def; - state->regs[dst_regno] = *reg; + copy_register_state(&state->regs[dst_regno], reg); state->regs[dst_regno].subreg_def = subreg_def; } else { for (i = 0; i < size; i++) { @@ -3364,7 +3383,7 @@ if (dst_regno >= 0) { /* restore register state from stack */ - state->regs[dst_regno] = *reg; + copy_register_state(&state->regs[dst_regno], reg); /* mark reg as written since spilled pointer state likely * has its liveness marks cleared by is_state_visited() * which resets stack/reg liveness for state transitions @@ -8091,7 +8110,7 @@ */ if (!ptr_is_dst_reg) { tmp = *dst_reg; - *dst_reg = *ptr_reg; + copy_register_state(dst_reg, ptr_reg); } ret = sanitize_speculative_path(env, NULL, env->insn_idx + 1, env->insn_idx); @@ -9344,7 +9363,7 @@ * to propagate min/max range. */ src_reg->id = ++env->id_gen; - *dst_reg = *src_reg; + copy_register_state(dst_reg, src_reg); dst_reg->live |= REG_LIVE_WRITTEN; dst_reg->subreg_def = DEF_NOT_SUBREG; } else { @@ -9355,7 +9374,7 @@ insn->src_reg); return -EACCES; } else if (src_reg->type == SCALAR_VALUE) { - *dst_reg = *src_reg; + copy_register_state(dst_reg, src_reg); /* Make sure ID is cleared otherwise * dst_reg min/max could be incorrectly * propagated into src_reg by find_equal_scalars() @@ -10151,7 +10170,7 @@ bpf_for_each_reg_in_vstate(vstate, state, reg, ({ if (reg->type == SCALAR_VALUE && reg->id == known_reg->id) - *reg = *known_reg; + copy_register_state(reg, known_reg); })); } diff -u linux-oem-6.1-6.1.0/kernel/locking/rtmutex.c linux-oem-6.1-6.1.0/kernel/locking/rtmutex.c --- linux-oem-6.1-6.1.0/kernel/locking/rtmutex.c +++ linux-oem-6.1-6.1.0/kernel/locking/rtmutex.c @@ -901,8 +901,9 @@ * then we need to wake the new top waiter up to try * to get the lock. */ - if (prerequeue_top_waiter != rt_mutex_top_waiter(lock)) - wake_up_state(waiter->task, waiter->wake_state); + top_waiter = rt_mutex_top_waiter(lock); + if (prerequeue_top_waiter != top_waiter) + wake_up_state(top_waiter->task, top_waiter->wake_state); raw_spin_unlock_irq(&lock->wait_lock); return 0; } diff -u linux-oem-6.1-6.1.0/kernel/sched/core.c linux-oem-6.1-6.1.0/kernel/sched/core.c --- linux-oem-6.1-6.1.0/kernel/sched/core.c +++ linux-oem-6.1-6.1.0/kernel/sched/core.c @@ -2587,14 +2587,43 @@ int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node) { - if (!src->user_cpus_ptr) + cpumask_t *user_mask; + unsigned long flags; + + /* + * Always clear dst->user_cpus_ptr first as their user_cpus_ptr's + * may differ by now due to racing. + */ + dst->user_cpus_ptr = NULL; + + /* + * This check is racy and losing the race is a valid situation. + * It is not worth the extra overhead of taking the pi_lock on + * every fork/clone. + */ + if (data_race(!src->user_cpus_ptr)) return 0; - dst->user_cpus_ptr = kmalloc_node(cpumask_size(), GFP_KERNEL, node); - if (!dst->user_cpus_ptr) + user_mask = kmalloc_node(cpumask_size(), GFP_KERNEL, node); + if (!user_mask) return -ENOMEM; - cpumask_copy(dst->user_cpus_ptr, src->user_cpus_ptr); + /* + * Use pi_lock to protect content of user_cpus_ptr + * + * Though unlikely, user_cpus_ptr can be reset to NULL by a concurrent + * do_set_cpus_allowed(). + */ + raw_spin_lock_irqsave(&src->pi_lock, flags); + if (src->user_cpus_ptr) { + swap(dst->user_cpus_ptr, user_mask); + cpumask_copy(dst->user_cpus_ptr, src->user_cpus_ptr); + } + raw_spin_unlock_irqrestore(&src->pi_lock, flags); + + if (unlikely(user_mask)) + kfree(user_mask); + return 0; } @@ -5469,7 +5498,9 @@ unsigned long thermal_pressure; u64 resched_latency; - arch_scale_freq_tick(); + if (housekeeping_cpu(cpu, HK_TYPE_TICK)) + arch_scale_freq_tick(); + sched_clock_tick(); rq_lock(rq, &rf); @@ -5747,8 +5778,7 @@ pr_err("Preemption disabled at:"); print_ip_sym(KERN_ERR, preempt_disable_ip); } - if (panic_on_warn) - panic("scheduling while atomic\n"); + check_panic_on_warn("scheduling while atomic"); dump_stack(); add_taint(TAINT_WARN, LOCKDEP_STILL_OK); diff -u linux-oem-6.1-6.1.0/kernel/sched/fair.c linux-oem-6.1-6.1.0/kernel/sched/fair.c --- linux-oem-6.1-6.1.0/kernel/sched/fair.c +++ linux-oem-6.1-6.1.0/kernel/sched/fair.c @@ -7213,11 +7213,11 @@ eenv_task_busy_time(&eenv, p, prev_cpu); for (; pd; pd = pd->next) { + unsigned long util_min = p_util_min, util_max = p_util_max; unsigned long cpu_cap, cpu_thermal_cap, util; unsigned long cur_delta, max_spare_cap = 0; unsigned long rq_util_min, rq_util_max; - unsigned long util_min, util_max; - bool compute_prev_delta = false; + unsigned long prev_spare_cap = 0; int max_spare_cap_cpu = -1; unsigned long base_energy; @@ -7235,6 +7235,8 @@ eenv.pd_cap = 0; for_each_cpu(cpu, cpus) { + struct rq *rq = cpu_rq(cpu); + eenv.pd_cap += cpu_thermal_cap; if (!cpumask_test_cpu(cpu, sched_domain_span(sd))) @@ -7253,24 +7255,19 @@ * much capacity we can get out of the CPU; this is * aligned with sched_cpu_util(). */ - if (uclamp_is_used()) { - if (uclamp_rq_is_idle(cpu_rq(cpu))) { - util_min = p_util_min; - util_max = p_util_max; - } else { - /* - * Open code uclamp_rq_util_with() except for - * the clamp() part. Ie: apply max aggregation - * only. util_fits_cpu() logic requires to - * operate on non clamped util but must use the - * max-aggregated uclamp_{min, max}. - */ - rq_util_min = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MIN); - rq_util_max = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MAX); - - util_min = max(rq_util_min, p_util_min); - util_max = max(rq_util_max, p_util_max); - } + if (uclamp_is_used() && !uclamp_rq_is_idle(rq)) { + /* + * Open code uclamp_rq_util_with() except for + * the clamp() part. Ie: apply max aggregation + * only. util_fits_cpu() logic requires to + * operate on non clamped util but must use the + * max-aggregated uclamp_{min, max}. + */ + rq_util_min = uclamp_rq_get(rq, UCLAMP_MIN); + rq_util_max = uclamp_rq_get(rq, UCLAMP_MAX); + + util_min = max(rq_util_min, p_util_min); + util_max = max(rq_util_max, p_util_max); } if (!util_fits_cpu(util, util_min, util_max, cpu)) continue; @@ -7279,18 +7276,19 @@ if (cpu == prev_cpu) { /* Always use prev_cpu as a candidate. */ - compute_prev_delta = true; + prev_spare_cap = cpu_cap; } else if (cpu_cap > max_spare_cap) { /* * Find the CPU with the maximum spare capacity - * in the performance domain. + * among the remaining CPUs in the performance + * domain. */ max_spare_cap = cpu_cap; max_spare_cap_cpu = cpu; } } - if (max_spare_cap_cpu < 0 && !compute_prev_delta) + if (max_spare_cap_cpu < 0 && prev_spare_cap == 0) continue; eenv_pd_busy_time(&eenv, cpus, p); @@ -7298,7 +7296,7 @@ base_energy = compute_energy(&eenv, pd, cpus, p, -1); /* Evaluate the energy impact of using prev_cpu. */ - if (compute_prev_delta) { + if (prev_spare_cap > 0) { prev_delta = compute_energy(&eenv, pd, cpus, p, prev_cpu); /* CPU utilization has changed */ @@ -7309,7 +7307,7 @@ } /* Evaluate the energy impact of using max_spare_cap_cpu. */ - if (max_spare_cap_cpu >= 0) { + if (max_spare_cap_cpu >= 0 && max_spare_cap > prev_spare_cap) { cur_delta = compute_energy(&eenv, pd, cpus, p, max_spare_cap_cpu); /* CPU utilization has changed */ diff -u linux-oem-6.1-6.1.0/kernel/sched/psi.c linux-oem-6.1-6.1.0/kernel/sched/psi.c --- linux-oem-6.1-6.1.0/kernel/sched/psi.c +++ linux-oem-6.1-6.1.0/kernel/sched/psi.c @@ -189,6 +189,7 @@ INIT_DELAYED_WORK(&group->avgs_work, psi_avgs_work); mutex_init(&group->avgs_lock); /* Init trigger-related members */ + atomic_set(&group->poll_scheduled, 0); mutex_init(&group->trigger_lock); INIT_LIST_HEAD(&group->triggers); group->poll_min_period = U32_MAX; @@ -565,18 +566,17 @@ return now + group->poll_min_period; } -/* Schedule polling if it's not already scheduled. */ -static void psi_schedule_poll_work(struct psi_group *group, unsigned long delay) +/* Schedule polling if it's not already scheduled or forced. */ +static void psi_schedule_poll_work(struct psi_group *group, unsigned long delay, + bool force) { struct task_struct *task; /* - * Do not reschedule if already scheduled. - * Possible race with a timer scheduled after this check but before - * mod_timer below can be tolerated because group->polling_next_update - * will keep updates on schedule. + * atomic_xchg should be called even when !force to provide a + * full memory barrier (see the comment inside psi_poll_work). */ - if (timer_pending(&group->poll_timer)) + if (atomic_xchg(&group->poll_scheduled, 1) && !force) return; rcu_read_lock(); @@ -588,12 +588,15 @@ */ if (likely(task)) mod_timer(&group->poll_timer, jiffies + delay); + else + atomic_set(&group->poll_scheduled, 0); rcu_read_unlock(); } static void psi_poll_work(struct psi_group *group) { + bool force_reschedule = false; u32 changed_states; u64 now; @@ -601,6 +604,43 @@ now = sched_clock(); + if (now > group->polling_until) { + /* + * We are either about to start or might stop polling if no + * state change was recorded. Resetting poll_scheduled leaves + * a small window for psi_group_change to sneak in and schedule + * an immediate poll_work before we get to rescheduling. One + * potential extra wakeup at the end of the polling window + * should be negligible and polling_next_update still keeps + * updates correctly on schedule. + */ + atomic_set(&group->poll_scheduled, 0); + /* + * A task change can race with the poll worker that is supposed to + * report on it. To avoid missing events, ensure ordering between + * poll_scheduled and the task state accesses, such that if the poll + * worker misses the state update, the task change is guaranteed to + * reschedule the poll worker: + * + * poll worker: + * atomic_set(poll_scheduled, 0) + * smp_mb() + * LOAD states + * + * task change: + * STORE states + * if atomic_xchg(poll_scheduled, 1) == 0: + * schedule poll worker + * + * The atomic_xchg() implies a full barrier. + */ + smp_mb(); + } else { + /* Polling window is not over, keep rescheduling */ + force_reschedule = true; + } + + collect_percpu_times(group, PSI_POLL, &changed_states); if (changed_states & group->poll_states) { @@ -626,7 +666,8 @@ group->polling_next_update = update_triggers(group, now); psi_schedule_poll_work(group, - nsecs_to_jiffies(group->polling_next_update - now) + 1); + nsecs_to_jiffies(group->polling_next_update - now) + 1, + force_reschedule); out: mutex_unlock(&group->trigger_lock); @@ -787,7 +828,7 @@ write_seqcount_end(&groupc->seq); if (state_mask & group->poll_states) - psi_schedule_poll_work(group, 1); + psi_schedule_poll_work(group, 1, false); if (wake_clock && !delayed_work_pending(&group->avgs_work)) schedule_delayed_work(&group->avgs_work, PSI_FREQ); @@ -941,7 +982,7 @@ write_seqcount_end(&groupc->seq); if (group->poll_states & (1 << PSI_IRQ_FULL)) - psi_schedule_poll_work(group, 1); + psi_schedule_poll_work(group, 1, false); } while ((group = group->parent)); } #endif @@ -1278,10 +1319,11 @@ group = t->group; /* - * Wakeup waiters to stop polling. Can happen if cgroup is deleted - * from under a polling process. + * Wakeup waiters to stop polling and clear the queue to prevent it from + * being accessed later. Can happen if cgroup is deleted from under a + * polling process. */ - wake_up_interruptible(&t->event_wait); + wake_up_pollfree(&t->event_wait); mutex_lock(&group->trigger_lock); @@ -1327,6 +1369,7 @@ * can no longer be found through group->poll_task. */ kthread_stop(task_to_destroy); + atomic_set(&group->poll_scheduled, 0); } kfree(t); } diff -u linux-oem-6.1-6.1.0/kernel/sys.c linux-oem-6.1-6.1.0/kernel/sys.c --- linux-oem-6.1-6.1.0/kernel/sys.c +++ linux-oem-6.1-6.1.0/kernel/sys.c @@ -1457,6 +1457,8 @@ if (resource >= RLIM_NLIMITS) return -EINVAL; + resource = array_index_nospec(resource, RLIM_NLIMITS); + if (new_rlim) { if (new_rlim->rlim_cur > new_rlim->rlim_max) return -EINVAL; diff -u linux-oem-6.1-6.1.0/kernel/trace/trace.c linux-oem-6.1-6.1.0/kernel/trace/trace.c --- linux-oem-6.1-6.1.0/kernel/trace/trace.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace.c @@ -9144,9 +9144,6 @@ if (val > 100) return -EINVAL; - if (!val) - val = 1; - tr->buffer_percent = val; (*ppos)++; @@ -10291,6 +10288,8 @@ static_key_enable(&tracepoint_printk_key.key); } tracer_alloc_buffers(); + + init_events(); } void __init trace_init(void) diff -u linux-oem-6.1-6.1.0/kernel/trace/trace.h linux-oem-6.1-6.1.0/kernel/trace/trace.h --- linux-oem-6.1-6.1.0/kernel/trace/trace.h +++ linux-oem-6.1-6.1.0/kernel/trace/trace.h @@ -1282,6 +1282,7 @@ int offset; int size; int is_signed; + int len; }; struct prog_entry; @@ -1490,6 +1491,7 @@ extern void trace_event_enable_tgid_record(bool enable); extern int event_trace_init(void); +extern int init_events(void); extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr); extern int event_trace_del_tracer(struct trace_array *tr); extern void __trace_early_add_events(struct trace_array *tr); diff -u linux-oem-6.1-6.1.0/kernel/trace/trace_events_hist.c linux-oem-6.1-6.1.0/kernel/trace/trace_events_hist.c --- linux-oem-6.1-6.1.0/kernel/trace/trace_events_hist.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_events_hist.c @@ -1975,6 +1975,8 @@ hist_field->fn_num = flags & HIST_FIELD_FL_LOG2 ? HIST_FIELD_FN_LOG2 : HIST_FIELD_FN_BUCKET; hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); + if (!hist_field->operands[0]) + goto free; hist_field->size = hist_field->operands[0]->size; hist_field->type = kstrdup_const(hist_field->operands[0]->type, GFP_KERNEL); if (!hist_field->type) diff -u linux-oem-6.1-6.1.0/kernel/trace/trace_events_user.c linux-oem-6.1-6.1.0/kernel/trace/trace_events_user.c --- linux-oem-6.1-6.1.0/kernel/trace/trace_events_user.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_events_user.c @@ -1489,7 +1489,7 @@ if (unlikely(*ppos != 0)) return -EFAULT; - if (unlikely(import_single_range(WRITE, (char __user *)ubuf, + if (unlikely(import_single_range(ITER_SOURCE, (char __user *)ubuf, count, &iov, &i))) return -EFAULT; diff -u linux-oem-6.1-6.1.0/lib/maple_tree.c linux-oem-6.1-6.1.0/lib/maple_tree.c --- linux-oem-6.1-6.1.0/lib/maple_tree.c +++ linux-oem-6.1-6.1.0/lib/maple_tree.c @@ -665,12 +665,13 @@ unsigned char piv) { struct maple_node *node = mte_to_node(mn); + enum maple_type type = mte_node_type(mn); - if (piv >= mt_pivots[piv]) { + if (piv >= mt_pivots[type]) { WARN_ON(1); return 0; } - switch (mte_node_type(mn)) { + switch (type) { case maple_arange_64: return node->ma64.pivot[piv]; case maple_range_64: @@ -4882,7 +4883,7 @@ unsigned long *pivots, *gaps; void __rcu **slots; unsigned long gap = 0; - unsigned long max, min, index; + unsigned long max, min; unsigned char offset; if (unlikely(mas_is_err(mas))) @@ -4904,8 +4905,7 @@ min = mas_safe_min(mas, pivots, --offset); max = mas_safe_pivot(mas, pivots, offset, type); - index = mas->index; - while (index <= max) { + while (mas->index <= max) { gap = 0; if (gaps) gap = gaps[offset]; @@ -4936,10 +4936,8 @@ min = mas_safe_min(mas, pivots, offset); } - if (unlikely(index > max)) { - mas_set_err(mas, -EBUSY); - return false; - } + if (unlikely((mas->index > max) || (size - 1 > max - mas->index))) + goto no_space; if (unlikely(ma_is_leaf(type))) { mas->offset = offset; @@ -4956,9 +4954,11 @@ return false; ascend: - if (mte_is_root(mas->node)) - mas_set_err(mas, -EBUSY); + if (!mte_is_root(mas->node)) + return false; +no_space: + mas_set_err(mas, -EBUSY); return false; } diff -u linux-oem-6.1-6.1.0/lib/test_maple_tree.c linux-oem-6.1-6.1.0/lib/test_maple_tree.c --- linux-oem-6.1-6.1.0/lib/test_maple_tree.c +++ linux-oem-6.1-6.1.0/lib/test_maple_tree.c @@ -2517,6 +2517,91 @@ mt_set_non_kernel(0); } +static noinline void check_empty_area_window(struct maple_tree *mt) +{ + unsigned long i, nr_entries = 20; + MA_STATE(mas, mt, 0, 0); + + for (i = 1; i <= nr_entries; i++) + mtree_store_range(mt, i*10, i*10 + 9, + xa_mk_value(i), GFP_KERNEL); + + /* Create another hole besides the one at 0 */ + mtree_store_range(mt, 160, 169, NULL, GFP_KERNEL); + + /* Check lower bounds that don't fit */ + rcu_read_lock(); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 5, 90, 10) != -EBUSY); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 6, 90, 5) != -EBUSY); + + /* Check lower bound that does fit */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 5, 90, 5) != 0); + MT_BUG_ON(mt, mas.index != 5); + MT_BUG_ON(mt, mas.last != 9); + rcu_read_unlock(); + + /* Check one gap that doesn't fit and one that does */ + rcu_read_lock(); + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 5, 217, 9) != 0); + MT_BUG_ON(mt, mas.index != 161); + MT_BUG_ON(mt, mas.last != 169); + + /* Check one gap that does fit above the min */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 100, 218, 3) != 0); + MT_BUG_ON(mt, mas.index != 216); + MT_BUG_ON(mt, mas.last != 218); + + /* Check size that doesn't fit any gap */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 100, 218, 16) != -EBUSY); + + /* + * Check size that doesn't fit the lower end of the window but + * does fit the gap + */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 167, 200, 4) != -EBUSY); + + /* + * Check size that doesn't fit the upper end of the window but + * does fit the gap + */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area_rev(&mas, 100, 162, 4) != -EBUSY); + + /* Check mas_empty_area forward */ + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 0, 100, 9) != 0); + MT_BUG_ON(mt, mas.index != 0); + MT_BUG_ON(mt, mas.last != 8); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 0, 100, 4) != 0); + MT_BUG_ON(mt, mas.index != 0); + MT_BUG_ON(mt, mas.last != 3); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 0, 100, 11) != -EBUSY); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 5, 100, 6) != -EBUSY); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 0, 8, 10) != -EBUSY); + + mas_reset(&mas); + mas_empty_area(&mas, 100, 165, 3); + + mas_reset(&mas); + MT_BUG_ON(mt, mas_empty_area(&mas, 100, 163, 6) != -EBUSY); + rcu_read_unlock(); +} + static DEFINE_MTREE(tree); static int maple_tree_seed(void) { @@ -2765,6 +2850,10 @@ check_bnode_min_spanning(&tree); mtree_destroy(&tree); + mt_init_flags(&tree, MT_FLAGS_ALLOC_RANGE); + check_empty_area_window(&tree); + mtree_destroy(&tree); + #if defined(BENCH) skip: #endif diff -u linux-oem-6.1-6.1.0/mm/compaction.c linux-oem-6.1-6.1.0/mm/compaction.c --- linux-oem-6.1-6.1.0/mm/compaction.c +++ linux-oem-6.1-6.1.0/mm/compaction.c @@ -1839,6 +1839,7 @@ pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; + set_pageblock_skip(freepage); break; } } diff -u linux-oem-6.1-6.1.0/mm/filemap.c linux-oem-6.1-6.1.0/mm/filemap.c --- linux-oem-6.1-6.1.0/mm/filemap.c +++ linux-oem-6.1-6.1.0/mm/filemap.c @@ -2569,18 +2569,19 @@ struct folio *folio; int err = 0; + /* "last_index" is the index of the page beyond the end of the read */ last_index = DIV_ROUND_UP(iocb->ki_pos + iter->count, PAGE_SIZE); retry: if (fatal_signal_pending(current)) return -EINTR; - filemap_get_read_batch(mapping, index, last_index, fbatch); + filemap_get_read_batch(mapping, index, last_index - 1, fbatch); if (!folio_batch_count(fbatch)) { if (iocb->ki_flags & IOCB_NOIO) return -EAGAIN; page_cache_sync_readahead(mapping, ra, filp, index, last_index - index); - filemap_get_read_batch(mapping, index, last_index, fbatch); + filemap_get_read_batch(mapping, index, last_index - 1, fbatch); } if (!folio_batch_count(fbatch)) { if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_WAITQ)) diff -u linux-oem-6.1-6.1.0/mm/gup.c linux-oem-6.1-6.1.0/mm/gup.c --- linux-oem-6.1-6.1.0/mm/gup.c +++ linux-oem-6.1-6.1.0/mm/gup.c @@ -1978,7 +1978,7 @@ drain_allow = false; } - if (!folio_isolate_lru(folio)) + if (folio_isolate_lru(folio)) continue; list_add_tail(&folio->lru, movable_page_list); diff -u linux-oem-6.1-6.1.0/mm/hugetlb.c linux-oem-6.1-6.1.0/mm/hugetlb.c --- linux-oem-6.1-6.1.0/mm/hugetlb.c +++ linux-oem-6.1-6.1.0/mm/hugetlb.c @@ -94,6 +94,8 @@ static void hugetlb_vma_lock_free(struct vm_area_struct *vma); static void hugetlb_vma_lock_alloc(struct vm_area_struct *vma); static void __hugetlb_vma_unlock_write_free(struct vm_area_struct *vma); +static void hugetlb_unshare_pmds(struct vm_area_struct *vma, + unsigned long start, unsigned long end); static inline bool subpool_is_free(struct hugepage_subpool *spool) { @@ -4825,6 +4827,25 @@ { if (addr & ~(huge_page_mask(hstate_vma(vma)))) return -EINVAL; + + /* + * PMD sharing is only possible for PUD_SIZE-aligned address ranges + * in HugeTLB VMAs. If we will lose PUD_SIZE alignment due to this + * split, unshare PMDs in the PUD_SIZE interval surrounding addr now. + */ + if (addr & ~PUD_MASK) { + /* + * hugetlb_vm_op_split is called right before we attempt to + * split the VMA. We will need to unshare PMDs in the old and + * new VMAs, so let's unshare before we split. + */ + unsigned long floor = addr & PUD_MASK; + unsigned long ceil = floor + PUD_SIZE; + + if (floor >= vma->vm_start && ceil <= vma->vm_end) + hugetlb_unshare_pmds(vma, floor, ceil); + } + return 0; } @@ -6583,8 +6604,17 @@ spinlock_t *ptl; ptep = huge_pte_offset(mm, address, psize); if (!ptep) { - address |= last_addr_mask; - continue; + if (!uffd_wp) { + address |= last_addr_mask; + continue; + } + /* + * Userfaultfd wr-protect requires pgtable + * pre-allocations to install pte markers. + */ + ptep = huge_pte_alloc(mm, vma, address, psize); + if (!ptep) + break; } ptl = huge_pte_lock(h, mm, ptep); if (huge_pmd_unshare(mm, vma, address, ptep)) { @@ -6602,16 +6632,13 @@ } pte = huge_ptep_get(ptep); if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) { - spin_unlock(ptl); - continue; - } - if (unlikely(is_hugetlb_entry_migration(pte))) { + /* Nothing to do. */ + } else if (unlikely(is_hugetlb_entry_migration(pte))) { swp_entry_t entry = pte_to_swp_entry(pte); struct page *page = pfn_swap_entry_to_page(entry); + pte_t newpte = pte; - if (!is_readable_migration_entry(entry)) { - pte_t newpte; - + if (is_writable_migration_entry(entry)) { if (PageAnon(page)) entry = make_readable_exclusive_migration_entry( swp_offset(entry)); @@ -6619,25 +6646,22 @@ entry = make_readable_migration_entry( swp_offset(entry)); newpte = swp_entry_to_pte(entry); - if (uffd_wp) - newpte = pte_swp_mkuffd_wp(newpte); - else if (uffd_wp_resolve) - newpte = pte_swp_clear_uffd_wp(newpte); - set_huge_pte_at(mm, address, ptep, newpte); pages++; } - spin_unlock(ptl); - continue; - } - if (unlikely(pte_marker_uffd_wp(pte))) { - /* - * This is changing a non-present pte into a none pte, - * no need for huge_ptep_modify_prot_start/commit(). - */ + + if (uffd_wp) + newpte = pte_swp_mkuffd_wp(newpte); + else if (uffd_wp_resolve) + newpte = pte_swp_clear_uffd_wp(newpte); + if (!pte_same(pte, newpte)) + set_huge_pte_at(mm, address, ptep, newpte); + } else if (unlikely(is_pte_marker(pte))) { + /* No other markers apply for now. */ + WARN_ON_ONCE(!pte_marker_uffd_wp(pte)); if (uffd_wp_resolve) + /* Safe to modify directly (non-present->none). */ huge_pte_clear(mm, address, ptep, psize); - } - if (!huge_pte_none(pte)) { + } else if (!huge_pte_none(pte)) { pte_t old_pte; unsigned int shift = huge_page_shift(hstate_vma(vma)); @@ -7386,26 +7410,21 @@ } } -/* - * This function will unconditionally remove all the shared pmd pgtable entries - * within the specific vma for a hugetlbfs memory range. - */ -void hugetlb_unshare_all_pmds(struct vm_area_struct *vma) +static void hugetlb_unshare_pmds(struct vm_area_struct *vma, + unsigned long start, + unsigned long end) { struct hstate *h = hstate_vma(vma); unsigned long sz = huge_page_size(h); struct mm_struct *mm = vma->vm_mm; struct mmu_notifier_range range; - unsigned long address, start, end; + unsigned long address; spinlock_t *ptl; pte_t *ptep; if (!(vma->vm_flags & VM_MAYSHARE)) return; - start = ALIGN(vma->vm_start, PUD_SIZE); - end = ALIGN_DOWN(vma->vm_end, PUD_SIZE); - if (start >= end) return; @@ -7437,6 +7456,16 @@ mmu_notifier_invalidate_range_end(&range); } +/* + * This function will unconditionally remove all the shared pmd pgtable entries + * within the specific vma for a hugetlbfs memory range. + */ +void hugetlb_unshare_all_pmds(struct vm_area_struct *vma) +{ + hugetlb_unshare_pmds(vma, ALIGN(vma->vm_start, PUD_SIZE), + ALIGN_DOWN(vma->vm_end, PUD_SIZE)); +} + #ifdef CONFIG_CMA static bool cma_reserve_called __initdata; diff -u linux-oem-6.1-6.1.0/mm/memory.c linux-oem-6.1-6.1.0/mm/memory.c --- linux-oem-6.1-6.1.0/mm/memory.c +++ linux-oem-6.1-6.1.0/mm/memory.c @@ -875,12 +875,8 @@ return -EBUSY; return -ENOENT; } else if (is_pte_marker_entry(entry)) { - /* - * We're copying the pgtable should only because dst_vma has - * uffd-wp enabled, do sanity check. - */ - WARN_ON_ONCE(!userfaultfd_wp(dst_vma)); - set_pte_at(dst_mm, addr, dst_pte, pte); + if (userfaultfd_wp(dst_vma)) + set_pte_at(dst_mm, addr, dst_pte, pte); return 0; } if (!userfaultfd_wp(dst_vma)) diff -u linux-oem-6.1-6.1.0/mm/mempolicy.c linux-oem-6.1-6.1.0/mm/mempolicy.c --- linux-oem-6.1-6.1.0/mm/mempolicy.c +++ linux-oem-6.1-6.1.0/mm/mempolicy.c @@ -600,7 +600,8 @@ /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || - (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) { + (flags & MPOL_MF_MOVE && page_mapcount(page) == 1 && + !hugetlb_pmd_shared(pte))) { if (isolate_hugetlb(page, qp->pagelist) && (flags & MPOL_MF_STRICT)) /* diff -u linux-oem-6.1-6.1.0/mm/mmap.c linux-oem-6.1-6.1.0/mm/mmap.c --- linux-oem-6.1-6.1.0/mm/mmap.c +++ linux-oem-6.1-6.1.0/mm/mmap.c @@ -1524,6 +1524,10 @@ if (vma_soft_dirty_enabled(vma) && !is_vm_hugetlb_page(vma)) return 1; + /* Do we need write faults for uffd-wp tracking? */ + if (userfaultfd_wp(vma)) + return 1; + /* Specialty mapping? */ if (vm_flags & VM_PFNMAP) return 0; diff -u linux-oem-6.1-6.1.0/mm/mremap.c linux-oem-6.1-6.1.0/mm/mremap.c --- linux-oem-6.1-6.1.0/mm/mremap.c +++ linux-oem-6.1-6.1.0/mm/mremap.c @@ -1027,16 +1027,29 @@ } /* - * Function vma_merge() is called on the extension we are adding to - * the already existing vma, vma_merge() will merge this extension with - * the already existing vma (expand operation itself) and possibly also - * with the next vma if it becomes adjacent to the expanded vma and - * otherwise compatible. + * Function vma_merge() is called on the extension we + * are adding to the already existing vma, vma_merge() + * will merge this extension with the already existing + * vma (expand operation itself) and possibly also with + * the next vma if it becomes adjacent to the expanded + * vma and otherwise compatible. + * + * However, vma_merge() can currently fail due to + * is_mergeable_vma() check for vm_ops->close (see the + * comment there). Yet this should not prevent vma + * expanding, so perform a simple expand for such vma. + * Ideally the check for close op should be only done + * when a vma would be actually removed due to a merge. */ - vma = vma_merge(mm, vma, extension_start, extension_end, + if (!vma->vm_ops || !vma->vm_ops->close) { + vma = vma_merge(mm, vma, extension_start, extension_end, vma->vm_flags, vma->anon_vma, vma->vm_file, extension_pgoff, vma_policy(vma), vma->vm_userfaultfd_ctx, anon_vma_name(vma)); + } else if (vma_adjust(vma, vma->vm_start, addr + new_len, + vma->vm_pgoff, NULL)) { + vma = NULL; + } if (!vma) { vm_unacct_memory(pages); ret = -ENOMEM; diff -u linux-oem-6.1-6.1.0/mm/nommu.c linux-oem-6.1-6.1.0/mm/nommu.c --- linux-oem-6.1-6.1.0/mm/nommu.c +++ linux-oem-6.1-6.1.0/mm/nommu.c @@ -559,7 +559,6 @@ static void setup_vma_to_mm(struct vm_area_struct *vma, struct mm_struct *mm) { - mm->map_count++; vma->vm_mm = mm; /* add the VMA to the mapping */ @@ -587,6 +586,7 @@ BUG_ON(!vma->vm_region); setup_vma_to_mm(vma, mm); + mm->map_count++; /* add the VMA to the tree */ vma_mas_store(vma, mas); @@ -1240,6 +1240,7 @@ error_just_free: up_write(&nommu_region_sem); error: + mas_destroy(&mas); if (region->vm_file) vmr_fput(region); kmem_cache_free(vm_region_jar, region); @@ -1250,7 +1251,6 @@ sharing_violation: up_write(&nommu_region_sem); - mas_destroy(&mas); pr_warn("Attempt to share mismatched mappings\n"); ret = -EINVAL; goto error; @@ -1347,6 +1347,7 @@ if (vma->vm_file) return -ENOMEM; + mm = vma->vm_mm; if (mm->map_count >= sysctl_max_map_count) return -ENOMEM; @@ -1398,6 +1399,7 @@ mas_set_range(&mas, vma->vm_start, vma->vm_end - 1); mas_store(&mas, vma); vma_mas_store(new, &mas); + mm->map_count++; return 0; err_mas_preallocate: @@ -1509,7 +1511,8 @@ erase_whole_vma: if (delete_vma_from_mm(vma)) ret = -ENOMEM; - delete_vma(mm, vma); + else + delete_vma(mm, vma); return ret; } diff -u linux-oem-6.1-6.1.0/net/9p/client.c linux-oem-6.1-6.1.0/net/9p/client.c --- linux-oem-6.1-6.1.0/net/9p/client.c +++ linux-oem-6.1-6.1.0/net/9p/client.c @@ -2049,7 +2049,7 @@ struct kvec kv = {.iov_base = data, .iov_len = count}; struct iov_iter to; - iov_iter_kvec(&to, READ, &kv, 1, count); + iov_iter_kvec(&to, ITER_DEST, &kv, 1, count); p9_debug(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %d\n", fid->fid, offset, count); diff -u linux-oem-6.1-6.1.0/net/bluetooth/hci_conn.c linux-oem-6.1-6.1.0/net/bluetooth/hci_conn.c --- linux-oem-6.1-6.1.0/net/bluetooth/hci_conn.c +++ linux-oem-6.1-6.1.0/net/bluetooth/hci_conn.c @@ -821,6 +821,7 @@ static int hci_le_terminate_big(struct hci_dev *hdev, u8 big, u8 bis) { struct iso_list_data *d; + int ret; bt_dev_dbg(hdev, "big 0x%2.2x bis 0x%2.2x", big, bis); @@ -832,8 +833,12 @@ d->big = big; d->bis = bis; - return hci_cmd_sync_queue(hdev, terminate_big_sync, d, - terminate_big_destroy); + ret = hci_cmd_sync_queue(hdev, terminate_big_sync, d, + terminate_big_destroy); + if (ret) + kfree(d); + + return ret; } static int big_terminate_sync(struct hci_dev *hdev, void *data) @@ -858,6 +863,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, u16 sync_handle) { struct iso_list_data *d; + int ret; bt_dev_dbg(hdev, "big 0x%2.2x sync_handle 0x%4.4x", big, sync_handle); @@ -869,8 +875,12 @@ d->big = big; d->sync_handle = sync_handle; - return hci_cmd_sync_queue(hdev, big_terminate_sync, d, - terminate_big_destroy); + ret = hci_cmd_sync_queue(hdev, big_terminate_sync, d, + terminate_big_destroy); + if (ret) + kfree(d); + + return ret; } /* Cleanup BIS connection diff -u linux-oem-6.1-6.1.0/net/bluetooth/hci_sync.c linux-oem-6.1-6.1.0/net/bluetooth/hci_sync.c --- linux-oem-6.1-6.1.0/net/bluetooth/hci_sync.c +++ linux-oem-6.1-6.1.0/net/bluetooth/hci_sync.c @@ -3554,7 +3554,7 @@ static int hci_le_read_buffer_size_sync(struct hci_dev *hdev) { /* Use Read LE Buffer Size V2 if supported */ - if (hdev->commands[41] & 0x20) + if (iso_capable(hdev) && hdev->commands[41] & 0x20) return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_BUFFER_SIZE_V2, 0, NULL, HCI_CMD_TIMEOUT); @@ -3579,10 +3579,10 @@ /* LE Controller init stage 2 command sequence */ static const struct hci_init_stage le_init2[] = { - /* HCI_OP_LE_READ_BUFFER_SIZE */ - HCI_INIT(hci_le_read_buffer_size_sync), /* HCI_OP_LE_READ_LOCAL_FEATURES */ HCI_INIT(hci_le_read_local_features_sync), + /* HCI_OP_LE_READ_BUFFER_SIZE */ + HCI_INIT(hci_le_read_buffer_size_sync), /* HCI_OP_LE_READ_SUPPORTED_STATES */ HCI_INIT(hci_le_read_supported_states_sync), {} @@ -4703,6 +4703,7 @@ hdev->flush(hdev); if (hdev->sent_cmd) { + cancel_delayed_work_sync(&hdev->cmd_timer); kfree_skb(hdev->sent_cmd); hdev->sent_cmd = NULL; } @@ -6170,18 +6171,11 @@ { - u8 instance = *(u8 *)data; - - kfree(data); + u8 instance = PTR_ERR(data); return hci_update_adv_data_sync(hdev, instance); } int hci_update_adv_data(struct hci_dev *hdev, u8 instance) { - u8 *inst_ptr = kmalloc(1, GFP_KERNEL); - - if (!inst_ptr) - return -ENOMEM; - - *inst_ptr = instance; - return hci_cmd_sync_queue(hdev, _update_adv_data_sync, inst_ptr, NULL); + return hci_cmd_sync_queue(hdev, _update_adv_data_sync, + ERR_PTR(instance), NULL); } diff -u linux-oem-6.1-6.1.0/net/core/dev.c linux-oem-6.1-6.1.0/net/core/dev.c --- linux-oem-6.1-6.1.0/net/core/dev.c +++ linux-oem-6.1-6.1.0/net/core/dev.c @@ -10385,7 +10385,7 @@ BUILD_BUG_ON(n > sizeof(*stats64) / sizeof(u64)); for (i = 0; i < n; i++) - dst[i] = atomic_long_read(&src[i]); + dst[i] = (unsigned long)atomic_long_read(&src[i]); /* zero out counters that only exist in rtnl_link_stats64 */ memset((char *)stats64 + n * sizeof(u64), 0, sizeof(*stats64) - n * sizeof(u64)); diff -u linux-oem-6.1-6.1.0/net/core/skbuff.c linux-oem-6.1-6.1.0/net/core/skbuff.c --- linux-oem-6.1-6.1.0/net/core/skbuff.c +++ linux-oem-6.1-6.1.0/net/core/skbuff.c @@ -4034,7 +4034,7 @@ skb_shinfo(skb)->frag_list = NULL; - do { + while (list_skb) { nskb = list_skb; list_skb = list_skb->next; @@ -4080,8 +4080,7 @@ if (skb_needs_linearize(nskb, features) && __skb_linearize(nskb)) goto err_linearize; - - } while (list_skb); + } skb->truesize = skb->truesize - delta_truesize; skb->data_len = skb->data_len - delta_len; diff -u linux-oem-6.1-6.1.0/net/core/sock.c linux-oem-6.1-6.1.0/net/core/sock.c --- linux-oem-6.1-6.1.0/net/core/sock.c +++ linux-oem-6.1-6.1.0/net/core/sock.c @@ -1524,6 +1524,8 @@ ret = -EINVAL; break; } + if ((u8)val == SOCK_TXREHASH_DEFAULT) + val = READ_ONCE(sock_net(sk)->core.sysctl_txrehash); /* Paired with READ_ONCE() in tcp_rtx_synack() */ WRITE_ONCE(sk->sk_txrehash, (u8)val); break; @@ -3428,7 +3430,6 @@ sk->sk_pacing_rate = ~0UL; WRITE_ONCE(sk->sk_pacing_shift, 10); sk->sk_incoming_cpu = -1; - sk->sk_txrehash = SOCK_TXREHASH_DEFAULT; sk_rx_queue_clear(sk); /* diff -u linux-oem-6.1-6.1.0/net/core/sock_map.c linux-oem-6.1-6.1.0/net/core/sock_map.c --- linux-oem-6.1-6.1.0/net/core/sock_map.c +++ linux-oem-6.1-6.1.0/net/core/sock_map.c @@ -1569,15 +1569,16 @@ psock = sk_psock(sk); if (unlikely(!psock)) { rcu_read_unlock(); - if (sk->sk_prot->unhash) - sk->sk_prot->unhash(sk); - return; + saved_unhash = READ_ONCE(sk->sk_prot)->unhash; + } else { + saved_unhash = psock->saved_unhash; + sock_map_remove_links(sk, psock); + rcu_read_unlock(); } - - saved_unhash = psock->saved_unhash; - sock_map_remove_links(sk, psock); - rcu_read_unlock(); - saved_unhash(sk); + if (WARN_ON_ONCE(saved_unhash == sock_map_unhash)) + return; + if (saved_unhash) + saved_unhash(sk); } EXPORT_SYMBOL_GPL(sock_map_unhash); @@ -1590,17 +1591,18 @@ psock = sk_psock_get(sk); if (unlikely(!psock)) { rcu_read_unlock(); - if (sk->sk_prot->destroy) - sk->sk_prot->destroy(sk); - return; + saved_destroy = READ_ONCE(sk->sk_prot)->destroy; + } else { + saved_destroy = psock->saved_destroy; + sock_map_remove_links(sk, psock); + rcu_read_unlock(); + sk_psock_stop(psock); + sk_psock_put(sk, psock); } - - saved_destroy = psock->saved_destroy; - sock_map_remove_links(sk, psock); - rcu_read_unlock(); - sk_psock_stop(psock); - sk_psock_put(sk, psock); - saved_destroy(sk); + if (WARN_ON_ONCE(saved_destroy == sock_map_destroy)) + return; + if (saved_destroy) + saved_destroy(sk); } EXPORT_SYMBOL_GPL(sock_map_destroy); @@ -1615,16 +1617,21 @@ if (unlikely(!psock)) { rcu_read_unlock(); release_sock(sk); - return sk->sk_prot->close(sk, timeout); + saved_close = READ_ONCE(sk->sk_prot)->close; + } else { + saved_close = psock->saved_close; + sock_map_remove_links(sk, psock); + rcu_read_unlock(); + sk_psock_stop(psock); + release_sock(sk); + cancel_work_sync(&psock->work); + sk_psock_put(sk, psock); } - - saved_close = psock->saved_close; - sock_map_remove_links(sk, psock); - rcu_read_unlock(); - sk_psock_stop(psock); - release_sock(sk); - cancel_work_sync(&psock->work); - sk_psock_put(sk, psock); + /* Make sure we do not recurse. This is a bug. + * Leak the socket instead of crashing on a stack overflow. + */ + if (WARN_ON_ONCE(saved_close == sock_map_close)) + return; saved_close(sk, timeout); } EXPORT_SYMBOL_GPL(sock_map_close); diff -u linux-oem-6.1-6.1.0/net/ethtool/ioctl.c linux-oem-6.1-6.1.0/net/ethtool/ioctl.c --- linux-oem-6.1-6.1.0/net/ethtool/ioctl.c +++ linux-oem-6.1-6.1.0/net/ethtool/ioctl.c @@ -2094,7 +2094,8 @@ return n_stats; if (n_stats > S32_MAX / sizeof(u64)) return -ENOMEM; - WARN_ON_ONCE(!n_stats); + if (WARN_ON_ONCE(!n_stats)) + return -EOPNOTSUPP; if (copy_from_user(&stats, useraddr, sizeof(stats))) return -EFAULT; diff -u linux-oem-6.1-6.1.0/net/ipv4/af_inet.c linux-oem-6.1-6.1.0/net/ipv4/af_inet.c --- linux-oem-6.1-6.1.0/net/ipv4/af_inet.c +++ linux-oem-6.1-6.1.0/net/ipv4/af_inet.c @@ -347,6 +347,7 @@ sk->sk_destruct = inet_sock_destruct; sk->sk_protocol = protocol; sk->sk_backlog_rcv = sk->sk_prot->backlog_rcv; + sk->sk_txrehash = READ_ONCE(net->core.sysctl_txrehash); inet->uc_ttl = -1; inet->mc_loop = 1; diff -u linux-oem-6.1-6.1.0/net/ipv4/inet_connection_sock.c linux-oem-6.1-6.1.0/net/ipv4/inet_connection_sock.c --- linux-oem-6.1-6.1.0/net/ipv4/inet_connection_sock.c +++ linux-oem-6.1-6.1.0/net/ipv4/inet_connection_sock.c @@ -1225,9 +1225,6 @@ sk->sk_ack_backlog = 0; inet_csk_delack_init(sk); - if (sk->sk_txrehash == SOCK_TXREHASH_DEFAULT) - sk->sk_txrehash = READ_ONCE(sock_net(sk)->core.sysctl_txrehash); - /* There is race window here: we announce ourselves listening, * but this transition is still not validated by get_port(). * It is OK, because this socket enters to hash table only diff -u linux-oem-6.1-6.1.0/net/ipv4/inet_hashtables.c linux-oem-6.1-6.1.0/net/ipv4/inet_hashtables.c --- linux-oem-6.1-6.1.0/net/ipv4/inet_hashtables.c +++ linux-oem-6.1-6.1.0/net/ipv4/inet_hashtables.c @@ -650,8 +650,20 @@ spin_lock(lock); if (osk) { WARN_ON_ONCE(sk->sk_hash != osk->sk_hash); - ret = sk_nulls_del_node_init_rcu(osk); - } else if (found_dup_sk) { + ret = sk_hashed(osk); + if (ret) { + /* Before deleting the node, we insert a new one to make + * sure that the look-up-sk process would not miss either + * of them and that at least one node would exist in ehash + * table all the time. Otherwise there's a tiny chance + * that lookup process could find nothing in ehash table. + */ + __sk_nulls_add_node_tail_rcu(sk, list); + sk_nulls_del_node_init_rcu(osk); + } + goto unlock; + } + if (found_dup_sk) { *found_dup_sk = inet_ehash_lookup_by_sk(sk, list); if (*found_dup_sk) ret = false; @@ -660,6 +672,7 @@ if (ret) __sk_nulls_add_node_rcu(sk, list); +unlock: spin_unlock(lock); return ret; diff -u linux-oem-6.1-6.1.0/net/ipv4/inet_timewait_sock.c linux-oem-6.1-6.1.0/net/ipv4/inet_timewait_sock.c --- linux-oem-6.1-6.1.0/net/ipv4/inet_timewait_sock.c +++ linux-oem-6.1-6.1.0/net/ipv4/inet_timewait_sock.c @@ -91,10 +91,10 @@ } EXPORT_SYMBOL_GPL(inet_twsk_put); -static void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw, - struct hlist_nulls_head *list) +static void inet_twsk_add_node_tail_rcu(struct inet_timewait_sock *tw, + struct hlist_nulls_head *list) { - hlist_nulls_add_head_rcu(&tw->tw_node, list); + hlist_nulls_add_tail_rcu(&tw->tw_node, list); } static void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, @@ -147,7 +147,7 @@ spin_lock(lock); - inet_twsk_add_node_rcu(tw, &ehead->chain); + inet_twsk_add_node_tail_rcu(tw, &ehead->chain); /* Step 3: Remove SK from hash chain */ if (__sk_nulls_del_node_init_rcu(sk)) diff -u linux-oem-6.1-6.1.0/net/ipv4/tcp_bpf.c linux-oem-6.1-6.1.0/net/ipv4/tcp_bpf.c --- linux-oem-6.1-6.1.0/net/ipv4/tcp_bpf.c +++ linux-oem-6.1-6.1.0/net/ipv4/tcp_bpf.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -639,10 +640,9 @@ */ void tcp_bpf_clone(const struct sock *sk, struct sock *newsk) { - int family = sk->sk_family == AF_INET6 ? TCP_BPF_IPV6 : TCP_BPF_IPV4; struct proto *prot = newsk->sk_prot; - if (prot == &tcp_bpf_prots[family][TCP_BPF_BASE]) + if (is_insidevar(prot, tcp_bpf_prots)) newsk->sk_prot = sk->sk_prot_creator; } #endif /* CONFIG_BPF_SYSCALL */ diff -u linux-oem-6.1-6.1.0/net/ipv4/tcp_ulp.c linux-oem-6.1-6.1.0/net/ipv4/tcp_ulp.c --- linux-oem-6.1-6.1.0/net/ipv4/tcp_ulp.c +++ linux-oem-6.1-6.1.0/net/ipv4/tcp_ulp.c @@ -139,7 +139,7 @@ if (sk->sk_socket) clear_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags); - err = -EINVAL; + err = -ENOTCONN; if (!ulp_ops->clone && sk->sk_state == TCP_LISTEN) goto out_err; diff -u linux-oem-6.1-6.1.0/net/ipv6/af_inet6.c linux-oem-6.1-6.1.0/net/ipv6/af_inet6.c --- linux-oem-6.1-6.1.0/net/ipv6/af_inet6.c +++ linux-oem-6.1-6.1.0/net/ipv6/af_inet6.c @@ -221,6 +221,7 @@ np->pmtudisc = IPV6_PMTUDISC_WANT; np->repflow = net->ipv6.sysctl.flowlabel_reflect & FLOWLABEL_REFLECT_ESTABLISHED; sk->sk_ipv6only = net->ipv6.sysctl.bindv6only; + sk->sk_txrehash = READ_ONCE(net->core.sysctl_txrehash); /* Init the ipv4 part of the socket since we can have sockets * using v6 API for ipv4. diff -u linux-oem-6.1-6.1.0/net/ipv6/datagram.c linux-oem-6.1-6.1.0/net/ipv6/datagram.c --- linux-oem-6.1-6.1.0/net/ipv6/datagram.c +++ linux-oem-6.1-6.1.0/net/ipv6/datagram.c @@ -51,7 +51,7 @@ fl6->flowi6_mark = sk->sk_mark; fl6->fl6_dport = inet->inet_dport; fl6->fl6_sport = inet->inet_sport; - fl6->flowlabel = np->flow_label; + fl6->flowlabel = ip6_make_flowinfo(np->tclass, np->flow_label); fl6->flowi6_uid = sk->sk_uid; if (!oif) diff -u linux-oem-6.1-6.1.0/net/ipv6/ip6_output.c linux-oem-6.1-6.1.0/net/ipv6/ip6_output.c --- linux-oem-6.1-6.1.0/net/ipv6/ip6_output.c +++ linux-oem-6.1-6.1.0/net/ipv6/ip6_output.c @@ -550,7 +550,20 @@ pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) { int proxied = ip6_forward_proxy_check(skb); if (proxied > 0) { - hdr->hop_limit--; + /* It's tempting to decrease the hop limit + * here by 1, as we do at the end of the + * function too. + * + * But that would be incorrect, as proxying is + * not forwarding. The ip6_input function + * will handle this packet locally, and it + * depends on the hop limit being unchanged. + * + * One example is the NDP hop limit, that + * always has to stay 255, but other would be + * similar checks around RA packets, where the + * user can even change the desired limit. + */ return ip6_input(skb); } else if (proxied < 0) { __IP6_INC_STATS(net, idev, IPSTATS_MIB_INDISCARDS); diff -u linux-oem-6.1-6.1.0/net/mac80211/cfg.c linux-oem-6.1-6.1.0/net/mac80211/cfg.c --- linux-oem-6.1-6.1.0/net/mac80211/cfg.c +++ linux-oem-6.1-6.1.0/net/mac80211/cfg.c @@ -147,6 +147,7 @@ link_conf->bssid_index = 0; link_conf->nontransmitted = false; link_conf->ema_ap = false; + link_conf->bssid_indicator = 0; if (sdata->vif.type != NL80211_IFTYPE_AP || !params.tx_wdev) return -EINVAL; @@ -1511,6 +1512,12 @@ kfree(link_conf->ftmr_params); link_conf->ftmr_params = NULL; + sdata->vif.mbssid_tx_vif = NULL; + link_conf->bssid_index = 0; + link_conf->nontransmitted = false; + link_conf->ema_ap = false; + link_conf->bssid_indicator = 0; + __sta_info_flush(sdata, true); ieee80211_free_keys(sdata, true); diff -u linux-oem-6.1-6.1.0/net/mac80211/ieee80211_i.h linux-oem-6.1-6.1.0/net/mac80211/ieee80211_i.h --- linux-oem-6.1-6.1.0/net/mac80211/ieee80211_i.h +++ linux-oem-6.1-6.1.0/net/mac80211/ieee80211_i.h @@ -836,7 +836,7 @@ IEEE80211_TXQ_STOP, IEEE80211_TXQ_AMPDU, IEEE80211_TXQ_NO_AMSDU, - IEEE80211_TXQ_STOP_NETIF_TX, + IEEE80211_TXQ_DIRTY, }; /** diff -u linux-oem-6.1-6.1.0/net/mac80211/iface.c linux-oem-6.1-6.1.0/net/mac80211/iface.c --- linux-oem-6.1-6.1.0/net/mac80211/iface.c +++ linux-oem-6.1-6.1.0/net/mac80211/iface.c @@ -364,7 +364,9 @@ /* No support for VLAN with MLO yet */ if (iftype == NL80211_IFTYPE_AP_VLAN && - nsdata->wdev.use_4addr) + sdata->wdev.use_4addr && + nsdata->vif.type == NL80211_IFTYPE_AP && + nsdata->vif.valid_links) return -EOPNOTSUPP; /* @@ -2258,7 +2260,6 @@ ret = cfg80211_register_netdevice(ndev); if (ret) { - ieee80211_if_free(ndev); free_netdev(ndev); return ret; } diff -u linux-oem-6.1-6.1.0/net/mac80211/tx.c linux-oem-6.1-6.1.0/net/mac80211/tx.c --- linux-oem-6.1-6.1.0/net/mac80211/tx.c +++ linux-oem-6.1-6.1.0/net/mac80211/tx.c @@ -1295,7 +1295,8 @@ if (!(info->flags & IEEE80211_TX_CTL_DONTFRAG)) { if (!(tx->flags & IEEE80211_TX_UNICAST) || skb->len + FCS_LEN <= local->hw.wiphy->frag_threshold || - info->flags & IEEE80211_TX_CTL_AMPDU) + (info->flags & IEEE80211_TX_CTL_AMPDU && + !local->ops->wake_tx_queue)) info->flags |= IEEE80211_TX_CTL_DONTFRAG; } @@ -3709,13 +3710,15 @@ struct ieee80211_local *local = hw_to_local(hw); struct txq_info *txqi = container_of(txq, struct txq_info, txq); struct ieee80211_hdr *hdr; - struct sk_buff *skb = NULL; struct fq *fq = &local->fq; struct fq_tin *tin = &txqi->tin; struct ieee80211_tx_info *info; struct ieee80211_tx_data tx; + struct sk_buff *skb; ieee80211_tx_result r; struct ieee80211_vif *vif = txq->vif; + int q = vif->hw_queue[txq->ac]; + bool q_stopped; WARN_ON_ONCE(softirq_count() == 0); @@ -3723,17 +3726,18 @@ return NULL; begin: - spin_lock_bh(&fq->lock); - - if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags) || - test_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags)) - goto out; + spin_lock(&local->queue_stop_reason_lock); + q_stopped = local->queue_stop_reasons[q]; + spin_unlock(&local->queue_stop_reason_lock); - if (vif->txqs_stopped[txq->ac]) { - set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags); - goto out; + if (unlikely(q_stopped)) { + /* mark for waking later */ + set_bit(IEEE80211_TXQ_DIRTY, &txqi->flags); + return NULL; } + spin_lock_bh(&fq->lock); + /* Make sure fragments stay together. */ skb = __skb_dequeue(&txqi->frags); if (unlikely(skb)) { @@ -3743,6 +3747,9 @@ IEEE80211_SKB_CB(skb)->control.flags &= ~IEEE80211_TX_INTCFL_NEED_TXPROCESSING; } else { + if (unlikely(test_bit(IEEE80211_TXQ_STOP, &txqi->flags))) + goto out; + skb = fq_tin_dequeue(fq, tin, fq_tin_dequeue_func); } @@ -3793,7 +3800,8 @@ } if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags)) - info->flags |= IEEE80211_TX_CTL_AMPDU; + info->flags |= (IEEE80211_TX_CTL_AMPDU | + IEEE80211_TX_CTL_DONTFRAG); else info->flags &= ~IEEE80211_TX_CTL_AMPDU; diff -u linux-oem-6.1-6.1.0/net/mac80211/util.c linux-oem-6.1-6.1.0/net/mac80211/util.c --- linux-oem-6.1-6.1.0/net/mac80211/util.c +++ linux-oem-6.1-6.1.0/net/mac80211/util.c @@ -347,8 +347,6 @@ local_bh_disable(); spin_lock(&fq->lock); - sdata->vif.txqs_stopped[ac] = false; - if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) goto out; @@ -370,7 +368,7 @@ if (ac != txq->ac) continue; - if (!test_and_clear_bit(IEEE80211_TXQ_STOP_NETIF_TX, + if (!test_and_clear_bit(IEEE80211_TXQ_DIRTY, &txqi->flags)) continue; @@ -385,7 +383,7 @@ txqi = to_txq_info(vif->txq); - if (!test_and_clear_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags) || + if (!test_and_clear_bit(IEEE80211_TXQ_DIRTY, &txqi->flags) || (ps && atomic_read(&ps->num_sta_ps)) || ac != vif->txq->ac) goto out; @@ -583,16 +581,10 @@ continue; for (ac = 0; ac < n_acs; ac++) { - if (sdata->vif.hw_queue[ac] == queue || - sdata->vif.cab_queue == queue) { - if (!local->ops->wake_tx_queue) { - netif_stop_subqueue(sdata->dev, ac); - continue; - } - spin_lock(&local->fq.lock); - sdata->vif.txqs_stopped[ac] = true; - spin_unlock(&local->fq.lock); - } + if (!local->ops->wake_tx_queue && + (sdata->vif.hw_queue[ac] == queue || + sdata->vif.cab_queue == queue)) + netif_stop_subqueue(sdata->dev, ac); } } rcu_read_unlock(); diff -u linux-oem-6.1-6.1.0/net/mptcp/pm_userspace.c linux-oem-6.1-6.1.0/net/mptcp/pm_userspace.c --- linux-oem-6.1-6.1.0/net/mptcp/pm_userspace.c +++ linux-oem-6.1-6.1.0/net/mptcp/pm_userspace.c @@ -294,6 +294,13 @@ } sk = &msk->sk.icsk_inet.sk; + + if (!mptcp_pm_addr_families_match(sk, &addr_l, &addr_r)) { + GENL_SET_ERR_MSG(info, "families mismatch"); + err = -EINVAL; + goto create_err; + } + lock_sock(sk); err = __mptcp_subflow_connect(sk, &addr_l, &addr_r); diff -u linux-oem-6.1-6.1.0/net/mptcp/protocol.c linux-oem-6.1-6.1.0/net/mptcp/protocol.c --- linux-oem-6.1-6.1.0/net/mptcp/protocol.c +++ linux-oem-6.1-6.1.0/net/mptcp/protocol.c @@ -107,7 +107,7 @@ struct socket *ssock; int err; - err = mptcp_subflow_create_socket(sk, &ssock); + err = mptcp_subflow_create_socket(sk, sk->sk_family, &ssock); if (err) return err; @@ -2908,6 +2908,7 @@ struct mptcp_subflow_context *subflow; struct mptcp_sock *msk = mptcp_sk(sk); bool do_cancel_work = false; + int subflows_alive = 0; sk->sk_shutdown = SHUTDOWN_MASK; @@ -2933,6 +2934,8 @@ struct sock *ssk = mptcp_subflow_tcp_sock(subflow); bool slow = lock_sock_fast_nested(ssk); + subflows_alive += ssk->sk_state != TCP_CLOSE; + /* since the close timeout takes precedence on the fail one, * cancel the latter */ @@ -2948,6 +2951,12 @@ } sock_orphan(sk); + /* all the subflows are closed, only timeout can change the msk + * state, let's not keep resources busy for no reasons + */ + if (subflows_alive == 0) + inet_sk_state_store(sk, TCP_CLOSE); + sock_hold(sk); pr_debug("msk=%p state=%d", sk, sk->sk_state); if (mptcp_sk(sk)->token) diff -u linux-oem-6.1-6.1.0/net/mptcp/protocol.h linux-oem-6.1-6.1.0/net/mptcp/protocol.h --- linux-oem-6.1-6.1.0/net/mptcp/protocol.h +++ linux-oem-6.1-6.1.0/net/mptcp/protocol.h @@ -626,7 +626,8 @@ /* called with sk socket lock held */ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, const struct mptcp_addr_info *remote); -int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock); +int mptcp_subflow_create_socket(struct sock *sk, unsigned short family, + struct socket **new_sock); void mptcp_info2sockaddr(const struct mptcp_addr_info *info, struct sockaddr_storage *addr, unsigned short family); @@ -761,6 +762,9 @@ int mptcp_pm_parse_entry(struct nlattr *attr, struct genl_info *info, bool require_family, struct mptcp_pm_addr_entry *entry); +bool mptcp_pm_addr_families_match(const struct sock *sk, + const struct mptcp_addr_info *loc, + const struct mptcp_addr_info *rem); void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk); void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk); void mptcp_pm_new_connection(struct mptcp_sock *msk, const struct sock *ssk, int server_side); diff -u linux-oem-6.1-6.1.0/net/mptcp/subflow.c linux-oem-6.1-6.1.0/net/mptcp/subflow.c --- linux-oem-6.1-6.1.0/net/mptcp/subflow.c +++ linux-oem-6.1-6.1.0/net/mptcp/subflow.c @@ -1344,6 +1344,7 @@ mptcp_for_each_subflow(msk, subflow) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); int err = sock_error(ssk); + int ssk_state; if (!err) continue; @@ -1354,7 +1355,14 @@ if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(msk)) continue; - inet_sk_state_store(sk, inet_sk_state_load(ssk)); + /* We need to propagate only transition to CLOSE state. + * Orphaned socket will see such state change via + * subflow_sched_work_if_closed() and that path will properly + * destroy the msk as needed. + */ + ssk_state = inet_sk_state_load(ssk); + if (ssk_state == TCP_CLOSE && !sock_flag(sk, SOCK_DEAD)) + inet_sk_state_store(sk, ssk_state); sk->sk_err = -err; /* This barrier is coupled with smp_rmb() in mptcp_poll() */ @@ -1492,7 +1500,7 @@ if (!mptcp_is_fully_established(sk)) goto err_out; - err = mptcp_subflow_create_socket(sk, &sf); + err = mptcp_subflow_create_socket(sk, loc->family, &sf); if (err) goto err_out; @@ -1604,7 +1612,9 @@ #endif ssk->sk_prot = &tcp_prot; } -int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock) + +int mptcp_subflow_create_socket(struct sock *sk, unsigned short family, + struct socket **new_sock) { struct mptcp_subflow_context *subflow; struct net *net = sock_net(sk); @@ -1617,12 +1627,11 @@ if (unlikely(!sk->sk_socket)) return -EINVAL; - err = sock_create_kern(net, sk->sk_family, SOCK_STREAM, IPPROTO_TCP, - &sf); + err = sock_create_kern(net, family, SOCK_STREAM, IPPROTO_TCP, &sf); if (err) return err; - lock_sock(sf->sk); + lock_sock_nested(sf->sk, SINGLE_DEPTH_NESTING); /* the newly created socket has to be in the same cgroup as its parent */ mptcp_attach_cgroup(sk, sf->sk); diff -u linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_standalone.c linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_standalone.c --- linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_standalone.c +++ linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_standalone.c @@ -602,7 +602,6 @@ NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_RECD, NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT, NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_SENT, - NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_ACKED, #endif #ifdef CONFIG_NF_CT_PROTO_DCCP NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_REQUEST, @@ -887,12 +886,6 @@ .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, - [NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_ACKED] = { - .procname = "nf_conntrack_sctp_timeout_heartbeat_acked", - .maxlen = sizeof(unsigned int), - .mode = 0644, - .proc_handler = proc_dointvec_jiffies, - }, #endif #ifdef CONFIG_NF_CT_PROTO_DCCP [NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_REQUEST] = { @@ -1036,7 +1029,6 @@ XASSIGN(SHUTDOWN_RECD, sn); XASSIGN(SHUTDOWN_ACK_SENT, sn); XASSIGN(HEARTBEAT_SENT, sn); - XASSIGN(HEARTBEAT_ACKED, sn); #undef XASSIGN #endif } diff -u linux-oem-6.1-6.1.0/net/openvswitch/datapath.c linux-oem-6.1-6.1.0/net/openvswitch/datapath.c --- linux-oem-6.1-6.1.0/net/openvswitch/datapath.c +++ linux-oem-6.1-6.1.0/net/openvswitch/datapath.c @@ -979,14 +979,14 @@ key = kzalloc(sizeof(*key), GFP_KERNEL); if (!key) { error = -ENOMEM; - goto err_kfree_key; + goto err_kfree_flow; } ovs_match_init(&match, key, false, &mask); error = ovs_nla_get_match(net, &match, a[OVS_FLOW_ATTR_KEY], a[OVS_FLOW_ATTR_MASK], log); if (error) - goto err_kfree_flow; + goto err_kfree_key; ovs_flow_mask_key(&new_flow->key, key, true, &mask); @@ -994,14 +994,14 @@ error = ovs_nla_get_identifier(&new_flow->id, a[OVS_FLOW_ATTR_UFID], key, log); if (error) - goto err_kfree_flow; + goto err_kfree_key; /* Validate actions. */ error = ovs_nla_copy_actions(net, a[OVS_FLOW_ATTR_ACTIONS], &new_flow->key, &acts, log); if (error) { OVS_NLERR(log, "Flow actions may not be safe on all matching packets."); - goto err_kfree_flow; + goto err_kfree_key; } reply = ovs_flow_cmd_alloc_info(acts, &new_flow->id, info, false, @@ -1101,10 +1101,10 @@ kfree_skb(reply); err_kfree_acts: ovs_nla_free_flow_actions(acts); -err_kfree_flow: - ovs_flow_free(new_flow, false); err_kfree_key: kfree(key); +err_kfree_flow: + ovs_flow_free(new_flow, false); error: return error; } diff -u linux-oem-6.1-6.1.0/net/sched/cls_tcindex.c linux-oem-6.1-6.1.0/net/sched/cls_tcindex.c --- linux-oem-6.1-6.1.0/net/sched/cls_tcindex.c +++ linux-oem-6.1-6.1.0/net/sched/cls_tcindex.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -338,6 +339,7 @@ struct tcf_result cr = {}; int err, balloc = 0; struct tcf_exts e; + bool update_h = false; err = tcf_exts_init(&e, net, TCA_TCINDEX_ACT, TCA_TCINDEX_POLICE); if (err < 0) @@ -455,10 +457,13 @@ } } - if (cp->perfect) + if (cp->perfect) { r = cp->perfect + handle; - else - r = tcindex_lookup(cp, handle) ? : &new_filter_result; + } else { + /* imperfect area is updated in-place using rcu */ + update_h = !!tcindex_lookup(cp, handle); + r = &new_filter_result; + } if (r == &new_filter_result) { f = kzalloc(sizeof(*f), GFP_KERNEL); @@ -484,7 +489,28 @@ rcu_assign_pointer(tp->root, cp); - if (r == &new_filter_result) { + if (update_h) { + struct tcindex_filter __rcu **fp; + struct tcindex_filter *cf; + + f->result.res = r->res; + tcf_exts_change(&f->result.exts, &r->exts); + + /* imperfect area bucket */ + fp = cp->h + (handle % cp->hash); + + /* lookup the filter, guaranteed to exist */ + for (cf = rcu_dereference_bh_rtnl(*fp); cf; + fp = &cf->next, cf = rcu_dereference_bh_rtnl(*fp)) + if (cf->key == (u16)handle) + break; + + f->next = cf->next; + + cf = rcu_replace_pointer(*fp, f, 1); + tcf_exts_get_net(&cf->result.exts); + tcf_queue_work(&cf->rwork, tcindex_destroy_fexts_work); + } else if (r == &new_filter_result) { struct tcindex_filter *nfp; struct tcindex_filter __rcu **fp; diff -u linux-oem-6.1-6.1.0/net/sunrpc/svcsock.c linux-oem-6.1-6.1.0/net/sunrpc/svcsock.c --- linux-oem-6.1-6.1.0/net/sunrpc/svcsock.c +++ linux-oem-6.1-6.1.0/net/sunrpc/svcsock.c @@ -260,7 +260,7 @@ rqstp->rq_respages = &rqstp->rq_pages[i]; rqstp->rq_next_page = rqstp->rq_respages + 1; - iov_iter_bvec(&msg.msg_iter, READ, bvec, i, buflen); + iov_iter_bvec(&msg.msg_iter, ITER_DEST, bvec, i, buflen); if (seek) { iov_iter_advance(&msg.msg_iter, seek); buflen -= seek; @@ -874,7 +874,7 @@ want = sizeof(rpc_fraghdr) - svsk->sk_tcplen; iov.iov_base = ((char *)&svsk->sk_marker) + svsk->sk_tcplen; iov.iov_len = want; - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, want); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, want); len = sock_recvmsg(svsk->sk_sock, &msg, MSG_DONTWAIT); if (len < 0) return len; diff -u linux-oem-6.1-6.1.0/net/tls/tls_sw.c linux-oem-6.1-6.1.0/net/tls/tls_sw.c --- linux-oem-6.1-6.1.0/net/tls/tls_sw.c +++ linux-oem-6.1-6.1.0/net/tls/tls_sw.c @@ -2427,7 +2427,7 @@ { struct tls_rec *rec; - rec = list_first_entry(&ctx->tx_list, struct tls_rec, list); + rec = list_first_entry_or_null(&ctx->tx_list, struct tls_rec, list); if (!rec) return false; diff -u linux-oem-6.1-6.1.0/scripts/Makefile.modinst linux-oem-6.1-6.1.0/scripts/Makefile.modinst --- linux-oem-6.1-6.1.0/scripts/Makefile.modinst +++ linux-oem-6.1-6.1.0/scripts/Makefile.modinst @@ -66,11 +66,15 @@ # Don't stop modules_install even if we can't sign external modules. # ifeq ($(CONFIG_MODULE_SIG_ALL),y) +ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) +else +sig-key := $(CONFIG_MODULE_SIG_KEY) +endif quiet_cmd_sign = SIGN $@ cmd_sign = if test -e $(srctree)/debian/scripts/sign-module && \ $(srctree)/debian/scripts/sign-module $@ ; \ - then scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(sig-key) certs/signing_key.x509 $@ \ + then scripts/sign-file $(CONFIG_MODULE_SIG_HASH) "$(sig-key)" certs/signing_key.x509 $@ \ $(if $(KBUILD_EXTMOD),|| true) ; \ fi else diff -u linux-oem-6.1-6.1.0/security/Kconfig.hardening linux-oem-6.1-6.1.0/security/Kconfig.hardening --- linux-oem-6.1-6.1.0/security/Kconfig.hardening +++ linux-oem-6.1-6.1.0/security/Kconfig.hardening @@ -281,6 +281,9 @@ config CC_HAS_RANDSTRUCT def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) + # Randstruct was first added in Clang 15, but it isn't safe to use until + # Clang 16 due to https://github.com/llvm/llvm-project/issues/60349 + depends on !CC_IS_CLANG || CLANG_VERSION >= 160000 choice prompt "Randomize layout of sensitive kernel structures" diff -u linux-oem-6.1-6.1.0/sound/core/memalloc.c linux-oem-6.1-6.1.0/sound/core/memalloc.c --- linux-oem-6.1-6.1.0/sound/core/memalloc.c +++ linux-oem-6.1-6.1.0/sound/core/memalloc.c @@ -542,16 +542,15 @@ struct sg_table *sgt; void *p; +#ifdef CONFIG_SND_DMA_SGBUF + if (cpu_feature_enabled(X86_FEATURE_XENPV)) + return snd_dma_sg_fallback_alloc(dmab, size); +#endif sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, DEFAULT_GFP, 0); #ifdef CONFIG_SND_DMA_SGBUF - if (!sgt && !get_dma_ops(dmab->dev.dev)) { - if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) - dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; - else - dmab->dev.type = SNDRV_DMA_TYPE_DEV_SG_FALLBACK; + if (!sgt && !get_dma_ops(dmab->dev.dev)) return snd_dma_sg_fallback_alloc(dmab, size); - } #endif if (!sgt) return NULL; @@ -718,19 +717,38 @@ /* Fallback SG-buffer allocations for x86 */ struct snd_dma_sg_fallback { + bool use_dma_alloc_coherent; size_t count; struct page **pages; + /* DMA address array; the first page contains #pages in ~PAGE_MASK */ + dma_addr_t *addrs; }; static void __snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab, struct snd_dma_sg_fallback *sgbuf) { - bool wc = dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; - size_t i; + size_t i, size; - for (i = 0; i < sgbuf->count && sgbuf->pages[i]; i++) - do_free_pages(page_address(sgbuf->pages[i]), PAGE_SIZE, wc); + if (sgbuf->pages && sgbuf->addrs) { + i = 0; + while (i < sgbuf->count) { + if (!sgbuf->pages[i] || !sgbuf->addrs[i]) + break; + size = sgbuf->addrs[i] & ~PAGE_MASK; + if (WARN_ON(!size)) + break; + if (sgbuf->use_dma_alloc_coherent) + dma_free_coherent(dmab->dev.dev, size << PAGE_SHIFT, + page_address(sgbuf->pages[i]), + sgbuf->addrs[i] & PAGE_MASK); + else + do_free_pages(page_address(sgbuf->pages[i]), + size << PAGE_SHIFT, false); + i += size; + } + } kvfree(sgbuf->pages); + kvfree(sgbuf->addrs); kfree(sgbuf); } @@ -739,24 +757,36 @@ struct snd_dma_sg_fallback *sgbuf; struct page **pagep, *curp; size_t chunk, npages; + dma_addr_t *addrp; dma_addr_t addr; void *p; - bool wc = dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; + + /* correct the type */ + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) + dmab->dev.type = SNDRV_DMA_TYPE_DEV_SG_FALLBACK; + else if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) + dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); if (!sgbuf) return NULL; + sgbuf->use_dma_alloc_coherent = cpu_feature_enabled(X86_FEATURE_XENPV); size = PAGE_ALIGN(size); sgbuf->count = size >> PAGE_SHIFT; sgbuf->pages = kvcalloc(sgbuf->count, sizeof(*sgbuf->pages), GFP_KERNEL); - if (!sgbuf->pages) + sgbuf->addrs = kvcalloc(sgbuf->count, sizeof(*sgbuf->addrs), GFP_KERNEL); + if (!sgbuf->pages || !sgbuf->addrs) goto error; pagep = sgbuf->pages; - chunk = size; + addrp = sgbuf->addrs; + chunk = (PAGE_SIZE - 1) << PAGE_SHIFT; /* to fit in low bits in addrs */ while (size > 0) { chunk = min(size, chunk); - p = do_alloc_pages(dmab->dev.dev, chunk, &addr, wc); + if (sgbuf->use_dma_alloc_coherent) + p = dma_alloc_coherent(dmab->dev.dev, chunk, &addr, DEFAULT_GFP); + else + p = do_alloc_pages(dmab->dev.dev, chunk, &addr, false); if (!p) { if (chunk <= PAGE_SIZE) goto error; @@ -768,17 +798,25 @@ size -= chunk; /* fill pages */ npages = chunk >> PAGE_SHIFT; + *addrp = npages; /* store in lower bits */ curp = virt_to_page(p); - while (npages--) + while (npages--) { *pagep++ = curp++; + *addrp++ |= addr; + addr += PAGE_SIZE; + } } p = vmap(sgbuf->pages, sgbuf->count, VM_MAP, PAGE_KERNEL); if (!p) goto error; + + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) + set_pages_array_wc(sgbuf->pages, sgbuf->count); + dmab->private_data = sgbuf; /* store the first page address for convenience */ - dmab->addr = snd_sgbuf_get_addr(dmab, 0); + dmab->addr = sgbuf->addrs[0] & PAGE_MASK; return p; error: @@ -788,10 +826,23 @@ static void snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab) { + struct snd_dma_sg_fallback *sgbuf = dmab->private_data; + + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) + set_pages_array_wb(sgbuf->pages, sgbuf->count); vunmap(dmab->area); __snd_dma_sg_fallback_free(dmab, dmab->private_data); } +static dma_addr_t snd_dma_sg_fallback_get_addr(struct snd_dma_buffer *dmab, + size_t offset) +{ + struct snd_dma_sg_fallback *sgbuf = dmab->private_data; + size_t index = offset >> PAGE_SHIFT; + + return (sgbuf->addrs[index] & PAGE_MASK) | (offset & ~PAGE_MASK); +} + static int snd_dma_sg_fallback_mmap(struct snd_dma_buffer *dmab, struct vm_area_struct *area) { @@ -806,8 +857,8 @@ .alloc = snd_dma_sg_fallback_alloc, .free = snd_dma_sg_fallback_free, .mmap = snd_dma_sg_fallback_mmap, + .get_addr = snd_dma_sg_fallback_get_addr, /* reuse vmalloc helpers */ - .get_addr = snd_dma_vmalloc_get_addr, .get_page = snd_dma_vmalloc_get_page, .get_chunk_size = snd_dma_vmalloc_get_chunk_size, }; diff -u linux-oem-6.1-6.1.0/sound/pci/hda/hda_codec.c linux-oem-6.1-6.1.0/sound/pci/hda/hda_codec.c --- linux-oem-6.1-6.1.0/sound/pci/hda/hda_codec.c +++ linux-oem-6.1-6.1.0/sound/pci/hda/hda_codec.c @@ -795,7 +795,6 @@ snd_array_free(&codec->cvt_setups); snd_array_free(&codec->spdif_out); snd_array_free(&codec->verbs); - codec->preset = NULL; codec->follower_dig_outs = NULL; codec->spdif_status_reset = 0; snd_array_free(&codec->mixers); @@ -928,7 +927,6 @@ codec->depop_delay = -1; codec->fixup_id = HDA_FIXUP_ID_NOT_SET; codec->core.dev.release = snd_hda_codec_dev_release; - codec->core.exec_verb = codec_exec_verb; codec->core.type = HDA_DEV_LEGACY; mutex_init(&codec->spdif_mutex); @@ -999,6 +997,7 @@ if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) return -EINVAL; + codec->core.exec_verb = codec_exec_verb; codec->card = card; codec->addr = codec_addr; diff -u linux-oem-6.1-6.1.0/sound/pci/hda/patch_realtek.c linux-oem-6.1-6.1.0/sound/pci/hda/patch_realtek.c --- linux-oem-6.1-6.1.0/sound/pci/hda/patch_realtek.c +++ linux-oem-6.1-6.1.0/sound/pci/hda/patch_realtek.c @@ -832,7 +832,7 @@ alc_setup_gpio(codec, 0x02); break; case 7: - alc_setup_gpio(codec, 0x03); + alc_setup_gpio(codec, 0x04); break; case 5: default: @@ -3564,6 +3564,15 @@ hda_nid_t hp_pin = alc_get_hp_pin(spec); bool hp_pin_sense; + if (spec->ultra_low_power) { + alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); + alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); + alc_update_coef_idx(codec, 0x08, 7<<4, 0); + alc_update_coef_idx(codec, 0x3b, 1<<15, 0); + alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); + msleep(30); + } + if (!hp_pin) hp_pin = 0x21; @@ -3575,14 +3584,6 @@ msleep(2); alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ - if (spec->ultra_low_power) { - alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); - alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); - alc_update_coef_idx(codec, 0x08, 7<<4, 0); - alc_update_coef_idx(codec, 0x3b, 1<<15, 0); - alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); - msleep(30); - } snd_hda_codec_write(codec, hp_pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); @@ -3713,6 +3714,13 @@ hda_nid_t hp_pin = alc_get_hp_pin(spec); bool hp1_pin_sense, hp2_pin_sense; + if (spec->ultra_low_power) { + alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); + alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); + alc_update_coef_idx(codec, 0x33, 1<<11, 0); + msleep(30); + } + if (spec->codec_variant != ALC269_TYPE_ALC287 && spec->codec_variant != ALC269_TYPE_ALC245) /* required only at boot or S3 and S4 resume time */ @@ -3734,12 +3742,6 @@ msleep(2); alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ - if (spec->ultra_low_power) { - alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); - alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); - alc_update_coef_idx(codec, 0x33, 1<<11, 0); - msleep(30); - } if (hp1_pin_sense || spec->ultra_low_power) snd_hda_codec_write(codec, hp_pin, 0, @@ -4644,6 +4646,16 @@ } } +static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + + if (action == HDA_FIXUP_ACT_PRE_PROBE) + spec->micmute_led_polarity = 1; + alc_fixup_hp_gpio_led(codec, action, 0, 0x04); +} + static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -4665,6 +4677,13 @@ alc285_fixup_hp_coef_micmute_led(codec, fix, action); } +static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + alc285_fixup_hp_mute_led_coefbit(codec, fix, action); + alc285_fixup_hp_gpio_micmute_led(codec, fix, action); +} + static void alc236_fixup_hp_mute_led(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -7106,6 +7125,7 @@ ALC285_FIXUP_ASUS_G533Z_PINS, ALC285_FIXUP_HP_GPIO_LED, ALC285_FIXUP_HP_MUTE_LED, + ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, ALC236_FIXUP_HP_GPIO_LED, ALC236_FIXUP_HP_MUTE_LED, ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, @@ -8486,6 +8506,10 @@ .type = HDA_FIXUP_FUNC, .v.func = alc285_fixup_hp_mute_led, }, + [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_spectre_x360_mute_led, + }, [ALC236_FIXUP_HP_GPIO_LED] = { .type = HDA_FIXUP_FUNC, .v.func = alc236_fixup_hp_gpio_led, @@ -9178,6 +9202,7 @@ SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), + SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), @@ -9328,6 +9353,7 @@ SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), + SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), @@ -9397,6 +9423,7 @@ SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), + SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), @@ -9405,8 +9432,21 @@ SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), + SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), @@ -9453,6 +9493,7 @@ SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2), SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), + SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), @@ -9496,6 +9537,7 @@ SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), + SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), @@ -9674,6 +9716,7 @@ SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), + SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP), diff -u linux-oem-6.1-6.1.0/sound/soc/amd/yc/acp6x-mach.c linux-oem-6.1-6.1.0/sound/soc/amd/yc/acp6x-mach.c --- linux-oem-6.1-6.1.0/sound/soc/amd/yc/acp6x-mach.c +++ linux-oem-6.1-6.1.0/sound/soc/amd/yc/acp6x-mach.c @@ -209,6 +209,13 @@ { .driver_data = &acp6x_card, .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M5402RA"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), } @@ -220,6 +227,34 @@ DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"), + DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"), + } + }, {} }; diff -u linux-oem-6.1-6.1.0/sound/soc/codecs/wsa883x.c linux-oem-6.1-6.1.0/sound/soc/codecs/wsa883x.c --- linux-oem-6.1-6.1.0/sound/soc/codecs/wsa883x.c +++ linux-oem-6.1-6.1.0/sound/soc/codecs/wsa883x.c @@ -1359,8 +1359,8 @@ .stream_name = "SPKR Playback", .rates = WSA883X_RATES | WSA883X_FRAC_RATES, .formats = WSA883X_FORMATS, - .rate_max = 8000, - .rate_min = 352800, + .rate_min = 8000, + .rate_max = 352800, .channels_min = 1, .channels_max = 1, }, diff -u linux-oem-6.1-6.1.0/sound/soc/intel/avs/core.c linux-oem-6.1-6.1.0/sound/soc/intel/avs/core.c --- linux-oem-6.1-6.1.0/sound/soc/intel/avs/core.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/avs/core.c @@ -476,6 +476,29 @@ return ret; } +static void avs_pci_shutdown(struct pci_dev *pci) +{ + struct hdac_bus *bus = pci_get_drvdata(pci); + struct avs_dev *adev = hdac_to_avs(bus); + + cancel_work_sync(&adev->probe_work); + avs_ipc_block(adev->ipc); + + snd_hdac_stop_streams(bus); + avs_dsp_op(adev, int_control, false); + snd_hdac_ext_bus_ppcap_int_enable(bus, false); + snd_hdac_ext_bus_link_power_down_all(bus); + + snd_hdac_bus_stop_chip(bus); + snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false); + + if (avs_platattr_test(adev, CLDMA)) + pci_free_irq(pci, 0, &code_loader); + pci_free_irq(pci, 0, adev); + pci_free_irq(pci, 0, bus); + pci_free_irq_vectors(pci); +} + static void avs_pci_remove(struct pci_dev *pci) { struct hdac_device *hdev, *save; @@ -679,6 +702,7 @@ .id_table = avs_ids, .probe = avs_pci_probe, .remove = avs_pci_remove, + .shutdown = avs_pci_shutdown, .driver = { .pm = &avs_dev_pm, }, diff -u linux-oem-6.1-6.1.0/sound/soc/intel/boards/Kconfig linux-oem-6.1-6.1.0/sound/soc/intel/boards/Kconfig --- linux-oem-6.1-6.1.0/sound/soc/intel/boards/Kconfig +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/Kconfig @@ -558,6 +558,7 @@ select SND_SOC_HDAC_HDMI select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON + select SND_SOC_INTEL_SOF_REALTEK_COMMON help This adds support for ASoC machine driver for SOF platforms with nau8825 codec. diff -u linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_rt5640.c linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_rt5640.c --- linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_rt5640.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_rt5640.c @@ -1626,13 +1626,18 @@ if (adev) { snprintf(byt_rt5640_codec_name, sizeof(byt_rt5640_codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); byt_rt5640_dais[dai_index].codecs->name = byt_rt5640_codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); return -ENXIO; } + codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); + if (!codec_dev) + return -EPROBE_DEFER; + priv->codec_dev = get_device(codec_dev); + /* * swap SSP0 if bytcr is detected * (will be overridden if DMI quirk is detected) @@ -1707,11 +1712,6 @@ byt_rt5640_quirk = quirk_override; } - codec_dev = acpi_get_first_physical_node(adev); - if (!codec_dev) - return -EPROBE_DEFER; - priv->codec_dev = get_device(codec_dev); - if (byt_rt5640_quirk & BYT_RT5640_JD_HP_ELITEP_1000G2) { acpi_dev_add_driver_gpios(ACPI_COMPANION(priv->codec_dev), byt_rt5640_hp_elitepad_1000g2_gpios); diff -u linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_es8336.c linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_es8336.c --- linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_es8336.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_es8336.c @@ -681,7 +681,6 @@ if (adev) { snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); dai_links[0].codecs->name = codec_name; /* also fixup codec dai name if relevant */ @@ -692,16 +691,19 @@ return -ENXIO; } - ret = snd_soc_fixup_dai_links_platform_name(&sof_es8336_card, - mach->mach_params.platform); - if (ret) - return ret; - codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); if (!codec_dev) return -EPROBE_DEFER; priv->codec_dev = get_device(codec_dev); + ret = snd_soc_fixup_dai_links_platform_name(&sof_es8336_card, + mach->mach_params.platform); + if (ret) { + put_device(codec_dev); + return ret; + } + if (quirk & SOF_ES8336_JD_INVERTED) props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-inverted"); diff -u linux-oem-6.1-6.1.0/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c linux-oem-6.1-6.1.0/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c --- linux-oem-6.1-6.1.0/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c +++ linux-oem-6.1-6.1.0/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c @@ -991,6 +991,21 @@ .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), }; +static struct snd_soc_card mt8186_mt6366_rt5682s_max98360_soc_card = { + .name = "mt8186_rt5682s_max98360", + .owner = THIS_MODULE, + .dai_link = mt8186_mt6366_rt1019_rt5682s_dai_links, + .num_links = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_dai_links), + .controls = mt8186_mt6366_rt1019_rt5682s_controls, + .num_controls = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_controls), + .dapm_widgets = mt8186_mt6366_rt1019_rt5682s_widgets, + .num_dapm_widgets = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_widgets), + .dapm_routes = mt8186_mt6366_rt1019_rt5682s_routes, + .num_dapm_routes = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_routes), + .codec_conf = mt8186_mt6366_rt1019_rt5682s_codec_conf, + .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), +}; + static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; @@ -1132,9 +1147,14 @@ #if IS_ENABLED(CONFIG_OF) static const struct of_device_id mt8186_mt6366_rt1019_rt5682s_dt_match[] = { - { .compatible = "mediatek,mt8186-mt6366-rt1019-rt5682s-sound", + { + .compatible = "mediatek,mt8186-mt6366-rt1019-rt5682s-sound", .data = &mt8186_mt6366_rt1019_rt5682s_soc_card, }, + { + .compatible = "mediatek,mt8186-mt6366-rt5682s-max98360-sound", + .data = &mt8186_mt6366_rt5682s_max98360_soc_card, + }, {} }; #endif diff -u linux-oem-6.1-6.1.0/sound/soc/qcom/Kconfig linux-oem-6.1-6.1.0/sound/soc/qcom/Kconfig --- linux-oem-6.1-6.1.0/sound/soc/qcom/Kconfig +++ linux-oem-6.1-6.1.0/sound/soc/qcom/Kconfig @@ -2,7 +2,6 @@ menuconfig SND_SOC_QCOM tristate "ASoC support for QCOM platforms" depends on ARCH_QCOM || COMPILE_TEST - imply SND_SOC_QCOM_COMMON help Say Y or M if you want to add support to use audio devices in Qualcomm Technologies SOC-based platforms. @@ -60,14 +59,16 @@ config SND_SOC_APQ8016_SBC tristate "SoC Audio support for APQ8016 SBC platforms" select SND_SOC_LPASS_APQ8016 - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON help Support for Qualcomm Technologies LPASS audio block in APQ8016 SOC-based systems. Say Y if you want to use audio devices on MI2S. config SND_SOC_QCOM_COMMON - depends on SOUNDWIRE + tristate + +config SND_SOC_QCOM_SDW tristate config SND_SOC_QDSP6_COMMON @@ -144,7 +145,7 @@ depends on QCOM_APR depends on COMMON_CLK select SND_SOC_QDSP6 - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON help Support for Qualcomm Technologies LPASS audio block in APQ8096 SoC-based systems. @@ -155,7 +156,7 @@ depends on QCOM_APR && I2C && SOUNDWIRE depends on COMMON_CLK select SND_SOC_QDSP6 - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON select SND_SOC_RT5663 select SND_SOC_MAX98927 imply SND_SOC_CROS_EC_CODEC @@ -169,7 +170,8 @@ depends on QCOM_APR && SOUNDWIRE depends on COMMON_CLK select SND_SOC_QDSP6 - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_SDW help To add support for audio on Qualcomm Technologies Inc. SM8250 SoC-based systems. @@ -180,7 +182,8 @@ depends on QCOM_APR && SOUNDWIRE depends on COMMON_CLK select SND_SOC_QDSP6 - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_SDW help To add support for audio on Qualcomm Technologies Inc. SC8280XP SoC-based systems. @@ -190,7 +193,7 @@ tristate "SoC Machine driver for SC7180 boards" depends on I2C && GPIOLIB depends on SOUNDWIRE || SOUNDWIRE=n - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON select SND_SOC_LPASS_SC7180 select SND_SOC_MAX98357A select SND_SOC_RT5682_I2C @@ -204,7 +207,7 @@ config SND_SOC_SC7280 tristate "SoC Machine driver for SC7280 boards" depends on I2C && SOUNDWIRE - depends on SND_SOC_QCOM_COMMON + select SND_SOC_QCOM_COMMON select SND_SOC_LPASS_SC7280 select SND_SOC_MAX98357A select SND_SOC_WCD938X_SDW diff -u linux-oem-6.1-6.1.0/sound/soc/qcom/common.c linux-oem-6.1-6.1.0/sound/soc/qcom/common.c --- linux-oem-6.1-6.1.0/sound/soc/qcom/common.c +++ linux-oem-6.1-6.1.0/sound/soc/qcom/common.c @@ -180,120 +180,6 @@ } EXPORT_SYMBOL_GPL(qcom_snd_parse_of); -int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, - bool *stream_prepared) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); - int ret; - - if (!sruntime) - return 0; - - switch (cpu_dai->id) { - case WSA_CODEC_DMA_RX_0: - case WSA_CODEC_DMA_RX_1: - case RX_CODEC_DMA_RX_0: - case RX_CODEC_DMA_RX_1: - case TX_CODEC_DMA_TX_0: - case TX_CODEC_DMA_TX_1: - case TX_CODEC_DMA_TX_2: - case TX_CODEC_DMA_TX_3: - break; - default: - return 0; - } - - if (*stream_prepared) { - sdw_disable_stream(sruntime); - sdw_deprepare_stream(sruntime); - *stream_prepared = false; - } - - ret = sdw_prepare_stream(sruntime); - if (ret) - return ret; - - /** - * NOTE: there is a strict hw requirement about the ordering of port - * enables and actual WSA881x PA enable. PA enable should only happen - * after soundwire ports are enabled if not DC on the line is - * accumulated resulting in Click/Pop Noise - * PA enable/mute are handled as part of codec DAPM and digital mute. - */ - - ret = sdw_enable_stream(sruntime); - if (ret) { - sdw_deprepare_stream(sruntime); - return ret; - } - *stream_prepared = true; - - return ret; -} -EXPORT_SYMBOL_GPL(qcom_snd_sdw_prepare); - -int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct sdw_stream_runtime **psruntime) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *codec_dai; - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); - struct sdw_stream_runtime *sruntime; - int i; - - switch (cpu_dai->id) { - case WSA_CODEC_DMA_RX_0: - case RX_CODEC_DMA_RX_0: - case RX_CODEC_DMA_RX_1: - case TX_CODEC_DMA_TX_0: - case TX_CODEC_DMA_TX_1: - case TX_CODEC_DMA_TX_2: - case TX_CODEC_DMA_TX_3: - for_each_rtd_codec_dais(rtd, i, codec_dai) { - sruntime = snd_soc_dai_get_stream(codec_dai, substream->stream); - if (sruntime != ERR_PTR(-ENOTSUPP)) - *psruntime = sruntime; - } - break; - } - - return 0; - -} -EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_params); - -int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, bool *stream_prepared) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); - - switch (cpu_dai->id) { - case WSA_CODEC_DMA_RX_0: - case WSA_CODEC_DMA_RX_1: - case RX_CODEC_DMA_RX_0: - case RX_CODEC_DMA_RX_1: - case TX_CODEC_DMA_TX_0: - case TX_CODEC_DMA_TX_1: - case TX_CODEC_DMA_TX_2: - case TX_CODEC_DMA_TX_3: - if (sruntime && *stream_prepared) { - sdw_disable_stream(sruntime); - sdw_deprepare_stream(sruntime); - *stream_prepared = false; - } - break; - default: - break; - } - - return 0; -} -EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_free); - int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup) { diff -u linux-oem-6.1-6.1.0/sound/soc/qcom/common.h linux-oem-6.1-6.1.0/sound/soc/qcom/common.h --- linux-oem-6.1-6.1.0/sound/soc/qcom/common.h +++ linux-oem-6.1-6.1.0/sound/soc/qcom/common.h @@ -7,17 +7,7 @@ #include -#include int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); -int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *runtime, - bool *stream_prepared); -int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct sdw_stream_runtime **psruntime); -int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, - bool *stream_prepared); #endif diff -u linux-oem-6.1-6.1.0/sound/usb/implicit.c linux-oem-6.1-6.1.0/sound/usb/implicit.c --- linux-oem-6.1-6.1.0/sound/usb/implicit.c +++ linux-oem-6.1-6.1.0/sound/usb/implicit.c @@ -471,7 +471,7 @@ subs = find_matching_substream(chip, stream, target->sync_ep, target->fmt_type); if (!subs) - return sync_fmt; + goto end; high_score = 0; list_for_each_entry(fp, &subs->fmt_list, list) { @@ -485,6 +485,7 @@ } } + end: if (fixed_rate) *fixed_rate = snd_usb_pcm_has_fixed_rate(subs); return sync_fmt; diff -u linux-oem-6.1-6.1.0/sound/usb/pcm.c linux-oem-6.1-6.1.0/sound/usb/pcm.c --- linux-oem-6.1-6.1.0/sound/usb/pcm.c +++ linux-oem-6.1-6.1.0/sound/usb/pcm.c @@ -160,9 +160,12 @@ bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs) { const struct audioformat *fp; - struct snd_usb_audio *chip = subs->stream->chip; + struct snd_usb_audio *chip; int rate = -1; + if (!subs) + return false; + chip = subs->stream->chip; if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE)) return false; list_for_each_entry(fp, &subs->fmt_list, list) { @@ -525,6 +528,8 @@ if (snd_usb_endpoint_compatible(chip, subs->data_endpoint, fmt, hw_params)) goto unlock; + if (stop_endpoints(subs, false)) + sync_pending_stops(subs); close_endpoints(chip, subs); } @@ -935,8 +940,13 @@ continue; /* for the implicit fb, check the sync ep as well */ ep = snd_usb_get_endpoint(chip, fp->sync_ep); - if (ep && ep->cur_audiofmt) - return ep; + if (ep && ep->cur_audiofmt) { + /* ditto, if the sync (data) ep is used by others, + * this stream is restricted by the sync ep + */ + if (ep != subs->sync_endpoint || ep->opened > 1) + return ep; + } } return NULL; } diff -u linux-oem-6.1-6.1.0/sound/usb/quirks.c linux-oem-6.1-6.1.0/sound/usb/quirks.c --- linux-oem-6.1-6.1.0/sound/usb/quirks.c +++ linux-oem-6.1-6.1.0/sound/usb/quirks.c @@ -2152,6 +2152,8 @@ QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */ QUIRK_FLAG_IFACE_SKIP_CLOSE), + DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */ + QUIRK_FLAG_FIXED_RATE), DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ QUIRK_FLAG_FIXED_RATE), diff -u linux-oem-6.1-6.1.0/tools/perf/builtin-trace.c linux-oem-6.1-6.1.0/tools/perf/builtin-trace.c --- linux-oem-6.1-6.1.0/tools/perf/builtin-trace.c +++ linux-oem-6.1-6.1.0/tools/perf/builtin-trace.c @@ -17,7 +17,9 @@ #include "util/record.h" #include #include +#ifdef HAVE_LIBBPF_SUPPORT #include +#endif #include "util/bpf_map.h" #include "util/rlimit.h" #include "builtin.h" diff -u linux-oem-6.1-6.1.0/tools/testing/selftests/lib.mk linux-oem-6.1-6.1.0/tools/testing/selftests/lib.mk --- linux-oem-6.1-6.1.0/tools/testing/selftests/lib.mk +++ linux-oem-6.1-6.1.0/tools/testing/selftests/lib.mk @@ -20,7 +20,7 @@ ifeq ($(CROSS_COMPILE),) ifeq ($(CLANG_TARGET_FLAGS),) -$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk +$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk) else CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) endif # CLANG_TARGET_FLAGS only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/ABI/testing/sysfs-kernel-oops_count +++ linux-oem-6.1-6.1.0/Documentation/ABI/testing/sysfs-kernel-oops_count @@ -0,0 +1,6 @@ +What: /sys/kernel/oops_count +Date: November 2022 +KernelVersion: 6.2.0 +Contact: Linux Kernel Hardening List +Description: + Shows how many times the system has Oopsed since last boot. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/ABI/testing/sysfs-kernel-warn_count +++ linux-oem-6.1-6.1.0/Documentation/ABI/testing/sysfs-kernel-warn_count @@ -0,0 +1,6 @@ +What: /sys/kernel/warn_count +Date: November 2022 +KernelVersion: 6.2.0 +Contact: Linux Kernel Hardening List +Description: + Shows how many times the system has Warned since last boot. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/admin-guide/hw-vuln/cross-thread-rsb.rst +++ linux-oem-6.1-6.1.0/Documentation/admin-guide/hw-vuln/cross-thread-rsb.rst @@ -0,0 +1,92 @@ + +.. SPDX-License-Identifier: GPL-2.0 + +Cross-Thread Return Address Predictions +======================================= + +Certain AMD and Hygon processors are subject to a cross-thread return address +predictions vulnerability. When running in SMT mode and one sibling thread +transitions out of C0 state, the other sibling thread could use return target +predictions from the sibling thread that transitioned out of C0. + +The Spectre v2 mitigations protect the Linux kernel, as it fills the return +address prediction entries with safe targets when context switching to the idle +thread. However, KVM does allow a VMM to prevent exiting guest mode when +transitioning out of C0. This could result in a guest-controlled return target +being consumed by the sibling thread. + +Affected processors +------------------- + +The following CPUs are vulnerable: + + - AMD Family 17h processors + - Hygon Family 18h processors + +Related CVEs +------------ + +The following CVE entry is related to this issue: + + ============== ======================================= + CVE-2022-27672 Cross-Thread Return Address Predictions + ============== ======================================= + +Problem +------- + +Affected SMT-capable processors support 1T and 2T modes of execution when SMT +is enabled. In 2T mode, both threads in a core are executing code. For the +processor core to enter 1T mode, it is required that one of the threads +requests to transition out of the C0 state. This can be communicated with the +HLT instruction or with an MWAIT instruction that requests non-C0. +When the thread re-enters the C0 state, the processor transitions back +to 2T mode, assuming the other thread is also still in C0 state. + +In affected processors, the return address predictor (RAP) is partitioned +depending on the SMT mode. For instance, in 2T mode each thread uses a private +16-entry RAP, but in 1T mode, the active thread uses a 32-entry RAP. Upon +transition between 1T/2T mode, the RAP contents are not modified but the RAP +pointers (which control the next return target to use for predictions) may +change. This behavior may result in return targets from one SMT thread being +used by RET predictions in the sibling thread following a 1T/2T switch. In +particular, a RET instruction executed immediately after a transition to 1T may +use a return target from the thread that just became idle. In theory, this +could lead to information disclosure if the return targets used do not come +from trustworthy code. + +Attack scenarios +---------------- + +An attack can be mounted on affected processors by performing a series of CALL +instructions with targeted return locations and then transitioning out of C0 +state. + +Mitigation mechanism +-------------------- + +Before entering idle state, the kernel context switches to the idle thread. The +context switch fills the RAP entries (referred to as the RSB in Linux) with safe +targets by performing a sequence of CALL instructions. + +Prevent a guest VM from directly putting the processor into an idle state by +intercepting HLT and MWAIT instructions. + +Both mitigations are required to fully address this issue. + +Mitigation control on the kernel command line +--------------------------------------------- + +Use existing Spectre v2 mitigations that will fill the RSB on context switch. + +Mitigation control for KVM - module parameter +--------------------------------------------- + +By default, the KVM hypervisor mitigates this issue by intercepting guest +attempts to transition out of C0. A VMM can use the KVM_CAP_X86_DISABLE_EXITS +capability to override those interceptions, but since this is not common, the +mitigation that covers this path is not enabled by default. + +The mitigation for the KVM_CAP_X86_DISABLE_EXITS capability can be turned on +using the boolean module parameter mitigate_smt_rsb, e.g.: + kvm.mitigate_smt_rsb=1 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/admin-guide/hw-vuln/index.rst +++ linux-oem-6.1-6.1.0/Documentation/admin-guide/hw-vuln/index.rst @@ -18,3 +18,4 @@ core-scheduling.rst l1d_flush.rst processor_mmio_stale_data.rst + cross-thread-rsb.rst only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/admin-guide/perf/hisi-pcie-pmu.rst +++ linux-oem-6.1-6.1.0/Documentation/admin-guide/perf/hisi-pcie-pmu.rst @@ -15,10 +15,10 @@ The PCIe PMU driver registers a perf PMU with the name of its sicl-id and PCIe Core id.:: - /sys/bus/event_source/hisi_pcie_ + /sys/bus/event_source/hisi_pcie_core PMU driver provides description of available events and filter options in sysfs, -see /sys/bus/event_source/devices/hisi_pcie_. +see /sys/bus/event_source/devices/hisi_pcie_core. The "format" directory describes all formats of the config (events) and config1 (filter options) fields of the perf_event_attr structure. The "events" directory @@ -33,13 +33,13 @@ Example usage of perf:: $# perf list - hisi_pcie0_0/rx_mwr_latency/ [kernel PMU event] - hisi_pcie0_0/rx_mwr_cnt/ [kernel PMU event] + hisi_pcie0_core0/rx_mwr_latency/ [kernel PMU event] + hisi_pcie0_core0/rx_mwr_cnt/ [kernel PMU event] ------------------------------------------ - $# perf stat -e hisi_pcie0_0/rx_mwr_latency/ - $# perf stat -e hisi_pcie0_0/rx_mwr_cnt/ - $# perf stat -g -e hisi_pcie0_0/rx_mwr_latency/ -e hisi_pcie0_0/rx_mwr_cnt/ + $# perf stat -e hisi_pcie0_core0/rx_mwr_latency/ + $# perf stat -e hisi_pcie0_core0/rx_mwr_cnt/ + $# perf stat -g -e hisi_pcie0_core0/rx_mwr_latency/ -e hisi_pcie0_core0/rx_mwr_cnt/ The current driver does not support sampling. So "perf record" is unsupported. Also attach to a task is unsupported for PCIe PMU. @@ -64,7 +64,7 @@ Example usage of perf:: - $# perf stat -e hisi_pcie0_0/rx_mwr_latency,port=0x1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mwr_latency,port=0x1/ sleep 5 -bdf @@ -76,7 +76,7 @@ Example usage of perf:: - $# perf stat -e hisi_pcie0_0/rx_mrd_flux,bdf=0x3900/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,bdf=0x3900/ sleep 5 2. Trigger filter Event statistics start when the first time TLP length is greater/smaller @@ -90,7 +90,7 @@ Example usage of perf:: - $# perf stat -e hisi_pcie0_0/rx_mrd_flux,trig_len=0x4,trig_mode=1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,trig_len=0x4,trig_mode=1/ sleep 5 3. Threshold filter Counter counts when TLP length within the specified range. You can set the @@ -103,4 +103,4 @@ Example usage of perf:: - $# perf stat -e hisi_pcie0_0/rx_mrd_flux,thr_len=0x4,thr_mode=1/ sleep 5 + $# perf stat -e hisi_pcie0_core0/rx_mrd_flux,thr_len=0x4,thr_mode=1/ sleep 5 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml @@ -32,7 +32,7 @@ - description: Display byte clock - description: Display byte interface clock - description: Display pixel clock - - description: Display escape clock + - description: Display core clock - description: Display AHB clock - description: Display AXI clock @@ -134,8 +134,6 @@ - phy-names - assigned-clocks - assigned-clock-parents - - power-domains - - operating-points-v2 - ports additionalProperties: false only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml @@ -69,7 +69,6 @@ - compatible - reg - reg-names - - vdds-supply unevaluatedProperties: false only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml @@ -38,7 +38,6 @@ - compatible - reg - reg-names - - vcca-supply unevaluatedProperties: false only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml @@ -34,6 +34,10 @@ vddio-supply: description: Phandle to vdd-io regulator device node. + qcom,dsi-phy-regulator-ldo-mode: + type: boolean + description: Indicates if the LDO mode PHY regulator is wanted. + required: - compatible - reg only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml @@ -16,7 +16,7 @@ compatible: items: - enum: - - renesas,i2c-r9a09g011 # RZ/V2M + - renesas,r9a09g011-i2c # RZ/V2M - const: renesas,rzv2m-i2c reg: @@ -66,7 +66,7 @@ #include i2c0: i2c@a4030000 { - compatible = "renesas,i2c-r9a09g011", "renesas,rzv2m-i2c"; + compatible = "renesas,r9a09g011-i2c", "renesas,rzv2m-i2c"; reg = <0xa4030000 0x80>; interrupts = , ; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/phy/amlogic,g12a-usb2-phy.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/phy/amlogic,g12a-usb2-phy.yaml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 BayLibre, SAS +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/amlogic,g12a-usb2-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Amlogic G12A USB2 PHY + +maintainers: + - Neil Armstrong + +properties: + compatible: + enum: + - amlogic,g12a-usb2-phy + - amlogic,a1-usb2-phy + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: xtal + + resets: + maxItems: 1 + + reset-names: + items: + - const: phy + + "#phy-cells": + const: 0 + + phy-supply: + description: + Phandle to a regulator that provides power to the PHY. This + regulator will be managed during the PHY power on/off sequence. + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +if: + properties: + compatible: + enum: + - amlogic,meson-a1-usb-ctrl + +then: + properties: + power-domains: + maxItems: 1 + required: + - power-domains + +additionalProperties: false + +examples: + - | + phy@36000 { + compatible = "amlogic,g12a-usb2-phy"; + reg = <0x36000 0x2000>; + clocks = <&xtal>; + clock-names = "xtal"; + resets = <&phy_reset>; + reset-names = "phy"; + #phy-cells = <0>; + }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/phy/amlogic,g12a-usb3-pcie-phy.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/phy/amlogic,g12a-usb3-pcie-phy.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 BayLibre, SAS +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/amlogic,g12a-usb3-pcie-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Amlogic G12A USB3 + PCIE Combo PHY + +maintainers: + - Neil Armstrong + +properties: + compatible: + enum: + - amlogic,g12a-usb3-pcie-phy + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: ref_clk + + resets: + maxItems: 1 + + reset-names: + items: + - const: phy + + "#phy-cells": + const: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +additionalProperties: false + +examples: + - | + phy@46000 { + compatible = "amlogic,g12a-usb3-pcie-phy"; + reg = <0x46000 0x2000>; + clocks = <&ref_clk>; + clock-names = "ref_clk"; + resets = <&phy_reset>; + reset-names = "phy"; + #phy-cells = <1>; + }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/regulator/samsung,s2mps14.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/regulator/samsung,s2mps14.yaml @@ -19,8 +19,8 @@ additional information and example. patternProperties: - # 25 LDOs - "^LDO([1-9]|[1][0-9]|2[0-5])$": + # 25 LDOs, without LDO10-12 + "^LDO([1-9]|1[3-9]|2[0-5])$": type: object $ref: regulator.yaml# unevaluatedProperties: false @@ -29,6 +29,23 @@ required: - regulator-name + + "^LDO(1[0-2])$": + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + description: + Properties for single LDO regulator. + + properties: + samsung,ext-control-gpios: + maxItems: 1 + description: + LDO10, LDO11 and LDO12 can be configured to external control over + GPIO. + + required: + - regulator-name # 5 bucks "^BUCK[1-5]$": only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/devicetree/bindings/riscv/cpus.yaml +++ linux-oem-6.1-6.1.0/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -80,7 +80,7 @@ insensitive, letters in the riscv,isa string must be all lowercase to simplify parsing. $ref: "/schemas/types.yaml#/definitions/string" - pattern: ^rv(?:64|32)imaf?d?q?c?b?v?k?h?(?:_[hsxz](?:[a-z])+)*$ + pattern: ^rv(?:64|32)imaf?d?q?c?b?k?j?p?v?h?(?:[hsxz](?:[a-z])+)?(?:_[hsxz](?:[a-z])+)*$ # RISC-V requires 'timebase-frequency' in /cpus, so disallow it here timebase-frequency: false only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/gpu/todo.rst +++ linux-oem-6.1-6.1.0/Documentation/gpu/todo.rst @@ -651,17 +651,6 @@ Contact: Harry Wentland, Alex Deucher -vmwgfx: Replace hashtable with Linux' implementation ----------------------------------------------------- - -The vmwgfx driver uses its own hashtable implementation. Replace the -code with Linux' implementation and update the callers. It's mostly a -refactoring task, but the interfaces are different. - -Contact: Zack Rusin, Thomas Zimmermann - -Level: Intermediate - Bootsplash ========== only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/sphinx/load_config.py +++ linux-oem-6.1-6.1.0/Documentation/sphinx/load_config.py @@ -3,7 +3,7 @@ import os import sys -from sphinx.util.pycompat import execfile_ +from sphinx.util.osutil import fs_encoding # ------------------------------------------------------------------------------ def loadConfig(namespace): @@ -48,7 +48,9 @@ sys.stdout.write("load additional sphinx-config: %s\n" % config_file) config = namespace.copy() config['__file__'] = config_file - execfile_(config_file, config) + with open(config_file, 'rb') as f: + code = compile(f.read(), fs_encoding, 'exec') + exec(code, config) del config['__file__'] namespace.update(config) else: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/virt/kvm/api.rst +++ linux-oem-6.1-6.1.0/Documentation/virt/kvm/api.rst @@ -8248,6 +8248,20 @@ It can be enabled if ``KVM_CAP_TSC_DEADLINE_TIMER`` is present and the kernel has enabled in-kernel emulation of the local APIC. +CPU topology +~~~~~~~~~~~~ + +Several CPUID values include topology information for the host CPU: +0x0b and 0x1f for Intel systems, 0x8000001e for AMD systems. Different +versions of KVM return different values for this information and userspace +should not rely on it. Currently they return all zeroes. + +If userspace wishes to set up a guest topology, it should be careful that +the values of these three leaves differ for each CPU. In particular, +the APIC ID is found in EDX for all subleaves of 0x0b and 0x1f, and in EAX +for 0x8000001e; the latter also encodes the core id and node id in bits +7:0 of EBX and ECX respectively. + Obsolete ioctls and capabilities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/Documentation/x86/amd-memory-encryption.rst +++ linux-oem-6.1-6.1.0/Documentation/x86/amd-memory-encryption.rst @@ -95,3 +95,39 @@ not enable SME, then Linux will not be able to activate memory encryption, even if configured to do so by default or the mem_encrypt=on command line parameter is specified. + +Secure Nested Paging (SNP) +========================== + +SEV-SNP introduces new features (SEV_FEATURES[1:63]) which can be enabled +by the hypervisor for security enhancements. Some of these features need +guest side implementation to function correctly. The below table lists the +expected guest behavior with various possible scenarios of guest/hypervisor +SNP feature support. + ++-----------------+---------------+---------------+------------------+ +| Feature Enabled | Guest needs | Guest has | Guest boot | +| by the HV | implementation| implementation| behaviour | ++=================+===============+===============+==================+ +| No | No | No | Boot | +| | | | | ++-----------------+---------------+---------------+------------------+ +| No | Yes | No | Boot | +| | | | | ++-----------------+---------------+---------------+------------------+ +| No | Yes | Yes | Boot | +| | | | | ++-----------------+---------------+---------------+------------------+ +| Yes | No | No | Boot with | +| | | | feature enabled | ++-----------------+---------------+---------------+------------------+ +| Yes | Yes | No | Graceful boot | +| | | | failure | ++-----------------+---------------+---------------+------------------+ +| Yes | Yes | Yes | Boot with | +| | | | feature enabled | ++-----------------+---------------+---------------+------------------+ + +More details in AMD64 APM[1] Vol 2: 15.34.10 SEV_STATUS MSR + +[1] https://www.amd.com/system/files/TechDocs/40332.pdf only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx53-ppd.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx53-ppd.dts @@ -488,7 +488,7 @@ scl-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; status = "okay"; - i2c-switch@70 { + i2c-mux@70 { compatible = "nxp,pca9547"; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx6qdl-gw560x.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx6qdl-gw560x.dtsi @@ -632,7 +632,6 @@ &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; - uart-has-rtscts; rts-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx6ul-pico-dwarf.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx6ul-pico-dwarf.dts @@ -32,7 +32,7 @@ }; &i2c2 { - clock_frequency = <100000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; status = "okay"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx7d-pico-dwarf.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx7d-pico-dwarf.dts @@ -32,7 +32,7 @@ }; &i2c1 { - clock_frequency = <100000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; @@ -52,7 +52,7 @@ }; &i2c4 { - clock_frequency = <100000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx7d-pico-nymph.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx7d-pico-nymph.dts @@ -43,7 +43,7 @@ }; &i2c1 { - clock_frequency = <100000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; @@ -64,7 +64,7 @@ }; &i2c2 { - clock_frequency = <100000>; + clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; status = "okay"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/imx7d-smegw01.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/imx7d-smegw01.dts @@ -198,6 +198,7 @@ &usbotg2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usbotg2>; + over-current-active-low; dr_mode = "host"; status = "okay"; }; @@ -374,7 +375,7 @@ pinctrl_usbotg2: usbotg2grp { fsl,pins = < - MX7D_PAD_UART3_RTS_B__USB_OTG2_OC 0x04 + MX7D_PAD_UART3_RTS_B__USB_OTG2_OC 0x5c >; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/qcom-apq8084-ifc6540.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/qcom-apq8084-ifc6540.dts @@ -19,16 +19,16 @@ serial@f995e000 { status = "okay"; }; + }; +}; - sdhci@f9824900 { - bus-width = <8>; - non-removable; - status = "okay"; - }; +&sdhc_1 { + bus-width = <8>; + non-removable; + status = "okay"; +}; - sdhci@f98a4900 { - cd-gpios = <&tlmm 122 GPIO_ACTIVE_LOW>; - bus-width = <4>; - }; - }; +&sdhc_2 { + cd-gpios = <&tlmm 122 GPIO_ACTIVE_LOW>; + bus-width = <4>; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/qcom-apq8084.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/qcom-apq8084.dtsi @@ -419,7 +419,7 @@ status = "disabled"; }; - mmc@f9824900 { + sdhc_1: mmc@f9824900 { compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4"; reg = <0xf9824900 0x11c>, <0xf9824000 0x800>; reg-names = "hc", "core"; @@ -432,7 +432,7 @@ status = "disabled"; }; - mmc@f98a4900 { + sdhc_2: mmc@f98a4900 { compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4"; reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>; reg-names = "hc", "core"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/sam9x60.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/sam9x60.dtsi @@ -564,7 +564,7 @@ mpddrc: mpddrc@ffffe800 { compatible = "microchip,sam9x60-ddramc", "atmel,sama5d3-ddramc"; reg = <0xffffe800 0x200>; - clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>; + clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_PERIPHERAL 49>; clock-names = "ddrck", "mpddr"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/stm32mp151a-prtt1l.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/stm32mp151a-prtt1l.dtsi @@ -101,8 +101,12 @@ &qspi { pinctrl-names = "default", "sleep"; - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; + pinctrl-0 = <&qspi_clk_pins_a + &qspi_bk1_pins_a + &qspi_cs1_pins_a>; + pinctrl-1 = <&qspi_clk_sleep_pins_a + &qspi_bk1_sleep_pins_a + &qspi_cs1_sleep_pins_a>; reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi @@ -391,8 +391,12 @@ &qspi { pinctrl-names = "default", "sleep"; - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; + pinctrl-0 = <&qspi_clk_pins_a + &qspi_bk1_pins_a + &qspi_cs1_pins_a>; + pinctrl-1 = <&qspi_clk_sleep_pins_a + &qspi_bk1_sleep_pins_a + &qspi_cs1_sleep_pins_a>; reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi @@ -428,8 +428,12 @@ &qspi { pinctrl-names = "default", "sleep"; - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; + pinctrl-0 = <&qspi_clk_pins_a + &qspi_bk1_pins_a + &qspi_cs1_pins_a>; + pinctrl-1 = <&qspi_clk_sleep_pins_a + &qspi_bk1_sleep_pins_a + &qspi_cs1_sleep_pins_a>; reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi @@ -247,8 +247,12 @@ &qspi { pinctrl-names = "default", "sleep"; - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; + pinctrl-0 = <&qspi_clk_pins_a + &qspi_bk1_pins_a + &qspi_cs1_pins_a>; + pinctrl-1 = <&qspi_clk_sleep_pins_a + &qspi_bk1_sleep_pins_a + &qspi_cs1_sleep_pins_a>; reg = <0x58003000 0x1000>, <0x70000000 0x200000>; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/vf610-zii-dev-rev-b.dts @@ -345,7 +345,7 @@ }; &i2c2 { - tca9548@70 { + i2c-mux@70 { compatible = "nxp,pca9548"; pinctrl-0 = <&pinctrl_i2c_mux_reset>; pinctrl-names = "default"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/boot/dts/vf610-zii-dev-rev-c.dts +++ linux-oem-6.1-6.1.0/arch/arm/boot/dts/vf610-zii-dev-rev-c.dts @@ -340,7 +340,7 @@ }; &i2c2 { - tca9548@70 { + i2c-mux@70 { compatible = "nxp,pca9548"; pinctrl-0 = <&pinctrl_i2c_mux_reset>; pinctrl-names = "default"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-imx/cpu-imx25.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-imx/cpu-imx25.c @@ -23,6 +23,7 @@ np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); rev = readl(iim_base + MXC_IIMSREV); iounmap(iim_base); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-imx/cpu-imx27.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-imx/cpu-imx27.c @@ -28,6 +28,7 @@ np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm"); ccm_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!ccm_base); /* * now we have access to the IO registers. As we need only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-imx/cpu-imx31.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-imx/cpu-imx31.c @@ -39,6 +39,7 @@ np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); /* read SREV register from IIM module */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-imx/cpu-imx35.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-imx/cpu-imx35.c @@ -21,6 +21,7 @@ np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); rev = imx_readl(iim_base + MXC_IIMSREV); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-imx/cpu-imx5.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-imx/cpu-imx5.c @@ -28,6 +28,7 @@ np = of_find_compatible_node(NULL, NULL, compat); iim_base = of_iomap(np, 0); + of_node_put(np); WARN_ON(!iim_base); srev = readl(iim_base + IIM_SREV) & 0xff; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/Kconfig +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/Kconfig @@ -4,6 +4,7 @@ depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 depends on CPU_LITTLE_ENDIAN depends on ATAGS + select ARCH_OMAP select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_OMAP select CLKSRC_MMIO @@ -45,10 +46,6 @@ select CPU_ARM926T select OMAP_DM_TIMER -config ARCH_OMAP1_ANY - select ARCH_OMAP - def_bool ARCH_OMAP730 || ARCH_OMAP850 || ARCH_OMAP15XX || ARCH_OMAP16XX - config ARCH_OMAP bool only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/Makefile +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/Makefile @@ -3,8 +3,6 @@ # Makefile for the linux kernel. # -ifdef CONFIG_ARCH_OMAP1_ANY - # Common support obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ serial.o devices.o dma.o omap-dma.o fb.o @@ -59,5 +57,3 @@ obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o - -endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/gpio15xx.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/gpio15xx.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "irqs.h" only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/io.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/io.c @@ -22,17 +22,14 @@ * The machine specific code may provide the extra mapping besides the * default mapping provided here. */ -static struct map_desc omap_io_desc[] __initdata = { +#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) +static struct map_desc omap7xx_io_desc[] __initdata = { { .virtual = OMAP1_IO_VIRT, .pfn = __phys_to_pfn(OMAP1_IO_PHYS), .length = OMAP1_IO_SIZE, .type = MT_DEVICE - } -}; - -#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) -static struct map_desc omap7xx_io_desc[] __initdata = { + }, { .virtual = OMAP7XX_DSP_BASE, .pfn = __phys_to_pfn(OMAP7XX_DSP_START), @@ -50,6 +47,12 @@ #ifdef CONFIG_ARCH_OMAP15XX static struct map_desc omap1510_io_desc[] __initdata = { { + .virtual = OMAP1_IO_VIRT, + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), + .length = OMAP1_IO_SIZE, + .type = MT_DEVICE + }, + { .virtual = OMAP1510_DSP_BASE, .pfn = __phys_to_pfn(OMAP1510_DSP_START), .length = OMAP1510_DSP_SIZE, @@ -66,6 +69,12 @@ #if defined(CONFIG_ARCH_OMAP16XX) static struct map_desc omap16xx_io_desc[] __initdata = { { + .virtual = OMAP1_IO_VIRT, + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), + .length = OMAP1_IO_SIZE, + .type = MT_DEVICE + }, + { .virtual = OMAP16XX_DSP_BASE, .pfn = __phys_to_pfn(OMAP16XX_DSP_START), .length = OMAP16XX_DSP_SIZE, @@ -79,18 +88,9 @@ }; #endif -/* - * Maps common IO regions for omap1 - */ -static void __init omap1_map_common_io(void) -{ - iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); -} - #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) void __init omap7xx_map_io(void) { - omap1_map_common_io(); iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc)); } #endif @@ -98,7 +98,6 @@ #ifdef CONFIG_ARCH_OMAP15XX void __init omap15xx_map_io(void) { - omap1_map_common_io(); iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); } #endif @@ -106,7 +105,6 @@ #if defined(CONFIG_ARCH_OMAP16XX) void __init omap16xx_map_io(void) { - omap1_map_common_io(); iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc)); } #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/mcbsp.c +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/mcbsp.c @@ -89,7 +89,6 @@ #define OMAP1610_MCBSP2_BASE 0xfffb1000 #define OMAP1610_MCBSP3_BASE 0xe1017000 -#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) struct resource omap7xx_mcbsp_res[][6] = { { { @@ -159,14 +158,7 @@ }; #define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1]) #define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res) -#else -#define omap7xx_mcbsp_res_0 NULL -#define omap7xx_mcbsp_pdata NULL -#define OMAP7XX_MCBSP_RES_SZ 0 -#define OMAP7XX_MCBSP_COUNT 0 -#endif -#ifdef CONFIG_ARCH_OMAP15XX struct resource omap15xx_mcbsp_res[][6] = { { { @@ -266,14 +258,7 @@ }; #define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1]) #define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res) -#else -#define omap15xx_mcbsp_res_0 NULL -#define omap15xx_mcbsp_pdata NULL -#define OMAP15XX_MCBSP_RES_SZ 0 -#define OMAP15XX_MCBSP_COUNT 0 -#endif -#ifdef CONFIG_ARCH_OMAP16XX struct resource omap16xx_mcbsp_res[][6] = { { { @@ -373,12 +358,6 @@ }; #define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1]) #define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res) -#else -#define omap16xx_mcbsp_res_0 NULL -#define omap16xx_mcbsp_pdata NULL -#define OMAP16XX_MCBSP_RES_SZ 0 -#define OMAP16XX_MCBSP_COUNT 0 -#endif static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, struct omap_mcbsp_platform_data *config, int size) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mach-omap1/pm.h +++ linux-oem-6.1-6.1.0/arch/arm/mach-omap1/pm.h @@ -106,13 +106,6 @@ #define OMAP7XX_IDLECT3 0xfffece24 #define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00 -#if !defined(CONFIG_ARCH_OMAP730) && \ - !defined(CONFIG_ARCH_OMAP850) && \ - !defined(CONFIG_ARCH_OMAP15XX) && \ - !defined(CONFIG_ARCH_OMAP16XX) -#warning "Power management for this processor not implemented yet" -#endif - #ifndef __ASSEMBLER__ #include only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm/mm/nommu.c +++ linux-oem-6.1-6.1.0/arch/arm/mm/nommu.c @@ -161,7 +161,7 @@ mpu_setup(); /* allocate the zero page. */ - zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE); + zero_page = (void *)memblock_alloc(PAGE_SIZE, PAGE_SIZE); if (!zero_page) panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, PAGE_SIZE, PAGE_SIZE); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/amlogic/meson-axg.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/amlogic/meson-axg.dtsi @@ -1885,7 +1885,7 @@ sd_emmc_b: sd@5000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0x5000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; clocks = <&clkc CLKID_SD_EMMC_B>, <&clkc CLKID_SD_EMMC_B_CLK0>, @@ -1897,7 +1897,7 @@ sd_emmc_c: mmc@7000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0x7000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; clocks = <&clkc CLKID_SD_EMMC_C>, <&clkc CLKID_SD_EMMC_C_CLK0>, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi @@ -2318,7 +2318,7 @@ sd_emmc_a: sd@ffe03000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0xffe03000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; clocks = <&clkc CLKID_SD_EMMC_A>, <&clkc CLKID_SD_EMMC_A_CLK0>, @@ -2330,7 +2330,7 @@ sd_emmc_b: sd@ffe05000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0xffe05000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; clocks = <&clkc CLKID_SD_EMMC_B>, <&clkc CLKID_SD_EMMC_B_CLK0>, @@ -2342,7 +2342,7 @@ sd_emmc_c: mmc@ffe07000 { compatible = "amlogic,meson-axg-mmc"; reg = <0x0 0xffe07000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; clocks = <&clkc CLKID_SD_EMMC_C>, <&clkc CLKID_SD_EMMC_C_CLK0>, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/amlogic/meson-gx.dtsi @@ -602,21 +602,21 @@ sd_emmc_a: mmc@70000 { compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; reg = <0x0 0x70000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; }; sd_emmc_b: mmc@72000 { compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; reg = <0x0 0x72000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; }; sd_emmc_c: mmc@74000 { compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; reg = <0x0 0x74000 0x0 0x800>; - interrupts = ; + interrupts = ; status = "disabled"; }; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts @@ -110,7 +110,7 @@ &i2c0 { status = "okay"; - pca9547@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts @@ -89,7 +89,7 @@ &i2c0 { status = "okay"; - pca9547@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts @@ -88,7 +88,7 @@ &i2c0 { status = "okay"; - pca9547@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts @@ -53,7 +53,7 @@ &i2c0 { status = "okay"; - i2c-switch@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -136,7 +136,7 @@ &i2c0 { status = "okay"; - i2c-switch@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts @@ -245,7 +245,7 @@ &i2c3 { status = "okay"; - i2c-switch@70 { + i2c-mux@70 { compatible = "nxp,pca9540"; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi @@ -103,7 +103,7 @@ &i2c0 { status = "okay"; - pca9547@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; reg = <0x77>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi @@ -44,7 +44,7 @@ &i2c0 { status = "okay"; - pca9547@75 { + i2c-mux@75 { compatible = "nxp,pca9547"; reg = <0x75>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi @@ -54,7 +54,7 @@ &i2c0 { status = "okay"; - i2c-switch@77 { + i2c-mux@77 { compatible = "nxp,pca9547"; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8dxl.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8dxl.dtsi @@ -157,7 +157,7 @@ sc_pwrkey: keys { compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key"; - linux,keycode = ; + linux,keycodes = ; wakeup-source; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi @@ -120,7 +120,7 @@ &ecspi2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_espi2>; - cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; + cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>; status = "okay"; eeprom@0 { @@ -316,7 +316,7 @@ MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82 MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82 MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82 - MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x41 + MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0x41 >; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts @@ -214,7 +214,7 @@ pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - i2cmux@70 { + i2c-mux@70 { compatible = "nxp,pca9540"; reg = <0x70>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h @@ -602,7 +602,7 @@ #define MX8MM_IOMUXC_UART1_RXD_GPIO5_IO22 0x234 0x49C 0x000 0x5 0x0 #define MX8MM_IOMUXC_UART1_RXD_TPSMP_HDATA24 0x234 0x49C 0x000 0x7 0x0 #define MX8MM_IOMUXC_UART1_TXD_UART1_DCE_TX 0x238 0x4A0 0x000 0x0 0x0 -#define MX8MM_IOMUXC_UART1_TXD_UART1_DTE_RX 0x238 0x4A0 0x4F4 0x0 0x0 +#define MX8MM_IOMUXC_UART1_TXD_UART1_DTE_RX 0x238 0x4A0 0x4F4 0x0 0x1 #define MX8MM_IOMUXC_UART1_TXD_ECSPI3_MOSI 0x238 0x4A0 0x000 0x1 0x0 #define MX8MM_IOMUXC_UART1_TXD_GPIO5_IO23 0x238 0x4A0 0x000 0x5 0x0 #define MX8MM_IOMUXC_UART1_TXD_TPSMP_HDATA25 0x238 0x4A0 0x000 0x7 0x0 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs232-rts.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-rs232-rts.dts @@ -33,7 +33,6 @@ pinctrl-0 = <&pinctrl_uart2>; rts-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio5 28 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dts @@ -33,7 +33,6 @@ pinctrl-0 = <&pinctrl_uart2>; rts-gpios = <&gpio5 29 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio5 28 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi @@ -222,7 +222,6 @@ pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_bten>; cts-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>; rts-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; bluetooth { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7901.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7901.dts @@ -721,7 +721,6 @@ dtr-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; dsr-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; dcd-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; @@ -737,7 +736,6 @@ pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_uart3_gpio>; cts-gpios = <&gpio4 10 GPIO_ACTIVE_LOW>; rts-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; @@ -746,7 +744,6 @@ pinctrl-0 = <&pinctrl_uart4>, <&pinctrl_uart4_gpio>; cts-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>; rts-gpios = <&gpio5 12 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; @@ -759,6 +756,7 @@ &usbotg2 { dr_mode = "host"; vbus-supply = <®_usb2_vbus>; + over-current-active-low; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts @@ -651,7 +651,6 @@ pinctrl-0 = <&pinctrl_uart1>, <&pinctrl_uart1_gpio>; rts-gpios = <&gpio4 10 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; @@ -668,7 +667,6 @@ pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_uart3_gpio>; rts-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; bluetooth { @@ -686,7 +684,6 @@ dtr-gpios = <&gpio4 3 GPIO_ACTIVE_LOW>; dsr-gpios = <&gpio4 4 GPIO_ACTIVE_LOW>; dcd-gpios = <&gpio4 6 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7903.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-venice-gw7903.dts @@ -572,7 +572,6 @@ dtr-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; dsr-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; dcd-gpios = <&gpio3 24 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi @@ -9,6 +9,7 @@ simple-audio-card,bitclock-master = <&dailink_master>; simple-audio-card,format = "i2s"; simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,mclk-fs = <256>; simple-audio-card,name = "imx8mm-wm8904"; simple-audio-card,routing = "Headphone Jack", "HPOUTL", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi @@ -11,6 +11,7 @@ simple-audio-card,bitclock-master = <&dailink_master>; simple-audio-card,format = "i2s"; simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,mclk-fs = <256>; simple-audio-card,name = "imx8mm-nau8822"; simple-audio-card,routing = "Headphones", "LHP", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi @@ -98,6 +98,7 @@ off-on-delay = <500000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_reg_eth>; + regulator-always-on; regulator-boot-on; regulator-max-microvolt = <3300000>; regulator-min-microvolt = <3300000>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts @@ -631,7 +631,6 @@ pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_uart3_gpio>; rts-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; bluetooth { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -36,8 +36,8 @@ pcie0_refclk: pcie0-refclk { compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; + #clock-cells = <0>; + clock-frequency = <100000000>; }; reg_can1_stby: regulator-can1-stby { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi @@ -99,7 +99,6 @@ regulators { buck1: BUCK1 { - regulator-compatible = "BUCK1"; regulator-min-microvolt = <600000>; regulator-max-microvolt = <2187500>; regulator-boot-on; @@ -108,7 +107,6 @@ }; buck2: BUCK2 { - regulator-compatible = "BUCK2"; regulator-min-microvolt = <600000>; regulator-max-microvolt = <2187500>; regulator-boot-on; @@ -119,7 +117,6 @@ }; buck4: BUCK4 { - regulator-compatible = "BUCK4"; regulator-min-microvolt = <600000>; regulator-max-microvolt = <3400000>; regulator-boot-on; @@ -127,7 +124,6 @@ }; buck5: BUCK5 { - regulator-compatible = "BUCK5"; regulator-min-microvolt = <600000>; regulator-max-microvolt = <3400000>; regulator-boot-on; @@ -135,7 +131,6 @@ }; buck6: BUCK6 { - regulator-compatible = "BUCK6"; regulator-min-microvolt = <600000>; regulator-max-microvolt = <3400000>; regulator-boot-on; @@ -143,7 +138,6 @@ }; ldo1: LDO1 { - regulator-compatible = "LDO1"; regulator-min-microvolt = <1600000>; regulator-max-microvolt = <3300000>; regulator-boot-on; @@ -151,7 +145,6 @@ }; ldo2: LDO2 { - regulator-compatible = "LDO2"; regulator-min-microvolt = <800000>; regulator-max-microvolt = <1150000>; regulator-boot-on; @@ -159,7 +152,6 @@ }; ldo3: LDO3 { - regulator-compatible = "LDO3"; regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; regulator-boot-on; @@ -167,13 +159,11 @@ }; ldo4: LDO4 { - regulator-compatible = "LDO4"; regulator-min-microvolt = <800000>; regulator-max-microvolt = <3300000>; }; ldo5: LDO5 { - regulator-compatible = "LDO5"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>; regulator-boot-on; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts @@ -611,7 +611,6 @@ pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_uart3_gpio>; cts-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>; rts-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>; - uart-has-rtscts; status = "okay"; bluetooth { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -523,6 +523,7 @@ compatible = "fsl,imx8mp-gpc"; reg = <0x303a0000 0x1000>; interrupt-parent = <&gic>; + interrupts = ; interrupt-controller; #interrupt-cells = <3>; @@ -589,7 +590,7 @@ reg = ; }; - pgc_hsiomix: power-domains@17 { + pgc_hsiomix: power-domain@17 { #power-domain-cells = <0>; reg = ; clocks = <&clk IMX8MP_CLK_HSIO_AXI>, @@ -1279,7 +1280,7 @@ reg = <0x32f10100 0x8>, <0x381f0000 0x20>; clocks = <&clk IMX8MP_CLK_HSIO_ROOT>, - <&clk IMX8MP_CLK_USB_ROOT>; + <&clk IMX8MP_CLK_USB_SUSP>; clock-names = "hsio", "suspend"; interrupts = ; power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>; @@ -1292,9 +1293,9 @@ usb_dwc3_0: usb@38100000 { compatible = "snps,dwc3"; reg = <0x38100000 0x10000>; - clocks = <&clk IMX8MP_CLK_HSIO_AXI>, + clocks = <&clk IMX8MP_CLK_USB_ROOT>, <&clk IMX8MP_CLK_USB_CORE_REF>, - <&clk IMX8MP_CLK_USB_ROOT>; + <&clk IMX8MP_CLK_USB_SUSP>; clock-names = "bus_early", "ref", "suspend"; interrupts = ; phys = <&usb3_phy0>, <&usb3_phy0>; @@ -1321,7 +1322,7 @@ reg = <0x32f10108 0x8>, <0x382f0000 0x20>; clocks = <&clk IMX8MP_CLK_HSIO_ROOT>, - <&clk IMX8MP_CLK_USB_ROOT>; + <&clk IMX8MP_CLK_USB_SUSP>; clock-names = "hsio", "suspend"; interrupts = ; power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>; @@ -1334,9 +1335,9 @@ usb_dwc3_1: usb@38200000 { compatible = "snps,dwc3"; reg = <0x38200000 0x10000>; - clocks = <&clk IMX8MP_CLK_HSIO_AXI>, + clocks = <&clk IMX8MP_CLK_USB_ROOT>, <&clk IMX8MP_CLK_USB_CORE_REF>, - <&clk IMX8MP_CLK_USB_ROOT>; + <&clk IMX8MP_CLK_USB_SUSP>; clock-names = "bus_early", "ref", "suspend"; interrupts = ; phys = <&usb3_phy1>, <&usb3_phy1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts @@ -133,7 +133,7 @@ pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; - i2cmux@70 { + i2c-mux@70 { compatible = "nxp,pca9546"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1_pca9546>; @@ -216,7 +216,7 @@ pinctrl-0 = <&pinctrl_i2c4>; status = "okay"; - pca9546: i2cmux@70 { + pca9546: i2c-mux@70 { compatible = "nxp,pca9546"; reg = <0x70>; #address-cells = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8mq-thor96.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8mq-thor96.dts @@ -339,7 +339,7 @@ bus-width = <4>; non-removable; no-sd; - no-emmc; + no-mmc; status = "okay"; brcmf: wifi@1 { @@ -359,7 +359,7 @@ cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; bus-width = <4>; no-sdio; - no-emmc; + no-mmc; disable-wp; status = "okay"; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts @@ -61,7 +61,7 @@ pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>; status = "okay"; - i2c-switch@71 { + i2c-mux@71 { compatible = "nxp,pca9646", "nxp,pca9546"; #address-cells = <1>; #size-cells = <0>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts @@ -74,7 +74,7 @@ pinctrl_usdhc1: usdhc1grp { fsl,pins = < - MX93_PAD_SD1_CLK__USDHC1_CLK 0x17fe + MX93_PAD_SD1_CLK__USDHC1_CLK 0x15fe MX93_PAD_SD1_CMD__USDHC1_CMD 0x13fe MX93_PAD_SD1_DATA0__USDHC1_DATA0 0x13fe MX93_PAD_SD1_DATA1__USDHC1_DATA1 0x13fe @@ -84,7 +84,7 @@ MX93_PAD_SD1_DATA5__USDHC1_DATA5 0x13fe MX93_PAD_SD1_DATA6__USDHC1_DATA6 0x13fe MX93_PAD_SD1_DATA7__USDHC1_DATA7 0x13fe - MX93_PAD_SD1_STROBE__USDHC1_STROBE 0x17fe + MX93_PAD_SD1_STROBE__USDHC1_STROBE 0x15fe >; }; @@ -102,7 +102,7 @@ pinctrl_usdhc2: usdhc2grp { fsl,pins = < - MX93_PAD_SD2_CLK__USDHC2_CLK 0x17fe + MX93_PAD_SD2_CLK__USDHC2_CLK 0x15fe MX93_PAD_SD2_CMD__USDHC2_CMD 0x13fe MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x13fe MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x13fe only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi @@ -97,7 +97,7 @@ uart1: serial@12100 { compatible = "snps,dw-apb-uart"; - reg = <0x11000 0x100>; + reg = <0x12100 0x100>; reg-shift = <2>; interrupts = ; reg-io-width = <1>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts @@ -11,6 +11,12 @@ #include #include +/delete-node/ &adsp_mem; +/delete-node/ &audio_mem; +/delete-node/ &mpss_mem; +/delete-node/ &peripheral_region; +/delete-node/ &rmtfs_mem; + / { model = "Xiaomi Mi 4C"; compatible = "xiaomi,libra", "qcom,msm8992"; @@ -70,25 +76,67 @@ #size-cells = <2>; ranges; - /* This is for getting crash logs using Android downstream kernels */ - ramoops@dfc00000 { - compatible = "ramoops"; - reg = <0x0 0xdfc00000 0x0 0x40000>; - console-size = <0x10000>; - record-size = <0x10000>; - ftrace-size = <0x10000>; - pmsg-size = <0x20000>; + memory_hole: hole@6400000 { + reg = <0 0x06400000 0 0x600000>; + no-map; + }; + + memory_hole2: hole2@6c00000 { + reg = <0 0x06c00000 0 0x2400000>; + no-map; + }; + + mpss_mem: mpss@9000000 { + reg = <0 0x09000000 0 0x5a00000>; + no-map; + }; + + tzapp: tzapp@ea00000 { + reg = <0 0x0ea00000 0 0x1900000>; + no-map; + }; + + mdm_rfsa_mem: mdm-rfsa@ca0b0000 { + reg = <0 0xca0b0000 0 0x10000>; + no-map; + }; + + rmtfs_mem: rmtfs@ca100000 { + compatible = "qcom,rmtfs-mem"; + reg = <0 0xca100000 0 0x180000>; + no-map; + + qcom,client-id = <1>; }; - modem_region: modem_region@9000000 { - reg = <0x0 0x9000000 0x0 0x5a00000>; + audio_mem: audio@cb400000 { + reg = <0 0xcb000000 0 0x400000>; + no-mem; + }; + + qseecom_mem: qseecom@cb400000 { + reg = <0 0xcb400000 0 0x1c00000>; + no-mem; + }; + + adsp_rfsa_mem: adsp-rfsa@cd000000 { + reg = <0 0xcd000000 0 0x10000>; no-map; }; - tzapp: modem_region@ea00000 { - reg = <0x0 0xea00000 0x0 0x1900000>; + sensor_rfsa_mem: sensor-rfsa@cd010000 { + reg = <0 0xcd010000 0 0x10000>; no-map; }; + + ramoops@dfc00000 { + compatible = "ramoops"; + reg = <0 0xdfc00000 0 0x40000>; + console-size = <0x10000>; + record-size = <0x10000>; + ftrace-size = <0x10000>; + pmsg-size = <0x20000>; + }; }; }; @@ -130,11 +178,6 @@ status = "okay"; }; -&peripheral_region { - reg = <0x0 0x7400000 0x0 0x1c00000>; - no-map; -}; - &pm8994_spmi_regulators { VDD_APC0: s8 { regulator-min-microvolt = <680000>; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/qcom/msm8992.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/msm8992.dtsi @@ -36,10 +36,6 @@ compatible = "qcom,rpmcc-msm8992", "qcom,rpmcc"; }; -&tcsr_mutex { - compatible = "qcom,sfpb-mutex"; -}; - &timer { interrupts = , , only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts @@ -8,9 +8,6 @@ #include "msm8994.dtsi" -/* Angler's firmware does not report where the memory is allocated */ -/delete-node/ &cont_splash_mem; - / { model = "Huawei Nexus 6P"; compatible = "huawei,angler", "qcom,msm8994"; @@ -27,6 +24,22 @@ chosen { stdout-path = "serial0:115200n8"; }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + tzapp_mem: tzapp@4800000 { + reg = <0 0x04800000 0 0x1900000>; + no-map; + }; + + removed_region: reserved@6300000 { + reg = <0 0x06300000 0 0xD00000>; + no-map; + }; + }; }; &blsp1_uart2 { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -2221,13 +2221,11 @@ pcfg_input_pull_up: pcfg-input-pull-up { input-enable; bias-pull-up; - drive-strength = <2>; }; pcfg_input_pull_down: pcfg-input-pull-down { input-enable; bias-pull-down; - drive-strength = <2>; }; clock { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts +++ linux-oem-6.1-6.1.0/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts @@ -642,7 +642,7 @@ disable-wp; pinctrl-names = "default"; pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; - sd-uhs-sdr104; + sd-uhs-sdr50; vmmc-supply = <&vcc3v3_sd>; vqmmc-supply = <&vccio_sd>; status = "okay"; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/atomic_ll_sc.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/atomic_ll_sc.h @@ -315,7 +315,7 @@ " cbnz %w0, 1b\n" \ " " #mb "\n" \ "2:" \ - : "=&r" (tmp), "=&r" (ret), "+Q" (*(unsigned long *)ptr) \ + : "=&r" (tmp), "=&r" (ret), "+Q" (*(__uint128_t *)ptr) \ : "r" (old1), "r" (old2), "r" (new1), "r" (new2) \ : cl); \ \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/atomic_lse.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/atomic_lse.h @@ -311,7 +311,7 @@ " eor %[old2], %[old2], %[oldval2]\n" \ " orr %[old1], %[old1], %[old2]" \ : [old1] "+&r" (x0), [old2] "+&r" (x1), \ - [v] "+Q" (*(unsigned long *)ptr) \ + [v] "+Q" (*(__uint128_t *)ptr) \ : [new1] "r" (x2), [new2] "r" (x3), [ptr] "r" (x4), \ [oldval1] "r" (oldval1), [oldval2] "r" (oldval2) \ : cl); \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/efi.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/efi.h @@ -14,8 +14,16 @@ #ifdef CONFIG_EFI extern void efi_init(void); + +bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg); #else #define efi_init() + +static inline +bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg) +{ + return false; +} #endif int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); @@ -25,6 +33,7 @@ ({ \ efi_virtmap_load(); \ __efi_fpsimd_begin(); \ + spin_lock(&efi_rt_lock); \ }) #undef arch_efi_call_virt @@ -33,12 +42,23 @@ #define arch_efi_call_virt_teardown() \ ({ \ + spin_unlock(&efi_rt_lock); \ __efi_fpsimd_end(); \ efi_virtmap_unload(); \ }) +extern spinlock_t efi_rt_lock; +extern u64 *efi_rt_stack_top; efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...); +/* + * efi_rt_stack_top[-1] contains the value the stack pointer had before + * switching to the EFI runtime stack. + */ +#define current_in_efi() \ + (!preemptible() && efi_rt_stack_top != NULL && \ + on_task_stack(current, READ_ONCE(efi_rt_stack_top[-1]), 1)) + #define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT) /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/kvm_emulate.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/kvm_emulate.h @@ -373,8 +373,26 @@ static inline bool kvm_is_write_fault(struct kvm_vcpu *vcpu) { - if (kvm_vcpu_abt_iss1tw(vcpu)) - return true; + if (kvm_vcpu_abt_iss1tw(vcpu)) { + /* + * Only a permission fault on a S1PTW should be + * considered as a write. Otherwise, page tables baked + * in a read-only memslot will result in an exception + * being delivered in the guest. + * + * The drawback is that we end-up faulting twice if the + * guest is using any of HW AF/DB: a translation fault + * to map the page containing the PT (read only at + * first), then a permission fault to allow the flags + * to be set. + */ + switch (kvm_vcpu_trap_get_fault_type(vcpu)) { + case ESR_ELx_FSC_PERM: + return true; + default: + return false; + } + } if (kvm_vcpu_trap_is_iabt(vcpu)) return false; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/pgtable.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/pgtable.h @@ -682,7 +682,7 @@ #define pud_leaf(pud) (pud_present(pud) && !pud_table(pud)) #define pud_valid(pud) pte_valid(pud_pte(pud)) #define pud_user(pud) pte_user(pud_pte(pud)) - +#define pud_user_exec(pud) pte_user_exec(pud_pte(pud)) static inline void set_pud(pud_t *pudp, pud_t pud) { @@ -863,12 +863,12 @@ static inline bool pmd_user_accessible_page(pmd_t pmd) { - return pmd_leaf(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); + return pmd_leaf(pmd) && !pmd_present_invalid(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); } static inline bool pud_user_accessible_page(pud_t pud) { - return pud_leaf(pud) && pud_user(pud); + return pud_leaf(pud) && (pud_user(pud) || pud_user_exec(pud)); } #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/include/asm/stacktrace.h +++ linux-oem-6.1-6.1.0/arch/arm64/include/asm/stacktrace.h @@ -104,4 +104,19 @@ #define stackinfo_get_sdei_critical() stackinfo_get_unknown() #endif +#ifdef CONFIG_EFI +extern u64 *efi_rt_stack_top; + +static inline struct stack_info stackinfo_get_efi(void) +{ + unsigned long high = (u64)efi_rt_stack_top; + unsigned long low = high - THREAD_SIZE; + + return (struct stack_info) { + .low = low, + .high = high, + }; +} +#endif + #endif /* __ASM_STACKTRACE_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kernel/efi-rt-wrapper.S +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/efi-rt-wrapper.S @@ -4,9 +4,10 @@ */ #include +#include SYM_FUNC_START(__efi_rt_asm_wrapper) - stp x29, x30, [sp, #-32]! + stp x29, x30, [sp, #-112]! mov x29, sp /* @@ -17,6 +18,22 @@ stp x1, x18, [sp, #16] /* + * Preserve all callee saved registers and preserve the stack pointer + * value at the base of the EFI runtime stack so we can recover from + * synchronous exceptions occurring while executing the firmware + * routines. + */ + stp x19, x20, [sp, #32] + stp x21, x22, [sp, #48] + stp x23, x24, [sp, #64] + stp x25, x26, [sp, #80] + stp x27, x28, [sp, #96] + + ldr_l x16, efi_rt_stack_top + mov sp, x16 + stp x18, x29, [sp, #-16]! + + /* * We are lucky enough that no EFI runtime services take more than * 5 arguments, so all are passed in registers rather than via the * stack. @@ -29,9 +46,13 @@ mov x4, x6 blr x8 + mov x16, sp + mov sp, x29 + str xzr, [x16, #8] // clear recorded task SP value + ldp x1, x2, [sp, #16] cmp x2, x18 - ldp x29, x30, [sp], #32 + ldp x29, x30, [sp], #112 b.ne 0f ret 0: @@ -42,6 +63,25 @@ * called with preemption disabled and a separate shadow stack is used * for interrupts. */ - mov x18, x2 +#ifdef CONFIG_SHADOW_CALL_STACK + ldr_l x18, efi_rt_stack_top + ldr x18, [x18, #-16] +#endif + b efi_handle_corrupted_x18 // tail call SYM_FUNC_END(__efi_rt_asm_wrapper) + +SYM_CODE_START(__efi_rt_asm_recover) + mov sp, x30 + + ldr_l x16, efi_rt_stack_top // clear recorded task SP value + str xzr, [x16, #-8] + + ldp x19, x20, [sp, #32] + ldp x21, x22, [sp, #48] + ldp x23, x24, [sp, #64] + ldp x25, x26, [sp, #80] + ldp x27, x28, [sp, #96] + ldp x29, x30, [sp], #112 + ret +SYM_CODE_END(__efi_rt_asm_recover) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kernel/efi.c +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/efi.c @@ -11,6 +11,7 @@ #include #include +#include static bool region_is_misaligned(const efi_memory_desc_t *md) { @@ -144,3 +145,52 @@ pr_err_ratelimited(FW_BUG "register x18 corrupted by EFI %s\n", f); return s; } + +DEFINE_SPINLOCK(efi_rt_lock); + +asmlinkage u64 *efi_rt_stack_top __ro_after_init; + +asmlinkage efi_status_t __efi_rt_asm_recover(void); + +bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg) +{ + /* Check whether the exception occurred while running the firmware */ + if (!current_in_efi() || regs->pc >= TASK_SIZE_64) + return false; + + pr_err(FW_BUG "Unable to handle %s in EFI runtime service\n", msg); + add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); + clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); + + regs->regs[0] = EFI_ABORTED; + regs->regs[30] = efi_rt_stack_top[-1]; + regs->pc = (u64)__efi_rt_asm_recover; + + if (IS_ENABLED(CONFIG_SHADOW_CALL_STACK)) + regs->regs[18] = efi_rt_stack_top[-2]; + + return true; +} + +/* EFI requires 8 KiB of stack space for runtime services */ +static_assert(THREAD_SIZE >= SZ_8K); + +static int __init arm64_efi_rt_init(void) +{ + void *p; + + if (!efi_enabled(EFI_RUNTIME_SERVICES)) + return 0; + + p = __vmalloc_node(THREAD_SIZE, THREAD_ALIGN, GFP_KERNEL, + NUMA_NO_NODE, &&l); +l: if (!p) { + pr_warn("Failed to allocate EFI runtime stack\n"); + clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); + return -ENOMEM; + } + + efi_rt_stack_top = p + THREAD_SIZE; + return 0; +} +core_initcall(arm64_efi_rt_init); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kernel/elfcore.c +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/elfcore.c @@ -8,28 +8,27 @@ #include #include -#define for_each_mte_vma(vmi, vma) \ +#define for_each_mte_vma(cprm, i, m) \ if (system_supports_mte()) \ - for_each_vma(vmi, vma) \ - if (vma->vm_flags & VM_MTE) + for (i = 0, m = cprm->vma_meta; \ + i < cprm->vma_count; \ + i++, m = cprm->vma_meta + i) \ + if (m->flags & VM_MTE) -static unsigned long mte_vma_tag_dump_size(struct vm_area_struct *vma) +static unsigned long mte_vma_tag_dump_size(struct core_vma_metadata *m) { - if (vma->vm_flags & VM_DONTDUMP) - return 0; - - return vma_pages(vma) * MTE_PAGE_TAG_STORAGE; + return (m->dump_size >> PAGE_SHIFT) * MTE_PAGE_TAG_STORAGE; } /* Derived from dump_user_range(); start/end must be page-aligned */ static int mte_dump_tag_range(struct coredump_params *cprm, - unsigned long start, unsigned long end) + unsigned long start, unsigned long len) { int ret = 1; unsigned long addr; void *tags = NULL; - for (addr = start; addr < end; addr += PAGE_SIZE) { + for (addr = start; addr < start + len; addr += PAGE_SIZE) { struct page *page = get_dump_page(addr); /* @@ -65,7 +64,6 @@ mte_save_page_tags(page_address(page), tags); put_page(page); if (!dump_emit(cprm, tags, MTE_PAGE_TAG_STORAGE)) { - mte_free_tag_storage(tags); ret = 0; break; } @@ -77,13 +75,13 @@ return ret; } -Elf_Half elf_core_extra_phdrs(void) +Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm) { - struct vm_area_struct *vma; + int i; + struct core_vma_metadata *m; int vma_count = 0; - VMA_ITERATOR(vmi, current->mm, 0); - for_each_mte_vma(vmi, vma) + for_each_mte_vma(cprm, i, m) vma_count++; return vma_count; @@ -91,18 +89,18 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) { - struct vm_area_struct *vma; - VMA_ITERATOR(vmi, current->mm, 0); + int i; + struct core_vma_metadata *m; - for_each_mte_vma(vmi, vma) { + for_each_mte_vma(cprm, i, m) { struct elf_phdr phdr; phdr.p_type = PT_AARCH64_MEMTAG_MTE; phdr.p_offset = offset; - phdr.p_vaddr = vma->vm_start; + phdr.p_vaddr = m->start; phdr.p_paddr = 0; - phdr.p_filesz = mte_vma_tag_dump_size(vma); - phdr.p_memsz = vma->vm_end - vma->vm_start; + phdr.p_filesz = mte_vma_tag_dump_size(m); + phdr.p_memsz = m->end - m->start; offset += phdr.p_filesz; phdr.p_flags = 0; phdr.p_align = 0; @@ -114,28 +112,25 @@ return 1; } -size_t elf_core_extra_data_size(void) +size_t elf_core_extra_data_size(struct coredump_params *cprm) { - struct vm_area_struct *vma; + int i; + struct core_vma_metadata *m; size_t data_size = 0; - VMA_ITERATOR(vmi, current->mm, 0); - for_each_mte_vma(vmi, vma) - data_size += mte_vma_tag_dump_size(vma); + for_each_mte_vma(cprm, i, m) + data_size += mte_vma_tag_dump_size(m); return data_size; } int elf_core_write_extra_data(struct coredump_params *cprm) { - struct vm_area_struct *vma; - VMA_ITERATOR(vmi, current->mm, 0); - - for_each_mte_vma(vmi, vma) { - if (vma->vm_flags & VM_DONTDUMP) - continue; + int i; + struct core_vma_metadata *m; - if (!mte_dump_tag_range(cprm, vma->vm_start, vma->vm_end)) + for_each_mte_vma(cprm, i, m) { + if (!mte_dump_tag_range(cprm, m->start, m->dump_size)) return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kernel/ptrace.c +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/ptrace.c @@ -1364,7 +1364,7 @@ #ifdef CONFIG_ARM64_SVE REGSET_SVE, #endif -#ifdef CONFIG_ARM64_SVE +#ifdef CONFIG_ARM64_SME REGSET_SSVE, REGSET_ZA, #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kernel/signal.c +++ linux-oem-6.1-6.1.0/arch/arm64/kernel/signal.c @@ -280,7 +280,12 @@ vl = task_get_sme_vl(current); } else { - if (!system_supports_sve()) + /* + * A SME only system use SVE for streaming mode so can + * have a SVE formatted context with a zero VL and no + * payload data. + */ + if (!system_supports_sve() && !system_supports_sme()) return -EINVAL; vl = task_get_sve_vl(current); @@ -729,7 +734,7 @@ return err; } - if (system_supports_sve()) { + if (system_supports_sve() || system_supports_sme()) { unsigned int vq = 0; if (add_all || test_thread_flag(TIF_SVE) || only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kvm/vgic/vgic-v3.c +++ linux-oem-6.1-6.1.0/arch/arm64/kvm/vgic/vgic-v3.c @@ -350,26 +350,23 @@ * The deactivation of the doorbell interrupt will trigger the * unmapping of the associated vPE. */ -static void unmap_all_vpes(struct vgic_dist *dist) +static void unmap_all_vpes(struct kvm *kvm) { - struct irq_desc *desc; + struct vgic_dist *dist = &kvm->arch.vgic; int i; - for (i = 0; i < dist->its_vm.nr_vpes; i++) { - desc = irq_to_desc(dist->its_vm.vpes[i]->irq); - irq_domain_deactivate_irq(irq_desc_get_irq_data(desc)); - } + for (i = 0; i < dist->its_vm.nr_vpes; i++) + free_irq(dist->its_vm.vpes[i]->irq, kvm_get_vcpu(kvm, i)); } -static void map_all_vpes(struct vgic_dist *dist) +static void map_all_vpes(struct kvm *kvm) { - struct irq_desc *desc; + struct vgic_dist *dist = &kvm->arch.vgic; int i; - for (i = 0; i < dist->its_vm.nr_vpes; i++) { - desc = irq_to_desc(dist->its_vm.vpes[i]->irq); - irq_domain_activate_irq(irq_desc_get_irq_data(desc), false); - } + for (i = 0; i < dist->its_vm.nr_vpes; i++) + WARN_ON(vgic_v4_request_vpe_irq(kvm_get_vcpu(kvm, i), + dist->its_vm.vpes[i]->irq)); } /** @@ -394,7 +391,7 @@ * and enabling of the doorbells have already been done. */ if (kvm_vgic_global_state.has_gicv4_1) { - unmap_all_vpes(dist); + unmap_all_vpes(kvm); vlpi_avail = true; } @@ -444,7 +441,7 @@ out: if (vlpi_avail) - map_all_vpes(dist); + map_all_vpes(kvm); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kvm/vgic/vgic-v4.c +++ linux-oem-6.1-6.1.0/arch/arm64/kvm/vgic/vgic-v4.c @@ -222,6 +222,11 @@ *val = !!(*ptr & mask); } +int vgic_v4_request_vpe_irq(struct kvm_vcpu *vcpu, int irq) +{ + return request_irq(irq, vgic_v4_doorbell_handler, 0, "vcpu", vcpu); +} + /** * vgic_v4_init - Initialize the GICv4 data structures * @kvm: Pointer to the VM being initialized @@ -283,8 +288,7 @@ irq_flags &= ~IRQ_NOAUTOEN; irq_set_status_flags(irq, irq_flags); - ret = request_irq(irq, vgic_v4_doorbell_handler, - 0, "vcpu", vcpu); + ret = vgic_v4_request_vpe_irq(vcpu, irq); if (ret) { kvm_err("failed to allocate vcpu IRQ%d\n", irq); /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/arm64/kvm/vgic/vgic.h +++ linux-oem-6.1-6.1.0/arch/arm64/kvm/vgic/vgic.h @@ -331,5 +331,6 @@ void vgic_v4_teardown(struct kvm *kvm); void vgic_v4_configure_vsgis(struct kvm *kvm); void vgic_v4_get_vlpi_state(struct vgic_irq *irq, bool *val); +int vgic_v4_request_vpe_irq(struct kvm_vcpu *vcpu, int irq); #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/ia64/kernel/elfcore.c +++ linux-oem-6.1-6.1.0/arch/ia64/kernel/elfcore.c @@ -7,7 +7,7 @@ #include -Elf64_Half elf_core_extra_phdrs(void) +Elf64_Half elf_core_extra_phdrs(struct coredump_params *cprm) { return GATE_EHDR->e_phnum; } @@ -60,7 +60,7 @@ return 1; } -size_t elf_core_extra_data_size(void) +size_t elf_core_extra_data_size(struct coredump_params *cprm) { const struct elf_phdr *const gate_phdrs = (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/ia64/kernel/sys_ia64.c +++ linux-oem-6.1-6.1.0/arch/ia64/kernel/sys_ia64.c @@ -170,6 +170,9 @@ asmlinkage long ia64_clock_getres(const clockid_t which_clock, struct __kernel_timespec __user *tp) { + struct timespec64 rtn_tp; + s64 tick_ns; + /* * ia64's clock_gettime() syscall is implemented as a vdso call * fsys_clock_gettime(). Currently it handles only @@ -185,8 +188,8 @@ switch (which_clock) { case CLOCK_REALTIME: case CLOCK_MONOTONIC: - s64 tick_ns = DIV_ROUND_UP(NSEC_PER_SEC, local_cpu_data->itc_freq); - struct timespec64 rtn_tp = ns_to_timespec64(tick_ns); + tick_ns = DIV_ROUND_UP(NSEC_PER_SEC, local_cpu_data->itc_freq); + rtn_tp = ns_to_timespec64(tick_ns); return put_timespec64(&rtn_tp, tp); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/loongarch/kernel/cpu-probe.c +++ linux-oem-6.1-6.1.0/arch/loongarch/kernel/cpu-probe.c @@ -94,7 +94,7 @@ c->options = LOONGARCH_CPU_CPUCFG | LOONGARCH_CPU_CSR | LOONGARCH_CPU_TLB | LOONGARCH_CPU_VINT | LOONGARCH_CPU_WATCH; - elf_hwcap |= HWCAP_LOONGARCH_CRC32; + elf_hwcap = HWCAP_LOONGARCH_CPUCFG | HWCAP_LOONGARCH_CRC32; config = read_cpucfg(LOONGARCH_CPUCFG1); if (config & CPUCFG1_UAL) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/loongarch/kernel/process.c +++ linux-oem-6.1-6.1.0/arch/loongarch/kernel/process.c @@ -185,20 +185,14 @@ unsigned long __get_wchan(struct task_struct *task) { - unsigned long pc; + unsigned long pc = 0; struct unwind_state state; if (!try_get_task_stack(task)) return 0; - unwind_start(&state, task, NULL); - state.sp = thread_saved_fp(task); - get_stack_info(state.sp, state.task, &state.stack_info); - state.pc = thread_saved_ra(task); -#ifdef CONFIG_UNWINDER_PROLOGUE - state.type = UNWINDER_PROLOGUE; -#endif - for (; !unwind_done(&state); unwind_next_frame(&state)) { + for (unwind_start(&state, task, NULL); + !unwind_done(&state); unwind_next_frame(&state)) { pc = unwind_get_return_address(&state); if (!pc) break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/loongarch/kernel/unwind_guess.c +++ linux-oem-6.1-6.1.0/arch/loongarch/kernel/unwind_guess.c @@ -25,6 +25,12 @@ if (regs) { state->sp = regs->regs[3]; state->pc = regs->csr_era; + } else if (task && task != current) { + state->sp = thread_saved_fp(task); + state->pc = thread_saved_ra(task); + } else { + state->sp = (unsigned long)__builtin_frame_address(0); + state->pc = (unsigned long)__builtin_return_address(0); } state->task = task; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/loongarch/kernel/unwind_prologue.c +++ linux-oem-6.1-6.1.0/arch/loongarch/kernel/unwind_prologue.c @@ -111,12 +111,22 @@ struct pt_regs *regs) { memset(state, 0, sizeof(*state)); + state->type = UNWINDER_PROLOGUE; - if (regs && __kernel_text_address(regs->csr_era)) { - state->pc = regs->csr_era; + if (regs) { state->sp = regs->regs[3]; + state->pc = regs->csr_era; state->ra = regs->regs[1]; - state->type = UNWINDER_PROLOGUE; + if (!__kernel_text_address(state->pc)) + state->type = UNWINDER_GUESS; + } else if (task && task != current) { + state->sp = thread_saved_fp(task); + state->pc = thread_saved_ra(task); + state->ra = 0; + } else { + state->sp = (unsigned long)__builtin_frame_address(0); + state->pc = (unsigned long)__builtin_return_address(0); + state->ra = 0; } state->task = task; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/parisc/kernel/ptrace.c +++ linux-oem-6.1-6.1.0/arch/parisc/kernel/ptrace.c @@ -126,6 +126,12 @@ unsigned long tmp; long ret = -EIO; + unsigned long user_regs_struct_size = sizeof(struct user_regs_struct); +#ifdef CONFIG_64BIT + if (is_compat_task()) + user_regs_struct_size /= 2; +#endif + switch (request) { /* Read the word at location addr in the USER area. For ptraced @@ -166,7 +172,7 @@ addr >= sizeof(struct pt_regs)) break; if (addr == PT_IAOQ0 || addr == PT_IAOQ1) { - data |= 3; /* ensure userspace privilege */ + data |= PRIV_USER; /* ensure userspace privilege */ } if ((addr >= PT_GR1 && addr <= PT_GR31) || addr == PT_IAOQ0 || addr == PT_IAOQ1 || @@ -181,14 +187,14 @@ return copy_regset_to_user(child, task_user_regset_view(current), REGSET_GENERAL, - 0, sizeof(struct user_regs_struct), + 0, user_regs_struct_size, datap); case PTRACE_SETREGS: /* Set all gp regs in the child. */ return copy_regset_from_user(child, task_user_regset_view(current), REGSET_GENERAL, - 0, sizeof(struct user_regs_struct), + 0, user_regs_struct_size, datap); case PTRACE_GETFPREGS: /* Get the child FPU state. */ @@ -285,7 +291,7 @@ if (addr >= sizeof(struct pt_regs)) break; if (addr == PT_IAOQ0+4 || addr == PT_IAOQ1+4) { - data |= 3; /* ensure userspace privilege */ + data |= PRIV_USER; /* ensure userspace privilege */ } if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { /* Special case, fp regs are 64 bits anyway */ @@ -302,6 +308,11 @@ } } break; + case PTRACE_GETREGS: + case PTRACE_SETREGS: + case PTRACE_GETFPREGS: + case PTRACE_SETFPREGS: + return arch_ptrace(child, request, addr, data); default: ret = compat_ptrace_request(child, request, addr, data); @@ -483,7 +494,7 @@ case RI(iaoq[0]): case RI(iaoq[1]): /* set 2 lowest bits to ensure userspace privilege: */ - regs->iaoq[num - RI(iaoq[0])] = val | 3; + regs->iaoq[num - RI(iaoq[0])] = val | PRIV_USER; return; case RI(sar): regs->sar = val; return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi +++ linux-oem-6.1-6.1.0/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later +/* + * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset 0x400000 ] + * + * Copyright 2022 Sean Anderson + * Copyright 2012 - 2015 Freescale Semiconductor Inc. + */ + +fman@400000 { + fman0_rx_0x08: port@88000 { + cell-index = <0x8>; + compatible = "fsl,fman-v3-port-rx"; + reg = <0x88000 0x1000>; + fsl,fman-10g-port; + }; + + fman0_tx_0x28: port@a8000 { + cell-index = <0x28>; + compatible = "fsl,fman-v3-port-tx"; + reg = <0xa8000 0x1000>; + fsl,fman-10g-port; + }; + + ethernet@e0000 { + cell-index = <0>; + compatible = "fsl,fman-memac"; + reg = <0xe0000 0x1000>; + fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>; + ptp-timer = <&ptp_timer0>; + pcsphy-handle = <&pcsphy0>; + }; + + mdio@e1000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe1000 0x1000>; + fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy0: ethernet-phy@0 { + reg = <0x0>; + }; + }; +}; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi +++ linux-oem-6.1-6.1.0/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later +/* + * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset 0x400000 ] + * + * Copyright 2022 Sean Anderson + * Copyright 2012 - 2015 Freescale Semiconductor Inc. + */ + +fman@400000 { + fman0_rx_0x09: port@89000 { + cell-index = <0x9>; + compatible = "fsl,fman-v3-port-rx"; + reg = <0x89000 0x1000>; + fsl,fman-10g-port; + }; + + fman0_tx_0x29: port@a9000 { + cell-index = <0x29>; + compatible = "fsl,fman-v3-port-tx"; + reg = <0xa9000 0x1000>; + fsl,fman-10g-port; + }; + + ethernet@e2000 { + cell-index = <1>; + compatible = "fsl,fman-memac"; + reg = <0xe2000 0x1000>; + fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>; + ptp-timer = <&ptp_timer0>; + pcsphy-handle = <&pcsphy1>; + }; + + mdio@e3000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe3000 0x1000>; + fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy1: ethernet-phy@0 { + reg = <0x0>; + }; + }; +}; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi +++ linux-oem-6.1-6.1.0/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi @@ -609,8 +609,8 @@ /include/ "qoriq-bman1.dtsi" /include/ "qoriq-fman3-0.dtsi" -/include/ "qoriq-fman3-0-1g-0.dtsi" -/include/ "qoriq-fman3-0-1g-1.dtsi" +/include/ "qoriq-fman3-0-10g-2.dtsi" +/include/ "qoriq-fman3-0-10g-3.dtsi" /include/ "qoriq-fman3-0-1g-2.dtsi" /include/ "qoriq-fman3-0-1g-3.dtsi" /include/ "qoriq-fman3-0-1g-4.dtsi" @@ -659,3 +659,19 @@ interrupts = <16 2 1 9>; }; }; + +&fman0_rx_0x08 { + /delete-property/ fsl,fman-10g-port; +}; + +&fman0_tx_0x28 { + /delete-property/ fsl,fman-10g-port; +}; + +&fman0_rx_0x09 { + /delete-property/ fsl,fman-10g-port; +}; + +&fman0_tx_0x29 { + /delete-property/ fsl,fman-10g-port; +}; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/include/asm/hw_irq.h +++ linux-oem-6.1-6.1.0/arch/powerpc/include/asm/hw_irq.h @@ -173,6 +173,15 @@ return flags; } +static inline notrace unsigned long irq_soft_mask_andc_return(unsigned long mask) +{ + unsigned long flags = irq_soft_mask_return(); + + irq_soft_mask_set(flags & ~mask); + + return flags; +} + static inline unsigned long arch_local_save_flags(void) { return irq_soft_mask_return(); @@ -192,7 +201,7 @@ static inline unsigned long arch_local_irq_save(void) { - return irq_soft_mask_set_return(IRQS_DISABLED); + return irq_soft_mask_or_return(IRQS_DISABLED); } static inline bool arch_irqs_disabled_flags(unsigned long flags) @@ -331,10 +340,11 @@ * is a different soft-masked interrupt pending that requires hard * masking. */ -static inline bool should_hard_irq_enable(void) +static inline bool should_hard_irq_enable(struct pt_regs *regs) { if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) { - WARN_ON(irq_soft_mask_return() == IRQS_ENABLED); + WARN_ON(irq_soft_mask_return() != IRQS_ALL_DISABLED); + WARN_ON(!(get_paca()->irq_happened & PACA_IRQ_HARD_DIS)); WARN_ON(mfmsr() & MSR_EE); } @@ -347,8 +357,17 @@ * * TODO: Add test for 64e */ - if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && !power_pmu_wants_prompt_pmi()) - return false; + if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) { + if (!power_pmu_wants_prompt_pmi()) + return false; + /* + * If PMIs are disabled then IRQs should be disabled as well, + * so we shouldn't see this condition, check for it just in + * case because we are about to enable PMIs. + */ + if (WARN_ON_ONCE(regs->softe & IRQS_PMI_DISABLED)) + return false; + } if (get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK) return false; @@ -358,18 +377,16 @@ /* * Do the hard enabling, only call this if should_hard_irq_enable is true. + * This allows PMI interrupts to profile irq handlers. */ static inline void do_hard_irq_enable(void) { - if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG)) { - WARN_ON(irq_soft_mask_return() == IRQS_ENABLED); - WARN_ON(get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK); - WARN_ON(mfmsr() & MSR_EE); - } /* - * This allows PMI interrupts (and watchdog soft-NMIs) through. - * There is no other reason to enable this way. + * Asynch interrupts come in with IRQS_ALL_DISABLED, + * PACA_IRQ_HARD_DIS, and MSR[EE]=0. */ + if (IS_ENABLED(CONFIG_PPC_BOOK3S_64)) + irq_soft_mask_andc_return(IRQS_PMI_DISABLED); get_paca()->irq_happened &= ~PACA_IRQ_HARD_DIS; __hard_irq_enable(); } @@ -452,7 +469,7 @@ return !(regs->msr & MSR_EE); } -static __always_inline bool should_hard_irq_enable(void) +static __always_inline bool should_hard_irq_enable(struct pt_regs *regs) { return false; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/include/asm/imc-pmu.h +++ linux-oem-6.1-6.1.0/arch/powerpc/include/asm/imc-pmu.h @@ -137,7 +137,7 @@ * are inited. */ struct imc_pmu_ref { - struct mutex lock; + spinlock_t lock; unsigned int id; int refc; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/kernel/dbell.c +++ linux-oem-6.1-6.1.0/arch/powerpc/kernel/dbell.c @@ -27,7 +27,7 @@ ppc_msgsync(); - if (should_hard_irq_enable()) + if (should_hard_irq_enable(regs)) do_hard_irq_enable(); kvmppc_clear_host_ipi(smp_processor_id()); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/kernel/interrupt.c +++ linux-oem-6.1-6.1.0/arch/powerpc/kernel/interrupt.c @@ -50,16 +50,18 @@ */ static notrace __always_inline bool prep_irq_for_enabled_exit(bool restartable) { + bool must_hard_disable = (exit_must_hard_disable() || !restartable); + /* This must be done with RI=1 because tracing may touch vmaps */ trace_hardirqs_on(); - if (exit_must_hard_disable() || !restartable) + if (must_hard_disable) __hard_EE_RI_disable(); #ifdef CONFIG_PPC64 /* This pattern matches prep_irq_for_idle */ if (unlikely(lazy_irq_pending_nocheck())) { - if (exit_must_hard_disable() || !restartable) { + if (must_hard_disable) { local_paca->irq_happened |= PACA_IRQ_HARD_DIS; __hard_RI_enable(); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/kernel/irq.c +++ linux-oem-6.1-6.1.0/arch/powerpc/kernel/irq.c @@ -238,7 +238,7 @@ irq = static_call(ppc_get_irq)(); /* We can hard enable interrupts now to allow perf interrupts */ - if (should_hard_irq_enable()) + if (should_hard_irq_enable(regs)) do_hard_irq_enable(); /* And finally process it */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/kernel/time.c +++ linux-oem-6.1-6.1.0/arch/powerpc/kernel/time.c @@ -533,7 +533,7 @@ } /* Conditionally hard-enable interrupts. */ - if (should_hard_irq_enable()) { + if (should_hard_irq_enable(regs)) { /* * Ensure a positive value is written to the decrementer, or * else some CPUs will continue to take decrementer exceptions. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/kernel/vmlinux.lds.S +++ linux-oem-6.1-6.1.0/arch/powerpc/kernel/vmlinux.lds.S @@ -8,6 +8,7 @@ #define BSS_FIRST_SECTIONS *(.bss.prominit) #define EMITS_PT_NOTE #define RO_EXCEPTION_TABLE_ALIGN 0 +#define RUNTIME_DISCARD_EXIT #define SOFT_MASK_TABLE(align) \ . = ALIGN(align); \ @@ -410,9 +411,12 @@ DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) - *(.glink .iplt .plt .rela* .comment) + *(.glink .iplt .plt .comment) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) +#ifndef CONFIG_RELOCATABLE + *(.rela*) +#endif } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/mm/book3s64/radix_pgtable.c +++ linux-oem-6.1-6.1.0/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -234,6 +234,14 @@ end = (unsigned long)__end_rodata; radix__change_memory_range(start, end, _PAGE_WRITE); + + for (start = PAGE_OFFSET; start < (unsigned long)_stext; start += PAGE_SIZE) { + end = start + PAGE_SIZE; + if (overlaps_interrupt_vector_text(start, end)) + radix__change_memory_range(start, end, _PAGE_WRITE); + else + break; + } } void radix__mark_initmem_nx(void) @@ -262,6 +270,22 @@ static unsigned long next_boundary(unsigned long addr, unsigned long end) { #ifdef CONFIG_STRICT_KERNEL_RWX + unsigned long stext_phys; + + stext_phys = __pa_symbol(_stext); + + // Relocatable kernel running at non-zero real address + if (stext_phys != 0) { + // The end of interrupts code at zero is a rodata boundary + unsigned long end_intr = __pa_symbol(__end_interrupts) - stext_phys; + if (addr < end_intr) + return end_intr; + + // Start of relocated kernel text is a rodata boundary + if (addr < stext_phys) + return stext_phys; + } + if (addr < __pa_symbol(__srwx_boundary)) return __pa_symbol(__srwx_boundary); #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/powerpc/perf/imc-pmu.c +++ linux-oem-6.1-6.1.0/arch/powerpc/perf/imc-pmu.c @@ -14,6 +14,7 @@ #include #include #include +#include /* Nest IMC data structures and variables */ @@ -50,7 +51,7 @@ * core and trace-imc */ static struct imc_pmu_ref imc_global_refc = { - .lock = __MUTEX_INITIALIZER(imc_global_refc.lock), + .lock = __SPIN_LOCK_INITIALIZER(imc_global_refc.lock), .id = 0, .refc = 0, }; @@ -400,7 +401,7 @@ get_hard_smp_processor_id(cpu)); /* * If this is the last cpu in this chip then, skip the reference - * count mutex lock and make the reference count on this chip zero. + * count lock and make the reference count on this chip zero. */ ref = get_nest_pmu_ref(cpu); if (!ref) @@ -462,15 +463,15 @@ /* * See if we need to disable the nest PMU. * If no events are currently in use, then we have to take a - * mutex to ensure that we don't race with another task doing + * lock to ensure that we don't race with another task doing * enable or disable the nest counters. */ ref = get_nest_pmu_ref(event->cpu); if (!ref) return; - /* Take the mutex lock for this node and then decrement the reference count */ - mutex_lock(&ref->lock); + /* Take the lock for this node and then decrement the reference count */ + spin_lock(&ref->lock); if (ref->refc == 0) { /* * The scenario where this is true is, when perf session is @@ -482,7 +483,7 @@ * an OPAL call to disable the engine in that node. * */ - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); return; } ref->refc--; @@ -490,7 +491,7 @@ rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST, get_hard_smp_processor_id(event->cpu)); if (rc) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("nest-imc: Unable to stop the counters for core %d\n", node_id); return; } @@ -498,7 +499,7 @@ WARN(1, "nest-imc: Invalid event reference count\n"); ref->refc = 0; } - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); } static int nest_imc_event_init(struct perf_event *event) @@ -557,26 +558,25 @@ /* * Get the imc_pmu_ref struct for this node. - * Take the mutex lock and then increment the count of nest pmu events - * inited. + * Take the lock and then increment the count of nest pmu events inited. */ ref = get_nest_pmu_ref(event->cpu); if (!ref) return -EINVAL; - mutex_lock(&ref->lock); + spin_lock(&ref->lock); if (ref->refc == 0) { rc = opal_imc_counters_start(OPAL_IMC_COUNTERS_NEST, get_hard_smp_processor_id(event->cpu)); if (rc) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("nest-imc: Unable to start the counters for node %d\n", node_id); return rc; } } ++ref->refc; - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); event->destroy = nest_imc_counters_release; return 0; @@ -612,9 +612,8 @@ return -ENOMEM; mem_info->vbase = page_address(page); - /* Init the mutex */ core_imc_refc[core_id].id = core_id; - mutex_init(&core_imc_refc[core_id].lock); + spin_lock_init(&core_imc_refc[core_id].lock); rc = opal_imc_counters_init(OPAL_IMC_COUNTERS_CORE, __pa((void *)mem_info->vbase), @@ -703,9 +702,8 @@ perf_pmu_migrate_context(&core_imc_pmu->pmu, cpu, ncpu); } else { /* - * If this is the last cpu in this core then, skip taking refernce - * count mutex lock for this core and directly zero "refc" for - * this core. + * If this is the last cpu in this core then skip taking reference + * count lock for this core and directly zero "refc" for this core. */ opal_imc_counters_stop(OPAL_IMC_COUNTERS_CORE, get_hard_smp_processor_id(cpu)); @@ -720,11 +718,11 @@ * last cpu in this core and core-imc event running * in this cpu. */ - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); if (imc_global_refc.id == IMC_DOMAIN_CORE) imc_global_refc.refc--; - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); } return 0; } @@ -739,7 +737,7 @@ static void reset_global_refc(struct perf_event *event) { - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); imc_global_refc.refc--; /* @@ -751,7 +749,7 @@ imc_global_refc.refc = 0; imc_global_refc.id = 0; } - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); } static void core_imc_counters_release(struct perf_event *event) @@ -764,17 +762,17 @@ /* * See if we need to disable the IMC PMU. * If no events are currently in use, then we have to take a - * mutex to ensure that we don't race with another task doing + * lock to ensure that we don't race with another task doing * enable or disable the core counters. */ core_id = event->cpu / threads_per_core; - /* Take the mutex lock and decrement the refernce count for this core */ + /* Take the lock and decrement the refernce count for this core */ ref = &core_imc_refc[core_id]; if (!ref) return; - mutex_lock(&ref->lock); + spin_lock(&ref->lock); if (ref->refc == 0) { /* * The scenario where this is true is, when perf session is @@ -786,7 +784,7 @@ * an OPAL call to disable the engine in that core. * */ - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); return; } ref->refc--; @@ -794,7 +792,7 @@ rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_CORE, get_hard_smp_processor_id(event->cpu)); if (rc) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("IMC: Unable to stop the counters for core %d\n", core_id); return; } @@ -802,7 +800,7 @@ WARN(1, "core-imc: Invalid event reference count\n"); ref->refc = 0; } - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); reset_global_refc(event); } @@ -840,7 +838,6 @@ if ((!pcmi->vbase)) return -ENODEV; - /* Get the core_imc mutex for this core */ ref = &core_imc_refc[core_id]; if (!ref) return -EINVAL; @@ -848,22 +845,22 @@ /* * Core pmu units are enabled only when it is used. * See if this is triggered for the first time. - * If yes, take the mutex lock and enable the core counters. + * If yes, take the lock and enable the core counters. * If not, just increment the count in core_imc_refc struct. */ - mutex_lock(&ref->lock); + spin_lock(&ref->lock); if (ref->refc == 0) { rc = opal_imc_counters_start(OPAL_IMC_COUNTERS_CORE, get_hard_smp_processor_id(event->cpu)); if (rc) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("core-imc: Unable to start the counters for core %d\n", core_id); return rc; } } ++ref->refc; - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); /* * Since the system can run either in accumulation or trace-mode @@ -874,7 +871,7 @@ * to know whether any other trace/thread imc * events are running. */ - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); if (imc_global_refc.id == 0 || imc_global_refc.id == IMC_DOMAIN_CORE) { /* * No other trace/thread imc events are running in @@ -883,10 +880,10 @@ imc_global_refc.id = IMC_DOMAIN_CORE; imc_global_refc.refc++; } else { - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); return -EBUSY; } - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); event->hw.event_base = (u64)pcmi->vbase + (config & IMC_EVENT_OFFSET_MASK); event->destroy = core_imc_counters_release; @@ -958,10 +955,10 @@ mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63)))); /* Reduce the refc if thread-imc event running on this cpu */ - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); if (imc_global_refc.id == IMC_DOMAIN_THREAD) imc_global_refc.refc--; - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); return 0; } @@ -1001,7 +998,7 @@ if (!target) return -EINVAL; - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); /* * Check if any other trace/core imc events are running in the * system, if not set the global id to thread-imc. @@ -1010,10 +1007,10 @@ imc_global_refc.id = IMC_DOMAIN_THREAD; imc_global_refc.refc++; } else { - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); return -EBUSY; } - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); event->pmu->task_ctx_nr = perf_sw_context; event->destroy = reset_global_refc; @@ -1135,25 +1132,25 @@ /* * imc pmus are enabled only when it is used. * See if this is triggered for the first time. - * If yes, take the mutex lock and enable the counters. + * If yes, take the lock and enable the counters. * If not, just increment the count in ref count struct. */ ref = &core_imc_refc[core_id]; if (!ref) return -EINVAL; - mutex_lock(&ref->lock); + spin_lock(&ref->lock); if (ref->refc == 0) { if (opal_imc_counters_start(OPAL_IMC_COUNTERS_CORE, get_hard_smp_processor_id(smp_processor_id()))) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("thread-imc: Unable to start the counter\ for core %d\n", core_id); return -EINVAL; } } ++ref->refc; - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); return 0; } @@ -1170,12 +1167,12 @@ return; } - mutex_lock(&ref->lock); + spin_lock(&ref->lock); ref->refc--; if (ref->refc == 0) { if (opal_imc_counters_stop(OPAL_IMC_COUNTERS_CORE, get_hard_smp_processor_id(smp_processor_id()))) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("thread-imc: Unable to stop the counters\ for core %d\n", core_id); return; @@ -1183,7 +1180,7 @@ } else if (ref->refc < 0) { ref->refc = 0; } - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); /* Set bit 0 of LDBAR to zero, to stop posting updates to memory */ mtspr(SPRN_LDBAR, (mfspr(SPRN_LDBAR) & (~(1UL << 63)))); @@ -1224,9 +1221,8 @@ } } - /* Init the mutex, if not already */ trace_imc_refc[core_id].id = core_id; - mutex_init(&trace_imc_refc[core_id].lock); + spin_lock_init(&trace_imc_refc[core_id].lock); mtspr(SPRN_LDBAR, 0); return 0; @@ -1246,10 +1242,10 @@ * Reduce the refc if any trace-imc event running * on this cpu. */ - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); if (imc_global_refc.id == IMC_DOMAIN_TRACE) imc_global_refc.refc--; - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); return 0; } @@ -1371,17 +1367,17 @@ } mtspr(SPRN_LDBAR, ldbar_value); - mutex_lock(&ref->lock); + spin_lock(&ref->lock); if (ref->refc == 0) { if (opal_imc_counters_start(OPAL_IMC_COUNTERS_TRACE, get_hard_smp_processor_id(smp_processor_id()))) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("trace-imc: Unable to start the counters for core %d\n", core_id); return -EINVAL; } } ++ref->refc; - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); return 0; } @@ -1414,19 +1410,19 @@ return; } - mutex_lock(&ref->lock); + spin_lock(&ref->lock); ref->refc--; if (ref->refc == 0) { if (opal_imc_counters_stop(OPAL_IMC_COUNTERS_TRACE, get_hard_smp_processor_id(smp_processor_id()))) { - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); pr_err("trace-imc: Unable to stop the counters for core %d\n", core_id); return; } } else if (ref->refc < 0) { ref->refc = 0; } - mutex_unlock(&ref->lock); + spin_unlock(&ref->lock); trace_imc_event_stop(event, flags); } @@ -1448,7 +1444,7 @@ * no other thread is running any core/thread imc * events */ - mutex_lock(&imc_global_refc.lock); + spin_lock(&imc_global_refc.lock); if (imc_global_refc.id == 0 || imc_global_refc.id == IMC_DOMAIN_TRACE) { /* * No core/thread imc events are running in the @@ -1457,10 +1453,10 @@ imc_global_refc.id = IMC_DOMAIN_TRACE; imc_global_refc.refc++; } else { - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); return -EBUSY; } - mutex_unlock(&imc_global_refc.lock); + spin_unlock(&imc_global_refc.lock); event->hw.idx = -1; @@ -1533,10 +1529,10 @@ i = 0; for_each_node(nid) { /* - * Mutex lock to avoid races while tracking the number of + * Take the lock to avoid races while tracking the number of * sessions using the chip's nest pmu units. */ - mutex_init(&nest_imc_refc[i].lock); + spin_lock_init(&nest_imc_refc[i].lock); /* * Loop to init the "id" with the node_id. Variable "i" initialized to only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/Makefile +++ linux-oem-6.1-6.1.0/arch/riscv/Makefile @@ -80,6 +80,9 @@ KBUILD_CFLAGS += -fno-omit-frame-pointer endif +# Avoid generating .eh_frame sections. +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables + KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/kernel/head.S +++ linux-oem-6.1-6.1.0/arch/riscv/kernel/head.S @@ -326,7 +326,7 @@ call soc_early_init tail start_kernel -#if CONFIG_RISCV_BOOT_SPINWAIT +#ifdef CONFIG_RISCV_BOOT_SPINWAIT .Lsecondary_start: /* Set trap vector to spin forever to help debug */ la a3, .Lsecondary_park only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/kernel/probes/kprobes.c +++ linux-oem-6.1-6.1.0/arch/riscv/kernel/probes/kprobes.c @@ -48,15 +48,35 @@ post_kprobe_handler(p, kcb, regs); } +static bool __kprobes arch_check_kprobe(struct kprobe *p) +{ + unsigned long tmp = (unsigned long)p->addr - p->offset; + unsigned long addr = (unsigned long)p->addr; + + while (tmp <= addr) { + if (tmp == addr) + return true; + + tmp += GET_INSN_LENGTH(*(u16 *)tmp); + } + + return false; +} + int __kprobes arch_prepare_kprobe(struct kprobe *p) { - unsigned long probe_addr = (unsigned long)p->addr; + u16 *insn = (u16 *)p->addr; + + if ((unsigned long)insn & 0x1) + return -EILSEQ; - if (probe_addr & 0x1) + if (!arch_check_kprobe(p)) return -EILSEQ; /* copy instruction */ - p->opcode = *p->addr; + p->opcode = (kprobe_opcode_t)(*insn++); + if (GET_INSN_LENGTH(p->opcode) == 4) + p->opcode |= (kprobe_opcode_t)(*insn) << 16; /* decode instruction */ switch (riscv_probe_decode_insn(p->addr, &p->ainsn.api)) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/kernel/probes/simulate-insn.c +++ linux-oem-6.1-6.1.0/arch/riscv/kernel/probes/simulate-insn.c @@ -71,11 +71,11 @@ u32 rd_index = (opcode >> 7) & 0x1f; u32 rs1_index = (opcode >> 15) & 0x1f; - ret = rv_insn_reg_set_val(regs, rd_index, addr + 4); + ret = rv_insn_reg_get_val(regs, rs1_index, &base_addr); if (!ret) return ret; - ret = rv_insn_reg_get_val(regs, rs1_index, &base_addr); + ret = rv_insn_reg_set_val(regs, rd_index, addr + 4); if (!ret) return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/kernel/smpboot.c +++ linux-oem-6.1-6.1.0/arch/riscv/kernel/smpboot.c @@ -39,7 +39,6 @@ void __init smp_prepare_boot_cpu(void) { - init_cpu_topology(); } void __init smp_prepare_cpus(unsigned int max_cpus) @@ -48,6 +47,8 @@ int ret; unsigned int curr_cpuid; + init_cpu_topology(); + curr_cpuid = smp_processor_id(); store_cpu_topology(curr_cpuid); numa_store_cpu_info(curr_cpuid); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/riscv/mm/cacheflush.c +++ linux-oem-6.1-6.1.0/arch/riscv/mm/cacheflush.c @@ -83,8 +83,10 @@ { struct page *page = pte_page(pte); - if (!test_and_set_bit(PG_dcache_clean, &page->flags)) + if (!test_bit(PG_dcache_clean, &page->flags)) { flush_icache_all(); + set_bit(PG_dcache_clean, &page->flags); + } } #endif /* CONFIG_MMU */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/boot/decompressor.c +++ linux-oem-6.1-6.1.0/arch/s390/boot/decompressor.c @@ -80,6 +80,6 @@ void *output = (void *)decompress_offset; __decompress(_compressed_start, _compressed_end - _compressed_start, - NULL, NULL, output, 0, NULL, error); + NULL, NULL, output, vmlinux.image_size, NULL, error); return output; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/include/asm/cpu_mf.h +++ linux-oem-6.1-6.1.0/arch/s390/include/asm/cpu_mf.h @@ -131,19 +131,21 @@ struct hws_diag_entry diag; /* Diagnostic-sampling data entry */ } __packed; -struct hws_trailer_entry { - union { - struct { - unsigned int f:1; /* 0 - Block Full Indicator */ - unsigned int a:1; /* 1 - Alert request control */ - unsigned int t:1; /* 2 - Timestamp format */ - unsigned int :29; /* 3 - 31: Reserved */ - unsigned int bsdes:16; /* 32-47: size of basic SDE */ - unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */ - }; - unsigned long long flags; /* 0 - 63: All indicators */ +union hws_trailer_header { + struct { + unsigned int f:1; /* 0 - Block Full Indicator */ + unsigned int a:1; /* 1 - Alert request control */ + unsigned int t:1; /* 2 - Timestamp format */ + unsigned int :29; /* 3 - 31: Reserved */ + unsigned int bsdes:16; /* 32-47: size of basic SDE */ + unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */ + unsigned long long overflow; /* 64 - Overflow Count */ }; - unsigned long long overflow; /* 64 - sample Overflow count */ + __uint128_t val; +}; + +struct hws_trailer_entry { + union hws_trailer_header header; /* 0 - 15 Flags + Overflow Count */ unsigned char timestamp[16]; /* 16 - 31 timestamp */ unsigned long long reserved1; /* 32 -Reserved */ unsigned long long reserved2; /* */ @@ -290,14 +292,11 @@ return USEC_PER_SEC * qsi->cpu_speed / rate; } -#define SDB_TE_ALERT_REQ_MASK 0x4000000000000000UL -#define SDB_TE_BUFFER_FULL_MASK 0x8000000000000000UL - /* Return TOD timestamp contained in an trailer entry */ static inline unsigned long long trailer_timestamp(struct hws_trailer_entry *te) { /* TOD in STCKE format */ - if (te->t) + if (te->header.t) return *((unsigned long long *) &te->timestamp[1]); /* TOD in STCK format */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/include/asm/debug.h +++ linux-oem-6.1-6.1.0/arch/s390/include/asm/debug.h @@ -4,8 +4,8 @@ * * Copyright IBM Corp. 1999, 2020 */ -#ifndef DEBUG_H -#define DEBUG_H +#ifndef _ASM_S390_DEBUG_H +#define _ASM_S390_DEBUG_H #include #include @@ -487,4 +487,4 @@ #endif /* MODULE */ -#endif /* DEBUG_H */ +#endif /* _ASM_S390_DEBUG_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/include/asm/percpu.h +++ linux-oem-6.1-6.1.0/arch/s390/include/asm/percpu.h @@ -31,7 +31,7 @@ pcp_op_T__ *ptr__; \ preempt_disable_notrace(); \ ptr__ = raw_cpu_ptr(&(pcp)); \ - prev__ = *ptr__; \ + prev__ = READ_ONCE(*ptr__); \ do { \ old__ = prev__; \ new__ = old__ op (val); \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/kernel/crash_dump.c +++ linux-oem-6.1-6.1.0/arch/s390/kernel/crash_dump.c @@ -153,7 +153,7 @@ kvec.iov_base = dst; kvec.iov_len = count; - iov_iter_kvec(&iter, WRITE, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); if (copy_oldmem_iter(&iter, src, count) < count) return -EFAULT; return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/kernel/machine_kexec_file.c +++ linux-oem-6.1-6.1.0/arch/s390/kernel/machine_kexec_file.c @@ -187,8 +187,6 @@ data->memsz = ALIGN(data->memsz, PAGE_SIZE); buf.mem = data->memsz; - if (image->type == KEXEC_TYPE_CRASH) - buf.mem += crashk_res.start; ptr = (void *)ipl_cert_list_addr; end = ptr + ipl_cert_list_size; @@ -225,6 +223,9 @@ data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr); *lc_ipl_parmblock_ptr = (__u32)buf.mem; + if (image->type == KEXEC_TYPE_CRASH) + buf.mem += crashk_res.start; + ret = kexec_add_buffer(&buf); out: return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/kernel/perf_cpum_sf.c +++ linux-oem-6.1-6.1.0/arch/s390/kernel/perf_cpum_sf.c @@ -163,14 +163,15 @@ static int alloc_sample_data_block(unsigned long *sdbt, gfp_t gfp_flags) { - unsigned long sdb, *trailer; + struct hws_trailer_entry *te; + unsigned long sdb; /* Allocate and initialize sample-data-block */ sdb = get_zeroed_page(gfp_flags); if (!sdb) return -ENOMEM; - trailer = trailer_entry_ptr(sdb); - *trailer = SDB_TE_ALERT_REQ_MASK; + te = (struct hws_trailer_entry *)trailer_entry_ptr(sdb); + te->header.a = 1; /* Link SDB into the sample-data-block-table */ *sdbt = sdb; @@ -1206,7 +1207,7 @@ "%s: Found unknown" " sampling data entry: te->f %i" " basic.def %#4x (%p)\n", __func__, - te->f, sample->def, sample); + te->header.f, sample->def, sample); /* Sample slot is not yet written or other record. * * This condition can occur if the buffer was reused @@ -1217,7 +1218,7 @@ * that are not full. Stop processing if the first * invalid format was detected. */ - if (!te->f) + if (!te->header.f) break; } @@ -1227,6 +1228,16 @@ } } +static inline __uint128_t __cdsg(__uint128_t *ptr, __uint128_t old, __uint128_t new) +{ + asm volatile( + " cdsg %[old],%[new],%[ptr]\n" + : [old] "+d" (old), [ptr] "+QS" (*ptr) + : [new] "d" (new) + : "memory", "cc"); + return old; +} + /* hw_perf_event_update() - Process sampling buffer * @event: The perf event * @flush_all: Flag to also flush partially filled sample-data-blocks @@ -1243,10 +1254,11 @@ */ static void hw_perf_event_update(struct perf_event *event, int flush_all) { + unsigned long long event_overflow, sampl_overflow, num_sdb; + union hws_trailer_header old, prev, new; struct hw_perf_event *hwc = &event->hw; struct hws_trailer_entry *te; unsigned long *sdbt; - unsigned long long event_overflow, sampl_overflow, num_sdb, te_flags; int done; /* @@ -1266,25 +1278,25 @@ te = (struct hws_trailer_entry *) trailer_entry_ptr(*sdbt); /* Leave loop if no more work to do (block full indicator) */ - if (!te->f) { + if (!te->header.f) { done = 1; if (!flush_all) break; } /* Check the sample overflow count */ - if (te->overflow) + if (te->header.overflow) /* Account sample overflows and, if a particular limit * is reached, extend the sampling buffer. * For details, see sfb_account_overflows(). */ - sampl_overflow += te->overflow; + sampl_overflow += te->header.overflow; /* Timestamps are valid for full sample-data-blocks only */ debug_sprintf_event(sfdbg, 6, "%s: sdbt %#lx " "overflow %llu timestamp %#llx\n", - __func__, (unsigned long)sdbt, te->overflow, - (te->f) ? trailer_timestamp(te) : 0ULL); + __func__, (unsigned long)sdbt, te->header.overflow, + (te->header.f) ? trailer_timestamp(te) : 0ULL); /* Collect all samples from a single sample-data-block and * flag if an (perf) event overflow happened. If so, the PMU @@ -1294,12 +1306,16 @@ num_sdb++; /* Reset trailer (using compare-double-and-swap) */ + /* READ_ONCE() 16 byte header */ + prev.val = __cdsg(&te->header.val, 0, 0); do { - te_flags = te->flags & ~SDB_TE_BUFFER_FULL_MASK; - te_flags |= SDB_TE_ALERT_REQ_MASK; - } while (!cmpxchg_double(&te->flags, &te->overflow, - te->flags, te->overflow, - te_flags, 0ULL)); + old.val = prev.val; + new.val = prev.val; + new.f = 0; + new.a = 1; + new.overflow = 0; + prev.val = __cdsg(&te->header.val, old.val, new.val); + } while (prev.val != old.val); /* Advance to next sample-data-block */ sdbt++; @@ -1384,7 +1400,7 @@ range_scan = AUX_SDB_NUM_ALERT(aux); for (i = 0, idx = aux->head; i < range_scan; i++, idx++) { te = aux_sdb_trailer(aux, idx); - if (!(te->flags & SDB_TE_BUFFER_FULL_MASK)) + if (!te->header.f) break; } /* i is num of SDBs which are full */ @@ -1392,7 +1408,7 @@ /* Remove alert indicators in the buffer */ te = aux_sdb_trailer(aux, aux->alert_mark); - te->flags &= ~SDB_TE_ALERT_REQ_MASK; + te->header.a = 0; debug_sprintf_event(sfdbg, 6, "%s: SDBs %ld range %ld head %ld\n", __func__, i, range_scan, aux->head); @@ -1437,9 +1453,9 @@ idx = aux->empty_mark + 1; for (i = 0; i < range_scan; i++, idx++) { te = aux_sdb_trailer(aux, idx); - te->flags &= ~(SDB_TE_BUFFER_FULL_MASK | - SDB_TE_ALERT_REQ_MASK); - te->overflow = 0; + te->header.f = 0; + te->header.a = 0; + te->header.overflow = 0; } /* Save the position of empty SDBs */ aux->empty_mark = aux->head + range - 1; @@ -1448,7 +1464,7 @@ /* Set alert indicator */ aux->alert_mark = aux->head + range/2 - 1; te = aux_sdb_trailer(aux, aux->alert_mark); - te->flags = te->flags | SDB_TE_ALERT_REQ_MASK; + te->header.a = 1; /* Reset hardware buffer head */ head = AUX_SDB_INDEX(aux, aux->head); @@ -1475,14 +1491,17 @@ static bool aux_set_alert(struct aux_buffer *aux, unsigned long alert_index, unsigned long long *overflow) { - unsigned long long orig_overflow, orig_flags, new_flags; + union hws_trailer_header old, prev, new; struct hws_trailer_entry *te; te = aux_sdb_trailer(aux, alert_index); + /* READ_ONCE() 16 byte header */ + prev.val = __cdsg(&te->header.val, 0, 0); do { - orig_flags = te->flags; - *overflow = orig_overflow = te->overflow; - if (orig_flags & SDB_TE_BUFFER_FULL_MASK) { + old.val = prev.val; + new.val = prev.val; + *overflow = old.overflow; + if (old.f) { /* * SDB is already set by hardware. * Abort and try to set somewhere @@ -1490,10 +1509,10 @@ */ return false; } - new_flags = orig_flags | SDB_TE_ALERT_REQ_MASK; - } while (!cmpxchg_double(&te->flags, &te->overflow, - orig_flags, orig_overflow, - new_flags, 0ULL)); + new.a = 1; + new.overflow = 0; + prev.val = __cdsg(&te->header.val, old.val, new.val); + } while (prev.val != old.val); return true; } @@ -1522,8 +1541,9 @@ static bool aux_reset_buffer(struct aux_buffer *aux, unsigned long range, unsigned long long *overflow) { - unsigned long long orig_overflow, orig_flags, new_flags; unsigned long i, range_scan, idx, idx_old; + union hws_trailer_header old, prev, new; + unsigned long long orig_overflow; struct hws_trailer_entry *te; debug_sprintf_event(sfdbg, 6, "%s: range %ld head %ld alert %ld " @@ -1554,17 +1574,20 @@ idx_old = idx = aux->empty_mark + 1; for (i = 0; i < range_scan; i++, idx++) { te = aux_sdb_trailer(aux, idx); + /* READ_ONCE() 16 byte header */ + prev.val = __cdsg(&te->header.val, 0, 0); do { - orig_flags = te->flags; - orig_overflow = te->overflow; - new_flags = orig_flags & ~SDB_TE_BUFFER_FULL_MASK; + old.val = prev.val; + new.val = prev.val; + orig_overflow = old.overflow; + new.f = 0; + new.overflow = 0; if (idx == aux->alert_mark) - new_flags |= SDB_TE_ALERT_REQ_MASK; + new.a = 1; else - new_flags &= ~SDB_TE_ALERT_REQ_MASK; - } while (!cmpxchg_double(&te->flags, &te->overflow, - orig_flags, orig_overflow, - new_flags, 0ULL)); + new.a = 0; + prev.val = __cdsg(&te->header.val, old.val, new.val); + } while (prev.val != old.val); *overflow += orig_overflow; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/kernel/vmlinux.lds.S +++ linux-oem-6.1-6.1.0/arch/s390/kernel/vmlinux.lds.S @@ -17,6 +17,8 @@ /* Handle ro_after_init data on our own. */ #define RO_AFTER_INIT_DATA +#define RUNTIME_DISCARD_EXIT + #define EMITS_PT_NOTE #include @@ -79,6 +81,7 @@ _end_amode31_refs = .; } + . = ALIGN(PAGE_SIZE); _edata = .; /* End of data section */ /* will be freed after init */ @@ -193,6 +196,7 @@ BSS_SECTION(PAGE_SIZE, 4 * PAGE_SIZE, PAGE_SIZE) + . = ALIGN(PAGE_SIZE); _end = . ; /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/kvm/interrupt.c +++ linux-oem-6.1-6.1.0/arch/s390/kvm/interrupt.c @@ -83,8 +83,9 @@ struct esca_block *sca = vcpu->kvm->arch.sca; union esca_sigp_ctrl *sigp_ctrl = &(sca->cpu[vcpu->vcpu_id].sigp_ctrl); - union esca_sigp_ctrl new_val = {0}, old_val = *sigp_ctrl; + union esca_sigp_ctrl new_val = {0}, old_val; + old_val = READ_ONCE(*sigp_ctrl); new_val.scn = src_id; new_val.c = 1; old_val.c = 0; @@ -95,8 +96,9 @@ struct bsca_block *sca = vcpu->kvm->arch.sca; union bsca_sigp_ctrl *sigp_ctrl = &(sca->cpu[vcpu->vcpu_id].sigp_ctrl); - union bsca_sigp_ctrl new_val = {0}, old_val = *sigp_ctrl; + union bsca_sigp_ctrl new_val = {0}, old_val; + old_val = READ_ONCE(*sigp_ctrl); new_val.scn = src_id; new_val.c = 1; old_val.c = 0; @@ -126,16 +128,18 @@ struct esca_block *sca = vcpu->kvm->arch.sca; union esca_sigp_ctrl *sigp_ctrl = &(sca->cpu[vcpu->vcpu_id].sigp_ctrl); - union esca_sigp_ctrl old = *sigp_ctrl; + union esca_sigp_ctrl old; + old = READ_ONCE(*sigp_ctrl); expect = old.value; rc = cmpxchg(&sigp_ctrl->value, old.value, 0); } else { struct bsca_block *sca = vcpu->kvm->arch.sca; union bsca_sigp_ctrl *sigp_ctrl = &(sca->cpu[vcpu->vcpu_id].sigp_ctrl); - union bsca_sigp_ctrl old = *sigp_ctrl; + union bsca_sigp_ctrl old; + old = READ_ONCE(*sigp_ctrl); expect = old.value; rc = cmpxchg(&sigp_ctrl->value, old.value, 0); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/s390/mm/maccess.c +++ linux-oem-6.1-6.1.0/arch/s390/mm/maccess.c @@ -128,7 +128,7 @@ kvec.iov_base = dest; kvec.iov_len = count; - iov_iter_kvec(&iter, WRITE, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); if (memcpy_real_iter(&iter, src, count) < count) return -EFAULT; return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/sh/kernel/vmlinux.lds.S +++ linux-oem-6.1-6.1.0/arch/sh/kernel/vmlinux.lds.S @@ -4,6 +4,7 @@ * Written by Niibe Yutaka and Paul Mundt */ OUTPUT_ARCH(sh) +#define RUNTIME_DISCARD_EXIT #include #include #include only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/Makefile +++ linux-oem-6.1-6.1.0/arch/x86/Makefile @@ -14,13 +14,13 @@ ifdef CONFIG_CC_IS_GCC RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register) -RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix) RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register) endif ifdef CONFIG_CC_IS_CLANG RETPOLINE_CFLAGS := -mretpoline-external-thunk RETPOLINE_VDSO_CFLAGS := -mretpoline endif +RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix) ifdef CONFIG_RETHUNK RETHUNK_CFLAGS := -mfunction-return=thunk-extern only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/boot/bioscall.S +++ linux-oem-6.1-6.1.0/arch/x86/boot/bioscall.S @@ -32,7 +32,7 @@ movw %dx, %si movw %sp, %di movw $11, %cx - rep; movsd + rep; movsl /* Pop full state from the stack */ popal @@ -67,7 +67,7 @@ jz 4f movw %sp, %si movw $11, %cx - rep; movsd + rep; movsl 4: addw $44, %sp /* Restore state and return */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/boot/compressed/ident_map_64.c +++ linux-oem-6.1-6.1.0/arch/x86/boot/compressed/ident_map_64.c @@ -180,6 +180,12 @@ /* Load the new page-table. */ write_cr3(top_level_pgt); + + /* + * Now that the required page table mappings are established and a + * GHCB can be used, check for SNP guest/HV feature compatibility. + */ + snp_check_features(); } static pte_t *split_large_pmd(struct x86_mapping_info *info, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/boot/compressed/misc.h +++ linux-oem-6.1-6.1.0/arch/x86/boot/compressed/misc.h @@ -126,6 +126,7 @@ #ifdef CONFIG_AMD_MEM_ENCRYPT void sev_enable(struct boot_params *bp); +void snp_check_features(void); void sev_es_shutdown_ghcb(void); extern bool sev_es_check_ghcb_fault(unsigned long address); void snp_set_page_private(unsigned long paddr); @@ -143,6 +144,7 @@ if (bp) bp->cc_blob_address = 0; } +static inline void snp_check_features(void) { } static inline void sev_es_shutdown_ghcb(void) { } static inline bool sev_es_check_ghcb_fault(unsigned long address) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/boot/compressed/sev.c +++ linux-oem-6.1-6.1.0/arch/x86/boot/compressed/sev.c @@ -208,6 +208,23 @@ error("Can't unmap GHCB page"); } +static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, + unsigned int reason, u64 exit_info_2) +{ + u64 exit_info_1 = SVM_VMGEXIT_TERM_REASON(set, reason); + + vc_ghcb_invalidate(ghcb); + ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); + ghcb_set_sw_exit_info_1(ghcb, exit_info_1); + ghcb_set_sw_exit_info_2(ghcb, exit_info_2); + + sev_es_wr_ghcb_msr(__pa(ghcb)); + VMGEXIT(); + + while (true) + asm volatile("hlt\n" : : : "memory"); +} + bool sev_es_check_ghcb_fault(unsigned long address) { /* Check whether the fault was on the GHCB page */ @@ -270,6 +287,59 @@ sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_NOT_VMPL0); } +/* + * SNP_FEATURES_IMPL_REQ is the mask of SNP features that will need + * guest side implementation for proper functioning of the guest. If any + * of these features are enabled in the hypervisor but are lacking guest + * side implementation, the behavior of the guest will be undefined. The + * guest could fail in non-obvious way making it difficult to debug. + * + * As the behavior of reserved feature bits is unknown to be on the + * safe side add them to the required features mask. + */ +#define SNP_FEATURES_IMPL_REQ (MSR_AMD64_SNP_VTOM | \ + MSR_AMD64_SNP_REFLECT_VC | \ + MSR_AMD64_SNP_RESTRICTED_INJ | \ + MSR_AMD64_SNP_ALT_INJ | \ + MSR_AMD64_SNP_DEBUG_SWAP | \ + MSR_AMD64_SNP_VMPL_SSS | \ + MSR_AMD64_SNP_SECURE_TSC | \ + MSR_AMD64_SNP_VMGEXIT_PARAM | \ + MSR_AMD64_SNP_VMSA_REG_PROTECTION | \ + MSR_AMD64_SNP_RESERVED_BIT13 | \ + MSR_AMD64_SNP_RESERVED_BIT15 | \ + MSR_AMD64_SNP_RESERVED_MASK) + +/* + * SNP_FEATURES_PRESENT is the mask of SNP features that are implemented + * by the guest kernel. As and when a new feature is implemented in the + * guest kernel, a corresponding bit should be added to the mask. + */ +#define SNP_FEATURES_PRESENT (0) + +void snp_check_features(void) +{ + u64 unsupported; + + if (!(sev_status & MSR_AMD64_SEV_SNP_ENABLED)) + return; + + /* + * Terminate the boot if hypervisor has enabled any feature lacking + * guest side implementation. Pass on the unsupported features mask through + * EXIT_INFO_2 of the GHCB protocol so that those features can be reported + * as part of the guest boot failure. + */ + unsupported = sev_status & SNP_FEATURES_IMPL_REQ & ~SNP_FEATURES_PRESENT; + if (unsupported) { + if (ghcb_version < 2 || (!boot_ghcb && !early_setup_ghcb())) + sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SNP_UNSUPPORTED); + + sev_es_ghcb_terminate(boot_ghcb, SEV_TERM_SET_GEN, + GHCB_SNP_UNSUPPORTED, unsupported); + } +} + void sev_enable(struct boot_params *bp) { unsigned int eax, ebx, ecx, edx; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/amd/core.c +++ linux-oem-6.1-6.1.0/arch/x86/events/amd/core.c @@ -1387,7 +1387,7 @@ * numbered counter following it. */ for (i = 0; i < x86_pmu.num_counters - 1; i += 2) - even_ctr_mask |= 1 << i; + even_ctr_mask |= BIT_ULL(i); pair_constraint = (struct event_constraint) __EVENT_CONSTRAINT(0, even_ctr_mask, 0, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/core.c +++ linux-oem-6.1-6.1.0/arch/x86/events/core.c @@ -2994,17 +2994,19 @@ void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap) { - if (!x86_pmu_initialized()) { + /* This API doesn't currently support enumerating hybrid PMUs. */ + if (WARN_ON_ONCE(cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) || + !x86_pmu_initialized()) { memset(cap, 0, sizeof(*cap)); return; } - cap->version = x86_pmu.version; /* - * KVM doesn't support the hybrid PMU yet. - * Return the common value in global x86_pmu, - * which available for all cores. + * Note, hybrid CPU models get tracked as having hybrid PMUs even when + * all E-cores are disabled via BIOS. When E-cores are disabled, the + * base PMU holds the correct number of counters for P-cores. */ + cap->version = x86_pmu.version; cap->num_counters_gp = x86_pmu.num_counters; cap->num_counters_fixed = x86_pmu.num_counters_fixed; cap->bit_width_gp = x86_pmu.cntval_bits; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/intel/core.c +++ linux-oem-6.1-6.1.0/arch/x86/events/intel/core.c @@ -6342,6 +6342,7 @@ break; case INTEL_FAM6_SAPPHIRERAPIDS_X: + case INTEL_FAM6_EMERALDRAPIDS_X: pmem = true; x86_pmu.late_ack = true; memcpy(hw_cache_event_ids, spr_hw_cache_event_ids, sizeof(hw_cache_event_ids)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/intel/cstate.c +++ linux-oem-6.1-6.1.0/arch/x86/events/intel/cstate.c @@ -41,6 +41,7 @@ * MSR_CORE_C1_RES: CORE C1 Residency Counter * perf code: 0x00 * Available model: SLM,AMT,GLM,CNL,ICX,TNT,ADL,RPL + * MTL * Scope: Core (each processor core has a MSR) * MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter * perf code: 0x01 @@ -51,50 +52,50 @@ * perf code: 0x02 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, * SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX, - * TGL,TNT,RKL,ADL,RPL,SPR + * TGL,TNT,RKL,ADL,RPL,SPR,MTL * Scope: Core * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter * perf code: 0x03 * Available model: SNB,IVB,HSW,BDW,SKL,CNL,KBL,CML, - * ICL,TGL,RKL,ADL,RPL + * ICL,TGL,RKL,ADL,RPL,MTL * Scope: Core * MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter. * perf code: 0x00 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, * KBL,CML,ICL,ICX,TGL,TNT,RKL,ADL, - * RPL,SPR + * RPL,SPR,MTL * Scope: Package (physical package) * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. * perf code: 0x01 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL, * GLM,CNL,KBL,CML,ICL,TGL,TNT,RKL, - * ADL,RPL + * ADL,RPL,MTL * Scope: Package (physical package) * MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter. * perf code: 0x02 * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, * SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX, - * TGL,TNT,RKL,ADL,RPL,SPR + * TGL,TNT,RKL,ADL,RPL,SPR,MTL * Scope: Package (physical package) * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. * perf code: 0x03 * Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,CNL, - * KBL,CML,ICL,TGL,RKL,ADL,RPL + * KBL,CML,ICL,TGL,RKL,ADL,RPL,MTL * Scope: Package (physical package) * MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter. * perf code: 0x04 * Available model: HSW ULT,KBL,CNL,CML,ICL,TGL,RKL, - * ADL,RPL + * ADL,RPL,MTL * Scope: Package (physical package) * MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter. * perf code: 0x05 * Available model: HSW ULT,KBL,CNL,CML,ICL,TGL,RKL, - * ADL,RPL + * ADL,RPL,MTL * Scope: Package (physical package) * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. * perf code: 0x06 * Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL, - * TNT,RKL,ADL,RPL + * TNT,RKL,ADL,RPL,MTL * Scope: Package (physical package) * */ @@ -676,6 +677,7 @@ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &icx_cstates), X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &icx_cstates), X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &icx_cstates), + X86_MATCH_INTEL_FAM6_MODEL(EMERALDRAPIDS_X, &icx_cstates), X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &icl_cstates), X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &icl_cstates), @@ -686,6 +688,8 @@ X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, &adl_cstates), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &adl_cstates), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &adl_cstates), + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE, &adl_cstates), + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, &adl_cstates), { }, }; MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/intel/uncore.c +++ linux-oem-6.1-6.1.0/arch/x86/events/intel/uncore.c @@ -1833,6 +1833,7 @@ X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &adl_uncore_init), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &adl_uncore_init), X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &spr_uncore_init), + X86_MATCH_INTEL_FAM6_MODEL(EMERALDRAPIDS_X, &spr_uncore_init), X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &snr_uncore_init), {}, }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/msr.c +++ linux-oem-6.1-6.1.0/arch/x86/events/msr.c @@ -69,6 +69,7 @@ case INTEL_FAM6_BROADWELL_G: case INTEL_FAM6_BROADWELL_X: case INTEL_FAM6_SAPPHIRERAPIDS_X: + case INTEL_FAM6_EMERALDRAPIDS_X: case INTEL_FAM6_ATOM_SILVERMONT: case INTEL_FAM6_ATOM_SILVERMONT_D: @@ -107,6 +108,8 @@ case INTEL_FAM6_RAPTORLAKE: case INTEL_FAM6_RAPTORLAKE_P: case INTEL_FAM6_RAPTORLAKE_S: + case INTEL_FAM6_METEORLAKE: + case INTEL_FAM6_METEORLAKE_L: if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) return true; break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/events/rapl.c +++ linux-oem-6.1-6.1.0/arch/x86/events/rapl.c @@ -800,13 +800,18 @@ X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &model_hsx), X86_MATCH_INTEL_FAM6_MODEL(COMETLAKE_L, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(COMETLAKE, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_N, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &model_spr), + X86_MATCH_INTEL_FAM6_MODEL(EMERALDRAPIDS_X, &model_spr), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, &model_skl), X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(METEORLAKE_L, &model_skl), {}, }; MODULE_DEVICE_TABLE(x86cpu, rapl_model_match); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/asm/acpi.h +++ linux-oem-6.1-6.1.0/arch/x86/include/asm/acpi.h @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef CONFIG_ACPI_APEI # include @@ -63,6 +64,13 @@ /* Physical address to resume after wakeup */ unsigned long acpi_get_wakeup_address(void); +static inline bool acpi_skip_set_wakeup_address(void) +{ + return cpu_feature_enabled(X86_FEATURE_XENPV); +} + +#define acpi_skip_set_wakeup_address acpi_skip_set_wakeup_address + /* * Check if the CPU can handle C2 and deeper */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/asm/cpufeatures.h +++ linux-oem-6.1-6.1.0/arch/x86/include/asm/cpufeatures.h @@ -463,5 +463,6 @@ #define X86_BUG_MMIO_UNKNOWN X86_BUG(26) /* CPU is too old and its MMIO Stale Data status is unknown */ #define X86_BUG_RETBLEED X86_BUG(27) /* CPU is affected by RETBleed */ #define X86_BUG_EIBRS_PBRSB X86_BUG(28) /* EIBRS is vulnerable to Post Barrier RSB Predictions */ +#define X86_BUG_SMT_RSB X86_BUG(29) /* CPU is vulnerable to Cross-Thread Return Address Predictions */ #endif /* _ASM_X86_CPUFEATURES_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/asm/debugreg.h +++ linux-oem-6.1-6.1.0/arch/x86/include/asm/debugreg.h @@ -39,7 +39,20 @@ asm("mov %%db6, %0" :"=r" (val)); break; case 7: - asm("mov %%db7, %0" :"=r" (val)); + /* + * Apply __FORCE_ORDER to DR7 reads to forbid re-ordering them + * with other code. + * + * This is needed because a DR7 access can cause a #VC exception + * when running under SEV-ES. Taking a #VC exception is not a + * safe thing to do just anywhere in the entry code and + * re-ordering might place the access into an unsafe location. + * + * This happened in the NMI handler, where the DR7 read was + * re-ordered to happen before the call to sev_es_ist_enter(), + * causing stack recursion. + */ + asm volatile("mov %%db7, %0" : "=r" (val) : __FORCE_ORDER); break; default: BUG(); @@ -66,7 +79,16 @@ asm("mov %0, %%db6" ::"r" (value)); break; case 7: - asm("mov %0, %%db7" ::"r" (value)); + /* + * Apply __FORCE_ORDER to DR7 writes to forbid re-ordering them + * with other code. + * + * While is didn't happen with a DR7 write (see the DR7 read + * comment above which explains where it happened), add the + * __FORCE_ORDER here too to avoid similar problems in the + * future. + */ + asm volatile("mov %0, %%db7" ::"r" (value), __FORCE_ORDER); break; default: BUG(); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/asm/msr-index.h +++ linux-oem-6.1-6.1.0/arch/x86/include/asm/msr-index.h @@ -571,6 +571,26 @@ #define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT) #define MSR_AMD64_SEV_SNP_ENABLED BIT_ULL(MSR_AMD64_SEV_SNP_ENABLED_BIT) +/* SNP feature bits enabled by the hypervisor */ +#define MSR_AMD64_SNP_VTOM BIT_ULL(3) +#define MSR_AMD64_SNP_REFLECT_VC BIT_ULL(4) +#define MSR_AMD64_SNP_RESTRICTED_INJ BIT_ULL(5) +#define MSR_AMD64_SNP_ALT_INJ BIT_ULL(6) +#define MSR_AMD64_SNP_DEBUG_SWAP BIT_ULL(7) +#define MSR_AMD64_SNP_PREVENT_HOST_IBS BIT_ULL(8) +#define MSR_AMD64_SNP_BTB_ISOLATION BIT_ULL(9) +#define MSR_AMD64_SNP_VMPL_SSS BIT_ULL(10) +#define MSR_AMD64_SNP_SECURE_TSC BIT_ULL(11) +#define MSR_AMD64_SNP_VMGEXIT_PARAM BIT_ULL(12) +#define MSR_AMD64_SNP_IBS_VIRT BIT_ULL(14) +#define MSR_AMD64_SNP_VMSA_REG_PROTECTION BIT_ULL(16) +#define MSR_AMD64_SNP_SMT_PROTECTION BIT_ULL(17) + +/* SNP feature bits reserved for future use. */ +#define MSR_AMD64_SNP_RESERVED_BIT13 BIT_ULL(13) +#define MSR_AMD64_SNP_RESERVED_BIT15 BIT_ULL(15) +#define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, 18) + #define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f /* AMD Collaborative Processor Performance Control MSRs */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/asm/text-patching.h +++ linux-oem-6.1-6.1.0/arch/x86/include/asm/text-patching.h @@ -183,6 +183,37 @@ unsigned long ip = int3_emulate_pop(regs); int3_emulate_jmp(regs, ip); } + +static __always_inline +void int3_emulate_jcc(struct pt_regs *regs, u8 cc, unsigned long ip, unsigned long disp) +{ + static const unsigned long jcc_mask[6] = { + [0] = X86_EFLAGS_OF, + [1] = X86_EFLAGS_CF, + [2] = X86_EFLAGS_ZF, + [3] = X86_EFLAGS_CF | X86_EFLAGS_ZF, + [4] = X86_EFLAGS_SF, + [5] = X86_EFLAGS_PF, + }; + + bool invert = cc & 1; + bool match; + + if (cc < 0xc) { + match = regs->flags & jcc_mask[cc >> 1]; + } else { + match = ((regs->flags & X86_EFLAGS_SF) >> X86_EFLAGS_SF_BIT) ^ + ((regs->flags & X86_EFLAGS_OF) >> X86_EFLAGS_OF_BIT); + if (cc >= 0xe) + match = match || (regs->flags & X86_EFLAGS_ZF); + } + + if ((match && !invert) || (!match && invert)) + ip += disp; + + int3_emulate_jmp(regs, ip); +} + #endif /* !CONFIG_UML_X86 */ #endif /* _ASM_X86_TEXT_PATCHING_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/include/uapi/asm/svm.h +++ linux-oem-6.1-6.1.0/arch/x86/include/uapi/asm/svm.h @@ -116,6 +116,12 @@ #define SVM_VMGEXIT_AP_CREATE 1 #define SVM_VMGEXIT_AP_DESTROY 2 #define SVM_VMGEXIT_HV_FEATURES 0x8000fffd +#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe +#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \ + /* SW_EXITINFO1[3:0] */ \ + (((((u64)reason_set) & 0xf)) | \ + /* SW_EXITINFO1[11:4] */ \ + ((((u64)reason_code) & 0xff) << 4)) #define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff /* Exit code reserved for hypervisor/software use */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/alternative.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/alternative.c @@ -339,6 +339,12 @@ } } +static inline bool is_jcc32(struct insn *insn) +{ + /* Jcc.d32 second opcode byte is in the range: 0x80-0x8f */ + return insn->opcode.bytes[0] == 0x0f && (insn->opcode.bytes[1] & 0xf0) == 0x80; +} + #if defined(CONFIG_RETPOLINE) && defined(CONFIG_OBJTOOL) /* @@ -427,8 +433,7 @@ * [ NOP ] * 1: */ - /* Jcc.d32 second opcode byte is in the range: 0x80-0x8f */ - if (op == 0x0f && (insn->opcode.bytes[1] & 0xf0) == 0x80) { + if (is_jcc32(insn)) { cc = insn->opcode.bytes[1] & 0xf; cc ^= 1; /* invert condition */ @@ -1311,6 +1316,11 @@ on_each_cpu(do_sync_core, NULL, 1); } +/* + * NOTE: crazy scheme to allow patching Jcc.d32 but not increase the size of + * this thing. When len == 6 everything is prefixed with 0x0f and we map + * opcode to Jcc.d8, using len to distinguish. + */ struct text_poke_loc { /* addr := _stext + rel_addr */ s32 rel_addr; @@ -1432,6 +1442,10 @@ int3_emulate_jmp(regs, (long)ip + tp->disp); break; + case 0x70 ... 0x7f: /* Jcc */ + int3_emulate_jcc(regs, tp->opcode & 0xf, (long)ip, tp->disp); + break; + default: BUG(); } @@ -1505,16 +1519,26 @@ * Second step: update all but the first byte of the patched range. */ for (do_sync = 0, i = 0; i < nr_entries; i++) { - u8 old[POKE_MAX_OPCODE_SIZE] = { tp[i].old, }; + u8 old[POKE_MAX_OPCODE_SIZE+1] = { tp[i].old, }; + u8 _new[POKE_MAX_OPCODE_SIZE+1]; + const u8 *new = tp[i].text; int len = tp[i].len; if (len - INT3_INSN_SIZE > 0) { memcpy(old + INT3_INSN_SIZE, text_poke_addr(&tp[i]) + INT3_INSN_SIZE, len - INT3_INSN_SIZE); + + if (len == 6) { + _new[0] = 0x0f; + memcpy(_new + 1, new, 5); + new = _new; + } + text_poke(text_poke_addr(&tp[i]) + INT3_INSN_SIZE, - (const char *)tp[i].text + INT3_INSN_SIZE, + new + INT3_INSN_SIZE, len - INT3_INSN_SIZE); + do_sync++; } @@ -1542,8 +1566,7 @@ * The old instruction is recorded so that the event can be * processed forwards or backwards. */ - perf_event_text_poke(text_poke_addr(&tp[i]), old, len, - tp[i].text, len); + perf_event_text_poke(text_poke_addr(&tp[i]), old, len, new, len); } if (do_sync) { @@ -1560,10 +1583,15 @@ * replacing opcode. */ for (do_sync = 0, i = 0; i < nr_entries; i++) { - if (tp[i].text[0] == INT3_INSN_OPCODE) + u8 byte = tp[i].text[0]; + + if (tp[i].len == 6) + byte = 0x0f; + + if (byte == INT3_INSN_OPCODE) continue; - text_poke(text_poke_addr(&tp[i]), tp[i].text, INT3_INSN_SIZE); + text_poke(text_poke_addr(&tp[i]), &byte, INT3_INSN_SIZE); do_sync++; } @@ -1581,9 +1609,11 @@ const void *opcode, size_t len, const void *emulate) { struct insn insn; - int ret, i; + int ret, i = 0; - memcpy((void *)tp->text, opcode, len); + if (len == 6) + i = 1; + memcpy((void *)tp->text, opcode+i, len-i); if (!emulate) emulate = opcode; @@ -1594,6 +1624,13 @@ tp->len = len; tp->opcode = insn.opcode.bytes[0]; + if (is_jcc32(&insn)) { + /* + * Map Jcc.d32 onto Jcc.d8 and use len to distinguish. + */ + tp->opcode = insn.opcode.bytes[1] - 0x10; + } + switch (tp->opcode) { case RET_INSN_OPCODE: case JMP32_INSN_OPCODE: @@ -1610,7 +1647,6 @@ BUG_ON(len != insn.length); }; - switch (tp->opcode) { case INT3_INSN_OPCODE: case RET_INSN_OPCODE: @@ -1619,6 +1655,7 @@ case CALL_INSN_OPCODE: case JMP32_INSN_OPCODE: case JMP8_INSN_OPCODE: + case 0x70 ... 0x7f: /* Jcc */ tp->disp = insn.immediate.value; break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/cpu/aperfmperf.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/aperfmperf.c @@ -330,7 +330,16 @@ static void disable_freq_invariance_workfn(struct work_struct *work) { + int cpu; + static_branch_disable(&arch_scale_freq_key); + + /* + * Set arch_freq_scale to a default value on all cpus + * This negates the effect of scaling + */ + for_each_possible_cpu(cpu) + per_cpu(arch_freq_scale, cpu) = SCHED_CAPACITY_SCALE; } static DECLARE_WORK(disable_freq_invariance_work, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/cpu/common.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/common.c @@ -1235,6 +1235,8 @@ #define MMIO_SBDS BIT(2) /* CPU is affected by RETbleed, speculating where you would not expect it */ #define RETBLEED BIT(3) +/* CPU is affected by SMT (cross-thread) return predictions */ +#define SMT_RSB BIT(4) static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = { VULNBL_INTEL_STEPPINGS(IVYBRIDGE, X86_STEPPING_ANY, SRBDS), @@ -1266,8 +1268,8 @@ VULNBL_AMD(0x15, RETBLEED), VULNBL_AMD(0x16, RETBLEED), - VULNBL_AMD(0x17, RETBLEED), - VULNBL_HYGON(0x18, RETBLEED), + VULNBL_AMD(0x17, RETBLEED | SMT_RSB), + VULNBL_HYGON(0x18, RETBLEED | SMT_RSB), {} }; @@ -1385,6 +1387,9 @@ !(ia32_cap & ARCH_CAP_PBRSB_NO)) setup_force_cpu_bug(X86_BUG_EIBRS_PBRSB); + if (cpu_matches(cpu_vuln_blacklist, SMT_RSB)) + setup_force_cpu_bug(X86_BUG_SMT_RSB); + if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN)) return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/cpu/resctrl/monitor.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/resctrl/monitor.c @@ -146,6 +146,30 @@ return entry; } +static int __rmid_read(u32 rmid, enum resctrl_event_id eventid, u64 *val) +{ + u64 msr_val; + + /* + * As per the SDM, when IA32_QM_EVTSEL.EvtID (bits 7:0) is configured + * with a valid event code for supported resource type and the bits + * IA32_QM_EVTSEL.RMID (bits 41:32) are configured with valid RMID, + * IA32_QM_CTR.data (bits 61:0) reports the monitored data. + * IA32_QM_CTR.Error (bit 63) and IA32_QM_CTR.Unavailable (bit 62) + * are error bits. + */ + wrmsr(MSR_IA32_QM_EVTSEL, eventid, rmid); + rdmsrl(MSR_IA32_QM_CTR, msr_val); + + if (msr_val & RMID_VAL_ERROR) + return -EIO; + if (msr_val & RMID_VAL_UNAVAIL) + return -EINVAL; + + *val = msr_val; + return 0; +} + static struct arch_mbm_state *get_arch_mbm_state(struct rdt_hw_domain *hw_dom, u32 rmid, enum resctrl_event_id eventid) @@ -172,8 +196,12 @@ struct arch_mbm_state *am; am = get_arch_mbm_state(hw_dom, rmid, eventid); - if (am) + if (am) { memset(am, 0, sizeof(*am)); + + /* Record any initial, non-zero count value. */ + __rmid_read(rmid, eventid, &am->prev_msr); + } } static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width) @@ -191,25 +219,14 @@ struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d); struct arch_mbm_state *am; u64 msr_val, chunks; + int ret; if (!cpumask_test_cpu(smp_processor_id(), &d->cpu_mask)) return -EINVAL; - /* - * As per the SDM, when IA32_QM_EVTSEL.EvtID (bits 7:0) is configured - * with a valid event code for supported resource type and the bits - * IA32_QM_EVTSEL.RMID (bits 41:32) are configured with valid RMID, - * IA32_QM_CTR.data (bits 61:0) reports the monitored data. - * IA32_QM_CTR.Error (bit 63) and IA32_QM_CTR.Unavailable (bit 62) - * are error bits. - */ - wrmsr(MSR_IA32_QM_EVTSEL, eventid, rmid); - rdmsrl(MSR_IA32_QM_CTR, msr_val); - - if (msr_val & RMID_VAL_ERROR) - return -EIO; - if (msr_val & RMID_VAL_UNAVAIL) - return -EINVAL; + ret = __rmid_read(rmid, eventid, &msr_val); + if (ret) + return ret; am = get_arch_mbm_state(hw_dom, rmid, eventid); if (am) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -580,8 +580,10 @@ /* * Ensure the task's closid and rmid are written before determining if * the task is current that will decide if it will be interrupted. + * This pairs with the full barrier between the rq->curr update and + * resctrl_sched_in() during context switch. */ - barrier(); + smp_mb(); /* * By now, the task's closid and rmid are set. If the task is current @@ -2402,6 +2404,14 @@ WRITE_ONCE(t->rmid, to->mon.rmid); /* + * Order the closid/rmid stores above before the loads + * in task_curr(). This pairs with the full barrier + * between the rq->curr update and resctrl_sched_in() + * during context switch. + */ + smp_mb(); + + /* * If the task is on a CPU, set the CPU in the mask. * The detection is inaccurate as tasks might move or * schedule before the smp function call takes place. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/crash_dump_64.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/crash_dump_64.c @@ -57,7 +57,7 @@ struct kvec kvec = { .iov_base = buf, .iov_len = count }; struct iov_iter iter; - iov_iter_kvec(&iter, READ, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); return read_from_oldmem(&iter, count, ppos, cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/fpu/init.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/fpu/init.c @@ -133,9 +133,6 @@ fpu__init_system_mxcsr(); } -/* Get alignment of the TYPE. */ -#define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test) - /* * Enforce that 'MEMBER' is the last field of 'TYPE'. * @@ -143,8 +140,8 @@ * because that's how C aligns structs. */ #define CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) \ - BUILD_BUG_ON(sizeof(TYPE) != ALIGN(offsetofend(TYPE, MEMBER), \ - TYPE_ALIGN(TYPE))) + BUILD_BUG_ON(sizeof(TYPE) != \ + ALIGN(offsetofend(TYPE, MEMBER), _Alignof(TYPE))) /* * We append the 'struct fpu' to the task_struct: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/i8259.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/i8259.c @@ -114,6 +114,7 @@ disable_irq_nosync(irq); io_apic_irqs &= ~(1<init(0); - for (i = 0; i < nr_legacy_irqs(); i++) + for (i = 0; i < nr_legacy_irqs(); i++) { irq_set_chip_and_handler(i, chip, handle_level_irq); + irq_set_status_flags(i, IRQ_LEVEL); + } } void __init init_IRQ(void) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kernel/static_call.c +++ linux-oem-6.1-6.1.0/arch/x86/kernel/static_call.c @@ -9,6 +9,7 @@ NOP = 1, /* site cond-call */ JMP = 2, /* tramp / site tail-call */ RET = 3, /* tramp / site cond-tail-call */ + JCC = 4, }; /* @@ -25,12 +26,39 @@ static const u8 retinsn[] = { RET_INSN_OPCODE, 0xcc, 0xcc, 0xcc, 0xcc }; +static u8 __is_Jcc(u8 *insn) /* Jcc.d32 */ +{ + u8 ret = 0; + + if (insn[0] == 0x0f) { + u8 tmp = insn[1]; + if ((tmp & 0xf0) == 0x80) + ret = tmp; + } + + return ret; +} + +extern void __static_call_return(void); + +asm (".global __static_call_return\n\t" + ".type __static_call_return, @function\n\t" + "__static_call_return:\n\t" + ANNOTATE_NOENDBR + ANNOTATE_RETPOLINE_SAFE + "ret; int3\n\t" + ".size __static_call_return, . - __static_call_return \n\t"); + static void __ref __static_call_transform(void *insn, enum insn_type type, void *func, bool modinit) { const void *emulate = NULL; int size = CALL_INSN_SIZE; const void *code; + u8 op, buf[6]; + + if ((type == JMP || type == RET) && (op = __is_Jcc(insn))) + type = JCC; switch (type) { case CALL: @@ -56,6 +84,20 @@ else code = &retinsn; break; + + case JCC: + if (!func) { + func = __static_call_return; + if (cpu_feature_enabled(X86_FEATURE_RETHUNK)) + func = __x86_return_thunk; + } + + buf[0] = 0x0f; + __text_gen_insn(buf+1, op, insn+1, func, 5); + code = buf; + size = 6; + + break; } if (memcmp(insn, code, size) == 0) @@ -67,9 +109,9 @@ text_poke_bp(insn, code, size, emulate); } -static void __static_call_validate(void *insn, bool tail, bool tramp) +static void __static_call_validate(u8 *insn, bool tail, bool tramp) { - u8 opcode = *(u8 *)insn; + u8 opcode = insn[0]; if (tramp && memcmp(insn+5, tramp_ud, 3)) { pr_err("trampoline signature fail"); @@ -78,7 +120,8 @@ if (tail) { if (opcode == JMP32_INSN_OPCODE || - opcode == RET_INSN_OPCODE) + opcode == RET_INSN_OPCODE || + __is_Jcc(insn)) return; } else { if (opcode == CALL_INSN_OPCODE || only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kvm/cpuid.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/cpuid.c @@ -759,16 +759,22 @@ int nent; }; +static struct kvm_cpuid_entry2 *get_next_cpuid(struct kvm_cpuid_array *array) +{ + if (array->nent >= array->maxnent) + return NULL; + + return &array->entries[array->nent++]; +} + static struct kvm_cpuid_entry2 *do_host_cpuid(struct kvm_cpuid_array *array, u32 function, u32 index) { - struct kvm_cpuid_entry2 *entry; + struct kvm_cpuid_entry2 *entry = get_next_cpuid(array); - if (array->nent >= array->maxnent) + if (!entry) return NULL; - entry = &array->entries[array->nent++]; - memset(entry, 0, sizeof(*entry)); entry->function = function; entry->index = index; @@ -945,22 +951,13 @@ entry->edx = edx.full; break; } - /* - * Per Intel's SDM, the 0x1f is a superset of 0xb, - * thus they can be handled by common code. - */ case 0x1f: case 0xb: /* - * Populate entries until the level type (ECX[15:8]) of the - * previous entry is zero. Note, CPUID EAX.{0x1f,0xb}.0 is - * the starting entry, filled by the primary do_host_cpuid(). + * No topology; a valid topology is indicated by the presence + * of subleaf 1. */ - for (i = 1; entry->ecx & 0xff00; ++i) { - entry = do_host_cpuid(array, function, i); - if (!entry) - goto out; - } + entry->eax = entry->ebx = entry->ecx = 0; break; case 0xd: { u64 permitted_xcr0 = kvm_caps.supported_xcr0 & xstate_get_guest_group_perm(); @@ -1193,6 +1190,9 @@ entry->ebx = entry->ecx = entry->edx = 0; break; case 0x8000001e: + /* Do not return host topology information. */ + entry->eax = entry->ebx = entry->ecx = 0; + entry->edx = 0; /* reserved */ break; case 0x8000001F: if (!kvm_cpu_cap_has(X86_FEATURE_SEV)) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kvm/pmu.h +++ linux-oem-6.1-6.1.0/arch/x86/kvm/pmu.h @@ -164,15 +164,27 @@ { bool is_intel = boot_cpu_data.x86_vendor == X86_VENDOR_INTEL; - perf_get_x86_pmu_capability(&kvm_pmu_cap); - - /* - * For Intel, only support guest architectural pmu - * on a host with architectural pmu. - */ - if ((is_intel && !kvm_pmu_cap.version) || !kvm_pmu_cap.num_counters_gp) + /* + * Hybrid PMUs don't play nice with virtualization without careful + * configuration by userspace, and KVM's APIs for reporting supported + * vPMU features do not account for hybrid PMUs. Disable vPMU support + * for hybrid PMUs until KVM gains a way to let userspace opt-in. + */ + if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) enable_pmu = false; + if (enable_pmu) { + perf_get_x86_pmu_capability(&kvm_pmu_cap); + + /* + * For Intel, only support guest architectural pmu + * on a host with architectural pmu. + */ + if ((is_intel && !kvm_pmu_cap.version) || + !kvm_pmu_cap.num_counters_gp) + enable_pmu = false; + } + if (!enable_pmu) { memset(&kvm_pmu_cap, 0, sizeof(kvm_pmu_cap)); return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kvm/svm/svm.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/svm/svm.c @@ -3889,8 +3889,14 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu) { - if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR && - to_svm(vcpu)->vmcb->control.exit_info_1) + struct vmcb_control_area *control = &to_svm(vcpu)->vmcb->control; + + /* + * Note, the next RIP must be provided as SRCU isn't held, i.e. KVM + * can't read guest memory (dereference memslots) to decode the WRMSR. + */ + if (control->exit_code == SVM_EXIT_MSR && control->exit_info_1 && + nrips && control->next_rip) return handle_fastpath_set_msr_irqoff(vcpu); return EXIT_FASTPATH_NONE; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kvm/vmx/vmx.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/vmx/vmx.c @@ -1348,8 +1348,10 @@ /* * No indirect branch prediction barrier needed when switching - * the active VMCS within a guest, e.g. on nested VM-Enter. - * The L1 VMM can protect itself with retpolines, IBPB or IBRS. + * the active VMCS within a vCPU, unless IBRS is advertised to + * the vCPU. To minimize the number of IBPBs executed, KVM + * performs IBPB on nested VM-Exit (a single nested transition + * may switch the active VMCS multiple times). */ if (!buddy || WARN_ON_ONCE(buddy->vmcs != prev)) indirect_branch_prediction_barrier(); @@ -3412,18 +3414,15 @@ { u32 ar; - if (var->unusable || !var->present) - ar = 1 << 16; - else { - ar = var->type & 15; - ar |= (var->s & 1) << 4; - ar |= (var->dpl & 3) << 5; - ar |= (var->present & 1) << 7; - ar |= (var->avl & 1) << 12; - ar |= (var->l & 1) << 13; - ar |= (var->db & 1) << 14; - ar |= (var->g & 1) << 15; - } + ar = var->type & 15; + ar |= (var->s & 1) << 4; + ar |= (var->dpl & 3) << 5; + ar |= (var->present & 1) << 7; + ar |= (var->avl & 1) << 12; + ar |= (var->l & 1) << 13; + ar |= (var->db & 1) << 14; + ar |= (var->g & 1) << 15; + ar |= (var->unusable || !var->present) << 16; return ar; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/kvm/xen.c +++ linux-oem-6.1-6.1.0/arch/x86/kvm/xen.c @@ -1757,18 +1757,42 @@ static int kvm_xen_eventfd_reset(struct kvm *kvm) { - struct evtchnfd *evtchnfd; + struct evtchnfd *evtchnfd, **all_evtchnfds; int i; + int n = 0; mutex_lock(&kvm->lock); + + /* + * Because synchronize_srcu() cannot be called inside the + * critical section, first collect all the evtchnfd objects + * in an array as they are removed from evtchn_ports. + */ + idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) + n++; + + all_evtchnfds = kmalloc_array(n, sizeof(struct evtchnfd *), GFP_KERNEL); + if (!all_evtchnfds) { + mutex_unlock(&kvm->lock); + return -ENOMEM; + } + + n = 0; idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) { + all_evtchnfds[n++] = evtchnfd; idr_remove(&kvm->arch.xen.evtchn_ports, evtchnfd->send_port); - synchronize_srcu(&kvm->srcu); + } + mutex_unlock(&kvm->lock); + + synchronize_srcu(&kvm->srcu); + + while (n--) { + evtchnfd = all_evtchnfds[n]; if (!evtchnfd->deliver.port.port) eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx); kfree(evtchnfd); } - mutex_unlock(&kvm->lock); + kfree(all_evtchnfds); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/lib/iomap_copy_64.S +++ linux-oem-6.1-6.1.0/arch/x86/lib/iomap_copy_64.S @@ -10,6 +10,6 @@ */ SYM_FUNC_START(__iowrite32_copy) movl %edx,%ecx - rep movsd + rep movsl RET SYM_FUNC_END(__iowrite32_copy) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/mm/pat/memtype.c +++ linux-oem-6.1-6.1.0/arch/x86/mm/pat/memtype.c @@ -434,7 +434,8 @@ u8 mtrr_type, uniform; mtrr_type = mtrr_type_lookup(start, end, &uniform); - if (mtrr_type != MTRR_TYPE_WRBACK) + if (mtrr_type != MTRR_TYPE_WRBACK && + mtrr_type != MTRR_TYPE_INVALID) return _PAGE_CACHE_MODE_UC_MINUS; return _PAGE_CACHE_MODE_WB; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/arch/x86/um/elfcore.c +++ linux-oem-6.1-6.1.0/arch/x86/um/elfcore.c @@ -7,7 +7,7 @@ #include -Elf32_Half elf_core_extra_phdrs(void) +Elf32_Half elf_core_extra_phdrs(struct coredump_params *cprm) { return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0; } @@ -60,7 +60,7 @@ return 1; } -size_t elf_core_extra_data_size(void) +size_t elf_core_extra_data_size(struct coredump_params *cprm) { if ( vsyscall_ehdr ) { const struct elfhdr *const ehdrp = only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/block/bfq-cgroup.c +++ linux-oem-6.1-6.1.0/block/bfq-cgroup.c @@ -718,15 +718,15 @@ struct bfq_io_cq *bic, struct bfq_group *bfqg) { - struct bfq_queue *async_bfqq = bic_to_bfqq(bic, 0); - struct bfq_queue *sync_bfqq = bic_to_bfqq(bic, 1); + struct bfq_queue *async_bfqq = bic_to_bfqq(bic, false); + struct bfq_queue *sync_bfqq = bic_to_bfqq(bic, true); struct bfq_entity *entity; if (async_bfqq) { entity = &async_bfqq->entity; if (entity->sched_data != &bfqg->sched_data) { - bic_set_bfqq(bic, NULL, 0); + bic_set_bfqq(bic, NULL, false); bfq_release_process_ref(bfqd, async_bfqq); } } @@ -761,8 +761,8 @@ * request from the old cgroup. */ bfq_put_cooperator(sync_bfqq); + bic_set_bfqq(bic, NULL, true); bfq_release_process_ref(bfqd, sync_bfqq); - bic_set_bfqq(bic, NULL, 1); } } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/certs/Makefile +++ linux-oem-6.1-6.1.0/certs/Makefile @@ -23,8 +23,8 @@ targets += blacklist_hash_list quiet_cmd_extract_certs = CERT $@ - cmd_extract_certs = $(obj)/extract-cert $(extract-cert-in) $@ -extract-cert-in = $(or $(filter-out $(obj)/extract-cert, $(real-prereqs)),"") + cmd_extract_certs = $(obj)/extract-cert "$(extract-cert-in)" $@ +extract-cert-in = $(filter-out $(obj)/extract-cert, $(real-prereqs)) $(obj)/system_certificates.o: $(obj)/x509_certificate_list only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/crypto/testmgr.c +++ linux-oem-6.1-6.1.0/crypto/testmgr.c @@ -766,7 +766,7 @@ struct iov_iter input; int err; - iov_iter_kvec(&input, WRITE, inputs, nr_inputs, src_total_len); + iov_iter_kvec(&input, ITER_SOURCE, inputs, nr_inputs, src_total_len); err = build_test_sglist(&tsgls->src, cfg->src_divs, alignmask, cfg->inplace_mode != OUT_OF_PLACE ? max(dst_total_len, src_total_len) : @@ -1180,7 +1180,7 @@ kv.iov_base = (void *)vec->plaintext; kv.iov_len = vec->psize; - iov_iter_kvec(&input, WRITE, &kv, 1, vec->psize); + iov_iter_kvec(&input, ITER_SOURCE, &kv, 1, vec->psize); return build_test_sglist(tsgl, cfg->src_divs, alignmask, vec->psize, &input, divs); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/debian.oem/upstream-stable +++ linux-oem-6.1-6.1.0/debian.oem/upstream-stable @@ -0,0 +1,3 @@ +# The following upstream stable releases have been ported: +[upstream-stable] + linux-6.1.y = v6.1.14 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/accessibility/speakup/spk_ttyio.c +++ linux-oem-6.1-6.1.0/drivers/accessibility/speakup/spk_ttyio.c @@ -354,6 +354,9 @@ { struct tty_struct *tty = in_synth->dev; + if (tty == NULL) + return; + tty_lock(tty); if (tty->ops->close) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/acpi/glue.c +++ linux-oem-6.1-6.1.0/drivers/acpi/glue.c @@ -75,7 +75,8 @@ } #define FIND_CHILD_MIN_SCORE 1 -#define FIND_CHILD_MAX_SCORE 2 +#define FIND_CHILD_MID_SCORE 2 +#define FIND_CHILD_MAX_SCORE 3 static int match_any(struct acpi_device *adev, void *not_used) { @@ -96,8 +97,17 @@ return -ENODEV; status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); - if (status == AE_NOT_FOUND) + if (status == AE_NOT_FOUND) { + /* + * Special case: backlight device objects without _STA are + * preferred to other objects with the same _ADR value, because + * it is more likely that they are actually useful. + */ + if (adev->pnp.type.backlight) + return FIND_CHILD_MID_SCORE; + return FIND_CHILD_MIN_SCORE; + } if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_ENABLED)) return -ENODEV; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/acpi/prmt.c +++ linux-oem-6.1-6.1.0/drivers/acpi/prmt.c @@ -236,6 +236,11 @@ efi_status_t status; struct prm_context_buffer context; + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + pr_err_ratelimited("PRM: EFI runtime services no longer available\n"); + return AE_NO_HANDLER; + } + /* * The returned acpi_status will always be AE_OK. Error values will be * saved in the first byte of the PRM message buffer to be used by ASL. @@ -325,6 +330,11 @@ pr_info("PRM: found %u modules\n", mc); + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + pr_err("PRM: EFI runtime services unavailable\n"); + return; + } + status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, ACPI_ADR_SPACE_PLATFORM_RT, &acpi_platformrt_space_handler, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/acpi/scan.c +++ linux-oem-6.1-6.1.0/drivers/acpi/scan.c @@ -1370,9 +1370,12 @@ * Some devices don't reliably have _HIDs & _CIDs, so add * synthetic HIDs to make sure drivers can find them. */ - if (acpi_is_video_device(handle)) + if (acpi_is_video_device(handle)) { acpi_add_id(pnp, ACPI_VIDEO_HID); - else if (acpi_bay_match(handle)) + pnp->type.backlight = 1; + break; + } + if (acpi_bay_match(handle)) acpi_add_id(pnp, ACPI_BAY_HID); else if (acpi_dock_match(handle)) acpi_add_id(pnp, ACPI_DOCK_HID); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/acpi/sleep.c +++ linux-oem-6.1-6.1.0/drivers/acpi/sleep.c @@ -60,13 +60,17 @@ .priority = 0, }; +#ifndef acpi_skip_set_wakeup_address +#define acpi_skip_set_wakeup_address() false +#endif + static int acpi_sleep_prepare(u32 acpi_state) { #ifdef CONFIG_ACPI_SLEEP unsigned long acpi_wakeup_address; /* do we have a wakeup address for S2 and S3? */ - if (acpi_state == ACPI_STATE_S3) { + if (acpi_state == ACPI_STATE_S3 && !acpi_skip_set_wakeup_address()) { acpi_wakeup_address = acpi_get_wakeup_address(); if (!acpi_wakeup_address) return -EFAULT; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/ata/Kconfig +++ linux-oem-6.1-6.1.0/drivers/ata/Kconfig @@ -650,6 +650,7 @@ config PATA_CS5535 tristate "CS5535 PATA support (Experimental)" depends on PCI && (X86_32 || (X86_64 && COMPILE_TEST)) + depends on !UML help This option enables support for the NatSemi/AMD CS5535 companion chip used with the Geode processor family. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/ata/libata-core.c +++ linux-oem-6.1-6.1.0/drivers/ata/libata-core.c @@ -3108,7 +3108,7 @@ */ if (spd > 1) mask &= (1 << (spd - 1)) - 1; - else + else if (link->sata_spd) return -EINVAL; /* were we already at the bottom? */ @@ -4044,6 +4044,9 @@ { "Samsung SSD 870*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ATA_HORKAGE_ZERO_AFTER_TRIM | ATA_HORKAGE_NO_NCQ_ON_ATI }, + { "SAMSUNG*MZ7LH*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | + ATA_HORKAGE_ZERO_AFTER_TRIM | + ATA_HORKAGE_NO_NCQ_ON_ATI, }, { "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ATA_HORKAGE_ZERO_AFTER_TRIM }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/base/property.c +++ linux-oem-6.1-6.1.0/drivers/base/property.c @@ -989,26 +989,32 @@ fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode, struct fwnode_handle *prev) { + struct fwnode_handle *ep, *port_parent = NULL; const struct fwnode_handle *parent; - struct fwnode_handle *ep; /* * If this function is in a loop and the previous iteration returned * an endpoint from fwnode->secondary, then we need to use the secondary * as parent rather than @fwnode. */ - if (prev) - parent = fwnode_graph_get_port_parent(prev); - else + if (prev) { + port_parent = fwnode_graph_get_port_parent(prev); + parent = port_parent; + } else { parent = fwnode; + } if (IS_ERR_OR_NULL(parent)) return NULL; ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev); if (ep) - return ep; + goto out_put_port_parent; - return fwnode_graph_get_next_endpoint(parent->secondary, NULL); + ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); + +out_put_port_parent: + fwnode_handle_put(port_parent); + return ep; } EXPORT_SYMBOL_GPL(fwnode_graph_get_next_endpoint); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/base/test/test_async_driver_probe.c +++ linux-oem-6.1-6.1.0/drivers/base/test/test_async_driver_probe.c @@ -145,7 +145,7 @@ calltime = ktime_get(); for_each_online_cpu(cpu) { nid = cpu_to_node(cpu); - pdev = &sync_dev[sync_id]; + pdev = &async_dev[async_id]; *pdev = test_platform_device_register_node("test_async_driver", async_id, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/block/drbd/drbd_receiver.c +++ linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_receiver.c @@ -507,7 +507,7 @@ struct msghdr msg = { .msg_flags = (flags ? flags : MSG_WAITALL | MSG_NOSIGNAL) }; - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, size); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, size); return sock_recvmsg(sock, &msg, msg.msg_flags); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/block/drbd/drbd_req.c +++ linux-oem-6.1-6.1.0/drivers/block/drbd/drbd_req.c @@ -1607,6 +1607,8 @@ struct drbd_device *device = bio->bi_bdev->bd_disk->private_data; bio = bio_split_to_limits(bio); + if (!bio) + return; /* * what we "blindly" assume: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/block/pktcdvd.c +++ linux-oem-6.1-6.1.0/drivers/block/pktcdvd.c @@ -2400,6 +2400,8 @@ struct bio *split; bio = bio_split_to_limits(bio); + if (!bio) + return; pkt_dbg(2, pd, "start = %6llx stop = %6llx\n", (unsigned long long)bio->bi_iter.bi_sector, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/block/ps3vram.c +++ linux-oem-6.1-6.1.0/drivers/block/ps3vram.c @@ -587,6 +587,8 @@ dev_dbg(&dev->core, "%s\n", __func__); bio = bio_split_to_limits(bio); + if (!bio) + return; spin_lock_irq(&priv->lock); busy = !bio_list_empty(&priv->list); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/block/rnbd/rnbd-clt.c +++ linux-oem-6.1-6.1.0/drivers/block/rnbd/rnbd-clt.c @@ -1440,7 +1440,7 @@ goto out_alloc; } - ret = ida_alloc_max(&index_ida, 1 << (MINORBITS - RNBD_PART_BITS), + ret = ida_alloc_max(&index_ida, (1 << (MINORBITS - RNBD_PART_BITS)) - 1, GFP_KERNEL); if (ret < 0) { pr_err("Failed to initialize device '%s' from session %s, allocating idr failed, err: %d\n", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/bluetooth/btrtl.c +++ linux-oem-6.1-6.1.0/drivers/bluetooth/btrtl.c @@ -781,6 +781,13 @@ case CHIP_ID_8852C: set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); + + /* RTL8852C needs to transmit mSBC data continuously without + * the zero length of USB packets for the ALT 6 supported chips + */ + if (btrtl_dev->project_id == CHIP_ID_8852C) + btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP); + hci_set_aosp_capable(hdev); break; default: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/bluetooth/btrtl.h +++ linux-oem-6.1-6.1.0/drivers/bluetooth/btrtl.h @@ -47,6 +47,27 @@ struct rtl_vendor_config_entry entry[]; } __packed; +enum { + REALTEK_ALT6_CONTINUOUS_TX_CHIP, + + __REALTEK_NUM_FLAGS, +}; + +struct btrealtek_data { + DECLARE_BITMAP(flags, __REALTEK_NUM_FLAGS); +}; + +#define btrealtek_set_flag(hdev, nr) \ + do { \ + struct btrealtek_data *realtek = hci_get_priv((hdev)); \ + set_bit((nr), realtek->flags); \ + } while (0) + +#define btrealtek_get_flag(hdev) \ + (((struct btrealtek_data *)hci_get_priv(hdev))->flags) + +#define btrealtek_test_flag(hdev, nr) test_bit((nr), btrealtek_get_flag(hdev)) + #if IS_ENABLED(CONFIG_BT_RTL) struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/bus/sunxi-rsb.c +++ linux-oem-6.1-6.1.0/drivers/bus/sunxi-rsb.c @@ -857,7 +857,13 @@ return ret; } - return platform_driver_register(&sunxi_rsb_driver); + ret = platform_driver_register(&sunxi_rsb_driver); + if (ret) { + bus_unregister(&sunxi_rsb_bus); + return ret; + } + + return 0; } module_init(sunxi_rsb_init); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/ingenic/jz4760-cgu.c +++ linux-oem-6.1-6.1.0/drivers/clk/ingenic/jz4760-cgu.c @@ -58,7 +58,7 @@ unsigned long rate, unsigned long parent_rate, unsigned int *pm, unsigned int *pn, unsigned int *pod) { - unsigned int m, n, od, m_max = (1 << pll_info->m_bits) - 2; + unsigned int m, n, od, m_max = (1 << pll_info->m_bits) - 1; /* The frequency after the N divider must be between 1 and 50 MHz. */ n = parent_rate / (1 * MHZ); @@ -66,19 +66,17 @@ /* The N divider must be >= 2. */ n = clamp_val(n, 2, 1 << pll_info->n_bits); - for (;; n >>= 1) { - od = (unsigned int)-1; + rate /= MHZ; + parent_rate /= MHZ; - do { - m = (rate / MHZ) * (1 << ++od) * n / (parent_rate / MHZ); - } while ((m > m_max || m & 1) && (od < 4)); - - if (od < 4 && m >= 4 && m <= m_max) - break; + for (m = m_max; m >= m_max && n >= 2; n--) { + m = rate * n / parent_rate; + od = m & 1; + m <<= od; } *pm = m; - *pn = n; + *pn = n + 1; *pod = 1 << od; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/x86/Kconfig +++ linux-oem-6.1-6.1.0/drivers/clk/x86/Kconfig @@ -1,8 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-only config CLK_LGM_CGU depends on OF && HAS_IOMEM && (X86 || COMPILE_TEST) + select MFD_SYSCON select OF_EARLY_FLATTREE bool "Clock driver for Lightning Mountain(LGM) platform" help - Clock Generation Unit(CGU) driver for Intel Lightning Mountain(LGM) - network processor SoC. + Clock Generation Unit(CGU) driver for MaxLinear's x86 based + Lightning Mountain(LGM) network processor SoC. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/x86/clk-cgu-pll.c +++ linux-oem-6.1-6.1.0/drivers/clk/x86/clk-cgu-pll.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* + * Copyright (C) 2020-2022 MaxLinear, Inc. * Copyright (C) 2020 Intel Corporation. - * Zhu YiXin - * Rahul Tanwar + * Zhu Yixin + * Rahul Tanwar */ #include @@ -40,13 +41,10 @@ { struct lgm_clk_pll *pll = to_lgm_clk_pll(hw); unsigned int div, mult, frac; - unsigned long flags; - spin_lock_irqsave(&pll->lock, flags); mult = lgm_get_clk_val(pll->membase, PLL_REF_DIV(pll->reg), 0, 12); div = lgm_get_clk_val(pll->membase, PLL_REF_DIV(pll->reg), 18, 6); frac = lgm_get_clk_val(pll->membase, pll->reg, 2, 24); - spin_unlock_irqrestore(&pll->lock, flags); if (pll->type == TYPE_LJPLL) div *= 4; @@ -57,12 +55,9 @@ static int lgm_pll_is_enabled(struct clk_hw *hw) { struct lgm_clk_pll *pll = to_lgm_clk_pll(hw); - unsigned long flags; unsigned int ret; - spin_lock_irqsave(&pll->lock, flags); ret = lgm_get_clk_val(pll->membase, pll->reg, 0, 1); - spin_unlock_irqrestore(&pll->lock, flags); return ret; } @@ -70,15 +65,13 @@ static int lgm_pll_enable(struct clk_hw *hw) { struct lgm_clk_pll *pll = to_lgm_clk_pll(hw); - unsigned long flags; u32 val; int ret; - spin_lock_irqsave(&pll->lock, flags); lgm_set_clk_val(pll->membase, pll->reg, 0, 1, 1); - ret = readl_poll_timeout_atomic(pll->membase + pll->reg, - val, (val & 0x1), 1, 100); - spin_unlock_irqrestore(&pll->lock, flags); + ret = regmap_read_poll_timeout_atomic(pll->membase, pll->reg, + val, (val & 0x1), 1, 100); + return ret; } @@ -86,11 +79,8 @@ static void lgm_pll_disable(struct clk_hw *hw) { struct lgm_clk_pll *pll = to_lgm_clk_pll(hw); - unsigned long flags; - spin_lock_irqsave(&pll->lock, flags); lgm_set_clk_val(pll->membase, pll->reg, 0, 1, 0); - spin_unlock_irqrestore(&pll->lock, flags); } static const struct clk_ops lgm_pll_ops = { @@ -121,7 +111,6 @@ return ERR_PTR(-ENOMEM); pll->membase = ctx->membase; - pll->lock = ctx->lock; pll->reg = list->reg; pll->flags = list->flags; pll->type = list->type; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/x86/clk-cgu.c +++ linux-oem-6.1-6.1.0/drivers/clk/x86/clk-cgu.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* + * Copyright (C) 2020-2022 MaxLinear, Inc. * Copyright (C) 2020 Intel Corporation. - * Zhu YiXin - * Rahul Tanwar + * Zhu Yixin + * Rahul Tanwar */ #include #include @@ -24,14 +25,10 @@ static struct clk_hw *lgm_clk_register_fixed(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list) { - unsigned long flags; - if (list->div_flags & CLOCK_FLAG_VAL_INIT) { - spin_lock_irqsave(&ctx->lock, flags); + if (list->div_flags & CLOCK_FLAG_VAL_INIT) lgm_set_clk_val(ctx->membase, list->div_off, list->div_shift, list->div_width, list->div_val); - spin_unlock_irqrestore(&ctx->lock, flags); - } return clk_hw_register_fixed_rate(NULL, list->name, list->parent_data[0].name, @@ -41,33 +38,27 @@ static u8 lgm_clk_mux_get_parent(struct clk_hw *hw) { struct lgm_clk_mux *mux = to_lgm_clk_mux(hw); - unsigned long flags; u32 val; - spin_lock_irqsave(&mux->lock, flags); if (mux->flags & MUX_CLK_SW) val = mux->reg; else val = lgm_get_clk_val(mux->membase, mux->reg, mux->shift, mux->width); - spin_unlock_irqrestore(&mux->lock, flags); return clk_mux_val_to_index(hw, NULL, mux->flags, val); } static int lgm_clk_mux_set_parent(struct clk_hw *hw, u8 index) { struct lgm_clk_mux *mux = to_lgm_clk_mux(hw); - unsigned long flags; u32 val; val = clk_mux_index_to_val(NULL, mux->flags, index); - spin_lock_irqsave(&mux->lock, flags); if (mux->flags & MUX_CLK_SW) mux->reg = val; else lgm_set_clk_val(mux->membase, mux->reg, mux->shift, mux->width, val); - spin_unlock_irqrestore(&mux->lock, flags); return 0; } @@ -90,7 +81,7 @@ lgm_clk_register_mux(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list) { - unsigned long flags, cflags = list->mux_flags; + unsigned long cflags = list->mux_flags; struct device *dev = ctx->dev; u8 shift = list->mux_shift; u8 width = list->mux_width; @@ -111,7 +102,6 @@ init.num_parents = list->num_parents; mux->membase = ctx->membase; - mux->lock = ctx->lock; mux->reg = reg; mux->shift = shift; mux->width = width; @@ -123,11 +113,8 @@ if (ret) return ERR_PTR(ret); - if (cflags & CLOCK_FLAG_VAL_INIT) { - spin_lock_irqsave(&mux->lock, flags); + if (cflags & CLOCK_FLAG_VAL_INIT) lgm_set_clk_val(mux->membase, reg, shift, width, list->mux_val); - spin_unlock_irqrestore(&mux->lock, flags); - } return hw; } @@ -136,13 +123,10 @@ lgm_clk_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct lgm_clk_divider *divider = to_lgm_clk_divider(hw); - unsigned long flags; unsigned int val; - spin_lock_irqsave(÷r->lock, flags); val = lgm_get_clk_val(divider->membase, divider->reg, divider->shift, divider->width); - spin_unlock_irqrestore(÷r->lock, flags); return divider_recalc_rate(hw, parent_rate, val, divider->table, divider->flags, divider->width); @@ -163,7 +147,6 @@ unsigned long prate) { struct lgm_clk_divider *divider = to_lgm_clk_divider(hw); - unsigned long flags; int value; value = divider_get_val(rate, prate, divider->table, @@ -171,10 +154,8 @@ if (value < 0) return value; - spin_lock_irqsave(÷r->lock, flags); lgm_set_clk_val(divider->membase, divider->reg, divider->shift, divider->width, value); - spin_unlock_irqrestore(÷r->lock, flags); return 0; } @@ -182,12 +163,10 @@ static int lgm_clk_divider_enable_disable(struct clk_hw *hw, int enable) { struct lgm_clk_divider *div = to_lgm_clk_divider(hw); - unsigned long flags; - spin_lock_irqsave(&div->lock, flags); - lgm_set_clk_val(div->membase, div->reg, div->shift_gate, - div->width_gate, enable); - spin_unlock_irqrestore(&div->lock, flags); + if (div->flags != DIV_CLK_NO_MASK) + lgm_set_clk_val(div->membase, div->reg, div->shift_gate, + div->width_gate, enable); return 0; } @@ -213,7 +192,7 @@ lgm_clk_register_divider(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list) { - unsigned long flags, cflags = list->div_flags; + unsigned long cflags = list->div_flags; struct device *dev = ctx->dev; struct lgm_clk_divider *div; struct clk_init_data init = {}; @@ -236,7 +215,6 @@ init.num_parents = 1; div->membase = ctx->membase; - div->lock = ctx->lock; div->reg = reg; div->shift = shift; div->width = width; @@ -251,11 +229,8 @@ if (ret) return ERR_PTR(ret); - if (cflags & CLOCK_FLAG_VAL_INIT) { - spin_lock_irqsave(&div->lock, flags); + if (cflags & CLOCK_FLAG_VAL_INIT) lgm_set_clk_val(div->membase, reg, shift, width, list->div_val); - spin_unlock_irqrestore(&div->lock, flags); - } return hw; } @@ -264,7 +239,6 @@ lgm_clk_register_fixed_factor(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list) { - unsigned long flags; struct clk_hw *hw; hw = clk_hw_register_fixed_factor(ctx->dev, list->name, @@ -273,12 +247,9 @@ if (IS_ERR(hw)) return ERR_CAST(hw); - if (list->div_flags & CLOCK_FLAG_VAL_INIT) { - spin_lock_irqsave(&ctx->lock, flags); + if (list->div_flags & CLOCK_FLAG_VAL_INIT) lgm_set_clk_val(ctx->membase, list->div_off, list->div_shift, list->div_width, list->div_val); - spin_unlock_irqrestore(&ctx->lock, flags); - } return hw; } @@ -286,13 +257,10 @@ static int lgm_clk_gate_enable(struct clk_hw *hw) { struct lgm_clk_gate *gate = to_lgm_clk_gate(hw); - unsigned long flags; unsigned int reg; - spin_lock_irqsave(&gate->lock, flags); reg = GATE_HW_REG_EN(gate->reg); lgm_set_clk_val(gate->membase, reg, gate->shift, 1, 1); - spin_unlock_irqrestore(&gate->lock, flags); return 0; } @@ -300,25 +268,19 @@ static void lgm_clk_gate_disable(struct clk_hw *hw) { struct lgm_clk_gate *gate = to_lgm_clk_gate(hw); - unsigned long flags; unsigned int reg; - spin_lock_irqsave(&gate->lock, flags); reg = GATE_HW_REG_DIS(gate->reg); lgm_set_clk_val(gate->membase, reg, gate->shift, 1, 1); - spin_unlock_irqrestore(&gate->lock, flags); } static int lgm_clk_gate_is_enabled(struct clk_hw *hw) { struct lgm_clk_gate *gate = to_lgm_clk_gate(hw); unsigned int reg, ret; - unsigned long flags; - spin_lock_irqsave(&gate->lock, flags); reg = GATE_HW_REG_STAT(gate->reg); ret = lgm_get_clk_val(gate->membase, reg, gate->shift, 1); - spin_unlock_irqrestore(&gate->lock, flags); return ret; } @@ -333,7 +295,7 @@ lgm_clk_register_gate(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list) { - unsigned long flags, cflags = list->gate_flags; + unsigned long cflags = list->gate_flags; const char *pname = list->parent_data[0].name; struct device *dev = ctx->dev; u8 shift = list->gate_shift; @@ -354,7 +316,6 @@ init.num_parents = pname ? 1 : 0; gate->membase = ctx->membase; - gate->lock = ctx->lock; gate->reg = reg; gate->shift = shift; gate->flags = cflags; @@ -366,9 +327,7 @@ return ERR_PTR(ret); if (cflags & CLOCK_FLAG_VAL_INIT) { - spin_lock_irqsave(&gate->lock, flags); lgm_set_clk_val(gate->membase, reg, shift, 1, list->gate_val); - spin_unlock_irqrestore(&gate->lock, flags); } return hw; @@ -396,8 +355,22 @@ hw = lgm_clk_register_fixed_factor(ctx, list); break; case CLK_TYPE_GATE: - hw = lgm_clk_register_gate(ctx, list); + if (list->gate_flags & GATE_CLK_HW) { + hw = lgm_clk_register_gate(ctx, list); + } else { + /* + * GATE_CLKs can be controlled either from + * CGU clk driver i.e. this driver or directly + * from power management driver/daemon. It is + * dependent on the power policy/profile requirements + * of the end product. To override control of gate + * clks from this driver, provide NULL for this index + * of gate clk provider. + */ + hw = NULL; + } break; + default: dev_err(ctx->dev, "invalid clk type\n"); return -EINVAL; @@ -443,24 +416,18 @@ static int lgm_clk_ddiv_enable(struct clk_hw *hw) { struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); - unsigned long flags; - spin_lock_irqsave(&ddiv->lock, flags); lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift_gate, ddiv->width_gate, 1); - spin_unlock_irqrestore(&ddiv->lock, flags); return 0; } static void lgm_clk_ddiv_disable(struct clk_hw *hw) { struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); - unsigned long flags; - spin_lock_irqsave(&ddiv->lock, flags); lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift_gate, ddiv->width_gate, 0); - spin_unlock_irqrestore(&ddiv->lock, flags); } static int @@ -497,32 +464,25 @@ { struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); u32 div, ddiv1, ddiv2; - unsigned long flags; div = DIV_ROUND_CLOSEST_ULL((u64)prate, rate); - spin_lock_irqsave(&ddiv->lock, flags); if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); div = div * 2; } - if (div <= 0) { - spin_unlock_irqrestore(&ddiv->lock, flags); + if (div <= 0) return -EINVAL; - } - if (lgm_clk_get_ddiv_val(div, &ddiv1, &ddiv2)) { - spin_unlock_irqrestore(&ddiv->lock, flags); + if (lgm_clk_get_ddiv_val(div, &ddiv1, &ddiv2)) return -EINVAL; - } lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift0, ddiv->width0, ddiv1 - 1); lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift1, ddiv->width1, ddiv2 - 1); - spin_unlock_irqrestore(&ddiv->lock, flags); return 0; } @@ -533,18 +493,15 @@ { struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw); u32 div, ddiv1, ddiv2; - unsigned long flags; u64 rate64; div = DIV_ROUND_CLOSEST_ULL((u64)*prate, rate); /* if predivide bit is enabled, modify div by factor of 2.5 */ - spin_lock_irqsave(&ddiv->lock, flags); if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { div = div * 2; div = DIV_ROUND_CLOSEST_ULL((u64)div, 5); } - spin_unlock_irqrestore(&ddiv->lock, flags); if (div <= 0) return *prate; @@ -558,12 +515,10 @@ do_div(rate64, ddiv2); /* if predivide bit is enabled, modify rounded rate by factor of 2.5 */ - spin_lock_irqsave(&ddiv->lock, flags); if (lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift2, 1)) { rate64 = rate64 * 2; rate64 = DIV_ROUND_CLOSEST_ULL(rate64, 5); } - spin_unlock_irqrestore(&ddiv->lock, flags); return rate64; } @@ -600,7 +555,6 @@ init.num_parents = 1; ddiv->membase = ctx->membase; - ddiv->lock = ctx->lock; ddiv->reg = list->reg; ddiv->shift0 = list->shift0; ddiv->width0 = list->width0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/x86/clk-cgu.h +++ linux-oem-6.1-6.1.0/drivers/clk/x86/clk-cgu.h @@ -1,28 +1,28 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright(c) 2020 Intel Corporation. - * Zhu YiXin - * Rahul Tanwar + * Copyright (C) 2020-2022 MaxLinear, Inc. + * Copyright (C) 2020 Intel Corporation. + * Zhu Yixin + * Rahul Tanwar */ #ifndef __CLK_CGU_H #define __CLK_CGU_H -#include +#include struct lgm_clk_mux { struct clk_hw hw; - void __iomem *membase; + struct regmap *membase; unsigned int reg; u8 shift; u8 width; unsigned long flags; - spinlock_t lock; }; struct lgm_clk_divider { struct clk_hw hw; - void __iomem *membase; + struct regmap *membase; unsigned int reg; u8 shift; u8 width; @@ -30,12 +30,11 @@ u8 width_gate; unsigned long flags; const struct clk_div_table *table; - spinlock_t lock; }; struct lgm_clk_ddiv { struct clk_hw hw; - void __iomem *membase; + struct regmap *membase; unsigned int reg; u8 shift0; u8 width0; @@ -48,16 +47,14 @@ unsigned int mult; unsigned int div; unsigned long flags; - spinlock_t lock; }; struct lgm_clk_gate { struct clk_hw hw; - void __iomem *membase; + struct regmap *membase; unsigned int reg; u8 shift; unsigned long flags; - spinlock_t lock; }; enum lgm_clk_type { @@ -77,11 +74,10 @@ * @clk_data: array of hw clocks and clk number. */ struct lgm_clk_provider { - void __iomem *membase; + struct regmap *membase; struct device_node *np; struct device *dev; struct clk_hw_onecell_data clk_data; - spinlock_t lock; }; enum pll_type { @@ -92,11 +88,10 @@ struct lgm_clk_pll { struct clk_hw hw; - void __iomem *membase; + struct regmap *membase; unsigned int reg; unsigned long flags; enum pll_type type; - spinlock_t lock; }; /** @@ -202,6 +197,8 @@ /* clock flags definition */ #define CLOCK_FLAG_VAL_INIT BIT(16) #define MUX_CLK_SW BIT(17) +#define GATE_CLK_HW BIT(18) +#define DIV_CLK_NO_MASK BIT(19) #define LGM_MUX(_id, _name, _pdata, _f, _reg, \ _shift, _width, _cf, _v) \ @@ -300,29 +297,32 @@ .div = _d, \ } -static inline void lgm_set_clk_val(void __iomem *membase, u32 reg, +static inline void lgm_set_clk_val(struct regmap *membase, u32 reg, u8 shift, u8 width, u32 set_val) { u32 mask = (GENMASK(width - 1, 0) << shift); - u32 regval; - regval = readl(membase + reg); - regval = (regval & ~mask) | ((set_val << shift) & mask); - writel(regval, membase + reg); + regmap_update_bits(membase, reg, mask, set_val << shift); } -static inline u32 lgm_get_clk_val(void __iomem *membase, u32 reg, +static inline u32 lgm_get_clk_val(struct regmap *membase, u32 reg, u8 shift, u8 width) { u32 mask = (GENMASK(width - 1, 0) << shift); u32 val; - val = readl(membase + reg); + if (regmap_read(membase, reg, &val)) { + WARN_ONCE(1, "Failed to read clk reg: 0x%x\n", reg); + return 0; + } + val = (val & mask) >> shift; return val; } + + int lgm_clk_register_branches(struct lgm_clk_provider *ctx, const struct lgm_clk_branch *list, unsigned int nr_clk); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/clk/x86/clk-lgm.c +++ linux-oem-6.1-6.1.0/drivers/clk/x86/clk-lgm.c @@ -1,10 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 /* + * Copyright (C) 2020-2022 MaxLinear, Inc. * Copyright (C) 2020 Intel Corporation. - * Zhu YiXin - * Rahul Tanwar + * Zhu Yixin + * Rahul Tanwar */ #include +#include #include #include #include @@ -253,8 +255,8 @@ LGM_FIXED(LGM_CLK_SLIC, "slic", NULL, 0, CGU_IF_CLK1, 8, 2, CLOCK_FLAG_VAL_INIT, 8192000, 2), LGM_FIXED(LGM_CLK_DOCSIS, "v_docsis", NULL, 0, 0, 0, 0, 0, 16000000, 0), - LGM_DIV(LGM_CLK_DCL, "dcl", "v_ifclk", 0, CGU_PCMCR, - 25, 3, 0, 0, 0, 0, dcl_div), + LGM_DIV(LGM_CLK_DCL, "dcl", "v_ifclk", CLK_SET_RATE_PARENT, CGU_PCMCR, + 25, 3, 0, 0, DIV_CLK_NO_MASK, 0, dcl_div), LGM_MUX(LGM_CLK_PCM, "pcm", pcm_p, 0, CGU_C55_PCMCR, 0, 1, CLK_MUX_ROUND_CLOSEST, 0), LGM_FIXED_FACTOR(LGM_CLK_DDR_PHY, "ddr_phy", "ddr", @@ -433,13 +435,15 @@ ctx->clk_data.num = CLK_NR_CLKS; - ctx->membase = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(ctx->membase)) + ctx->membase = syscon_node_to_regmap(np); + if (IS_ERR(ctx->membase)) { + dev_err(dev, "Failed to get clk CGU iomem\n"); return PTR_ERR(ctx->membase); + } + ctx->np = np; ctx->dev = dev; - spin_lock_init(&ctx->lock); ret = lgm_clk_register_plls(ctx, lgm_pll_clks, ARRAY_SIZE(lgm_pll_clks)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/comedi/drivers/adv_pci1760.c +++ linux-oem-6.1-6.1.0/drivers/comedi/drivers/adv_pci1760.c @@ -58,7 +58,7 @@ #define PCI1760_CMD_CLR_IMB2 0x00 /* Clears IMB2 */ #define PCI1760_CMD_SET_DO 0x01 /* Set output state */ #define PCI1760_CMD_GET_DO 0x02 /* Read output status */ -#define PCI1760_CMD_GET_STATUS 0x03 /* Read current status */ +#define PCI1760_CMD_GET_STATUS 0x07 /* Read current status */ #define PCI1760_CMD_GET_FW_VER 0x0e /* Read firmware version */ #define PCI1760_CMD_GET_HW_VER 0x0f /* Read hardware version */ #define PCI1760_CMD_SET_PWM_HI(x) (0x10 + (x) * 2) /* Set "hi" period */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/cpufreq/amd-pstate.c +++ linux-oem-6.1-6.1.0/drivers/cpufreq/amd-pstate.c @@ -307,6 +307,7 @@ max_perf = min_perf; amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true); + cpufreq_cpu_put(policy); } static int amd_get_min_freq(struct amd_cpudata *cpudata) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/cpufreq/armada-37xx-cpufreq.c +++ linux-oem-6.1-6.1.0/drivers/cpufreq/armada-37xx-cpufreq.c @@ -445,7 +445,7 @@ return -ENODEV; } - clk = clk_get(cpu_dev, 0); + clk = clk_get(cpu_dev, NULL); if (IS_ERR(clk)) { dev_err(cpu_dev, "Cannot get clock for CPU0\n"); return PTR_ERR(clk); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/cpufreq/cppc_cpufreq.c +++ linux-oem-6.1-6.1.0/drivers/cpufreq/cppc_cpufreq.c @@ -487,7 +487,8 @@ cpu_data = policy->driver_data; perf_caps = &cpu_data->perf_caps; max_cap = arch_scale_cpu_capacity(cpu); - min_cap = div_u64(max_cap * perf_caps->lowest_perf, perf_caps->highest_perf); + min_cap = div_u64((u64)max_cap * perf_caps->lowest_perf, + perf_caps->highest_perf); if ((min_cap == 0) || (max_cap < min_cap)) return 0; return 1 + max_cap / CPPC_EM_CAP_STEP - min_cap / CPPC_EM_CAP_STEP; @@ -519,10 +520,10 @@ cpu_data = policy->driver_data; perf_caps = &cpu_data->perf_caps; max_cap = arch_scale_cpu_capacity(cpu_dev->id); - min_cap = div_u64(max_cap * perf_caps->lowest_perf, - perf_caps->highest_perf); - - perf_step = CPPC_EM_CAP_STEP * perf_caps->highest_perf / max_cap; + min_cap = div_u64((u64)max_cap * perf_caps->lowest_perf, + perf_caps->highest_perf); + perf_step = div_u64((u64)CPPC_EM_CAP_STEP * perf_caps->highest_perf, + max_cap); min_step = min_cap / CPPC_EM_CAP_STEP; max_step = max_cap / CPPC_EM_CAP_STEP; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/cpufreq/cpufreq-dt-platdev.c +++ linux-oem-6.1-6.1.0/drivers/cpufreq/cpufreq-dt-platdev.c @@ -135,6 +135,7 @@ { .compatible = "nvidia,tegra30", }, { .compatible = "nvidia,tegra124", }, { .compatible = "nvidia,tegra210", }, + { .compatible = "nvidia,tegra234", }, { .compatible = "qcom,apq8096", }, { .compatible = "qcom,msm8996", }, @@ -148,6 +149,7 @@ { .compatible = "qcom,sdm845", }, { .compatible = "qcom,sm6115", }, { .compatible = "qcom,sm6350", }, + { .compatible = "qcom,sm6375", }, { .compatible = "qcom,sm8150", }, { .compatible = "qcom,sm8250", }, { .compatible = "qcom,sm8350", }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma-buf/dma-buf-sysfs-stats.c +++ linux-oem-6.1-6.1.0/drivers/dma-buf/dma-buf-sysfs-stats.c @@ -168,14 +168,11 @@ kset_unregister(dma_buf_stats_kset); } -int dma_buf_stats_setup(struct dma_buf *dmabuf) +int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file) { struct dma_buf_sysfs_entry *sysfs_entry; int ret; - if (!dmabuf || !dmabuf->file) - return -EINVAL; - if (!dmabuf->exp_name) { pr_err("exporter name must not be empty if stats needed\n"); return -EINVAL; @@ -192,7 +189,7 @@ /* create the directory for buffer stats */ ret = kobject_init_and_add(&sysfs_entry->kobj, &dma_buf_ktype, NULL, - "%lu", file_inode(dmabuf->file)->i_ino); + "%lu", file_inode(file)->i_ino); if (ret) goto err_sysfs_dmabuf; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma-buf/dma-buf-sysfs-stats.h +++ linux-oem-6.1-6.1.0/drivers/dma-buf/dma-buf-sysfs-stats.h @@ -13,7 +13,7 @@ int dma_buf_init_sysfs_statistics(void); void dma_buf_uninit_sysfs_statistics(void); -int dma_buf_stats_setup(struct dma_buf *dmabuf); +int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file); void dma_buf_stats_teardown(struct dma_buf *dmabuf); #else @@ -25,7 +25,7 @@ static inline void dma_buf_uninit_sysfs_statistics(void) {} -static inline int dma_buf_stats_setup(struct dma_buf *dmabuf) +static inline int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file) { return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma-buf/dma-buf.c +++ linux-oem-6.1-6.1.0/drivers/dma-buf/dma-buf.c @@ -95,10 +95,11 @@ return -EINVAL; dmabuf = file->private_data; - - mutex_lock(&db_list.lock); - list_del(&dmabuf->list_node); - mutex_unlock(&db_list.lock); + if (dmabuf) { + mutex_lock(&db_list.lock); + list_del(&dmabuf->list_node); + mutex_unlock(&db_list.lock); + } return 0; } @@ -523,17 +524,17 @@ return file->f_op == &dma_buf_fops; } -static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) +static struct file *dma_buf_getfile(size_t size, int flags) { static atomic64_t dmabuf_inode = ATOMIC64_INIT(0); - struct file *file; struct inode *inode = alloc_anon_inode(dma_buf_mnt->mnt_sb); + struct file *file; if (IS_ERR(inode)) return ERR_CAST(inode); - inode->i_size = dmabuf->size; - inode_set_bytes(inode, dmabuf->size); + inode->i_size = size; + inode_set_bytes(inode, size); /* * The ->i_ino acquired from get_next_ino() is not unique thus @@ -547,8 +548,6 @@ flags, &dma_buf_fops); if (IS_ERR(file)) goto err_alloc_file; - file->private_data = dmabuf; - file->f_path.dentry->d_fsdata = dmabuf; return file; @@ -614,19 +613,11 @@ size_t alloc_size = sizeof(struct dma_buf); int ret; - if (!exp_info->resv) - alloc_size += sizeof(struct dma_resv); - else - /* prevent &dma_buf[1] == dma_buf->resv */ - alloc_size += 1; - - if (WARN_ON(!exp_info->priv - || !exp_info->ops - || !exp_info->ops->map_dma_buf - || !exp_info->ops->unmap_dma_buf - || !exp_info->ops->release)) { + if (WARN_ON(!exp_info->priv || !exp_info->ops + || !exp_info->ops->map_dma_buf + || !exp_info->ops->unmap_dma_buf + || !exp_info->ops->release)) return ERR_PTR(-EINVAL); - } if (WARN_ON(exp_info->ops->cache_sgt_mapping && (exp_info->ops->pin || exp_info->ops->unpin))) @@ -638,10 +629,21 @@ if (!try_module_get(exp_info->owner)) return ERR_PTR(-ENOENT); + file = dma_buf_getfile(exp_info->size, exp_info->flags); + if (IS_ERR(file)) { + ret = PTR_ERR(file); + goto err_module; + } + + if (!exp_info->resv) + alloc_size += sizeof(struct dma_resv); + else + /* prevent &dma_buf[1] == dma_buf->resv */ + alloc_size += 1; dmabuf = kzalloc(alloc_size, GFP_KERNEL); if (!dmabuf) { ret = -ENOMEM; - goto err_module; + goto err_file; } dmabuf->priv = exp_info->priv; @@ -653,44 +655,36 @@ init_waitqueue_head(&dmabuf->poll); dmabuf->cb_in.poll = dmabuf->cb_out.poll = &dmabuf->poll; dmabuf->cb_in.active = dmabuf->cb_out.active = 0; + mutex_init(&dmabuf->lock); + INIT_LIST_HEAD(&dmabuf->attachments); if (!resv) { - resv = (struct dma_resv *)&dmabuf[1]; - dma_resv_init(resv); + dmabuf->resv = (struct dma_resv *)&dmabuf[1]; + dma_resv_init(dmabuf->resv); + } else { + dmabuf->resv = resv; } - dmabuf->resv = resv; - file = dma_buf_getfile(dmabuf, exp_info->flags); - if (IS_ERR(file)) { - ret = PTR_ERR(file); + ret = dma_buf_stats_setup(dmabuf, file); + if (ret) goto err_dmabuf; - } + file->private_data = dmabuf; + file->f_path.dentry->d_fsdata = dmabuf; dmabuf->file = file; - mutex_init(&dmabuf->lock); - INIT_LIST_HEAD(&dmabuf->attachments); - mutex_lock(&db_list.lock); list_add(&dmabuf->list_node, &db_list.head); mutex_unlock(&db_list.lock); - ret = dma_buf_stats_setup(dmabuf); - if (ret) - goto err_sysfs; - return dmabuf; -err_sysfs: - /* - * Set file->f_path.dentry->d_fsdata to NULL so that when - * dma_buf_release() gets invoked by dentry_ops, it exits - * early before calling the release() dma_buf op. - */ - file->f_path.dentry->d_fsdata = NULL; - fput(file); err_dmabuf: + if (!resv) + dma_resv_fini(dmabuf->resv); kfree(dmabuf); +err_file: + fput(file); err_module: module_put(exp_info->owner); return ERR_PTR(ret); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma-buf/dma-fence.c +++ linux-oem-6.1-6.1.0/drivers/dma-buf/dma-fence.c @@ -167,7 +167,7 @@ 0, 0); set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, - &dma_fence_stub.flags); + &fence->flags); dma_fence_signal(fence); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/dmaengine.c +++ linux-oem-6.1-6.1.0/drivers/dma/dmaengine.c @@ -451,7 +451,8 @@ /* The channel is already in use, update client count */ if (chan->client_count) { __module_get(owner); - goto out; + chan->client_count++; + return 0; } if (!try_module_get(owner)) @@ -470,11 +471,11 @@ goto err_out; } + chan->client_count++; + if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask)) balance_ref_count(chan); -out: - chan->client_count++; return 0; err_out: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ linux-oem-6.1-6.1.0/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -1018,6 +1018,11 @@ /* The bad descriptor currently is in the head of vc list */ vd = vchan_next_desc(&chan->vc); + if (!vd) { + dev_err(chan2dev(chan), "BUG: %s, IRQ with no descriptors\n", + axi_chan_name(chan)); + goto out; + } /* Remove the completed descriptor from issued list */ list_del(&vd->node); @@ -1032,6 +1037,7 @@ /* Try to restart the controller */ axi_chan_start_first_queued(chan); +out: spin_unlock_irqrestore(&chan->vc.lock, flags); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/idxd/device.c +++ linux-oem-6.1-6.1.0/drivers/dma/idxd/device.c @@ -1173,8 +1173,19 @@ spin_unlock(&ie->list_lock); list_for_each_entry_safe(desc, itr, &flist, list) { + struct dma_async_tx_descriptor *tx; + list_del(&desc->list); ctype = desc->completion->status ? IDXD_COMPLETE_NORMAL : IDXD_COMPLETE_ABORT; + /* + * wq is being disabled. Any remaining descriptors are + * likely to be stuck and can be dropped. callback could + * point to code that is no longer accessible, for example + * if dmatest module has been unloaded. + */ + tx = &desc->txd; + tx->callback = NULL; + tx->callback_result = NULL; idxd_dma_complete_txd(desc, ctype, true); } } @@ -1391,8 +1402,7 @@ err_irq: idxd_wq_unmap_portal(wq); err_map_portal: - rc = idxd_wq_disable(wq, false); - if (rc < 0) + if (idxd_wq_disable(wq, false)) dev_dbg(dev, "wq %s disable failed\n", dev_name(wq_confdev(wq))); err: return rc; @@ -1409,11 +1419,11 @@ dev_warn(dev, "Clients has claim on wq %d: %d\n", wq->id, idxd_wq_refcount(wq)); - idxd_wq_free_resources(wq); idxd_wq_unmap_portal(wq); idxd_wq_drain(wq); idxd_wq_free_irq(wq); idxd_wq_reset(wq); + idxd_wq_free_resources(wq); percpu_ref_exit(&wq->wq_active); wq->type = IDXD_WQT_NONE; wq->client_count = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/imx-sdma.c +++ linux-oem-6.1-6.1.0/drivers/dma/imx-sdma.c @@ -1521,10 +1521,12 @@ sdma_config_ownership(sdmac, false, true, false); if (sdma_load_context(sdmac)) - goto err_desc_out; + goto err_bd_out; return desc; +err_bd_out: + sdma_free_bd(desc); err_desc_out: kfree(desc); err_out: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/lgm/lgm-dma.c +++ linux-oem-6.1-6.1.0/drivers/dma/lgm/lgm-dma.c @@ -914,7 +914,7 @@ } } -static int ldma_cfg_init(struct ldma_dev *d) +static int ldma_parse_dt(struct ldma_dev *d) { struct fwnode_handle *fwnode = dev_fwnode(d->dev); struct ldma_port *p; @@ -1661,10 +1661,6 @@ p->ldev = d; } - ret = ldma_cfg_init(d); - if (ret) - return ret; - dma_dev->dev = &pdev->dev; ch_mask = (unsigned long)d->channels_mask; @@ -1675,6 +1671,10 @@ ldma_dma_init_v3X(j, d); } + ret = ldma_parse_dt(d); + if (ret) + return ret; + dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources; dma_dev->device_free_chan_resources = ldma_free_chan_resources; dma_dev->device_terminate_all = ldma_terminate_all; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/ptdma/ptdma-dev.c +++ linux-oem-6.1-6.1.0/drivers/dma/ptdma/ptdma-dev.c @@ -71,12 +71,13 @@ bool soc = FIELD_GET(DWORD0_SOC, desc->dw0); u8 *q_desc = (u8 *)&cmd_q->qbase[cmd_q->qidx]; u32 tail; + unsigned long flags; if (soc) { desc->dw0 |= FIELD_PREP(DWORD0_IOC, desc->dw0); desc->dw0 &= ~DWORD0_SOC; } - mutex_lock(&cmd_q->q_mutex); + spin_lock_irqsave(&cmd_q->q_lock, flags); /* Copy 32-byte command descriptor to hw queue. */ memcpy(q_desc, desc, 32); @@ -91,7 +92,7 @@ /* Turn the queue back on using our cached control register */ pt_start_queue(cmd_q); - mutex_unlock(&cmd_q->q_mutex); + spin_unlock_irqrestore(&cmd_q->q_lock, flags); return 0; } @@ -199,7 +200,7 @@ cmd_q->pt = pt; cmd_q->dma_pool = dma_pool; - mutex_init(&cmd_q->q_mutex); + spin_lock_init(&cmd_q->q_lock); /* Page alignment satisfies our needs for N <= 128 */ cmd_q->qsize = Q_SIZE(Q_DESC_SIZE); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/ptdma/ptdma.h +++ linux-oem-6.1-6.1.0/drivers/dma/ptdma/ptdma.h @@ -196,7 +196,7 @@ struct ptdma_desc *qbase; /* Aligned queue start address (per requirement) */ - struct mutex q_mutex ____cacheline_aligned; + spinlock_t q_lock ____cacheline_aligned; unsigned int qidx; unsigned int qsize; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/qcom/gpi.c +++ linux-oem-6.1-6.1.0/drivers/dma/qcom/gpi.c @@ -1756,6 +1756,7 @@ tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE); if (spi->cmd == SPI_RX) { tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB); + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK); } else if (spi->cmd == SPI_TX) { tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN); } else { /* SPI_DUPLEX */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/tegra186-gpc-dma.c +++ linux-oem-6.1-6.1.0/drivers/dma/tegra186-gpc-dma.c @@ -707,6 +707,7 @@ return err; } + vchan_terminate_vdesc(&tdc->dma_desc->vd); tegra_dma_disable(tdc); tdc->dma_desc = NULL; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/tegra210-adma.c +++ linux-oem-6.1-6.1.0/drivers/dma/tegra210-adma.c @@ -221,7 +221,7 @@ int ret; /* Clear any interrupts */ - tdma_write(tdma, tdma->cdata->global_int_clear, 0x1); + tdma_write(tdma, tdma->cdata->ch_base_offset + tdma->cdata->global_int_clear, 0x1); /* Assert soft reset */ tdma_write(tdma, ADMA_GLOBAL_SOFT_RESET, 0x1); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/ti/k3-udma.c +++ linux-oem-6.1-6.1.0/drivers/dma/ti/k3-udma.c @@ -761,11 +761,12 @@ if (uc->desc->dir == DMA_DEV_TO_MEM) { udma_rchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); udma_rchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); - udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); + if (uc->config.ep_type != PSIL_EP_NATIVE) + udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); } else { udma_tchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); udma_tchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); - if (!uc->bchan) + if (!uc->bchan && uc->config.ep_type != PSIL_EP_NATIVE) udma_tchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/dma/xilinx/xilinx_dma.c +++ linux-oem-6.1-6.1.0/drivers/dma/xilinx/xilinx_dma.c @@ -3141,8 +3141,10 @@ /* Initialize the channels */ for_each_child_of_node(node, child) { err = xilinx_dma_child_probe(xdev, child); - if (err < 0) + if (err < 0) { + of_node_put(child); goto error; + } } if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/edac/edac_device.c +++ linux-oem-6.1-6.1.0/drivers/edac/edac_device.c @@ -34,6 +34,9 @@ static DEFINE_MUTEX(device_ctls_mutex); static LIST_HEAD(edac_device_list); +/* Default workqueue processing interval on this instance, in msecs */ +#define DEFAULT_POLL_INTERVAL 1000 + #ifdef CONFIG_EDAC_DEBUG static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev) { @@ -336,7 +339,7 @@ * whole one second to save timers firing all over the period * between integral seconds */ - if (edac_dev->poll_msec == 1000) + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); else edac_queue_work(&edac_dev->work, edac_dev->delay); @@ -366,7 +369,7 @@ * timers firing on sub-second basis, while they are happy * to fire together on the 1 second exactly */ - if (edac_dev->poll_msec == 1000) + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); else edac_queue_work(&edac_dev->work, edac_dev->delay); @@ -394,17 +397,16 @@ * Then restart the workq on the new delay */ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, - unsigned long value) + unsigned long msec) { - unsigned long jiffs = msecs_to_jiffies(value); - - if (value == 1000) - jiffs = round_jiffies_relative(value); - - edac_dev->poll_msec = value; - edac_dev->delay = jiffs; + edac_dev->poll_msec = msec; + edac_dev->delay = msecs_to_jiffies(msec); - edac_mod_work(&edac_dev->work, jiffs); + /* See comment in edac_device_workq_setup() above */ + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) + edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); + else + edac_mod_work(&edac_dev->work, edac_dev->delay); } int edac_device_alloc_index(void) @@ -443,11 +445,7 @@ /* This instance is NOW RUNNING */ edac_dev->op_state = OP_RUNNING_POLL; - /* - * enable workq processing on this instance, - * default = 1000 msec - */ - edac_device_workq_setup(edac_dev, 1000); + edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL); } else { edac_dev->op_state = OP_RUNNING_INTERRUPT; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/edac/edac_module.h +++ linux-oem-6.1-6.1.0/drivers/edac/edac_module.h @@ -52,7 +52,7 @@ bool edac_mod_work(struct delayed_work *work, unsigned long delay); extern void edac_device_reset_delay_period(struct edac_device_ctl_info - *edac_dev, unsigned long value); + *edac_dev, unsigned long msec); extern void edac_mc_reset_delay_period(unsigned long value); /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/edac/highbank_mc_edac.c +++ linux-oem-6.1-6.1.0/drivers/edac/highbank_mc_edac.c @@ -174,8 +174,10 @@ drvdata = mci->pvt_info; platform_set_drvdata(pdev, mci); - if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) - return -ENOMEM; + if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) { + res = -ENOMEM; + goto free; + } r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) { @@ -243,6 +245,7 @@ edac_mc_del_mc(&pdev->dev); err: devres_release_group(&pdev->dev, NULL); +free: edac_mc_free(mci); return res; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/edac/qcom_edac.c +++ linux-oem-6.1-6.1.0/drivers/edac/qcom_edac.c @@ -252,7 +252,7 @@ static int dump_syn_reg(struct edac_device_ctl_info *edev_ctl, int err_type, u32 bank) { - struct llcc_drv_data *drv = edev_ctl->pvt_info; + struct llcc_drv_data *drv = edev_ctl->dev->platform_data; int ret; ret = dump_syn_reg_values(drv, bank, err_type); @@ -289,7 +289,7 @@ llcc_ecc_irq_handler(int irq, void *edev_ctl) { struct edac_device_ctl_info *edac_dev_ctl = edev_ctl; - struct llcc_drv_data *drv = edac_dev_ctl->pvt_info; + struct llcc_drv_data *drv = edac_dev_ctl->dev->platform_data; irqreturn_t irq_rc = IRQ_NONE; u32 drp_error, trp_error, i; int ret; @@ -358,7 +358,6 @@ edev_ctl->dev_name = dev_name(dev); edev_ctl->ctl_name = "llcc"; edev_ctl->panic_on_ue = LLCC_ERP_PANIC_ON_UE; - edev_ctl->pvt_info = llcc_driv_data; rc = edac_device_add_device(edev_ctl); if (rc) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firewire/core-cdev.c +++ linux-oem-6.1-6.1.0/drivers/firewire/core-cdev.c @@ -819,8 +819,10 @@ r = container_of(resource, struct inbound_transaction_resource, resource); - if (is_fcp_request(r->request)) + if (is_fcp_request(r->request)) { + kfree(r->data); goto out; + } if (a->length != fw_get_response_length(r->request)) { ret = -EINVAL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/arm_scmi/driver.c +++ linux-oem-6.1-6.1.0/drivers/firmware/arm_scmi/driver.c @@ -910,6 +910,8 @@ xfer->hdr.protocol_id, xfer->hdr.seq, xfer->hdr.poll_completion); + /* Clear any stale status */ + xfer->hdr.status = SCMI_SUCCESS; xfer->state = SCMI_XFER_SENT_OK; /* * Even though spinlocking is not needed here since no race is possible only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/arm_scmi/shmem.c +++ linux-oem-6.1-6.1.0/drivers/firmware/arm_scmi/shmem.c @@ -81,10 +81,11 @@ void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem, struct scmi_xfer *xfer) { + size_t len = ioread32(&shmem->length); + xfer->hdr.status = ioread32(shmem->msg_payload); /* Skip the length of header and status in shmem area i.e 8 bytes */ - xfer->rx.len = min_t(size_t, xfer->rx.len, - ioread32(&shmem->length) - 8); + xfer->rx.len = min_t(size_t, xfer->rx.len, len > 8 ? len - 8 : 0); /* Take a copy to the rx buffer.. */ memcpy_fromio(xfer->rx.buf, shmem->msg_payload + 4, xfer->rx.len); @@ -93,8 +94,10 @@ void shmem_fetch_notification(struct scmi_shared_mem __iomem *shmem, size_t max_len, struct scmi_xfer *xfer) { + size_t len = ioread32(&shmem->length); + /* Skip only the length of header in shmem area i.e 4 bytes */ - xfer->rx.len = min_t(size_t, max_len, ioread32(&shmem->length) - 4); + xfer->rx.len = min_t(size_t, max_len, len > 4 ? len - 4 : 0); /* Take a copy to the rx buffer.. */ memcpy_fromio(xfer->rx.buf, shmem->msg_payload, xfer->rx.len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/arm_scmi/virtio.c +++ linux-oem-6.1-6.1.0/drivers/firmware/arm_scmi/virtio.c @@ -160,7 +160,6 @@ } vioch->shutdown_done = &vioch_shutdown_done; - virtio_break_device(vioch->vqueue->vdev); if (!vioch->is_rx && vioch->deferred_tx_wq) /* Cannot be kicked anymore after this...*/ vioch->deferred_tx_wq = NULL; @@ -482,6 +481,12 @@ struct scmi_chan_info *cinfo = p; struct scmi_vio_channel *vioch = cinfo->transport_info; + /* + * Break device to inhibit further traffic flowing while shutting down + * the channels: doing it later holding vioch->lock creates unsafe + * locking dependency chains as reported by LOCKDEP. + */ + virtio_break_device(vioch->vqueue->vdev); scmi_vio_channel_cleanup_sync(vioch); scmi_free_channel(cinfo, data, id); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/efi/libstub/arm64-stub.c +++ linux-oem-6.1-6.1.0/drivers/firmware/efi/libstub/arm64-stub.c @@ -20,10 +20,13 @@ const u8 *type1_family = efi_get_smbios_string(1, family); /* - * Ampere Altra machines crash in SetTime() if SetVirtualAddressMap() - * has not been called prior. + * Ampere eMAG, Altra, and Altra Max machines crash in SetTime() if + * SetVirtualAddressMap() has not been called prior. */ - if (!type1_family || strcmp(type1_family, "Altra")) + if (!type1_family || ( + strcmp(type1_family, "eMAG") && + strcmp(type1_family, "Altra") && + strcmp(type1_family, "Altra Max"))) return false; efi_warn("Working around broken SetVirtualAddressMap()\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/efi/memattr.c +++ linux-oem-6.1-6.1.0/drivers/firmware/efi/memattr.c @@ -33,7 +33,7 @@ return -ENOMEM; } - if (tbl->version > 1) { + if (tbl->version > 2) { pr_warn("Unexpected EFI Memory Attributes table version %d\n", tbl->version); goto unmap; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/efi/runtime-wrappers.c +++ linux-oem-6.1-6.1.0/drivers/firmware/efi/runtime-wrappers.c @@ -62,6 +62,7 @@ \ if (!efi_enabled(EFI_RUNTIME_SERVICES)) { \ pr_warn_once("EFI Runtime Services are disabled!\n"); \ + efi_rts_work.status = EFI_DEVICE_ERROR; \ goto exit; \ } \ \ @@ -83,6 +84,7 @@ else \ pr_err("Failed to queue work to efi_rts_wq.\n"); \ \ + WARN_ON_ONCE(efi_rts_work.status == EFI_ABORTED); \ exit: \ efi_rts_work.efi_rts_id = EFI_NONE; \ efi_rts_work.status; \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/google/coreboot_table.c +++ linux-oem-6.1-6.1.0/drivers/firmware/google/coreboot_table.c @@ -93,7 +93,12 @@ for (i = 0; i < header->table_entries; i++) { entry = ptr_entry; - device = kzalloc(sizeof(struct device) + entry->size, GFP_KERNEL); + if (entry->size < sizeof(*entry)) { + dev_warn(dev, "coreboot table entry too small!\n"); + return -EINVAL; + } + + device = kzalloc(sizeof(device->dev) + entry->size, GFP_KERNEL); if (!device) return -ENOMEM; @@ -101,7 +106,7 @@ device->dev.parent = dev; device->dev.bus = &coreboot_bus_type; device->dev.release = coreboot_device_release; - memcpy(&device->entry, ptr_entry, entry->size); + memcpy(device->raw, ptr_entry, entry->size); ret = device_register(&device->dev); if (ret) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/google/coreboot_table.h +++ linux-oem-6.1-6.1.0/drivers/firmware/google/coreboot_table.h @@ -66,6 +66,7 @@ struct coreboot_table_entry entry; struct lb_cbmem_ref cbmem_ref; struct lb_framebuffer framebuffer; + DECLARE_FLEX_ARRAY(u8, raw); }; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/google/gsmi.c +++ linux-oem-6.1-6.1.0/drivers/firmware/google/gsmi.c @@ -361,9 +361,10 @@ memcpy(data, gsmi_dev.data_buf->start, *data_size); /* All variables are have the following attributes */ - *attr = EFI_VARIABLE_NON_VOLATILE | - EFI_VARIABLE_BOOTSERVICE_ACCESS | - EFI_VARIABLE_RUNTIME_ACCESS; + if (attr) + *attr = EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS; } spin_unlock_irqrestore(&gsmi_dev.lock, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/firmware/psci/psci.c +++ linux-oem-6.1-6.1.0/drivers/firmware/psci/psci.c @@ -440,6 +440,9 @@ static int __init psci_debugfs_init(void) { + if (!invoke_psci_fn || !psci_ops.get_version) + return 0; + return PTR_ERR_OR_ZERO(debugfs_create_file("psci", 0444, NULL, NULL, &psci_debugfs_ops)); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/fpga/intel-m10-bmc-sec-update.c +++ linux-oem-6.1-6.1.0/drivers/fpga/intel-m10-bmc-sec-update.c @@ -574,20 +574,27 @@ len = scnprintf(buf, SEC_UPDATE_LEN_MAX, "secure-update%d", sec->fw_name_id); sec->fw_name = kmemdup_nul(buf, len, GFP_KERNEL); - if (!sec->fw_name) - return -ENOMEM; + if (!sec->fw_name) { + ret = -ENOMEM; + goto fw_name_fail; + } fwl = firmware_upload_register(THIS_MODULE, sec->dev, sec->fw_name, &m10bmc_ops, sec); if (IS_ERR(fwl)) { dev_err(sec->dev, "Firmware Upload driver failed to start\n"); - kfree(sec->fw_name); - xa_erase(&fw_upload_xa, sec->fw_name_id); - return PTR_ERR(fwl); + ret = PTR_ERR(fwl); + goto fw_uploader_fail; } sec->fwl = fwl; return 0; + +fw_uploader_fail: + kfree(sec->fw_name); +fw_name_fail: + xa_erase(&fw_upload_xa, sec->fw_name_id); + return ret; } static int m10bmc_sec_remove(struct platform_device *pdev) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/fpga/stratix10-soc.c +++ linux-oem-6.1-6.1.0/drivers/fpga/stratix10-soc.c @@ -213,9 +213,9 @@ /* Allocate buffers from the service layer's pool. */ for (i = 0; i < NUM_SVC_BUFS; i++) { kbuf = stratix10_svc_allocate_memory(priv->chan, SVC_BUF_SIZE); - if (!kbuf) { + if (IS_ERR(kbuf)) { s10_free_buffers(mgr); - ret = -ENOMEM; + ret = PTR_ERR(kbuf); goto init_done; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/fsi/fsi-sbefifo.c +++ linux-oem-6.1-6.1.0/drivers/fsi/fsi-sbefifo.c @@ -659,7 +659,7 @@ } ffdc_iov.iov_base = ffdc; ffdc_iov.iov_len = SBEFIFO_MAX_FFDC_SIZE; - iov_iter_kvec(&ffdc_iter, WRITE, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE); + iov_iter_kvec(&ffdc_iter, ITER_DEST, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE); cmd[0] = cpu_to_be32(2); cmd[1] = cpu_to_be32(SBEFIFO_CMD_GET_SBE_FFDC); rc = sbefifo_do_command(sbefifo, cmd, 2, &ffdc_iter); @@ -756,7 +756,7 @@ rbytes = (*resp_len) * sizeof(__be32); resp_iov.iov_base = response; resp_iov.iov_len = rbytes; - iov_iter_kvec(&resp_iter, WRITE, &resp_iov, 1, rbytes); + iov_iter_kvec(&resp_iter, ITER_DEST, &resp_iov, 1, rbytes); /* Perform the command */ rc = mutex_lock_interruptible(&sbefifo->lock); @@ -839,7 +839,7 @@ /* Prepare iov iterator */ resp_iov.iov_base = buf; resp_iov.iov_len = len; - iov_iter_init(&resp_iter, WRITE, &resp_iov, 1, len); + iov_iter_init(&resp_iter, ITER_DEST, &resp_iov, 1, len); /* Perform the command */ rc = mutex_lock_interruptible(&sbefifo->lock); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpio/gpio-ep93xx.c +++ linux-oem-6.1-6.1.0/drivers/gpio/gpio-ep93xx.c @@ -148,7 +148,7 @@ */ struct irq_chip *irqchip = irq_desc_get_chip(desc); unsigned int irq = irq_desc_get_irq(desc); - int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ + int port_f_idx = (irq & 7) ^ 4; /* {20..23,48..51} -> {0..7} */ int gpio_irq = EP93XX_GPIO_F_IRQ_BASE + port_f_idx; chained_irq_enter(irqchip, desc); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpio/gpio-mxc.c +++ linux-oem-6.1-6.1.0/drivers/gpio/gpio-mxc.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -147,6 +148,7 @@ { struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); struct mxc_gpio_port *port = gc->private; + unsigned long flags; u32 bit, val; u32 gpio_idx = d->hwirq; int edge; @@ -185,6 +187,8 @@ return -EINVAL; } + raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags); + if (GPIO_EDGE_SEL >= 0) { val = readl(port->base + GPIO_EDGE_SEL); if (edge == GPIO_INT_BOTH_EDGES) @@ -204,15 +208,20 @@ writel(1 << gpio_idx, port->base + GPIO_ISR); - return 0; + raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags); + + return port->gc.direction_input(&port->gc, gpio_idx); } static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio) { void __iomem *reg = port->base; + unsigned long flags; u32 bit, val; int edge; + raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags); + reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */ bit = gpio & 0xf; val = readl(reg); @@ -227,9 +236,12 @@ } else { pr_err("mxc: invalid configuration for GPIO %d: %x\n", gpio, edge); - return; + goto unlock; } writel(val | (edge << (bit << 1)), reg); + +unlock: + raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags); } /* handle 32 interrupts in one status register */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpio/gpio-sim.c +++ linux-oem-6.1-6.1.0/drivers/gpio/gpio-sim.c @@ -732,7 +732,7 @@ gpiod_remove_hogs(dev->hogs); - for (hog = dev->hogs; !hog->chip_label; hog++) { + for (hog = dev->hogs; hog->chip_label; hog++) { kfree(hog->chip_label); kfree(hog->line_name); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpio/gpiolib-acpi.c +++ linux-oem-6.1-6.1.0/drivers/gpio/gpiolib-acpi.c @@ -361,7 +361,7 @@ } static bool acpi_gpio_irq_is_wake(struct device *parent, - struct acpi_resource_gpio *agpio) + const struct acpi_resource_gpio *agpio) { unsigned int pin = agpio->pin_table[0]; @@ -754,7 +754,7 @@ lookup->info.pin_config = agpio->pin_config; lookup->info.debounce = agpio->debounce_timeout; lookup->info.gpioint = gpioint; - lookup->info.wake_capable = agpio->wake_capable == ACPI_WAKE_CAPABLE; + lookup->info.wake_capable = acpi_gpio_irq_is_wake(&lookup->info.adev->dev, agpio); /* * Polarity and triggering are only specified for GpioInt @@ -1080,7 +1080,8 @@ dev_dbg(&adev->dev, "IRQ %d already in use\n", irq); } - if (wake_capable) + /* avoid suspend issues with GPIOs when systems are using S3 */ + if (wake_capable && acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) *wake_capable = info.wake_capable; return irq; @@ -1599,6 +1600,19 @@ .ignore_interrupt = "AMDI0030:00@18", }, }, + { + /* + * Spurious wakeups from TP_ATTN# pin + * Found in BIOS 1.7.8 + * https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1720627 + */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), + }, + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { + .ignore_wake = "ELAN0415:00@9", + }, + }, {} /* Terminating entry */ }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/Kconfig +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/Kconfig @@ -53,7 +53,8 @@ config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default y + default n + depends on BROKEN depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -1507,6 +1507,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): amdgpu_device_ip_block_add(adev, &soc21_common_ip_block); break; default: @@ -1551,6 +1552,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block); break; default: @@ -1636,6 +1638,7 @@ case IP_VERSION(13, 0, 7): case IP_VERSION(13, 0, 8): case IP_VERSION(13, 0, 10): + case IP_VERSION(13, 0, 11): amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block); break; case IP_VERSION(13, 0, 4): @@ -1686,6 +1689,7 @@ case IP_VERSION(13, 0, 7): case IP_VERSION(13, 0, 8): case IP_VERSION(13, 0, 10): + case IP_VERSION(13, 0, 11): amdgpu_device_ip_block_add(adev, &smu_v13_0_ip_block); break; default: @@ -1785,6 +1789,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block); break; default: @@ -1948,6 +1953,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block); adev->enable_mes = true; adev->enable_mes_kiq = true; @@ -2177,6 +2183,7 @@ adev->family = AMDGPU_FAMILY_GC_11_0_0; break; case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): adev->family = AMDGPU_FAMILY_GC_11_0_1; break; default: @@ -2194,6 +2201,7 @@ case IP_VERSION(10, 3, 6): case IP_VERSION(10, 3, 7): case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): adev->flags |= AMD_IS_APU; break; default: @@ -2250,6 +2258,7 @@ adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg; break; case IP_VERSION(7, 7, 0): + case IP_VERSION(7, 7, 1): adev->nbio.funcs = &nbio_v7_7_funcs; adev->nbio.hdp_flush_reg = &nbio_v7_7_hdp_flush_reg; break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -564,7 +564,13 @@ if (!ring || !ring->fence_drv.initialized) continue; - if (!ring->no_scheduler) + /* + * Notice we check for sched.ops since there's some + * override on the meaning of sched.ready by amdgpu. + * The natural check would be sched.ready, which is + * set as drm_sched_init() finishes... + */ + if (ring->sched.ops) drm_sched_fini(&ring->sched); for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -156,6 +156,9 @@ return amdgpu_compute_multipipe == 1; } + if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0)) + return true; + /* FIXME: spreading the queues across pipes causes perf regressions * on POLARIS11 compute workloads */ if (adev->asic_type == CHIP_POLARIS11) @@ -583,10 +586,14 @@ if (adev->gfx.gfx_off_req_count == 0 && !adev->gfx.gfx_off_state) { /* If going to s2idle, no need to wait */ - if (adev->in_s0ix) - delay = GFX_OFF_NO_DELAY; - schedule_delayed_work(&adev->gfx.gfx_off_delay_work, + if (adev->in_s0ix) { + if (!amdgpu_dpm_set_powergating_by_smu(adev, + AMD_IP_BLOCK_TYPE_GFX, true)) + adev->gfx.gfx_off_state = true; + } else { + schedule_delayed_work(&adev->gfx.gfx_off_delay_work, delay); + } } } else { if (adev->gfx.gfx_off_req_count == 0) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -548,6 +548,8 @@ case IP_VERSION(10, 3, 1): /* YELLOW_CARP*/ case IP_VERSION(10, 3, 3): + case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): /* Don't enable it by default yet. */ if (amdgpu_tmz < 1) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -154,8 +154,14 @@ struct dma_fence *f; unsigned i; - /* use sched fence if available */ - f = job->base.s_fence ? &job->base.s_fence->finished : &job->hw_fence; + /* Check if any fences where initialized */ + if (job->base.s_fence && job->base.s_fence->finished.ops) + f = &job->base.s_fence->finished; + else if (job->hw_fence.ops) + f = &job->hw_fence; + else + f = NULL; + for (i = 0; i < job->num_ibs; ++i) amdgpu_ib_free(ring->adev, &job->ibs[i], f); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -139,6 +139,7 @@ case IP_VERSION(13, 0, 5): case IP_VERSION(13, 0, 8): case IP_VERSION(13, 0, 10): + case IP_VERSION(13, 0, 11): psp_v13_0_set_psp_funcs(psp); psp->autoload_supported = true; break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c @@ -974,7 +974,7 @@ trace_amdgpu_vm_update_ptes(params, frag_start, upd_end, min(nptes, 32u), dst, incr, upd_flags, - vm->task_info.pid, + vm->task_info.tgid, vm->immediate.fence_context); amdgpu_vm_pte_update_flags(params, to_amdgpu_bo_vm(pt), cursor.level, pe_start, dst, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -882,7 +882,7 @@ kfree(rsv); list_for_each_entry_safe(rsv, temp, &mgr->reserved_pages, blocks) { - drm_buddy_free_list(&mgr->mm, &rsv->blocks); + drm_buddy_free_list(&mgr->mm, &rsv->allocated); kfree(rsv); } drm_buddy_fini(&mgr->mm); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -77,6 +77,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_3_me.bin"); MODULE_FIRMWARE("amdgpu/gc_11_0_3_mec.bin"); MODULE_FIRMWARE("amdgpu/gc_11_0_3_rlc.bin"); +MODULE_FIRMWARE("amdgpu/gc_11_0_4_pfp.bin"); +MODULE_FIRMWARE("amdgpu/gc_11_0_4_me.bin"); +MODULE_FIRMWARE("amdgpu/gc_11_0_4_mec.bin"); +MODULE_FIRMWARE("amdgpu/gc_11_0_4_rlc.bin"); static const struct soc15_reg_golden golden_settings_gc_11_0_1[] = { @@ -262,6 +266,7 @@ { switch (adev->ip_versions[GC_HWIP][0]) { case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): soc15_program_register_sequence(adev, golden_settings_gc_11_0_1, (const u32)ARRAY_SIZE(golden_settings_gc_11_0_1)); @@ -785,8 +790,8 @@ * zero here */ WARN_ON(simd != 0); - /* type 2 wave data */ - dst[(*no_fields)++] = 2; + /* type 3 wave data */ + dst[(*no_fields)++] = 3; dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_STATUS); dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_PC_LO); dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_PC_HI); @@ -856,6 +861,7 @@ adev->gfx.config.sc_earlyz_tile_fifo_size = 0x4C0; break; case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): adev->gfx.config.max_hw_contexts = 8; adev->gfx.config.sc_prim_fifo_size_frontend = 0x20; adev->gfx.config.sc_prim_fifo_size_backend = 0x100; @@ -1282,7 +1288,6 @@ switch (adev->ip_versions[GC_HWIP][0]) { case IP_VERSION(11, 0, 0): - case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): adev->gfx.me.num_me = 1; @@ -1292,6 +1297,15 @@ adev->gfx.mec.num_pipe_per_mec = 4; adev->gfx.mec.num_queue_per_pipe = 4; break; + case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): + adev->gfx.me.num_me = 1; + adev->gfx.me.num_pipe_per_me = 1; + adev->gfx.me.num_queue_per_pipe = 1; + adev->gfx.mec.num_mec = 1; + adev->gfx.mec.num_pipe_per_mec = 4; + adev->gfx.mec.num_queue_per_pipe = 4; + break; default: adev->gfx.me.num_me = 1; adev->gfx.me.num_pipe_per_me = 1; @@ -2486,7 +2500,8 @@ for (i = 0; i < adev->usec_timeout; i++) { cp_status = RREG32_SOC15(GC, 0, regCP_STAT); - if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(11, 0, 1)) + if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(11, 0, 1) || + adev->ip_versions[GC_HWIP][0] == IP_VERSION(11, 0, 4)) bootload_status = RREG32_SOC15(GC, 0, regRLC_RLCS_BOOTLOAD_STATUS_gc_11_0_1); else @@ -5022,6 +5037,7 @@ if (enable && (adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { switch (adev->ip_versions[GC_HWIP][0]) { case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1); break; default: @@ -5055,6 +5071,7 @@ amdgpu_gfx_off_ctrl(adev, enable); break; case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 4): gfx_v11_cntl_pg(adev, enable); amdgpu_gfx_off_ctrl(adev, enable); break; @@ -5078,6 +5095,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): gfx_v11_0_update_gfx_clock_gating(adev, state == AMD_CG_STATE_GATE); break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c @@ -749,6 +749,7 @@ case IP_VERSION(11, 0, 1): case IP_VERSION(11, 0, 2): case IP_VERSION(11, 0, 3): + case IP_VERSION(11, 0, 4): adev->num_vmhubs = 2; /* * To fulfill 4-level page support, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c @@ -337,7 +337,13 @@ static void nbio_v4_3_init_registers(struct amdgpu_device *adev) { - return; + if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(4, 3, 0)) { + uint32_t data; + + data = RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2); + data &= ~RCC_DEV0_EPF2_STRAP2__STRAP_NO_SOFT_RESET_DEV0_F2_MASK; + WREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2, data); + } } static u32 nbio_v4_3_get_rom_offset(struct amdgpu_device *adev) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c @@ -46,6 +46,8 @@ MODULE_FIRMWARE("amdgpu/psp_13_0_7_ta.bin"); MODULE_FIRMWARE("amdgpu/psp_13_0_10_sos.bin"); MODULE_FIRMWARE("amdgpu/psp_13_0_10_ta.bin"); +MODULE_FIRMWARE("amdgpu/psp_13_0_11_toc.bin"); +MODULE_FIRMWARE("amdgpu/psp_13_0_11_ta.bin"); /* For large FW files the time to complete can be very long */ #define USBC_PD_POLLING_LIMIT_S 240 @@ -102,6 +104,7 @@ case IP_VERSION(13, 0, 3): case IP_VERSION(13, 0, 5): case IP_VERSION(13, 0, 8): + case IP_VERSION(13, 0, 11): err = psp_init_toc_microcode(psp, chip_name); if (err) return err; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -200,7 +200,7 @@ queue_input.wptr_addr = (uint64_t)q->properties.write_ptr; if (q->wptr_bo) { - wptr_addr_off = (uint64_t)q->properties.write_ptr - (uint64_t)q->wptr_bo->kfd_bo->va; + wptr_addr_off = (uint64_t)q->properties.write_ptr & (PAGE_SIZE - 1); queue_input.wptr_mc_addr = ((uint64_t)q->wptr_bo->tbo.resource->start << PAGE_SHIFT) + wptr_addr_off; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -570,6 +570,15 @@ goto reserve_bo_failed; } + if (clear) { + r = amdgpu_bo_sync_wait(bo, AMDGPU_FENCE_OWNER_KFD, false); + if (r) { + pr_debug("failed %d to sync bo\n", r); + amdgpu_bo_unreserve(bo); + goto reserve_bo_failed; + } + } + r = dma_resv_reserve_fences(bo->tbo.base.resv, 1); if (r) { pr_debug("failed %d to reserve bo\n", r); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -468,7 +468,6 @@ static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder) { drm_encoder_cleanup(encoder); - kfree(encoder); } static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = { @@ -897,11 +896,6 @@ if (IS_ERR(mst_state)) return PTR_ERR(mst_state); - mst_state->pbn_div = dm_mst_get_pbn_divider(dc_link); -#if defined(CONFIG_DRM_AMD_DC_DCN) - drm_dp_mst_update_slots(mst_state, dc_link_dp_mst_decide_link_encoding_format(dc_link)); -#endif - /* Set up params */ for (i = 0; i < dc_state->stream_count; i++) { struct dc_dsc_policy dsc_policy = {0}; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c @@ -90,8 +90,8 @@ { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3, 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR2020_TYPE, - { 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2, - 0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} }, + { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2, + 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }, { COLOR_SPACE_YCBCR709_BLACK_TYPE, { 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -3995,10 +3995,13 @@ struct fixed31_32 avg_time_slots_per_mtp = dc_fixpt_from_int(0); int i; bool mst_mode = (link->type == dc_connection_mst_branch); + /* adjust for drm changes*/ + bool update_drm_mst_state = true; const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res); const struct dc_link_settings empty_link_settings = {0}; DC_LOGGER_INIT(link->ctx->logger); + /* deallocate_mst_payload is called before disable link. When mode or * disable/enable monitor, new stream is created which is not in link * stream[] yet. For this, payload is not allocated yet, so de-alloc @@ -4014,7 +4017,7 @@ &empty_link_settings, avg_time_slots_per_mtp); - if (mst_mode) { + if (mst_mode || update_drm_mst_state) { /* when link is in mst mode, reply on mst manager to remove * payload */ @@ -4077,11 +4080,18 @@ stream->ctx, stream); + if (!update_drm_mst_state) + dm_helpers_dp_mst_send_payload_allocation( + stream->ctx, + stream, + false); + } + + if (update_drm_mst_state) dm_helpers_dp_mst_send_payload_allocation( stream->ctx, stream, false); - } return DC_OK; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -871,8 +871,9 @@ }, // 6:1 downscaling ratio: 1000/6 = 166.666 + // 4:1 downscaling ratio for ARGB888 to prevent underflow during P010 playback: 1000/4 = 250 .max_downscale_factor = { - .argb8888 = 167, + .argb8888 = 250, .nv12 = 167, .fp16 = 167 }, @@ -1755,7 +1756,7 @@ pool->base.underlay_pipe_index = NO_UNDERLAY_PIPE; pool->base.pipe_count = pool->base.res_cap->num_timing_generator; pool->base.mpcc_count = pool->base.res_cap->num_timing_generator; - dc->caps.max_downscale_ratio = 600; + dc->caps.max_downscale_ratio = 400; dc->caps.i2c_speed_in_khz = 100; dc->caps.i2c_speed_in_khz_hdcp = 100; dc->caps.max_cursor_size = 256; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c @@ -94,7 +94,7 @@ .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, .calc_vupdate_position = dcn10_calc_vupdate_position, .apply_idle_power_optimizations = dcn32_apply_idle_power_optimizations, - .does_plane_fit_in_mall = dcn30_does_plane_fit_in_mall, + .does_plane_fit_in_mall = NULL, .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .hardware_release = dcn30_hardware_release, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c @@ -3184,7 +3184,7 @@ } else { v->MIN_DST_Y_NEXT_START[k] = v->VTotal[k] - v->VFrontPorch[k] + v->VTotal[k] - v->VActive[k] - v->VStartup[k]; } - v->MIN_DST_Y_NEXT_START[k] += dml_floor(4.0 * v->TSetup[k] / (double)v->HTotal[k] / v->PixelClock[k], 1.0) / 4.0; + v->MIN_DST_Y_NEXT_START[k] += dml_floor(4.0 * v->TSetup[k] / ((double)v->HTotal[k] / v->PixelClock[k]), 1.0) / 4.0; if (((v->VUpdateOffsetPix[k] + v->VUpdateWidthPix[k] + v->VReadyOffsetPix[k]) / v->HTotal[k]) <= (isInterlaceTiming ? dml_floor((v->VTotal[k] - v->VActive[k] - v->VFrontPorch[k] - v->VStartup[k]) / 2.0, 1.0) : only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h @@ -73,4 +73,7 @@ void dcn32_patch_dpm_table(struct clk_bw_params *bw_params); +void dcn32_zero_pipe_dcc_fraction(display_e2e_pipe_params_st *pipes, + int pipe_cnt); + #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c @@ -532,6 +532,9 @@ if (dmub->hw_funcs.reset) dmub->hw_funcs.reset(dmub); + /* reset the cache of the last wptr as well now that hw is reset */ + dmub->inbox1_last_wptr = 0; + cw0.offset.quad_part = inst_fb->gpu_addr; cw0.region.base = DMUB_CW0_BASE; cw0.region.top = cw0.region.base + inst_fb->size - 1; @@ -649,6 +652,15 @@ if (dmub->hw_funcs.reset) dmub->hw_funcs.reset(dmub); + /* mailboxes have been reset in hw, so reset the sw state as well */ + dmub->inbox1_last_wptr = 0; + dmub->inbox1_rb.wrpt = 0; + dmub->inbox1_rb.rptr = 0; + dmub->outbox0_rb.wrpt = 0; + dmub->outbox0_rb.rptr = 0; + dmub->outbox1_rb.wrpt = 0; + dmub->outbox1_rb.rptr = 0; + dmub->hw_init = false; return DMUB_STATUS_OK; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -1991,6 +1991,8 @@ case IP_VERSION(9, 4, 2): case IP_VERSION(10, 3, 0): case IP_VERSION(11, 0, 0): + case IP_VERSION(11, 0, 1): + case IP_VERSION(11, 0, 2): *states = ATTR_STATE_SUPPORTED; break; default: @@ -2007,14 +2009,16 @@ gc_ver == IP_VERSION(10, 3, 0) || gc_ver == IP_VERSION(10, 1, 2) || gc_ver == IP_VERSION(11, 0, 0) || - gc_ver == IP_VERSION(11, 0, 2))) + gc_ver == IP_VERSION(11, 0, 2) || + gc_ver == IP_VERSION(11, 0, 3))) *states = ATTR_STATE_UNSUPPORTED; } else if (DEVICE_ATTR_IS(pp_dpm_dclk)) { if (!(gc_ver == IP_VERSION(10, 3, 1) || gc_ver == IP_VERSION(10, 3, 0) || gc_ver == IP_VERSION(10, 1, 2) || gc_ver == IP_VERSION(11, 0, 0) || - gc_ver == IP_VERSION(11, 0, 2))) + gc_ver == IP_VERSION(11, 0, 2) || + gc_ver == IP_VERSION(11, 0, 3))) *states = ATTR_STATE_UNSUPPORTED; } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) { if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -585,6 +585,7 @@ yellow_carp_set_ppt_funcs(smu); break; case IP_VERSION(13, 0, 4): + case IP_VERSION(13, 0, 11): smu_v13_0_4_set_ppt_funcs(smu); break; case IP_VERSION(13, 0, 5): @@ -1494,6 +1495,20 @@ return 0; default: break; + } + } + + /* + * For SMU 13.0.4/11, PMFW will handle the features disablement properly + * for gpu reset case. Driver involvement is unnecessary. + */ + if (amdgpu_in_reset(adev)) { + switch (adev->ip_versions[MP1_HWIP][0]) { + case IP_VERSION(13, 0, 4): + case IP_VERSION(13, 0, 11): + return 0; + default: + break; } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h @@ -568,6 +568,10 @@ u32 param_reg; u32 msg_reg; u32 resp_reg; + + u32 debug_param_reg; + u32 debug_msg_reg; + u32 debug_resp_reg; }; struct i2c_adapter; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h @@ -113,20 +113,21 @@ #define NUM_FEATURES 64 #define ALLOWED_FEATURE_CTRL_DEFAULT 0xFFFFFFFFFFFFFFFFULL -#define ALLOWED_FEATURE_CTRL_SCPM (1 << FEATURE_DPM_GFXCLK_BIT) | \ - (1 << FEATURE_DPM_GFX_POWER_OPTIMIZER_BIT) | \ - (1 << FEATURE_DPM_UCLK_BIT) | \ - (1 << FEATURE_DPM_FCLK_BIT) | \ - (1 << FEATURE_DPM_SOCCLK_BIT) | \ - (1 << FEATURE_DPM_MP0CLK_BIT) | \ - (1 << FEATURE_DPM_LINK_BIT) | \ - (1 << FEATURE_DPM_DCN_BIT) | \ - (1 << FEATURE_DS_GFXCLK_BIT) | \ - (1 << FEATURE_DS_SOCCLK_BIT) | \ - (1 << FEATURE_DS_FCLK_BIT) | \ - (1 << FEATURE_DS_LCLK_BIT) | \ - (1 << FEATURE_DS_DCFCLK_BIT) | \ - (1 << FEATURE_DS_UCLK_BIT) +#define ALLOWED_FEATURE_CTRL_SCPM ((1 << FEATURE_DPM_GFXCLK_BIT) | \ + (1 << FEATURE_DPM_GFX_POWER_OPTIMIZER_BIT) | \ + (1 << FEATURE_DPM_UCLK_BIT) | \ + (1 << FEATURE_DPM_FCLK_BIT) | \ + (1 << FEATURE_DPM_SOCCLK_BIT) | \ + (1 << FEATURE_DPM_MP0CLK_BIT) | \ + (1 << FEATURE_DPM_LINK_BIT) | \ + (1 << FEATURE_DPM_DCN_BIT) | \ + (1 << FEATURE_DS_GFXCLK_BIT) | \ + (1 << FEATURE_DS_SOCCLK_BIT) | \ + (1 << FEATURE_DS_FCLK_BIT) | \ + (1 << FEATURE_DS_LCLK_BIT) | \ + (1 << FEATURE_DS_DCFCLK_BIT) | \ + (1 << FEATURE_DS_UCLK_BIT) | \ + (1ULL << FEATURE_DS_VCN_BIT)) //For use with feature control messages typedef enum { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h @@ -131,7 +131,13 @@ #define PPSMC_MSG_EnableAudioStutterWA 0x44 #define PPSMC_MSG_PowerUpUmsch 0x45 #define PPSMC_MSG_PowerDownUmsch 0x46 -#define PPSMC_Message_Count 0x47 +#define PPSMC_MSG_SetDcsArch 0x47 +#define PPSMC_MSG_TriggerVFFLR 0x48 +#define PPSMC_MSG_SetNumBadMemoryPagesRetired 0x49 +#define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4A +#define PPSMC_MSG_SetPriorityDeltaGain 0x4B +#define PPSMC_MSG_AllowIHHostInterrupt 0x4C +#define PPSMC_Message_Count 0x4D //Debug Dump Message #define DEBUGSMC_MSG_TestMessage 0x1 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h @@ -239,7 +239,10 @@ __SMU_DUMMY_MAP(DriverMode2Reset), \ __SMU_DUMMY_MAP(GetGfxOffStatus), \ __SMU_DUMMY_MAP(GetGfxOffEntryCount), \ - __SMU_DUMMY_MAP(LogGfxOffResidency), + __SMU_DUMMY_MAP(LogGfxOffResidency), \ + __SMU_DUMMY_MAP(SetNumBadMemoryPagesRetired), \ + __SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel), \ + __SMU_DUMMY_MAP(AllowGpo), #undef __SMU_DUMMY_MAP #define __SMU_DUMMY_MAP(type) SMU_MSG_##type only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c @@ -1171,6 +1171,7 @@ int ret = 0; uint32_t apu_percent = 0; uint32_t dgpu_percent = 0; + struct amdgpu_device *adev = smu->adev; ret = smu_cmn_get_metrics_table(smu, @@ -1196,7 +1197,11 @@ *value = metrics->AverageUvdActivity / 100; break; case METRICS_AVERAGE_SOCKETPOWER: - *value = (metrics->CurrentSocketPower << 8) / 1000; + if (((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) && (adev->pm.fw_version >= 0x40000f)) || + ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0)) && (adev->pm.fw_version >= 0x373200))) + *value = metrics->CurrentSocketPower << 8; + else + *value = (metrics->CurrentSocketPower << 8) / 1000; break; case METRICS_TEMPERATURE_EDGE: *value = (metrics->GfxTemperature / 100) * only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c @@ -1026,6 +1026,15 @@ .set_gfx_power_up_by_imu = smu_v13_0_set_gfx_power_up_by_imu, }; +static void smu_v13_0_4_set_smu_mailbox_registers(struct smu_context *smu) +{ + struct amdgpu_device *adev = smu->adev; + + smu->param_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_82); + smu->msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_66); + smu->resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90); +} + void smu_v13_0_4_set_ppt_funcs(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; @@ -1035,7 +1044,9 @@ smu->feature_map = smu_v13_0_4_feature_mask_map; smu->table_map = smu_v13_0_4_table_map; smu->is_apu = true; - smu->param_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_82); - smu->msg_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_66); - smu->resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_90); + + if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 4)) + smu_v13_0_4_set_smu_mailbox_registers(smu); + else + smu_v13_0_set_smu_mailbox_registers(smu); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c @@ -233,6 +233,18 @@ WREG32(smu->msg_reg, msg); } +static int __smu_cmn_send_debug_msg(struct smu_context *smu, + u32 msg, + u32 param) +{ + struct amdgpu_device *adev = smu->adev; + + WREG32(smu->debug_param_reg, param); + WREG32(smu->debug_msg_reg, msg); + WREG32(smu->debug_resp_reg, 0); + + return 0; +} /** * smu_cmn_send_msg_without_waiting -- send the message; don't wait for status * @smu: pointer to an SMU context @@ -386,6 +398,12 @@ read_arg); } +int smu_cmn_send_debug_smc_msg(struct smu_context *smu, + uint32_t msg) +{ + return __smu_cmn_send_debug_msg(smu, msg, 0); +} + int smu_cmn_to_asic_specific_index(struct smu_context *smu, enum smu_cmn2asic_mapping_type type, uint32_t index) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h @@ -42,6 +42,9 @@ enum smu_message_type msg, uint32_t *read_arg); +int smu_cmn_send_debug_smc_msg(struct smu_context *smu, + uint32_t msg); + int smu_cmn_wait_for_response(struct smu_context *smu); int smu_cmn_to_asic_specific_index(struct smu_context *smu, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3372,6 +3372,9 @@ mgr->payload_count--; mgr->next_start_slot -= payload->time_slots; + + if (payload->delete) + drm_dp_mst_put_port_malloc(payload->port); } EXPORT_SYMBOL(drm_dp_remove_payload); @@ -4327,7 +4330,6 @@ drm_dbg_atomic(mgr->dev, "[MST PORT:%p] TU %d -> 0\n", port, payload->time_slots); if (!payload->delete) { - drm_dp_mst_put_port_malloc(port); payload->pbn = 0; payload->delete = true; topology_state->payload_mask &= ~BIT(payload->vcpi - 1); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/drm_buddy.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_buddy.c @@ -38,6 +38,25 @@ kmem_cache_free(slab_blocks, block); } +static void list_insert_sorted(struct drm_buddy *mm, + struct drm_buddy_block *block) +{ + struct drm_buddy_block *node; + struct list_head *head; + + head = &mm->free_list[drm_buddy_block_order(block)]; + if (list_empty(head)) { + list_add(&block->link, head); + return; + } + + list_for_each_entry(node, head, link) + if (drm_buddy_block_offset(block) < drm_buddy_block_offset(node)) + break; + + __list_add(&block->link, node->link.prev, &node->link); +} + static void mark_allocated(struct drm_buddy_block *block) { block->header &= ~DRM_BUDDY_HEADER_STATE; @@ -52,8 +71,7 @@ block->header &= ~DRM_BUDDY_HEADER_STATE; block->header |= DRM_BUDDY_FREE; - list_add(&block->link, - &mm->free_list[drm_buddy_block_order(block)]); + list_insert_sorted(mm, block); } static void mark_split(struct drm_buddy_block *block) @@ -387,20 +405,26 @@ } static struct drm_buddy_block * -get_maxblock(struct list_head *head) +get_maxblock(struct drm_buddy *mm, unsigned int order) { struct drm_buddy_block *max_block = NULL, *node; + unsigned int i; - max_block = list_first_entry_or_null(head, - struct drm_buddy_block, - link); - if (!max_block) - return NULL; - - list_for_each_entry(node, head, link) { - if (drm_buddy_block_offset(node) > - drm_buddy_block_offset(max_block)) - max_block = node; + for (i = order; i <= mm->max_order; ++i) { + if (!list_empty(&mm->free_list[i])) { + node = list_last_entry(&mm->free_list[i], + struct drm_buddy_block, + link); + if (!max_block) { + max_block = node; + continue; + } + + if (drm_buddy_block_offset(node) > + drm_buddy_block_offset(max_block)) { + max_block = node; + } + } } return max_block; @@ -412,20 +436,23 @@ unsigned long flags) { struct drm_buddy_block *block = NULL; - unsigned int i; + unsigned int tmp; int err; - for (i = order; i <= mm->max_order; ++i) { - if (flags & DRM_BUDDY_TOPDOWN_ALLOCATION) { - block = get_maxblock(&mm->free_list[i]); - if (block) - break; - } else { - block = list_first_entry_or_null(&mm->free_list[i], - struct drm_buddy_block, - link); - if (block) - break; + if (flags & DRM_BUDDY_TOPDOWN_ALLOCATION) { + block = get_maxblock(mm, order); + if (block) + /* Store the obtained block order */ + tmp = drm_buddy_block_order(block); + } else { + for (tmp = order; tmp <= mm->max_order; ++tmp) { + if (!list_empty(&mm->free_list[tmp])) { + block = list_last_entry(&mm->free_list[tmp], + struct drm_buddy_block, + link); + if (block) + break; + } } } @@ -434,18 +461,18 @@ BUG_ON(!drm_buddy_block_is_free(block)); - while (i != order) { + while (tmp != order) { err = split_block(mm, block); if (unlikely(err)) goto err_undo; block = block->right; - i--; + tmp--; } return block; err_undo: - if (i != order) + if (tmp != order) __drm_buddy_free(mm, block); return ERR_PTR(err); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_panel_orientation_quirks.c @@ -304,6 +304,12 @@ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, + }, { /* Lenovo Ideapad D330-10IGL (HD) */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGL"), + }, + .driver_data = (void *)&lcd800x1280_rightside_up, }, { /* Lenovo Yoga Book X90F / X91F / X91L */ .matches = { /* Non exact match to match all versions */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/drm_vma_manager.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/drm_vma_manager.c @@ -240,27 +240,8 @@ } EXPORT_SYMBOL(drm_vma_offset_remove); -/** - * drm_vma_node_allow - Add open-file to list of allowed users - * @node: Node to modify - * @tag: Tag of file to remove - * - * Add @tag to the list of allowed open-files for this node. If @tag is - * already on this list, the ref-count is incremented. - * - * The list of allowed-users is preserved across drm_vma_offset_add() and - * drm_vma_offset_remove() calls. You may even call it if the node is currently - * not added to any offset-manager. - * - * You must remove all open-files the same number of times as you added them - * before destroying the node. Otherwise, you will leak memory. - * - * This is locked against concurrent access internally. - * - * RETURNS: - * 0 on success, negative error code on internal failure (out-of-mem) - */ -int drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *tag) +static int vma_node_allow(struct drm_vma_offset_node *node, + struct drm_file *tag, bool ref_counted) { struct rb_node **iter; struct rb_node *parent = NULL; @@ -282,7 +263,8 @@ entry = rb_entry(*iter, struct drm_vma_offset_file, vm_rb); if (tag == entry->vm_tag) { - entry->vm_count++; + if (ref_counted) + entry->vm_count++; goto unlock; } else if (tag > entry->vm_tag) { iter = &(*iter)->rb_right; @@ -307,9 +289,59 @@ kfree(new); return ret; } + +/** + * drm_vma_node_allow - Add open-file to list of allowed users + * @node: Node to modify + * @tag: Tag of file to remove + * + * Add @tag to the list of allowed open-files for this node. If @tag is + * already on this list, the ref-count is incremented. + * + * The list of allowed-users is preserved across drm_vma_offset_add() and + * drm_vma_offset_remove() calls. You may even call it if the node is currently + * not added to any offset-manager. + * + * You must remove all open-files the same number of times as you added them + * before destroying the node. Otherwise, you will leak memory. + * + * This is locked against concurrent access internally. + * + * RETURNS: + * 0 on success, negative error code on internal failure (out-of-mem) + */ +int drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *tag) +{ + return vma_node_allow(node, tag, true); +} EXPORT_SYMBOL(drm_vma_node_allow); /** + * drm_vma_node_allow_once - Add open-file to list of allowed users + * @node: Node to modify + * @tag: Tag of file to remove + * + * Add @tag to the list of allowed open-files for this node. + * + * The list of allowed-users is preserved across drm_vma_offset_add() and + * drm_vma_offset_remove() calls. You may even call it if the node is currently + * not added to any offset-manager. + * + * This is not ref-counted unlike drm_vma_node_allow() hence drm_vma_node_revoke() + * should only be called once after this. + * + * This is locked against concurrent access internally. + * + * RETURNS: + * 0 on success, negative error code on internal failure (out-of-mem) + */ +int drm_vma_node_allow_once(struct drm_vma_offset_node *node, struct drm_file *tag) +{ + return vma_node_allow(node, tag, false); +} +EXPORT_SYMBOL(drm_vma_node_allow_once); + +/** * drm_vma_node_revoke - Remove open-file from list of allowed users * @node: Node to modify * @tag: Tag of file to remove only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/display/intel_cdclk.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -1323,7 +1323,7 @@ { .refclk = 24000, .cdclk = 192000, .divider = 2, .ratio = 16 }, { .refclk = 24000, .cdclk = 312000, .divider = 2, .ratio = 26 }, { .refclk = 24000, .cdclk = 552000, .divider = 2, .ratio = 46 }, - { .refclk = 24400, .cdclk = 648000, .divider = 2, .ratio = 54 }, + { .refclk = 24000, .cdclk = 648000, .divider = 2, .ratio = 54 }, { .refclk = 38400, .cdclk = 179200, .divider = 3, .ratio = 14 }, { .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/display/intel_dmc.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dmc.c @@ -52,8 +52,8 @@ #define DISPLAY_VER12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE -#define DG2_DMC_PATH DMC_PATH(dg2, 2, 07) -#define DG2_DMC_VERSION_REQUIRED DMC_VERSION(2, 07) +#define DG2_DMC_PATH DMC_PATH(dg2, 2, 08) +#define DG2_DMC_VERSION_REQUIRED DMC_VERSION(2, 8) MODULE_FIRMWARE(DG2_DMC_PATH); #define ADLP_DMC_PATH DMC_PATH(adlp, 2, 16) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/display/intel_dp.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/intel_dp.h @@ -97,6 +97,8 @@ unsigned int type); bool intel_digital_port_connected(struct intel_encoder *encoder); +struct edid *intel_dp_get_edid(struct intel_dp *intel_dp); + static inline unsigned int intel_dp_unused_lane_mask(int lane_count) { return ~((1 << lane_count) - 1) & 0xf; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -1620,7 +1620,7 @@ u32 offset; int ret; - if (w > max_width || w < min_width || h > max_height) { + if (w > max_width || w < min_width || h > max_height || h < 1) { drm_dbg_kms(&dev_priv->drm, "requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n", w, h, min_width, max_width, max_height); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/display/skl_watermark.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/display/skl_watermark.c @@ -1587,7 +1587,8 @@ skl_check_wm_level(&wm->wm[level], ddb); if (icl_need_wm1_wa(i915, plane_id) && - level == 1 && wm->wm[0].enable) { + level == 1 && !wm->wm[level].enable && + wm->wm[0].enable) { wm->wm[level].blocks = wm->wm[0].blocks; wm->wm[level].lines = wm->wm[0].lines; wm->wm[level].ignore_lines = wm->wm[0].ignore_lines; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -1688,6 +1688,10 @@ init_contexts(&i915->gem.contexts); } +/* + * Note that this implicitly consumes the ctx reference, by placing + * the ctx in the context_xa. + */ static void gem_context_register(struct i915_gem_context *ctx, struct drm_i915_file_private *fpriv, u32 id) @@ -1703,10 +1707,6 @@ snprintf(ctx->name, sizeof(ctx->name), "%s[%d]", current->comm, pid_nr(ctx->pid)); - /* And finally expose ourselves to userspace via the idr */ - old = xa_store(&fpriv->context_xa, id, ctx, GFP_KERNEL); - WARN_ON(old); - spin_lock(&ctx->client->ctx_lock); list_add_tail_rcu(&ctx->client_link, &ctx->client->ctx_list); spin_unlock(&ctx->client->ctx_lock); @@ -1714,6 +1714,10 @@ spin_lock(&i915->gem.contexts.lock); list_add_tail(&ctx->link, &i915->gem.contexts.list); spin_unlock(&i915->gem.contexts.lock); + + /* And finally expose ourselves to userspace via the idr */ + old = xa_store(&fpriv->context_xa, id, ctx, GFP_KERNEL); + WARN_ON(old); } int i915_gem_context_open(struct drm_i915_private *i915, @@ -1857,11 +1861,19 @@ vm = ctx->vm; GEM_BUG_ON(!vm); + /* + * Get a reference for the allocated handle. Once the handle is + * visible in the vm_xa table, userspace could try to close it + * from under our feet, so we need to hold the extra reference + * first. + */ + i915_vm_get(vm); + err = xa_alloc(&file_priv->vm_xa, &id, vm, xa_limit_32b, GFP_KERNEL); - if (err) + if (err) { + i915_vm_put(vm); return err; - - i915_vm_get(vm); + } GEM_BUG_ON(id == 0); /* reserved for invalid/unassigned ppgtt */ args->value = id; @@ -2199,14 +2211,22 @@ if (IS_ERR(ctx)) return ctx; + /* + * One for the xarray and one for the caller. We need to grab + * the reference *prior* to making the ctx visble to userspace + * in gem_context_register(), as at any point after that + * userspace can try to race us with another thread destroying + * the context under our feet. + */ + i915_gem_context_get(ctx); + gem_context_register(ctx, file_priv, id); old = xa_erase(&file_priv->proto_context_xa, id); GEM_BUG_ON(old != pc); proto_context_close(file_priv->dev_priv, pc); - /* One for the xarray and one for the caller */ - return i915_gem_context_get(ctx); + return ctx; } struct i915_gem_context * only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_shmem.c @@ -579,7 +579,7 @@ mapping_set_gfp_mask(mapping, mask); GEM_BUG_ON(!(mapping_gfp_mask(mapping) & __GFP_RECLAIM)); - i915_gem_object_init(obj, &i915_gem_shmem_ops, &lock_class, 0); + i915_gem_object_init(obj, &i915_gem_shmem_ops, &lock_class, flags); obj->mem_flags |= I915_BO_FLAG_STRUCT_PAGE; obj->write_domain = I915_GEM_DOMAIN_CPU; obj->read_domains = I915_GEM_DOMAIN_CPU; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gem/i915_gem_tiling.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/i915_gem_tiling.c @@ -305,10 +305,6 @@ spin_unlock(&obj->vma.lock); obj->tiling_and_stride = tiling | stride; - i915_gem_object_unlock(obj); - - /* Force the fence to be reacquired for GTT access */ - i915_gem_object_release_mmap_gtt(obj); /* Try to preallocate memory required to save swizzling on put-pages */ if (i915_gem_object_needs_bit17_swizzle(obj)) { @@ -321,6 +317,11 @@ obj->bit_17 = NULL; } + i915_gem_object_unlock(obj); + + /* Force the fence to be reacquired for GTT access */ + i915_gem_object_release_mmap_gtt(obj); + return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gem/selftests/huge_pages.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gem/selftests/huge_pages.c @@ -1697,7 +1697,7 @@ I915_SHRINK_ACTIVE); i915_vma_unpin(vma); if (err) - goto out_put; + goto out_wf; /* * Now that the pages are *unpinned* shrinking should invoke @@ -1713,19 +1713,19 @@ pr_err("unexpected pages mismatch, should_swap=%s\n", str_yes_no(should_swap)); err = -EINVAL; - goto out_put; + goto out_wf; } if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) { pr_err("unexpected residual page-size bits, should_swap=%s\n", str_yes_no(should_swap)); err = -EINVAL; - goto out_put; + goto out_wf; } err = i915_vma_pin(vma, 0, 0, flags); if (err) - goto out_put; + goto out_wf; while (n--) { err = cpu_check(obj, n, 0xdeadbeaf); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_context.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_context.c @@ -528,7 +528,7 @@ return rq; } -struct i915_request *intel_context_find_active_request(struct intel_context *ce) +struct i915_request *intel_context_get_active_request(struct intel_context *ce) { struct intel_context *parent = intel_context_to_parent(ce); struct i915_request *rq, *active = NULL; @@ -552,6 +552,8 @@ active = rq; } + if (active) + active = i915_request_get_rcu(active); spin_unlock_irqrestore(&parent->guc_state.lock, flags); return active; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_context.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_context.h @@ -268,8 +268,7 @@ struct i915_request *intel_context_create_request(struct intel_context *ce); -struct i915_request * -intel_context_find_active_request(struct intel_context *ce); +struct i915_request *intel_context_get_active_request(struct intel_context *ce); static inline bool intel_context_is_barrier(const struct intel_context *ce) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_execlists_submission.c @@ -4144,6 +4144,33 @@ spin_unlock_irqrestore(&sched_engine->lock, flags); } +static unsigned long list_count(struct list_head *list) +{ + struct list_head *pos; + unsigned long count = 0; + + list_for_each(pos, list) + count++; + + return count; +} + +void intel_execlists_dump_active_requests(struct intel_engine_cs *engine, + struct i915_request *hung_rq, + struct drm_printer *m) +{ + unsigned long flags; + + spin_lock_irqsave(&engine->sched_engine->lock, flags); + + intel_engine_dump_active_requests(&engine->sched_engine->requests, hung_rq, m); + + drm_printf(m, "\tOn hold?: %lu\n", + list_count(&engine->sched_engine->hold)); + + spin_unlock_irqrestore(&engine->sched_engine->lock, flags); +} + #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) #include "selftest_execlists.c" #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_execlists_submission.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_execlists_submission.h @@ -32,6 +32,10 @@ int indent), unsigned int max); +void intel_execlists_dump_active_requests(struct intel_engine_cs *engine, + struct i915_request *hung_rq, + struct drm_printer *m); + bool intel_engine_in_execlists_submission_mode(const struct intel_engine_cs *engine); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_gt_regs.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_gt_regs.h @@ -396,9 +396,10 @@ #define RC_OP_FLUSH_ENABLE (1 << 0) #define HIZ_RAW_STALL_OPT_DISABLE (1 << 2) #define CACHE_MODE_1 _MMIO(0x7004) /* IVB+ */ -#define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1 << 6) -#define GEN8_4x4_STC_OPTIMIZATION_DISABLE (1 << 6) -#define GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE (1 << 1) +#define MSAA_OPTIMIZATION_REDUC_DISABLE REG_BIT(11) +#define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE REG_BIT(6) +#define GEN8_4x4_STC_OPTIMIZATION_DISABLE REG_BIT(6) +#define GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE REG_BIT(1) #define GEN7_GT_MODE _MMIO(0x7008) #define GEN9_IZ_HASHING_MASK(slice) (0x3 << ((slice) * 2)) @@ -423,6 +424,9 @@ #define GEN8_L3CNTLREG _MMIO(0x7034) #define GEN8_ERRDETBCTRL (1 << 9) +#define PSS_MODE2 _MMIO(0x703c) +#define SCOREBOARD_STALL_FLUSH_CONTROL REG_BIT(5) + #define GEN7_SC_INSTDONE _MMIO(0x7100) #define GEN12_SC_INSTDONE_EXTRA _MMIO(0x7104) #define GEN12_SC_INSTDONE_EXTRA2 _MMIO(0x7108) @@ -482,6 +486,9 @@ #define VF_PREEMPTION _MMIO(0x83a4) #define PREEMPTION_VERTEX_COUNT REG_GENMASK(15, 0) +#define VFG_PREEMPTION_CHICKEN _MMIO(0x83b4) +#define POLYGON_TRIFAN_LINELOOP_DISABLE REG_BIT(4) + #define GEN8_RC6_CTX_INFO _MMIO(0x8504) #define GEN12_SQCM _MMIO(0x8724) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c @@ -22,11 +22,9 @@ return !strncmp(kobj->name, "gt", 2); } -struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev, +struct intel_gt *intel_gt_sysfs_get_drvdata(struct kobject *kobj, const char *name) { - struct kobject *kobj = &dev->kobj; - /* * We are interested at knowing from where the interface * has been called, whether it's called from gt/ or from @@ -38,6 +36,7 @@ * "struct drm_i915_private *" type. */ if (!is_object_gt(kobj)) { + struct device *dev = kobj_to_dev(kobj); struct drm_i915_private *i915 = kdev_minor_to_i915(dev); return to_gt(i915); @@ -51,18 +50,18 @@ return >->i915->drm.primary->kdev->kobj; } -static ssize_t id_show(struct device *dev, - struct device_attribute *attr, +static ssize_t id_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); return sysfs_emit(buf, "%u\n", gt->info.id); } -static DEVICE_ATTR_RO(id); +static struct kobj_attribute attr_id = __ATTR_RO(id); static struct attribute *id_attrs[] = { - &dev_attr_id.attr, + &attr_id.attr, NULL, }; ATTRIBUTE_GROUPS(id); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h @@ -30,7 +30,7 @@ void intel_gt_sysfs_register(struct intel_gt *gt); void intel_gt_sysfs_unregister(struct intel_gt *gt); -struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev, +struct intel_gt *intel_gt_sysfs_get_drvdata(struct kobject *kobj, const char *name); #endif /* SYSFS_GT_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c @@ -24,14 +24,15 @@ }; static int -sysfs_gt_attribute_w_func(struct device *dev, struct device_attribute *attr, +sysfs_gt_attribute_w_func(struct kobject *kobj, struct attribute *attr, int (func)(struct intel_gt *gt, u32 val), u32 val) { struct intel_gt *gt; int ret; - if (!is_object_gt(&dev->kobj)) { + if (!is_object_gt(kobj)) { int i; + struct device *dev = kobj_to_dev(kobj); struct drm_i915_private *i915 = kdev_minor_to_i915(dev); for_each_gt(gt, i915, i) { @@ -40,7 +41,7 @@ break; } } else { - gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); ret = func(gt, val); } @@ -48,7 +49,7 @@ } static u32 -sysfs_gt_attribute_r_func(struct device *dev, struct device_attribute *attr, +sysfs_gt_attribute_r_func(struct kobject *kobj, struct attribute *attr, u32 (func)(struct intel_gt *gt), enum intel_gt_sysfs_op op) { @@ -57,8 +58,9 @@ ret = (op == INTEL_GT_SYSFS_MAX) ? 0 : (u32) -1; - if (!is_object_gt(&dev->kobj)) { + if (!is_object_gt(kobj)) { int i; + struct device *dev = kobj_to_dev(kobj); struct drm_i915_private *i915 = kdev_minor_to_i915(dev); for_each_gt(gt, i915, i) { @@ -77,7 +79,7 @@ } } } else { - gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); ret = func(gt); } @@ -92,6 +94,76 @@ #define sysfs_gt_attribute_r_max_func(d, a, f) \ sysfs_gt_attribute_r_func(d, a, f, INTEL_GT_SYSFS_MAX) +#define INTEL_GT_SYSFS_SHOW(_name, _attr_type) \ + static ssize_t _name##_show_common(struct kobject *kobj, \ + struct attribute *attr, char *buff) \ + { \ + u32 val = sysfs_gt_attribute_r_##_attr_type##_func(kobj, attr, \ + __##_name##_show); \ + \ + return sysfs_emit(buff, "%u\n", val); \ + } \ + static ssize_t _name##_show(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buff) \ + { \ + return _name ##_show_common(kobj, &attr->attr, buff); \ + } \ + static ssize_t _name##_dev_show(struct device *dev, \ + struct device_attribute *attr, char *buff) \ + { \ + return _name##_show_common(&dev->kobj, &attr->attr, buff); \ + } + +#define INTEL_GT_SYSFS_STORE(_name, _func) \ + static ssize_t _name##_store_common(struct kobject *kobj, \ + struct attribute *attr, \ + const char *buff, size_t count) \ + { \ + int ret; \ + u32 val; \ + \ + ret = kstrtou32(buff, 0, &val); \ + if (ret) \ + return ret; \ + \ + ret = sysfs_gt_attribute_w_func(kobj, attr, _func, val); \ + \ + return ret ?: count; \ + } \ + static ssize_t _name##_store(struct kobject *kobj, \ + struct kobj_attribute *attr, const char *buff, \ + size_t count) \ + { \ + return _name##_store_common(kobj, &attr->attr, buff, count); \ + } \ + static ssize_t _name##_dev_store(struct device *dev, \ + struct device_attribute *attr, \ + const char *buff, size_t count) \ + { \ + return _name##_store_common(&dev->kobj, &attr->attr, buff, count); \ + } + +#define INTEL_GT_SYSFS_SHOW_MAX(_name) INTEL_GT_SYSFS_SHOW(_name, max) +#define INTEL_GT_SYSFS_SHOW_MIN(_name) INTEL_GT_SYSFS_SHOW(_name, min) + +#define INTEL_GT_ATTR_RW(_name) \ + static struct kobj_attribute attr_##_name = __ATTR_RW(_name) + +#define INTEL_GT_ATTR_RO(_name) \ + static struct kobj_attribute attr_##_name = __ATTR_RO(_name) + +#define INTEL_GT_DUAL_ATTR_RW(_name) \ + static struct device_attribute dev_attr_##_name = __ATTR(_name, 0644, \ + _name##_dev_show, \ + _name##_dev_store); \ + INTEL_GT_ATTR_RW(_name) + +#define INTEL_GT_DUAL_ATTR_RO(_name) \ + static struct device_attribute dev_attr_##_name = __ATTR(_name, 0444, \ + _name##_dev_show, \ + NULL); \ + INTEL_GT_ATTR_RO(_name) + #ifdef CONFIG_PM static u32 get_residency(struct intel_gt *gt, i915_reg_t reg) { @@ -104,11 +176,8 @@ return DIV_ROUND_CLOSEST_ULL(res, 1000); } -static ssize_t rc6_enable_show(struct device *dev, - struct device_attribute *attr, - char *buff) +static u8 get_rc6_mask(struct intel_gt *gt) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); u8 mask = 0; if (HAS_RC6(gt->i915)) @@ -118,37 +187,35 @@ if (HAS_RC6pp(gt->i915)) mask |= BIT(2); - return sysfs_emit(buff, "%x\n", mask); + return mask; } -static u32 __rc6_residency_ms_show(struct intel_gt *gt) +static ssize_t rc6_enable_show(struct kobject *kobj, + struct kobj_attribute *attr, + char *buff) { - return get_residency(gt, GEN6_GT_GFX_RC6); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); + + return sysfs_emit(buff, "%x\n", get_rc6_mask(gt)); } -static ssize_t rc6_residency_ms_show(struct device *dev, - struct device_attribute *attr, - char *buff) +static ssize_t rc6_enable_dev_show(struct device *dev, + struct device_attribute *attr, + char *buff) { - u32 rc6_residency = sysfs_gt_attribute_r_min_func(dev, attr, - __rc6_residency_ms_show); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name); - return sysfs_emit(buff, "%u\n", rc6_residency); + return sysfs_emit(buff, "%x\n", get_rc6_mask(gt)); } -static u32 __rc6p_residency_ms_show(struct intel_gt *gt) +static u32 __rc6_residency_ms_show(struct intel_gt *gt) { - return get_residency(gt, GEN6_GT_GFX_RC6p); + return get_residency(gt, GEN6_GT_GFX_RC6); } -static ssize_t rc6p_residency_ms_show(struct device *dev, - struct device_attribute *attr, - char *buff) +static u32 __rc6p_residency_ms_show(struct intel_gt *gt) { - u32 rc6p_residency = sysfs_gt_attribute_r_min_func(dev, attr, - __rc6p_residency_ms_show); - - return sysfs_emit(buff, "%u\n", rc6p_residency); + return get_residency(gt, GEN6_GT_GFX_RC6p); } static u32 __rc6pp_residency_ms_show(struct intel_gt *gt) @@ -156,67 +223,69 @@ return get_residency(gt, GEN6_GT_GFX_RC6pp); } -static ssize_t rc6pp_residency_ms_show(struct device *dev, - struct device_attribute *attr, - char *buff) -{ - u32 rc6pp_residency = sysfs_gt_attribute_r_min_func(dev, attr, - __rc6pp_residency_ms_show); - - return sysfs_emit(buff, "%u\n", rc6pp_residency); -} - static u32 __media_rc6_residency_ms_show(struct intel_gt *gt) { return get_residency(gt, VLV_GT_MEDIA_RC6); } -static ssize_t media_rc6_residency_ms_show(struct device *dev, - struct device_attribute *attr, - char *buff) -{ - u32 rc6_residency = sysfs_gt_attribute_r_min_func(dev, attr, - __media_rc6_residency_ms_show); +INTEL_GT_SYSFS_SHOW_MIN(rc6_residency_ms); +INTEL_GT_SYSFS_SHOW_MIN(rc6p_residency_ms); +INTEL_GT_SYSFS_SHOW_MIN(rc6pp_residency_ms); +INTEL_GT_SYSFS_SHOW_MIN(media_rc6_residency_ms); + +INTEL_GT_DUAL_ATTR_RO(rc6_enable); +INTEL_GT_DUAL_ATTR_RO(rc6_residency_ms); +INTEL_GT_DUAL_ATTR_RO(rc6p_residency_ms); +INTEL_GT_DUAL_ATTR_RO(rc6pp_residency_ms); +INTEL_GT_DUAL_ATTR_RO(media_rc6_residency_ms); - return sysfs_emit(buff, "%u\n", rc6_residency); -} +static struct attribute *rc6_attrs[] = { + &attr_rc6_enable.attr, + &attr_rc6_residency_ms.attr, + NULL +}; -static DEVICE_ATTR_RO(rc6_enable); -static DEVICE_ATTR_RO(rc6_residency_ms); -static DEVICE_ATTR_RO(rc6p_residency_ms); -static DEVICE_ATTR_RO(rc6pp_residency_ms); -static DEVICE_ATTR_RO(media_rc6_residency_ms); +static struct attribute *rc6p_attrs[] = { + &attr_rc6p_residency_ms.attr, + &attr_rc6pp_residency_ms.attr, + NULL +}; -static struct attribute *rc6_attrs[] = { +static struct attribute *media_rc6_attrs[] = { + &attr_media_rc6_residency_ms.attr, + NULL +}; + +static struct attribute *rc6_dev_attrs[] = { &dev_attr_rc6_enable.attr, &dev_attr_rc6_residency_ms.attr, NULL }; -static struct attribute *rc6p_attrs[] = { +static struct attribute *rc6p_dev_attrs[] = { &dev_attr_rc6p_residency_ms.attr, &dev_attr_rc6pp_residency_ms.attr, NULL }; -static struct attribute *media_rc6_attrs[] = { +static struct attribute *media_rc6_dev_attrs[] = { &dev_attr_media_rc6_residency_ms.attr, NULL }; static const struct attribute_group rc6_attr_group[] = { { .attrs = rc6_attrs, }, - { .name = power_group_name, .attrs = rc6_attrs, }, + { .name = power_group_name, .attrs = rc6_dev_attrs, }, }; static const struct attribute_group rc6p_attr_group[] = { { .attrs = rc6p_attrs, }, - { .name = power_group_name, .attrs = rc6p_attrs, }, + { .name = power_group_name, .attrs = rc6p_dev_attrs, }, }; static const struct attribute_group media_rc6_attr_group[] = { { .attrs = media_rc6_attrs, }, - { .name = power_group_name, .attrs = media_rc6_attrs, }, + { .name = power_group_name, .attrs = media_rc6_dev_attrs, }, }; static int __intel_gt_sysfs_create_group(struct kobject *kobj, @@ -271,104 +340,34 @@ return intel_rps_read_actual_frequency(>->rps); } -static ssize_t act_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 actual_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __act_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", actual_freq); -} - static u32 __cur_freq_mhz_show(struct intel_gt *gt) { return intel_rps_get_requested_frequency(>->rps); } -static ssize_t cur_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 cur_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __cur_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", cur_freq); -} - static u32 __boost_freq_mhz_show(struct intel_gt *gt) { return intel_rps_get_boost_frequency(>->rps); } -static ssize_t boost_freq_mhz_show(struct device *dev, - struct device_attribute *attr, - char *buff) -{ - u32 boost_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __boost_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", boost_freq); -} - static int __boost_freq_mhz_store(struct intel_gt *gt, u32 val) { return intel_rps_set_boost_frequency(>->rps, val); } -static ssize_t boost_freq_mhz_store(struct device *dev, - struct device_attribute *attr, - const char *buff, size_t count) -{ - ssize_t ret; - u32 val; - - ret = kstrtou32(buff, 0, &val); - if (ret) - return ret; - - return sysfs_gt_attribute_w_func(dev, attr, - __boost_freq_mhz_store, val) ?: count; -} - -static u32 __rp0_freq_mhz_show(struct intel_gt *gt) +static u32 __RP0_freq_mhz_show(struct intel_gt *gt) { return intel_rps_get_rp0_frequency(>->rps); } -static ssize_t RP0_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 rp0_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __rp0_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", rp0_freq); -} - -static u32 __rp1_freq_mhz_show(struct intel_gt *gt) -{ - return intel_rps_get_rp1_frequency(>->rps); -} - -static ssize_t RP1_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 rp1_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __rp1_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", rp1_freq); -} - -static u32 __rpn_freq_mhz_show(struct intel_gt *gt) +static u32 __RPn_freq_mhz_show(struct intel_gt *gt) { return intel_rps_get_rpn_frequency(>->rps); } -static ssize_t RPn_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) +static u32 __RP1_freq_mhz_show(struct intel_gt *gt) { - u32 rpn_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __rpn_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", rpn_freq); + return intel_rps_get_rp1_frequency(>->rps); } static u32 __max_freq_mhz_show(struct intel_gt *gt) @@ -376,71 +375,21 @@ return intel_rps_get_max_frequency(>->rps); } -static ssize_t max_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 max_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __max_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", max_freq); -} - static int __set_max_freq(struct intel_gt *gt, u32 val) { return intel_rps_set_max_frequency(>->rps, val); } -static ssize_t max_freq_mhz_store(struct device *dev, - struct device_attribute *attr, - const char *buff, size_t count) -{ - int ret; - u32 val; - - ret = kstrtou32(buff, 0, &val); - if (ret) - return ret; - - ret = sysfs_gt_attribute_w_func(dev, attr, __set_max_freq, val); - - return ret ?: count; -} - static u32 __min_freq_mhz_show(struct intel_gt *gt) { return intel_rps_get_min_frequency(>->rps); } -static ssize_t min_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 min_freq = sysfs_gt_attribute_r_min_func(dev, attr, - __min_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", min_freq); -} - static int __set_min_freq(struct intel_gt *gt, u32 val) { return intel_rps_set_min_frequency(>->rps, val); } -static ssize_t min_freq_mhz_store(struct device *dev, - struct device_attribute *attr, - const char *buff, size_t count) -{ - int ret; - u32 val; - - ret = kstrtou32(buff, 0, &val); - if (ret) - return ret; - - ret = sysfs_gt_attribute_w_func(dev, attr, __set_min_freq, val); - - return ret ?: count; -} - static u32 __vlv_rpe_freq_mhz_show(struct intel_gt *gt) { struct intel_rps *rps = >->rps; @@ -448,23 +397,31 @@ return intel_gpu_freq(rps, rps->efficient_freq); } -static ssize_t vlv_rpe_freq_mhz_show(struct device *dev, - struct device_attribute *attr, char *buff) -{ - u32 rpe_freq = sysfs_gt_attribute_r_max_func(dev, attr, - __vlv_rpe_freq_mhz_show); - - return sysfs_emit(buff, "%u\n", rpe_freq); -} - -#define INTEL_GT_RPS_SYSFS_ATTR(_name, _mode, _show, _store) \ - static struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \ - static struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store) - -#define INTEL_GT_RPS_SYSFS_ATTR_RO(_name) \ - INTEL_GT_RPS_SYSFS_ATTR(_name, 0444, _name##_show, NULL) -#define INTEL_GT_RPS_SYSFS_ATTR_RW(_name) \ - INTEL_GT_RPS_SYSFS_ATTR(_name, 0644, _name##_show, _name##_store) +INTEL_GT_SYSFS_SHOW_MAX(act_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(boost_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(cur_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(RP0_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(RP1_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(RPn_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(max_freq_mhz); +INTEL_GT_SYSFS_SHOW_MIN(min_freq_mhz); +INTEL_GT_SYSFS_SHOW_MAX(vlv_rpe_freq_mhz); +INTEL_GT_SYSFS_STORE(boost_freq_mhz, __boost_freq_mhz_store); +INTEL_GT_SYSFS_STORE(max_freq_mhz, __set_max_freq); +INTEL_GT_SYSFS_STORE(min_freq_mhz, __set_min_freq); + +#define INTEL_GT_RPS_SYSFS_ATTR(_name, _mode, _show, _store, _show_dev, _store_dev) \ + static struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, \ + _show_dev, _store_dev); \ + static struct kobj_attribute attr_rps_##_name = __ATTR(rps_##_name, _mode, \ + _show, _store) + +#define INTEL_GT_RPS_SYSFS_ATTR_RO(_name) \ + INTEL_GT_RPS_SYSFS_ATTR(_name, 0444, _name##_show, NULL, \ + _name##_dev_show, NULL) +#define INTEL_GT_RPS_SYSFS_ATTR_RW(_name) \ + INTEL_GT_RPS_SYSFS_ATTR(_name, 0644, _name##_show, _name##_store, \ + _name##_dev_show, _name##_dev_store) /* The below macros generate static structures */ INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz); @@ -475,32 +432,31 @@ INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz); INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz); INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz); +INTEL_GT_RPS_SYSFS_ATTR_RO(vlv_rpe_freq_mhz); -static DEVICE_ATTR_RO(vlv_rpe_freq_mhz); - -#define GEN6_ATTR(s) { \ - &dev_attr_##s##_act_freq_mhz.attr, \ - &dev_attr_##s##_cur_freq_mhz.attr, \ - &dev_attr_##s##_boost_freq_mhz.attr, \ - &dev_attr_##s##_max_freq_mhz.attr, \ - &dev_attr_##s##_min_freq_mhz.attr, \ - &dev_attr_##s##_RP0_freq_mhz.attr, \ - &dev_attr_##s##_RP1_freq_mhz.attr, \ - &dev_attr_##s##_RPn_freq_mhz.attr, \ +#define GEN6_ATTR(p, s) { \ + &p##attr_##s##_act_freq_mhz.attr, \ + &p##attr_##s##_cur_freq_mhz.attr, \ + &p##attr_##s##_boost_freq_mhz.attr, \ + &p##attr_##s##_max_freq_mhz.attr, \ + &p##attr_##s##_min_freq_mhz.attr, \ + &p##attr_##s##_RP0_freq_mhz.attr, \ + &p##attr_##s##_RP1_freq_mhz.attr, \ + &p##attr_##s##_RPn_freq_mhz.attr, \ NULL, \ } -#define GEN6_RPS_ATTR GEN6_ATTR(rps) -#define GEN6_GT_ATTR GEN6_ATTR(gt) +#define GEN6_RPS_ATTR GEN6_ATTR(, rps) +#define GEN6_GT_ATTR GEN6_ATTR(dev_, gt) static const struct attribute * const gen6_rps_attrs[] = GEN6_RPS_ATTR; static const struct attribute * const gen6_gt_attrs[] = GEN6_GT_ATTR; -static ssize_t punit_req_freq_mhz_show(struct device *dev, - struct device_attribute *attr, +static ssize_t punit_req_freq_mhz_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); u32 preq = intel_rps_read_punit_req_frequency(>->rps); return sysfs_emit(buff, "%u\n", preq); @@ -508,17 +464,17 @@ struct intel_gt_bool_throttle_attr { struct attribute attr; - ssize_t (*show)(struct device *dev, struct device_attribute *attr, + ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr, char *buf); i915_reg_t reg32; u32 mask; }; -static ssize_t throttle_reason_bool_show(struct device *dev, - struct device_attribute *attr, +static ssize_t throttle_reason_bool_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); struct intel_gt_bool_throttle_attr *t_attr = (struct intel_gt_bool_throttle_attr *) attr; bool val = rps_read_mask_mmio(>->rps, t_attr->reg32, t_attr->mask); @@ -534,7 +490,7 @@ .mask = mask__, \ } -static DEVICE_ATTR_RO(punit_req_freq_mhz); +INTEL_GT_ATTR_RO(punit_req_freq_mhz); static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_status, GT0_PERF_LIMIT_REASONS_MASK); static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_pl1, POWER_LIMIT_1_MASK); static INTEL_GT_RPS_BOOL_ATTR_RO(throttle_reason_pl2, POWER_LIMIT_2_MASK); @@ -597,8 +553,8 @@ #define U8_8_VAL_MASK 0xffff #define U8_8_SCALE_TO_VALUE "0.00390625" -static ssize_t freq_factor_scale_show(struct device *dev, - struct device_attribute *attr, +static ssize_t freq_factor_scale_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { return sysfs_emit(buff, "%s\n", U8_8_SCALE_TO_VALUE); @@ -610,11 +566,11 @@ return !mode ? mode : 256 / mode; } -static ssize_t media_freq_factor_show(struct device *dev, - struct device_attribute *attr, +static ssize_t media_freq_factor_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); struct intel_guc_slpc *slpc = >->uc.guc.slpc; intel_wakeref_t wakeref; u32 mode; @@ -641,11 +597,11 @@ return sysfs_emit(buff, "%u\n", media_ratio_mode_to_factor(mode)); } -static ssize_t media_freq_factor_store(struct device *dev, - struct device_attribute *attr, +static ssize_t media_freq_factor_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buff, size_t count) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); struct intel_guc_slpc *slpc = >->uc.guc.slpc; u32 factor, mode; int err; @@ -670,11 +626,11 @@ return err ?: count; } -static ssize_t media_RP0_freq_mhz_show(struct device *dev, - struct device_attribute *attr, +static ssize_t media_RP0_freq_mhz_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); u32 val; int err; @@ -691,11 +647,11 @@ return sysfs_emit(buff, "%u\n", val); } -static ssize_t media_RPn_freq_mhz_show(struct device *dev, - struct device_attribute *attr, +static ssize_t media_RPn_freq_mhz_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buff) { - struct intel_gt *gt = intel_gt_sysfs_get_drvdata(dev, attr->attr.name); + struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); u32 val; int err; @@ -712,17 +668,17 @@ return sysfs_emit(buff, "%u\n", val); } -static DEVICE_ATTR_RW(media_freq_factor); -static struct device_attribute dev_attr_media_freq_factor_scale = +INTEL_GT_ATTR_RW(media_freq_factor); +static struct kobj_attribute attr_media_freq_factor_scale = __ATTR(media_freq_factor.scale, 0444, freq_factor_scale_show, NULL); -static DEVICE_ATTR_RO(media_RP0_freq_mhz); -static DEVICE_ATTR_RO(media_RPn_freq_mhz); +INTEL_GT_ATTR_RO(media_RP0_freq_mhz); +INTEL_GT_ATTR_RO(media_RPn_freq_mhz); static const struct attribute *media_perf_power_attrs[] = { - &dev_attr_media_freq_factor.attr, - &dev_attr_media_freq_factor_scale.attr, - &dev_attr_media_RP0_freq_mhz.attr, - &dev_attr_media_RPn_freq_mhz.attr, + &attr_media_freq_factor.attr, + &attr_media_freq_factor_scale.attr, + &attr_media_RP0_freq_mhz.attr, + &attr_media_RPn_freq_mhz.attr, NULL }; @@ -754,20 +710,29 @@ NULL }; -static int intel_sysfs_rps_init(struct intel_gt *gt, struct kobject *kobj, - const struct attribute * const *attrs) +static int intel_sysfs_rps_init(struct intel_gt *gt, struct kobject *kobj) { + const struct attribute * const *attrs; + struct attribute *vlv_attr; int ret; if (GRAPHICS_VER(gt->i915) < 6) return 0; + if (is_object_gt(kobj)) { + attrs = gen6_rps_attrs; + vlv_attr = &attr_rps_vlv_rpe_freq_mhz.attr; + } else { + attrs = gen6_gt_attrs; + vlv_attr = &dev_attr_gt_vlv_rpe_freq_mhz.attr; + } + ret = sysfs_create_files(kobj, attrs); if (ret) return ret; if (IS_VALLEYVIEW(gt->i915) || IS_CHERRYVIEW(gt->i915)) - ret = sysfs_create_file(kobj, &dev_attr_vlv_rpe_freq_mhz.attr); + ret = sysfs_create_file(kobj, vlv_attr); return ret; } @@ -778,9 +743,7 @@ intel_sysfs_rc6_init(gt, kobj); - ret = is_object_gt(kobj) ? - intel_sysfs_rps_init(gt, kobj, gen6_rps_attrs) : - intel_sysfs_rps_init(gt, kobj, gen6_gt_attrs); + ret = intel_sysfs_rps_init(gt, kobj); if (ret) drm_warn(>->i915->drm, "failed to create gt%u RPS sysfs files (%pe)", @@ -790,7 +753,7 @@ if (!is_object_gt(kobj)) return; - ret = sysfs_create_file(kobj, &dev_attr_punit_req_freq_mhz.attr); + ret = sysfs_create_file(kobj, &attr_punit_req_freq_mhz.attr); if (ret) drm_warn(>->i915->drm, "failed to create gt%u punit_req_freq_mhz sysfs (%pe)", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/gt/intel_reset.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/gt/intel_reset.c @@ -278,6 +278,7 @@ static int gen6_hw_domain_reset(struct intel_gt *gt, u32 hw_domain_mask) { struct intel_uncore *uncore = gt->uncore; + int loops = 2; int err; /* @@ -285,18 +286,39 @@ * for fifo space for the write or forcewake the chip for * the read */ - intel_uncore_write_fw(uncore, GEN6_GDRST, hw_domain_mask); + do { + intel_uncore_write_fw(uncore, GEN6_GDRST, hw_domain_mask); - /* Wait for the device to ack the reset requests */ - err = __intel_wait_for_register_fw(uncore, - GEN6_GDRST, hw_domain_mask, 0, - 500, 0, - NULL); + /* + * Wait for the device to ack the reset requests. + * + * On some platforms, e.g. Jasperlake, we see that the + * engine register state is not cleared until shortly after + * GDRST reports completion, causing a failure as we try + * to immediately resume while the internal state is still + * in flux. If we immediately repeat the reset, the second + * reset appears to serialise with the first, and since + * it is a no-op, the registers should retain their reset + * value. However, there is still a concern that upon + * leaving the second reset, the internal engine state + * is still in flux and not ready for resuming. + */ + err = __intel_wait_for_register_fw(uncore, GEN6_GDRST, + hw_domain_mask, 0, + 2000, 0, + NULL); + } while (err == 0 && --loops); if (err) GT_TRACE(gt, "Wait for 0x%08x engines reset failed\n", hw_domain_mask); + /* + * As we have observed that the engine state is still volatile + * after GDRST is acked, impose a small delay to let everything settle. + */ + udelay(50); + return err; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/i915_gpu_error.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1592,43 +1592,20 @@ { struct intel_engine_capture_vma *capture = NULL; struct intel_engine_coredump *ee; - struct intel_context *ce; + struct intel_context *ce = NULL; struct i915_request *rq = NULL; - unsigned long flags; ee = intel_engine_coredump_alloc(engine, ALLOW_FAIL, dump_flags); if (!ee) return NULL; - ce = intel_engine_get_hung_context(engine); - if (ce) { - intel_engine_clear_hung_context(engine); - rq = intel_context_find_active_request(ce); - if (!rq || !i915_request_started(rq)) - goto no_request_capture; - } else { - /* - * Getting here with GuC enabled means it is a forced error capture - * with no actual hang. So, no need to attempt the execlist search. - */ - if (!intel_uc_uses_guc_submission(&engine->gt->uc)) { - spin_lock_irqsave(&engine->sched_engine->lock, flags); - rq = intel_engine_execlist_find_hung_request(engine); - spin_unlock_irqrestore(&engine->sched_engine->lock, - flags); - } - } - if (rq) - rq = i915_request_get_rcu(rq); - - if (!rq) + intel_engine_get_hung_entity(engine, &ce, &rq); + if (!rq || !i915_request_started(rq)) goto no_request_capture; capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL); - if (!capture) { - i915_request_put(rq); + if (!capture) goto no_request_capture; - } if (dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE) intel_guc_capture_get_matching_node(engine->gt, ee, ce); @@ -1638,6 +1615,8 @@ return ee; no_request_capture: + if (rq) + i915_request_put(rq); kfree(ee); return NULL; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/i915_switcheroo.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/i915_switcheroo.c @@ -19,6 +19,10 @@ dev_err(&pdev->dev, "DRM not initialized, aborting switch.\n"); return; } + if (!HAS_DISPLAY(i915)) { + dev_err(&pdev->dev, "Device state not initialized, aborting switch.\n"); + return; + } if (state == VGA_SWITCHEROO_ON) { drm_info(&i915->drm, "switched on\n"); @@ -44,7 +48,7 @@ * locking inversion with the driver load path. And the access here is * completely racy anyway. So don't bother with locking for now. */ - return i915 && atomic_read(&i915->drm.open_count) == 0; + return i915 && HAS_DISPLAY(i915) && atomic_read(&i915->drm.open_count) == 0; } static const struct vga_switcheroo_client_ops i915_switcheroo_ops = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c @@ -28,8 +28,7 @@ int intel_selftest_modify_policy(struct intel_engine_cs *engine, struct intel_selftest_saved_policy *saved, - u32 modify_type) - + enum selftest_scheduler_modify modify_type) { int err; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -876,7 +876,8 @@ #define GBIF_CLIENT_HALT_MASK BIT(0) #define GBIF_ARB_HALT_MASK BIT(1) -static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu) +static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu, + bool gx_off) { struct msm_gpu *gpu = &adreno_gpu->base; @@ -889,9 +890,11 @@ return; } - /* Halt the gx side of GBIF */ - gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1); - spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1); + if (gx_off) { + /* Halt the gx side of GBIF */ + gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1); + spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1); + } /* Halt new client requests on GBIF */ gpu_write(gpu, REG_A6XX_GBIF_HALT, GBIF_CLIENT_HALT_MASK); @@ -929,7 +932,7 @@ /* Halt the gmu cm3 core */ gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1); - a6xx_bus_clear_pending_transactions(adreno_gpu); + a6xx_bus_clear_pending_transactions(adreno_gpu, true); /* Reset GPU core blocks */ gpu_write(gpu, REG_A6XX_RBBM_SW_RESET_CMD, 1); @@ -1083,7 +1086,7 @@ return; } - a6xx_bus_clear_pending_transactions(adreno_gpu); + a6xx_bus_clear_pending_transactions(adreno_gpu, a6xx_gpu->hung); /* tell the GMU we want to slumber */ ret = a6xx_gmu_notify_slumber(gmu); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -32,6 +32,7 @@ void *llc_slice; void *htw_llc_slice; bool have_mmu500; + bool hung; }; #define to_a6xx_gpu(x) container_of(x, struct a6xx_gpu, base) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -351,6 +351,8 @@ /* Ensure string is null terminated: */ str[len] = '\0'; + mutex_lock(&gpu->lock); + if (param == MSM_PARAM_COMM) { paramp = &ctx->comm; } else { @@ -360,6 +362,8 @@ kfree(*paramp); *paramp = str; + mutex_unlock(&gpu->lock); + return 0; } case MSM_PARAM_SYSPROF: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -29,11 +29,9 @@ ADRENO_FW_MAX, }; -enum adreno_quirks { - ADRENO_QUIRK_TWO_PASS_USE_WFI = 1, - ADRENO_QUIRK_FAULT_DETECT_MASK = 2, - ADRENO_QUIRK_LMLOADKILL_DISABLE = 3, -}; +#define ADRENO_QUIRK_TWO_PASS_USE_WFI BIT(0) +#define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(1) +#define ADRENO_QUIRK_LMLOADKILL_DISABLE BIT(2) struct adreno_rev { uint8_t core; @@ -65,7 +63,7 @@ const char *name; const char *fw[ADRENO_FW_MAX]; uint32_t gmem; - enum adreno_quirks quirks; + u64 quirks; struct msm_gpu *(*init)(struct drm_device *dev); const char *zapfw; u32 inactive_period; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -132,7 +132,6 @@ * dpu_encoder_phys_wb_setup_fb - setup output framebuffer * @phys_enc: Pointer to physical encoder * @fb: Pointer to output framebuffer - * @wb_roi: Pointer to output region of interest */ static void dpu_encoder_phys_wb_setup_fb(struct dpu_encoder_phys *phys_enc, struct drm_framebuffer *fb) @@ -692,7 +691,7 @@ /** * dpu_encoder_phys_wb_init - initialize writeback encoder - * @init: Pointer to init info structure with initialization params + * @p: Pointer to init info structure with initialization params */ struct dpu_encoder_phys *dpu_encoder_phys_wb_init( struct dpu_enc_phys_init_params *p) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/dp/dp_aux.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/dp/dp_aux.c @@ -423,6 +423,10 @@ isr = dp_catalog_aux_get_irq(aux->catalog); + /* no interrupts pending, return immediately */ + if (!isr) + return; + if (!aux->cmd_busy) return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/msm_drv.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/msm_drv.c @@ -1271,7 +1271,7 @@ * msm_drm_init, drm_dev->registered is used as an indicator that the * shutdown will be successful. */ - if (drm && drm->registered) + if (drm && drm->registered && priv->kms) drm_atomic_helper_shutdown(drm); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/msm_gpu.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/msm_gpu.c @@ -335,6 +335,8 @@ struct msm_file_private *ctx = submit->queue->ctx; struct task_struct *task; + WARN_ON(!mutex_is_locked(&submit->gpu->lock)); + /* Note that kstrdup will return NULL if argument is NULL: */ *comm = kstrdup(ctx->comm, GFP_KERNEL); *cmd = kstrdup(ctx->cmdline, GFP_KERNEL); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/msm_gpu.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/msm_gpu.h @@ -366,10 +366,18 @@ */ int sysprof; - /** comm: Overridden task comm, see MSM_PARAM_COMM */ + /** + * comm: Overridden task comm, see MSM_PARAM_COMM + * + * Accessed under msm_gpu::lock + */ char *comm; - /** cmdline: Overridden task cmdline, see MSM_PARAM_CMDLINE */ + /** + * cmdline: Overridden task cmdline, see MSM_PARAM_CMDLINE + * + * Accessed under msm_gpu::lock + */ char *cmdline; /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/msm/msm_mdss.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/msm/msm_mdss.c @@ -46,15 +46,17 @@ static int msm_mdss_parse_data_bus_icc_path(struct device *dev, struct msm_mdss *msm_mdss) { - struct icc_path *path0 = of_icc_get(dev, "mdp0-mem"); - struct icc_path *path1 = of_icc_get(dev, "mdp1-mem"); + struct icc_path *path0; + struct icc_path *path1; + path0 = of_icc_get(dev, "mdp0-mem"); if (IS_ERR_OR_NULL(path0)) return PTR_ERR_OR_ZERO(path0); msm_mdss->path[0] = path0; msm_mdss->num_paths = 1; + path1 = of_icc_get(dev, "mdp1-mem"); if (!IS_ERR_OR_NULL(path1)) { msm_mdss->path[1] = path1; msm_mdss->num_paths++; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c @@ -65,10 +65,33 @@ return ret; } +static int +tu102_devinit_wait(struct nvkm_device *device) +{ + unsigned timeout = 50 + 2000; + + do { + if (nvkm_rd32(device, 0x118128) & 0x00000001) { + if ((nvkm_rd32(device, 0x118234) & 0x000000ff) == 0xff) + return 0; + } + + usleep_range(1000, 2000); + } while (timeout--); + + return -ETIMEDOUT; +} + int tu102_devinit_post(struct nvkm_devinit *base, bool post) { struct nv50_devinit *init = nv50_devinit(base); + int ret; + + ret = tu102_devinit_wait(init->base.subdev.device); + if (ret) + return ret; + gm200_devinit_preos(init, post); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1193,14 +1193,11 @@ return 0; } -static int boe_panel_unprepare(struct drm_panel *panel) +static int boe_panel_disable(struct drm_panel *panel) { struct boe_panel *boe = to_boe_panel(panel); int ret; - if (!boe->prepared) - return 0; - ret = boe_panel_enter_sleep_mode(boe); if (ret < 0) { dev_err(panel->dev, "failed to set panel off: %d\n", ret); @@ -1209,6 +1206,16 @@ msleep(150); + return 0; +} + +static int boe_panel_unprepare(struct drm_panel *panel) +{ + struct boe_panel *boe = to_boe_panel(panel); + + if (!boe->prepared) + return 0; + if (boe->desc->discharge_on_disable) { regulator_disable(boe->avee); regulator_disable(boe->avdd); @@ -1528,6 +1535,7 @@ } static const struct drm_panel_funcs boe_panel_funcs = { + .disable = boe_panel_disable, .unprepare = boe_panel_unprepare, .prepare = boe_panel_prepare, .enable = boe_panel_enable, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/panfrost/Kconfig +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/panfrost/Kconfig @@ -3,7 +3,8 @@ config DRM_PANFROST tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)" depends on DRM - depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64) + depends on ARM || ARM64 || COMPILE_TEST + depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE depends on MMU select DRM_SCHED select IOMMU_SUPPORT only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/solomon/ssd130x.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/solomon/ssd130x.c @@ -665,18 +665,8 @@ .atomic_check = ssd130x_crtc_helper_atomic_check, }; -static void ssd130x_crtc_reset(struct drm_crtc *crtc) -{ - struct drm_device *drm = crtc->dev; - struct ssd130x_device *ssd130x = drm_to_ssd130x(drm); - - ssd130x_init(ssd130x); - - drm_atomic_helper_crtc_reset(crtc); -} - static const struct drm_crtc_funcs ssd130x_crtc_funcs = { - .reset = ssd130x_crtc_reset, + .reset = drm_atomic_helper_crtc_reset, .destroy = drm_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, @@ -695,6 +685,12 @@ if (ret) return; + ret = ssd130x_init(ssd130x); + if (ret) { + ssd130x_power_off(ssd130x); + return; + } + ssd130x_write_cmd(ssd130x, 1, SSD130X_DISPLAY_ON); backlight_enable(ssd130x->bl_dev); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vc4/vc4_bo.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vc4/vc4_bo.c @@ -179,6 +179,7 @@ bo->validated_shader = NULL; } + mutex_destroy(&bo->madv_lock); drm_gem_dma_free(&bo->base); } @@ -394,7 +395,6 @@ { struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_bo *bo; - int ret; if (WARN_ON_ONCE(vc4->is_vc5)) return ERR_PTR(-ENODEV); @@ -406,9 +406,7 @@ bo->madv = VC4_MADV_WILLNEED; refcount_set(&bo->usecnt, 0); - ret = drmm_mutex_init(dev, &bo->madv_lock); - if (ret) - return ERR_PTR(ret); + mutex_init(&bo->madv_lock); mutex_lock(&vc4->bo_lock); bo->label = VC4_BO_TYPE_KERNEL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vc4/vc4_crtc.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vc4/vc4_crtc.c @@ -711,7 +711,7 @@ struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { - vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, + vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 8000, mode->clock * 9 / 10) * 1000; } else { vc4_state->hvs_load = mode->clock * 1000; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vc4/vc4_hdmi.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3009,7 +3009,8 @@ } vc4_hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, - vc4_hdmi, "vc4", + vc4_hdmi, + vc4_hdmi->variant->card_name, CEC_CAP_DEFAULTS | CEC_CAP_CONNECTOR_INFO, 1); ret = PTR_ERR_OR_ZERO(vc4_hdmi->cec_adap); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vc4/vc4_plane.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vc4/vc4_plane.c @@ -340,7 +340,7 @@ { struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); struct drm_framebuffer *fb = state->fb; - struct drm_gem_dma_object *bo = drm_fb_dma_get_gem_obj(fb, 0); + struct drm_gem_dma_object *bo; int num_planes = fb->format->num_planes; struct drm_crtc_state *crtc_state; u32 h_subsample = fb->format->hsub; @@ -359,8 +359,10 @@ if (ret) return ret; - for (i = 0; i < num_planes; i++) + for (i = 0; i < num_planes; i++) { + bo = drm_fb_dma_get_gem_obj(fb, i); vc4_state->offsets[i] = bo->dma_addr + fb->offsets[i]; + } /* * We don't support subpixel source positioning for scaling, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -126,7 +126,6 @@ void __user *user_bo_handles = NULL; struct virtio_gpu_object_array *buflist = NULL; struct sync_file *sync_file; - int in_fence_fd = exbuf->fence_fd; int out_fence_fd = -1; void *buf; uint64_t fence_ctx; @@ -152,13 +151,11 @@ ring_idx = exbuf->ring_idx; } - exbuf->fence_fd = -1; - virtio_gpu_create_context(dev, file); if (exbuf->flags & VIRTGPU_EXECBUF_FENCE_FD_IN) { struct dma_fence *in_fence; - in_fence = sync_file_get_fence(in_fence_fd); + in_fence = sync_file_get_fence(exbuf->fence_fd); if (!in_fence) return -EINVAL; @@ -358,10 +355,18 @@ drm_gem_object_release(obj); return ret; } - drm_gem_object_put(obj); rc->res_handle = qobj->hw_res_handle; /* similiar to a VM address */ rc->bo_handle = handle; + + /* + * The handle owns the reference now. But we must drop our + * remaining reference *after* we no longer need to dereference + * the obj. Otherwise userspace could guess the handle and + * race closing it from another thread. + */ + drm_gem_object_put(obj); + return 0; } @@ -723,11 +728,18 @@ drm_gem_object_release(obj); return ret; } - drm_gem_object_put(obj); rc_blob->res_handle = bo->hw_res_handle; rc_blob->bo_handle = handle; + /* + * The handle owns the reference now. But we must drop our + * remaining reference *after* we no longer need to dereference + * the obj. Otherwise userspace could guess the handle and + * race closing it from another thread. + */ + drm_gem_object_put(obj); + return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/Makefile +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_hashtab.o vmwgfx_kms.o vmwgfx_drv.o \ +vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \ vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \ vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \ vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/ttm_object.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/ttm_object.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 OR MIT */ /************************************************************************** * - * Copyright (c) 2009-2013 VMware, Inc., Palo Alto, CA., USA + * Copyright (c) 2009-2022 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -44,16 +44,20 @@ #define pr_fmt(fmt) "[TTM] " fmt +#include "ttm_object.h" +#include "vmwgfx_drv.h" + #include #include #include #include #include -#include "ttm_object.h" -#include "vmwgfx_drv.h" +#include MODULE_IMPORT_NS(DMA_BUF); +#define VMW_TTM_OBJECT_REF_HT_ORDER 10 + /** * struct ttm_object_file * @@ -74,16 +78,14 @@ struct ttm_object_device *tdev; spinlock_t lock; struct list_head ref_list; - struct vmwgfx_open_hash ref_hash; + DECLARE_HASHTABLE(ref_hash, VMW_TTM_OBJECT_REF_HT_ORDER); struct kref refcount; }; /* * struct ttm_object_device * - * @object_lock: lock that protects the object_hash hash table. - * - * @object_hash: hash table for fast lookup of object global names. + * @object_lock: lock that protects idr. * * @object_count: Per device object count. * @@ -92,7 +94,6 @@ struct ttm_object_device { spinlock_t object_lock; - struct vmwgfx_open_hash object_hash; atomic_t object_count; struct dma_buf_ops ops; void (*dmabuf_release)(struct dma_buf *dma_buf); @@ -138,6 +139,36 @@ return tfile; } +static int ttm_tfile_find_ref_rcu(struct ttm_object_file *tfile, + uint64_t key, + struct vmwgfx_hash_item **p_hash) +{ + struct vmwgfx_hash_item *hash; + + hash_for_each_possible_rcu(tfile->ref_hash, hash, head, key) { + if (hash->key == key) { + *p_hash = hash; + return 0; + } + } + return -EINVAL; +} + +static int ttm_tfile_find_ref(struct ttm_object_file *tfile, + uint64_t key, + struct vmwgfx_hash_item **p_hash) +{ + struct vmwgfx_hash_item *hash; + + hash_for_each_possible(tfile->ref_hash, hash, head, key) { + if (hash->key == key) { + *p_hash = hash; + return 0; + } + } + return -EINVAL; +} + static void ttm_object_file_destroy(struct kref *kref) { struct ttm_object_file *tfile = @@ -223,64 +254,29 @@ kref_put(&base->refcount, ttm_release_base); } -/** - * ttm_base_object_noref_lookup - look up a base object without reference - * @tfile: The struct ttm_object_file the object is registered with. - * @key: The object handle. - * - * This function looks up a ttm base object and returns a pointer to it - * without refcounting the pointer. The returned pointer is only valid - * until ttm_base_object_noref_release() is called, and the object - * pointed to by the returned pointer may be doomed. Any persistent usage - * of the object requires a refcount to be taken using kref_get_unless_zero(). - * Iff this function returns successfully it needs to be paired with - * ttm_base_object_noref_release() and no sleeping- or scheduling functions - * may be called inbetween these function callse. - * - * Return: A pointer to the object if successful or NULL otherwise. - */ -struct ttm_base_object * -ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint32_t key) -{ - struct vmwgfx_hash_item *hash; - struct vmwgfx_open_hash *ht = &tfile->ref_hash; - int ret; - - rcu_read_lock(); - ret = vmwgfx_ht_find_item_rcu(ht, key, &hash); - if (ret) { - rcu_read_unlock(); - return NULL; - } - - __release(RCU); - return drm_hash_entry(hash, struct ttm_ref_object, hash)->obj; -} -EXPORT_SYMBOL(ttm_base_object_noref_lookup); - struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile, - uint32_t key) + uint64_t key) { struct ttm_base_object *base = NULL; struct vmwgfx_hash_item *hash; - struct vmwgfx_open_hash *ht = &tfile->ref_hash; int ret; - rcu_read_lock(); - ret = vmwgfx_ht_find_item_rcu(ht, key, &hash); + spin_lock(&tfile->lock); + ret = ttm_tfile_find_ref(tfile, key, &hash); if (likely(ret == 0)) { - base = drm_hash_entry(hash, struct ttm_ref_object, hash)->obj; + base = hlist_entry(hash, struct ttm_ref_object, hash)->obj; if (!kref_get_unless_zero(&base->refcount)) base = NULL; } - rcu_read_unlock(); + spin_unlock(&tfile->lock); + return base; } struct ttm_base_object * -ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint32_t key) +ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint64_t key) { struct ttm_base_object *base; @@ -299,7 +295,6 @@ bool *existed, bool require_existed) { - struct vmwgfx_open_hash *ht = &tfile->ref_hash; struct ttm_ref_object *ref; struct vmwgfx_hash_item *hash; int ret = -EINVAL; @@ -312,10 +307,10 @@ while (ret == -EINVAL) { rcu_read_lock(); - ret = vmwgfx_ht_find_item_rcu(ht, base->handle, &hash); + ret = ttm_tfile_find_ref_rcu(tfile, base->handle, &hash); if (ret == 0) { - ref = drm_hash_entry(hash, struct ttm_ref_object, hash); + ref = hlist_entry(hash, struct ttm_ref_object, hash); if (kref_get_unless_zero(&ref->kref)) { rcu_read_unlock(); break; @@ -337,21 +332,14 @@ kref_init(&ref->kref); spin_lock(&tfile->lock); - ret = vmwgfx_ht_insert_item_rcu(ht, &ref->hash); - - if (likely(ret == 0)) { - list_add_tail(&ref->head, &tfile->ref_list); - kref_get(&base->refcount); - spin_unlock(&tfile->lock); - if (existed != NULL) - *existed = false; - break; - } + hash_add_rcu(tfile->ref_hash, &ref->hash.head, ref->hash.key); + ret = 0; + list_add_tail(&ref->head, &tfile->ref_list); + kref_get(&base->refcount); spin_unlock(&tfile->lock); - BUG_ON(ret != -EINVAL); - - kfree(ref); + if (existed != NULL) + *existed = false; } return ret; @@ -363,10 +351,8 @@ struct ttm_ref_object *ref = container_of(kref, struct ttm_ref_object, kref); struct ttm_object_file *tfile = ref->tfile; - struct vmwgfx_open_hash *ht; - ht = &tfile->ref_hash; - (void)vmwgfx_ht_remove_item_rcu(ht, &ref->hash); + hash_del_rcu(&ref->hash.head); list_del(&ref->head); spin_unlock(&tfile->lock); @@ -378,18 +364,17 @@ int ttm_ref_object_base_unref(struct ttm_object_file *tfile, unsigned long key) { - struct vmwgfx_open_hash *ht = &tfile->ref_hash; struct ttm_ref_object *ref; struct vmwgfx_hash_item *hash; int ret; spin_lock(&tfile->lock); - ret = vmwgfx_ht_find_item(ht, key, &hash); + ret = ttm_tfile_find_ref(tfile, key, &hash); if (unlikely(ret != 0)) { spin_unlock(&tfile->lock); return -EINVAL; } - ref = drm_hash_entry(hash, struct ttm_ref_object, hash); + ref = hlist_entry(hash, struct ttm_ref_object, hash); kref_put(&ref->kref, ttm_ref_object_release); spin_unlock(&tfile->lock); return 0; @@ -416,16 +401,13 @@ } spin_unlock(&tfile->lock); - vmwgfx_ht_remove(&tfile->ref_hash); ttm_object_file_unref(&tfile); } -struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev, - unsigned int hash_order) +struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev) { struct ttm_object_file *tfile = kmalloc(sizeof(*tfile), GFP_KERNEL); - int ret; if (unlikely(tfile == NULL)) return NULL; @@ -435,34 +417,21 @@ kref_init(&tfile->refcount); INIT_LIST_HEAD(&tfile->ref_list); - ret = vmwgfx_ht_create(&tfile->ref_hash, hash_order); - if (ret) - goto out_err; + hash_init(tfile->ref_hash); return tfile; -out_err: - vmwgfx_ht_remove(&tfile->ref_hash); - - kfree(tfile); - - return NULL; } struct ttm_object_device * -ttm_object_device_init(unsigned int hash_order, - const struct dma_buf_ops *ops) +ttm_object_device_init(const struct dma_buf_ops *ops) { struct ttm_object_device *tdev = kmalloc(sizeof(*tdev), GFP_KERNEL); - int ret; if (unlikely(tdev == NULL)) return NULL; spin_lock_init(&tdev->object_lock); atomic_set(&tdev->object_count, 0); - ret = vmwgfx_ht_create(&tdev->object_hash, hash_order); - if (ret != 0) - goto out_no_object_hash; /* * Our base is at VMWGFX_NUM_MOB + 1 because we want to create @@ -477,10 +446,6 @@ tdev->dmabuf_release = tdev->ops.release; tdev->ops.release = ttm_prime_dmabuf_release; return tdev; - -out_no_object_hash: - kfree(tdev); - return NULL; } void ttm_object_device_release(struct ttm_object_device **p_tdev) @@ -491,7 +456,6 @@ WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); idr_destroy(&tdev->idr); - vmwgfx_ht_remove(&tdev->object_hash); kfree(tdev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/ttm_object.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/ttm_object.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA + * Copyright (c) 2006-2022 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -42,8 +42,6 @@ #include #include -#include "vmwgfx_hashtab.h" - /** * enum ttm_object_type * @@ -104,7 +102,7 @@ struct ttm_object_file *tfile; struct kref refcount; void (*refcount_release) (struct ttm_base_object **base); - u32 handle; + u64 handle; enum ttm_object_type object_type; u32 shareable; }; @@ -164,7 +162,7 @@ */ extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file - *tfile, uint32_t key); + *tfile, uint64_t key); /** * ttm_base_object_lookup_for_ref @@ -178,7 +176,7 @@ */ extern struct ttm_base_object * -ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint32_t key); +ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint64_t key); /** * ttm_base_object_unref @@ -237,14 +235,12 @@ * ttm_object_file_init - initialize a struct ttm_object file * * @tdev: A struct ttm_object device this file is initialized on. - * @hash_order: Order of the hash table used to hold the reference objects. * * This is typically called by the file_ops::open function. */ extern struct ttm_object_file *ttm_object_file_init(struct ttm_object_device - *tdev, - unsigned int hash_order); + *tdev); /** * ttm_object_file_release - release data held by a ttm_object_file @@ -262,7 +258,6 @@ /** * ttm_object device init - initialize a struct ttm_object_device * - * @hash_order: Order of hash table used to hash the base objects. * @ops: DMA buf ops for prime objects of this device. * * This function is typically called on device initialization to prepare @@ -270,8 +265,7 @@ */ extern struct ttm_object_device * -ttm_object_device_init(unsigned int hash_order, - const struct dma_buf_ops *ops); +ttm_object_device_init(const struct dma_buf_ops *ops); /** * ttm_object_device_release - release data held by a ttm_object_device @@ -313,18 +307,4 @@ #define ttm_prime_object_kfree(__obj, __prime) \ kfree_rcu(__obj, __prime.base.rhead) -struct ttm_base_object * -ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint32_t key); - -/** - * ttm_base_object_noref_release - release a base object pointer looked up - * without reference - * - * Releases a base object pointer looked up with ttm_base_object_noref_lookup(). - */ -static inline void ttm_base_object_noref_release(void) -{ - __acquire(RCU); - rcu_read_unlock(); -} #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -462,6 +462,9 @@ return -ENOMEM; } + /* + * vmw_bo_init will delete the *p_bo object if it fails + */ ret = vmw_bo_init(vmw, *p_bo, size, placement, interruptible, pin, bo_free); @@ -470,7 +473,6 @@ return ret; out_error: - kfree(*p_bo); *p_bo = NULL; return ret; } @@ -596,6 +598,7 @@ ttm_bo_put(&vmw_bo->base); } + drm_gem_object_put(&vmw_bo->base.base); return ret; } @@ -636,6 +639,7 @@ ret = vmw_user_bo_synccpu_grab(vbo, arg->flags); vmw_bo_unreference(&vbo); + drm_gem_object_put(&vbo->base.base); if (unlikely(ret != 0)) { if (ret == -ERESTARTSYS || ret == -EBUSY) return -EBUSY; @@ -693,7 +697,7 @@ * struct vmw_buffer_object should be placed. * Return: Zero on success, Negative error code on error. * - * The vmw buffer object pointer will be refcounted. + * The vmw buffer object pointer will be refcounted (both ttm and gem) */ int vmw_user_bo_lookup(struct drm_file *filp, uint32_t handle, @@ -710,50 +714,11 @@ *out = gem_to_vmw_bo(gobj); ttm_bo_get(&(*out)->base); - drm_gem_object_put(gobj); return 0; } /** - * vmw_user_bo_noref_lookup - Look up a vmw user buffer object without reference - * @filp: The TTM object file the handle is registered with. - * @handle: The user buffer object handle. - * - * This function looks up a struct vmw_bo and returns a pointer to the - * struct vmw_buffer_object it derives from without refcounting the pointer. - * The returned pointer is only valid until vmw_user_bo_noref_release() is - * called, and the object pointed to by the returned pointer may be doomed. - * Any persistent usage of the object requires a refcount to be taken using - * ttm_bo_reference_unless_doomed(). Iff this function returns successfully it - * needs to be paired with vmw_user_bo_noref_release() and no sleeping- - * or scheduling functions may be called in between these function calls. - * - * Return: A struct vmw_buffer_object pointer if successful or negative - * error pointer on failure. - */ -struct vmw_buffer_object * -vmw_user_bo_noref_lookup(struct drm_file *filp, u32 handle) -{ - struct vmw_buffer_object *vmw_bo; - struct ttm_buffer_object *bo; - struct drm_gem_object *gobj = drm_gem_object_lookup(filp, handle); - - if (!gobj) { - DRM_ERROR("Invalid buffer object handle 0x%08lx.\n", - (unsigned long)handle); - return ERR_PTR(-ESRCH); - } - vmw_bo = gem_to_vmw_bo(gobj); - bo = ttm_bo_get_unless_zero(&vmw_bo->base); - vmw_bo = vmw_buffer_object(bo); - drm_gem_object_put(gobj); - - return vmw_bo; -} - - -/** * vmw_bo_fence_single - Utility function to fence a single TTM buffer * object without unreserving it. * @@ -815,7 +780,8 @@ ret = vmw_gem_object_create_with_handle(dev_priv, file_priv, args->size, &args->handle, &vbo); - + /* drop reference from allocate - handle holds it now */ + drm_gem_object_put(&vbo->base.base); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT /************************************************************************** * - * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA + * Copyright 2014-2022 VMware, Inc., Palo Alto, CA., USA * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -28,6 +28,8 @@ #include "vmwgfx_drv.h" #include "vmwgfx_resource_priv.h" +#include + #define VMW_CMDBUF_RES_MAN_HT_ORDER 12 /** @@ -59,7 +61,7 @@ * @resources and @list are protected by the cmdbuf mutex for now. */ struct vmw_cmdbuf_res_manager { - struct vmwgfx_open_hash resources; + DECLARE_HASHTABLE(resources, VMW_CMDBUF_RES_MAN_HT_ORDER); struct list_head list; struct vmw_private *dev_priv; }; @@ -82,14 +84,13 @@ u32 user_key) { struct vmwgfx_hash_item *hash; - int ret; unsigned long key = user_key | (res_type << 24); - ret = vmwgfx_ht_find_item(&man->resources, key, &hash); - if (unlikely(ret != 0)) - return ERR_PTR(ret); - - return drm_hash_entry(hash, struct vmw_cmdbuf_res, hash)->res; + hash_for_each_possible_rcu(man->resources, hash, head, key) { + if (hash->key == key) + return hlist_entry(hash, struct vmw_cmdbuf_res, hash)->res; + } + return ERR_PTR(-EINVAL); } /** @@ -105,7 +106,7 @@ struct vmw_cmdbuf_res *entry) { list_del(&entry->head); - WARN_ON(vmwgfx_ht_remove_item(&man->resources, &entry->hash)); + hash_del_rcu(&entry->hash.head); vmw_resource_unreference(&entry->res); kfree(entry); } @@ -159,7 +160,6 @@ void vmw_cmdbuf_res_revert(struct list_head *list) { struct vmw_cmdbuf_res *entry, *next; - int ret; list_for_each_entry_safe(entry, next, list, head) { switch (entry->state) { @@ -167,8 +167,8 @@ vmw_cmdbuf_res_free(entry->man, entry); break; case VMW_CMDBUF_RES_DEL: - ret = vmwgfx_ht_insert_item(&entry->man->resources, &entry->hash); - BUG_ON(ret); + hash_add_rcu(entry->man->resources, &entry->hash.head, + entry->hash.key); list_move_tail(&entry->head, &entry->man->list); entry->state = VMW_CMDBUF_RES_COMMITTED; break; @@ -199,26 +199,20 @@ struct list_head *list) { struct vmw_cmdbuf_res *cres; - int ret; cres = kzalloc(sizeof(*cres), GFP_KERNEL); if (unlikely(!cres)) return -ENOMEM; cres->hash.key = user_key | (res_type << 24); - ret = vmwgfx_ht_insert_item(&man->resources, &cres->hash); - if (unlikely(ret != 0)) { - kfree(cres); - goto out_invalid_key; - } + hash_add_rcu(man->resources, &cres->hash.head, cres->hash.key); cres->state = VMW_CMDBUF_RES_ADD; cres->res = vmw_resource_reference(res); cres->man = man; list_add_tail(&cres->head, list); -out_invalid_key: - return ret; + return 0; } /** @@ -243,24 +237,26 @@ struct list_head *list, struct vmw_resource **res_p) { - struct vmw_cmdbuf_res *entry; + struct vmw_cmdbuf_res *entry = NULL; struct vmwgfx_hash_item *hash; - int ret; + unsigned long key = user_key | (res_type << 24); - ret = vmwgfx_ht_find_item(&man->resources, user_key | (res_type << 24), - &hash); - if (likely(ret != 0)) + hash_for_each_possible_rcu(man->resources, hash, head, key) { + if (hash->key == key) { + entry = hlist_entry(hash, struct vmw_cmdbuf_res, hash); + break; + } + } + if (unlikely(!entry)) return -EINVAL; - entry = drm_hash_entry(hash, struct vmw_cmdbuf_res, hash); - switch (entry->state) { case VMW_CMDBUF_RES_ADD: vmw_cmdbuf_res_free(man, entry); *res_p = NULL; break; case VMW_CMDBUF_RES_COMMITTED: - (void) vmwgfx_ht_remove_item(&man->resources, &entry->hash); + hash_del_rcu(&entry->hash.head); list_del(&entry->head); entry->state = VMW_CMDBUF_RES_DEL; list_add_tail(&entry->head, list); @@ -287,7 +283,6 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv) { struct vmw_cmdbuf_res_manager *man; - int ret; man = kzalloc(sizeof(*man), GFP_KERNEL); if (!man) @@ -295,12 +290,8 @@ man->dev_priv = dev_priv; INIT_LIST_HEAD(&man->list); - ret = vmwgfx_ht_create(&man->resources, VMW_CMDBUF_RES_MAN_HT_ORDER); - if (ret == 0) - return man; - - kfree(man); - return ERR_PTR(ret); + hash_init(man->resources); + return man; } /** @@ -320,7 +311,6 @@ list_for_each_entry_safe(entry, next, &man->list, head) vmw_cmdbuf_res_free(man, entry); - vmwgfx_ht_remove(&man->resources); kfree(man); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -25,10 +25,13 @@ * **************************************************************************/ -#include -#include -#include -#include + +#include "vmwgfx_drv.h" + +#include "vmwgfx_devcaps.h" +#include "vmwgfx_mksstat.h" +#include "vmwgfx_binding.h" +#include "ttm_object.h" #include #include @@ -41,11 +44,11 @@ #include #include -#include "ttm_object.h" -#include "vmwgfx_binding.h" -#include "vmwgfx_devcaps.h" -#include "vmwgfx_drv.h" -#include "vmwgfx_mksstat.h" +#include +#include +#include +#include +#include #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices" @@ -806,6 +809,43 @@ return 0; } +static void vmw_write_driver_id(struct vmw_private *dev) +{ + if ((dev->capabilities2 & SVGA_CAP2_DX2) != 0) { + vmw_write(dev, SVGA_REG_GUEST_DRIVER_ID, + SVGA_REG_GUEST_DRIVER_ID_LINUX); + + vmw_write(dev, SVGA_REG_GUEST_DRIVER_VERSION1, + LINUX_VERSION_MAJOR << 24 | + LINUX_VERSION_PATCHLEVEL << 16 | + LINUX_VERSION_SUBLEVEL); + vmw_write(dev, SVGA_REG_GUEST_DRIVER_VERSION2, + VMWGFX_DRIVER_MAJOR << 24 | + VMWGFX_DRIVER_MINOR << 16 | + VMWGFX_DRIVER_PATCHLEVEL); + vmw_write(dev, SVGA_REG_GUEST_DRIVER_VERSION3, 0); + + vmw_write(dev, SVGA_REG_GUEST_DRIVER_ID, + SVGA_REG_GUEST_DRIVER_ID_SUBMIT); + } +} + +static void vmw_sw_context_init(struct vmw_private *dev_priv) +{ + struct vmw_sw_context *sw_context = &dev_priv->ctx; + + hash_init(sw_context->res_ht); +} + +static void vmw_sw_context_fini(struct vmw_private *dev_priv) +{ + struct vmw_sw_context *sw_context = &dev_priv->ctx; + + vfree(sw_context->cmd_bounce); + if (sw_context->staged_bindings) + vmw_binding_state_free(sw_context->staged_bindings); +} + static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) { int ret; @@ -815,6 +855,8 @@ dev_priv->drm.dev_private = dev_priv; + vmw_sw_context_init(dev_priv); + mutex_init(&dev_priv->cmdbuf_mutex); mutex_init(&dev_priv->binding_mutex); spin_lock_init(&dev_priv->resource_lock); @@ -970,7 +1012,7 @@ goto out_err0; } - dev_priv->tdev = ttm_object_device_init(12, &vmw_prime_dmabuf_ops); + dev_priv->tdev = ttm_object_device_init(&vmw_prime_dmabuf_ops); if (unlikely(dev_priv->tdev == NULL)) { drm_err(&dev_priv->drm, @@ -1091,6 +1133,7 @@ vmw_host_printf("vmwgfx: Module Version: %d.%d.%d (kernel: %s)", VMWGFX_DRIVER_MAJOR, VMWGFX_DRIVER_MINOR, VMWGFX_DRIVER_PATCHLEVEL, UTS_RELEASE); + vmw_write_driver_id(dev_priv); if (dev_priv->enable_fb) { vmw_fifo_resource_inc(dev_priv); @@ -1143,9 +1186,7 @@ unregister_pm_notifier(&dev_priv->pm_nb); - if (dev_priv->ctx.res_ht_initialized) - vmwgfx_ht_remove(&dev_priv->ctx.res_ht); - vfree(dev_priv->ctx.cmd_bounce); + vmw_sw_context_fini(dev_priv); if (dev_priv->enable_fb) { vmw_fb_off(dev_priv); vmw_fb_close(dev_priv); @@ -1173,8 +1214,6 @@ vmw_irq_uninstall(&dev_priv->drm); ttm_object_device_release(&dev_priv->tdev); - if (dev_priv->ctx.staged_bindings) - vmw_binding_state_free(dev_priv->ctx.staged_bindings); for (i = vmw_res_context; i < vmw_res_max; ++i) idr_destroy(&dev_priv->res_idr[i]); @@ -1203,7 +1242,7 @@ if (unlikely(!vmw_fp)) return ret; - vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10); + vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev); if (unlikely(vmw_fp->tfile == NULL)) goto out_no_tfile; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -42,7 +43,6 @@ #include "ttm_object.h" #include "vmwgfx_fence.h" -#include "vmwgfx_hashtab.h" #include "vmwgfx_reg.h" #include "vmwgfx_validation.h" @@ -93,6 +93,7 @@ #define VMW_RES_STREAM ttm_driver_type2 #define VMW_RES_FENCE ttm_driver_type3 #define VMW_RES_SHADER ttm_driver_type4 +#define VMW_RES_HT_ORDER 12 #define MKSSTAT_CAPACITY_LOG2 5U #define MKSSTAT_CAPACITY (1U << MKSSTAT_CAPACITY_LOG2) @@ -102,6 +103,11 @@ bool gb_aware; /* user-space is guest-backed aware */ }; +struct vmwgfx_hash_item { + struct hlist_node head; + unsigned long key; +}; + /** * struct vmw_buffer_object - TTM buffer object with vmwgfx additions * @base: The TTM buffer object @@ -425,8 +431,7 @@ * @ctx: The validation context */ struct vmw_sw_context{ - struct vmwgfx_open_hash res_ht; - bool res_ht_initialized; + DECLARE_HASHTABLE(res_ht, VMW_RES_HT_ORDER); bool kernel; struct vmw_fpriv *fp; struct drm_file *filp; @@ -821,12 +826,7 @@ uint32_t handle, const struct vmw_user_resource_conv *converter, struct vmw_resource **p_res); -extern struct vmw_resource * -vmw_user_resource_noref_lookup_handle(struct vmw_private *dev_priv, - struct ttm_object_file *tfile, - uint32_t handle, - const struct vmw_user_resource_conv * - converter); + extern int vmw_stream_claim_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int vmw_stream_unref_ioctl(struct drm_device *dev, void *data, @@ -866,15 +866,6 @@ } /** - * vmw_user_resource_noref_release - release a user resource pointer looked up - * without reference - */ -static inline void vmw_user_resource_noref_release(void) -{ - ttm_base_object_noref_release(); -} - -/** * Buffer object helper functions - vmwgfx_bo.c */ extern int vmw_bo_pin_in_placement(struct vmw_private *vmw_priv, @@ -925,8 +916,6 @@ extern void vmw_bo_move_notify(struct ttm_buffer_object *bo, struct ttm_resource *mem); extern void vmw_bo_swap_notify(struct ttm_buffer_object *bo); -extern struct vmw_buffer_object * -vmw_user_bo_noref_lookup(struct drm_file *filp, u32 handle); /** * vmw_bo_adjust_prio - Adjust the buffer object eviction priority only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT /************************************************************************** * - * Copyright 2009 - 2015 VMware, Inc., Palo Alto, CA., USA + * Copyright 2009 - 2022 VMware, Inc., Palo Alto, CA., USA * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -25,6 +25,7 @@ * **************************************************************************/ #include +#include #include "vmwgfx_drv.h" #include "vmwgfx_reg.h" @@ -34,7 +35,6 @@ #include "vmwgfx_binding.h" #include "vmwgfx_mksstat.h" -#define VMW_RES_HT_ORDER 12 /* * Helper macro to get dx_ctx_node if available otherwise print an error @@ -290,20 +290,26 @@ rcache->valid_handle = 0; } +enum vmw_val_add_flags { + vmw_val_add_flag_none = 0, + vmw_val_add_flag_noctx = 1 << 0, +}; + /** - * vmw_execbuf_res_noref_val_add - Add a resource described by an unreferenced - * rcu-protected pointer to the validation list. + * vmw_execbuf_res_val_add - Add a resource to the validation list. * * @sw_context: Pointer to the software context. * @res: Unreferenced rcu-protected pointer to the resource. * @dirty: Whether to change dirty status. + * @flags: specifies whether to use the context or not * * Returns: 0 on success. Negative error code on failure. Typical error codes * are %-EINVAL on inconsistency and %-ESRCH if the resource was doomed. */ -static int vmw_execbuf_res_noref_val_add(struct vmw_sw_context *sw_context, - struct vmw_resource *res, - u32 dirty) +static int vmw_execbuf_res_val_add(struct vmw_sw_context *sw_context, + struct vmw_resource *res, + u32 dirty, + u32 flags) { struct vmw_private *dev_priv = res->dev_priv; int ret; @@ -318,24 +324,30 @@ if (dirty) vmw_validation_res_set_dirty(sw_context->ctx, rcache->private, dirty); - vmw_user_resource_noref_release(); return 0; } - priv_size = vmw_execbuf_res_size(dev_priv, res_type); - ret = vmw_validation_add_resource(sw_context->ctx, res, priv_size, - dirty, (void **)&ctx_info, - &first_usage); - vmw_user_resource_noref_release(); - if (ret) - return ret; + if ((flags & vmw_val_add_flag_noctx) != 0) { + ret = vmw_validation_add_resource(sw_context->ctx, res, 0, dirty, + (void **)&ctx_info, NULL); + if (ret) + return ret; - if (priv_size && first_usage) { - ret = vmw_cmd_ctx_first_setup(dev_priv, sw_context, res, - ctx_info); - if (ret) { - VMW_DEBUG_USER("Failed first usage context setup.\n"); + } else { + priv_size = vmw_execbuf_res_size(dev_priv, res_type); + ret = vmw_validation_add_resource(sw_context->ctx, res, priv_size, + dirty, (void **)&ctx_info, + &first_usage); + if (ret) return ret; + + if (priv_size && first_usage) { + ret = vmw_cmd_ctx_first_setup(dev_priv, sw_context, res, + ctx_info); + if (ret) { + VMW_DEBUG_USER("Failed first usage context setup.\n"); + return ret; + } } } @@ -344,43 +356,6 @@ } /** - * vmw_execbuf_res_noctx_val_add - Add a non-context resource to the resource - * validation list if it's not already on it - * - * @sw_context: Pointer to the software context. - * @res: Pointer to the resource. - * @dirty: Whether to change dirty status. - * - * Returns: Zero on success. Negative error code on failure. - */ -static int vmw_execbuf_res_noctx_val_add(struct vmw_sw_context *sw_context, - struct vmw_resource *res, - u32 dirty) -{ - struct vmw_res_cache_entry *rcache; - enum vmw_res_type res_type = vmw_res_type(res); - void *ptr; - int ret; - - rcache = &sw_context->res_cache[res_type]; - if (likely(rcache->valid && rcache->res == res)) { - if (dirty) - vmw_validation_res_set_dirty(sw_context->ctx, - rcache->private, dirty); - return 0; - } - - ret = vmw_validation_add_resource(sw_context->ctx, res, 0, dirty, - &ptr, NULL); - if (ret) - return ret; - - vmw_execbuf_rcache_update(rcache, res, ptr); - - return 0; -} - -/** * vmw_view_res_val_add - Add a view and the surface it's pointing to to the * validation list * @@ -398,13 +373,13 @@ * First add the resource the view is pointing to, otherwise it may be * swapped out when the view is validated. */ - ret = vmw_execbuf_res_noctx_val_add(sw_context, vmw_view_srf(view), - vmw_view_dirtying(view)); + ret = vmw_execbuf_res_val_add(sw_context, vmw_view_srf(view), + vmw_view_dirtying(view), vmw_val_add_flag_noctx); if (ret) return ret; - return vmw_execbuf_res_noctx_val_add(sw_context, view, - VMW_RES_DIRTY_NONE); + return vmw_execbuf_res_val_add(sw_context, view, VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); } /** @@ -475,8 +450,9 @@ if (IS_ERR(res)) continue; - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_SET); + ret = vmw_execbuf_res_val_add(sw_context, res, + VMW_RES_DIRTY_SET, + vmw_val_add_flag_noctx); if (unlikely(ret != 0)) return ret; } @@ -490,9 +466,9 @@ if (vmw_res_type(entry->res) == vmw_res_view) ret = vmw_view_res_val_add(sw_context, entry->res); else - ret = vmw_execbuf_res_noctx_val_add - (sw_context, entry->res, - vmw_binding_dirtying(entry->bt)); + ret = vmw_execbuf_res_val_add(sw_context, entry->res, + vmw_binding_dirtying(entry->bt), + vmw_val_add_flag_noctx); if (unlikely(ret != 0)) break; } @@ -658,7 +634,8 @@ { struct vmw_res_cache_entry *rcache = &sw_context->res_cache[res_type]; struct vmw_resource *res; - int ret; + int ret = 0; + bool needs_unref = false; if (p_res) *p_res = NULL; @@ -683,17 +660,18 @@ if (ret) return ret; - res = vmw_user_resource_noref_lookup_handle - (dev_priv, sw_context->fp->tfile, *id_loc, converter); - if (IS_ERR(res)) { + ret = vmw_user_resource_lookup_handle + (dev_priv, sw_context->fp->tfile, *id_loc, converter, &res); + if (ret != 0) { VMW_DEBUG_USER("Could not find/use resource 0x%08x.\n", (unsigned int) *id_loc); - return PTR_ERR(res); + return ret; } + needs_unref = true; - ret = vmw_execbuf_res_noref_val_add(sw_context, res, dirty); + ret = vmw_execbuf_res_val_add(sw_context, res, dirty, vmw_val_add_flag_none); if (unlikely(ret != 0)) - return ret; + goto res_check_done; if (rcache->valid && rcache->res == res) { rcache->valid_handle = true; @@ -708,7 +686,11 @@ if (p_res) *p_res = res; - return 0; +res_check_done: + if (needs_unref) + vmw_resource_unreference(&res); + + return ret; } /** @@ -1171,13 +1153,14 @@ int ret; vmw_validation_preload_bo(sw_context->ctx); - vmw_bo = vmw_user_bo_noref_lookup(sw_context->filp, handle); - if (IS_ERR(vmw_bo)) { - VMW_DEBUG_USER("Could not find or use MOB buffer.\n"); + ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo); + if (ret != 0) { + drm_dbg(&dev_priv->drm, "Could not find or use MOB buffer.\n"); return PTR_ERR(vmw_bo); } ret = vmw_validation_add_bo(sw_context->ctx, vmw_bo, true, false); ttm_bo_put(&vmw_bo->base); + drm_gem_object_put(&vmw_bo->base.base); if (unlikely(ret != 0)) return ret; @@ -1225,13 +1208,14 @@ int ret; vmw_validation_preload_bo(sw_context->ctx); - vmw_bo = vmw_user_bo_noref_lookup(sw_context->filp, handle); - if (IS_ERR(vmw_bo)) { - VMW_DEBUG_USER("Could not find or use GMR region.\n"); + ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo); + if (ret != 0) { + drm_dbg(&dev_priv->drm, "Could not find or use GMR region.\n"); return PTR_ERR(vmw_bo); } ret = vmw_validation_add_bo(sw_context->ctx, vmw_bo, false, false); ttm_bo_put(&vmw_bo->base); + drm_gem_object_put(&vmw_bo->base.base); if (unlikely(ret != 0)) return ret; @@ -2025,8 +2009,9 @@ res = vmw_shader_lookup(vmw_context_res_man(ctx), cmd->body.shid, cmd->body.type); if (!IS_ERR(res)) { - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_NONE); + ret = vmw_execbuf_res_val_add(sw_context, res, + VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); if (unlikely(ret != 0)) return ret; @@ -2273,8 +2258,9 @@ return PTR_ERR(res); } - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_NONE); + ret = vmw_execbuf_res_val_add(sw_context, res, + VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); if (ret) return ret; } @@ -2777,8 +2763,8 @@ return PTR_ERR(res); } - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_NONE); + ret = vmw_execbuf_res_val_add(sw_context, res, VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); if (ret) { VMW_DEBUG_USER("Error creating resource validation node.\n"); return ret; @@ -3098,8 +3084,8 @@ vmw_dx_streamoutput_set_size(res, cmd->body.sizeInBytes); - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_NONE); + ret = vmw_execbuf_res_val_add(sw_context, res, VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); if (ret) { DRM_ERROR("Error creating resource validation node.\n"); return ret; @@ -3148,8 +3134,8 @@ return 0; } - ret = vmw_execbuf_res_noctx_val_add(sw_context, res, - VMW_RES_DIRTY_NONE); + ret = vmw_execbuf_res_val_add(sw_context, res, VMW_RES_DIRTY_NONE, + vmw_val_add_flag_noctx); if (ret) { DRM_ERROR("Error creating resource validation node.\n"); return ret; @@ -4067,22 +4053,26 @@ if (ret) return ret; - res = vmw_user_resource_noref_lookup_handle + ret = vmw_user_resource_lookup_handle (dev_priv, sw_context->fp->tfile, handle, - user_context_converter); - if (IS_ERR(res)) { + user_context_converter, &res); + if (ret != 0) { VMW_DEBUG_USER("Could not find or user DX context 0x%08x.\n", (unsigned int) handle); - return PTR_ERR(res); + return ret; } - ret = vmw_execbuf_res_noref_val_add(sw_context, res, VMW_RES_DIRTY_SET); - if (unlikely(ret != 0)) + ret = vmw_execbuf_res_val_add(sw_context, res, VMW_RES_DIRTY_SET, + vmw_val_add_flag_none); + if (unlikely(ret != 0)) { + vmw_resource_unreference(&res); return ret; + } sw_context->dx_ctx_node = vmw_execbuf_info_from_res(sw_context, res); sw_context->man = vmw_context_res_man(res); + vmw_resource_unreference(&res); return 0; } @@ -4101,7 +4091,7 @@ int ret; int32_t out_fence_fd = -1; struct sync_file *sync_file = NULL; - DECLARE_VAL_CONTEXT(val_ctx, &sw_context->res_ht, 1); + DECLARE_VAL_CONTEXT(val_ctx, sw_context, 1); if (flags & DRM_VMW_EXECBUF_FLAG_EXPORT_FENCE_FD) { out_fence_fd = get_unused_fd_flags(O_CLOEXEC); @@ -4164,14 +4154,6 @@ if (sw_context->staged_bindings) vmw_binding_state_reset(sw_context->staged_bindings); - if (!sw_context->res_ht_initialized) { - ret = vmwgfx_ht_create(&sw_context->res_ht, VMW_RES_HT_ORDER); - if (unlikely(ret != 0)) - goto out_unlock; - - sw_context->res_ht_initialized = true; - } - INIT_LIST_HEAD(&sw_context->staged_cmd_res); sw_context->ctx = &val_ctx; ret = vmw_execbuf_tie_context(dev_priv, sw_context, dx_context_handle); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c @@ -146,14 +146,12 @@ &vmw_sys_placement : &vmw_vram_sys_placement, true, false, &vmw_gem_destroy, p_vbo); - - (*p_vbo)->base.base.funcs = &vmw_gem_object_funcs; if (ret != 0) goto out_no_bo; + (*p_vbo)->base.base.funcs = &vmw_gem_object_funcs; + ret = drm_gem_handle_create(filp, &(*p_vbo)->base.base, handle); - /* drop reference from allocate - handle holds it now */ - drm_gem_object_put(&(*p_vbo)->base.base); out_no_bo: return ret; } @@ -180,6 +178,8 @@ rep->map_handle = drm_vma_node_offset_addr(&vbo->base.base.vma_node); rep->cur_gmr_id = handle; rep->cur_gmr_offset = 0; + /* drop reference from allocate - handle holds it now */ + drm_gem_object_put(&vbo->base.base); out_no_bo: return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c @@ -458,6 +458,7 @@ ret = vmw_overlay_update_stream(dev_priv, buf, arg, true); vmw_bo_unreference(&buf); + drm_gem_object_put(&buf->base.base); out_unlock: mutex_unlock(&overlay->mutex); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c @@ -281,39 +281,6 @@ return ret; } -/** - * vmw_user_resource_noref_lookup_handle - lookup a struct resource from a - * TTM user-space handle and perform basic type checks - * - * @dev_priv: Pointer to a device private struct - * @tfile: Pointer to a struct ttm_object_file identifying the caller - * @handle: The TTM user-space handle - * @converter: Pointer to an object describing the resource type - * - * If the handle can't be found or is associated with an incorrect resource - * type, -EINVAL will be returned. - */ -struct vmw_resource * -vmw_user_resource_noref_lookup_handle(struct vmw_private *dev_priv, - struct ttm_object_file *tfile, - uint32_t handle, - const struct vmw_user_resource_conv - *converter) -{ - struct ttm_base_object *base; - - base = ttm_base_object_noref_lookup(tfile, handle); - if (!base) - return ERR_PTR(-ESRCH); - - if (unlikely(ttm_base_object_type(base) != converter->object_type)) { - ttm_base_object_noref_release(); - return ERR_PTR(-EINVAL); - } - - return converter->base_obj_to_res(base); -} - /* * Helper function that looks either a surface or bo. * only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c @@ -807,6 +807,7 @@ num_output_sig, tfile, shader_handle); out_bad_arg: vmw_bo_unreference(&buffer); + drm_gem_object_put(&buffer->base.base); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -683,7 +683,7 @@ container_of(base, struct vmw_user_surface, prime.base); struct vmw_resource *res = &user_srf->srf.res; - if (base->shareable && res && res->backup) + if (res && res->backup) drm_gem_object_put(&res->backup->base.base); *p_base = NULL; @@ -860,7 +860,11 @@ goto out_unlock; } vmw_bo_reference(res->backup); - drm_gem_object_get(&res->backup->base.base); + /* + * We don't expose the handle to the userspace and surface + * already holds a gem reference + */ + drm_gem_handle_delete(file_priv, backup_handle); } tmp = vmw_resource_reference(&srf->res); @@ -1564,8 +1568,6 @@ drm_vma_node_offset_addr(&res->backup->base.base.vma_node); rep->buffer_size = res->backup->base.base.size; rep->buffer_handle = backup_handle; - if (user_srf->prime.base.shareable) - drm_gem_object_get(&res->backup->base.base); } else { rep->buffer_map_handle = 0; rep->buffer_size = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT /************************************************************************** * - * Copyright © 2018 VMware, Inc., Palo Alto, CA., USA + * Copyright © 2018 - 2022 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -180,11 +180,16 @@ if (!ctx->merge_dups) return NULL; - if (ctx->ht) { + if (ctx->sw_context) { struct vmwgfx_hash_item *hash; + unsigned long key = (unsigned long) vbo; - if (!vmwgfx_ht_find_item(ctx->ht, (unsigned long) vbo, &hash)) - bo_node = container_of(hash, typeof(*bo_node), hash); + hash_for_each_possible_rcu(ctx->sw_context->res_ht, hash, head, key) { + if (hash->key == key) { + bo_node = container_of(hash, typeof(*bo_node), hash); + break; + } + } } else { struct vmw_validation_bo_node *entry; @@ -217,11 +222,16 @@ if (!ctx->merge_dups) return NULL; - if (ctx->ht) { + if (ctx->sw_context) { struct vmwgfx_hash_item *hash; + unsigned long key = (unsigned long) res; - if (!vmwgfx_ht_find_item(ctx->ht, (unsigned long) res, &hash)) - res_node = container_of(hash, typeof(*res_node), hash); + hash_for_each_possible_rcu(ctx->sw_context->res_ht, hash, head, key) { + if (hash->key == key) { + res_node = container_of(hash, typeof(*res_node), hash); + break; + } + } } else { struct vmw_validation_res_node *entry; @@ -269,20 +279,15 @@ } } else { struct ttm_validate_buffer *val_buf; - int ret; bo_node = vmw_validation_mem_alloc(ctx, sizeof(*bo_node)); if (!bo_node) return -ENOMEM; - if (ctx->ht) { + if (ctx->sw_context) { bo_node->hash.key = (unsigned long) vbo; - ret = vmwgfx_ht_insert_item(ctx->ht, &bo_node->hash); - if (ret) { - DRM_ERROR("Failed to initialize a buffer " - "validation entry.\n"); - return ret; - } + hash_add_rcu(ctx->sw_context->res_ht, &bo_node->hash.head, + bo_node->hash.key); } val_buf = &bo_node->base; val_buf->bo = ttm_bo_get_unless_zero(&vbo->base); @@ -316,7 +321,6 @@ bool *first_usage) { struct vmw_validation_res_node *node; - int ret; node = vmw_validation_find_res_dup(ctx, res); if (node) { @@ -330,14 +334,9 @@ return -ENOMEM; } - if (ctx->ht) { + if (ctx->sw_context) { node->hash.key = (unsigned long) res; - ret = vmwgfx_ht_insert_item(ctx->ht, &node->hash); - if (ret) { - DRM_ERROR("Failed to initialize a resource validation " - "entry.\n"); - return ret; - } + hash_add_rcu(ctx->sw_context->res_ht, &node->hash.head, node->hash.key); } node->res = vmw_resource_reference_unless_doomed(res); if (!node->res) @@ -681,19 +680,19 @@ struct vmw_validation_bo_node *entry; struct vmw_validation_res_node *val; - if (!ctx->ht) + if (!ctx->sw_context) return; list_for_each_entry(entry, &ctx->bo_list, base.head) - (void) vmwgfx_ht_remove_item(ctx->ht, &entry->hash); + hash_del_rcu(&entry->hash.head); list_for_each_entry(val, &ctx->resource_list, head) - (void) vmwgfx_ht_remove_item(ctx->ht, &val->hash); + hash_del_rcu(&val->hash.head); list_for_each_entry(val, &ctx->resource_ctx_list, head) - (void) vmwgfx_ht_remove_item(ctx->ht, &val->hash); + hash_del_rcu(&entry->hash.head); - ctx->ht = NULL; + ctx->sw_context = NULL; } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h +++ linux-oem-6.1-6.1.0/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 OR MIT */ /************************************************************************** * - * Copyright © 2018 VMware, Inc., Palo Alto, CA., USA + * Copyright © 2018 - 2022 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -29,12 +29,11 @@ #define _VMWGFX_VALIDATION_H_ #include +#include #include #include -#include "vmwgfx_hashtab.h" - #define VMW_RES_DIRTY_NONE 0 #define VMW_RES_DIRTY_SET BIT(0) #define VMW_RES_DIRTY_CLEAR BIT(1) @@ -59,7 +58,7 @@ * @total_mem: Amount of reserved memory. */ struct vmw_validation_context { - struct vmwgfx_open_hash *ht; + struct vmw_sw_context *sw_context; struct list_head resource_list; struct list_head resource_ctx_list; struct list_head bo_list; @@ -82,16 +81,16 @@ /** * DECLARE_VAL_CONTEXT - Declare a validation context with initialization * @_name: The name of the variable - * @_ht: The hash table used to find dups or NULL if none + * @_sw_context: Contains the hash table used to find dups or NULL if none * @_merge_dups: Whether to merge duplicate buffer object- or resource * entries. If set to true, ideally a hash table pointer should be supplied * as well unless the number of resources and buffer objects per validation * is known to be very small */ #endif -#define DECLARE_VAL_CONTEXT(_name, _ht, _merge_dups) \ +#define DECLARE_VAL_CONTEXT(_name, _sw_context, _merge_dups) \ struct vmw_validation_context _name = \ - { .ht = _ht, \ + { .sw_context = _sw_context, \ .resource_list = LIST_HEAD_INIT((_name).resource_list), \ .resource_ctx_list = LIST_HEAD_INIT((_name).resource_ctx_list), \ .bo_list = LIST_HEAD_INIT((_name).bo_list), \ @@ -115,19 +114,6 @@ } /** - * vmw_validation_set_ht - Register a hash table for duplicate finding - * @ctx: The validation context - * @ht: Pointer to a hash table to use for duplicate finding - * This function is intended to be used if the hash table wasn't - * available at validation context declaration time - */ -static inline void vmw_validation_set_ht(struct vmw_validation_context *ctx, - struct vmwgfx_open_hash *ht) -{ - ctx->ht = ht; -} - -/** * vmw_validation_bo_reserve - Reserve buffer objects registered with a * validation context * @ctx: The validation context only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/amd-sfh-hid/amd_sfh_hid.h +++ linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/amd_sfh_hid.h @@ -32,6 +32,7 @@ struct amdtp_cl_data { u8 init_done; u32 cur_hid_dev; + bool is_any_sensor_enabled; u32 hid_dev_count; u32 num_hid_devices; struct device_info *hid_devices; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ linux-oem-6.1-6.1.0/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -160,7 +160,7 @@ } rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]); if (rc) - return rc; + goto cleanup; writel(0, privdata->mmio + AMD_P2C_MSG(0)); mp2_ops->start(privdata, info); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-betopff.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-betopff.c @@ -60,7 +60,6 @@ struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; struct input_dev *dev; - int field_count = 0; int error; int i, j; @@ -86,19 +85,21 @@ * ----------------------------------------- * Do init them with default value. */ + if (report->maxfield < 4) { + hid_err(hid, "not enough fields in the report: %d\n", + report->maxfield); + return -ENODEV; + } for (i = 0; i < report->maxfield; i++) { + if (report->field[i]->report_count < 1) { + hid_err(hid, "no values in the field\n"); + return -ENODEV; + } for (j = 0; j < report->field[i]->report_count; j++) { report->field[i]->value[j] = 0x00; - field_count++; } } - if (field_count < 4) { - hid_err(hid, "not enough fields in the report: %d\n", - field_count); - return -ENODEV; - } - betopff = kzalloc(sizeof(*betopff), GFP_KERNEL); if (!betopff) return -ENOMEM; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-bigbenff.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-bigbenff.c @@ -344,6 +344,11 @@ } report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; + if (list_empty(report_list)) { + hid_err(hid, "no output report found\n"); + error = -ENODEV; + goto error_hw_stop; + } bigben->report = list_entry(report_list->next, struct hid_report, list); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-core.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-core.c @@ -993,8 +993,8 @@ * Validating on id 0 means we should examine the first * report in the list. */ - report = list_entry( - hid->report_enum[type].report_list.next, + report = list_first_entry_or_null( + &hid->report_enum[type].report_list, struct hid_report, list); } else { report = hid->report_enum[type].report_id_hash[id]; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-playstation.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-playstation.c @@ -712,6 +712,7 @@ static int dualsense_get_calibration_data(struct dualsense *ds) { + struct hid_device *hdev = ds->base.hdev; short gyro_pitch_bias, gyro_pitch_plus, gyro_pitch_minus; short gyro_yaw_bias, gyro_yaw_plus, gyro_yaw_minus; short gyro_roll_bias, gyro_roll_plus, gyro_roll_minus; @@ -722,6 +723,7 @@ int speed_2x; int range_2g; int ret = 0; + int i; uint8_t *buf; buf = kzalloc(DS_FEATURE_REPORT_CALIBRATION_SIZE, GFP_KERNEL); @@ -774,6 +776,21 @@ ds->gyro_calib_data[2].sens_denom = gyro_roll_plus - gyro_roll_minus; /* + * Sanity check gyro calibration data. This is needed to prevent crashes + * during report handling of virtual, clone or broken devices not implementing + * calibration data properly. + */ + for (i = 0; i < ARRAY_SIZE(ds->gyro_calib_data); i++) { + if (ds->gyro_calib_data[i].sens_denom == 0) { + hid_warn(hdev, "Invalid gyro calibration data for axis (%d), disabling calibration.", + ds->gyro_calib_data[i].abs_code); + ds->gyro_calib_data[i].bias = 0; + ds->gyro_calib_data[i].sens_numer = DS_GYRO_RANGE; + ds->gyro_calib_data[i].sens_denom = S16_MAX; + } + } + + /* * Set accelerometer calibration and normalization parameters. * Data values will be normalized to 1/DS_ACC_RES_PER_G g. */ @@ -795,6 +812,21 @@ ds->accel_calib_data[2].sens_numer = 2*DS_ACC_RES_PER_G; ds->accel_calib_data[2].sens_denom = range_2g; + /* + * Sanity check accelerometer calibration data. This is needed to prevent crashes + * during report handling of virtual, clone or broken devices not implementing calibration + * data properly. + */ + for (i = 0; i < ARRAY_SIZE(ds->accel_calib_data); i++) { + if (ds->accel_calib_data[i].sens_denom == 0) { + hid_warn(hdev, "Invalid accelerometer calibration data for axis (%d), disabling calibration.", + ds->accel_calib_data[i].abs_code); + ds->accel_calib_data[i].bias = 0; + ds->accel_calib_data[i].sens_numer = DS_ACC_RANGE; + ds->accel_calib_data[i].sens_denom = S16_MAX; + } + } + err_free: kfree(buf); return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-quirks.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-quirks.c @@ -54,7 +54,6 @@ { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_THROTTLE), HID_QUIRK_NOGET }, - { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_MOUSE_000C), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB), HID_QUIRK_NO_INIT_REPORTS }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/hid-uclogic-core.c +++ linux-oem-6.1-6.1.0/drivers/hid/hid-uclogic-core.c @@ -526,6 +526,8 @@ { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01) }, { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, + USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) }, { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S) }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hid/intel-ish-hid/ishtp/dma-if.c +++ linux-oem-6.1-6.1.0/drivers/hid/intel-ish-hid/ishtp/dma-if.c @@ -104,6 +104,11 @@ int required_slots = (size / DMA_SLOT_SIZE) + 1 * (size % DMA_SLOT_SIZE != 0); + if (!dev->ishtp_dma_tx_map) { + dev_err(dev->devc, "Fail to allocate Tx map\n"); + return NULL; + } + spin_lock_irqsave(&dev->ishtp_dma_tx_lock, flags); for (i = 0; i <= (dev->ishtp_dma_num_slots - required_slots); i++) { free = 1; @@ -150,6 +155,11 @@ return; } + if (!dev->ishtp_dma_tx_map) { + dev_err(dev->devc, "Fail to allocate Tx map\n"); + return; + } + i = (msg_addr - dev->ishtp_host_dma_tx_buf) / DMA_SLOT_SIZE; spin_lock_irqsave(&dev->ishtp_dma_tx_lock, flags); for (j = 0; j < acked_slots; j++) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/hv/hv_balloon.c +++ linux-oem-6.1-6.1.0/drivers/hv/hv_balloon.c @@ -1911,7 +1911,7 @@ static void hv_balloon_debugfs_exit(struct hv_dynmem_device *b) { - debugfs_remove(debugfs_lookup("hv-balloon", NULL)); + debugfs_lookup_and_remove("hv-balloon", NULL); } #else only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/i2c/busses/i2c-designware-common.c +++ linux-oem-6.1-6.1.0/drivers/i2c/busses/i2c-designware-common.c @@ -351,7 +351,8 @@ * * If your hardware is free from tHD;STA issue, try this one. */ - return DIV_ROUND_CLOSEST(ic_clk * tSYMBOL, MICRO) - 8 + offset; + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) - + 8 + offset; else /* * Conditional expression: @@ -367,7 +368,8 @@ * The reason why we need to take into account "tf" here, * is the same as described in i2c_dw_scl_lcnt(). */ - return DIV_ROUND_CLOSEST(ic_clk * (tSYMBOL + tf), MICRO) - 3 + offset; + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), MICRO) - + 3 + offset; } u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset) @@ -383,7 +385,8 @@ * account the fall time of SCL signal (tf). Default tf value * should be 0.3 us, for safety. */ - return DIV_ROUND_CLOSEST(ic_clk * (tLOW + tf), MICRO) - 1 + offset; + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) - + 1 + offset; } int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/i2c/busses/i2c-designware-pcidrv.c +++ linux-oem-6.1-6.1.0/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -396,6 +396,8 @@ { PCI_VDEVICE(ATI, 0x73a4), navi_amd }, { PCI_VDEVICE(ATI, 0x73e4), navi_amd }, { PCI_VDEVICE(ATI, 0x73c4), navi_amd }, + { PCI_VDEVICE(ATI, 0x7444), navi_amd }, + { PCI_VDEVICE(ATI, 0x7464), navi_amd }, { 0,} }; MODULE_DEVICE_TABLE(pci, i2_designware_pci_ids); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/i2c/busses/i2c-designware-platdrv.c +++ linux-oem-6.1-6.1.0/drivers/i2c/busses/i2c-designware-platdrv.c @@ -351,13 +351,11 @@ if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { dev_pm_set_driver_flags(&pdev->dev, - DPM_FLAG_SMART_PREPARE | - DPM_FLAG_MAY_SKIP_RESUME); + DPM_FLAG_SMART_PREPARE); } else { dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_SMART_PREPARE | - DPM_FLAG_SMART_SUSPEND | - DPM_FLAG_MAY_SKIP_RESUME); + DPM_FLAG_SMART_SUSPEND); } device_enable_async_suspend(&pdev->dev); @@ -419,21 +417,8 @@ */ return !has_acpi_companion(dev); } - -static void dw_i2c_plat_complete(struct device *dev) -{ - /* - * The device can only be in runtime suspend at this point if it has not - * been resumed throughout the ending system suspend/resume cycle, so if - * the platform firmware might mess up with it, request the runtime PM - * framework to resume it. - */ - if (pm_runtime_suspended(dev) && pm_resume_via_firmware()) - pm_request_resume(dev); -} #else #define dw_i2c_plat_prepare NULL -#define dw_i2c_plat_complete NULL #endif #ifdef CONFIG_PM @@ -483,7 +468,6 @@ static const struct dev_pm_ops dw_i2c_dev_pm_ops = { .prepare = dw_i2c_plat_prepare, - .complete = dw_i2c_plat_complete, SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL) }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/i2c/busses/i2c-mxs.c +++ linux-oem-6.1-6.1.0/drivers/i2c/busses/i2c-mxs.c @@ -826,8 +826,8 @@ /* Setup the DMA */ i2c->dmach = dma_request_chan(dev, "rx-tx"); if (IS_ERR(i2c->dmach)) { - dev_err(dev, "Failed to request dma\n"); - return PTR_ERR(i2c->dmach); + return dev_err_probe(dev, PTR_ERR(i2c->dmach), + "Failed to request dma\n"); } platform_set_drvdata(pdev, i2c); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/i2c/busses/i2c-rk3x.c +++ linux-oem-6.1-6.1.0/drivers/i2c/busses/i2c-rk3x.c @@ -80,7 +80,7 @@ #define DEFAULT_SCL_RATE (100 * 1000) /* Hz */ /** - * struct i2c_spec_values: + * struct i2c_spec_values - I2C specification values for various modes * @min_hold_start_ns: min hold time (repeated) START condition * @min_low_ns: min LOW period of the SCL clock * @min_high_ns: min HIGH period of the SCL cloc @@ -136,7 +136,7 @@ }; /** - * struct rk3x_i2c_calced_timings: + * struct rk3x_i2c_calced_timings - calculated V1 timings * @div_low: Divider output for low * @div_high: Divider output for high * @tuning: Used to adjust setup/hold data time, @@ -159,7 +159,7 @@ }; /** - * struct rk3x_i2c_soc_data: + * struct rk3x_i2c_soc_data - SOC-specific data * @grf_offset: offset inside the grf regmap for setting the i2c type * @calc_timings: Callback function for i2c timing information calculated */ @@ -239,7 +239,8 @@ } /** - * Generate a START condition, which triggers a REG_INT_START interrupt. + * rk3x_i2c_start - Generate a START condition, which triggers a REG_INT_START interrupt. + * @i2c: target controller data */ static void rk3x_i2c_start(struct rk3x_i2c *i2c) { @@ -258,8 +259,8 @@ } /** - * Generate a STOP condition, which triggers a REG_INT_STOP interrupt. - * + * rk3x_i2c_stop - Generate a STOP condition, which triggers a REG_INT_STOP interrupt. + * @i2c: target controller data * @error: Error code to return in rk3x_i2c_xfer */ static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error) @@ -298,7 +299,8 @@ } /** - * Setup a read according to i2c->msg + * rk3x_i2c_prepare_read - Setup a read according to i2c->msg + * @i2c: target controller data */ static void rk3x_i2c_prepare_read(struct rk3x_i2c *i2c) { @@ -329,7 +331,8 @@ } /** - * Fill the transmit buffer with data from i2c->msg + * rk3x_i2c_fill_transmit_buf - Fill the transmit buffer with data from i2c->msg + * @i2c: target controller data */ static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c) { @@ -532,11 +535,10 @@ } /** - * Get timing values of I2C specification - * + * rk3x_i2c_get_spec - Get timing values of I2C specification * @speed: Desired SCL frequency * - * Returns: Matched i2c spec values. + * Return: Matched i2c_spec_values. */ static const struct i2c_spec_values *rk3x_i2c_get_spec(unsigned int speed) { @@ -549,13 +551,12 @@ } /** - * Calculate divider values for desired SCL frequency - * + * rk3x_i2c_v0_calc_timings - Calculate divider values for desired SCL frequency * @clk_rate: I2C input clock rate * @t: Known I2C timing information * @t_calc: Caculated rk3x private timings that would be written into regs * - * Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case + * Return: %0 on success, -%EINVAL if the goal SCL rate is too slow. In that case * a best-effort divider value is returned in divs. If the target rate is * too high, we silently use the highest possible rate. */ @@ -710,13 +711,12 @@ } /** - * Calculate timing values for desired SCL frequency - * + * rk3x_i2c_v1_calc_timings - Calculate timing values for desired SCL frequency * @clk_rate: I2C input clock rate * @t: Known I2C timing information * @t_calc: Caculated rk3x private timings that would be written into regs * - * Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case + * Return: %0 on success, -%EINVAL if the goal SCL rate is too slow. In that case * a best-effort divider value is returned in divs. If the target rate is * too high, we silently use the highest possible rate. * The following formulas are v1's method to calculate timings. @@ -960,14 +960,14 @@ } /** - * Setup I2C registers for an I2C operation specified by msgs, num. - * - * Must be called with i2c->lock held. - * + * rk3x_i2c_setup - Setup I2C registers for an I2C operation specified by msgs, num. + * @i2c: target controller data * @msgs: I2C msgs to process * @num: Number of msgs * - * returns: Number of I2C msgs processed or negative in case of error + * Must be called with i2c->lock held. + * + * Return: Number of I2C msgs processed or negative in case of error */ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/accel/hid-sensor-accel-3d.c +++ linux-oem-6.1-6.1.0/drivers/iio/accel/hid-sensor-accel-3d.c @@ -280,6 +280,7 @@ hid_sensor_convert_timestamp( &accel_state->common_attributes, *(int64_t *)raw_data); + ret = 0; break; default: break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/adc/berlin2-adc.c +++ linux-oem-6.1-6.1.0/drivers/iio/adc/berlin2-adc.c @@ -298,8 +298,10 @@ int ret; indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv)); - if (!indio_dev) + if (!indio_dev) { + of_node_put(parent_np); return -ENOMEM; + } priv = iio_priv(indio_dev); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/adc/imx8qxp-adc.c +++ linux-oem-6.1-6.1.0/drivers/iio/adc/imx8qxp-adc.c @@ -86,6 +86,8 @@ #define IMX8QXP_ADC_TIMEOUT msecs_to_jiffies(100) +#define IMX8QXP_ADC_MAX_FIFO_SIZE 16 + struct imx8qxp_adc { struct device *dev; void __iomem *regs; @@ -95,6 +97,7 @@ /* Serialise ADC channel reads */ struct mutex lock; struct completion completion; + u32 fifo[IMX8QXP_ADC_MAX_FIFO_SIZE]; }; #define IMX8QXP_ADC_CHAN(_idx) { \ @@ -238,8 +241,7 @@ return ret; } - *val = FIELD_GET(IMX8QXP_ADC_RESFIFO_VAL_MASK, - readl(adc->regs + IMX8QXP_ADR_ADC_RESFIFO)); + *val = adc->fifo[0]; mutex_unlock(&adc->lock); return IIO_VAL_INT; @@ -265,10 +267,15 @@ { struct imx8qxp_adc *adc = dev_id; u32 fifo_count; + int i; fifo_count = FIELD_GET(IMX8QXP_ADC_FCTRL_FCOUNT_MASK, readl(adc->regs + IMX8QXP_ADR_ADC_FCTRL)); + for (i = 0; i < fifo_count; i++) + adc->fifo[i] = FIELD_GET(IMX8QXP_ADC_RESFIFO_VAL_MASK, + readl_relaxed(adc->regs + IMX8QXP_ADR_ADC_RESFIFO)); + if (fifo_count) complete(&adc->completion); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/adc/stm32-dfsdm-adc.c +++ linux-oem-6.1-6.1.0/drivers/iio/adc/stm32-dfsdm-adc.c @@ -1520,6 +1520,7 @@ }, {} }; +MODULE_DEVICE_TABLE(of, stm32_dfsdm_adc_match); static int stm32_dfsdm_adc_probe(struct platform_device *pdev) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/adc/twl6030-gpadc.c +++ linux-oem-6.1-6.1.0/drivers/iio/adc/twl6030-gpadc.c @@ -57,6 +57,18 @@ #define TWL6030_GPADCS BIT(1) #define TWL6030_GPADCR BIT(0) +#define USB_VBUS_CTRL_SET 0x04 +#define USB_ID_CTRL_SET 0x06 + +#define TWL6030_MISC1 0xE4 +#define VBUS_MEAS 0x01 +#define ID_MEAS 0x01 + +#define VAC_MEAS 0x04 +#define VBAT_MEAS 0x02 +#define BB_MEAS 0x01 + + /** * struct twl6030_chnl_calib - channel calibration * @gain: slope coefficient for ideal curve @@ -927,6 +939,26 @@ return ret; } + ret = twl_i2c_write_u8(TWL_MODULE_USB, VBUS_MEAS, USB_VBUS_CTRL_SET); + if (ret < 0) { + dev_err(dev, "failed to wire up inputs\n"); + return ret; + } + + ret = twl_i2c_write_u8(TWL_MODULE_USB, ID_MEAS, USB_ID_CTRL_SET); + if (ret < 0) { + dev_err(dev, "failed to wire up inputs\n"); + return ret; + } + + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, + VBAT_MEAS | BB_MEAS | VAC_MEAS, + TWL6030_MISC1); + if (ret < 0) { + dev_err(dev, "failed to wire up inputs\n"); + return ret; + } + indio_dev->name = DRIVER_NAME; indio_dev->info = &twl6030_gpadc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/adc/xilinx-ams.c +++ linux-oem-6.1-6.1.0/drivers/iio/adc/xilinx-ams.c @@ -1329,7 +1329,7 @@ dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL); if (!dev_channels) - ret = -ENOMEM; + return -ENOMEM; indio_dev->channels = dev_channels; indio_dev->num_channels = num_channels; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ linux-oem-6.1-6.1.0/drivers/iio/gyro/hid-sensor-gyro-3d.c @@ -231,6 +231,7 @@ gyro_state->timestamp = hid_sensor_convert_timestamp(&gyro_state->common_attributes, *(s64 *)raw_data); + ret = 0; break; default: break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/imu/fxos8700_core.c +++ linux-oem-6.1-6.1.0/drivers/iio/imu/fxos8700_core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -144,9 +145,8 @@ #define FXOS8700_NVM_DATA_BNK0 0xa7 /* Bit definitions for FXOS8700_CTRL_REG1 */ -#define FXOS8700_CTRL_ODR_MSK 0x38 #define FXOS8700_CTRL_ODR_MAX 0x00 -#define FXOS8700_CTRL_ODR_MIN GENMASK(4, 3) +#define FXOS8700_CTRL_ODR_MSK GENMASK(5, 3) /* Bit definitions for FXOS8700_M_CTRL_REG1 */ #define FXOS8700_HMS_MASK GENMASK(1, 0) @@ -320,7 +320,7 @@ switch (iio_type) { case IIO_ACCEL: return FXOS8700_ACCEL; - case IIO_ANGL_VEL: + case IIO_MAGN: return FXOS8700_MAGN; default: return -EINVAL; @@ -345,15 +345,35 @@ static int fxos8700_set_scale(struct fxos8700_data *data, enum fxos8700_sensor t, int uscale) { - int i; + int i, ret, val; + bool active_mode; static const int scale_num = ARRAY_SIZE(fxos8700_accel_scale); struct device *dev = regmap_get_device(data->regmap); if (t == FXOS8700_MAGN) { - dev_err(dev, "Magnetometer scale is locked at 1200uT\n"); + dev_err(dev, "Magnetometer scale is locked at 0.001Gs\n"); return -EINVAL; } + /* + * When device is in active mode, it failed to set an ACCEL + * full-scale range(2g/4g/8g) in FXOS8700_XYZ_DATA_CFG. + * This is not align with the datasheet, but it is a fxos8700 + * chip behavier. Set the device in standby mode before setting + * an ACCEL full-scale range. + */ + ret = regmap_read(data->regmap, FXOS8700_CTRL_REG1, &val); + if (ret) + return ret; + + active_mode = val & FXOS8700_ACTIVE; + if (active_mode) { + ret = regmap_write(data->regmap, FXOS8700_CTRL_REG1, + val & ~FXOS8700_ACTIVE); + if (ret) + return ret; + } + for (i = 0; i < scale_num; i++) if (fxos8700_accel_scale[i].uscale == uscale) break; @@ -361,8 +381,12 @@ if (i == scale_num) return -EINVAL; - return regmap_write(data->regmap, FXOS8700_XYZ_DATA_CFG, + ret = regmap_write(data->regmap, FXOS8700_XYZ_DATA_CFG, fxos8700_accel_scale[i].bits); + if (ret) + return ret; + return regmap_write(data->regmap, FXOS8700_CTRL_REG1, + active_mode); } static int fxos8700_get_scale(struct fxos8700_data *data, @@ -372,7 +396,7 @@ static const int scale_num = ARRAY_SIZE(fxos8700_accel_scale); if (t == FXOS8700_MAGN) { - *uscale = 1200; /* Magnetometer is locked at 1200uT */ + *uscale = 1000; /* Magnetometer is locked at 0.001Gs */ return 0; } @@ -394,22 +418,61 @@ int axis, int *val) { u8 base, reg; + s16 tmp; int ret; - enum fxos8700_sensor type = fxos8700_to_sensor(chan_type); - base = type ? FXOS8700_OUT_X_MSB : FXOS8700_M_OUT_X_MSB; + /* + * Different register base addresses varies with channel types. + * This bug hasn't been noticed before because using an enum is + * really hard to read. Use an a switch statement to take over that. + */ + switch (chan_type) { + case IIO_ACCEL: + base = FXOS8700_OUT_X_MSB; + break; + case IIO_MAGN: + base = FXOS8700_M_OUT_X_MSB; + break; + default: + return -EINVAL; + } /* Block read 6 bytes of device output registers to avoid data loss */ ret = regmap_bulk_read(data->regmap, base, data->buf, - FXOS8700_DATA_BUF_SIZE); + sizeof(data->buf)); if (ret) return ret; /* Convert axis to buffer index */ reg = axis - IIO_MOD_X; + /* + * Convert to native endianness. The accel data and magn data + * are signed, so a forced type conversion is needed. + */ + tmp = be16_to_cpu(data->buf[reg]); + + /* + * ACCEL output data registers contain the X-axis, Y-axis, and Z-axis + * 14-bit left-justified sample data and MAGN output data registers + * contain the X-axis, Y-axis, and Z-axis 16-bit sample data. Apply + * a signed 2 bits right shift to the readback raw data from ACCEL + * output data register and keep that from MAGN sensor as the origin. + * Value should be extended to 32 bit. + */ + switch (chan_type) { + case IIO_ACCEL: + tmp = tmp >> 2; + break; + case IIO_MAGN: + /* Nothing to do */ + break; + default: + return -EINVAL; + } + /* Convert to native endianness */ - *val = sign_extend32(be16_to_cpu(data->buf[reg]), 15); + *val = sign_extend32(tmp, 15); return 0; } @@ -445,10 +508,9 @@ if (i >= odr_num) return -EINVAL; - return regmap_update_bits(data->regmap, - FXOS8700_CTRL_REG1, - FXOS8700_CTRL_ODR_MSK + FXOS8700_ACTIVE, - fxos8700_odr[i].bits << 3 | active_mode); + val &= ~FXOS8700_CTRL_ODR_MSK; + val |= FIELD_PREP(FXOS8700_CTRL_ODR_MSK, fxos8700_odr[i].bits) | FXOS8700_ACTIVE; + return regmap_write(data->regmap, FXOS8700_CTRL_REG1, val); } static int fxos8700_get_odr(struct fxos8700_data *data, enum fxos8700_sensor t, @@ -461,7 +523,7 @@ if (ret) return ret; - val &= FXOS8700_CTRL_ODR_MSK; + val = FIELD_GET(FXOS8700_CTRL_ODR_MSK, val); for (i = 0; i < odr_num; i++) if (val == fxos8700_odr[i].bits) @@ -526,7 +588,7 @@ static IIO_CONST_ATTR(in_magn_sampling_frequency_available, "1.5625 6.25 12.5 50 100 200 400 800"); static IIO_CONST_ATTR(in_accel_scale_available, "0.000244 0.000488 0.000976"); -static IIO_CONST_ATTR(in_magn_scale_available, "0.000001200"); +static IIO_CONST_ATTR(in_magn_scale_available, "0.001000"); static struct attribute *fxos8700_attrs[] = { &iio_const_attr_in_accel_sampling_frequency_available.dev_attr.attr, @@ -592,14 +654,19 @@ if (ret) return ret; - /* Max ODR (800Hz individual or 400Hz hybrid), active mode */ - ret = regmap_write(data->regmap, FXOS8700_CTRL_REG1, - FXOS8700_CTRL_ODR_MAX | FXOS8700_ACTIVE); + /* + * Set max full-scale range (+/-8G) for ACCEL sensor in chip + * initialization then activate the device. + */ + ret = regmap_write(data->regmap, FXOS8700_XYZ_DATA_CFG, MODE_8G); if (ret) return ret; - /* Set for max full-scale range (+/-8G) */ - return regmap_write(data->regmap, FXOS8700_XYZ_DATA_CFG, MODE_8G); + /* Max ODR (800Hz individual or 400Hz hybrid), active mode */ + return regmap_update_bits(data->regmap, FXOS8700_CTRL_REG1, + FXOS8700_CTRL_ODR_MSK | FXOS8700_ACTIVE, + FIELD_PREP(FXOS8700_CTRL_ODR_MSK, FXOS8700_CTRL_ODR_MAX) | + FXOS8700_ACTIVE); } static void fxos8700_chip_uninit(void *data) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iio/light/cm32181.c +++ linux-oem-6.1-6.1.0/drivers/iio/light/cm32181.c @@ -440,6 +440,8 @@ if (!indio_dev) return -ENOMEM; + i2c_set_clientdata(client, indio_dev); + /* * Some ACPI systems list 2 I2C resources for the CM3218 sensor, the * SMBus Alert Response Address (ARA, 0x0c) and the actual I2C address. @@ -460,8 +462,6 @@ return PTR_ERR(client); } - i2c_set_clientdata(client, indio_dev); - cm32181 = iio_priv(indio_dev); cm32181->client = client; cm32181->dev = dev; @@ -490,7 +490,8 @@ static int cm32181_suspend(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); + struct cm32181_chip *cm32181 = iio_priv(dev_get_drvdata(dev)); + struct i2c_client *client = cm32181->client; return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, CM32181_CMD_ALS_DISABLE); @@ -498,8 +499,8 @@ static int cm32181_resume(struct device *dev) { - struct i2c_client *client = to_i2c_client(dev); struct cm32181_chip *cm32181 = iio_priv(dev_get_drvdata(dev)); + struct i2c_client *client = cm32181->client; return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, cm32181->conf_regs[CM32181_REG_ADDR_CMD]); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/core/verbs.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/core/verbs.c @@ -2957,15 +2957,18 @@ bool __rdma_block_iter_next(struct ib_block_iter *biter) { unsigned int block_offset; + unsigned int sg_delta; if (!biter->__sg_nents || !biter->__sg) return false; biter->__dma_addr = sg_dma_address(biter->__sg) + biter->__sg_advance; block_offset = biter->__dma_addr & (BIT_ULL(biter->__pg_bit) - 1); - biter->__sg_advance += BIT_ULL(biter->__pg_bit) - block_offset; + sg_delta = BIT_ULL(biter->__pg_bit) - block_offset; - if (biter->__sg_advance >= sg_dma_len(biter->__sg)) { + if (sg_dma_len(biter->__sg) - biter->__sg_advance > sg_delta) { + biter->__sg_advance += sg_delta; + } else { biter->__sg_advance = 0; biter->__sg = sg_next(biter->__sg); biter->__sg_nents--; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/hw/hfi1/file_ops.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/hw/hfi1/file_ops.c @@ -1318,12 +1318,15 @@ addr = arg + offsetof(struct hfi1_tid_info, tidcnt); if (copy_to_user((void __user *)addr, &tinfo.tidcnt, sizeof(tinfo.tidcnt))) - return -EFAULT; + ret = -EFAULT; addr = arg + offsetof(struct hfi1_tid_info, length); - if (copy_to_user((void __user *)addr, &tinfo.length, + if (!ret && copy_to_user((void __user *)addr, &tinfo.length, sizeof(tinfo.length))) ret = -EFAULT; + + if (ret) + hfi1_user_exp_rcv_invalid(fd, &tinfo); } return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/hw/hfi1/user_exp_rcv.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/hw/hfi1/user_exp_rcv.c @@ -23,18 +23,25 @@ static bool tid_rb_invalidate(struct mmu_interval_notifier *mni, const struct mmu_notifier_range *range, unsigned long cur_seq); +static bool tid_cover_invalidate(struct mmu_interval_notifier *mni, + const struct mmu_notifier_range *range, + unsigned long cur_seq); static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *, struct tid_group *grp, unsigned int start, u16 count, u32 *tidlist, unsigned int *tididx, unsigned int *pmapped); -static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo, - struct tid_group **grp); +static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo); +static void __clear_tid_node(struct hfi1_filedata *fd, + struct tid_rb_node *node); static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); static const struct mmu_interval_notifier_ops tid_mn_ops = { .invalidate = tid_rb_invalidate, }; +static const struct mmu_interval_notifier_ops tid_cover_ops = { + .invalidate = tid_cover_invalidate, +}; /* * Initialize context and file private data needed for Expected @@ -253,53 +260,65 @@ tididx = 0, mapped, mapped_pages = 0; u32 *tidlist = NULL; struct tid_user_buf *tidbuf; + unsigned long mmu_seq = 0; if (!PAGE_ALIGNED(tinfo->vaddr)) return -EINVAL; + if (tinfo->length == 0) + return -EINVAL; tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); if (!tidbuf) return -ENOMEM; + mutex_init(&tidbuf->cover_mutex); tidbuf->vaddr = tinfo->vaddr; tidbuf->length = tinfo->length; tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), GFP_KERNEL); if (!tidbuf->psets) { - kfree(tidbuf); - return -ENOMEM; + ret = -ENOMEM; + goto fail_release_mem; + } + + if (fd->use_mn) { + ret = mmu_interval_notifier_insert( + &tidbuf->notifier, current->mm, + tidbuf->vaddr, tidbuf->npages * PAGE_SIZE, + &tid_cover_ops); + if (ret) + goto fail_release_mem; + mmu_seq = mmu_interval_read_begin(&tidbuf->notifier); } pinned = pin_rcv_pages(fd, tidbuf); if (pinned <= 0) { - kfree(tidbuf->psets); - kfree(tidbuf); - return pinned; + ret = (pinned < 0) ? pinned : -ENOSPC; + goto fail_unpin; } /* Find sets of physically contiguous pages */ tidbuf->n_psets = find_phys_blocks(tidbuf, pinned); - /* - * We don't need to access this under a lock since tid_used is per - * process and the same process cannot be in hfi1_user_exp_rcv_clear() - * and hfi1_user_exp_rcv_setup() at the same time. - */ + /* Reserve the number of expected tids to be used. */ spin_lock(&fd->tid_lock); if (fd->tid_used + tidbuf->n_psets > fd->tid_limit) pageset_count = fd->tid_limit - fd->tid_used; else pageset_count = tidbuf->n_psets; + fd->tid_used += pageset_count; spin_unlock(&fd->tid_lock); - if (!pageset_count) - goto bail; + if (!pageset_count) { + ret = -ENOSPC; + goto fail_unreserve; + } ngroups = pageset_count / dd->rcv_entries.group_size; tidlist = kcalloc(pageset_count, sizeof(*tidlist), GFP_KERNEL); if (!tidlist) { ret = -ENOMEM; - goto nomem; + goto fail_unreserve; } tididx = 0; @@ -395,43 +414,78 @@ } unlock: mutex_unlock(&uctxt->exp_mutex); -nomem: hfi1_cdbg(TID, "total mapped: tidpairs:%u pages:%u (%d)", tididx, mapped_pages, ret); - if (tididx) { - spin_lock(&fd->tid_lock); - fd->tid_used += tididx; - spin_unlock(&fd->tid_lock); - tinfo->tidcnt = tididx; - tinfo->length = mapped_pages * PAGE_SIZE; - if (copy_to_user(u64_to_user_ptr(tinfo->tidlist), - tidlist, sizeof(tidlist[0]) * tididx)) { - /* - * On failure to copy to the user level, we need to undo - * everything done so far so we don't leak resources. - */ - tinfo->tidlist = (unsigned long)&tidlist; - hfi1_user_exp_rcv_clear(fd, tinfo); - tinfo->tidlist = 0; - ret = -EFAULT; - goto bail; + /* fail if nothing was programmed, set error if none provided */ + if (tididx == 0) { + if (ret >= 0) + ret = -ENOSPC; + goto fail_unreserve; + } + + /* adjust reserved tid_used to actual count */ + spin_lock(&fd->tid_lock); + fd->tid_used -= pageset_count - tididx; + spin_unlock(&fd->tid_lock); + + /* unpin all pages not covered by a TID */ + unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, pinned - mapped_pages, + false); + + if (fd->use_mn) { + /* check for an invalidate during setup */ + bool fail = false; + + mutex_lock(&tidbuf->cover_mutex); + fail = mmu_interval_read_retry(&tidbuf->notifier, mmu_seq); + mutex_unlock(&tidbuf->cover_mutex); + + if (fail) { + ret = -EBUSY; + goto fail_unprogram; } } - /* - * If not everything was mapped (due to insufficient RcvArray entries, - * for example), unpin all unmapped pages so we can pin them nex time. - */ - if (mapped_pages != pinned) - unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, - (pinned - mapped_pages), false); -bail: + tinfo->tidcnt = tididx; + tinfo->length = mapped_pages * PAGE_SIZE; + + if (copy_to_user(u64_to_user_ptr(tinfo->tidlist), + tidlist, sizeof(tidlist[0]) * tididx)) { + ret = -EFAULT; + goto fail_unprogram; + } + + if (fd->use_mn) + mmu_interval_notifier_remove(&tidbuf->notifier); + kfree(tidbuf->pages); kfree(tidbuf->psets); + kfree(tidbuf); kfree(tidlist); + return 0; + +fail_unprogram: + /* unprogram, unmap, and unpin all allocated TIDs */ + tinfo->tidlist = (unsigned long)tidlist; + hfi1_user_exp_rcv_clear(fd, tinfo); + tinfo->tidlist = 0; + pinned = 0; /* nothing left to unpin */ + pageset_count = 0; /* nothing left reserved */ +fail_unreserve: + spin_lock(&fd->tid_lock); + fd->tid_used -= pageset_count; + spin_unlock(&fd->tid_lock); +fail_unpin: + if (fd->use_mn) + mmu_interval_notifier_remove(&tidbuf->notifier); + if (pinned > 0) + unpin_rcv_pages(fd, tidbuf, NULL, 0, pinned, false); +fail_release_mem: kfree(tidbuf->pages); + kfree(tidbuf->psets); kfree(tidbuf); - return ret > 0 ? 0 : ret; + kfree(tidlist); + return ret; } int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd, @@ -452,7 +506,7 @@ mutex_lock(&uctxt->exp_mutex); for (tididx = 0; tididx < tinfo->tidcnt; tididx++) { - ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL); + ret = unprogram_rcvarray(fd, tidinfo[tididx]); if (ret) { hfi1_cdbg(TID, "Failed to unprogram rcv array %d", ret); @@ -706,6 +760,7 @@ } node->fdata = fd; + mutex_init(&node->invalidate_mutex); node->phys = page_to_phys(pages[0]); node->npages = npages; node->rcventry = rcventry; @@ -721,11 +776,6 @@ &tid_mn_ops); if (ret) goto out_unmap; - /* - * FIXME: This is in the wrong order, the notifier should be - * established before the pages are pinned by pin_rcv_pages. - */ - mmu_interval_read_begin(&node->notifier); } fd->entry_to_rb[node->rcventry - uctxt->expected_base] = node; @@ -745,8 +795,7 @@ return -EFAULT; } -static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo, - struct tid_group **grp) +static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo) { struct hfi1_ctxtdata *uctxt = fd->uctxt; struct hfi1_devdata *dd = uctxt->dd; @@ -769,9 +818,6 @@ if (!node || node->rcventry != (uctxt->expected_base + rcventry)) return -EBADF; - if (grp) - *grp = node->grp; - if (fd->use_mn) mmu_interval_notifier_remove(&node->notifier); cacheless_tid_rb_remove(fd, node); @@ -779,23 +825,34 @@ return 0; } -static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) +static void __clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) { struct hfi1_ctxtdata *uctxt = fd->uctxt; struct hfi1_devdata *dd = uctxt->dd; + mutex_lock(&node->invalidate_mutex); + if (node->freed) + goto done; + node->freed = true; + trace_hfi1_exp_tid_unreg(uctxt->ctxt, fd->subctxt, node->rcventry, node->npages, node->notifier.interval_tree.start, node->phys, node->dma_addr); - /* - * Make sure device has seen the write before we unpin the - * pages. - */ + /* Make sure device has seen the write before pages are unpinned */ hfi1_put_tid(dd, node->rcventry, PT_INVALID_FLUSH, 0, 0); unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); +done: + mutex_unlock(&node->invalidate_mutex); +} + +static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) +{ + struct hfi1_ctxtdata *uctxt = fd->uctxt; + + __clear_tid_node(fd, node); node->grp->used--; node->grp->map &= ~(1 << (node->rcventry - node->grp->base)); @@ -854,10 +911,16 @@ if (node->freed) return true; + /* take action only if unmapping */ + if (range->event != MMU_NOTIFY_UNMAP) + return true; + trace_hfi1_exp_tid_inval(uctxt->ctxt, fdata->subctxt, node->notifier.interval_tree.start, node->rcventry, node->npages, node->dma_addr); - node->freed = true; + + /* clear the hardware rcvarray entry */ + __clear_tid_node(fdata, node); spin_lock(&fdata->invalid_lock); if (fdata->invalid_tid_idx < uctxt->expected_count) { @@ -887,6 +950,23 @@ return true; } +static bool tid_cover_invalidate(struct mmu_interval_notifier *mni, + const struct mmu_notifier_range *range, + unsigned long cur_seq) +{ + struct tid_user_buf *tidbuf = + container_of(mni, struct tid_user_buf, notifier); + + /* take action only if unmapping */ + if (range->event == MMU_NOTIFY_UNMAP) { + mutex_lock(&tidbuf->cover_mutex); + mmu_interval_set_seq(mni, cur_seq); + mutex_unlock(&tidbuf->cover_mutex); + } + + return true; +} + static void cacheless_tid_rb_remove(struct hfi1_filedata *fdata, struct tid_rb_node *tnode) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/hw/hfi1/user_exp_rcv.h +++ linux-oem-6.1-6.1.0/drivers/infiniband/hw/hfi1/user_exp_rcv.h @@ -16,6 +16,8 @@ }; struct tid_user_buf { + struct mmu_interval_notifier notifier; + struct mutex cover_mutex; unsigned long vaddr; unsigned long length; unsigned int npages; @@ -27,6 +29,7 @@ struct tid_rb_node { struct mmu_interval_notifier notifier; struct hfi1_filedata *fdata; + struct mutex invalidate_mutex; /* covers hw removal */ unsigned long phys; struct tid_group *grp; u32 rcventry; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/hw/irdma/cm.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/hw/irdma/cm.c @@ -1722,6 +1722,9 @@ continue; idev = in_dev_get(ip_dev); + if (!idev) + continue; + in_dev_for_each_ifa_rtnl(ifa, idev) { ibdev_dbg(&iwdev->ibdev, "CM: Allocating child CM Listener forIP=%pI4, vlan_id=%d, MAC=%pM\n", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/hw/usnic/usnic_uiom.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -277,8 +277,8 @@ size = pa_end - pa_start + PAGE_SIZE; usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x", va_start, &pa_start, size, flags); - err = iommu_map(pd->domain, va_start, pa_start, - size, flags); + err = iommu_map_atomic(pd->domain, va_start, + pa_start, size, flags); if (err) { usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", va_start, &pa_start, size, err); @@ -294,8 +294,8 @@ size = pa - pa_start + PAGE_SIZE; usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x\n", va_start, &pa_start, size, flags); - err = iommu_map(pd->domain, va_start, pa_start, - size, flags); + err = iommu_map_atomic(pd->domain, va_start, + pa_start, size, flags); if (err) { usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", va_start, &pa_start, size, err); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/sw/rxe/rxe_param.h +++ linux-oem-6.1-6.1.0/drivers/infiniband/sw/rxe/rxe_param.h @@ -91,11 +91,11 @@ RXE_MAX_SRQ = DEFAULT_MAX_VALUE - RXE_MIN_SRQ_INDEX, RXE_MIN_MR_INDEX = 0x00000001, - RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE, - RXE_MAX_MR = DEFAULT_MAX_VALUE - RXE_MIN_MR_INDEX, - RXE_MIN_MW_INDEX = 0x00010001, - RXE_MAX_MW_INDEX = 0x00020000, - RXE_MAX_MW = 0x00001000, + RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE >> 1, + RXE_MAX_MR = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX, + RXE_MIN_MW_INDEX = RXE_MAX_MR_INDEX + 1, + RXE_MAX_MW_INDEX = DEFAULT_MAX_VALUE, + RXE_MAX_MW = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX, RXE_MAX_PKT_PER_ACK = 64, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/sw/rxe/rxe_pool.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/sw/rxe/rxe_pool.c @@ -23,16 +23,16 @@ .size = sizeof(struct rxe_ucontext), .elem_offset = offsetof(struct rxe_ucontext, elem), .min_index = 1, - .max_index = UINT_MAX, - .max_elem = UINT_MAX, + .max_index = RXE_MAX_UCONTEXT, + .max_elem = RXE_MAX_UCONTEXT, }, [RXE_TYPE_PD] = { .name = "pd", .size = sizeof(struct rxe_pd), .elem_offset = offsetof(struct rxe_pd, elem), .min_index = 1, - .max_index = UINT_MAX, - .max_elem = UINT_MAX, + .max_index = RXE_MAX_PD, + .max_elem = RXE_MAX_PD, }, [RXE_TYPE_AH] = { .name = "ah", @@ -40,7 +40,7 @@ .elem_offset = offsetof(struct rxe_ah, elem), .min_index = RXE_MIN_AH_INDEX, .max_index = RXE_MAX_AH_INDEX, - .max_elem = RXE_MAX_AH_INDEX - RXE_MIN_AH_INDEX + 1, + .max_elem = RXE_MAX_AH, }, [RXE_TYPE_SRQ] = { .name = "srq", @@ -49,7 +49,7 @@ .cleanup = rxe_srq_cleanup, .min_index = RXE_MIN_SRQ_INDEX, .max_index = RXE_MAX_SRQ_INDEX, - .max_elem = RXE_MAX_SRQ_INDEX - RXE_MIN_SRQ_INDEX + 1, + .max_elem = RXE_MAX_SRQ, }, [RXE_TYPE_QP] = { .name = "qp", @@ -58,7 +58,7 @@ .cleanup = rxe_qp_cleanup, .min_index = RXE_MIN_QP_INDEX, .max_index = RXE_MAX_QP_INDEX, - .max_elem = RXE_MAX_QP_INDEX - RXE_MIN_QP_INDEX + 1, + .max_elem = RXE_MAX_QP, }, [RXE_TYPE_CQ] = { .name = "cq", @@ -66,8 +66,8 @@ .elem_offset = offsetof(struct rxe_cq, elem), .cleanup = rxe_cq_cleanup, .min_index = 1, - .max_index = UINT_MAX, - .max_elem = UINT_MAX, + .max_index = RXE_MAX_CQ, + .max_elem = RXE_MAX_CQ, }, [RXE_TYPE_MR] = { .name = "mr", @@ -76,7 +76,7 @@ .cleanup = rxe_mr_cleanup, .min_index = RXE_MIN_MR_INDEX, .max_index = RXE_MAX_MR_INDEX, - .max_elem = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX + 1, + .max_elem = RXE_MAX_MR, }, [RXE_TYPE_MW] = { .name = "mw", @@ -85,7 +85,7 @@ .cleanup = rxe_mw_cleanup, .min_index = RXE_MIN_MW_INDEX, .max_index = RXE_MAX_MW_INDEX, - .max_elem = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX + 1, + .max_elem = RXE_MAX_MW, }, }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2200,6 +2200,14 @@ rn->attach_mcast = ipoib_mcast_attach; rn->detach_mcast = ipoib_mcast_detach; rn->hca = hca; + + rc = netif_set_real_num_tx_queues(dev, 1); + if (rc) + goto out; + + rc = netif_set_real_num_rx_queues(dev, 1); + if (rc) + goto out; } priv->rn_ops = dev->netdev_ops; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ linux-oem-6.1-6.1.0/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -966,7 +966,7 @@ refcount_set(&req->ref, 1); req->mp_policy = clt_path->clt->mp_policy; - iov_iter_kvec(&iter, READ, vec, 1, usr_len); + iov_iter_kvec(&iter, ITER_SOURCE, vec, 1, usr_len); len = _copy_from_iter(req->iu->buf, usr_len, &iter); WARN_ON(len != usr_len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/infiniband/ulp/srp/ib_srp.h +++ linux-oem-6.1-6.1.0/drivers/infiniband/ulp/srp/ib_srp.h @@ -62,9 +62,6 @@ SRP_DEFAULT_CMD_SQ_SIZE = SRP_DEFAULT_QUEUE_SIZE - SRP_RSP_SQ_SIZE - SRP_TSK_MGMT_SQ_SIZE, - SRP_TAG_NO_REQ = ~0U, - SRP_TAG_TSK_MGMT = 1U << 31, - SRP_MAX_PAGES_PER_MR = 512, SRP_MAX_ADD_CDB_LEN = 16, @@ -79,6 +76,11 @@ sizeof(struct srp_imm_buf), }; +enum { + SRP_TAG_NO_REQ = ~0U, + SRP_TAG_TSK_MGMT = BIT(31), +}; + enum srp_target_state { SRP_TARGET_SCANNING, SRP_TARGET_LIVE, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/input/mouse/synaptics.c +++ linux-oem-6.1-6.1.0/drivers/input/mouse/synaptics.c @@ -192,7 +192,6 @@ "SYN3221", /* HP 15-ay000 */ "SYN323d", /* HP Spectre X360 13-w013dx */ "SYN3257", /* HP Envy 13-ad105ng */ - "SYN3286", /* HP Laptop 15-da3001TU */ NULL }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/input/serio/i8042-acpipnpio.h +++ linux-oem-6.1-6.1.0/drivers/input/serio/i8042-acpipnpio.h @@ -1240,6 +1240,13 @@ }, { .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) + }, + { + .matches = { DMI_MATCH(DMI_BOARD_NAME, "X170SM"), }, .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/interconnect/qcom/msm8996.c +++ linux-oem-6.1-6.1.0/drivers/interconnect/qcom/msm8996.c @@ -33,6 +33,13 @@ "aggre0_noc_mpu_cfg" }; +static const char * const bus_a2noc_clocks[] = { + "bus", + "bus_a", + "aggre2_ufs_axi", + "ufs_axi" +}; + static const u16 mas_a0noc_common_links[] = { MSM8996_SLAVE_A0NOC_SNOC }; @@ -1806,7 +1813,7 @@ .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0x9000, + .max_register = 0x6000, .fast_io = true }; @@ -1830,7 +1837,7 @@ .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0x7000, + .max_register = 0x5000, .fast_io = true }; @@ -1851,7 +1858,7 @@ .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0xa000, + .max_register = 0x7000, .fast_io = true }; @@ -1859,6 +1866,8 @@ .type = QCOM_ICC_NOC, .nodes = a2noc_nodes, .num_nodes = ARRAY_SIZE(a2noc_nodes), + .clocks = bus_a2noc_clocks, + .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), .regmap_cfg = &msm8996_a2noc_regmap_config }; @@ -1877,7 +1886,7 @@ .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0x62000, + .max_register = 0x5a000, .fast_io = true }; @@ -1988,7 +1997,7 @@ .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0x20000, + .max_register = 0x1c000, .fast_io = true }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ linux-oem-6.1-6.1.0/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3854,7 +3854,9 @@ static void arm_smmu_device_shutdown(struct platform_device *pdev) { - arm_smmu_device_remove(pdev); + struct arm_smmu_device *smmu = platform_get_drvdata(pdev); + + arm_smmu_device_disable(smmu); } static const struct of_device_id arm_smmu_of_match[] = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ linux-oem-6.1-6.1.0/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1319,8 +1319,14 @@ switch (cap) { case IOMMU_CAP_CACHE_COHERENCY: - /* Assume that a coherent TCU implies coherent TBUs */ - return cfg->smmu->features & ARM_SMMU_FEAT_COHERENT_WALK; + /* + * It's overwhelmingly the case in practice that when the pagetable + * walk interface is connected to a coherent interconnect, all the + * translation interfaces are too. Furthermore if the device is + * natively coherent, then its translation interface must also be. + */ + return cfg->smmu->features & ARM_SMMU_FEAT_COHERENT_WALK || + device_get_dma_attr(dev) == DEV_DMA_COHERENT; case IOMMU_CAP_NOEXEC: return true; default: @@ -2188,19 +2194,16 @@ return 0; } -static int arm_smmu_device_remove(struct platform_device *pdev) +static void arm_smmu_device_shutdown(struct platform_device *pdev) { struct arm_smmu_device *smmu = platform_get_drvdata(pdev); if (!smmu) - return -ENODEV; + return; if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS)) dev_notice(&pdev->dev, "disabling translation\n"); - iommu_device_unregister(&smmu->iommu); - iommu_device_sysfs_remove(&smmu->iommu); - arm_smmu_rpm_get(smmu); /* Turn the thing off */ arm_smmu_gr0_write(smmu, ARM_SMMU_GR0_sCR0, ARM_SMMU_sCR0_CLIENTPD); @@ -2212,12 +2215,21 @@ clk_bulk_disable(smmu->num_clks, smmu->clks); clk_bulk_unprepare(smmu->num_clks, smmu->clks); - return 0; } -static void arm_smmu_device_shutdown(struct platform_device *pdev) +static int arm_smmu_device_remove(struct platform_device *pdev) { - arm_smmu_device_remove(pdev); + struct arm_smmu_device *smmu = platform_get_drvdata(pdev); + + if (!smmu) + return -ENODEV; + + iommu_device_unregister(&smmu->iommu); + iommu_device_sysfs_remove(&smmu->iommu); + + arm_smmu_device_shutdown(pdev); + + return 0; } static int __maybe_unused arm_smmu_runtime_resume(struct device *dev) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iommu/iova.c +++ linux-oem-6.1-6.1.0/drivers/iommu/iova.c @@ -197,7 +197,7 @@ curr = __get_cached_rbnode(iovad, limit_pfn); curr_iova = to_iova(curr); - retry_pfn = curr_iova->pfn_hi + 1; + retry_pfn = curr_iova->pfn_hi; retry: do { @@ -211,7 +211,7 @@ if (high_pfn < size || new_pfn < low_pfn) { if (low_pfn == iovad->start_pfn && retry_pfn < limit_pfn) { high_pfn = limit_pfn; - low_pfn = retry_pfn; + low_pfn = retry_pfn + 1; curr = iova_find_limit(iovad, limit_pfn); curr_iova = to_iova(curr); goto retry; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/iommu/mtk_iommu_v1.c +++ linux-oem-6.1-6.1.0/drivers/iommu/mtk_iommu_v1.c @@ -685,7 +685,7 @@ ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL, dev_name(&pdev->dev)); if (ret) - return ret; + goto out_clk_unprepare; ret = iommu_device_register(&data->iommu, &mtk_iommu_v1_ops, dev); if (ret) @@ -700,6 +700,8 @@ iommu_device_unregister(&data->iommu); out_sysfs_remove: iommu_device_sysfs_remove(&data->iommu); +out_clk_unprepare: + clk_disable_unprepare(data->bclk); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/isdn/mISDN/l1oip_core.c +++ linux-oem-6.1-6.1.0/drivers/isdn/mISDN/l1oip_core.c @@ -706,7 +706,7 @@ printk(KERN_DEBUG "%s: socket created and open\n", __func__); while (!signal_pending(current)) { - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, recvbuf_size); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, recvbuf_size); recvlen = sock_recvmsg(socket, &msg, 0); if (recvlen > 0) { l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/md/bcache/bcache_ondisk.h +++ linux-oem-6.1-6.1.0/drivers/md/bcache/bcache_ondisk.h @@ -106,7 +106,8 @@ return bkey_u64s(k) * sizeof(__u64); } -#define bkey_copy(_dest, _src) memcpy(_dest, _src, bkey_bytes(_src)) +#define bkey_copy(_dest, _src) unsafe_memcpy(_dest, _src, bkey_bytes(_src), \ + /* bkey is always padded */) static inline void bkey_copy_key(struct bkey *dest, const struct bkey *src) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/md/bcache/journal.c +++ linux-oem-6.1-6.1.0/drivers/md/bcache/journal.c @@ -149,7 +149,8 @@ bytes, GFP_KERNEL); if (!i) return -ENOMEM; - memcpy(&i->j, j, bytes); + unsafe_memcpy(&i->j, j, bytes, + /* "bytes" was calculated by set_bytes() above */); /* Add to the location after 'where' points to */ list_add(&i->list, where); ret = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/memory/atmel-sdramc.c +++ linux-oem-6.1-6.1.0/drivers/memory/atmel-sdramc.c @@ -47,19 +47,17 @@ caps = of_device_get_match_data(&pdev->dev); if (caps->has_ddrck) { - clk = devm_clk_get(&pdev->dev, "ddrck"); + clk = devm_clk_get_enabled(&pdev->dev, "ddrck"); if (IS_ERR(clk)) return PTR_ERR(clk); - clk_prepare_enable(clk); } if (caps->has_mpddr_clk) { - clk = devm_clk_get(&pdev->dev, "mpddr"); + clk = devm_clk_get_enabled(&pdev->dev, "mpddr"); if (IS_ERR(clk)) { pr_err("AT91 RAMC: couldn't get mpddr clock\n"); return PTR_ERR(clk); } - clk_prepare_enable(clk); } return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/memory/mvebu-devbus.c +++ linux-oem-6.1-6.1.0/drivers/memory/mvebu-devbus.c @@ -280,10 +280,9 @@ if (IS_ERR(devbus->base)) return PTR_ERR(devbus->base); - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) return PTR_ERR(clk); - clk_prepare_enable(clk); /* * Obtain clock period in picoseconds, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/memory/tegra/tegra186.c +++ linux-oem-6.1-6.1.0/drivers/memory/tegra/tegra186.c @@ -22,32 +22,6 @@ #define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16) #define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8) -static void tegra186_mc_program_sid(struct tegra_mc *mc) -{ - unsigned int i; - - for (i = 0; i < mc->soc->num_clients; i++) { - const struct tegra_mc_client *client = &mc->soc->clients[i]; - u32 override, security; - - override = readl(mc->regs + client->regs.sid.override); - security = readl(mc->regs + client->regs.sid.security); - - dev_dbg(mc->dev, "client %s: override: %x security: %x\n", - client->name, override, security); - - dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid, - client->name); - writel(client->sid, mc->regs + client->regs.sid.override); - - override = readl(mc->regs + client->regs.sid.override); - security = readl(mc->regs + client->regs.sid.security); - - dev_dbg(mc->dev, "client %s: override: %x security: %x\n", - client->name, override, security); - } -} - static int tegra186_mc_probe(struct tegra_mc *mc) { struct platform_device *pdev = to_platform_device(mc->dev); @@ -85,8 +59,6 @@ if (err < 0) return err; - tegra186_mc_program_sid(mc); - return 0; } @@ -95,13 +67,6 @@ of_platform_depopulate(mc->dev); } -static int tegra186_mc_resume(struct tegra_mc *mc) -{ - tegra186_mc_program_sid(mc); - - return 0; -} - #if IS_ENABLED(CONFIG_IOMMU_API) static void tegra186_mc_client_sid_override(struct tegra_mc *mc, const struct tegra_mc_client *client, @@ -173,7 +138,6 @@ const struct tegra_mc_ops tegra186_mc_ops = { .probe = tegra186_mc_probe, .remove = tegra186_mc_remove, - .resume = tegra186_mc_resume, .probe_device = tegra186_mc_probe_device, .handle_irq = tegra30_mc_handle_irq, }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/misc/fastrpc.c +++ linux-oem-6.1-6.1.0/drivers/misc/fastrpc.c @@ -316,6 +316,13 @@ dma_buf_put(map->buf); } + if (map->fl) { + spin_lock(&map->fl->lock); + list_del(&map->node); + spin_unlock(&map->fl->lock); + map->fl = NULL; + } + kfree(map); } @@ -325,38 +332,41 @@ kref_put(&map->refcount, fastrpc_free_map); } -static void fastrpc_map_get(struct fastrpc_map *map) +static int fastrpc_map_get(struct fastrpc_map *map) { - if (map) - kref_get(&map->refcount); + if (!map) + return -ENOENT; + + return kref_get_unless_zero(&map->refcount) ? 0 : -ENOENT; } static int fastrpc_map_lookup(struct fastrpc_user *fl, int fd, - struct fastrpc_map **ppmap) + struct fastrpc_map **ppmap, bool take_ref) { + struct fastrpc_session_ctx *sess = fl->sctx; struct fastrpc_map *map = NULL; + int ret = -ENOENT; - mutex_lock(&fl->mutex); + spin_lock(&fl->lock); list_for_each_entry(map, &fl->maps, node) { - if (map->fd == fd) { - *ppmap = map; - mutex_unlock(&fl->mutex); - return 0; - } - } - mutex_unlock(&fl->mutex); - - return -ENOENT; -} + if (map->fd != fd) + continue; -static int fastrpc_map_find(struct fastrpc_user *fl, int fd, - struct fastrpc_map **ppmap) -{ - int ret = fastrpc_map_lookup(fl, fd, ppmap); + if (take_ref) { + ret = fastrpc_map_get(map); + if (ret) { + dev_dbg(sess->dev, "%s: Failed to get map fd=%d ret=%d\n", + __func__, fd, ret); + break; + } + } - if (!ret) - fastrpc_map_get(*ppmap); + *ppmap = map; + ret = 0; + break; + } + spin_unlock(&fl->lock); return ret; } @@ -703,7 +713,7 @@ struct fastrpc_map *map = NULL; int err = 0; - if (!fastrpc_map_find(fl, fd, ppmap)) + if (!fastrpc_map_lookup(fl, fd, ppmap, true)) return 0; map = kzalloc(sizeof(*map), GFP_KERNEL); @@ -1026,7 +1036,7 @@ for (i = 0; i < FASTRPC_MAX_FDLIST; i++) { if (!fdlist[i]) break; - if (!fastrpc_map_lookup(fl, (int)fdlist[i], &mmap)) + if (!fastrpc_map_lookup(fl, (int)fdlist[i], &mmap, false)) fastrpc_map_put(mmap); } @@ -1265,12 +1275,7 @@ fl->init_mem = NULL; fastrpc_buf_free(imem); err_alloc: - if (map) { - spin_lock(&fl->lock); - list_del(&map->node); - spin_unlock(&fl->lock); - fastrpc_map_put(map); - } + fastrpc_map_put(map); err: kfree(args); @@ -1346,10 +1351,8 @@ fastrpc_context_put(ctx); } - list_for_each_entry_safe(map, m, &fl->maps, node) { - list_del(&map->node); + list_for_each_entry_safe(map, m, &fl->maps, node) fastrpc_map_put(map); - } list_for_each_entry_safe(buf, b, &fl->mmaps, node) { list_del(&buf->node); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/misc/mei/bus.c +++ linux-oem-6.1-6.1.0/drivers/misc/mei/bus.c @@ -665,13 +665,15 @@ if (cl->state == MEI_FILE_UNINITIALIZED) { ret = mei_cl_link(cl); if (ret) - goto out; + goto notlinked; /* update pointers */ cl->cldev = cldev; } ret = mei_cl_dma_alloc_and_map(cl, NULL, buffer_id, size); -out: + if (ret) + mei_cl_unlink(cl); +notlinked: mutex_unlock(&bus->device_lock); if (ret) return ERR_PTR(ret); @@ -721,7 +723,7 @@ if (cl->state == MEI_FILE_UNINITIALIZED) { ret = mei_cl_link(cl); if (ret) - goto out; + goto notlinked; /* update pointers */ cl->cldev = cldev; } @@ -748,6 +750,9 @@ } out: + if (ret) + mei_cl_unlink(cl); +notlinked: mutex_unlock(&bus->device_lock); return ret; @@ -1115,7 +1120,6 @@ mei_cl_flush_queues(cldev->cl, NULL); mei_me_cl_put(cldev->me_cl); mei_dev_bus_put(cldev->bus); - mei_cl_unlink(cldev->cl); kfree(cldev->cl); kfree(cldev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/misc/mei/hw-me-regs.h +++ linux-oem-6.1-6.1.0/drivers/misc/mei/hw-me-regs.h @@ -111,6 +111,8 @@ #define MEI_DEV_ID_RPL_S 0x7A68 /* Raptor Lake Point S */ +#define MEI_DEV_ID_MTL_M 0x7E70 /* Meteor Lake Point M */ + /* * MEI HW Section */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/misc/vmw_vmci/vmci_guest.c +++ linux-oem-6.1-6.1.0/drivers/misc/vmw_vmci/vmci_guest.c @@ -56,8 +56,6 @@ bool exclusive_vectors; - struct tasklet_struct datagram_tasklet; - struct tasklet_struct bm_tasklet; struct wait_queue_head inout_wq; void *data_buffer; @@ -304,9 +302,8 @@ * This function assumes that it has exclusive access to the data * in register(s) for the duration of the call. */ -static void vmci_dispatch_dgs(unsigned long data) +static void vmci_dispatch_dgs(struct vmci_guest_device *vmci_dev) { - struct vmci_guest_device *vmci_dev = (struct vmci_guest_device *)data; u8 *dg_in_buffer = vmci_dev->data_buffer; struct vmci_datagram *dg; size_t dg_in_buffer_size = VMCI_MAX_DG_SIZE; @@ -465,10 +462,8 @@ * Scans the notification bitmap for raised flags, clears them * and handles the notifications. */ -static void vmci_process_bitmap(unsigned long data) +static void vmci_process_bitmap(struct vmci_guest_device *dev) { - struct vmci_guest_device *dev = (struct vmci_guest_device *)data; - if (!dev->notification_bitmap) { dev_dbg(dev->dev, "No bitmap present in %s\n", __func__); return; @@ -486,13 +481,13 @@ struct vmci_guest_device *dev = _dev; /* - * If we are using MSI-X with exclusive vectors then we simply schedule - * the datagram tasklet, since we know the interrupt was meant for us. + * If we are using MSI-X with exclusive vectors then we simply call + * vmci_dispatch_dgs(), since we know the interrupt was meant for us. * Otherwise we must read the ICR to determine what to do. */ if (dev->exclusive_vectors) { - tasklet_schedule(&dev->datagram_tasklet); + vmci_dispatch_dgs(dev); } else { unsigned int icr; @@ -502,12 +497,12 @@ return IRQ_NONE; if (icr & VMCI_ICR_DATAGRAM) { - tasklet_schedule(&dev->datagram_tasklet); + vmci_dispatch_dgs(dev); icr &= ~VMCI_ICR_DATAGRAM; } if (icr & VMCI_ICR_NOTIFICATION) { - tasklet_schedule(&dev->bm_tasklet); + vmci_process_bitmap(dev); icr &= ~VMCI_ICR_NOTIFICATION; } @@ -536,7 +531,7 @@ struct vmci_guest_device *dev = _dev; /* For MSI-X we can just assume it was meant for us. */ - tasklet_schedule(&dev->bm_tasklet); + vmci_process_bitmap(dev); return IRQ_HANDLED; } @@ -638,10 +633,6 @@ vmci_dev->iobase = iobase; vmci_dev->mmio_base = mmio_base; - tasklet_init(&vmci_dev->datagram_tasklet, - vmci_dispatch_dgs, (unsigned long)vmci_dev); - tasklet_init(&vmci_dev->bm_tasklet, - vmci_process_bitmap, (unsigned long)vmci_dev); init_waitqueue_head(&vmci_dev->inout_wq); if (mmio_base != NULL) { @@ -808,8 +799,9 @@ * Request IRQ for legacy or MSI interrupts, or for first * MSI-X vector. */ - error = request_irq(pci_irq_vector(pdev, 0), vmci_interrupt, - IRQF_SHARED, KBUILD_MODNAME, vmci_dev); + error = request_threaded_irq(pci_irq_vector(pdev, 0), NULL, + vmci_interrupt, IRQF_SHARED, + KBUILD_MODNAME, vmci_dev); if (error) { dev_err(&pdev->dev, "Irq %u in use: %d\n", pci_irq_vector(pdev, 0), error); @@ -823,9 +815,9 @@ * between the vectors. */ if (vmci_dev->exclusive_vectors) { - error = request_irq(pci_irq_vector(pdev, 1), - vmci_interrupt_bm, 0, KBUILD_MODNAME, - vmci_dev); + error = request_threaded_irq(pci_irq_vector(pdev, 1), NULL, + vmci_interrupt_bm, 0, + KBUILD_MODNAME, vmci_dev); if (error) { dev_err(&pdev->dev, "Failed to allocate irq %u: %d\n", @@ -833,9 +825,11 @@ goto err_free_irq; } if (caps_in_use & VMCI_CAPS_DMA_DATAGRAM) { - error = request_irq(pci_irq_vector(pdev, 2), - vmci_interrupt_dma_datagram, - 0, KBUILD_MODNAME, vmci_dev); + error = request_threaded_irq(pci_irq_vector(pdev, 2), + NULL, + vmci_interrupt_dma_datagram, + 0, KBUILD_MODNAME, + vmci_dev); if (error) { dev_err(&pdev->dev, "Failed to allocate irq %u: %d\n", @@ -871,8 +865,6 @@ err_free_irq: free_irq(pci_irq_vector(pdev, 0), vmci_dev); - tasklet_kill(&vmci_dev->datagram_tasklet); - tasklet_kill(&vmci_dev->bm_tasklet); err_disable_msi: pci_free_irq_vectors(pdev); @@ -943,9 +935,6 @@ free_irq(pci_irq_vector(pdev, 0), vmci_dev); pci_free_irq_vectors(pdev); - tasklet_kill(&vmci_dev->datagram_tasklet); - tasklet_kill(&vmci_dev->bm_tasklet); - if (vmci_dev->notification_bitmap) { /* * The device reset above cleared the bitmap state of the only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ linux-oem-6.1-6.1.0/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -3044,7 +3044,7 @@ if (!qpair || !buf) return VMCI_ERROR_INVALID_ARGS; - iov_iter_kvec(&from, WRITE, &v, 1, buf_size); + iov_iter_kvec(&from, ITER_SOURCE, &v, 1, buf_size); qp_lock(qpair); @@ -3088,7 +3088,7 @@ if (!qpair || !buf) return VMCI_ERROR_INVALID_ARGS; - iov_iter_kvec(&to, READ, &v, 1, buf_size); + iov_iter_kvec(&to, ITER_DEST, &v, 1, buf_size); qp_lock(qpair); @@ -3133,7 +3133,7 @@ if (!qpair || !buf) return VMCI_ERROR_INVALID_ARGS; - iov_iter_kvec(&to, READ, &v, 1, buf_size); + iov_iter_kvec(&to, ITER_DEST, &v, 1, buf_size); qp_lock(qpair); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/core/sdio_bus.c +++ linux-oem-6.1-6.1.0/drivers/mmc/core/sdio_bus.c @@ -294,6 +294,12 @@ if (!(func->card->quirks & MMC_QUIRK_NONSTD_SDIO)) sdio_free_func_cis(func); + /* + * We have now removed the link to the tuples in the + * card structure, so remove the reference. + */ + put_device(&func->card->dev); + kfree(func->info); kfree(func->tmpbuf); kfree(func); @@ -324,6 +330,12 @@ device_initialize(&func->dev); + /* + * We may link to tuples in the card structure, + * we need make sure we have a reference to it. + */ + get_device(&func->card->dev); + func->dev.parent = &card->dev; func->dev.bus = &sdio_bus_type; func->dev.release = sdio_release_func; @@ -377,10 +389,9 @@ */ void sdio_remove_func(struct sdio_func *func) { - if (!sdio_func_present(func)) - return; + if (sdio_func_present(func)) + device_del(&func->dev); - device_del(&func->dev); of_node_put(func->dev.of_node); put_device(&func->dev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/core/sdio_cis.c +++ linux-oem-6.1-6.1.0/drivers/mmc/core/sdio_cis.c @@ -404,12 +404,6 @@ return ret; /* - * Since we've linked to tuples in the card structure, - * we must make sure we have a reference to it. - */ - get_device(&func->card->dev); - - /* * Vendor/device id is optional for function CIS, so * copy it from the card structure as needed. */ @@ -434,11 +428,5 @@ } func->tuples = NULL; - - /* - * We have now removed the link to the tuples in the - * card structure, so remove the reference. - */ - put_device(&func->card->dev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/host/jz4740_mmc.c +++ linux-oem-6.1-6.1.0/drivers/mmc/host/jz4740_mmc.c @@ -1053,6 +1053,16 @@ mmc->ops = &jz4740_mmc_ops; if (!mmc->f_max) mmc->f_max = JZ_MMC_CLK_RATE; + + /* + * There seems to be a problem with this driver on the JZ4760 and + * JZ4760B SoCs. There, when using the maximum rate supported (50 MHz), + * the communication fails with many SD cards. + * Until this bug is sorted out, limit the maximum rate to 24 MHz. + */ + if (host->version == JZ_MMC_JZ4760 && mmc->f_max > JZ_MMC_CLK_RATE) + mmc->f_max = JZ_MMC_CLK_RATE; + mmc->f_min = mmc->f_max / 128; mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/host/mmc_spi.c +++ linux-oem-6.1-6.1.0/drivers/mmc/host/mmc_spi.c @@ -1437,7 +1437,7 @@ status = mmc_add_host(mmc); if (status != 0) - goto fail_add_host; + goto fail_glue_init; /* * Index 0 is card detect @@ -1445,7 +1445,7 @@ */ status = mmc_gpiod_request_cd(mmc, NULL, 0, false, 1000); if (status == -EPROBE_DEFER) - goto fail_add_host; + goto fail_gpiod_request; if (!status) { /* * The platform has a CD GPIO signal that may support @@ -1460,7 +1460,7 @@ /* Index 1 is write protect/read only */ status = mmc_gpiod_request_ro(mmc, NULL, 1, 0); if (status == -EPROBE_DEFER) - goto fail_add_host; + goto fail_gpiod_request; if (!status) has_ro = true; @@ -1474,7 +1474,7 @@ ? ", cd polling" : ""); return 0; -fail_add_host: +fail_gpiod_request: mmc_remove_host(mmc); fail_glue_init: mmc_spi_dma_free(host); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/host/sdhci-esdhc-imx.c +++ linux-oem-6.1-6.1.0/drivers/mmc/host/sdhci-esdhc-imx.c @@ -107,6 +107,7 @@ #define ESDHC_TUNING_START_TAP_DEFAULT 0x1 #define ESDHC_TUNING_START_TAP_MASK 0x7f #define ESDHC_TUNING_CMD_CRC_CHECK_DISABLE (1 << 7) +#define ESDHC_TUNING_STEP_DEFAULT 0x1 #define ESDHC_TUNING_STEP_MASK 0x00070000 #define ESDHC_TUNING_STEP_SHIFT 16 @@ -1361,7 +1362,7 @@ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); struct cqhci_host *cq_host = host->mmc->cqe_private; - int tmp; + u32 tmp; if (esdhc_is_usdhc(imx_data)) { /* @@ -1416,17 +1417,24 @@ if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { tmp = readl(host->ioaddr + ESDHC_TUNING_CTRL); - tmp |= ESDHC_STD_TUNING_EN | - ESDHC_TUNING_START_TAP_DEFAULT; - if (imx_data->boarddata.tuning_start_tap) { - tmp &= ~ESDHC_TUNING_START_TAP_MASK; + tmp |= ESDHC_STD_TUNING_EN; + + /* + * ROM code or bootloader may config the start tap + * and step, unmask them first. + */ + tmp &= ~(ESDHC_TUNING_START_TAP_MASK | ESDHC_TUNING_STEP_MASK); + if (imx_data->boarddata.tuning_start_tap) tmp |= imx_data->boarddata.tuning_start_tap; - } + else + tmp |= ESDHC_TUNING_START_TAP_DEFAULT; if (imx_data->boarddata.tuning_step) { - tmp &= ~ESDHC_TUNING_STEP_MASK; tmp |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; + } else { + tmp |= ESDHC_TUNING_STEP_DEFAULT + << ESDHC_TUNING_STEP_SHIFT; } /* Disable the CMD CRC check for tuning, if not, need to only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mmc/host/sunxi-mmc.c +++ linux-oem-6.1-6.1.0/drivers/mmc/host/sunxi-mmc.c @@ -1492,9 +1492,11 @@ struct sunxi_mmc_host *host = mmc_priv(mmc); mmc_remove_host(mmc); - pm_runtime_force_suspend(&pdev->dev); - disable_irq(host->irq); - sunxi_mmc_disable(host); + pm_runtime_disable(&pdev->dev); + if (!pm_runtime_status_suspended(&pdev->dev)) { + disable_irq(host->irq); + sunxi_mmc_disable(host); + } dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); mmc_free_host(mmc); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/mtd/parsers/scpart.c +++ linux-oem-6.1-6.1.0/drivers/mtd/parsers/scpart.c @@ -50,7 +50,7 @@ int cnt = 0; int res = 0; int res2; - loff_t offs; + uint32_t offs; size_t retlen; struct sc_part_desc *pdesc = NULL; struct sc_part_desc *tmpdesc; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/bonding/bond_debugfs.c +++ linux-oem-6.1-6.1.0/drivers/net/bonding/bond_debugfs.c @@ -76,7 +76,7 @@ d = debugfs_rename(bonding_debug_root, bond->debug_dir, bonding_debug_root, bond->dev->name); - if (d) { + if (!IS_ERR(d)) { bond->debug_dir = d; } else { netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c @@ -48,6 +48,7 @@ priv->rx_obj_num = layout.cur_rx; priv->rx_obj_num_coalesce_irq = layout.rx_coalesce; priv->tx->obj_num = layout.cur_tx; + priv->tx_obj_num_coalesce_irq = layout.tx_coalesce; return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/dsa/microchip/ksz9477.c +++ linux-oem-6.1-6.1.0/drivers/net/dsa/microchip/ksz9477.c @@ -548,10 +548,10 @@ ksz_read32(dev, REG_SW_ALU_VAL_D, &alu_table[3]); /* clear forwarding port */ - alu_table[2] &= ~BIT(port); + alu_table[1] &= ~BIT(port); /* if there is no port to forward, clear table */ - if ((alu_table[2] & ALU_V_PORT_MAP) == 0) { + if ((alu_table[1] & ALU_V_PORT_MAP) == 0) { alu_table[0] = 0; alu_table[1] = 0; alu_table[2] = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/dsa/microchip/ksz9477_i2c.c +++ linux-oem-6.1-6.1.0/drivers/net/dsa/microchip/ksz9477_i2c.c @@ -105,7 +105,7 @@ }, { .compatible = "microchip,ksz8563", - .data = &ksz_switch_chips[KSZ9893] + .data = &ksz_switch_chips[KSZ8563] }, { .compatible = "microchip,ksz9567", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/dsa/mt7530.c +++ linux-oem-6.1-6.1.0/drivers/net/dsa/mt7530.c @@ -1309,14 +1309,26 @@ if (!priv->ports[port].pvid) mt7530_rmw(priv, MT7530_PVC_P(port), ACC_FRM_MASK, MT7530_VLAN_ACC_TAGGED); - } - /* Set the port as a user port which is to be able to recognize VID - * from incoming packets before fetching entry within the VLAN table. - */ - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK, - VLAN_ATTR(MT7530_VLAN_USER) | - PVC_EG_TAG(MT7530_VLAN_EG_DISABLED)); + /* Set the port as a user port which is to be able to recognize + * VID from incoming packets before fetching entry within the + * VLAN table. + */ + mt7530_rmw(priv, MT7530_PVC_P(port), + VLAN_ATTR_MASK | PVC_EG_TAG_MASK, + VLAN_ATTR(MT7530_VLAN_USER) | + PVC_EG_TAG(MT7530_VLAN_EG_DISABLED)); + } else { + /* Also set CPU ports to the "user" VLAN port attribute, to + * allow VLAN classification, but keep the EG_TAG attribute as + * "consistent" (i.o.w. don't change its value) for packets + * received by the switch from the CPU, so that tagged packets + * are forwarded to user ports as tagged, and untagged as + * untagged. + */ + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK, + VLAN_ATTR(MT7530_VLAN_USER)); + } } static void only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe-dev.c @@ -524,19 +524,28 @@ netif_dbg(pdata, drv, pdata->netdev, "VXLAN acceleration disabled\n"); } +static unsigned int xgbe_get_fc_queue_count(struct xgbe_prv_data *pdata) +{ + unsigned int max_q_count = XGMAC_MAX_FLOW_CONTROL_QUEUES; + + /* From MAC ver 30H the TFCR is per priority, instead of per queue */ + if (XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) >= 0x30) + return max_q_count; + else + return min_t(unsigned int, pdata->tx_q_count, max_q_count); +} + static int xgbe_disable_tx_flow_control(struct xgbe_prv_data *pdata) { - unsigned int max_q_count, q_count; unsigned int reg, reg_val; - unsigned int i; + unsigned int i, q_count; /* Clear MTL flow control */ for (i = 0; i < pdata->rx_q_count; i++) XGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_RQOMR, EHFC, 0); /* Clear MAC flow control */ - max_q_count = XGMAC_MAX_FLOW_CONTROL_QUEUES; - q_count = min_t(unsigned int, pdata->tx_q_count, max_q_count); + q_count = xgbe_get_fc_queue_count(pdata); reg = MAC_Q0TFCR; for (i = 0; i < q_count; i++) { reg_val = XGMAC_IOREAD(pdata, reg); @@ -553,9 +562,8 @@ { struct ieee_pfc *pfc = pdata->pfc; struct ieee_ets *ets = pdata->ets; - unsigned int max_q_count, q_count; unsigned int reg, reg_val; - unsigned int i; + unsigned int i, q_count; /* Set MTL flow control */ for (i = 0; i < pdata->rx_q_count; i++) { @@ -579,8 +587,7 @@ } /* Set MAC flow control */ - max_q_count = XGMAC_MAX_FLOW_CONTROL_QUEUES; - q_count = min_t(unsigned int, pdata->tx_q_count, max_q_count); + q_count = xgbe_get_fc_queue_count(pdata); reg = MAC_Q0TFCR; for (i = 0; i < q_count; i++) { reg_val = XGMAC_IOREAD(pdata, reg); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/amd/xgbe/xgbe.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/amd/xgbe/xgbe.h @@ -290,6 +290,7 @@ /* Auto-negotiation */ #define XGBE_AN_MS_TIMEOUT 500 #define XGBE_LINK_TIMEOUT 5 +#define XGBE_KR_TRAINING_WAIT_ITER 50 #define XGBE_SGMII_AN_LINK_STATUS BIT(1) #define XGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3)) @@ -1280,6 +1281,7 @@ unsigned int parallel_detect; unsigned int fec_ability; unsigned long an_start; + unsigned long kr_start_time; enum xgbe_an_mode an_mode; /* I2C support */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/broadcom/bgmac-bcma.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bgmac-bcma.c @@ -240,12 +240,12 @@ bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1; bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY; - if (ci->pkg == BCMA_PKG_ID_BCM47188 || - ci->pkg == BCMA_PKG_ID_BCM47186) { + if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) || + (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) { bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII; bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED; } - if (ci->pkg == BCMA_PKG_ID_BCM5358) + if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358) bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII; break; case BCMA_CHIP_ID_BCM53573: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -3865,7 +3865,7 @@ test_info->timeout = HWRM_CMD_TIMEOUT; for (i = 0; i < bp->num_tests; i++) { char *str = test_info->string[i]; - char *fw_str = resp->test0_name + i * 32; + char *fw_str = resp->test_name[i]; if (i == BNXT_MACLPBK_TEST_IDX) { strcpy(str, "Mac loopback test (offline)"); @@ -3876,14 +3876,9 @@ } else if (i == BNXT_IRQ_TEST_IDX) { strcpy(str, "Interrupt_test (offline)"); } else { - strscpy(str, fw_str, ETH_GSTRING_LEN); - strncat(str, " test", ETH_GSTRING_LEN - strlen(str)); - if (test_info->offline_mask & (1 << i)) - strncat(str, " (offline)", - ETH_GSTRING_LEN - strlen(str)); - else - strncat(str, " (online)", - ETH_GSTRING_LEN - strlen(str)); + snprintf(str, ETH_GSTRING_LEN, "%s test (%s)", + fw_str, test_info->offline_mask & (1 << i) ? + "offline" : "online"); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h @@ -10099,14 +10099,7 @@ u8 unused_0; __le16 test_timeout; u8 unused_1[2]; - char test0_name[32]; - char test1_name[32]; - char test2_name[32]; - char test3_name[32]; - char test4_name[32]; - char test5_name[32]; - char test6_name[32]; - char test7_name[32]; + char test_name[8][32]; u8 eyescope_target_BER_support; #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E8_SUPPORTED 0x0UL #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E9_SUPPORTED 0x1UL only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/broadcom/tg3.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/broadcom/tg3.c @@ -11174,7 +11174,7 @@ rtnl_lock(); tg3_full_lock(tp, 0); - if (!netif_running(tp->dev)) { + if (tp->pcierr_recovery || !netif_running(tp->dev)) { tg3_flag_clear(tp, RESET_TASK_PENDING); tg3_full_unlock(tp); rtnl_unlock(); @@ -18109,6 +18109,9 @@ netdev_info(netdev, "PCI I/O error detected\n"); + /* Want to make sure that the reset task doesn't run */ + tg3_reset_task_cancel(tp); + rtnl_lock(); /* Could be second call or maybe we don't have netdev yet */ @@ -18125,9 +18128,6 @@ tg3_timer_stop(tp); - /* Want to make sure that the reset task doesn't run */ - tg3_reset_task_cancel(tp); - netif_device_detach(netdev); /* Clean up software state, even if MMIO is blocked */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/cadence/macb_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/cadence/macb_main.c @@ -2188,7 +2188,6 @@ bool cloned = skb_cloned(*skb) || skb_header_cloned(*skb) || skb_is_nonlinear(*skb); int padlen = ETH_ZLEN - (*skb)->len; - int headroom = skb_headroom(*skb); int tailroom = skb_tailroom(*skb); struct sk_buff *nskb; u32 fcs; @@ -2202,9 +2201,6 @@ /* FCS could be appeded to tailroom. */ if (tailroom >= ETH_FCS_LEN) goto add_fcs; - /* FCS could be appeded by moving data to headroom. */ - else if (!cloned && headroom + tailroom >= ETH_FCS_LEN) - padlen = 0; /* No room for FCS, need to reallocate skb. */ else padlen = ETH_FCS_LEN; @@ -2213,10 +2209,7 @@ padlen += ETH_FCS_LEN; } - if (!cloned && headroom + tailroom >= padlen) { - (*skb)->data = memmove((*skb)->head, (*skb)->data, (*skb)->len); - skb_set_tail_pointer(*skb, (*skb)->len); - } else { + if (cloned || tailroom < padlen) { nskb = skb_copy_expand(*skb, 0, padlen, GFP_ATOMIC); if (!nskb) return -ENOMEM; @@ -4621,25 +4614,26 @@ if (ret) return dev_err_probe(&pdev->dev, ret, "failed to init SGMII PHY\n"); - } - ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); - if (!ret) { - u32 pm_info[2]; - - ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", - pm_info, ARRAY_SIZE(pm_info)); - if (ret) { - dev_err(&pdev->dev, "Failed to read power management information\n"); - goto err_out_phy_exit; + ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); + if (!ret) { + u32 pm_info[2]; + + ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", + pm_info, ARRAY_SIZE(pm_info)); + if (ret) { + dev_err(&pdev->dev, "Failed to read power management information\n"); + goto err_out_phy_exit; + } + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); + if (ret) + goto err_out_phy_exit; + + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); + if (ret) + goto err_out_phy_exit; } - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); - if (ret) - goto err_out_phy_exit; - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); - if (ret) - goto err_out_phy_exit; } /* Fully reset controller at hardware level if mapped in device tree */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/engleder/tsnep_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/engleder/tsnep_main.c @@ -419,7 +419,7 @@ /* ring full, shall not happen because queue is stopped if full * below */ - netif_stop_queue(tx->adapter->netdev); + netif_stop_subqueue(tx->adapter->netdev, tx->queue_index); spin_unlock_irqrestore(&tx->lock, flags); @@ -462,7 +462,7 @@ if (tsnep_tx_desc_available(tx) < (MAX_SKB_FRAGS + 1)) { /* ring can get full with next frame */ - netif_stop_queue(tx->adapter->netdev); + netif_stop_subqueue(tx->adapter->netdev, tx->queue_index); } spin_unlock_irqrestore(&tx->lock, flags); @@ -472,11 +472,14 @@ static bool tsnep_tx_poll(struct tsnep_tx *tx, int napi_budget) { + struct tsnep_tx_entry *entry; + struct netdev_queue *nq; unsigned long flags; int budget = 128; - struct tsnep_tx_entry *entry; - int count; int length; + int count; + + nq = netdev_get_tx_queue(tx->adapter->netdev, tx->queue_index); spin_lock_irqsave(&tx->lock, flags); @@ -533,8 +536,8 @@ } while (likely(budget)); if ((tsnep_tx_desc_available(tx) >= ((MAX_SKB_FRAGS + 1) * 2)) && - netif_queue_stopped(tx->adapter->netdev)) { - netif_wake_queue(tx->adapter->netdev); + netif_tx_queue_stopped(nq)) { + netif_tx_wake_queue(nq); } spin_unlock_irqrestore(&tx->lock, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2400,6 +2400,9 @@ cleaned = qman_p_poll_dqrr(np->p, budget); + if (np->xdp_act & XDP_REDIRECT) + xdp_do_flush(); + if (cleaned < budget) { napi_complete_done(napi, cleaned); qman_p_irqsource_add(np->p, QM_PIRQ_DQRI); @@ -2407,9 +2410,6 @@ qman_p_irqsource_add(np->p, QM_PIRQ_DQRI); } - if (np->xdp_act & XDP_REDIRECT) - xdp_do_flush(); - return cleaned; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -1868,10 +1868,15 @@ if (rx_cleaned >= budget || txconf_cleaned >= DPAA2_ETH_TXCONF_PER_NAPI) { work_done = budget; + if (ch->xdp.res & XDP_REDIRECT) + xdp_do_flush(); goto out; } } while (store_cleaned); + if (ch->xdp.res & XDP_REDIRECT) + xdp_do_flush(); + /* Update NET DIM with the values for this CDAN */ dpaa2_io_update_net_dim(ch->dpio, ch->stats.frames_per_cdan, ch->stats.bytes_per_cdan); @@ -1902,9 +1907,7 @@ txc_fq->dq_bytes = 0; } - if (ch->xdp.res & XDP_REDIRECT) - xdp_do_flush_map(); - else if (rx_cleaned && ch->xdp.res & XDP_TX) + if (rx_cleaned && ch->xdp.res & XDP_TX) dpaa2_eth_xdp_tx_flush(priv, ch, &priv->fq[flowid]); return work_done; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/iavf/iavf.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/iavf/iavf.h @@ -249,6 +249,7 @@ /* board specific private data structure */ struct iavf_adapter { + struct workqueue_struct *wq; struct work_struct reset_task; struct work_struct adminq_task; struct delayed_work client_task; @@ -459,7 +460,6 @@ /* needed by iavf_ethtool.c */ extern char iavf_driver_name[]; -extern struct workqueue_struct *iavf_wq; static inline const char *iavf_state_str(enum iavf_state_t state) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -532,7 +532,7 @@ if (changed_flags & IAVF_FLAG_LEGACY_RX) { if (netif_running(netdev)) { adapter->flags |= IAVF_FLAG_RESET_NEEDED; - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); } } @@ -672,7 +672,7 @@ if (netif_running(netdev)) { adapter->flags |= IAVF_FLAG_RESET_NEEDED; - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); } return 0; @@ -1433,7 +1433,7 @@ adapter->aq_required |= IAVF_FLAG_AQ_ADD_FDIR_FILTER; spin_unlock_bh(&adapter->fdir_fltr_lock); - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); ret: if (err && fltr) @@ -1474,7 +1474,7 @@ spin_unlock_bh(&adapter->fdir_fltr_lock); if (fltr && fltr->state == IAVF_FDIR_FLTR_DEL_REQUEST) - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); return err; } @@ -1658,7 +1658,7 @@ spin_unlock_bh(&adapter->adv_rss_lock); if (!err) - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); mutex_unlock(&adapter->crit_lock); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/iavf/iavf_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -49,7 +49,6 @@ MODULE_LICENSE("GPL v2"); static const struct net_device_ops iavf_netdev_ops; -struct workqueue_struct *iavf_wq; int iavf_status_to_errno(enum iavf_status status) { @@ -277,7 +276,7 @@ if (!(adapter->flags & (IAVF_FLAG_RESET_PENDING | IAVF_FLAG_RESET_NEEDED))) { adapter->flags |= IAVF_FLAG_RESET_NEEDED; - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); } } @@ -291,7 +290,7 @@ void iavf_schedule_request_stats(struct iavf_adapter *adapter) { adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_STATS; - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); } /** @@ -411,7 +410,7 @@ if (adapter->state != __IAVF_REMOVE) /* schedule work on the private workqueue */ - queue_work(iavf_wq, &adapter->adminq_task); + queue_work(adapter->wq, &adapter->adminq_task); return IRQ_HANDLED; } @@ -1034,7 +1033,7 @@ /* schedule the watchdog task to immediately process the request */ if (f) { - queue_work(iavf_wq, &adapter->watchdog_task.work); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); return 0; } return -ENOMEM; @@ -1257,7 +1256,7 @@ adapter->aq_required |= IAVF_FLAG_AQ_ENABLE_QUEUES; if (CLIENT_ENABLED(adapter)) adapter->flags |= IAVF_FLAG_CLIENT_NEEDS_OPEN; - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); } /** @@ -1414,7 +1413,7 @@ adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; } - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); } /** @@ -2248,7 +2247,7 @@ if (aq_required) { adapter->aq_required |= aq_required; - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); } } @@ -2700,7 +2699,7 @@ adapter->aq_required = 0; adapter->current_op = VIRTCHNL_OP_UNKNOWN; mutex_unlock(&adapter->crit_lock); - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); return; } @@ -2708,31 +2707,31 @@ case __IAVF_STARTUP: iavf_startup(adapter); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(30)); return; case __IAVF_INIT_VERSION_CHECK: iavf_init_version_check(adapter); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(30)); return; case __IAVF_INIT_GET_RESOURCES: iavf_init_get_resources(adapter); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(1)); return; case __IAVF_INIT_EXTENDED_CAPS: iavf_init_process_extended_caps(adapter); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(1)); return; case __IAVF_INIT_CONFIG_ADAPTER: iavf_init_config_adapter(adapter); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(1)); return; case __IAVF_INIT_FAILED: @@ -2751,14 +2750,14 @@ adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED; iavf_shutdown_adminq(hw); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, (5 * HZ)); return; } /* Try again from failed step*/ iavf_change_state(adapter, adapter->last_state); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ); + queue_delayed_work(adapter->wq, &adapter->watchdog_task, HZ); return; case __IAVF_COMM_FAILED: if (test_bit(__IAVF_IN_REMOVE_TASK, @@ -2789,13 +2788,14 @@ adapter->aq_required = 0; adapter->current_op = VIRTCHNL_OP_UNKNOWN; mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(10)); return; case __IAVF_RESETTING: mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); + queue_delayed_work(adapter->wq, &adapter->watchdog_task, + HZ * 2); return; case __IAVF_DOWN: case __IAVF_DOWN_PENDING: @@ -2834,9 +2834,9 @@ adapter->aq_required = 0; adapter->current_op = VIRTCHNL_OP_UNKNOWN; dev_err(&adapter->pdev->dev, "Hardware reset detected\n"); - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); mutex_unlock(&adapter->crit_lock); - queue_delayed_work(iavf_wq, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, HZ * 2); return; } @@ -2845,12 +2845,13 @@ mutex_unlock(&adapter->crit_lock); restart_watchdog: if (adapter->state >= __IAVF_DOWN) - queue_work(iavf_wq, &adapter->adminq_task); + queue_work(adapter->wq, &adapter->adminq_task); if (adapter->aq_required) - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(20)); else - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); + queue_delayed_work(adapter->wq, &adapter->watchdog_task, + HZ * 2); } /** @@ -2952,7 +2953,7 @@ */ if (!mutex_trylock(&adapter->crit_lock)) { if (adapter->state != __IAVF_REMOVE) - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); goto reset_finish; } @@ -3116,7 +3117,7 @@ bitmap_clear(adapter->vsi.active_cvlans, 0, VLAN_N_VID); bitmap_clear(adapter->vsi.active_svlans, 0, VLAN_N_VID); - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 2); + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 2); /* We were running when the reset started, so we need to restore some * state here. @@ -3208,7 +3209,7 @@ if (adapter->state == __IAVF_REMOVE) return; - queue_work(iavf_wq, &adapter->adminq_task); + queue_work(adapter->wq, &adapter->adminq_task); goto out; } @@ -3850,7 +3851,7 @@ field_flags |= IAVF_CLOUD_FIELD_IIP; } else { dev_err(&adapter->pdev->dev, "Bad ip src mask 0x%08x\n", - be32_to_cpu(match.mask->dst)); + be32_to_cpu(match.mask->src)); return -EINVAL; } } @@ -4349,7 +4350,7 @@ if (netif_running(netdev)) { adapter->flags |= IAVF_FLAG_RESET_NEEDED; - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); } return 0; @@ -4898,6 +4899,13 @@ hw = &adapter->hw; hw->back = adapter; + adapter->wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + iavf_driver_name); + if (!adapter->wq) { + err = -ENOMEM; + goto err_alloc_wq; + } + adapter->msg_enable = BIT(DEFAULT_DEBUG_LEVEL_SHIFT) - 1; iavf_change_state(adapter, __IAVF_STARTUP); @@ -4942,7 +4950,7 @@ INIT_WORK(&adapter->adminq_task, iavf_adminq_task); INIT_DELAYED_WORK(&adapter->watchdog_task, iavf_watchdog_task); INIT_DELAYED_WORK(&adapter->client_task, iavf_client_task); - queue_delayed_work(iavf_wq, &adapter->watchdog_task, + queue_delayed_work(adapter->wq, &adapter->watchdog_task, msecs_to_jiffies(5 * (pdev->devfn & 0x07))); /* Setup the wait queue for indicating transition to down status */ @@ -4954,6 +4962,8 @@ return 0; err_ioremap: + destroy_workqueue(adapter->wq); +err_alloc_wq: free_netdev(netdev); err_alloc_etherdev: pci_disable_pcie_error_reporting(pdev); @@ -5023,7 +5033,7 @@ return err; } - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); netif_device_attach(adapter->netdev); @@ -5170,6 +5180,8 @@ } spin_unlock_bh(&adapter->adv_rss_lock); + destroy_workqueue(adapter->wq); + free_netdev(netdev); pci_disable_pcie_error_reporting(pdev); @@ -5196,24 +5208,11 @@ **/ static int __init iavf_init_module(void) { - int ret; - pr_info("iavf: %s\n", iavf_driver_string); pr_info("%s\n", iavf_copyright); - iavf_wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, - iavf_driver_name); - if (!iavf_wq) { - pr_err("%s: Failed to create workqueue\n", iavf_driver_name); - return -ENOMEM; - } - - ret = pci_register_driver(&iavf_driver); - if (ret) - destroy_workqueue(iavf_wq); - - return ret; + return pci_register_driver(&iavf_driver); } module_init(iavf_init_module); @@ -5227,7 +5226,6 @@ static void __exit iavf_exit_module(void) { pci_unregister_driver(&iavf_driver); - destroy_workqueue(iavf_wq); } module_exit(iavf_exit_module); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -1952,7 +1952,7 @@ if (!(adapter->flags & IAVF_FLAG_RESET_PENDING)) { adapter->flags |= IAVF_FLAG_RESET_PENDING; dev_info(&adapter->pdev->dev, "Scheduling reset task\n"); - queue_work(iavf_wq, &adapter->reset_task); + queue_work(adapter->wq, &adapter->reset_task); } break; default: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice.h @@ -856,7 +856,7 @@ void ice_set_ethtool_safe_mode_ops(struct net_device *netdev); u16 ice_get_avail_txq_count(struct ice_pf *pf); u16 ice_get_avail_rxq_count(struct ice_pf *pf); -int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx); +int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked); void ice_update_vsi_stats(struct ice_vsi *vsi); void ice_update_pf_stats(struct ice_pf *pf); void only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -434,7 +434,7 @@ goto out; } - ice_pf_dcb_recfg(pf); + ice_pf_dcb_recfg(pf, false); out: /* enable previously downed VSIs */ @@ -724,12 +724,13 @@ /** * ice_pf_dcb_recfg - Reconfigure all VEBs and VSIs * @pf: pointer to the PF struct + * @locked: is adev device lock held * * Assumed caller has already disabled all VSIs before * calling this function. Reconfiguring DCB based on * local_dcbx_cfg. */ -void ice_pf_dcb_recfg(struct ice_pf *pf) +void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked) { struct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->qos_cfg.local_dcbx_cfg; struct iidc_event *event; @@ -776,14 +777,16 @@ if (vsi->type == ICE_VSI_PF) ice_dcbnl_set_all(vsi); } - /* Notify the AUX drivers that TC change is finished */ - event = kzalloc(sizeof(*event), GFP_KERNEL); - if (!event) - return; + if (!locked) { + /* Notify the AUX drivers that TC change is finished */ + event = kzalloc(sizeof(*event), GFP_KERNEL); + if (!event) + return; - set_bit(IIDC_EVENT_AFTER_TC_CHANGE, event->type); - ice_send_event_to_aux(pf, event); - kfree(event); + set_bit(IIDC_EVENT_AFTER_TC_CHANGE, event->type); + ice_send_event_to_aux(pf, event); + kfree(event); + } } /** @@ -1034,7 +1037,7 @@ } /* changes in configuration update VSI */ - ice_pf_dcb_recfg(pf); + ice_pf_dcb_recfg(pf, false); /* enable previously downed VSIs */ ice_dcb_ena_dis_vsi(pf, true, true); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_dcb_lib.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_dcb_lib.h @@ -23,7 +23,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked); int ice_dcb_bwchk(struct ice_pf *pf, struct ice_dcbx_cfg *dcbcfg); -void ice_pf_dcb_recfg(struct ice_pf *pf); +void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked); void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi); int ice_init_pf_dcb(struct ice_pf *pf, bool locked); void ice_update_dcb_stats(struct ice_pf *pf); @@ -128,7 +128,7 @@ return 0; } -static inline void ice_pf_dcb_recfg(struct ice_pf *pf) { } +static inline void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked) { } static inline void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi) { } static inline void ice_update_dcb_stats(struct ice_pf *pf) { } static inline void only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -3472,7 +3472,9 @@ struct ice_vsi *vsi = np->vsi; struct ice_pf *pf = vsi->back; int new_rx = 0, new_tx = 0; + bool locked = false; u32 curr_combined; + int ret = 0; /* do not support changing channels in Safe Mode */ if (ice_is_safe_mode(pf)) { @@ -3536,15 +3538,33 @@ return -EINVAL; } - ice_vsi_recfg_qs(vsi, new_rx, new_tx); - - if (!netif_is_rxfh_configured(dev)) - return ice_vsi_set_dflt_rss_lut(vsi, new_rx); + if (pf->adev) { + mutex_lock(&pf->adev_mutex); + device_lock(&pf->adev->dev); + locked = true; + if (pf->adev->dev.driver) { + netdev_err(dev, "Cannot change channels when RDMA is active\n"); + ret = -EBUSY; + goto adev_unlock; + } + } + + ice_vsi_recfg_qs(vsi, new_rx, new_tx, locked); + + if (!netif_is_rxfh_configured(dev)) { + ret = ice_vsi_set_dflt_rss_lut(vsi, new_rx); + goto adev_unlock; + } /* Update rss_size due to change in Rx queues */ vsi->rss_size = ice_get_valid_rss_size(&pf->hw, new_rx); - return 0; +adev_unlock: + if (locked) { + device_unlock(&pf->adev->dev); + mutex_unlock(&pf->adev_mutex); + } + return ret; } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_gnss.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_gnss.c @@ -363,6 +363,7 @@ /* Send the data out to a hardware port */ write_buf = kzalloc(sizeof(*write_buf), GFP_KERNEL); if (!write_buf) { + kfree(cmd_buf); err = -ENOMEM; goto exit; } @@ -460,6 +461,9 @@ for (i = 0; i < ICE_GNSS_TTY_MINOR_DEVICES; i++) { pf->gnss_tty_port[i] = kzalloc(sizeof(*pf->gnss_tty_port[i]), GFP_KERNEL); + if (!pf->gnss_tty_port[i]) + goto err_out; + pf->gnss_serial[i] = NULL; tty_port_init(pf->gnss_tty_port[i]); @@ -469,21 +473,23 @@ err = tty_register_driver(tty_driver); if (err) { dev_err(dev, "Failed to register TTY driver err=%d\n", err); - - for (i = 0; i < ICE_GNSS_TTY_MINOR_DEVICES; i++) { - tty_port_destroy(pf->gnss_tty_port[i]); - kfree(pf->gnss_tty_port[i]); - } - kfree(ttydrv_name); - tty_driver_kref_put(pf->ice_gnss_tty_driver); - - return NULL; + goto err_out; } for (i = 0; i < ICE_GNSS_TTY_MINOR_DEVICES; i++) dev_info(dev, "%s%d registered\n", ttydrv_name, i); return tty_driver; + +err_out: + while (i--) { + tty_port_destroy(pf->gnss_tty_port[i]); + kfree(pf->gnss_tty_port[i]); + } + kfree(ttydrv_name); + tty_driver_kref_put(pf->ice_gnss_tty_driver); + + return NULL; } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_main.c @@ -270,6 +270,8 @@ if (status && status != -EEXIST) return status; + netdev_dbg(vsi->netdev, "set promisc filter bits for VSI %i: 0x%x\n", + vsi->vsi_num, promisc_m); return 0; } @@ -295,6 +297,8 @@ promisc_m, 0); } + netdev_dbg(vsi->netdev, "clear promisc filter bits for VSI %i: 0x%x\n", + vsi->vsi_num, promisc_m); return status; } @@ -423,6 +427,16 @@ } err = 0; vlan_ops->dis_rx_filtering(vsi); + + /* promiscuous mode implies allmulticast so + * that VSIs that are in promiscuous mode are + * subscribed to multicast packets coming to + * the port + */ + err = ice_set_promisc(vsi, + ICE_MCAST_PROMISC_BITS); + if (err) + goto out_promisc; } } else { /* Clear Rx filter to remove traffic from wire */ @@ -439,6 +453,18 @@ NETIF_F_HW_VLAN_CTAG_FILTER) vlan_ops->ena_rx_filtering(vsi); } + + /* disable allmulti here, but only if allmulti is not + * still enabled for the netdev + */ + if (!(vsi->current_netdev_flags & IFF_ALLMULTI)) { + err = ice_clear_promisc(vsi, + ICE_MCAST_PROMISC_BITS); + if (err) { + netdev_err(netdev, "Error %d clearing multicast promiscuous on VSI %i\n", + err, vsi->vsi_num); + } + } } } goto exit; @@ -4192,12 +4218,13 @@ * @vsi: VSI being changed * @new_rx: new number of Rx queues * @new_tx: new number of Tx queues + * @locked: is adev device_lock held * * Only change the number of queues if new_tx, or new_rx is non-0. * * Returns 0 on success. */ -int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx) +int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked) { struct ice_pf *pf = vsi->back; int err = 0, timeout = 50; @@ -4226,7 +4253,7 @@ ice_vsi_close(vsi); ice_vsi_rebuild(vsi, false); - ice_pf_dcb_recfg(pf); + ice_pf_dcb_recfg(pf, locked); ice_vsi_open(vsi); done: clear_bit(ICE_CFG_BUSY, pf->state); @@ -5517,7 +5544,7 @@ pr_info("%s\n", ice_driver_string); pr_info("%s\n", ice_copyright); - ice_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, KBUILD_MODNAME); + ice_wq = alloc_workqueue("%s", 0, 0, KBUILD_MODNAME); if (!ice_wq) { pr_err("Failed to create workqueue\n"); return -ENOMEM; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_switch.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_switch.c @@ -5420,7 +5420,7 @@ */ status = ice_add_special_words(rinfo, lkup_exts, ice_is_dvm_ena(hw)); if (status) - goto err_free_lkup_exts; + goto err_unroll; /* Group match words into recipes using preferred recipe grouping * criteria. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c @@ -44,13 +44,17 @@ /* outer VLAN ops regardless of port VLAN config */ vlan_ops->add_vlan = ice_vsi_add_vlan; - vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering; vlan_ops->ena_tx_filtering = ice_vsi_ena_tx_vlan_filtering; vlan_ops->dis_tx_filtering = ice_vsi_dis_tx_vlan_filtering; if (ice_vf_is_port_vlan_ena(vf)) { /* setup outer VLAN ops */ vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan; + /* all Rx traffic should be in the domain of the + * assigned port VLAN, so prevent disabling Rx VLAN + * filtering + */ + vlan_ops->dis_rx_filtering = noop_vlan; vlan_ops->ena_rx_filtering = ice_vsi_ena_rx_vlan_filtering; @@ -63,6 +67,9 @@ vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion; vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion; } else { + vlan_ops->dis_rx_filtering = + ice_vsi_dis_rx_vlan_filtering; + if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags)) vlan_ops->ena_rx_filtering = noop_vlan; else @@ -96,7 +103,14 @@ vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan; vlan_ops->ena_rx_filtering = ice_vsi_ena_rx_vlan_filtering; + /* all Rx traffic should be in the domain of the + * assigned port VLAN, so prevent disabling Rx VLAN + * filtering + */ + vlan_ops->dis_rx_filtering = noop_vlan; } else { + vlan_ops->dis_rx_filtering = + ice_vsi_dis_rx_vlan_filtering; if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags)) vlan_ops->ena_rx_filtering = noop_vlan; else only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/igc/igc_ptp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -322,7 +322,7 @@ ts = ns_to_timespec64(ns); if (rq->perout.index == 1) { if (use_freq) { - tsauxc_mask = IGC_TSAUXC_EN_CLK1; + tsauxc_mask = IGC_TSAUXC_EN_CLK1 | IGC_TSAUXC_ST1; tsim_mask = 0; } else { tsauxc_mask = IGC_TSAUXC_EN_TT1; @@ -333,7 +333,7 @@ freqout = IGC_FREQOUT1; } else { if (use_freq) { - tsauxc_mask = IGC_TSAUXC_EN_CLK0; + tsauxc_mask = IGC_TSAUXC_EN_CLK0 | IGC_TSAUXC_ST0; tsim_mask = 0; } else { tsauxc_mask = IGC_TSAUXC_EN_TT0; @@ -347,10 +347,12 @@ tsauxc = rd32(IGC_TSAUXC); tsim = rd32(IGC_TSIM); if (rq->perout.index == 1) { - tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1); + tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1 | + IGC_TSAUXC_ST1); tsim &= ~IGC_TSICR_TT1; } else { - tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0); + tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0 | + IGC_TSAUXC_ST0); tsim &= ~IGC_TSICR_TT0; } if (on) { @@ -415,10 +417,12 @@ * * We need to convert the system time value stored in the RX/TXSTMP registers * into a hwtstamp which can be used by the upper level timestamping functions. + * + * Returns 0 on success. **/ -static void igc_ptp_systim_to_hwtstamp(struct igc_adapter *adapter, - struct skb_shared_hwtstamps *hwtstamps, - u64 systim) +static int igc_ptp_systim_to_hwtstamp(struct igc_adapter *adapter, + struct skb_shared_hwtstamps *hwtstamps, + u64 systim) { switch (adapter->hw.mac.type) { case igc_i225: @@ -428,8 +432,9 @@ systim & 0xFFFFFFFF); break; default: - break; + return -EINVAL; } + return 0; } /** @@ -650,7 +655,8 @@ regval = rd32(IGC_TXSTMPL); regval |= (u64)rd32(IGC_TXSTMPH) << 32; - igc_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval); + if (igc_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval)) + return; switch (adapter->link_speed) { case SPEED_10: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ixgbe/ixgbe.h @@ -67,6 +67,8 @@ #define IXGBE_RXBUFFER_4K 4096 #define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */ +#define IXGBE_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2)) + /* Attempt to maximize the headroom available for incoming frames. We * use a 2K buffer for receives and need 1536/1534 to store the data for * the frame. This leaves us with 512 bytes of room. From that we need only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -6778,6 +6778,18 @@ } /** + * ixgbe_max_xdp_frame_size - returns the maximum allowed frame size for XDP + * @adapter: device handle, pointer to adapter + */ +static int ixgbe_max_xdp_frame_size(struct ixgbe_adapter *adapter) +{ + if (PAGE_SIZE >= 8192 || adapter->flags2 & IXGBE_FLAG2_RX_LEGACY) + return IXGBE_RXBUFFER_2K; + else + return IXGBE_RXBUFFER_3K; +} + +/** * ixgbe_change_mtu - Change the Maximum Transfer Unit * @netdev: network interface device structure * @new_mtu: new value for maximum frame size @@ -6788,18 +6800,12 @@ { struct ixgbe_adapter *adapter = netdev_priv(netdev); - if (adapter->xdp_prog) { - int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + - VLAN_HLEN; - int i; - - for (i = 0; i < adapter->num_rx_queues; i++) { - struct ixgbe_ring *ring = adapter->rx_ring[i]; + if (ixgbe_enabled_xdp_adapter(adapter)) { + int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD; - if (new_frame_size > ixgbe_rx_bufsz(ring)) { - e_warn(probe, "Requested MTU size is not supported with XDP\n"); - return -EINVAL; - } + if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) { + e_warn(probe, "Requested MTU size is not supported with XDP\n"); + return -EINVAL; } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c @@ -855,9 +855,11 @@ rp_pdev = pci_get_domain_bus_and_slot(0, 0, devfn); if (rp_pdev && rp_pdev->subordinate) { bus = rp_pdev->subordinate->number; + pci_dev_put(rp_pdev); return pci_get_domain_bus_and_slot(0, bus, 0); } + pci_dev_put(rp_pdev); return NULL; } @@ -874,6 +876,7 @@ struct ixgbe_adapter *adapter = hw->back; struct pci_dev *pdev = adapter->pdev; struct pci_dev *func0_pdev; + bool has_mii = false; /* For the C3000 family of SoCs (x550em_a) the internal ixgbe devices * are always downstream of root ports @ 0000:00:16.0 & 0000:00:17.0 @@ -884,15 +887,16 @@ func0_pdev = ixgbe_get_first_secondary_devfn(PCI_DEVFN(0x16, 0)); if (func0_pdev) { if (func0_pdev == pdev) - return true; - else - return false; + has_mii = true; + goto out; } func0_pdev = ixgbe_get_first_secondary_devfn(PCI_DEVFN(0x17, 0)); if (func0_pdev == pdev) - return true; + has_mii = true; - return false; +out: + pci_dev_put(func0_pdev); + return has_mii; } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -768,9 +768,9 @@ cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG); if (enable) - cfg |= CMR_EN | DATA_PKT_RX_EN | DATA_PKT_TX_EN; + cfg |= DATA_PKT_RX_EN | DATA_PKT_TX_EN; else - cfg &= ~(CMR_EN | DATA_PKT_RX_EN | DATA_PKT_TX_EN); + cfg &= ~(DATA_PKT_RX_EN | DATA_PKT_TX_EN); cgx_write(cgx, lmac_id, CGXX_CMRX_CFG, cfg); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/af/cgx.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/af/cgx.h @@ -30,7 +30,6 @@ #define CMR_P2X_SEL_SHIFT 59ULL #define CMR_P2X_SEL_NIX0 1ULL #define CMR_P2X_SEL_NIX1 2ULL -#define CMR_EN BIT_ULL(55) #define DATA_PKT_TX_EN BIT_ULL(53) #define DATA_PKT_RX_EN BIT_ULL(54) #define CGX_LMAC_TYPE_SHIFT 40 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c @@ -589,7 +589,7 @@ u16 pcifunc = req->hdr.pcifunc; struct mcs_rsrc_map *map; struct mcs *mcs; - int rc; + int rc = 0; if (req->mcs_id >= rvu->mcs_blk_cnt) return MCS_AF_ERR_INVALID_MCSID; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -1500,6 +1500,9 @@ BIT(DEVLINK_PARAM_CMODE_RUNTIME), rvu_af_dl_dwrr_mtu_get, rvu_af_dl_dwrr_mtu_set, rvu_af_dl_dwrr_mtu_validate), +}; + +static const struct devlink_param rvu_af_dl_param_exact_match[] = { DEVLINK_PARAM_DRIVER(RVU_AF_DEVLINK_PARAM_ID_NPC_EXACT_FEATURE_DISABLE, "npc_exact_feature_disable", DEVLINK_PARAM_TYPE_STRING, BIT(DEVLINK_PARAM_CMODE_RUNTIME), @@ -1563,7 +1566,6 @@ { struct rvu_devlink *rvu_dl; struct devlink *dl; - size_t size; int err; dl = devlink_alloc(&rvu_devlink_ops, sizeof(struct rvu_devlink), @@ -1585,21 +1587,32 @@ goto err_dl_health; } + err = devlink_params_register(dl, rvu_af_dl_params, ARRAY_SIZE(rvu_af_dl_params)); + if (err) { + dev_err(rvu->dev, + "devlink params register failed with error %d", err); + goto err_dl_health; + } + /* Register exact match devlink only for CN10K-B */ - size = ARRAY_SIZE(rvu_af_dl_params); if (!rvu_npc_exact_has_match_table(rvu)) - size -= 1; + goto done; - err = devlink_params_register(dl, rvu_af_dl_params, size); + err = devlink_params_register(dl, rvu_af_dl_param_exact_match, + ARRAY_SIZE(rvu_af_dl_param_exact_match)); if (err) { dev_err(rvu->dev, - "devlink params register failed with error %d", err); - goto err_dl_health; + "devlink exact match params register failed with error %d", err); + goto err_dl_exact_match; } +done: devlink_register(dl); return 0; +err_dl_exact_match: + devlink_params_unregister(dl, rvu_af_dl_params, ARRAY_SIZE(rvu_af_dl_params)); + err_dl_health: rvu_health_reporters_destroy(rvu); devlink_free(dl); @@ -1612,8 +1625,14 @@ struct devlink *dl = rvu_dl->dl; devlink_unregister(dl); - devlink_params_unregister(dl, rvu_af_dl_params, - ARRAY_SIZE(rvu_af_dl_params)); + + devlink_params_unregister(dl, rvu_af_dl_params, ARRAY_SIZE(rvu_af_dl_params)); + + /* Unregister exact match devlink only for CN10K-B */ + if (rvu_npc_exact_has_match_table(rvu)) + devlink_params_unregister(dl, rvu_af_dl_param_exact_match, + ARRAY_SIZE(rvu_af_dl_param_exact_match)); + rvu_health_reporters_destroy(rvu); devlink_free(dl); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -733,8 +733,10 @@ u64 ptrs[2]; ptrs[1] = buf; + get_cpu(); /* Free only one buffer at time during init and teardown */ __cn10k_aura_freeptr(pfvf, aura, ptrs, 2); + put_cpu(); } /* Alloc pointer from pool/aura */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -758,6 +758,8 @@ if (vf->otx2_wq) destroy_workqueue(vf->otx2_wq); otx2_ptp_destroy(vf); + otx2_mcam_flow_del(vf); + otx2_shutdown_tc(vf); otx2vf_disable_mbox_intr(vf); otx2_detach_resources(&vf->mbox); if (test_bit(CN10K_LMTST, &vf->hw.cap_flag)) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mediatek/mtk_ppe.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -595,8 +595,7 @@ u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; int type; - flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end), - GFP_ATOMIC); + flow_info = kzalloc(sizeof(*flow_info), GFP_ATOMIC); if (!flow_info) return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mediatek/mtk_ppe.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mediatek/mtk_ppe.h @@ -277,7 +277,6 @@ struct { struct mtk_flow_entry *base_flow; struct hlist_node list; - struct {} end; } l2_data; }; struct rhash_head node; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -2177,15 +2177,9 @@ return -EINVAL; } - cmd->stats = kvcalloc(MLX5_CMD_OP_MAX, sizeof(*cmd->stats), GFP_KERNEL); - if (!cmd->stats) - return -ENOMEM; - cmd->pool = dma_pool_create("mlx5_cmd", mlx5_core_dma_dev(dev), size, align, 0); - if (!cmd->pool) { - err = -ENOMEM; - goto dma_pool_err; - } + if (!cmd->pool) + return -ENOMEM; err = alloc_cmd_page(dev, cmd); if (err) @@ -2269,8 +2263,6 @@ err_free_pool: dma_pool_destroy(cmd->pool); -dma_pool_err: - kvfree(cmd->stats); return err; } @@ -2283,7 +2275,6 @@ destroy_msg_cache(dev); free_cmd_page(dev, cmd); dma_pool_destroy(cmd->pool); - kvfree(cmd->stats); } void mlx5_cmd_set_state(struct mlx5_core_dev *dev, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c @@ -245,8 +245,9 @@ pages = dev->priv.dbg.pages_debugfs; debugfs_create_u32("fw_pages_total", 0400, pages, &dev->priv.fw_pages); - debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.vfs_pages); - debugfs_create_u32("fw_pages_host_pf", 0400, pages, &dev->priv.host_pf_pages); + debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.page_counters[MLX5_VF]); + debugfs_create_u32("fw_pages_sfs", 0400, pages, &dev->priv.page_counters[MLX5_SF]); + debugfs_create_u32("fw_pages_host_pf", 0400, pages, &dev->priv.page_counters[MLX5_HOST_PF]); debugfs_create_u32("fw_pages_alloc_failed", 0400, pages, &dev->priv.fw_pages_alloc_failed); debugfs_create_u32("fw_pages_give_dropped", 0400, pages, &dev->priv.give_pages_dropped); debugfs_create_u32("fw_pages_reclaim_discard", 0400, pages, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -64,6 +64,7 @@ MLX5_GET(mtrc_cap, out, num_string_trace); tracer->str_db.num_string_db = MLX5_GET(mtrc_cap, out, num_string_db); tracer->owner = !!MLX5_GET(mtrc_cap, out, trace_owner); + tracer->str_db.loaded = false; for (i = 0; i < tracer->str_db.num_string_db; i++) { mtrc_cap_sp = MLX5_ADDR_OF(mtrc_cap, out, string_db_param[i]); @@ -756,6 +757,7 @@ if (err) mlx5_core_warn(dev, "FWTracer: Failed to set tracer configurations %d\n", err); + tracer->buff.consumer_index = 0; return err; } @@ -820,7 +822,6 @@ mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner); if (tracer->owner) { tracer->owner = false; - tracer->buff.consumer_index = 0; return; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/ecpf.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ecpf.c @@ -87,7 +87,7 @@ mlx5_host_pf_cleanup(dev); - err = mlx5_wait_for_pages(dev, &dev->priv.host_pf_pages); + err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_HOST_PF]); if (err) mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en/htb.c @@ -637,7 +637,7 @@ if (child->bw_share == old_bw_share) continue; - err_one = mlx5_qos_update_node(htb->mdev, child->hw_id, child->bw_share, + err_one = mlx5_qos_update_node(htb->mdev, child->bw_share, child->max_average_bw, child->hw_id); if (!err && err_one) { err = err_one; @@ -671,7 +671,7 @@ mlx5e_htb_convert_rate(htb, rate, node->parent, &bw_share); mlx5e_htb_convert_ceil(htb, ceil, &max_average_bw); - err = mlx5_qos_update_node(htb->mdev, node->parent->hw_id, bw_share, + err = mlx5_qos_update_node(htb->mdev, bw_share, max_average_bw, node->hw_id); if (err) { NL_SET_ERR_MSG_MOD(extack, "Firmware error when modifying a node."); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c @@ -438,10 +438,6 @@ switch (event) { case SWITCHDEV_FDB_ADD_TO_BRIDGE: - /* only handle the event on native eswtich of representor */ - if (!mlx5_esw_bridge_is_local(dev, rep, esw)) - break; - fdb_info = container_of(info, struct switchdev_notifier_fdb_info, info); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c @@ -477,7 +477,6 @@ struct mlx5e_sample_flow *sample_flow; struct mlx5e_sample_attr *sample_attr; struct mlx5_flow_attr *pre_attr; - u32 tunnel_id = attr->tunnel_id; struct mlx5_eswitch *esw; u32 default_tbl_id; u32 obj_id; @@ -522,7 +521,7 @@ restore_obj.sample.group_id = sample_attr->group_num; restore_obj.sample.rate = sample_attr->rate; restore_obj.sample.trunc_size = sample_attr->trunc_size; - restore_obj.sample.tunnel_id = tunnel_id; + restore_obj.sample.tunnel_id = attr->tunnel_id; err = mapping_add(esw->offloads.reg_c0_obj_pool, &restore_obj, &obj_id); if (err) goto err_obj_id; @@ -548,7 +547,7 @@ /* For decap action, do decap in the original flow table instead of the * default flow table. */ - if (tunnel_id) + if (attr->action & MLX5_FLOW_CONTEXT_ACTION_DECAP) pre_attr->action |= MLX5_FLOW_CONTEXT_ACTION_DECAP; pre_attr->modify_hdr = sample_flow->restore->modify_hdr; pre_attr->flags = MLX5_ATTR_FLAG_SAMPLE; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c @@ -88,6 +88,8 @@ struct udphdr *udp = (struct udphdr *)(buf); struct vxlanhdr *vxh; + if (tun_key->tun_flags & TUNNEL_VXLAN_OPT) + return -EOPNOTSUPP; vxh = (struct vxlanhdr *)((char *)udp + sizeof(struct udphdr)); *ip_proto = IPPROTO_UDP; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -62,6 +62,7 @@ u32 enc_key_id; u32 next_pn; sci_t sci; + ssci_t ssci; salt_t salt; struct rhash_head hash; @@ -358,7 +359,6 @@ struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_macsec_obj_attrs obj_attrs; union mlx5e_macsec_rule *macsec_rule; - struct macsec_key *key; int err; obj_attrs.next_pn = sa->next_pn; @@ -368,13 +368,9 @@ obj_attrs.aso_pdn = macsec->aso.pdn; obj_attrs.epn_state = sa->epn_state; - key = (is_tx) ? &ctx->sa.tx_sa->key : &ctx->sa.rx_sa->key; - if (sa->epn_state.epn_enabled) { - obj_attrs.ssci = (is_tx) ? cpu_to_be32((__force u32)ctx->sa.tx_sa->ssci) : - cpu_to_be32((__force u32)ctx->sa.rx_sa->ssci); - - memcpy(&obj_attrs.salt, &key->salt, sizeof(key->salt)); + obj_attrs.ssci = cpu_to_be32((__force u32)sa->ssci); + memcpy(&obj_attrs.salt, &sa->salt, sizeof(sa->salt)); } obj_attrs.replay_window = ctx->secy->replay_window; @@ -499,10 +495,11 @@ } static void update_macsec_epn(struct mlx5e_macsec_sa *sa, const struct macsec_key *key, - const pn_t *next_pn_halves) + const pn_t *next_pn_halves, ssci_t ssci) { struct mlx5e_macsec_epn_state *epn_state = &sa->epn_state; + sa->ssci = ssci; sa->salt = key->salt; epn_state->epn_enabled = 1; epn_state->epn_msb = next_pn_halves->upper; @@ -550,7 +547,8 @@ tx_sa->assoc_num = assoc_num; if (secy->xpn) - update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves); + update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves, + ctx_tx_sa->ssci); err = mlx5_create_encryption_key(mdev, ctx->sa.key, secy->key_len, MLX5_ACCEL_OBJ_MACSEC_KEY, @@ -945,7 +943,8 @@ rx_sa->fs_id = rx_sc->sc_xarray_element->fs_id; if (ctx->secy->xpn) - update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves); + update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves, + ctx_rx_sa->ssci); err = mlx5_create_encryption_key(mdev, ctx->sa.key, ctx->secy->key_len, MLX5_ACCEL_OBJ_MACSEC_KEY, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -443,7 +443,7 @@ void mlx5e_disable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc) { - if (fs->vlan->cvlan_filter_disabled) + if (!fs->vlan || fs->vlan->cvlan_filter_disabled) return; fs->vlan->cvlan_filter_disabled = true; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -2300,7 +2300,7 @@ priv = mlx5i_epriv(netdev); tstamp = &priv->tstamp; - stats = rq->stats; + stats = &priv->channel_stats[rq->ix]->rq; flags_rqpn = be32_to_cpu(cqe->flags_rqpn); g = (flags_rqpn >> 28) & 3; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -157,6 +157,7 @@ * it's different than the ht->mutex here. */ static struct lock_class_key tc_ht_lock_key; +static struct lock_class_key tc_ht_wq_key; static void mlx5e_put_flow_tunnel_id(struct mlx5e_tc_flow *flow); static void free_flow_post_acts(struct mlx5e_tc_flow *flow); @@ -1283,7 +1284,6 @@ if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) { err = mlx5e_attach_mod_hdr(priv, flow, parse_attr); - mlx5e_mod_hdr_dealloc(&parse_attr->mod_hdr_acts); if (err) return err; } @@ -1341,8 +1341,10 @@ } mutex_unlock(&tc->t_lock); - if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) + if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) { + mlx5e_mod_hdr_dealloc(&attr->parse_attr->mod_hdr_acts); mlx5e_detach_mod_hdr(priv, flow); + } if (attr->action & MLX5_FLOW_CONTEXT_ACTION_COUNT) mlx5_fc_destroy(priv->mdev, attr->counter); @@ -4970,6 +4972,7 @@ return err; lockdep_set_class(&tc->ht.mutex, &tc_ht_lock_key); + lockdep_init_map(&tc->ht.run_work.lockdep_map, "tc_ht_wq_key", &tc_ht_wq_key, 0); mapping_id = mlx5_query_nic_system_image_guid(dev); @@ -5076,6 +5079,7 @@ return err; lockdep_set_class(&tc_ht->mutex, &tc_ht_lock_key); + lockdep_init_map(&tc_ht->run_work.lockdep_map, "tc_ht_wq_key", &tc_ht_wq_key, 0); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c @@ -1715,7 +1715,7 @@ struct mlx5_esw_bridge *bridge; port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads); - if (!port || port->flags & MLX5_ESW_BRIDGE_PORT_FLAG_PEER) + if (!port) return; bridge = port->bridge; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c @@ -22,15 +22,13 @@ }; static int esw_qos_tsar_config(struct mlx5_core_dev *dev, u32 *sched_ctx, - u32 parent_ix, u32 tsar_ix, - u32 max_rate, u32 bw_share) + u32 tsar_ix, u32 max_rate, u32 bw_share) { u32 bitmask = 0; if (!MLX5_CAP_GEN(dev, qos) || !MLX5_CAP_QOS(dev, esw_scheduling)) return -EOPNOTSUPP; - MLX5_SET(scheduling_context, sched_ctx, parent_element_id, parent_ix); MLX5_SET(scheduling_context, sched_ctx, max_average_bw, max_rate); MLX5_SET(scheduling_context, sched_ctx, bw_share, bw_share); bitmask |= MODIFY_SCHEDULING_ELEMENT_IN_MODIFY_BITMASK_MAX_AVERAGE_BW; @@ -51,7 +49,7 @@ int err; err = esw_qos_tsar_config(dev, sched_ctx, - esw->qos.root_tsar_ix, group->tsar_ix, + group->tsar_ix, max_rate, bw_share); if (err) NL_SET_ERR_MSG_MOD(extack, "E-Switch modify group TSAR element failed"); @@ -67,23 +65,13 @@ struct netlink_ext_ack *extack) { u32 sched_ctx[MLX5_ST_SZ_DW(scheduling_context)] = {}; - struct mlx5_esw_rate_group *group = vport->qos.group; struct mlx5_core_dev *dev = esw->dev; - u32 parent_tsar_ix; - void *vport_elem; int err; if (!vport->qos.enabled) return -EIO; - parent_tsar_ix = group ? group->tsar_ix : esw->qos.root_tsar_ix; - MLX5_SET(scheduling_context, sched_ctx, element_type, - SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT); - vport_elem = MLX5_ADDR_OF(scheduling_context, sched_ctx, - element_attributes); - MLX5_SET(vport_element, vport_elem, vport_number, vport->vport); - - err = esw_qos_tsar_config(dev, sched_ctx, parent_tsar_ix, vport->qos.esw_tsar_ix, + err = esw_qos_tsar_config(dev, sched_ctx, vport->qos.esw_tsar_ix, max_rate, bw_share); if (err) { esw_warn(esw->dev, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -142,7 +142,7 @@ if (mlx5_esw_indir_table_decap_vport(attr)) vport = mlx5_esw_indir_table_decap_vport(attr); - if (attr && !attr->chain && esw_attr->int_port) + if (!attr->chain && esw_attr && esw_attr->int_port) metadata = mlx5e_tc_int_port_get_metadata_for_match(esw_attr->int_port); else only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c @@ -90,9 +90,21 @@ static int mlx5i_set_channels(struct net_device *dev, struct ethtool_channels *ch) { - struct mlx5e_priv *priv = mlx5i_epriv(dev); + struct mlx5i_priv *ipriv = netdev_priv(dev); + struct mlx5e_priv *epriv = mlx5i_epriv(dev); - return mlx5e_ethtool_set_channels(priv, ch); + /* rtnl lock protects from race between this ethtool op and sub + * interface ndo_init/uninit. + */ + ASSERT_RTNL(); + if (ipriv->num_sub_interfaces > 0) { + mlx5_core_warn(epriv->mdev, + "can't change number of channels for interfaces with sub interfaces (%u)\n", + ipriv->num_sub_interfaces); + return -EINVAL; + } + + return mlx5e_ethtool_set_channels(epriv, ch); } static void mlx5i_get_channels(struct net_device *dev, @@ -177,16 +189,16 @@ } } -static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) +static u32 mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) { int rate, width; rate = mlx5_ptys_rate_enum_to_int(ib_proto_oper); if (rate < 0) - return -EINVAL; + return SPEED_UNKNOWN; width = mlx5_ptys_width_enum_to_int(ib_link_width_oper); if (width < 0) - return -EINVAL; + return SPEED_UNKNOWN; return rate * width; } @@ -209,16 +221,13 @@ ethtool_link_ksettings_zero_link_mode(link_ksettings, advertising); speed = mlx5i_get_speed_settings(ib_link_width_oper, ib_proto_oper); - if (speed < 0) - return -EINVAL; + link_ksettings->base.speed = speed; + link_ksettings->base.duplex = speed == SPEED_UNKNOWN ? DUPLEX_UNKNOWN : DUPLEX_FULL; - link_ksettings->base.duplex = DUPLEX_FULL; link_ksettings->base.port = PORT_OTHER; link_ksettings->base.autoneg = AUTONEG_DISABLE; - link_ksettings->base.speed = speed; - return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h @@ -54,9 +54,11 @@ struct rdma_netdev rn; /* keep this first */ u32 qpn; bool sub_interface; + u32 num_sub_interfaces; u32 qkey; u16 pkey_index; struct mlx5i_pkey_qpn_ht *qpn_htbl; + struct net_device *parent_dev; char *mlx5e_priv[]; }; @@ -117,5 +119,9 @@ struct mlx5_av *av, u32 dqpn, u32 dqkey, bool xmit_more); void mlx5i_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats); +/* Reference management for child to parent interfaces. */ +struct net_device *mlx5i_parent_get(struct net_device *netdev); +void mlx5i_parent_put(struct net_device *netdev); + #endif /* CONFIG_MLX5_CORE_IPOIB */ #endif /* __MLX5E_IPOB_H__ */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c @@ -158,21 +158,28 @@ struct mlx5e_priv *priv = mlx5i_epriv(dev); struct mlx5i_priv *ipriv, *parent_ipriv; struct net_device *parent_dev; - int parent_ifindex; ipriv = priv->ppriv; - /* Get QPN to netdevice hash table from parent */ - parent_ifindex = dev->netdev_ops->ndo_get_iflink(dev); - parent_dev = dev_get_by_index(dev_net(dev), parent_ifindex); + /* Link to parent */ + parent_dev = mlx5i_parent_get(dev); if (!parent_dev) { mlx5_core_warn(priv->mdev, "failed to get parent device\n"); return -EINVAL; } + if (dev->num_rx_queues < parent_dev->real_num_rx_queues) { + mlx5_core_warn(priv->mdev, + "failed to create child device with rx queues [%d] less than parent's [%d]\n", + dev->num_rx_queues, + parent_dev->real_num_rx_queues); + mlx5i_parent_put(dev); + return -EINVAL; + } + + /* Get QPN to netdevice hash table from parent */ parent_ipriv = netdev_priv(parent_dev); ipriv->qpn_htbl = parent_ipriv->qpn_htbl; - dev_put(parent_dev); return mlx5i_dev_init(dev); } @@ -184,6 +191,7 @@ static void mlx5i_pkey_dev_cleanup(struct net_device *netdev) { + mlx5i_parent_put(netdev); return mlx5i_dev_cleanup(netdev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -691,7 +691,7 @@ static const struct ptp_clock_info mlx5_ptp_clock_info = { .owner = THIS_MODULE, .name = "mlx5_ptp", - .max_adj = 100000000, + .max_adj = 50000000, .n_alarm = 0, .n_ext_ts = 0, .n_per_out = 0, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -74,6 +74,14 @@ return (u32)func_id | (ec_function << 16); } +static u16 func_id_to_type(struct mlx5_core_dev *dev, u16 func_id, bool ec_function) +{ + if (!func_id) + return mlx5_core_is_ecpf(dev) && !ec_function ? MLX5_HOST_PF : MLX5_PF; + + return func_id <= mlx5_core_max_vfs(dev) ? MLX5_VF : MLX5_SF; +} + static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function) { struct rb_root *root; @@ -332,6 +340,7 @@ u32 out[MLX5_ST_SZ_DW(manage_pages_out)] = {0}; int inlen = MLX5_ST_SZ_BYTES(manage_pages_in); int notify_fail = event; + u16 func_type; u64 addr; int err; u32 *in; @@ -383,11 +392,9 @@ goto out_dropped; } + func_type = func_id_to_type(dev, func_id, ec_function); + dev->priv.page_counters[func_type] += npages; dev->priv.fw_pages += npages; - if (func_id) - dev->priv.vfs_pages += npages; - else if (mlx5_core_is_ecpf(dev) && !ec_function) - dev->priv.host_pf_pages += npages; mlx5_core_dbg(dev, "npages %d, ec_function %d, func_id 0x%x, err %d\n", npages, ec_function, func_id, err); @@ -414,6 +421,7 @@ struct rb_root *root; struct rb_node *p; int npages = 0; + u16 func_type; root = xa_load(&dev->priv.page_root_xa, function); if (WARN_ON_ONCE(!root)) @@ -428,11 +436,9 @@ free_fwp(dev, fwp, fwp->free_count); } + func_type = func_id_to_type(dev, func_id, ec_function); + dev->priv.page_counters[func_type] -= npages; dev->priv.fw_pages -= npages; - if (func_id) - dev->priv.vfs_pages -= npages; - else if (mlx5_core_is_ecpf(dev) && !ec_function) - dev->priv.host_pf_pages -= npages; mlx5_core_dbg(dev, "npages %d, ec_function %d, func_id 0x%x\n", npages, ec_function, func_id); @@ -498,6 +504,7 @@ int outlen = MLX5_ST_SZ_BYTES(manage_pages_out); u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {}; int num_claimed; + u16 func_type; u32 *out; int err; int i; @@ -549,11 +556,9 @@ if (nclaimed) *nclaimed = num_claimed; + func_type = func_id_to_type(dev, func_id, ec_function); + dev->priv.page_counters[func_type] -= num_claimed; dev->priv.fw_pages -= num_claimed; - if (func_id) - dev->priv.vfs_pages -= num_claimed; - else if (mlx5_core_is_ecpf(dev) && !ec_function) - dev->priv.host_pf_pages -= num_claimed; out_free: kvfree(out); @@ -706,12 +711,12 @@ WARN(dev->priv.fw_pages, "FW pages counter is %d after reclaiming all pages\n", dev->priv.fw_pages); - WARN(dev->priv.vfs_pages, + WARN(dev->priv.page_counters[MLX5_VF], "VFs FW pages counter is %d after reclaiming all pages\n", - dev->priv.vfs_pages); - WARN(dev->priv.host_pf_pages, + dev->priv.page_counters[MLX5_VF]); + WARN(dev->priv.page_counters[MLX5_HOST_PF], "External host PF FW pages counter is %d after reclaiming all pages\n", - dev->priv.host_pf_pages); + dev->priv.page_counters[MLX5_HOST_PF]); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/qos.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/qos.c @@ -62,13 +62,12 @@ return mlx5_qos_create_inner_node(mdev, MLX5_QOS_DEFAULT_DWRR_UID, 0, 0, id); } -int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 parent_id, +int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 bw_share, u32 max_avg_bw, u32 id) { u32 sched_ctx[MLX5_ST_SZ_DW(scheduling_context)] = {0}; u32 bitmask = 0; - MLX5_SET(scheduling_context, sched_ctx, parent_element_id, parent_id); MLX5_SET(scheduling_context, sched_ctx, bw_share, bw_share); MLX5_SET(scheduling_context, sched_ctx, max_average_bw, max_avg_bw); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/qos.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/qos.h @@ -23,7 +23,7 @@ int mlx5_qos_create_inner_node(struct mlx5_core_dev *mdev, u32 parent_id, u32 bw_share, u32 max_avg_bw, u32 *id); int mlx5_qos_create_root_node(struct mlx5_core_dev *mdev, u32 *id); -int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 parent_id, u32 bw_share, +int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 bw_share, u32 max_avg_bw, u32 id); int mlx5_qos_destroy_node(struct mlx5_core_dev *mdev, u32 id); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -147,7 +147,7 @@ mlx5_eswitch_disable_sriov(dev->priv.eswitch, clear_vf); - if (mlx5_wait_for_pages(dev, &dev->priv.vfs_pages)) + if (mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF])) mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1022,11 +1022,6 @@ lan966x->base_mac[5] &= 0xf0; } - ports = device_get_named_child_node(&pdev->dev, "ethernet-ports"); - if (!ports) - return dev_err_probe(&pdev->dev, -ENODEV, - "no ethernet-ports child found\n"); - err = lan966x_create_targets(pdev, lan966x); if (err) return dev_err_probe(&pdev->dev, err, @@ -1104,6 +1099,11 @@ } } + ports = device_get_named_child_node(&pdev->dev, "ethernet-ports"); + if (!ports) + return dev_err_probe(&pdev->dev, -ENODEV, + "no ethernet-ports child found\n"); + /* init switch */ lan966x_init(lan966x); lan966x_stats_init(lan966x); @@ -1138,6 +1138,8 @@ lan966x_port_init(lan966x->ports[p]); } + fwnode_handle_put(ports); + lan966x_mdb_init(lan966x); err = lan966x_fdb_init(lan966x); if (err) @@ -1160,6 +1162,7 @@ lan966x_fdb_deinit(lan966x); cleanup_ports: + fwnode_handle_put(ports); fwnode_handle_put(portnp); lan966x_cleanup_ports(lan966x); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c @@ -853,6 +853,9 @@ struct lan966x_port *port; int i; + if (!lan966x->ptp) + return; + for (i = 0; i < lan966x->num_phys_ports; i++) { port = lan966x->ports[i]; if (!port) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c @@ -633,7 +633,7 @@ /* Enable master counters */ spx5_wr(PTP_PTP_DOM_CFG_PTP_ENA_SET(0x7), sparx5, PTP_PTP_DOM_CFG); - for (i = 0; i < sparx5->port_count; i++) { + for (i = 0; i < SPX5_PORTS; i++) { port = sparx5->ports[i]; if (!port) continue; @@ -649,7 +649,7 @@ struct sparx5_port *port; int i; - for (i = 0; i < sparx5->port_count; i++) { + for (i = 0; i < SPX5_PORTS; i++) { port = sparx5->ports[i]; if (!port) continue; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/microsoft/mana/gdma.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/microsoft/mana/gdma.h @@ -324,9 +324,12 @@ }; }; +#define MANA_IRQ_NAME_SZ 32 + struct gdma_irq_context { void (*handler)(void *arg); void *arg; + char name[MANA_IRQ_NAME_SZ]; }; struct gdma_context { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -1233,13 +1233,20 @@ gic->handler = NULL; gic->arg = NULL; + if (!i) + snprintf(gic->name, MANA_IRQ_NAME_SZ, "mana_hwc@pci:%s", + pci_name(pdev)); + else + snprintf(gic->name, MANA_IRQ_NAME_SZ, "mana_q%d@pci:%s", + i - 1, pci_name(pdev)); + irq = pci_irq_vector(pdev, i); if (irq < 0) { err = irq; goto free_irq; } - err = request_irq(irq, mana_gd_intr, 0, "mana_intr", gic); + err = request_irq(irq, mana_gd_intr, 0, gic->name, gic); if (err) goto free_irq; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mscc/ocelot_flower.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mscc/ocelot_flower.c @@ -605,6 +605,18 @@ flow_rule_match_control(rule, &match); } + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { + struct flow_match_vlan match; + + flow_rule_match_vlan(rule, &match); + filter->key_type = OCELOT_VCAP_KEY_ANY; + filter->vlan.vid.value = match.key->vlan_id; + filter->vlan.vid.mask = match.mask->vlan_id; + filter->vlan.pcp.value[0] = match.key->vlan_priority; + filter->vlan.pcp.mask[0] = match.mask->vlan_priority; + match_protocol = false; + } + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { struct flow_match_eth_addrs match; @@ -737,18 +749,6 @@ match_protocol = false; } - if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { - struct flow_match_vlan match; - - flow_rule_match_vlan(rule, &match); - filter->key_type = OCELOT_VCAP_KEY_ANY; - filter->vlan.vid.value = match.key->vlan_id; - filter->vlan.vid.mask = match.mask->vlan_id; - filter->vlan.pcp.value[0] = match.key->vlan_priority; - filter->vlan.pcp.mask[0] = match.mask->vlan_priority; - match_protocol = false; - } - finished_key_parsing: if (match_protocol && proto != ETH_P_ALL) { if (filter->block_id == VCAP_ES0) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/mscc/ocelot_ptp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/mscc/ocelot_ptp.c @@ -335,8 +335,8 @@ ocelot_populate_ipv6_ptp_event_trap_key(struct ocelot_vcap_filter *trap) { trap->key_type = OCELOT_VCAP_KEY_IPV6; - trap->key.ipv4.proto.value[0] = IPPROTO_UDP; - trap->key.ipv4.proto.mask[0] = 0xff; + trap->key.ipv6.proto.value[0] = IPPROTO_UDP; + trap->key.ipv6.proto.mask[0] = 0xff; trap->key.ipv6.dport.value = PTP_EV_PORT; trap->key.ipv6.dport.mask = 0xffff; } @@ -355,8 +355,8 @@ ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap) { trap->key_type = OCELOT_VCAP_KEY_IPV6; - trap->key.ipv4.proto.value[0] = IPPROTO_UDP; - trap->key.ipv4.proto.mask[0] = 0xff; + trap->key.ipv6.proto.value[0] = IPPROTO_UDP; + trap->key.ipv6.proto.mask[0] = 0xff; trap->key.ipv6.dport.value = PTP_GEN_PORT; trap->key.ipv6.dport.mask = 0xffff; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfp_main.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfp_main.h @@ -28,6 +28,7 @@ struct nfp_mip; struct nfp_net; struct nfp_nsp_identify; +struct nfp_eth_media_buf; struct nfp_port; struct nfp_rtsym; struct nfp_rtsym_table; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -293,6 +293,182 @@ } } +static const struct nfp_eth_media_link_mode { + u16 ethtool_link_mode; + u16 speed; +} nfp_eth_media_table[NFP_MEDIA_LINK_MODES_NUMBER] = { + [NFP_MEDIA_1000BASE_CX] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, + .speed = NFP_SPEED_1G, + }, + [NFP_MEDIA_1000BASE_KX] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, + .speed = NFP_SPEED_1G, + }, + [NFP_MEDIA_10GBASE_KX4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_10GBASE_KR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKR_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_10GBASE_CX4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_10GBASE_CR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseCR_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_10GBASE_SR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseSR_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_10GBASE_ER] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseER_Full_BIT, + .speed = NFP_SPEED_10G, + }, + [NFP_MEDIA_25GBASE_KR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, + .speed = NFP_SPEED_25G, + }, + [NFP_MEDIA_25GBASE_KR_S] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, + .speed = NFP_SPEED_25G, + }, + [NFP_MEDIA_25GBASE_CR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, + .speed = NFP_SPEED_25G, + }, + [NFP_MEDIA_25GBASE_CR_S] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, + .speed = NFP_SPEED_25G, + }, + [NFP_MEDIA_25GBASE_SR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseSR_Full_BIT, + .speed = NFP_SPEED_25G, + }, + [NFP_MEDIA_40GBASE_CR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT, + .speed = NFP_SPEED_40G, + }, + [NFP_MEDIA_40GBASE_KR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT, + .speed = NFP_SPEED_40G, + }, + [NFP_MEDIA_40GBASE_SR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT, + .speed = NFP_SPEED_40G, + }, + [NFP_MEDIA_40GBASE_LR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT, + .speed = NFP_SPEED_40G, + }, + [NFP_MEDIA_50GBASE_KR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseKR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_50GBASE_SR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseSR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_50GBASE_CR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseCR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_50GBASE_LR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_50GBASE_ER] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_50GBASE_FR] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, + .speed = NFP_SPEED_50G, + }, + [NFP_MEDIA_100GBASE_KR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, + .speed = NFP_SPEED_100G, + }, + [NFP_MEDIA_100GBASE_SR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT, + .speed = NFP_SPEED_100G, + }, + [NFP_MEDIA_100GBASE_CR4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, + .speed = NFP_SPEED_100G, + }, + [NFP_MEDIA_100GBASE_KP4] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, + .speed = NFP_SPEED_100G, + }, + [NFP_MEDIA_100GBASE_CR10] = { + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, + .speed = NFP_SPEED_100G, + }, +}; + +static const unsigned int nfp_eth_speed_map[NFP_SUP_SPEED_NUMBER] = { + [NFP_SPEED_1G] = SPEED_1000, + [NFP_SPEED_10G] = SPEED_10000, + [NFP_SPEED_25G] = SPEED_25000, + [NFP_SPEED_40G] = SPEED_40000, + [NFP_SPEED_50G] = SPEED_50000, + [NFP_SPEED_100G] = SPEED_100000, +}; + +static void nfp_add_media_link_mode(struct nfp_port *port, + struct nfp_eth_table_port *eth_port, + struct ethtool_link_ksettings *cmd) +{ + u64 supported_modes[2], advertised_modes[2]; + struct nfp_eth_media_buf ethm = { + .eth_index = eth_port->eth_index, + }; + struct nfp_cpp *cpp = port->app->cpp; + + if (nfp_eth_read_media(cpp, ðm)) { + bitmap_fill(port->speed_bitmap, NFP_SUP_SPEED_NUMBER); + return; + } + + bitmap_zero(port->speed_bitmap, NFP_SUP_SPEED_NUMBER); + + for (u32 i = 0; i < 2; i++) { + supported_modes[i] = le64_to_cpu(ethm.supported_modes[i]); + advertised_modes[i] = le64_to_cpu(ethm.advertised_modes[i]); + } + + for (u32 i = 0; i < NFP_MEDIA_LINK_MODES_NUMBER; i++) { + if (i < 64) { + if (supported_modes[0] & BIT_ULL(i)) { + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, + cmd->link_modes.supported); + __set_bit(nfp_eth_media_table[i].speed, + port->speed_bitmap); + } + + if (advertised_modes[0] & BIT_ULL(i)) + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, + cmd->link_modes.advertising); + } else { + if (supported_modes[1] & BIT_ULL(i - 64)) { + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, + cmd->link_modes.supported); + __set_bit(nfp_eth_media_table[i].speed, + port->speed_bitmap); + } + + if (advertised_modes[1] & BIT_ULL(i - 64)) + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, + cmd->link_modes.advertising); + } + } +} + /** * nfp_net_get_link_ksettings - Get Link Speed settings * @netdev: network interface device structure @@ -311,6 +487,8 @@ u16 sts; /* Init to unknowns */ + ethtool_link_ksettings_zero_link_mode(cmd, supported); + ethtool_link_ksettings_zero_link_mode(cmd, advertising); ethtool_link_ksettings_add_link_mode(cmd, supported, FIBRE); cmd->base.port = PORT_OTHER; cmd->base.speed = SPEED_UNKNOWN; @@ -321,6 +499,7 @@ if (eth_port) { ethtool_link_ksettings_add_link_mode(cmd, supported, Pause); ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause); + nfp_add_media_link_mode(port, eth_port, cmd); if (eth_port->supp_aneg) { ethtool_link_ksettings_add_link_mode(cmd, supported, Autoneg); if (eth_port->aneg == NFP_ANEG_AUTO) { @@ -395,6 +574,22 @@ if (cmd->base.speed != SPEED_UNKNOWN) { u32 speed = cmd->base.speed / eth_port->lanes; + bool is_supported = false; + + for (u32 i = 0; i < NFP_SUP_SPEED_NUMBER; i++) { + if (cmd->base.speed == nfp_eth_speed_map[i] && + test_bit(i, port->speed_bitmap)) { + is_supported = true; + break; + } + } + + if (!is_supported) { + netdev_err(netdev, "Speed %u is not supported.\n", + cmd->base.speed); + err = -EINVAL; + goto err_bad_set; + } if (req_aneg) { netdev_err(netdev, "Speed changing is not allowed when working on autoneg mode.\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfp_port.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfp_port.h @@ -38,6 +38,16 @@ NFP_PORT_CHANGED = 0, }; +enum { + NFP_SPEED_1G, + NFP_SPEED_10G, + NFP_SPEED_25G, + NFP_SPEED_40G, + NFP_SPEED_50G, + NFP_SPEED_100G, + NFP_SUP_SPEED_NUMBER +}; + /** * struct nfp_port - structure representing NFP port * @netdev: backpointer to associated netdev @@ -52,6 +62,7 @@ * @eth_forced: for %NFP_PORT_PHYS_PORT port is forced UP or DOWN, don't change * @eth_port: for %NFP_PORT_PHYS_PORT translated ETH Table port entry * @eth_stats: for %NFP_PORT_PHYS_PORT MAC stats if available + * @speed_bitmap: for %NFP_PORT_PHYS_PORT supported speed bitmap * @pf_id: for %NFP_PORT_PF_PORT, %NFP_PORT_VF_PORT ID of the PCI PF (0-3) * @vf_id: for %NFP_PORT_VF_PORT ID of the PCI VF within @pf_id * @pf_split: for %NFP_PORT_PF_PORT %true if PCI PF has more than one vNIC @@ -78,6 +89,7 @@ bool eth_forced; struct nfp_eth_table_port *eth_port; u8 __iomem *eth_stats; + DECLARE_BITMAP(speed_bitmap, NFP_SUP_SPEED_NUMBER); }; /* NFP_PORT_PF_PORT, NFP_PORT_VF_PORT */ struct { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c @@ -100,6 +100,7 @@ SPCODE_FW_LOADED = 19, /* Is application firmware loaded */ SPCODE_VERSIONS = 21, /* Report FW versions */ SPCODE_READ_SFF_EEPROM = 22, /* Read module EEPROM */ + SPCODE_READ_MEDIA = 23, /* Get either the supported or advertised media for a port */ }; struct nfp_nsp_dma_buf { @@ -1100,4 +1101,20 @@ kfree(buf); return ret; +}; + +int nfp_nsp_read_media(struct nfp_nsp *state, void *buf, unsigned int size) +{ + struct nfp_nsp_command_buf_arg media = { + { + .code = SPCODE_READ_MEDIA, + .option = size, + }, + .in_buf = buf, + .in_size = size, + .out_buf = buf, + .out_size = size, + }; + + return nfp_nsp_command_buf(state, &media); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h @@ -65,6 +65,11 @@ return nfp_nsp_get_abi_ver_minor(state) > 28; } +static inline bool nfp_nsp_has_read_media(struct nfp_nsp *state) +{ + return nfp_nsp_get_abi_ver_minor(state) > 33; +} + enum nfp_eth_interface { NFP_INTERFACE_NONE = 0, NFP_INTERFACE_SFP = 1, @@ -97,6 +102,47 @@ NFP_FEC_DISABLED_BIT, }; +/* link modes about RJ45 haven't been used, so there's no mapping to them */ +enum nfp_ethtool_link_mode_list { + NFP_MEDIA_W0_RJ45_10M, + NFP_MEDIA_W0_RJ45_10M_HD, + NFP_MEDIA_W0_RJ45_100M, + NFP_MEDIA_W0_RJ45_100M_HD, + NFP_MEDIA_W0_RJ45_1G, + NFP_MEDIA_W0_RJ45_2P5G, + NFP_MEDIA_W0_RJ45_5G, + NFP_MEDIA_W0_RJ45_10G, + NFP_MEDIA_1000BASE_CX, + NFP_MEDIA_1000BASE_KX, + NFP_MEDIA_10GBASE_KX4, + NFP_MEDIA_10GBASE_KR, + NFP_MEDIA_10GBASE_CX4, + NFP_MEDIA_10GBASE_CR, + NFP_MEDIA_10GBASE_SR, + NFP_MEDIA_10GBASE_ER, + NFP_MEDIA_25GBASE_KR, + NFP_MEDIA_25GBASE_KR_S, + NFP_MEDIA_25GBASE_CR, + NFP_MEDIA_25GBASE_CR_S, + NFP_MEDIA_25GBASE_SR, + NFP_MEDIA_40GBASE_CR4, + NFP_MEDIA_40GBASE_KR4, + NFP_MEDIA_40GBASE_SR4, + NFP_MEDIA_40GBASE_LR4, + NFP_MEDIA_50GBASE_KR, + NFP_MEDIA_50GBASE_SR, + NFP_MEDIA_50GBASE_CR, + NFP_MEDIA_50GBASE_LR, + NFP_MEDIA_50GBASE_ER, + NFP_MEDIA_50GBASE_FR, + NFP_MEDIA_100GBASE_KR4, + NFP_MEDIA_100GBASE_SR4, + NFP_MEDIA_100GBASE_CR4, + NFP_MEDIA_100GBASE_KP4, + NFP_MEDIA_100GBASE_CR10, + NFP_MEDIA_LINK_MODES_NUMBER +}; + #define NFP_FEC_AUTO BIT(NFP_FEC_AUTO_BIT) #define NFP_FEC_BASER BIT(NFP_FEC_BASER_BIT) #define NFP_FEC_REED_SOLOMON BIT(NFP_FEC_REED_SOLOMON_BIT) @@ -256,6 +302,16 @@ int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val); +struct nfp_eth_media_buf { + u8 eth_index; + u8 reserved[7]; + __le64 supported_modes[2]; + __le64 advertised_modes[2]; +}; + +int nfp_nsp_read_media(struct nfp_nsp *state, void *buf, unsigned int size); +int nfp_eth_read_media(struct nfp_cpp *cpp, struct nfp_eth_media_buf *ethm); + #define NFP_NSP_VERSION_BUFSZ 1024 /* reasonable size, not in the ABI */ enum nfp_nsp_versions { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c @@ -647,3 +647,29 @@ return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES); } + +int nfp_eth_read_media(struct nfp_cpp *cpp, struct nfp_eth_media_buf *ethm) +{ + struct nfp_nsp *nsp; + int ret; + + nsp = nfp_nsp_open(cpp); + if (IS_ERR(nsp)) { + nfp_err(cpp, "Failed to access the NSP: %pe\n", nsp); + return PTR_ERR(nsp); + } + + if (!nfp_nsp_has_read_media(nsp)) { + nfp_warn(cpp, "Reading media link modes not supported. Please update flash\n"); + ret = -EOPNOTSUPP; + goto exit_close_nsp; + } + + ret = nfp_nsp_read_media(nsp, ethm, sizeof(*ethm)); + if (ret) + nfp_err(cpp, "Reading media link modes failed: %pe\n", ERR_PTR(ret)); + +exit_close_nsp: + nfp_nsp_close(nsp); + return ret; +} only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -694,9 +694,16 @@ q->lif->index, q->name, q->hw_type, q->hw_index, q->head_idx, ring_doorbell); - if (ring_doorbell) + if (ring_doorbell) { ionic_dbell_ring(lif->kern_dbpage, q->hw_type, q->dbval | q->head_idx); + + q->dbell_jiffies = jiffies; + + if (q_to_qcq(q)->napi_qcq) + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); + } } static bool ionic_q_is_posted(struct ionic_queue *q, unsigned int pos) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -25,6 +25,12 @@ #define IONIC_DEV_INFO_REG_COUNT 32 #define IONIC_DEV_CMD_REG_COUNT 32 +#define IONIC_NAPI_DEADLINE (HZ / 200) /* 5ms */ +#define IONIC_ADMIN_DOORBELL_DEADLINE (HZ / 2) /* 500ms */ +#define IONIC_TX_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ +#define IONIC_RX_MIN_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ +#define IONIC_RX_MAX_DOORBELL_DEADLINE (HZ * 5) /* 5s */ + struct ionic_dev_bar { void __iomem *vaddr; phys_addr_t bus_addr; @@ -214,6 +220,8 @@ struct ionic_lif *lif; struct ionic_desc_info *info; u64 dbval; + unsigned long dbell_deadline; + unsigned long dbell_jiffies; u16 head_idx; u16 tail_idx; unsigned int index; @@ -358,4 +366,8 @@ int ionic_heartbeat_check(struct ionic *ionic); bool ionic_is_fw_running(struct ionic_dev *idev); +bool ionic_adminq_poke_doorbell(struct ionic_queue *q); +bool ionic_txq_poke_doorbell(struct ionic_queue *q); +bool ionic_rxq_poke_doorbell(struct ionic_queue *q); + #endif /* _IONIC_DEV_H_ */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -16,6 +16,7 @@ #include "ionic.h" #include "ionic_bus.h" +#include "ionic_dev.h" #include "ionic_lif.h" #include "ionic_txrx.h" #include "ionic_ethtool.h" @@ -200,6 +201,13 @@ } } +static void ionic_napi_deadline(struct timer_list *timer) +{ + struct ionic_qcq *qcq = container_of(timer, struct ionic_qcq, napi_deadline); + + napi_schedule(&qcq->napi); +} + static irqreturn_t ionic_isr(int irq, void *data) { struct napi_struct *napi = data; @@ -269,6 +277,7 @@ .oper = IONIC_Q_ENABLE, }, }; + int ret; idev = &lif->ionic->idev; dev = lif->ionic->dev; @@ -276,16 +285,24 @@ dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n", ctx.cmd.q_control.index, ctx.cmd.q_control.type); + if (qcq->flags & IONIC_QCQ_F_INTR) + ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); + + ret = ionic_adminq_post_wait(lif, &ctx); + if (ret) + return ret; + + if (qcq->napi.poll) + napi_enable(&qcq->napi); + if (qcq->flags & IONIC_QCQ_F_INTR) { irq_set_affinity_hint(qcq->intr.vector, &qcq->intr.affinity_mask); - napi_enable(&qcq->napi); - ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); ionic_intr_mask(idev->intr_ctrl, qcq->intr.index, IONIC_INTR_MASK_CLEAR); } - return ionic_adminq_post_wait(lif, &ctx); + return 0; } static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err) @@ -316,6 +333,7 @@ synchronize_irq(qcq->intr.vector); irq_set_affinity_hint(qcq->intr.vector, NULL); napi_disable(&qcq->napi); + del_timer_sync(&qcq->napi_deadline); } /* If there was a previous fw communcation error, don't bother with @@ -451,6 +469,7 @@ n_qcq->intr.vector = src_qcq->intr.vector; n_qcq->intr.index = src_qcq->intr.index; + n_qcq->napi_qcq = src_qcq->napi_qcq; } static int ionic_alloc_qcq_interrupt(struct ionic_lif *lif, struct ionic_qcq *qcq) @@ -773,8 +792,14 @@ dev_dbg(dev, "txq->hw_type %d\n", q->hw_type); dev_dbg(dev, "txq->hw_index %d\n", q->hw_index); - if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) + q->dbell_deadline = IONIC_TX_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + + if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) { netif_napi_add(lif->netdev, &qcq->napi, ionic_tx_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + } qcq->flags |= IONIC_QCQ_F_INITED; @@ -828,11 +853,17 @@ dev_dbg(dev, "rxq->hw_type %d\n", q->hw_type); dev_dbg(dev, "rxq->hw_index %d\n", q->hw_index); + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) netif_napi_add(lif->netdev, &qcq->napi, ionic_rx_napi); else netif_napi_add(lif->netdev, &qcq->napi, ionic_txrx_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + qcq->flags |= IONIC_QCQ_F_INITED; return 0; @@ -1150,6 +1181,7 @@ struct ionic_dev *idev = &lif->ionic->idev; unsigned long irqflags; unsigned int flags = 0; + bool resched = false; int rx_work = 0; int tx_work = 0; int n_work = 0; @@ -1187,6 +1219,16 @@ ionic_intr_credits(idev->intr_ctrl, intr->index, credits, flags); } + if (!a_work && ionic_adminq_poke_doorbell(&lif->adminqcq->q)) + resched = true; + if (lif->hwstamp_rxq && !rx_work && ionic_rxq_poke_doorbell(&lif->hwstamp_rxq->q)) + resched = true; + if (lif->hwstamp_txq && !tx_work && ionic_txq_poke_doorbell(&lif->hwstamp_txq->q)) + resched = true; + if (resched) + mod_timer(&lif->adminqcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); + return work_done; } @@ -3166,8 +3208,14 @@ dev_dbg(dev, "adminq->hw_type %d\n", q->hw_type); dev_dbg(dev, "adminq->hw_index %d\n", q->hw_index); + q->dbell_deadline = IONIC_ADMIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + netif_napi_add(lif->netdev, &qcq->napi, ionic_adminq_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + napi_enable(&qcq->napi); if (qcq->flags & IONIC_QCQ_F_INTR) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -74,8 +74,10 @@ struct ionic_queue q; struct ionic_cq cq; struct ionic_intr_info intr; + struct timer_list napi_deadline; struct napi_struct napi; unsigned int flags; + struct ionic_qcq *napi_qcq; struct dentry *dentry; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -289,6 +289,35 @@ complete_all(&ctx->work); } +bool ionic_adminq_poke_doorbell(struct ionic_queue *q) +{ + struct ionic_lif *lif = q->lif; + unsigned long now, then, dif; + unsigned long irqflags; + + spin_lock_irqsave(&lif->adminq_lock, irqflags); + + if (q->tail_idx == q->head_idx) { + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + return false; + } + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + } + + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + + return true; +} + int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) { struct ionic_desc_info *desc_info; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -22,6 +22,67 @@ ionic_q_post(q, ring_dbell, cb_func, cb_arg); } +bool ionic_txq_poke_doorbell(struct ionic_queue *q) +{ + unsigned long now, then, dif; + struct netdev_queue *netdev_txq; + struct net_device *netdev; + + netdev = q->lif->netdev; + netdev_txq = netdev_get_tx_queue(netdev, q->index); + + HARD_TX_LOCK(netdev, netdev_txq, smp_processor_id()); + + if (q->tail_idx == q->head_idx) { + HARD_TX_UNLOCK(netdev, netdev_txq); + return false; + } + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + } + + HARD_TX_UNLOCK(netdev, netdev_txq); + + return true; +} + +bool ionic_rxq_poke_doorbell(struct ionic_queue *q) +{ + unsigned long now, then, dif; + + /* no lock, called from rx napi or txrx napi, nothing else can fill */ + + if (q->tail_idx == q->head_idx) + return false; + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + + dif = 2 * q->dbell_deadline; + if (dif > IONIC_RX_MAX_DOORBELL_DEADLINE) + dif = IONIC_RX_MAX_DOORBELL_DEADLINE; + + q->dbell_deadline = dif; + } + + return true; +} + static inline struct netdev_queue *q_to_ndq(struct ionic_queue *q) { return netdev_get_tx_queue(q->lif->netdev, q->index); @@ -348,16 +409,25 @@ struct ionic_rxq_sg_desc *sg_desc; struct ionic_rxq_sg_elem *sg_elem; struct ionic_buf_info *buf_info; + unsigned int fill_threshold; struct ionic_rxq_desc *desc; unsigned int remain_len; unsigned int frag_len; unsigned int nfrags; + unsigned int n_fill; unsigned int i, j; unsigned int len; + n_fill = ionic_q_space_avail(q); + + fill_threshold = min_t(unsigned int, IONIC_RX_FILL_THRESHOLD, + q->num_descs / IONIC_RX_FILL_DIV); + if (n_fill < fill_threshold) + return; + len = netdev->mtu + ETH_HLEN + VLAN_HLEN; - for (i = ionic_q_space_avail(q); i; i--) { + for (i = n_fill; i; i--) { nfrags = 0; remain_len = len; desc_info = &q->info[q->head_idx]; @@ -415,6 +485,12 @@ ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, q->dbval | q->head_idx); + + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); } void ionic_rx_empty(struct ionic_queue *q) @@ -502,6 +578,9 @@ work_done, flags); } + if (!work_done && ionic_txq_poke_doorbell(&qcq->q)) + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return work_done; } @@ -511,7 +590,6 @@ struct ionic_cq *cq = napi_to_cq(napi); struct ionic_dev *idev; struct ionic_lif *lif; - u16 rx_fill_threshold; u32 work_done = 0; u32 flags = 0; @@ -521,10 +599,7 @@ work_done = ionic_cq_service(cq, budget, ionic_rx_service, NULL, NULL); - rx_fill_threshold = min_t(u16, IONIC_RX_FILL_THRESHOLD, - cq->num_descs / IONIC_RX_FILL_DIV); - if (work_done && ionic_q_space_avail(cq->bound_q) >= rx_fill_threshold) - ionic_rx_fill(cq->bound_q); + ionic_rx_fill(cq->bound_q); if (work_done < budget && napi_complete_done(napi, work_done)) { ionic_dim_update(qcq, IONIC_LIF_F_RX_DIM_INTR); @@ -539,24 +614,29 @@ work_done, flags); } + if (!work_done && ionic_rxq_poke_doorbell(&qcq->q)) + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return work_done; } int ionic_txrx_napi(struct napi_struct *napi, int budget) { - struct ionic_qcq *qcq = napi_to_qcq(napi); + struct ionic_qcq *rxqcq = napi_to_qcq(napi); struct ionic_cq *rxcq = napi_to_cq(napi); unsigned int qi = rxcq->bound_q->index; + struct ionic_qcq *txqcq; struct ionic_dev *idev; struct ionic_lif *lif; struct ionic_cq *txcq; - u16 rx_fill_threshold; + bool resched = false; u32 rx_work_done = 0; u32 tx_work_done = 0; u32 flags = 0; lif = rxcq->bound_q->lif; idev = &lif->ionic->idev; + txqcq = lif->txqcqs[qi]; txcq = &lif->txqcqs[qi]->cq; tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT, @@ -565,13 +645,10 @@ rx_work_done = ionic_cq_service(rxcq, budget, ionic_rx_service, NULL, NULL); - rx_fill_threshold = min_t(u16, IONIC_RX_FILL_THRESHOLD, - rxcq->num_descs / IONIC_RX_FILL_DIV); - if (rx_work_done && ionic_q_space_avail(rxcq->bound_q) >= rx_fill_threshold) - ionic_rx_fill(rxcq->bound_q); + ionic_rx_fill(rxcq->bound_q); if (rx_work_done < budget && napi_complete_done(napi, rx_work_done)) { - ionic_dim_update(qcq, 0); + ionic_dim_update(rxqcq, 0); flags |= IONIC_INTR_CRED_UNMASK; rxcq->bound_intr->rearm_count++; } @@ -582,6 +659,13 @@ tx_work_done + rx_work_done, flags); } + if (!rx_work_done && ionic_rxq_poke_doorbell(&rxqcq->q)) + resched = true; + if (!tx_work_done && ionic_txq_poke_doorbell(&txqcq->q)) + resched = true; + if (resched) + mod_timer(&rxqcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return rx_work_done; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/qlogic/qede/qede_fp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/qlogic/qede/qede_fp.c @@ -1438,6 +1438,10 @@ rx_work_done = (likely(fp->type & QEDE_FASTPATH_RX) && qede_has_rx_work(fp->rxq)) ? qede_rx_int(fp, budget) : 0; + + if (fp->xdp_xmit & QEDE_XDP_REDIRECT) + xdp_do_flush(); + /* Handle case where we are called by netpoll with a budget of 0 */ if (rx_work_done < budget || !budget) { if (!qede_poll_is_more_work(fp)) { @@ -1457,9 +1461,6 @@ qede_update_tx_producer(fp->xdp_tx); } - if (fp->xdp_xmit & QEDE_XDP_REDIRECT) - xdp_do_flush_map(); - return rx_work_done; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/sfc/efx.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/sfc/efx.c @@ -1003,8 +1003,11 @@ /* Determine netdevice features */ net_dev->features |= (efx->type->offload_features | NETIF_F_SG | NETIF_F_TSO | NETIF_F_RXCSUM | NETIF_F_RXALL); - if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM)) + if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM)) { net_dev->features |= NETIF_F_TSO6; + if (efx_has_cap(efx, TX_TSO_V2_ENCAP)) + net_dev->hw_enc_features |= NETIF_F_TSO6; + } /* Check whether device supports TSO */ if (!efx->type->tso_versions || !efx->type->tso_versions(efx)) net_dev->features &= ~NETIF_F_ALL_TSO; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -90,7 +90,6 @@ struct mediatek_dwmac_variant { int (*dwmac_set_phy_interface)(struct mediatek_dwmac_plat_data *plat); int (*dwmac_set_delay)(struct mediatek_dwmac_plat_data *plat); - void (*dwmac_fix_mac_speed)(void *priv, unsigned int speed); /* clock ids to be requested */ const char * const *clk_list; @@ -443,32 +442,9 @@ return 0; } -static void mt8195_fix_mac_speed(void *priv, unsigned int speed) -{ - struct mediatek_dwmac_plat_data *priv_plat = priv; - - if ((phy_interface_mode_is_rgmii(priv_plat->phy_mode))) { - /* prefer 2ns fixed delay which is controlled by TXC_PHASE_CTRL, - * when link speed is 1Gbps with RGMII interface, - * Fall back to delay macro circuit for 10/100Mbps link speed. - */ - if (speed == SPEED_1000) - regmap_update_bits(priv_plat->peri_regmap, - MT8195_PERI_ETH_CTRL0, - MT8195_RGMII_TXC_PHASE_CTRL | - MT8195_DLY_GTXC_ENABLE | - MT8195_DLY_GTXC_INV | - MT8195_DLY_GTXC_STAGES, - MT8195_RGMII_TXC_PHASE_CTRL); - else - mt8195_set_delay(priv_plat); - } -} - static const struct mediatek_dwmac_variant mt8195_gmac_variant = { .dwmac_set_phy_interface = mt8195_set_interface, .dwmac_set_delay = mt8195_set_delay, - .dwmac_fix_mac_speed = mt8195_fix_mac_speed, .clk_list = mt8195_dwmac_clk_l, .num_clks = ARRAY_SIZE(mt8195_dwmac_clk_l), .dma_bit_mask = 35, @@ -619,8 +595,6 @@ plat->bsp_priv = priv_plat; plat->init = mediatek_dwmac_init; plat->clks_config = mediatek_dwmac_clks_config; - if (priv_plat->variant->dwmac_fix_mac_speed) - plat->fix_mac_speed = priv_plat->variant->dwmac_fix_mac_speed; plat->safety_feat_cfg = devm_kzalloc(&pdev->dev, sizeof(*plat->safety_feat_cfg), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -560,6 +560,8 @@ plat_dat->has_gmac4 = 1; plat_dat->pmt = 1; plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); + if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) + plat_dat->rx_clk_runs_in_lpi = 1; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/dwmac5.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/dwmac5.c @@ -186,11 +186,25 @@ int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp, struct stmmac_safety_feature_cfg *safety_feat_cfg) { + struct stmmac_safety_feature_cfg all_safety_feats = { + .tsoee = 1, + .mrxpee = 1, + .mestee = 1, + .mrxee = 1, + .mtxee = 1, + .epsi = 1, + .edpp = 1, + .prtyen = 1, + .tmouten = 1, + }; u32 value; if (!asp) return -EINVAL; + if (!safety_feat_cfg) + safety_feat_cfg = &all_safety_feats; + /* 1. Enable Safety Features */ value = readl(ioaddr + MTL_ECC_CONTROL); value |= MEEAO; /* MTL ECC Error Addr Status Override */ @@ -527,9 +541,9 @@ return 0; } - val |= PPSCMDx(index, 0x2); val |= TRGTMODSELx(index, 0x2); val |= PPSEN0; + writel(val, ioaddr + MAC_PPS_CONTROL); writel(cfg->start.tv_sec, ioaddr + MAC_PPSx_TARGET_TIME_SEC(index)); @@ -554,6 +568,7 @@ writel(period - 1, ioaddr + MAC_PPSx_WIDTH(index)); /* Finally, activate it */ + val |= PPSCMDx(index, 0x2); writel(val, ioaddr + MAC_PPS_CONTROL); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -551,16 +551,16 @@ p = (char *)priv + offsetof(struct stmmac_priv, xstats.txq_stats[q].tx_pkt_n); for (stat = 0; stat < STMMAC_TXQ_STATS; stat++) { - *data++ = (*(u64 *)p); - p += sizeof(u64 *); + *data++ = (*(unsigned long *)p); + p += sizeof(unsigned long); } } for (q = 0; q < rx_cnt; q++) { p = (char *)priv + offsetof(struct stmmac_priv, xstats.rxq_stats[q].rx_pkt_n); for (stat = 0; stat < STMMAC_RXQ_STATS; stat++) { - *data++ = (*(u64 *)p); - p += sizeof(u64 *); + *data++ = (*(unsigned long *)p); + p += sizeof(unsigned long); } } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -559,7 +559,7 @@ dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); - if (plat->force_thresh_dma_mode) { + if (plat->force_thresh_dma_mode && plat->force_sf_dma_mode) { plat->force_sf_dma_mode = 0; dev_warn(&pdev->dev, "force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -219,7 +219,10 @@ } writel(acr_value, ptpaddr + PTP_ACR); mutex_unlock(&priv->aux_ts_lock); - ret = 0; + /* wait for auxts fifo clear to finish */ + ret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value, + !(acr_value & PTP_ACR_ATSFC), + 10, 10000); break; default: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ethernet/ti/am65-cpsw-nuss.h +++ linux-oem-6.1-6.1.0/drivers/net/ethernet/ti/am65-cpsw-nuss.h @@ -86,6 +86,7 @@ }; #define AM65_CPSW_QUIRK_I2027_NO_TX_CSUM BIT(0) +#define AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ BIT(1) struct am65_cpsw_pdata { u32 quirks; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/hyperv/netvsc.c +++ linux-oem-6.1-6.1.0/drivers/net/hyperv/netvsc.c @@ -987,9 +987,6 @@ void netvsc_dma_unmap(struct hv_device *hv_dev, struct hv_netvsc_packet *packet) { - u32 page_count = packet->cp_partial ? - packet->page_buf_cnt - packet->rmsg_pgcnt : - packet->page_buf_cnt; int i; if (!hv_is_isolation_supported()) @@ -998,7 +995,7 @@ if (!packet->dma_range) return; - for (i = 0; i < page_count; i++) + for (i = 0; i < packet->page_buf_cnt; i++) dma_unmap_single(&hv_dev->device, packet->dma_range[i].dma, packet->dma_range[i].mapping_size, DMA_TO_DEVICE); @@ -1028,9 +1025,7 @@ struct hv_netvsc_packet *packet, struct hv_page_buffer *pb) { - u32 page_count = packet->cp_partial ? - packet->page_buf_cnt - packet->rmsg_pgcnt : - packet->page_buf_cnt; + u32 page_count = packet->page_buf_cnt; dma_addr_t dma; int i; @@ -1039,7 +1034,7 @@ packet->dma_range = kcalloc(page_count, sizeof(*packet->dma_range), - GFP_KERNEL); + GFP_ATOMIC); if (!packet->dma_range) return -ENOMEM; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ipa/ipa_interrupt.c +++ linux-oem-6.1-6.1.0/drivers/net/ipa/ipa_interrupt.c @@ -127,6 +127,16 @@ return IRQ_HANDLED; } +void ipa_interrupt_irq_disable(struct ipa *ipa) +{ + disable_irq(ipa->interrupt->irq); +} + +void ipa_interrupt_irq_enable(struct ipa *ipa) +{ + enable_irq(ipa->interrupt->irq); +} + /* Common function used to enable/disable TX_SUSPEND for an endpoint */ static void ipa_interrupt_suspend_control(struct ipa_interrupt *interrupt, u32 endpoint_id, bool enable) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ipa/ipa_interrupt.h +++ linux-oem-6.1-6.1.0/drivers/net/ipa/ipa_interrupt.h @@ -86,6 +86,22 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt); /** + * ipa_interrupt_irq_enable() - Enable IPA interrupts + * @ipa: IPA pointer + * + * This enables the IPA interrupt line + */ +void ipa_interrupt_irq_enable(struct ipa *ipa); + +/** + * ipa_interrupt_irq_disable() - Disable IPA interrupts + * @ipa: IPA pointer + * + * This disables the IPA interrupt line + */ +void ipa_interrupt_irq_disable(struct ipa *ipa); + +/** * ipa_interrupt_config() - Configure the IPA interrupt framework * @ipa: IPA pointer * only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/ipa/ipa_power.c +++ linux-oem-6.1-6.1.0/drivers/net/ipa/ipa_power.c @@ -181,6 +181,17 @@ __set_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); + /* Increment the disable depth to ensure that the IRQ won't + * be re-enabled until the matching _enable call in + * ipa_resume(). We do this to ensure that the interrupt + * handler won't run whilst PM runtime is disabled. + * + * Note that disabling the IRQ is NOT the same as disabling + * irq wake. If wakeup is enabled for the IPA then the IRQ + * will still cause the system to wake up, see irq_set_irq_wake(). + */ + ipa_interrupt_irq_disable(ipa); + return pm_runtime_force_suspend(dev); } @@ -193,6 +204,12 @@ __clear_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); + /* Now that PM runtime is enabled again it's safe + * to turn the IRQ back on and process any data + * that was received during suspend. + */ + ipa_interrupt_irq_enable(ipa); + return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/mdio/mdio-mux-meson-g12a.c +++ linux-oem-6.1-6.1.0/drivers/net/mdio/mdio-mux-meson-g12a.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -150,6 +151,7 @@ static int g12a_enable_internal_mdio(struct g12a_mdio_mux *priv) { + u32 value; int ret; /* Enable the phy clock */ @@ -163,18 +165,25 @@ /* Initialize ephy control */ writel(EPHY_G12A_ID, priv->regs + ETH_PHY_CNTL0); - writel(FIELD_PREP(PHY_CNTL1_ST_MODE, 3) | - FIELD_PREP(PHY_CNTL1_ST_PHYADD, EPHY_DFLT_ADD) | - FIELD_PREP(PHY_CNTL1_MII_MODE, EPHY_MODE_RMII) | - PHY_CNTL1_CLK_EN | - PHY_CNTL1_CLKFREQ | - PHY_CNTL1_PHY_ENB, - priv->regs + ETH_PHY_CNTL1); + + /* Make sure we get a 0 -> 1 transition on the enable bit */ + value = FIELD_PREP(PHY_CNTL1_ST_MODE, 3) | + FIELD_PREP(PHY_CNTL1_ST_PHYADD, EPHY_DFLT_ADD) | + FIELD_PREP(PHY_CNTL1_MII_MODE, EPHY_MODE_RMII) | + PHY_CNTL1_CLK_EN | + PHY_CNTL1_CLKFREQ; + writel(value, priv->regs + ETH_PHY_CNTL1); writel(PHY_CNTL2_USE_INTERNAL | PHY_CNTL2_SMI_SRC_MAC | PHY_CNTL2_RX_CLK_EPHY, priv->regs + ETH_PHY_CNTL2); + value |= PHY_CNTL1_PHY_ENB; + writel(value, priv->regs + ETH_PHY_CNTL1); + + /* The phy needs a bit of time to power up */ + mdelay(10); + return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/phy/dp83822.c +++ linux-oem-6.1-6.1.0/drivers/net/phy/dp83822.c @@ -233,7 +233,8 @@ DP83822_ENERGY_DET_INT_EN | DP83822_LINK_QUAL_INT_EN); - if (!dp83822->fx_enabled) + /* Private data pointer is NULL on DP83825/26 */ + if (!dp83822 || !dp83822->fx_enabled) misr_status |= DP83822_ANEG_COMPLETE_INT_EN | DP83822_DUP_MODE_CHANGE_INT_EN | DP83822_SPEED_CHANGED_INT_EN; @@ -253,7 +254,8 @@ DP83822_PAGE_RX_INT_EN | DP83822_EEE_ERROR_CHANGE_INT_EN); - if (!dp83822->fx_enabled) + /* Private data pointer is NULL on DP83825/26 */ + if (!dp83822 || !dp83822->fx_enabled) misr_status |= DP83822_ANEG_ERR_INT_EN | DP83822_WOL_PKT_INT_EN; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/phy/mdio_bus.c +++ linux-oem-6.1-6.1.0/drivers/net/phy/mdio_bus.c @@ -108,7 +108,12 @@ struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr) { - struct mdio_device *mdiodev = bus->mdio_map[addr]; + struct mdio_device *mdiodev; + + if (addr < 0 || addr >= ARRAY_SIZE(bus->mdio_map)) + return NULL; + + mdiodev = bus->mdio_map[addr]; if (!mdiodev) return NULL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/phy/meson-gxl.c +++ linux-oem-6.1-6.1.0/drivers/net/phy/meson-gxl.c @@ -261,6 +261,8 @@ .handle_interrupt = meson_gxl_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume, + .read_mmd = genphy_read_mmd_unsupported, + .write_mmd = genphy_write_mmd_unsupported, }, { PHY_ID_MATCH_EXACT(0x01803301), .name = "Meson G12A Internal PHY", @@ -271,6 +273,8 @@ .handle_interrupt = meson_gxl_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume, + .read_mmd = genphy_read_mmd_unsupported, + .write_mmd = genphy_write_mmd_unsupported, }, }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/phy/phylink.c +++ linux-oem-6.1-6.1.0/drivers/net/phy/phylink.c @@ -1793,10 +1793,9 @@ ret = phy_attach_direct(pl->netdev, phy_dev, flags, pl->link_interface); - if (ret) { - phy_device_free(phy_dev); + phy_device_free(phy_dev); + if (ret) return ret; - } ret = phylink_bringup_phy(pl, phy_dev, pl->link_config.interface); if (ret) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/usb/cdc_ether.c +++ linux-oem-6.1-6.1.0/drivers/net/usb/cdc_ether.c @@ -1002,6 +1002,12 @@ USB_CDC_PROTO_NONE), .driver_info = (unsigned long)&wwan_info, }, { + /* Cinterion PLS62-W modem by GEMALTO/THALES */ + USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x005b, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&wwan_info, +}, { /* Cinterion PLS83/PLS63 modem by GEMALTO/THALES */ USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0069, USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/usb/kalmia.c +++ linux-oem-6.1-6.1.0/drivers/net/usb/kalmia.c @@ -65,8 +65,8 @@ init_msg, init_msg_len, &act_len, KALMIA_USB_TIMEOUT); if (status != 0) { netdev_err(dev->net, - "Error sending init packet. Status %i, length %i\n", - status, act_len); + "Error sending init packet. Status %i\n", + status); return status; } else if (act_len != init_msg_len) { @@ -83,8 +83,8 @@ if (status != 0) netdev_err(dev->net, - "Error receiving init result. Status %i, length %i\n", - status, act_len); + "Error receiving init result. Status %i\n", + status); else if (act_len != expected_len) netdev_err(dev->net, "Unexpected init result length: %i\n", act_len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/usb/plusb.c +++ linux-oem-6.1-6.1.0/drivers/net/usb/plusb.c @@ -57,9 +57,7 @@ static inline int pl_vendor_req(struct usbnet *dev, u8 req, u8 val, u8 index) { - return usbnet_read_cmd(dev, req, - USB_DIR_IN | USB_TYPE_VENDOR | - USB_RECIP_DEVICE, + return usbnet_write_cmd(dev, req, USB_TYPE_VENDOR | USB_RECIP_DEVICE, val, index, NULL, 0); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/usb/r8152.c +++ linux-oem-6.1-6.1.0/drivers/net/usb/r8152.c @@ -9836,6 +9836,7 @@ REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), + REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e), REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/usb/sr9700.c +++ linux-oem-6.1-6.1.0/drivers/net/usb/sr9700.c @@ -413,7 +413,7 @@ /* ignore the CRC length */ len = (skb->data[1] | (skb->data[2] << 8)) - 4; - if (len > ETH_FRAME_LEN || len > skb->len) + if (len > ETH_FRAME_LEN || len > skb->len || len < 0) return 0; /* the last packet of current skb */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/virtio_net.c +++ linux-oem-6.1-6.1.0/drivers/net/virtio_net.c @@ -1673,13 +1673,13 @@ received = virtnet_receive(rq, budget, &xdp_xmit); + if (xdp_xmit & VIRTIO_XDP_REDIR) + xdp_do_flush(); + /* Out of packets? */ if (received < budget) virtqueue_napi_complete(napi, rq->vq, received); - if (xdp_xmit & VIRTIO_XDP_REDIR) - xdp_do_flush(); - if (xdp_xmit & VIRTIO_XDP_TX) { sq = virtnet_xdp_get_sq(vi); if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) { @@ -1873,8 +1873,10 @@ */ if (sq->vq->num_free < 2+MAX_SKB_FRAGS) { netif_stop_subqueue(dev, qnum); - if (!use_napi && - unlikely(!virtqueue_enable_cb_delayed(sq->vq))) { + if (use_napi) { + if (unlikely(!virtqueue_enable_cb_delayed(sq->vq))) + virtqueue_napi_schedule(&sq->napi, sq->vq); + } else if (unlikely(!virtqueue_enable_cb_delayed(sq->vq))) { /* More just got used, free them then recheck. */ free_old_xmit_skbs(sq, false); if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) { @@ -2152,8 +2154,8 @@ cancel_delayed_work_sync(&vi->refill); for (i = 0; i < vi->max_queue_pairs; i++) { - xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); napi_disable(&vi->rq[i].napi); + xdp_rxq_info_unreg(&vi->rq[i].xdp_rxq); virtnet_napi_tx_disable(&vi->sq[i].napi); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wan/fsl_ucc_hdlc.c +++ linux-oem-6.1-6.1.0/drivers/net/wan/fsl_ucc_hdlc.c @@ -1243,9 +1243,11 @@ free_dev: free_netdev(dev); undo_uhdlc_init: - iounmap(utdm->siram); + if (utdm) + iounmap(utdm->siram); unmap_si_regs: - iounmap(utdm->si_regs); + if (utdm) + iounmap(utdm->si_regs); free_utdm: if (uhdlc_priv->tsa) kfree(utdm); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -91,6 +91,9 @@ #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \ (sizeof(struct brcmf_assoc_params_le) - sizeof(u16)) +#define BRCMF_MAX_CHANSPEC_LIST \ + (BRCMF_DCMD_MEDLEN / sizeof(__le32) - 1) + static bool check_vif_up(struct brcmf_cfg80211_vif *vif) { if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) { @@ -6556,6 +6559,13 @@ band->channels[i].flags = IEEE80211_CHAN_DISABLED; total = le32_to_cpu(list->count); + if (total > BRCMF_MAX_CHANSPEC_LIST) { + bphy_err(drvr, "Invalid count of channel Spec. (%u)\n", + total); + err = -EINVAL; + goto fail_pbuf; + } + for (i = 0; i < total; i++) { ch.chspec = (u16)le32_to_cpu(list->element[i]); cfg->d11inf.decchspec(&ch); @@ -6701,6 +6711,13 @@ band = cfg_to_wiphy(cfg)->bands[NL80211_BAND_2GHZ]; list = (struct brcmf_chanspec_list *)pbuf; num_chan = le32_to_cpu(list->count); + if (num_chan > BRCMF_MAX_CHANSPEC_LIST) { + bphy_err(drvr, "Invalid count of channel Spec. (%u)\n", + num_chan); + kfree(pbuf); + return -EINVAL; + } + for (i = 0; i < num_chan; i++) { ch.chspec = (u16)le32_to_cpu(list->element[i]); cfg->d11inf.decchspec(&ch); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -79,7 +79,8 @@ /* Apple ARM64 platforms have their own idea of board type, passed in * via the device tree. They also have an antenna SKU parameter */ - if (!of_property_read_string(np, "brcm,board-type", &prop)) + err = of_property_read_string(np, "brcm,board-type", &prop); + if (!err) settings->board_type = prop; if (!of_property_read_string(np, "apple,antenna-sku", &prop)) @@ -87,7 +88,7 @@ /* Set board-type to the first string of the machine compatible prop */ root = of_find_node_by_path("/"); - if (root && !settings->board_type) { + if (root && err) { char *board_type; const char *tmp; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -1106,6 +1106,11 @@ int i, j, num_sub_bands; s8 *gain; + /* many firmware images for JF lie about this */ + if (CSR_HW_RFID_TYPE(fwrt->trans->hw_rf_id) == + CSR_HW_RFID_TYPE(CSR_HW_RF_ID_TYPE_JF)) + return -EOPNOTSUPP; + if (!fw_has_capa(&fwrt->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) { IWL_DEBUG_RADIO(fwrt, "PPAG capability not supported by FW, command not sent.\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/marvell/mwifiex/sdio.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -480,6 +480,7 @@ }; static const struct of_device_id mwifiex_sdio_of_match_table[] = { + { .compatible = "marvell,sd8787" }, { .compatible = "marvell,sd8897" }, { .compatible = "marvell,sd8997" }, { } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/mediatek/mt76/mt7921/acpi_sar.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/mediatek/mt76/mt7921/acpi_sar.c @@ -33,14 +33,17 @@ sar_root->package.elements[0].type != ACPI_TYPE_INTEGER) { dev_err(mdev->dev, "sar cnt = %d\n", sar_root->package.count); + ret = -EINVAL; goto free; } if (!*tbl) { *tbl = devm_kzalloc(mdev->dev, sar_root->package.count, GFP_KERNEL); - if (!*tbl) + if (!*tbl) { + ret = -ENOMEM; goto free; + } } if (len) *len = sar_root->package.count; @@ -52,9 +55,9 @@ break; *(*tbl + i) = (u8)sar_unit->integer.value; } -free: ret = (i == sar_root->package.count) ? 0 : -EINVAL; +free: kfree(sar_root); return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/net/wireless/rndis_wlan.c +++ linux-oem-6.1-6.1.0/drivers/net/wireless/rndis_wlan.c @@ -696,8 +696,8 @@ struct rndis_query *get; struct rndis_query_c *get_c; } u; - int ret, buflen; - int resplen, respoffs, copylen; + int ret; + size_t buflen, resplen, respoffs, copylen; buflen = *len + sizeof(*u.get); if (buflen < CONTROL_BUFFER_SIZE) @@ -732,22 +732,15 @@ if (respoffs > buflen) { /* Device returned data offset outside buffer, error. */ - netdev_dbg(dev->net, "%s(%s): received invalid " - "data offset: %d > %d\n", __func__, - oid_to_string(oid), respoffs, buflen); + netdev_dbg(dev->net, + "%s(%s): received invalid data offset: %zu > %zu\n", + __func__, oid_to_string(oid), respoffs, buflen); ret = -EINVAL; goto exit_unlock; } - if ((resplen + respoffs) > buflen) { - /* Device would have returned more data if buffer would - * have been big enough. Copy just the bits that we got. - */ - copylen = buflen - respoffs; - } else { - copylen = resplen; - } + copylen = min(resplen, buflen - respoffs); if (copylen > *len) copylen = *len; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nfc/pn533/usb.c +++ linux-oem-6.1-6.1.0/drivers/nfc/pn533/usb.c @@ -153,10 +153,17 @@ return usb_submit_urb(phy->ack_urb, flags); } +struct pn533_out_arg { + struct pn533_usb_phy *phy; + struct completion done; +}; + static int pn533_usb_send_frame(struct pn533 *dev, struct sk_buff *out) { struct pn533_usb_phy *phy = dev->phy; + struct pn533_out_arg arg; + void *cntx; int rc; if (phy->priv == NULL) @@ -168,10 +175,17 @@ print_hex_dump_debug("PN533 TX: ", DUMP_PREFIX_NONE, 16, 1, out->data, out->len, false); + init_completion(&arg.done); + cntx = phy->out_urb->context; + phy->out_urb->context = &arg; + rc = usb_submit_urb(phy->out_urb, GFP_KERNEL); if (rc) return rc; + wait_for_completion(&arg.done); + phy->out_urb->context = cntx; + if (dev->protocol_type == PN533_PROTO_REQ_RESP) { /* request for response for sent packet directly */ rc = pn533_submit_urb_for_response(phy, GFP_KERNEL); @@ -408,7 +422,31 @@ return arg.rc; } -static void pn533_send_complete(struct urb *urb) +static void pn533_out_complete(struct urb *urb) +{ + struct pn533_out_arg *arg = urb->context; + struct pn533_usb_phy *phy = arg->phy; + + switch (urb->status) { + case 0: + break; /* success */ + case -ECONNRESET: + case -ENOENT: + dev_dbg(&phy->udev->dev, + "The urb has been stopped (status %d)\n", + urb->status); + break; + case -ESHUTDOWN: + default: + nfc_err(&phy->udev->dev, + "Urb failure (status %d)\n", + urb->status); + } + + complete(&arg->done); +} + +static void pn533_ack_complete(struct urb *urb) { struct pn533_usb_phy *phy = urb->context; @@ -496,10 +534,10 @@ usb_fill_bulk_urb(phy->out_urb, phy->udev, usb_sndbulkpipe(phy->udev, out_endpoint), - NULL, 0, pn533_send_complete, phy); + NULL, 0, pn533_out_complete, phy); usb_fill_bulk_urb(phy->ack_urb, phy->udev, usb_sndbulkpipe(phy->udev, out_endpoint), - NULL, 0, pn533_send_complete, phy); + NULL, 0, pn533_ack_complete, phy); switch (id->driver_info) { case PN533_DEVICE_STD: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvdimm/Kconfig +++ linux-oem-6.1-6.1.0/drivers/nvdimm/Kconfig @@ -102,6 +102,25 @@ depends on ENCRYPTED_KEYS depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m +config NVDIMM_KMSAN + bool + depends on KMSAN + help + KMSAN, and other memory debug facilities, increase the size of + 'struct page' to contain extra metadata. This collides with + the NVDIMM capability to store a potentially + larger-than-"System RAM" size 'struct page' array in a + reservation of persistent memory rather than limited / + precious DRAM. However, that reservation needs to persist for + the life of the given NVDIMM namespace. If you are using KMSAN + to debug an issue unrelated to NVDIMMs or DAX then say N to this + option. Otherwise, say Y but understand that any namespaces + (with the page array stored pmem) created with this build of + the kernel will permanently reserve and strand excess + capacity compared to the CONFIG_KMSAN=n case. + + Select N if unsure. + config NVDIMM_TEST_BUILD tristate "Build the unit test core" depends on m only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvdimm/nd.h +++ linux-oem-6.1-6.1.0/drivers/nvdimm/nd.h @@ -652,7 +652,7 @@ struct nd_namespace_common *ndns); #if IS_ENABLED(CONFIG_ND_CLAIM) /* max struct page size independent of kernel config */ -#define MAX_STRUCT_PAGE_SIZE 128 +#define MAX_STRUCT_PAGE_SIZE 64 int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap); #else static inline int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvdimm/pfn_devs.c +++ linux-oem-6.1-6.1.0/drivers/nvdimm/pfn_devs.c @@ -13,6 +13,8 @@ #include "pfn.h" #include "nd.h" +static const bool page_struct_override = IS_ENABLED(CONFIG_NVDIMM_KMSAN); + static void nd_pfn_release(struct device *dev) { struct nd_region *nd_region = to_nd_region(dev->parent); @@ -758,12 +760,6 @@ return -ENXIO; } - /* - * Note, we use 64 here for the standard size of struct page, - * debugging options may cause it to be larger in which case the - * implementation will limit the pfns advertised through - * ->direct_access() to those that are included in the memmap. - */ start = nsio->res.start; size = resource_size(&nsio->res); npfns = PHYS_PFN(size - SZ_8K); @@ -782,20 +778,33 @@ } end_trunc = start + size - ALIGN_DOWN(start + size, align); if (nd_pfn->mode == PFN_MODE_PMEM) { + unsigned long page_map_size = MAX_STRUCT_PAGE_SIZE * npfns; + /* * The altmap should be padded out to the block size used * when populating the vmemmap. This *should* be equal to * PMD_SIZE for most architectures. * - * Also make sure size of struct page is less than 128. We - * want to make sure we use large enough size here so that - * we don't have a dynamic reserve space depending on - * struct page size. But we also want to make sure we notice - * when we end up adding new elements to struct page. + * Also make sure size of struct page is less than + * MAX_STRUCT_PAGE_SIZE. The goal here is compatibility in the + * face of production kernel configurations that reduce the + * 'struct page' size below MAX_STRUCT_PAGE_SIZE. For debug + * kernel configurations that increase the 'struct page' size + * above MAX_STRUCT_PAGE_SIZE, the page_struct_override allows + * for continuing with the capacity that will be wasted when + * reverting to a production kernel configuration. Otherwise, + * those configurations are blocked by default. */ - BUILD_BUG_ON(sizeof(struct page) > MAX_STRUCT_PAGE_SIZE); - offset = ALIGN(start + SZ_8K + MAX_STRUCT_PAGE_SIZE * npfns, align) - - start; + if (sizeof(struct page) > MAX_STRUCT_PAGE_SIZE) { + if (page_struct_override) + page_map_size = sizeof(struct page) * npfns; + else { + dev_err(&nd_pfn->dev, + "Memory debug options prevent using pmem for the page map\n"); + return -EINVAL; + } + } + offset = ALIGN(start + SZ_8K + page_map_size, align) - start; } else if (nd_pfn->mode == PFN_MODE_RAM) offset = ALIGN(start + SZ_8K, align) - start; else @@ -818,7 +827,10 @@ pfn_sb->version_minor = cpu_to_le16(4); pfn_sb->end_trunc = cpu_to_le32(end_trunc); pfn_sb->align = cpu_to_le32(nd_pfn->align); - pfn_sb->page_struct_size = cpu_to_le16(MAX_STRUCT_PAGE_SIZE); + if (sizeof(struct page) > MAX_STRUCT_PAGE_SIZE && page_struct_override) + pfn_sb->page_struct_size = cpu_to_le16(sizeof(struct page)); + else + pfn_sb->page_struct_size = cpu_to_le16(MAX_STRUCT_PAGE_SIZE); pfn_sb->page_size = cpu_to_le32(PAGE_SIZE); checksum = nd_sb_checksum((struct nd_gen_sb *) pfn_sb); pfn_sb->checksum = cpu_to_le64(checksum); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvme/host/apple.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/apple.c @@ -987,11 +987,11 @@ goto out; } - if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) - apple_nvme_disable(anv, false); - /* RTKit must be shut down cleanly for the (soft)-reset to work */ if (apple_rtkit_is_running(anv->rtk)) { + /* reset the controller if it is enabled */ + if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) + apple_nvme_disable(anv, false); dev_dbg(anv->dev, "Trying to shut down RTKit before reset."); ret = apple_rtkit_shutdown(anv->rtk); if (ret) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvme/host/multipath.c +++ linux-oem-6.1-6.1.0/drivers/nvme/host/multipath.c @@ -351,6 +351,8 @@ * pool from the original queue to allocate the bvecs from. */ bio = bio_split_to_limits(bio); + if (!bio) + return; srcu_idx = srcu_read_lock(&head->srcu); ns = nvme_find_path(head); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvme/target/fc.c +++ linux-oem-6.1-6.1.0/drivers/nvme/target/fc.c @@ -1685,8 +1685,10 @@ else { queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, be16_to_cpu(rqst->assoc_cmd.sqsize)); - if (!queue) + if (!queue) { ret = VERR_QUEUE_ALLOC_FAIL; + nvmet_fc_tgt_a_put(iod->assoc); + } } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvme/target/tcp.c +++ linux-oem-6.1-6.1.0/drivers/nvme/target/tcp.c @@ -331,7 +331,7 @@ sg_offset = 0; } - iov_iter_bvec(&cmd->recv_msg.msg_iter, READ, cmd->iov, + iov_iter_bvec(&cmd->recv_msg.msg_iter, ITER_DEST, cmd->iov, nr_pages, cmd->pdu_len); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvmem/brcm_nvram.c +++ linux-oem-6.1-6.1.0/drivers/nvmem/brcm_nvram.c @@ -97,6 +97,9 @@ len = le32_to_cpu(header.len); data = kzalloc(len, GFP_KERNEL); + if (!data) + return -ENOMEM; + memcpy_fromio(data, priv->base, len); data[len - 1] = '\0'; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvmem/core.c +++ linux-oem-6.1-6.1.0/drivers/nvmem/core.c @@ -770,31 +770,32 @@ return ERR_PTR(rval); } - if (config->wp_gpio) - nvmem->wp_gpio = config->wp_gpio; - else if (!config->ignore_wp) + nvmem->id = rval; + + nvmem->dev.type = &nvmem_provider_type; + nvmem->dev.bus = &nvmem_bus_type; + nvmem->dev.parent = config->dev; + + device_initialize(&nvmem->dev); + + if (!config->ignore_wp) nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", GPIOD_OUT_HIGH); if (IS_ERR(nvmem->wp_gpio)) { - ida_free(&nvmem_ida, nvmem->id); rval = PTR_ERR(nvmem->wp_gpio); - kfree(nvmem); - return ERR_PTR(rval); + nvmem->wp_gpio = NULL; + goto err_put_device; } kref_init(&nvmem->refcnt); INIT_LIST_HEAD(&nvmem->cells); - nvmem->id = rval; nvmem->owner = config->owner; if (!nvmem->owner && config->dev->driver) nvmem->owner = config->dev->driver->owner; nvmem->stride = config->stride ?: 1; nvmem->word_size = config->word_size ?: 1; nvmem->size = config->size; - nvmem->dev.type = &nvmem_provider_type; - nvmem->dev.bus = &nvmem_bus_type; - nvmem->dev.parent = config->dev; nvmem->root_only = config->root_only; nvmem->priv = config->priv; nvmem->type = config->type; @@ -822,11 +823,8 @@ break; } - if (rval) { - ida_free(&nvmem_ida, nvmem->id); - kfree(nvmem); - return ERR_PTR(rval); - } + if (rval) + goto err_put_device; nvmem->read_only = device_property_present(config->dev, "read-only") || config->read_only || !nvmem->reg_write; @@ -835,28 +833,22 @@ nvmem->dev.groups = nvmem_dev_groups; #endif - dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); - - rval = device_register(&nvmem->dev); - if (rval) - goto err_put_device; - if (nvmem->nkeepout) { rval = nvmem_validate_keepouts(nvmem); if (rval) - goto err_device_del; + goto err_put_device; } if (config->compat) { rval = nvmem_sysfs_setup_compat(nvmem, config); if (rval) - goto err_device_del; + goto err_put_device; } if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) - goto err_teardown_compat; + goto err_remove_cells; } rval = nvmem_add_cells_from_table(nvmem); @@ -867,17 +859,20 @@ if (rval) goto err_remove_cells; + dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name); + + rval = device_add(&nvmem->dev); + if (rval) + goto err_remove_cells; + blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem); return nvmem; err_remove_cells: nvmem_device_remove_all_cells(nvmem); -err_teardown_compat: if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); -err_device_del: - device_del(&nvmem->dev); err_put_device: put_device(&nvmem->dev); @@ -1242,16 +1237,21 @@ if (!cell_np) return ERR_PTR(-ENOENT); - nvmem_np = of_get_next_parent(cell_np); - if (!nvmem_np) + nvmem_np = of_get_parent(cell_np); + if (!nvmem_np) { + of_node_put(cell_np); return ERR_PTR(-EINVAL); + } nvmem = __nvmem_device_get(nvmem_np, device_match_of_node); of_node_put(nvmem_np); - if (IS_ERR(nvmem)) + if (IS_ERR(nvmem)) { + of_node_put(cell_np); return ERR_CAST(nvmem); + } cell_entry = nvmem_find_cell_entry_by_node(nvmem, cell_np); + of_node_put(cell_np); if (!cell_entry) { __nvmem_device_put(nvmem); return ERR_PTR(-ENOENT); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvmem/qcom-spmi-sdam.c +++ linux-oem-6.1-6.1.0/drivers/nvmem/qcom-spmi-sdam.c @@ -166,6 +166,7 @@ { .compatible = "qcom,spmi-sdam" }, {}, }; +MODULE_DEVICE_TABLE(of, sdam_match_table); static struct platform_driver sdam_driver = { .driver = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/nvmem/sunxi_sid.c +++ linux-oem-6.1-6.1.0/drivers/nvmem/sunxi_sid.c @@ -41,8 +41,21 @@ void *val, size_t bytes) { struct sunxi_sid *sid = context; + u32 word; - memcpy_fromio(val, sid->base + sid->value_offset + offset, bytes); + /* .stride = 4 so offset is guaranteed to be aligned */ + __ioread32_copy(val, sid->base + sid->value_offset + offset, bytes / 4); + + val += round_down(bytes, 4); + offset += round_down(bytes, 4); + bytes = bytes % 4; + + if (!bytes) + return 0; + + /* Handle any trailing bytes */ + word = readl_relaxed(sid->base + sid->value_offset + offset); + memcpy(val, &word, bytes); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/of/address.c +++ linux-oem-6.1-6.1.0/drivers/of/address.c @@ -965,8 +965,19 @@ } of_dma_range_parser_init(&parser, node); - for_each_of_range(&parser, &range) + for_each_of_range(&parser, &range) { + if (range.cpu_addr == OF_BAD_ADDR) { + pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", + range.bus_addr, node); + continue; + } num_ranges++; + } + + if (!num_ranges) { + ret = -EINVAL; + goto out; + } r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL); if (!r) { @@ -975,18 +986,16 @@ } /* - * Record all info in the generic DMA ranges array for struct device. + * Record all info in the generic DMA ranges array for struct device, + * returning an error if we don't find any parsable ranges. */ *map = r; of_dma_range_parser_init(&parser, node); for_each_of_range(&parser, &range) { pr_debug("dma_addr(%llx) cpu_addr(%llx) size(%llx)\n", range.bus_addr, range.cpu_addr, range.size); - if (range.cpu_addr == OF_BAD_ADDR) { - pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", - range.bus_addr, node); + if (range.cpu_addr == OF_BAD_ADDR) continue; - } r->cpu_start = range.cpu_addr; r->dma_start = range.bus_addr; r->size = range.size; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/of/of_reserved_mem.c +++ linux-oem-6.1-6.1.0/drivers/of/of_reserved_mem.c @@ -48,9 +48,10 @@ err = memblock_mark_nomap(base, size); if (err) memblock_phys_free(base, size); - kmemleak_ignore_phys(base); } + kmemleak_ignore_phys(base); + return err; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/of/platform.c +++ linux-oem-6.1-6.1.0/drivers/of/platform.c @@ -526,6 +526,7 @@ if (IS_ENABLED(CONFIG_PPC)) { struct device_node *boot_display = NULL; struct platform_device *dev; + int display_number = 0; int ret; /* Check if we have a MacOS display without a node spec */ @@ -556,16 +557,23 @@ if (!of_get_property(node, "linux,opened", NULL) || !of_get_property(node, "linux,boot-display", NULL)) continue; - dev = of_platform_device_create(node, "of-display", NULL); + dev = of_platform_device_create(node, "of-display.0", NULL); + of_node_put(node); if (WARN_ON(!dev)) return -ENOMEM; boot_display = node; + display_number++; break; } for_each_node_by_type(node, "display") { + char buf[14]; + const char *of_display_format = "of-display.%d"; + if (!of_get_property(node, "linux,opened", NULL) || node == boot_display) continue; - of_platform_device_create(node, "of-display", NULL); + ret = snprintf(buf, sizeof(buf), of_display_format, display_number++); + if (ret < sizeof(buf)) + of_platform_device_create(node, buf, NULL); } } else { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pci/pci.h +++ linux-oem-6.1-6.1.0/drivers/pci/pci.h @@ -565,14 +565,10 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev); void pcie_aspm_exit_link_state(struct pci_dev *pdev); void pcie_aspm_powersave_config_link(struct pci_dev *pdev); -void pci_save_aspm_l1ss_state(struct pci_dev *dev); -void pci_restore_aspm_l1ss_state(struct pci_dev *dev); #else static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { } static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { } static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { } -static inline void pci_save_aspm_l1ss_state(struct pci_dev *dev) { } -static inline void pci_restore_aspm_l1ss_state(struct pci_dev *dev) { } #endif #ifdef CONFIG_PCIE_ECRC only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/perf/arm-cmn.c +++ linux-oem-6.1-6.1.0/drivers/perf/arm-cmn.c @@ -1576,7 +1576,6 @@ hw->dn++; continue; } - hw->dtcs_used |= arm_cmn_node_to_xp(cmn, dn)->dtc; hw->num_dns++; if (bynodeid) break; @@ -1589,6 +1588,12 @@ nodeid, nid.x, nid.y, nid.port, nid.dev, type); return -EINVAL; } + /* + * Keep assuming non-cycles events count in all DTC domains; turns out + * it's hard to make a worthwhile optimisation around this, short of + * going all-in with domain-local counter allocation as well. + */ + hw->dtcs_used = (1U << cmn->num_dtcs) - 1; return arm_cmn_validate_group(cmn, event); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/phy/phy-can-transceiver.c +++ linux-oem-6.1-6.1.0/drivers/phy/phy-can-transceiver.c @@ -99,6 +99,7 @@ struct gpio_desc *standby_gpio; struct gpio_desc *enable_gpio; u32 max_bitrate = 0; + int err; can_transceiver_phy = devm_kzalloc(dev, sizeof(struct can_transceiver_phy), GFP_KERNEL); if (!can_transceiver_phy) @@ -124,8 +125,8 @@ return PTR_ERR(phy); } - device_property_read_u32(dev, "max-bitrate", &max_bitrate); - if (!max_bitrate) + err = device_property_read_u32(dev, "max-bitrate", &max_bitrate); + if ((err != -EINVAL) && !max_bitrate) dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitrate limit\n"); phy->attrs.max_link_rate = max_bitrate; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ linux-oem-6.1-6.1.0/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -485,8 +485,10 @@ return ret; ret = property_enable(base, &rport->port_cfg->phy_sus, false); - if (ret) + if (ret) { + clk_disable_unprepare(rphy->clk480m); return ret; + } /* waiting for the utmi_clk to become stable */ usleep_range(1500, 2000); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/phy/sunplus/phy-sunplus-usb2.c +++ linux-oem-6.1-6.1.0/drivers/phy/sunplus/phy-sunplus-usb2.c @@ -254,6 +254,9 @@ return PTR_ERR(usbphy->phy_regs); usbphy->moon4_res_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "moon4"); + if (!usbphy->moon4_res_mem) + return -EINVAL; + usbphy->moon4_regs = devm_ioremap(&pdev->dev, usbphy->moon4_res_mem->start, resource_size(usbphy->moon4_res_mem)); if (!usbphy->moon4_regs) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/phy/ti/Kconfig +++ linux-oem-6.1-6.1.0/drivers/phy/ti/Kconfig @@ -23,7 +23,7 @@ config PHY_AM654_SERDES tristate "TI AM654 SERDES support" - depends on OF && ARCH_K3 || COMPILE_TEST + depends on OF && (ARCH_K3 || COMPILE_TEST) depends on COMMON_CLK select GENERIC_PHY select MULTIPLEXER @@ -35,7 +35,7 @@ config PHY_J721E_WIZ tristate "TI J721E WIZ (SERDES Wrapper) support" - depends on OF && ARCH_K3 || COMPILE_TEST + depends on OF && (ARCH_K3 || COMPILE_TEST) depends on HAS_IOMEM && OF_ADDRESS depends on COMMON_CLK select GENERIC_PHY only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/aspeed/pinctrl-aspeed.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/aspeed/pinctrl-aspeed.c @@ -92,10 +92,19 @@ static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx, const struct aspeed_sig_expr *expr) { + int ret; + pr_debug("Disabling signal %s for %s\n", expr->signal, expr->function); - return aspeed_sig_expr_set(ctx, expr, false); + ret = aspeed_sig_expr_eval(ctx, expr, true); + if (ret < 0) + return ret; + + if (ret) + return aspeed_sig_expr_set(ctx, expr, false); + + return 0; } /** @@ -113,7 +122,7 @@ int ret = 0; if (!exprs) - return true; + return -EINVAL; while (*exprs && !ret) { ret = aspeed_sig_expr_disable(ctx, *exprs); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/intel/pinctrl-intel.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/intel/pinctrl-intel.c @@ -1676,6 +1676,12 @@ EXPORT_SYMBOL_GPL(intel_pinctrl_get_soc_data); #ifdef CONFIG_PM_SLEEP +static bool __intel_gpio_is_direct_irq(u32 value) +{ + return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) && + (__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO); +} + static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int pin) { const struct pin_desc *pd = pin_desc_get(pctrl->pctldev, pin); @@ -1709,8 +1715,7 @@ * See https://bugzilla.kernel.org/show_bug.cgi?id=214749. */ value = readl(intel_get_padcfg(pctrl, pin, PADCFG0)); - if ((value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) && - (__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO)) + if (__intel_gpio_is_direct_irq(value)) return true; return false; @@ -1840,7 +1845,12 @@ for (i = 0; i < pctrl->soc->npins; i++) { const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i]; - if (!intel_pinctrl_should_save(pctrl, desc->number)) + if (!(intel_pinctrl_should_save(pctrl, desc->number) || + /* + * If the firmware mangled the register contents too much, + * check the saved value for the Direct IRQ mode. + */ + __intel_gpio_is_direct_irq(pads[i].padcfg0))) continue; intel_restore_padcfg(pctrl, desc->number, PADCFG0, pads[i].padcfg0); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/mediatek/pinctrl-mt8195.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/mediatek/pinctrl-mt8195.c @@ -659,7 +659,7 @@ PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3), PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3), PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3), - PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3), + PIN_FIELD_BASE(13, 13, 4, 0x000, 0x10, 27, 3), PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3), PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3), PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3), @@ -708,7 +708,7 @@ PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3), PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3), PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3), - PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3), + PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 24, 3), PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3), PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3), PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/pinctrl-amd.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/pinctrl-amd.c @@ -628,13 +628,15 @@ /* Each status bit covers four pins */ for (i = 0; i < 4; i++) { regval = readl(regs + i); - /* caused wake on resume context for shared IRQ */ - if (irq < 0 && (regval & BIT(WAKE_STS_OFF))) { + + if (regval & PIN_IRQ_PENDING) dev_dbg(&gpio_dev->pdev->dev, - "Waking due to GPIO %d: 0x%x", + "GPIO %d is active: 0x%x", irqnr + i, regval); + + /* caused wake on resume context for shared IRQ */ + if (irq < 0 && (regval & BIT(WAKE_STS_OFF))) return true; - } if (!(regval & PIN_IRQ_PENDING) || !(regval & BIT(INTERRUPT_MASK_OFF))) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/pinctrl-rockchip.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/pinctrl-rockchip.c @@ -926,19 +926,19 @@ RK_MUXROUTE_PMU(0, RK_PB5, 4, 0x0110, WRITE_MASK_VAL(3, 2, 1)), /* PWM1 IO mux M1 */ RK_MUXROUTE_PMU(0, RK_PC1, 1, 0x0110, WRITE_MASK_VAL(5, 4, 0)), /* PWM2 IO mux M0 */ RK_MUXROUTE_PMU(0, RK_PB6, 4, 0x0110, WRITE_MASK_VAL(5, 4, 1)), /* PWM2 IO mux M1 */ - RK_MUXROUTE_PMU(0, RK_PB3, 2, 0x0300, WRITE_MASK_VAL(0, 0, 0)), /* CAN0 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PB3, 2, 0x0300, WRITE_MASK_VAL(0, 0, 0)), /* CAN0 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PA1, 4, 0x0300, WRITE_MASK_VAL(0, 0, 1)), /* CAN0 IO mux M1 */ RK_MUXROUTE_GRF(1, RK_PA1, 3, 0x0300, WRITE_MASK_VAL(2, 2, 0)), /* CAN1 IO mux M0 */ RK_MUXROUTE_GRF(4, RK_PC3, 3, 0x0300, WRITE_MASK_VAL(2, 2, 1)), /* CAN1 IO mux M1 */ RK_MUXROUTE_GRF(4, RK_PB5, 3, 0x0300, WRITE_MASK_VAL(4, 4, 0)), /* CAN2 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PB2, 4, 0x0300, WRITE_MASK_VAL(4, 4, 1)), /* CAN2 IO mux M1 */ RK_MUXROUTE_GRF(4, RK_PC4, 1, 0x0300, WRITE_MASK_VAL(6, 6, 0)), /* HPDIN IO mux M0 */ - RK_MUXROUTE_PMU(0, RK_PC2, 2, 0x0300, WRITE_MASK_VAL(6, 6, 1)), /* HPDIN IO mux M1 */ + RK_MUXROUTE_GRF(0, RK_PC2, 2, 0x0300, WRITE_MASK_VAL(6, 6, 1)), /* HPDIN IO mux M1 */ RK_MUXROUTE_GRF(3, RK_PB1, 3, 0x0300, WRITE_MASK_VAL(8, 8, 0)), /* GMAC1 IO mux M0 */ RK_MUXROUTE_GRF(4, RK_PA7, 3, 0x0300, WRITE_MASK_VAL(8, 8, 1)), /* GMAC1 IO mux M1 */ RK_MUXROUTE_GRF(4, RK_PD1, 1, 0x0300, WRITE_MASK_VAL(10, 10, 0)), /* HDMITX IO mux M0 */ - RK_MUXROUTE_PMU(0, RK_PC7, 1, 0x0300, WRITE_MASK_VAL(10, 10, 1)), /* HDMITX IO mux M1 */ - RK_MUXROUTE_PMU(0, RK_PB6, 1, 0x0300, WRITE_MASK_VAL(14, 14, 0)), /* I2C2 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PC7, 1, 0x0300, WRITE_MASK_VAL(10, 10, 1)), /* HDMITX IO mux M1 */ + RK_MUXROUTE_GRF(0, RK_PB6, 1, 0x0300, WRITE_MASK_VAL(14, 14, 0)), /* I2C2 IO mux M0 */ RK_MUXROUTE_GRF(4, RK_PB4, 1, 0x0300, WRITE_MASK_VAL(14, 14, 1)), /* I2C2 IO mux M1 */ RK_MUXROUTE_GRF(1, RK_PA0, 1, 0x0304, WRITE_MASK_VAL(0, 0, 0)), /* I2C3 IO mux M0 */ RK_MUXROUTE_GRF(3, RK_PB6, 4, 0x0304, WRITE_MASK_VAL(0, 0, 1)), /* I2C3 IO mux M1 */ @@ -964,7 +964,7 @@ RK_MUXROUTE_GRF(4, RK_PC3, 1, 0x0308, WRITE_MASK_VAL(12, 12, 1)), /* PWM15 IO mux M1 */ RK_MUXROUTE_GRF(3, RK_PD2, 3, 0x0308, WRITE_MASK_VAL(14, 14, 0)), /* SDMMC2 IO mux M0 */ RK_MUXROUTE_GRF(3, RK_PA5, 5, 0x0308, WRITE_MASK_VAL(14, 14, 1)), /* SDMMC2 IO mux M1 */ - RK_MUXROUTE_PMU(0, RK_PB5, 2, 0x030c, WRITE_MASK_VAL(0, 0, 0)), /* SPI0 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PB5, 2, 0x030c, WRITE_MASK_VAL(0, 0, 0)), /* SPI0 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PD3, 3, 0x030c, WRITE_MASK_VAL(0, 0, 1)), /* SPI0 IO mux M1 */ RK_MUXROUTE_GRF(2, RK_PB5, 3, 0x030c, WRITE_MASK_VAL(2, 2, 0)), /* SPI1 IO mux M0 */ RK_MUXROUTE_GRF(3, RK_PC3, 3, 0x030c, WRITE_MASK_VAL(2, 2, 1)), /* SPI1 IO mux M1 */ @@ -973,8 +973,8 @@ RK_MUXROUTE_GRF(4, RK_PB3, 4, 0x030c, WRITE_MASK_VAL(6, 6, 0)), /* SPI3 IO mux M0 */ RK_MUXROUTE_GRF(4, RK_PC2, 2, 0x030c, WRITE_MASK_VAL(6, 6, 1)), /* SPI3 IO mux M1 */ RK_MUXROUTE_GRF(2, RK_PB4, 2, 0x030c, WRITE_MASK_VAL(8, 8, 0)), /* UART1 IO mux M0 */ - RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(8, 8, 1)), /* UART1 IO mux M1 */ - RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(10, 10, 0)), /* UART2 IO mux M0 */ + RK_MUXROUTE_GRF(3, RK_PD6, 4, 0x030c, WRITE_MASK_VAL(8, 8, 1)), /* UART1 IO mux M1 */ + RK_MUXROUTE_GRF(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(10, 10, 0)), /* UART2 IO mux M0 */ RK_MUXROUTE_GRF(1, RK_PD5, 2, 0x030c, WRITE_MASK_VAL(10, 10, 1)), /* UART2 IO mux M1 */ RK_MUXROUTE_GRF(1, RK_PA1, 2, 0x030c, WRITE_MASK_VAL(12, 12, 0)), /* UART3 IO mux M0 */ RK_MUXROUTE_GRF(3, RK_PB7, 4, 0x030c, WRITE_MASK_VAL(12, 12, 1)), /* UART3 IO mux M1 */ @@ -1004,13 +1004,13 @@ RK_MUXROUTE_GRF(3, RK_PD6, 5, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ RK_MUXROUTE_GRF(4, RK_PA0, 4, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ RK_MUXROUTE_GRF(3, RK_PC4, 5, 0x0314, WRITE_MASK_VAL(1, 0, 2)), /* PDM IO mux M2 */ - RK_MUXROUTE_PMU(0, RK_PA5, 3, 0x0314, WRITE_MASK_VAL(3, 2, 0)), /* PCIE20 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PA5, 3, 0x0314, WRITE_MASK_VAL(3, 2, 0)), /* PCIE20 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PD0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 1)), /* PCIE20 IO mux M1 */ RK_MUXROUTE_GRF(1, RK_PB0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 2)), /* PCIE20 IO mux M2 */ - RK_MUXROUTE_PMU(0, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(5, 4, 0)), /* PCIE30X1 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(5, 4, 0)), /* PCIE30X1 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PD2, 4, 0x0314, WRITE_MASK_VAL(5, 4, 1)), /* PCIE30X1 IO mux M1 */ RK_MUXROUTE_GRF(1, RK_PA5, 4, 0x0314, WRITE_MASK_VAL(5, 4, 2)), /* PCIE30X1 IO mux M2 */ - RK_MUXROUTE_PMU(0, RK_PA6, 2, 0x0314, WRITE_MASK_VAL(7, 6, 0)), /* PCIE30X2 IO mux M0 */ + RK_MUXROUTE_GRF(0, RK_PA6, 2, 0x0314, WRITE_MASK_VAL(7, 6, 0)), /* PCIE30X2 IO mux M0 */ RK_MUXROUTE_GRF(2, RK_PD4, 4, 0x0314, WRITE_MASK_VAL(7, 6, 1)), /* PCIE30X2 IO mux M1 */ RK_MUXROUTE_GRF(4, RK_PC2, 4, 0x0314, WRITE_MASK_VAL(7, 6, 2)), /* PCIE30X2 IO mux M2 */ }; @@ -2436,10 +2436,19 @@ case RK3308: case RK3368: case RK3399: + case RK3568: case RK3588: pull_type = bank->pull_type[pin_num / 8]; data >>= bit; data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1; + /* + * In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6, + * where that pull up value becomes 3. + */ + if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) { + if (data == 3) + data = 1; + } return rockchip_pull_list[pull_type][data]; default: @@ -2497,7 +2506,7 @@ } } /* - * In the TRM, pull-up being 1 for everything except the GPIO0_D0-D6, + * In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6, * where that pull up value becomes 3. */ if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/pinctrl-single.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/pinctrl-single.c @@ -372,6 +372,8 @@ if (!pcs->fmask) return 0; function = pinmux_generic_get_function(pctldev, fselector); + if (!function) + return -EINVAL; func = function->data; if (!func) return -EINVAL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c +++ linux-oem-6.1-6.1.0/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c @@ -105,7 +105,7 @@ static const char * const swr_tx_clk_groups[] = { "gpio0" }; static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio14" }; static const char * const swr_rx_clk_groups[] = { "gpio3" }; -static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5", "gpio15" }; +static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" }; static const char * const dmic1_clk_groups[] = { "gpio6" }; static const char * const dmic1_data_groups[] = { "gpio7" }; static const char * const dmic2_clk_groups[] = { "gpio8" }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/surface/aggregator/controller.c +++ linux-oem-6.1-6.1.0/drivers/platform/surface/aggregator/controller.c @@ -1700,8 +1700,10 @@ return status; status = ssam_request_sync_init(rqst, spec->flags); - if (status) + if (status) { + ssam_request_sync_free(rqst); return status; + } ssam_request_sync_set_resp(rqst, rsp); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/surface/aggregator/ssh_request_layer.c +++ linux-oem-6.1-6.1.0/drivers/platform/surface/aggregator/ssh_request_layer.c @@ -916,6 +916,20 @@ if (sshp_parse_command(dev, data, &command, &command_data)) return; + /* + * Check if the message was intended for us. If not, drop it. + * + * Note: We will need to change this to handle debug messages. On newer + * generation devices, these seem to be sent to tid_out=0x03. We as + * host can still receive them as they can be forwarded via an override + * option on SAM, but doing so does not change tid_out=0x00. + */ + if (command->tid_out != 0x00) { + rtl_warn(rtl, "rtl: dropping message not intended for us (tid = %#04x)\n", + command->tid_out); + return; + } + if (ssh_rqid_is_event(get_unaligned_le16(&command->rqid))) ssh_rtl_rx_event(rtl, command, &command_data); else only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/Kconfig +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/Kconfig @@ -8,6 +8,7 @@ config AMD_PMC tristate "AMD SoC PMC driver" depends on ACPI && PCI && RTC_CLASS + select SERIO help The driver provides support for AMD Power Management Controller primarily responsible for S2Idle transactions that are driven from only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmc.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -653,6 +654,33 @@ return -EINVAL; } +static int amd_pmc_czn_wa_irq1(struct amd_pmc_dev *pdev) +{ + struct device *d; + int rc; + + if (!pdev->major) { + rc = amd_pmc_get_smu_version(pdev); + if (rc) + return rc; + } + + if (pdev->major > 64 || (pdev->major == 64 && pdev->minor > 65)) + return 0; + + d = bus_find_device_by_name(&serio_bus, NULL, "serio0"); + if (!d) + return 0; + if (device_may_wakeup(d)) { + dev_info_once(d, "Disabling IRQ1 wakeup source to avoid platform firmware bug\n"); + disable_irq_wake(1); + device_set_wakeup_enable(d, false); + } + put_device(d); + + return 0; +} + static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg) { struct rtc_device *rtc_device; @@ -782,6 +810,25 @@ .check = amd_pmc_s2idle_check, .restore = amd_pmc_s2idle_restore, }; + +static int __maybe_unused amd_pmc_suspend_handler(struct device *dev) +{ + struct amd_pmc_dev *pdev = dev_get_drvdata(dev); + + if (pdev->cpu_id == AMD_CPU_ID_CZN) { + int rc = amd_pmc_czn_wa_irq1(pdev); + + if (rc) { + dev_err(pdev->dev, "failed to adjust keyboard wakeup: %d\n", rc); + return rc; + } + } + + return 0; +} + +static SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL); + #endif static const struct pci_device_id pmc_pci_ids[] = { @@ -932,7 +979,7 @@ if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) { err = amd_pmc_s2d_init(dev); if (err) - return err; + goto err_pci_dev_put; } platform_set_drvdata(pdev, dev); @@ -980,6 +1027,9 @@ .name = "amd_pmc", .acpi_match_table = amd_pmc_acpi_ids, .dev_groups = pmc_groups, +#ifdef CONFIG_SUSPEND + .pm = &amd_pmc_pm, +#endif }, .probe = amd_pmc_probe, .remove = amd_pmc_remove, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/Kconfig +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/Kconfig @@ -6,6 +6,7 @@ config AMD_PMF tristate "AMD Platform Management Framework" depends on ACPI && PCI + depends on POWER_SUPPLY select ACPI_PLATFORM_PROFILE help This driver provides support for the AMD Platform Management Framework. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/auto-mode.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/auto-mode.c @@ -275,13 +275,8 @@ */ if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) { - int mode = amd_pmf_get_pprof_modes(dev); - - if (mode < 0) - return mode; - dev_dbg(dev->dev, "resetting AMT thermals\n"); - amd_pmf_update_slider(dev, SLIDER_OP_SET, mode, NULL); + amd_pmf_set_sps_power_limits(dev); } return 0; } @@ -299,7 +294,5 @@ void amd_pmf_init_auto_mode(struct amd_pmf_dev *dev) { amd_pmf_load_defaults_auto_mode(dev); - /* update the thermal limits for Automode */ - amd_pmf_set_automode(dev, config_store.current_mode, NULL); amd_pmf_init_metrics_table(dev); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/cnqf.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/cnqf.c @@ -103,7 +103,7 @@ src = amd_pmf_cnqf_get_power_source(dev); - if (dev->current_profile == PLATFORM_PROFILE_BALANCED) { + if (is_pprof_balanced(dev)) { amd_pmf_set_cnqf(dev, src, config_store.current_mode, NULL); } else { /* @@ -307,13 +307,9 @@ const char *buf, size_t count) { struct amd_pmf_dev *pdev = dev_get_drvdata(dev); - int mode, result, src; + int result, src; bool input; - mode = amd_pmf_get_pprof_modes(pdev); - if (mode < 0) - return mode; - result = kstrtobool(buf, &input); if (result) return result; @@ -321,11 +317,11 @@ src = amd_pmf_cnqf_get_power_source(pdev); pdev->cnqf_enabled = input; - if (pdev->cnqf_enabled && pdev->current_profile == PLATFORM_PROFILE_BALANCED) { + if (pdev->cnqf_enabled && is_pprof_balanced(pdev)) { amd_pmf_set_cnqf(pdev, src, config_store.current_mode, NULL); } else { if (is_apmf_func_supported(pdev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) - amd_pmf_update_slider(pdev, SLIDER_OP_SET, mode, NULL); + amd_pmf_set_sps_power_limits(pdev); } dev_dbg(pdev->dev, "Received CnQF %s\n", input ? "on" : "off"); @@ -386,7 +382,7 @@ dev->cnqf_enabled = amd_pmf_check_flags(dev); /* update the thermal for CnQF */ - if (dev->cnqf_enabled && dev->current_profile == PLATFORM_PROFILE_BALANCED) { + if (dev->cnqf_enabled && is_pprof_balanced(dev)) { src = amd_pmf_cnqf_get_power_source(dev); amd_pmf_set_cnqf(dev, src, config_store.current_mode, NULL); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/core.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/core.c @@ -58,6 +58,25 @@ module_param(force_load, bool, 0444); MODULE_PARM_DESC(force_load, "Force load this driver on supported older platforms (experimental)"); +static int amd_pmf_pwr_src_notify_call(struct notifier_block *nb, unsigned long event, void *data) +{ + struct amd_pmf_dev *pmf = container_of(nb, struct amd_pmf_dev, pwr_src_notifier); + + if (event != PSY_EVENT_PROP_CHANGED) + return NOTIFY_OK; + + if (is_apmf_func_supported(pmf, APMF_FUNC_AUTO_MODE) || + is_apmf_func_supported(pmf, APMF_FUNC_DYN_SLIDER_DC) || + is_apmf_func_supported(pmf, APMF_FUNC_DYN_SLIDER_AC)) { + if ((pmf->amt_enabled || pmf->cnqf_enabled) && is_pprof_balanced(pmf)) + return NOTIFY_DONE; + } + + amd_pmf_set_sps_power_limits(pmf); + + return NOTIFY_OK; +} + static int current_power_limits_show(struct seq_file *seq, void *unused) { struct amd_pmf_dev *dev = seq->private; @@ -366,14 +385,18 @@ if (!dev->regbase) return -ENOMEM; + mutex_init(&dev->lock); + mutex_init(&dev->update_mutex); + apmf_acpi_init(dev); platform_set_drvdata(pdev, dev); amd_pmf_init_features(dev); apmf_install_handler(dev); amd_pmf_dbgfs_register(dev); - mutex_init(&dev->lock); - mutex_init(&dev->update_mutex); + dev->pwr_src_notifier.notifier_call = amd_pmf_pwr_src_notify_call; + power_supply_reg_notifier(&dev->pwr_src_notifier); + dev_info(dev->dev, "registered PMF device successfully\n"); return 0; @@ -383,11 +406,12 @@ { struct amd_pmf_dev *dev = platform_get_drvdata(pdev); - mutex_destroy(&dev->lock); - mutex_destroy(&dev->update_mutex); + power_supply_unreg_notifier(&dev->pwr_src_notifier); amd_pmf_deinit_features(dev); apmf_acpi_deinit(dev); amd_pmf_dbgfs_unregister(dev); + mutex_destroy(&dev->lock); + mutex_destroy(&dev->update_mutex); kfree(dev->buf); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/pmf.h +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/pmf.h @@ -169,6 +169,7 @@ struct mutex update_mutex; /* protects race between ACPI handler and metrics thread */ bool cnqf_enabled; bool cnqf_supported; + struct notifier_block pwr_src_notifier; }; struct apmf_sps_prop_granular { @@ -391,9 +392,11 @@ void amd_pmf_deinit_sps(struct amd_pmf_dev *dev); int apmf_get_static_slider_granular(struct amd_pmf_dev *pdev, struct apmf_static_slider_granular_output *output); +bool is_pprof_balanced(struct amd_pmf_dev *pmf); int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bool manual, u32 idx); +int amd_pmf_set_sps_power_limits(struct amd_pmf_dev *pmf); /* Auto Mode Layer */ int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mode *data); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/amd/pmf/sps.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/amd/pmf/sps.c @@ -70,6 +70,24 @@ } } +int amd_pmf_set_sps_power_limits(struct amd_pmf_dev *pmf) +{ + int mode; + + mode = amd_pmf_get_pprof_modes(pmf); + if (mode < 0) + return mode; + + amd_pmf_update_slider(pmf, SLIDER_OP_SET, mode, NULL); + + return 0; +} + +bool is_pprof_balanced(struct amd_pmf_dev *pmf) +{ + return (pmf->current_profile == PLATFORM_PROFILE_BALANCED) ? true : false; +} + static int amd_pmf_profile_get(struct platform_profile_handler *pprof, enum platform_profile_option *profile) { @@ -105,15 +123,10 @@ enum platform_profile_option profile) { struct amd_pmf_dev *pmf = container_of(pprof, struct amd_pmf_dev, pprof); - int mode; pmf->current_profile = profile; - mode = amd_pmf_get_pprof_modes(pmf); - if (mode < 0) - return mode; - amd_pmf_update_slider(pmf, SLIDER_OP_SET, mode, NULL); - return 0; + return amd_pmf_set_sps_power_limits(pmf); } int amd_pmf_init_sps(struct amd_pmf_dev *dev) @@ -123,6 +136,9 @@ dev->current_profile = PLATFORM_PROFILE_BALANCED; amd_pmf_load_defaults_sps(dev); + /* update SPS balanced power mode thermals */ + amd_pmf_set_sps_power_limits(dev); + dev->pprof.profile_get = amd_pmf_profile_get; dev->pprof.profile_set = amd_pmf_profile_set; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/apple-gmux.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/apple-gmux.c @@ -64,29 +64,6 @@ static struct apple_gmux_data *apple_gmux_data; -/* - * gmux port offsets. Many of these are not yet used, but may be in the - * future, and it's useful to have them documented here anyhow. - */ -#define GMUX_PORT_VERSION_MAJOR 0x04 -#define GMUX_PORT_VERSION_MINOR 0x05 -#define GMUX_PORT_VERSION_RELEASE 0x06 -#define GMUX_PORT_SWITCH_DISPLAY 0x10 -#define GMUX_PORT_SWITCH_GET_DISPLAY 0x11 -#define GMUX_PORT_INTERRUPT_ENABLE 0x14 -#define GMUX_PORT_INTERRUPT_STATUS 0x16 -#define GMUX_PORT_SWITCH_DDC 0x28 -#define GMUX_PORT_SWITCH_EXTERNAL 0x40 -#define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41 -#define GMUX_PORT_DISCRETE_POWER 0x50 -#define GMUX_PORT_MAX_BRIGHTNESS 0x70 -#define GMUX_PORT_BRIGHTNESS 0x74 -#define GMUX_PORT_VALUE 0xc2 -#define GMUX_PORT_READ 0xd0 -#define GMUX_PORT_WRITE 0xd4 - -#define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4) - #define GMUX_INTERRUPT_ENABLE 0xff #define GMUX_INTERRUPT_DISABLE 0x00 @@ -249,23 +226,6 @@ gmux_pio_write32(gmux_data, port, val); } -static bool gmux_is_indexed(struct apple_gmux_data *gmux_data) -{ - u16 val; - - outb(0xaa, gmux_data->iostart + 0xcc); - outb(0x55, gmux_data->iostart + 0xcd); - outb(0x00, gmux_data->iostart + 0xce); - - val = inb(gmux_data->iostart + 0xcc) | - (inb(gmux_data->iostart + 0xcd) << 8); - - if (val == 0x55aa) - return true; - - return false; -} - /** * DOC: Backlight control * @@ -605,60 +565,43 @@ int ret = -ENXIO; acpi_status status; unsigned long long gpe; + bool indexed = false; + u32 version; if (apple_gmux_data) return -EBUSY; + if (!apple_gmux_detect(pnp, &indexed)) { + pr_info("gmux device not present\n"); + return -ENODEV; + } + gmux_data = kzalloc(sizeof(*gmux_data), GFP_KERNEL); if (!gmux_data) return -ENOMEM; pnp_set_drvdata(pnp, gmux_data); res = pnp_get_resource(pnp, IORESOURCE_IO, 0); - if (!res) { - pr_err("Failed to find gmux I/O resource\n"); - goto err_free; - } - gmux_data->iostart = res->start; gmux_data->iolen = resource_size(res); - if (gmux_data->iolen < GMUX_MIN_IO_LEN) { - pr_err("gmux I/O region too small (%lu < %u)\n", - gmux_data->iolen, GMUX_MIN_IO_LEN); - goto err_free; - } - if (!request_region(gmux_data->iostart, gmux_data->iolen, "Apple gmux")) { pr_err("gmux I/O already in use\n"); goto err_free; } - /* - * Invalid version information may indicate either that the gmux - * device isn't present or that it's a new one that uses indexed - * io - */ - - ver_major = gmux_read8(gmux_data, GMUX_PORT_VERSION_MAJOR); - ver_minor = gmux_read8(gmux_data, GMUX_PORT_VERSION_MINOR); - ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); - if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { - if (gmux_is_indexed(gmux_data)) { - u32 version; - mutex_init(&gmux_data->index_lock); - gmux_data->indexed = true; - version = gmux_read32(gmux_data, - GMUX_PORT_VERSION_MAJOR); - ver_major = (version >> 24) & 0xff; - ver_minor = (version >> 16) & 0xff; - ver_release = (version >> 8) & 0xff; - } else { - pr_info("gmux device not present\n"); - ret = -ENODEV; - goto err_release; - } + if (indexed) { + mutex_init(&gmux_data->index_lock); + gmux_data->indexed = true; + version = gmux_read32(gmux_data, GMUX_PORT_VERSION_MAJOR); + ver_major = (version >> 24) & 0xff; + ver_minor = (version >> 16) & 0xff; + ver_release = (version >> 8) & 0xff; + } else { + ver_major = gmux_read8(gmux_data, GMUX_PORT_VERSION_MAJOR); + ver_minor = gmux_read8(gmux_data, GMUX_PORT_VERSION_MINOR); + ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE); } pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor, ver_release, (gmux_data->indexed ? "indexed" : "classic")); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/asus-nb-wmi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/asus-nb-wmi.c @@ -121,6 +121,10 @@ .tablet_switch_mode = asus_wmi_lid_flip_rog_devid, }; +static struct quirk_entry quirk_asus_ignore_fan = { + .wmi_ignore_fan = true, +}; + static int dmi_matched(const struct dmi_system_id *dmi) { pr_info("Identified laptop model '%s'\n", dmi->ident); @@ -473,6 +477,15 @@ }, .driver_data = &quirk_asus_tablet_mode, }, + { + .callback = dmi_matched, + .ident = "ASUS VivoBook E410MA", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E410MA"), + }, + .driver_data = &quirk_asus_ignore_fan, + }, {}, }; @@ -511,6 +524,7 @@ { KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x32, { KEY_MUTE } }, + { KE_KEY, 0x33, { KEY_SCREENLOCK } }, { KE_KEY, 0x35, { KEY_SCREENLOCK } }, { KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */ { KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, @@ -544,6 +558,7 @@ { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ { KE_KEY, 0x82, { KEY_CAMERA } }, + { KE_KEY, 0x85, { KEY_CAMERA } }, { KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */ { KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */ { KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/asus-wmi.h +++ linux-oem-6.1-6.1.0/drivers/platform/x86/asus-wmi.h @@ -38,6 +38,7 @@ bool store_backlight_power; bool wmi_backlight_set_devstate; bool wmi_force_als_set; + bool wmi_ignore_fan; enum asus_wmi_tablet_switch_mode tablet_switch_mode; int wapf; /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/dell/dell-wmi-privacy.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/dell/dell-wmi-privacy.c @@ -61,7 +61,7 @@ /* privacy mic mute */ { KE_KEY, 0x0001, { KEY_MICMUTE } }, /* privacy camera mute */ - { KE_SW, 0x0002, { SW_CAMERA_LENS_COVER } }, + { KE_VSW, 0x0002, { SW_CAMERA_LENS_COVER } }, { KE_END, 0}, }; @@ -115,11 +115,15 @@ switch (code) { case DELL_PRIVACY_AUDIO_EVENT: /* Mic mute */ - case DELL_PRIVACY_CAMERA_EVENT: /* Camera mute */ priv->last_status = status; sparse_keymap_report_entry(priv->input_dev, key, 1, true); ret = true; break; + case DELL_PRIVACY_CAMERA_EVENT: /* Camera mute */ + priv->last_status = status; + sparse_keymap_report_entry(priv->input_dev, key, !(status & CAMERA_STATUS), false); + ret = true; + break; default: dev_dbg(&priv->wdev->dev, "unknown event type 0x%04x 0x%04x\n", type, code); } @@ -292,7 +296,7 @@ { struct privacy_wmi_data *priv; struct key_entry *keymap; - int ret, i; + int ret, i, j; ret = wmi_has_guid(DELL_PRIVACY_GUID); if (!ret) @@ -304,6 +308,11 @@ dev_set_drvdata(&wdev->dev, priv); priv->wdev = wdev; + + ret = get_current_status(priv->wdev); + if (ret) + return ret; + /* create evdev passing interface */ priv->input_dev = devm_input_allocate_device(&wdev->dev); if (!priv->input_dev) @@ -318,9 +327,20 @@ /* remap the keymap code with Dell privacy key type 0x12 as prefix * KEY_MICMUTE scancode will be reported as 0x120001 */ - for (i = 0; i < ARRAY_SIZE(dell_wmi_keymap_type_0012); i++) { - keymap[i] = dell_wmi_keymap_type_0012[i]; - keymap[i].code |= (0x0012 << 16); + for (i = 0, j = 0; i < ARRAY_SIZE(dell_wmi_keymap_type_0012); i++) { + /* + * Unlike keys where only presses matter, userspace may act + * on switches in both of their positions. Only register + * SW_CAMERA_LENS_COVER if it is actually there. + */ + if (dell_wmi_keymap_type_0012[i].type == KE_VSW && + dell_wmi_keymap_type_0012[i].sw.code == SW_CAMERA_LENS_COVER && + !(priv->features_present & BIT(DELL_PRIVACY_TYPE_CAMERA))) + continue; + + keymap[j] = dell_wmi_keymap_type_0012[i]; + keymap[j].code |= (0x0012 << 16); + j++; } ret = sparse_keymap_setup(priv->input_dev, keymap, NULL); kfree(keymap); @@ -331,11 +351,12 @@ priv->input_dev->name = "Dell Privacy Driver"; priv->input_dev->id.bustype = BUS_HOST; - ret = input_register_device(priv->input_dev); - if (ret) - return ret; + /* Report initial camera-cover status */ + if (priv->features_present & BIT(DELL_PRIVACY_TYPE_CAMERA)) + input_report_switch(priv->input_dev, SW_CAMERA_LENS_COVER, + !(priv->last_status & CAMERA_STATUS)); - ret = get_current_status(priv->wdev); + ret = input_register_device(priv->input_dev); if (ret) return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/gigabyte-wmi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/gigabyte-wmi.c @@ -141,6 +141,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = { DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H-CF"), + DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H WIFI-CF"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M S2H V2"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE AX V2"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE"), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/hp-wmi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/hp-wmi.c @@ -90,6 +90,7 @@ HPWMI_PEAKSHIFT_PERIOD = 0x0F, HPWMI_BATTERY_CHARGE_PERIOD = 0x10, HPWMI_SANITIZATION_MODE = 0x17, + HPWMI_OMEN_KEY = 0x1D, HPWMI_SMART_EXPERIENCE_APP = 0x21, }; @@ -216,6 +217,8 @@ { KE_KEY, 0x213b, { KEY_INFO } }, { KE_KEY, 0x2169, { KEY_ROTATE_DISPLAY } }, { KE_KEY, 0x216a, { KEY_SETUP } }, + { KE_KEY, 0x21a5, { KEY_PROG2 } }, /* HP Omen Key */ + { KE_KEY, 0x21a7, { KEY_FN_ESC } }, { KE_KEY, 0x21a9, { KEY_TOUCHPAD_OFF } }, { KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } }, { KE_KEY, 0x231b, { KEY_HELP } }, @@ -810,6 +813,7 @@ case HPWMI_SMART_ADAPTER: break; case HPWMI_BEZEL_BUTTON: + case HPWMI_OMEN_KEY: key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY); if (key_code < 0) break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/nvidia-wmi-ec-backlight.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/nvidia-wmi-ec-backlight.c @@ -12,6 +12,10 @@ #include #include +static bool force; +module_param(force, bool, 0444); +MODULE_PARM_DESC(force, "Force loading (disable acpi_backlight=xxx checks"); + /** * wmi_brightness_notify() - helper function for calling WMI-wrapped ACPI method * @w: Pointer to the struct wmi_device identified by %WMI_BRIGHTNESS_GUID @@ -91,7 +95,7 @@ int ret; /* drivers/acpi/video_detect.c also checks that SOURCE == EC */ - if (acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec) + if (!force && acpi_video_get_backlight_type() != acpi_backlight_nvidia_wmi_ec) return -ENODEV; /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/simatic-ipc.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/simatic-ipc.c @@ -46,7 +46,8 @@ {SIMATIC_IPC_IPC427D, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE}, {SIMATIC_IPC_IPC427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E}, {SIMATIC_IPC_IPC477E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E}, - {SIMATIC_IPC_IPC427G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G}, + {SIMATIC_IPC_IPCBX_39A, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G}, + {SIMATIC_IPC_IPCPX_39A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G}, }; static int register_platform_devices(u32 station_id) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/sony-laptop.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/sony-laptop.c @@ -1888,14 +1888,21 @@ break; } - ret = sony_call_snc_handle(handle, probe_base, &result); - if (ret) - return ret; + /* + * Only probe if there is a separate probe_base, otherwise the probe call + * is equivalent to __sony_nc_kbd_backlight_mode_set(0), resulting in + * the keyboard backlight being turned off. + */ + if (probe_base) { + ret = sony_call_snc_handle(handle, probe_base, &result); + if (ret) + return ret; - if ((handle == 0x0137 && !(result & 0x02)) || - !(result & 0x01)) { - dprintk("no backlight keyboard found\n"); - return 0; + if ((handle == 0x0137 && !(result & 0x02)) || + !(result & 0x01)) { + dprintk("no backlight keyboard found\n"); + return 0; + } } kbdbl_ctl = kzalloc(sizeof(*kbdbl_ctl), GFP_KERNEL); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/platform/x86/touchscreen_dmi.c +++ linux-oem-6.1-6.1.0/drivers/platform/x86/touchscreen_dmi.c @@ -264,6 +264,23 @@ .properties = connect_tablet9_props, }; +static const struct property_entry csl_panther_tab_hd_props[] = { + PROPERTY_ENTRY_U32("touchscreen-min-x", 1), + PROPERTY_ENTRY_U32("touchscreen-min-y", 20), + PROPERTY_ENTRY_U32("touchscreen-size-x", 1980), + PROPERTY_ENTRY_U32("touchscreen-size-y", 1526), + PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"), + PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), + PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-csl-panther-tab-hd.fw"), + PROPERTY_ENTRY_U32("silead,max-fingers", 10), + { } +}; + +static const struct ts_dmi_data csl_panther_tab_hd_data = { + .acpi_name = "MSSL1680:00", + .properties = csl_panther_tab_hd_props, +}; + static const struct property_entry cube_iwork8_air_props[] = { PROPERTY_ENTRY_U32("touchscreen-min-x", 1), PROPERTY_ENTRY_U32("touchscreen-min-y", 3), @@ -1081,6 +1098,15 @@ }, }, { + /* Chuwi Vi8 (CWI501) */ + .driver_data = (void *)&chuwi_vi8_data, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), + DMI_MATCH(DMI_PRODUCT_NAME, "i86"), + DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.W86JLBNR01"), + }, + }, + { /* Chuwi Vi8 (CWI506) */ .driver_data = (void *)&chuwi_vi8_data, .matches = { @@ -1125,6 +1151,14 @@ }, }, { + /* CSL Panther Tab HD */ + .driver_data = (void *)&csl_panther_tab_hd_data, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "CSL Computer GmbH & Co. KG"), + DMI_MATCH(DMI_PRODUCT_NAME, "CSL Panther Tab HD"), + }, + }, + { /* CUBE iwork8 Air */ .driver_data = (void *)&cube_iwork8_air_data, .matches = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/regulator/da9211-regulator.c +++ linux-oem-6.1-6.1.0/drivers/regulator/da9211-regulator.c @@ -498,6 +498,12 @@ chip->chip_irq = i2c->irq; + ret = da9211_regulator_init(chip); + if (ret < 0) { + dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret); + return ret; + } + if (chip->chip_irq != 0) { ret = devm_request_threaded_irq(chip->dev, chip->chip_irq, NULL, da9211_irq_handler, @@ -512,11 +518,6 @@ dev_warn(chip->dev, "No IRQ configured\n"); } - ret = da9211_regulator_init(chip); - - if (ret < 0) - dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret); - return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/reset/Kconfig +++ linux-oem-6.1-6.1.0/drivers/reset/Kconfig @@ -257,7 +257,7 @@ config RESET_TI_SCI tristate "TI System Control Interface (TI-SCI) reset driver" - depends on TI_SCI_PROTOCOL || COMPILE_TEST + depends on TI_SCI_PROTOCOL || (COMPILE_TEST && TI_SCI_PROTOCOL=n) help This enables the reset driver support over TI System Control Interface available on some new TI's SoCs. If you wish to use reset resources only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/reset/reset-uniphier-glue.c +++ linux-oem-6.1-6.1.0/drivers/reset/reset-uniphier-glue.c @@ -47,7 +47,6 @@ struct device *dev = &pdev->dev; struct uniphier_glue_reset_priv *priv; struct resource *res; - resource_size_t size; int i, ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -60,7 +59,6 @@ return -EINVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - size = resource_size(res); priv->rdata.membase = devm_ioremap_resource(dev, res); if (IS_ERR(priv->rdata.membase)) return PTR_ERR(priv->rdata.membase); @@ -96,7 +94,7 @@ spin_lock_init(&priv->rdata.lock); priv->rdata.rcdev.owner = THIS_MODULE; - priv->rdata.rcdev.nr_resets = size * BITS_PER_BYTE; + priv->rdata.rcdev.nr_resets = resource_size(res) * BITS_PER_BYTE; priv->rdata.rcdev.ops = &reset_simple_ops; priv->rdata.rcdev.of_node = dev->of_node; priv->rdata.active_low = true; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/rtc/rtc-efi.c +++ linux-oem-6.1-6.1.0/drivers/rtc/rtc-efi.c @@ -188,9 +188,10 @@ static int efi_procfs(struct device *dev, struct seq_file *seq) { - efi_time_t eft, alm; - efi_time_cap_t cap; - efi_bool_t enabled, pending; + efi_time_t eft, alm; + efi_time_cap_t cap; + efi_bool_t enabled, pending; + struct rtc_device *rtc = dev_get_drvdata(dev); memset(&eft, 0, sizeof(eft)); memset(&alm, 0, sizeof(alm)); @@ -213,23 +214,25 @@ /* XXX fixme: convert to string? */ seq_printf(seq, "Timezone\t: %u\n", eft.timezone); - seq_printf(seq, - "Alarm Time\t: %u:%u:%u.%09u\n" - "Alarm Date\t: %u-%u-%u\n" - "Alarm Daylight\t: %u\n" - "Enabled\t\t: %s\n" - "Pending\t\t: %s\n", - alm.hour, alm.minute, alm.second, alm.nanosecond, - alm.year, alm.month, alm.day, - alm.daylight, - enabled == 1 ? "yes" : "no", - pending == 1 ? "yes" : "no"); - - if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE) - seq_puts(seq, "Timezone\t: unspecified\n"); - else - /* XXX fixme: convert to string? */ - seq_printf(seq, "Timezone\t: %u\n", alm.timezone); + if (test_bit(RTC_FEATURE_ALARM, rtc->features)) { + seq_printf(seq, + "Alarm Time\t: %u:%u:%u.%09u\n" + "Alarm Date\t: %u-%u-%u\n" + "Alarm Daylight\t: %u\n" + "Enabled\t\t: %s\n" + "Pending\t\t: %s\n", + alm.hour, alm.minute, alm.second, alm.nanosecond, + alm.year, alm.month, alm.day, + alm.daylight, + enabled == 1 ? "yes" : "no", + pending == 1 ? "yes" : "no"); + + if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE) + seq_puts(seq, "Timezone\t: unspecified\n"); + else + /* XXX fixme: convert to string? */ + seq_printf(seq, "Timezone\t: %u\n", alm.timezone); + } /* * now prints the capabilities @@ -269,7 +272,10 @@ rtc->ops = &efi_rtc_ops; clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); - set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features); + if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES)) + set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features); + else + clear_bit(RTC_FEATURE_ALARM, rtc->features); return devm_rtc_register_device(rtc); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/rtc/rtc-sunplus.c +++ linux-oem-6.1-6.1.0/drivers/rtc/rtc-sunplus.c @@ -240,8 +240,8 @@ if (IS_ERR(sp_rtc->reg_base)) return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base), "%s devm_ioremap_resource fail\n", RTC_REG_NAME); - dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n", - sp_rtc->res->start, (unsigned long)sp_rtc->reg_base); + dev_dbg(&plat_dev->dev, "res = %pR, reg_base = %p\n", + sp_rtc->res, sp_rtc->reg_base); sp_rtc->irq = platform_get_irq(plat_dev, 0); if (sp_rtc->irq < 0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/s390/block/dcssblk.c +++ linux-oem-6.1-6.1.0/drivers/s390/block/dcssblk.c @@ -865,6 +865,8 @@ unsigned long bytes_done; bio = bio_split_to_limits(bio); + if (!bio) + return; bytes_done = 0; dev_info = bio->bi_bdev->bd_disk->private_data; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/s390/char/zcore.c +++ linux-oem-6.1-6.1.0/drivers/s390/char/zcore.c @@ -103,7 +103,7 @@ kvec.iov_base = dst; kvec.iov_len = count; - iov_iter_kvec(&iter, WRITE, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); if (memcpy_hsa_iter(&iter, src, count) < count) return -EIO; return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/hisi_sas/hisi_sas_main.c +++ linux-oem-6.1-6.1.0/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -714,7 +714,7 @@ int_to_scsilun(0, &lun); while (retry-- > 0) { - rc = sas_clear_task_set(device, lun.scsi_lun); + rc = sas_abort_task_set(device, lun.scsi_lun); if (rc == TMF_RESP_FUNC_COMPLETE) { hisi_sas_release_task(hisi_hba, device); break; @@ -1334,7 +1334,7 @@ device->linkrate = phy->sas_phy.linkrate; hisi_hba->hw->setup_itct(hisi_hba, sas_dev); - } else + } else if (!port->port_attached) port->id = 0xff; } } @@ -1708,13 +1708,15 @@ return rc; } + /* Remote phy */ if (rc) return rc; - /* Remote phy */ if (dev_is_sata(device)) { - rc = sas_ata_wait_after_reset(device, - HISI_SAS_WAIT_PHYUP_TIMEOUT); + struct ata_link *link = &device->sata_dev.ap->link; + + rc = ata_wait_after_reset(link, HISI_SAS_WAIT_PHYUP_TIMEOUT, + smp_ata_check_ready_type); } else { msleep(2000); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/iscsi_tcp.c +++ linux-oem-6.1-6.1.0/drivers/scsi/iscsi_tcp.c @@ -848,7 +848,7 @@ enum iscsi_host_param param, char *buf) { struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(shost); - struct iscsi_session *session = tcp_sw_host->session; + struct iscsi_session *session; struct iscsi_conn *conn; struct iscsi_tcp_conn *tcp_conn; struct iscsi_sw_tcp_conn *tcp_sw_conn; @@ -858,6 +858,7 @@ switch (param) { case ISCSI_HOST_PARAM_IPADDRESS: + session = tcp_sw_host->session; if (!session) return -ENOTCONN; @@ -958,11 +959,13 @@ if (!cls_session) goto remove_host; session = cls_session->dd_data; - tcp_sw_host = iscsi_host_priv(shost); - tcp_sw_host->session = session; if (iscsi_tcp_r2tpool_alloc(session)) goto remove_session; + + /* We are now fully setup so expose the session to sysfs. */ + tcp_sw_host = iscsi_host_priv(shost); + tcp_sw_host->session = session; return cls_session; remove_session: @@ -982,10 +985,17 @@ if (WARN_ON_ONCE(session->leadconn)) return; + iscsi_session_remove(cls_session); + /* + * Our get_host_param needs to access the session, so remove the + * host from sysfs before freeing the session to make sure userspace + * is no longer accessing the callout. + */ + iscsi_host_remove(shost, false); + iscsi_tcp_r2tpool_free(cls_session->dd_data); - iscsi_session_teardown(cls_session); - iscsi_host_remove(shost, false); + iscsi_session_free(cls_session); iscsi_host_free(shost); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/libiscsi.c +++ linux-oem-6.1-6.1.0/drivers/scsi/libiscsi.c @@ -3104,17 +3104,32 @@ } EXPORT_SYMBOL_GPL(iscsi_session_setup); -/** - * iscsi_session_teardown - destroy session, host, and cls_session - * @cls_session: iscsi session +/* + * issi_session_remove - Remove session from iSCSI class. */ -void iscsi_session_teardown(struct iscsi_cls_session *cls_session) +void iscsi_session_remove(struct iscsi_cls_session *cls_session) { struct iscsi_session *session = cls_session->dd_data; - struct module *owner = cls_session->transport->owner; struct Scsi_Host *shost = session->host; iscsi_remove_session(cls_session); + /* + * host removal only has to wait for its children to be removed from + * sysfs, and iscsi_tcp needs to do iscsi_host_remove before freeing + * the session, so drop the session count here. + */ + iscsi_host_dec_session_cnt(shost); +} +EXPORT_SYMBOL_GPL(iscsi_session_remove); + +/** + * iscsi_session_free - Free iscsi session and it's resources + * @cls_session: iscsi session + */ +void iscsi_session_free(struct iscsi_cls_session *cls_session) +{ + struct iscsi_session *session = cls_session->dd_data; + struct module *owner = cls_session->transport->owner; iscsi_pool_free(&session->cmdpool); kfree(session->password); @@ -3132,10 +3147,19 @@ kfree(session->discovery_parent_type); iscsi_free_session(cls_session); - - iscsi_host_dec_session_cnt(shost); module_put(owner); } +EXPORT_SYMBOL_GPL(iscsi_session_free); + +/** + * iscsi_session_teardown - destroy session and cls_session + * @cls_session: iscsi session + */ +void iscsi_session_teardown(struct iscsi_cls_session *cls_session) +{ + iscsi_session_remove(cls_session); + iscsi_session_free(cls_session); +} EXPORT_SYMBOL_GPL(iscsi_session_teardown); /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/libsas/sas_ata.c +++ linux-oem-6.1-6.1.0/drivers/scsi/libsas/sas_ata.c @@ -287,6 +287,31 @@ return 1; } +int smp_ata_check_ready_type(struct ata_link *link) +{ + struct domain_device *dev = link->ap->private_data; + struct sas_phy *phy = sas_get_local_phy(dev); + struct domain_device *ex_dev = dev->parent; + enum sas_device_type type = SAS_PHY_UNUSED; + u8 sas_addr[SAS_ADDR_SIZE]; + int res; + + res = sas_get_phy_attached_dev(ex_dev, phy->number, sas_addr, &type); + sas_put_local_phy(phy); + if (res) + return res; + + switch (type) { + case SAS_SATA_PENDING: + return 0; + case SAS_END_DEVICE: + return 1; + default: + return -ENODEV; + } +} +EXPORT_SYMBOL_GPL(smp_ata_check_ready_type); + static int smp_ata_check_ready(struct ata_link *link) { int res; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/libsas/sas_expander.c +++ linux-oem-6.1-6.1.0/drivers/scsi/libsas/sas_expander.c @@ -1693,8 +1693,8 @@ return res; } -static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, - u8 *sas_addr, enum sas_device_type *type) +int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, + u8 *sas_addr, enum sas_device_type *type) { int res; struct smp_disc_resp *disc_resp; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/libsas/sas_internal.h +++ linux-oem-6.1-6.1.0/drivers/scsi/libsas/sas_internal.h @@ -84,6 +84,8 @@ int sas_ex_phy_discover(struct domain_device *dev, int single); int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, struct smp_rps_resp *rps_resp); +int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, + u8 *sas_addr, enum sas_device_type *type); int sas_try_ata_reset(struct asd_sas_phy *phy); void sas_hae_reset(struct work_struct *work); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/mpi3mr/Makefile +++ linux-oem-6.1-6.1.0/drivers/scsi/mpi3mr/Makefile @@ -1,5 +1,5 @@ # mpi3mr makefile -obj-m += mpi3mr.o +obj-$(CONFIG_SCSI_MPI3MR) += mpi3mr.o mpi3mr-y += mpi3mr_os.o \ mpi3mr_fw.o \ mpi3mr_app.o \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/scsi_scan.c +++ linux-oem-6.1-6.1.0/drivers/scsi/scsi_scan.c @@ -1233,8 +1233,7 @@ * that no LUN is present, so don't add sdev in these cases. * Two specific examples are: * 1) NetApp targets: return PQ=1, PDT=0x1f - * 2) IBM/2145 targets: return PQ=1, PDT=0 - * 3) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved" + * 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved" * in the UFI 1.0 spec (we cannot rely on reserved bits). * * References: @@ -1248,8 +1247,8 @@ * PDT=00h Direct-access device (floppy) * PDT=1Fh none (no FDD connected to the requested logical unit) */ - if (((result[0] >> 5) == 1 || - (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f)) && + if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && + (result[0] & 0x1f) == 0x1f && !scsi_is_wlun(lun)) { SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: peripheral device type" only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/scsi_transport_iscsi.c +++ linux-oem-6.1-6.1.0/drivers/scsi/scsi_transport_iscsi.c @@ -1677,6 +1677,13 @@ return name; } +static char *iscsi_session_target_state_name[] = { + [ISCSI_SESSION_TARGET_UNBOUND] = "UNBOUND", + [ISCSI_SESSION_TARGET_ALLOCATED] = "ALLOCATED", + [ISCSI_SESSION_TARGET_SCANNED] = "SCANNED", + [ISCSI_SESSION_TARGET_UNBINDING] = "UNBINDING", +}; + int iscsi_session_chkready(struct iscsi_cls_session *session) { int err; @@ -1786,9 +1793,13 @@ if ((scan_data->channel == SCAN_WILD_CARD || scan_data->channel == 0) && (scan_data->id == SCAN_WILD_CARD || - scan_data->id == id)) + scan_data->id == id)) { scsi_scan_target(&session->dev, 0, id, scan_data->lun, scan_data->rescan); + spin_lock_irqsave(&session->lock, flags); + session->target_state = ISCSI_SESSION_TARGET_SCANNED; + spin_unlock_irqrestore(&session->lock, flags); + } } user_scan_exit: @@ -1961,31 +1972,41 @@ struct iscsi_cls_host *ihost = shost->shost_data; unsigned long flags; unsigned int target_id; + bool remove_target = true; ISCSI_DBG_TRANS_SESSION(session, "Unbinding session\n"); /* Prevent new scans and make sure scanning is not in progress */ mutex_lock(&ihost->mutex); spin_lock_irqsave(&session->lock, flags); - if (session->target_id == ISCSI_MAX_TARGET) { + if (session->target_state == ISCSI_SESSION_TARGET_ALLOCATED) { + remove_target = false; + } else if (session->target_state != ISCSI_SESSION_TARGET_SCANNED) { spin_unlock_irqrestore(&session->lock, flags); mutex_unlock(&ihost->mutex); - goto unbind_session_exit; + ISCSI_DBG_TRANS_SESSION(session, + "Skipping target unbinding: Session is unbound/unbinding.\n"); + return; } + session->target_state = ISCSI_SESSION_TARGET_UNBINDING; target_id = session->target_id; session->target_id = ISCSI_MAX_TARGET; spin_unlock_irqrestore(&session->lock, flags); mutex_unlock(&ihost->mutex); - scsi_remove_target(&session->dev); + if (remove_target) + scsi_remove_target(&session->dev); if (session->ida_used) ida_free(&iscsi_sess_ida, target_id); -unbind_session_exit: iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION); ISCSI_DBG_TRANS_SESSION(session, "Completed target removal\n"); + + spin_lock_irqsave(&session->lock, flags); + session->target_state = ISCSI_SESSION_TARGET_UNBOUND; + spin_unlock_irqrestore(&session->lock, flags); } static void __iscsi_destroy_session(struct work_struct *work) @@ -2062,6 +2083,9 @@ session->ida_used = true; } else session->target_id = target_id; + spin_lock_irqsave(&session->lock, flags); + session->target_state = ISCSI_SESSION_TARGET_ALLOCATED; + spin_unlock_irqrestore(&session->lock, flags); dev_set_name(&session->dev, "session%u", session->sid); err = device_add(&session->dev); @@ -4370,6 +4394,19 @@ iscsi_session_attr(discovery_parent_type, ISCSI_PARAM_DISCOVERY_PARENT_TYPE, 0); static ssize_t +show_priv_session_target_state(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent); + + return sysfs_emit(buf, "%s\n", + iscsi_session_target_state_name[session->target_state]); +} + +static ISCSI_CLASS_ATTR(priv_sess, target_state, S_IRUGO, + show_priv_session_target_state, NULL); + +static ssize_t show_priv_session_state(struct device *dev, struct device_attribute *attr, char *buf) { @@ -4471,6 +4508,7 @@ &dev_attr_sess_boot_target.attr, &dev_attr_priv_sess_recovery_tmo.attr, &dev_attr_priv_sess_state.attr, + &dev_attr_priv_sess_target_state.attr, &dev_attr_priv_sess_creator.attr, &dev_attr_sess_chap_out_idx.attr, &dev_attr_sess_chap_in_idx.attr, @@ -4584,6 +4622,8 @@ return S_IRUGO | S_IWUSR; else if (attr == &dev_attr_priv_sess_state.attr) return S_IRUGO; + else if (attr == &dev_attr_priv_sess_target_state.attr) + return S_IRUGO; else if (attr == &dev_attr_priv_sess_creator.attr) return S_IRUGO; else if (attr == &dev_attr_priv_sess_target_id.attr) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/sg.c +++ linux-oem-6.1-6.1.0/drivers/scsi/sg.c @@ -1726,7 +1726,7 @@ Sg_scatter_hold *rsv_schp = &sfp->reserve; struct request_queue *q = sfp->parentdp->device->request_queue; struct rq_map_data *md, map_data; - int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ; + int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? ITER_SOURCE : ITER_DEST; struct scsi_cmnd *scmd; SCSI_LOG_TIMEOUT(4, sg_printk(KERN_INFO, sfp->parentdp, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/scsi/storvsc_drv.c +++ linux-oem-6.1-6.1.0/drivers/scsi/storvsc_drv.c @@ -1823,6 +1823,9 @@ ret = storvsc_do_io(dev, cmd_request, get_cpu()); put_cpu(); + if (ret) + scsi_dma_unmap(scmnd); + if (ret == -EAGAIN) { /* no more space */ ret = SCSI_MLQUEUE_DEVICE_BUSY; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/soc/imx/imx8mp-blk-ctrl.c +++ linux-oem-6.1-6.1.0/drivers/soc/imx/imx8mp-blk-ctrl.c @@ -212,7 +212,7 @@ break; case IMX8MP_HDMIBLK_PD_LCDIF: regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, - BIT(7) | BIT(16) | BIT(17) | BIT(18) | + BIT(16) | BIT(17) | BIT(18) | BIT(19) | BIT(20)); regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, @@ -241,6 +241,7 @@ regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(1)); break; case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: + regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); regmap_clear_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); @@ -270,7 +271,7 @@ BIT(4) | BIT(5) | BIT(6)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, - BIT(7) | BIT(16) | BIT(17) | BIT(18) | + BIT(16) | BIT(17) | BIT(18) | BIT(19) | BIT(20)); break; case IMX8MP_HDMIBLK_PD_PAI: @@ -298,6 +299,7 @@ case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); regmap_clear_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); + regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); break; case IMX8MP_HDMIBLK_PD_HDCP: @@ -590,7 +592,6 @@ ret = PTR_ERR(domain->power_dev); goto cleanup_pds; } - dev_set_name(domain->power_dev, "%s", data->name); domain->genpd.name = data->name; domain->genpd.power_on = imx8mp_blk_ctrl_power_on; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/soc/imx/soc-imx8m.c +++ linux-oem-6.1-6.1.0/drivers/soc/imx/soc-imx8m.c @@ -66,8 +66,8 @@ ocotp_base = of_iomap(np, 0); WARN_ON(!ocotp_base); clk = of_clk_get_by_name(np, NULL); - if (!clk) { - WARN_ON(!clk); + if (IS_ERR(clk)) { + WARN_ON(IS_ERR(clk)); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/soc/qcom/cpr.c +++ linux-oem-6.1-6.1.0/drivers/soc/qcom/cpr.c @@ -1708,12 +1708,16 @@ ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd); if (ret) - return ret; + goto err_remove_genpd; platform_set_drvdata(pdev, drv); cpr_debugfs_init(drv); return 0; + +err_remove_genpd: + pm_genpd_remove(&drv->pd); + return ret; } static int cpr_remove(struct platform_device *pdev) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/spi/spi-cadence-xspi.c +++ linux-oem-6.1-6.1.0/drivers/spi/spi-cadence-xspi.c @@ -177,7 +177,10 @@ #define CDNS_XSPI_CMD_FLD_DSEQ_CMD_3(op) ( \ FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R3_DCNT_H, \ ((op)->data.nbytes >> 16) & 0xffff) | \ - FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R3_NUM_OF_DUMMY, (op)->dummy.nbytes * 8)) + FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R3_NUM_OF_DUMMY, \ + (op)->dummy.buswidth != 0 ? \ + (((op)->dummy.nbytes * 8) / (op)->dummy.buswidth) : \ + 0)) #define CDNS_XSPI_CMD_FLD_DSEQ_CMD_4(op, chipsel) ( \ FIELD_PREP(CDNS_XSPI_CMD_DSEQ_R4_BANK, chipsel) | \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/spi/spi-dw-core.c +++ linux-oem-6.1-6.1.0/drivers/spi/spi-dw-core.c @@ -366,7 +366,7 @@ * will be adjusted at the final stage of the IRQ-based SPI transfer * execution so not to lose the leftover of the incoming data. */ - level = min_t(u16, dws->fifo_len / 2, dws->tx_len); + level = min_t(unsigned int, dws->fifo_len / 2, dws->tx_len); dw_writel(dws, DW_SPI_TXFTLR, level); dw_writel(dws, DW_SPI_RXFTLR, level - 1); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/spi/spi-mt65xx.c +++ linux-oem-6.1-6.1.0/drivers/spi/spi-mt65xx.c @@ -1192,11 +1192,6 @@ else dma_set_max_seg_size(dev, SZ_256K); - ret = devm_request_irq(dev, irq, mtk_spi_interrupt, - IRQF_TRIGGER_NONE, dev_name(dev), master); - if (ret) - return dev_err_probe(dev, ret, "failed to register irq\n"); - mdata->parent_clk = devm_clk_get(dev, "parent-clk"); if (IS_ERR(mdata->parent_clk)) return dev_err_probe(dev, PTR_ERR(mdata->parent_clk), @@ -1258,6 +1253,11 @@ dev_notice(dev, "SPI dma_set_mask(%d) failed, ret:%d\n", addr_bits, ret); + ret = devm_request_irq(dev, irq, mtk_spi_interrupt, + IRQF_TRIGGER_NONE, dev_name(dev), master); + if (ret) + return dev_err_probe(dev, ret, "failed to register irq\n"); + pm_runtime_enable(dev); ret = devm_spi_register_master(dev, master); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h +++ linux-oem-6.1-6.1.0/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h @@ -86,7 +86,7 @@ struct vchiq_instance; -extern enum vchiq_status vchiq_initialise(struct vchiq_instance **pinstance); +extern int vchiq_initialise(struct vchiq_instance **pinstance); extern enum vchiq_status vchiq_shutdown(struct vchiq_instance *instance); extern enum vchiq_status vchiq_connect(struct vchiq_instance *instance); extern enum vchiq_status vchiq_open_service(struct vchiq_instance *instance, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ linux-oem-6.1-6.1.0/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -100,10 +100,10 @@ extern void vchiq_dump_service_use_state(struct vchiq_state *state); -extern enum vchiq_status +extern int vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, enum USE_TYPE_E use_type); -extern enum vchiq_status +extern int vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/target/iscsi/iscsi_target_util.c +++ linux-oem-6.1-6.1.0/drivers/target/iscsi/iscsi_target_util.c @@ -1225,7 +1225,7 @@ return -1; memset(&msg, 0, sizeof(struct msghdr)); - iov_iter_kvec(&msg.msg_iter, READ, iov, iov_count, data); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, iov, iov_count, data); while (msg_data_left(&msg)) { rx_loop = sock_recvmsg(conn->sock, &msg, MSG_WAITALL); @@ -1261,7 +1261,7 @@ memset(&msg, 0, sizeof(struct msghdr)); - iov_iter_kvec(&msg.msg_iter, WRITE, iov, iov_count, data); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, iov, iov_count, data); while (msg_data_left(&msg)) { int tx_loop = sock_sendmsg(conn->sock, &msg); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/target/target_core_file.c +++ linux-oem-6.1-6.1.0/drivers/target/target_core_file.c @@ -337,7 +337,7 @@ len += sg->length; } - iov_iter_bvec(&iter, READ, bvec, sgl_nents, len); + iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len); if (is_write) ret = vfs_iter_write(fd, &iter, &pos, 0); else @@ -473,7 +473,7 @@ len += se_dev->dev_attrib.block_size; } - iov_iter_bvec(&iter, READ, bvec, nolb, len); + iov_iter_bvec(&iter, ITER_SOURCE, bvec, nolb, len); ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0); kfree(bvec); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/target/target_core_tmr.c +++ linux-oem-6.1-6.1.0/drivers/target/target_core_tmr.c @@ -73,8 +73,8 @@ { struct se_session *sess = se_cmd->se_sess; - assert_spin_locked(&sess->sess_cmd_lock); - WARN_ON_ONCE(!irqs_disabled()); + lockdep_assert_held(&sess->sess_cmd_lock); + /* * If command already reached CMD_T_COMPLETE state within * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thermal/gov_fair_share.c +++ linux-oem-6.1-6.1.0/drivers/thermal/gov_fair_share.c @@ -49,11 +49,7 @@ static long get_target_state(struct thermal_zone_device *tz, struct thermal_cooling_device *cdev, int percentage, int level) { - unsigned long max_state; - - cdev->ops->get_max_state(cdev, &max_state); - - return (long)(percentage * level * max_state) / (100 * tz->num_trips); + return (long)(percentage * level * cdev->max_state) / (100 * tz->num_trips); } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ linux-oem-6.1-6.1.0/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -44,11 +44,13 @@ int trip, int *temp) { struct int34x_thermal_zone *d = zone->devdata; - int i; + int i, ret = 0; if (d->override_ops && d->override_ops->get_trip_temp) return d->override_ops->get_trip_temp(zone, trip, temp); + mutex_lock(&d->trip_mutex); + if (trip < d->aux_trip_nr) *temp = d->aux_trips[trip]; else if (trip == d->crt_trip_id) @@ -66,10 +68,12 @@ } } if (i == INT340X_THERMAL_MAX_ACT_TRIP_COUNT) - return -EINVAL; + ret = -EINVAL; } - return 0; + mutex_unlock(&d->trip_mutex); + + return ret; } static int int340x_thermal_get_trip_type(struct thermal_zone_device *zone, @@ -77,11 +81,13 @@ enum thermal_trip_type *type) { struct int34x_thermal_zone *d = zone->devdata; - int i; + int i, ret = 0; if (d->override_ops && d->override_ops->get_trip_type) return d->override_ops->get_trip_type(zone, trip, type); + mutex_lock(&d->trip_mutex); + if (trip < d->aux_trip_nr) *type = THERMAL_TRIP_PASSIVE; else if (trip == d->crt_trip_id) @@ -99,10 +105,12 @@ } } if (i == INT340X_THERMAL_MAX_ACT_TRIP_COUNT) - return -EINVAL; + ret = -EINVAL; } - return 0; + mutex_unlock(&d->trip_mutex); + + return ret; } static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone, @@ -180,6 +188,8 @@ int trip_cnt = int34x_zone->aux_trip_nr; int i; + mutex_lock(&int34x_zone->trip_mutex); + int34x_zone->crt_trip_id = -1; if (!int340x_thermal_get_trip_config(int34x_zone->adev->handle, "_CRT", &int34x_zone->crt_temp)) @@ -207,6 +217,8 @@ int34x_zone->act_trips[i].valid = true; } + mutex_unlock(&int34x_zone->trip_mutex); + return trip_cnt; } EXPORT_SYMBOL_GPL(int340x_thermal_read_trips); @@ -230,6 +242,8 @@ if (!int34x_thermal_zone) return ERR_PTR(-ENOMEM); + mutex_init(&int34x_thermal_zone->trip_mutex); + int34x_thermal_zone->adev = adev; int34x_thermal_zone->override_ops = override_ops; @@ -281,6 +295,7 @@ acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table); kfree(int34x_thermal_zone->aux_trips); err_trip_alloc: + mutex_destroy(&int34x_thermal_zone->trip_mutex); kfree(int34x_thermal_zone); return ERR_PTR(ret); } @@ -292,6 +307,7 @@ thermal_zone_device_unregister(int34x_thermal_zone->zone); acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table); kfree(int34x_thermal_zone->aux_trips); + mutex_destroy(&int34x_thermal_zone->trip_mutex); kfree(int34x_thermal_zone); } EXPORT_SYMBOL_GPL(int340x_thermal_zone_remove); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h +++ linux-oem-6.1-6.1.0/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h @@ -32,6 +32,7 @@ struct thermal_zone_device_ops *override_ops; void *priv_data; struct acpi_lpat_conversion_table *lpat_table; + struct mutex trip_mutex; }; struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thermal/thermal_sysfs.c +++ linux-oem-6.1-6.1.0/drivers/thermal/thermal_sysfs.c @@ -589,13 +589,8 @@ char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); - unsigned long state; - int ret; - ret = cdev->ops->get_max_state(cdev, &state); - if (ret) - return ret; - return sprintf(buf, "%ld\n", state); + return sprintf(buf, "%ld\n", cdev->max_state); } static ssize_t cur_state_show(struct device *dev, struct device_attribute *attr, @@ -625,6 +620,10 @@ if ((long)state < 0) return -EINVAL; + /* Requested state should be less than max_state + 1 */ + if (state > cdev->max_state) + return -EINVAL; + mutex_lock(&cdev->lock); result = cdev->ops->set_cur_state(cdev, state); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thunderbolt/retimer.c +++ linux-oem-6.1-6.1.0/drivers/thunderbolt/retimer.c @@ -427,13 +427,6 @@ { u32 status[TB_MAX_RETIMER_INDEX + 1] = {}; int ret, i, last_idx = 0; - struct usb4_port *usb4; - - usb4 = port->usb4; - if (!usb4) - return 0; - - pm_runtime_get_sync(&usb4->dev); /* * Send broadcast RT to make sure retimer indices facing this @@ -441,7 +434,7 @@ */ ret = usb4_port_enumerate_retimers(port); if (ret) - goto out; + return ret; /* * Enable sideband channel for each retimer. We can do this @@ -471,12 +464,11 @@ break; } - if (!last_idx) { - ret = 0; - goto out; - } + if (!last_idx) + return 0; /* Add on-board retimers if they do not exist already */ + ret = 0; for (i = 1; i <= last_idx; i++) { struct tb_retimer *rt; @@ -490,10 +482,6 @@ } } -out: - pm_runtime_mark_last_busy(&usb4->dev); - pm_runtime_put_autosuspend(&usb4->dev); - return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thunderbolt/tb.c +++ linux-oem-6.1-6.1.0/drivers/thunderbolt/tb.c @@ -628,11 +628,15 @@ * Downstream switch is reachable through two ports. * Only scan on the primary port (link_nr == 0). */ + + if (port->usb4) + pm_runtime_get_sync(&port->usb4->dev); + if (tb_wait_for_port(port, false) <= 0) - return; + goto out_rpm_put; if (port->remote) { tb_port_dbg(port, "port already has a remote\n"); - return; + goto out_rpm_put; } tb_retimer_scan(port, true); @@ -647,12 +651,12 @@ */ if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL) tb_scan_xdomain(port); - return; + goto out_rpm_put; } if (tb_switch_configure(sw)) { tb_switch_put(sw); - return; + goto out_rpm_put; } /* @@ -681,7 +685,7 @@ if (tb_switch_add(sw)) { tb_switch_put(sw); - return; + goto out_rpm_put; } /* Link the switches using both links if available */ @@ -733,6 +737,12 @@ tb_add_dp_resources(sw); tb_scan_switch(sw); + +out_rpm_put: + if (port->usb4) { + pm_runtime_mark_last_busy(&port->usb4->dev); + pm_runtime_put_autosuspend(&port->usb4->dev); + } } static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thunderbolt/tunnel.c +++ linux-oem-6.1-6.1.0/drivers/thunderbolt/tunnel.c @@ -1275,7 +1275,7 @@ return; } else if (!ret) { /* Use maximum link rate if the link valid is not set */ - ret = usb4_usb3_port_max_link_rate(tunnel->src_port); + ret = tb_usb3_max_link_rate(tunnel->dst_port, tunnel->src_port); if (ret < 0) { tb_tunnel_warn(tunnel, "failed to read maximum link rate\n"); return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/thunderbolt/xdomain.c +++ linux-oem-6.1-6.1.0/drivers/thunderbolt/xdomain.c @@ -1419,12 +1419,19 @@ * registered, we notify the userspace that it has changed. */ if (!update) { - struct tb_port *port; + /* + * Now disable lane 1 if bonding was not enabled. Do + * this only if bonding was possible at the beginning + * (that is we are the connection manager and there are + * two lanes). + */ + if (xd->bonding_possible) { + struct tb_port *port; - /* Now disable lane 1 if bonding was not enabled */ - port = tb_port_at(xd->route, tb_xdomain_parent(xd)); - if (!port->bonded) - tb_port_disable(port->dual_link_port); + port = tb_port_at(xd->route, tb_xdomain_parent(xd)); + if (!port->bonded) + tb_port_disable(port->dual_link_port); + } if (device_add(&xd->dev)) { dev_err(&xd->dev, "failed to add XDomain device\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/hvc/hvc_xen.c +++ linux-oem-6.1-6.1.0/drivers/tty/hvc/hvc_xen.c @@ -52,17 +52,22 @@ static struct xencons_info *vtermno_to_xencons(int vtermno) { - struct xencons_info *entry, *n, *ret = NULL; + struct xencons_info *entry, *ret = NULL; + unsigned long flags; - if (list_empty(&xenconsoles)) - return NULL; + spin_lock_irqsave(&xencons_lock, flags); + if (list_empty(&xenconsoles)) { + spin_unlock_irqrestore(&xencons_lock, flags); + return NULL; + } - list_for_each_entry_safe(entry, n, &xenconsoles, list) { + list_for_each_entry(entry, &xenconsoles, list) { if (entry->vtermno == vtermno) { ret = entry; break; } } + spin_unlock_irqrestore(&xencons_lock, flags); return ret; } @@ -223,7 +228,7 @@ { int r; uint64_t v = 0; - unsigned long gfn; + unsigned long gfn, flags; struct xencons_info *info; if (!xen_hvm_domain()) @@ -258,9 +263,9 @@ goto err; info->vtermno = HVC_COOKIE; - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); list_add_tail(&info->list, &xenconsoles); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); return 0; err: @@ -283,6 +288,7 @@ static int xen_pv_console_init(void) { struct xencons_info *info; + unsigned long flags; if (!xen_pv_domain()) return -ENODEV; @@ -299,9 +305,9 @@ /* already configured */ return 0; } - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); xencons_info_pv_init(info, HVC_COOKIE); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); return 0; } @@ -309,6 +315,7 @@ static int xen_initial_domain_console_init(void) { struct xencons_info *info; + unsigned long flags; if (!xen_initial_domain()) return -ENODEV; @@ -323,9 +330,9 @@ info->irq = bind_virq_to_irq(VIRQ_CONSOLE, 0, false); info->vtermno = HVC_COOKIE; - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); list_add_tail(&info->list, &xenconsoles); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); return 0; } @@ -380,10 +387,12 @@ static int xen_console_remove(struct xencons_info *info) { + unsigned long flags; + xencons_disconnect_backend(info); - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); list_del(&info->list); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); if (info->xbdev != NULL) xencons_free(info); else { @@ -464,6 +473,7 @@ { int ret, devid; struct xencons_info *info; + unsigned long flags; devid = dev->nodename[strlen(dev->nodename) - 1] - '0'; if (devid == 0) @@ -482,9 +492,9 @@ ret = xencons_connect_backend(dev, info); if (ret < 0) goto error; - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); list_add_tail(&info->list, &xenconsoles); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); return 0; @@ -584,10 +594,12 @@ info->hvc = hvc_alloc(HVC_COOKIE, info->irq, ops, 256); if (IS_ERR(info->hvc)) { + unsigned long flags; + r = PTR_ERR(info->hvc); - spin_lock(&xencons_lock); + spin_lock_irqsave(&xencons_lock, flags); list_del(&info->list); - spin_unlock(&xencons_lock); + spin_unlock_irqrestore(&xencons_lock, flags); if (info->irq) unbind_from_irqhandler(info->irq, NULL); kfree(info); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/serial/8250/8250_dma.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/8250/8250_dma.c @@ -44,19 +44,39 @@ struct uart_8250_dma *dma = p->dma; struct tty_port *tty_port = &p->port.state->port; struct dma_tx_state state; + enum dma_status dma_status; int count; - dma->rx_running = 0; - dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state); + /* + * New DMA Rx can be started during the completion handler before it + * could acquire port's lock and it might still be ongoing. Don't to + * anything in such case. + */ + dma_status = dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state); + if (dma_status == DMA_IN_PROGRESS) + return; count = dma->rx_size - state.residue; tty_insert_flip_string(tty_port, dma->rx_buf, count); p->port.icount.rx += count; + dma->rx_running = 0; tty_flip_buffer_push(tty_port); } +static void dma_rx_complete(void *param) +{ + struct uart_8250_port *p = param; + struct uart_8250_dma *dma = p->dma; + unsigned long flags; + + spin_lock_irqsave(&p->port.lock, flags); + if (dma->rx_running) + __dma_rx_complete(p); + spin_unlock_irqrestore(&p->port.lock, flags); +} + int serial8250_tx_dma(struct uart_8250_port *p) { struct uart_8250_dma *dma = p->dma; @@ -130,7 +150,7 @@ return -EBUSY; dma->rx_running = 1; - desc->callback = __dma_rx_complete; + desc->callback = dma_rx_complete; desc->callback_param = p; dma->rx_cookie = dmaengine_submit(desc); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/serial/8250/8250_exar.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/8250/8250_exar.c @@ -43,6 +43,12 @@ #define PCI_DEVICE_ID_EXAR_XR17V4358 0x4358 #define PCI_DEVICE_ID_EXAR_XR17V8358 0x8358 +#define PCI_DEVICE_ID_SEALEVEL_710xC 0x1001 +#define PCI_DEVICE_ID_SEALEVEL_720xC 0x1002 +#define PCI_DEVICE_ID_SEALEVEL_740xC 0x1004 +#define PCI_DEVICE_ID_SEALEVEL_780xC 0x1008 +#define PCI_DEVICE_ID_SEALEVEL_716xC 0x1010 + #define UART_EXAR_INT0 0x80 #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */ #define UART_EXAR_SLEEP 0x8b /* Sleep mode */ @@ -638,6 +644,8 @@ nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1); else if (board->num_ports) nr_ports = board->num_ports; + else if (pcidev->vendor == PCI_VENDOR_ID_SEALEVEL) + nr_ports = pcidev->device & 0xff; else nr_ports = pcidev->device & 0x0f; @@ -864,6 +872,12 @@ EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4), EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4), EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8), + + EXAR_DEVICE(SEALEVEL, 710xC, pbn_exar_XR17V35x), + EXAR_DEVICE(SEALEVEL, 720xC, pbn_exar_XR17V35x), + EXAR_DEVICE(SEALEVEL, 740xC, pbn_exar_XR17V35x), + EXAR_DEVICE(SEALEVEL, 780xC, pbn_exar_XR17V35x), + EXAR_DEVICE(SEALEVEL, 716xC, pbn_exar_XR17V35x), { 0, } }; MODULE_DEVICE_TABLE(pci, exar_pci_tbl); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/serial/atmel_serial.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/atmel_serial.c @@ -2673,13 +2673,7 @@ else if (mr == ATMEL_US_PAR_ODD) *parity = 'o'; - /* - * The serial core only rounds down when matching this to a - * supported baud rate. Make sure we don't end up slightly - * lower than one of those, as it would make us fall through - * to a much lower baud rate than we really want. - */ - *baud = port->uartclk / (16 * (quot - 1)); + *baud = port->uartclk / (16 * quot); } static int __init atmel_console_setup(struct console *co, char *options) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/serial/qcom_geni_serial.c +++ linux-oem-6.1-6.1.0/drivers/tty/serial/qcom_geni_serial.c @@ -864,9 +864,10 @@ return IRQ_HANDLED; } -static void get_tx_fifo_size(struct qcom_geni_serial_port *port) +static int setup_fifos(struct qcom_geni_serial_port *port) { struct uart_port *uport; + u32 old_rx_fifo_depth = port->rx_fifo_depth; uport = &port->uport; port->tx_fifo_depth = geni_se_get_tx_fifo_depth(&port->se); @@ -874,6 +875,16 @@ port->rx_fifo_depth = geni_se_get_rx_fifo_depth(&port->se); uport->fifosize = (port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE; + + if (port->rx_fifo && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) { + port->rx_fifo = devm_krealloc(uport->dev, port->rx_fifo, + port->rx_fifo_depth * sizeof(u32), + GFP_KERNEL); + if (!port->rx_fifo) + return -ENOMEM; + } + + return 0; } @@ -888,6 +899,7 @@ u32 rxstale = DEFAULT_BITS_PER_CHAR * STALE_TIMEOUT; u32 proto; u32 pin_swap; + int ret; proto = geni_se_read_proto(&port->se); if (proto != GENI_SE_UART) { @@ -897,7 +909,9 @@ qcom_geni_serial_stop_rx(uport); - get_tx_fifo_size(port); + ret = setup_fifos(port); + if (ret) + return ret; writel(rxstale, uport->membase + SE_UART_RX_STALE_CNT); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/tty/vt/vc_screen.c +++ linux-oem-6.1-6.1.0/drivers/tty/vt/vc_screen.c @@ -386,10 +386,6 @@ uni_mode = use_unicode(inode); attr = use_attributes(inode); - ret = -ENXIO; - vc = vcs_vc(inode, &viewed); - if (!vc) - goto unlock_out; ret = -EINVAL; if (pos < 0) @@ -407,6 +403,11 @@ unsigned int this_round, skip = 0; int size; + ret = -ENXIO; + vc = vcs_vc(inode, &viewed); + if (!vc) + goto unlock_out; + /* Check whether we are above size each round, * as copy_to_user at the end of this loop * could sleep. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/cdns3/cdns3-gadget.c +++ linux-oem-6.1-6.1.0/drivers/usb/cdns3/cdns3-gadget.c @@ -2614,6 +2614,7 @@ u8 req_on_hw_ring = 0; unsigned long flags; int ret = 0; + int val; if (!ep || !request || !ep->desc) return -EINVAL; @@ -2649,6 +2650,13 @@ /* Update ring only if removed request is on pending_req_list list */ if (req_on_hw_ring && link_trb) { + /* Stop DMA */ + writel(EP_CMD_DFLUSH, &priv_dev->regs->ep_cmd); + + /* wait for DFLUSH cleared */ + readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val, + !(val & EP_CMD_DFLUSH), 1, 1000); + link_trb->buffer = cpu_to_le32(TRB_BUFFER(priv_ep->trb_pool_dma + ((priv_req->end_trb + 1) * TRB_SIZE))); link_trb->control = cpu_to_le32((le32_to_cpu(link_trb->control) & TRB_CYCLE) | @@ -2660,6 +2668,10 @@ cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET); + req = cdns3_next_request(&priv_ep->pending_req_list); + if (req) + cdns3_rearm_transfer(priv_ep, 1); + not_found: spin_unlock_irqrestore(&priv_dev->lock, flags); return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/core/hub.c +++ linux-oem-6.1-6.1.0/drivers/usb/core/hub.c @@ -44,6 +44,9 @@ #define USB_PRODUCT_USB5534B 0x5534 #define USB_VENDOR_CYPRESS 0x04b4 #define USB_PRODUCT_CY7C65632 0x6570 +#define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451 +#define USB_PRODUCT_TUSB8041_USB3 0x8140 +#define USB_PRODUCT_TUSB8041_USB2 0x8142 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 @@ -5798,6 +5801,16 @@ .idVendor = USB_VENDOR_GENESYS_LOGIC, .bInterfaceClass = USB_CLASS_HUB, .driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND}, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR + | USB_DEVICE_ID_MATCH_PRODUCT, + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, + .idProduct = USB_PRODUCT_TUSB8041_USB2, + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR + | USB_DEVICE_ID_MATCH_PRODUCT, + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, + .idProduct = USB_PRODUCT_TUSB8041_USB3, + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS, .bDeviceClass = USB_CLASS_HUB}, { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/core/quirks.c +++ linux-oem-6.1-6.1.0/drivers/usb/core/quirks.c @@ -526,6 +526,9 @@ /* DJI CineSSD */ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, + /* Alcor Link AK9563 SC Reader used in 2022 Lenovo ThinkPads */ + { USB_DEVICE(0x2ce3, 0x9563), .driver_info = USB_QUIRK_NO_LPM }, + /* DELL USB GEN2 */ { USB_DEVICE(0x413c, 0xb062), .driver_info = USB_QUIRK_NO_LPM | USB_QUIRK_RESET_RESUME }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/core/usb-acpi.c +++ linux-oem-6.1-6.1.0/drivers/usb/core/usb-acpi.c @@ -37,6 +37,71 @@ } EXPORT_SYMBOL_GPL(usb_acpi_power_manageable); +#define UUID_USB_CONTROLLER_DSM "ce2ee385-00e6-48cb-9f05-2edb927c4899" +#define USB_DSM_DISABLE_U1_U2_FOR_PORT 5 + +/** + * usb_acpi_port_lpm_incapable - check if lpm should be disabled for a port. + * @hdev: USB device belonging to the usb hub + * @index: zero based port index + * + * Some USB3 ports may not support USB3 link power management U1/U2 states + * due to different retimer setup. ACPI provides _DSM method which returns 0x01 + * if U1 and U2 states should be disabled. Evaluate _DSM with: + * Arg0: UUID = ce2ee385-00e6-48cb-9f05-2edb927c4899 + * Arg1: Revision ID = 0 + * Arg2: Function Index = 5 + * Arg3: (empty) + * + * Return 1 if USB3 port is LPM incapable, negative on error, otherwise 0 + */ + +int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) +{ + union acpi_object *obj; + acpi_handle port_handle; + int port1 = index + 1; + guid_t guid; + int ret; + + ret = guid_parse(UUID_USB_CONTROLLER_DSM, &guid); + if (ret) + return ret; + + port_handle = usb_get_hub_port_acpi_handle(hdev, port1); + if (!port_handle) { + dev_dbg(&hdev->dev, "port-%d no acpi handle\n", port1); + return -ENODEV; + } + + if (!acpi_check_dsm(port_handle, &guid, 0, + BIT(USB_DSM_DISABLE_U1_U2_FOR_PORT))) { + dev_dbg(&hdev->dev, "port-%d no _DSM function %d\n", + port1, USB_DSM_DISABLE_U1_U2_FOR_PORT); + return -ENODEV; + } + + obj = acpi_evaluate_dsm(port_handle, &guid, 0, + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); + + if (!obj) + return -ENODEV; + + if (obj->type != ACPI_TYPE_INTEGER) { + dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); + ACPI_FREE(obj); + return -EINVAL; + } + + if (obj->integer.value == 0x01) + ret = 1; + + ACPI_FREE(obj); + + return ret; +} +EXPORT_SYMBOL_GPL(usb_acpi_port_lpm_incapable); + /** * usb_acpi_set_power_state - control usb port's power via acpi power * resource only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/dwc3/Kconfig +++ linux-oem-6.1-6.1.0/drivers/usb/dwc3/Kconfig @@ -3,6 +3,7 @@ config USB_DWC3 tristate "DesignWare USB3 DRD Core Support" depends on (USB || USB_GADGET) && HAS_DMA + depends on (EXTCON || EXTCON=n) select USB_XHCI_PLATFORM if USB_XHCI_HCD select USB_ROLE_SWITCH if USB_DWC3_DUAL_ROLE help @@ -44,7 +45,6 @@ config USB_DWC3_DUAL_ROLE bool "Dual Role mode" depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3)) - depends on (EXTCON=y || EXTCON=USB_DWC3) help This is the default mode of working of DWC3 controller where both host and gadget features are enabled. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/configfs.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/configfs.c @@ -392,6 +392,7 @@ WARN_ON(!list_empty(&gi->string_list)); WARN_ON(!list_empty(&gi->available_func)); kfree(gi->composite.gadget_driver.function); + kfree(gi->composite.gadget_driver.driver.name); kfree(gi); } @@ -1571,7 +1572,6 @@ .max_speed = USB_SPEED_SUPER_PLUS, .driver = { .owner = THIS_MODULE, - .name = "configfs-gadget", }, .match_existing_only = 1, }; @@ -1622,13 +1622,21 @@ gi->composite.gadget_driver = configfs_driver_template; + gi->composite.gadget_driver.driver.name = kasprintf(GFP_KERNEL, + "configfs-gadget.%s", name); + if (!gi->composite.gadget_driver.driver.name) + goto err; + gi->composite.gadget_driver.function = kstrdup(name, GFP_KERNEL); gi->composite.name = gi->composite.gadget_driver.function; if (!gi->composite.gadget_driver.function) - goto err; + goto out_free_driver_name; return &gi->group; + +out_free_driver_name: + kfree(gi->composite.gadget_driver.driver.name); err: kfree(gi); return ERR_PTR(-ENOMEM); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/function/f_fs.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/function/f_fs.c @@ -279,6 +279,11 @@ struct usb_request *req = ffs->ep0req; int ret; + if (!req) { + spin_unlock_irq(&ffs->ev.waitq.lock); + return -EINVAL; + } + req->zero = len < le16_to_cpu(ffs->ev.setup.wLength); spin_unlock_irq(&ffs->ev.waitq.lock); @@ -1892,10 +1897,14 @@ ENTER(); if (!WARN_ON(!ffs->gadget)) { + /* dequeue before freeing ep0req */ + usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req); + mutex_lock(&ffs->mutex); usb_ep_free_request(ffs->gadget->ep0, ffs->ep0req); ffs->ep0req = NULL; ffs->gadget = NULL; clear_bit(FFS_FL_BOUND, &ffs->flags); + mutex_unlock(&ffs->mutex); ffs_data_put(ffs); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/function/f_ncm.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/function/f_ncm.c @@ -83,7 +83,9 @@ /* peak (theoretical) bulk transfer rate in bits-per-second */ static inline unsigned ncm_bitrate(struct usb_gadget *g) { - if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) + if (!g) + return 0; + else if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) return 4250000000U; else if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) return 3750000000U; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/function/f_uac2.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/function/f_uac2.c @@ -1142,6 +1142,7 @@ } std_as_out_if0_desc.bInterfaceNumber = ret; std_as_out_if1_desc.bInterfaceNumber = ret; + std_as_out_if1_desc.bNumEndpoints = 1; uac2->as_out_intf = ret; uac2->as_out_alt = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/legacy/inode.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/legacy/inode.c @@ -229,6 +229,7 @@ */ static const char *CHIP; +static DEFINE_MUTEX(sb_mutex); /* Serialize superblock operations */ /*----------------------------------------------------------------------*/ @@ -2010,13 +2011,20 @@ { struct inode *inode; struct dev_data *dev; + int rc; - if (the_device) - return -ESRCH; + mutex_lock(&sb_mutex); + + if (the_device) { + rc = -ESRCH; + goto Done; + } CHIP = usb_get_gadget_udc_name(); - if (!CHIP) - return -ENODEV; + if (!CHIP) { + rc = -ENODEV; + goto Done; + } /* superblock */ sb->s_blocksize = PAGE_SIZE; @@ -2053,13 +2061,17 @@ * from binding to a controller. */ the_device = dev; - return 0; + rc = 0; + goto Done; -Enomem: + Enomem: kfree(CHIP); CHIP = NULL; + rc = -ENOMEM; - return -ENOMEM; + Done: + mutex_unlock(&sb_mutex); + return rc; } /* "mount -t gadgetfs path /dev/gadget" ends up here */ @@ -2081,6 +2093,7 @@ static void gadgetfs_kill_sb (struct super_block *sb) { + mutex_lock(&sb_mutex); kill_litter_super (sb); if (the_device) { put_dev (the_device); @@ -2088,6 +2101,7 @@ } kfree(CHIP); CHIP = NULL; + mutex_unlock(&sb_mutex); } /*----------------------------------------------------------------------*/ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/legacy/webcam.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/legacy/webcam.c @@ -293,6 +293,7 @@ (const struct uvc_descriptor_header *) &uvc_format_yuv, (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, + (const struct uvc_descriptor_header *) &uvc_color_matching, (const struct uvc_descriptor_header *) &uvc_format_mjpg, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, @@ -305,6 +306,7 @@ (const struct uvc_descriptor_header *) &uvc_format_yuv, (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, + (const struct uvc_descriptor_header *) &uvc_color_matching, (const struct uvc_descriptor_header *) &uvc_format_mjpg, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, @@ -317,6 +319,7 @@ (const struct uvc_descriptor_header *) &uvc_format_yuv, (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, + (const struct uvc_descriptor_header *) &uvc_color_matching, (const struct uvc_descriptor_header *) &uvc_format_mjpg, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/bcm63xx_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -1830,7 +1830,6 @@ bcm63xx_select_phy_mode(udc, true); udc->driver = driver; - driver->driver.bus = NULL; udc->gadget.dev.of_node = udc->dev->of_node; spin_unlock_irqrestore(&udc->lock, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/fsl_qe_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -2285,7 +2285,6 @@ /* lock is needed but whether should use this lock or another */ spin_lock_irqsave(&udc->lock, flags); - driver->driver.bus = NULL; /* hook up the driver */ udc->driver = driver; udc->gadget.speed = driver->max_speed; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/fsl_udc_core.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fsl_udc_core.c @@ -1943,7 +1943,6 @@ /* lock is needed but whether should use this lock or another */ spin_lock_irqsave(&udc_controller->lock, flags); - driver->driver.bus = NULL; /* hook up the driver */ udc_controller->driver = driver; spin_unlock_irqrestore(&udc_controller->lock, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/fusb300_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/fusb300_udc.c @@ -1311,7 +1311,6 @@ struct fusb300 *fusb300 = to_fusb300(g); /* hook up the driver */ - driver->driver.bus = NULL; fusb300->driver = driver; return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/goku_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/goku_udc.c @@ -1375,7 +1375,6 @@ struct goku_udc *dev = to_goku_udc(g); /* hook up the driver */ - driver->driver.bus = NULL; dev->driver = driver; /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/gr_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/gr_udc.c @@ -1906,7 +1906,6 @@ spin_lock(&dev->lock); /* Hook up the driver */ - driver->driver.bus = NULL; dev->driver = driver; /* Get ready for host detection */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/m66592-udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/m66592-udc.c @@ -1454,7 +1454,6 @@ struct m66592 *m66592 = to_m66592(g); /* hook up the driver */ - driver->driver.bus = NULL; m66592->driver = driver; m66592_bset(m66592, M66592_VBSE | M66592_URST, M66592_INTENB0); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/max3420_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/max3420_udc.c @@ -1108,7 +1108,6 @@ spin_lock_irqsave(&udc->lock, flags); /* hook up the driver */ - driver->driver.bus = NULL; udc->driver = driver; udc->gadget.speed = USB_SPEED_FULL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/mv_u3d_core.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/mv_u3d_core.c @@ -1243,7 +1243,6 @@ } /* hook up the driver ... */ - driver->driver.bus = NULL; u3d->driver = driver; u3d->ep0_dir = USB_DIR_OUT; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/mv_udc_core.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/mv_udc_core.c @@ -1359,7 +1359,6 @@ spin_lock_irqsave(&udc->lock, flags); /* hook up the driver ... */ - driver->driver.bus = NULL; udc->driver = driver; udc->usb_state = USB_STATE_ATTACHED; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/net2272.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/net2272.c @@ -1451,7 +1451,6 @@ dev->ep[i].irqs = 0; /* hook up the driver ... */ dev->softconnect = 1; - driver->driver.bus = NULL; dev->driver = driver; /* ... then enable host detection and ep0; and we're ready only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/net2280.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/net2280.c @@ -2423,7 +2423,6 @@ dev->ep[i].irqs = 0; /* hook up the driver ... */ - driver->driver.bus = NULL; dev->driver = driver; retval = device_create_file(&dev->pdev->dev, &dev_attr_function); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/omap_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/omap_udc.c @@ -2066,7 +2066,6 @@ udc->softconnect = 1; /* hook up the driver */ - driver->driver.bus = NULL; udc->driver = driver; spin_unlock_irqrestore(&udc->lock, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/pch_udc.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/pch_udc.c @@ -2908,7 +2908,6 @@ { struct pch_udc_dev *dev = to_pch_udc(g); - driver->driver.bus = NULL; dev->driver = driver; /* get ready for ep0 traffic */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/gadget/udc/snps_udc_core.c +++ linux-oem-6.1-6.1.0/drivers/usb/gadget/udc/snps_udc_core.c @@ -1933,7 +1933,6 @@ struct udc *dev = to_amd5536_udc(g); u32 tmp; - driver->driver.bus = NULL; dev->driver = driver; /* Some gadget drivers use both ep0 directions. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/host/ehci-fsl.c +++ linux-oem-6.1-6.1.0/drivers/usb/host/ehci-fsl.c @@ -29,7 +29,7 @@ #include "ehci-fsl.h" #define DRIVER_DESC "Freescale EHCI Host controller driver" -#define DRV_NAME "ehci-fsl" +#define DRV_NAME "fsl-ehci" static struct hc_driver __read_mostly fsl_ehci_hc_driver; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/host/xhci.c +++ linux-oem-6.1-6.1.0/drivers/usb/host/xhci.c @@ -3974,6 +3974,7 @@ struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_virt_device *virt_dev; struct xhci_slot_ctx *slot_ctx; + unsigned long flags; int i, ret; /* @@ -4000,7 +4001,11 @@ virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; virt_dev->udev = NULL; xhci_disable_slot(xhci, udev->slot_id); + + spin_lock_irqsave(&xhci->lock, flags); xhci_free_virt_device(xhci, udev->slot_id); + spin_unlock_irqrestore(&xhci->lock, flags); + } int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) @@ -5044,6 +5049,7 @@ struct usb_device *udev, enum usb3_link_state state) { struct xhci_hcd *xhci; + struct xhci_port *port; u16 hub_encoded_timeout; int mel; int ret; @@ -5060,6 +5066,13 @@ if (xhci_check_tier_policy(xhci, udev, state) < 0) return USB3_LPM_DISABLED; + /* If connected to root port then check port can handle lpm */ + if (udev->parent && !udev->parent->parent) { + port = xhci->usb3_rhub.ports[udev->portnum - 1]; + if (port->lpm_incapable) + return USB3_LPM_DISABLED; + } + hub_encoded_timeout = xhci_calculate_lpm_timeout(hcd, udev, state); mel = calculate_max_exit_latency(udev, state, hub_encoded_timeout); if (mel < 0) { @@ -5119,7 +5132,7 @@ /* Once a hub descriptor is fetched for a device, we need to update the xHC's * internal data structures for the device. */ -static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, +int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, struct usb_tt *tt, gfp_t mem_flags) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); @@ -5219,6 +5232,7 @@ xhci_free_command(xhci, config_cmd); return ret; } +EXPORT_SYMBOL_GPL(xhci_update_hub_device); static int xhci_get_frame(struct usb_hcd *hcd) { @@ -5502,6 +5516,8 @@ drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->update_hub_device) + drv->update_hub_device = over->update_hub_device; } } EXPORT_SYMBOL_GPL(xhci_init_driver); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/misc/iowarrior.c +++ linux-oem-6.1-6.1.0/drivers/usb/misc/iowarrior.c @@ -814,7 +814,7 @@ break; case USB_DEVICE_ID_CODEMERCS_IOW100: - dev->report_size = 13; + dev->report_size = 12; break; } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/misc/onboard_usb_hub.c +++ linux-oem-6.1-6.1.0/drivers/usb/misc/onboard_usb_hub.c @@ -27,7 +27,10 @@ #include "onboard_usb_hub.h" +static void onboard_hub_attach_usb_driver(struct work_struct *work); + static struct usb_device_driver onboard_hub_usbdev_driver; +static DECLARE_WORK(attach_usb_driver_work, onboard_hub_attach_usb_driver); /************************** Platform driver **************************/ @@ -45,7 +48,6 @@ bool is_powered_on; bool going_away; struct list_head udev_list; - struct work_struct attach_usb_driver_work; struct mutex lock; }; @@ -271,8 +273,7 @@ * This needs to be done deferred to avoid self-deadlocks on systems * with nested onboard hubs. */ - INIT_WORK(&hub->attach_usb_driver_work, onboard_hub_attach_usb_driver); - schedule_work(&hub->attach_usb_driver_work); + schedule_work(&attach_usb_driver_work); return 0; } @@ -285,9 +286,6 @@ hub->going_away = true; - if (&hub->attach_usb_driver_work != current_work()) - cancel_work_sync(&hub->attach_usb_driver_work); - mutex_lock(&hub->lock); /* unbind the USB devices to avoid dangling references to this device */ @@ -431,13 +429,13 @@ { int ret; - ret = platform_driver_register(&onboard_hub_driver); + ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); if (ret) return ret; - ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); + ret = platform_driver_register(&onboard_hub_driver); if (ret) - platform_driver_unregister(&onboard_hub_driver); + usb_deregister_device_driver(&onboard_hub_usbdev_driver); return ret; } @@ -447,6 +445,8 @@ { usb_deregister_device_driver(&onboard_hub_usbdev_driver); platform_driver_unregister(&onboard_hub_driver); + + cancel_work_sync(&attach_usb_driver_work); } module_exit(onboard_hub_exit); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/storage/uas-detect.h +++ linux-oem-6.1-6.1.0/drivers/usb/storage/uas-detect.h @@ -116,6 +116,19 @@ if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2) flags |= US_FL_NO_ATA_1X; + /* + * RTL9210-based enclosure from HIKSEMI, MD202 reportedly have issues + * with UAS. This isn't distinguishable with just idVendor and + * idProduct, use manufacturer and product too. + * + * Reported-by: Hongling Zeng + */ + if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bda && + le16_to_cpu(udev->descriptor.idProduct) == 0x9210 && + (udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) && + (udev->product && !strcmp(udev->product, "MD202"))) + flags |= US_FL_IGNORE_UAS; + usb_stor_adjust_quirks(udev, &flags); if (flags & US_FL_IGNORE_UAS) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/storage/unusual_uas.h +++ linux-oem-6.1-6.1.0/drivers/usb/storage/unusual_uas.h @@ -83,13 +83,6 @@ USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NO_REPORT_LUNS), -/* Reported-by: Hongling Zeng */ -UNUSUAL_DEV(0x0bda, 0x9210, 0x0000, 0x9999, - "Hiksemi", - "External HDD", - USB_SC_DEVICE, USB_PR_DEVICE, NULL, - US_FL_IGNORE_UAS), - /* Reported-by: Benjamin Tissoires */ UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, "Initio Corporation", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/typec/altmodes/displayport.c +++ linux-oem-6.1-6.1.0/drivers/usb/typec/altmodes/displayport.c @@ -419,6 +419,18 @@ [DP_PIN_ASSIGN_F] = "F", }; +/* + * Helper function to extract a peripheral's currently supported + * Pin Assignments from its DisplayPort alternate mode state. + */ +static u8 get_current_pin_assignments(struct dp_altmode *dp) +{ + if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) + return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo); + else + return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo); +} + static ssize_t pin_assignment_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) @@ -445,10 +457,7 @@ goto out_unlock; } - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); - else - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); + assignments = get_current_pin_assignments(dp); if (!(DP_CONF_GET_PIN_ASSIGN(conf) & assignments)) { ret = -EINVAL; @@ -485,10 +494,7 @@ cur = get_count_order(DP_CONF_GET_PIN_ASSIGN(dp->data.conf)); - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); - else - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); + assignments = get_current_pin_assignments(dp); for (i = 0; assignments; assignments >>= 1, i++) { if (assignments & 1) { @@ -529,10 +535,10 @@ /* FIXME: Port can only be DFP_U. */ /* Make sure we have compatiple pin configurations */ - if (!(DP_CAP_DFP_D_PIN_ASSIGN(port->vdo) & - DP_CAP_UFP_D_PIN_ASSIGN(alt->vdo)) && - !(DP_CAP_UFP_D_PIN_ASSIGN(port->vdo) & - DP_CAP_DFP_D_PIN_ASSIGN(alt->vdo))) + if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) & + DP_CAP_PIN_ASSIGN_UFP_D(alt->vdo)) && + !(DP_CAP_PIN_ASSIGN_UFP_D(port->vdo) & + DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo))) return -ENODEV; ret = sysfs_create_group(&alt->dev.kobj, &dp_altmode_group); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/typec/tcpm/tcpm.c +++ linux-oem-6.1-6.1.0/drivers/usb/typec/tcpm/tcpm.c @@ -4594,14 +4594,13 @@ tcpm_set_state(port, ready_state(port), 0); break; case DR_SWAP_CHANGE_DR: - if (port->data_role == TYPEC_HOST) { - tcpm_unregister_altmodes(port); + tcpm_unregister_altmodes(port); + if (port->data_role == TYPEC_HOST) tcpm_set_roles(port, true, port->pwr_role, TYPEC_DEVICE); - } else { + else tcpm_set_roles(port, true, port->pwr_role, TYPEC_HOST); - } tcpm_ams_finish(port); tcpm_set_state(port, ready_state(port), 0); break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/usb/usbip/usbip_common.c +++ linux-oem-6.1-6.1.0/drivers/usb/usbip/usbip_common.c @@ -309,7 +309,7 @@ if (!sock || !buf || !size) return -EINVAL; - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, size); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, size); usbip_dbg_xmit("enter\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vdpa/ifcvf/ifcvf_main.c +++ linux-oem-6.1-6.1.0/drivers/vdpa/ifcvf/ifcvf_main.c @@ -849,7 +849,7 @@ ret = ifcvf_init_hw(vf, pdev); if (ret) { IFCVF_ERR(pdev, "Failed to init IFCVF hw\n"); - return ret; + goto err; } for (i = 0; i < vf->nr_vring; i++) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vdpa/mlx5/core/mlx5_vdpa.h +++ linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/core/mlx5_vdpa.h @@ -116,8 +116,9 @@ int inlen); int mlx5_vdpa_destroy_mkey(struct mlx5_vdpa_dev *mvdev, u32 mkey); int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, - bool *change_map); -int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb); + bool *change_map, unsigned int asid); +int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, + unsigned int asid); void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev); #define mlx5_vdpa_warn(__dev, format, ...) \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vdpa/mlx5/core/mr.c +++ linux-oem-6.1-6.1.0/drivers/vdpa/mlx5/core/mr.c @@ -511,7 +511,8 @@ mutex_unlock(&mr->mkey_mtx); } -static int _mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) +static int _mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, + struct vhost_iotlb *iotlb, unsigned int asid) { struct mlx5_vdpa_mr *mr = &mvdev->mr; int err; @@ -519,42 +520,49 @@ if (mr->initialized) return 0; - if (iotlb) - err = create_user_mr(mvdev, iotlb); - else - err = create_dma_mr(mvdev, mr); - - if (err) - return err; - - err = dup_iotlb(mvdev, iotlb); - if (err) - goto out_err; + if (mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP] == asid) { + if (iotlb) + err = create_user_mr(mvdev, iotlb); + else + err = create_dma_mr(mvdev, mr); + + if (err) + return err; + } + + if (mvdev->group2asid[MLX5_VDPA_CVQ_GROUP] == asid) { + err = dup_iotlb(mvdev, iotlb); + if (err) + goto out_err; + } mr->initialized = true; return 0; out_err: - if (iotlb) - destroy_user_mr(mvdev, mr); - else - destroy_dma_mr(mvdev, mr); + if (mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP] == asid) { + if (iotlb) + destroy_user_mr(mvdev, mr); + else + destroy_dma_mr(mvdev, mr); + } return err; } -int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb) +int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, + unsigned int asid) { int err; mutex_lock(&mvdev->mr.mkey_mtx); - err = _mlx5_vdpa_create_mr(mvdev, iotlb); + err = _mlx5_vdpa_create_mr(mvdev, iotlb, asid); mutex_unlock(&mvdev->mr.mkey_mtx); return err; } int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb, - bool *change_map) + bool *change_map, unsigned int asid) { struct mlx5_vdpa_mr *mr = &mvdev->mr; int err = 0; @@ -566,7 +574,7 @@ *change_map = true; } if (!*change_map) - err = _mlx5_vdpa_create_mr(mvdev, iotlb); + err = _mlx5_vdpa_create_mr(mvdev, iotlb, asid); mutex_unlock(&mr->mkey_mtx); return err; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vdpa/vdpa_user/vduse_dev.c +++ linux-oem-6.1-6.1.0/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1440,6 +1440,9 @@ if (config->config_size > PAGE_SIZE) return false; + if (config->vq_num > 0xffff) + return false; + if (!device_is_allowed(config->device_id)) return false; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vfio/vfio_iommu_type1.c +++ linux-oem-6.1-6.1.0/drivers/vfio/vfio_iommu_type1.c @@ -1856,24 +1856,33 @@ * significantly boosts non-hugetlbfs mappings and doesn't seem to hurt when * hugetlbfs is in use. */ -static void vfio_test_domain_fgsp(struct vfio_domain *domain) +static void vfio_test_domain_fgsp(struct vfio_domain *domain, struct list_head *regions) { - struct page *pages; int ret, order = get_order(PAGE_SIZE * 2); + struct vfio_iova *region; + struct page *pages; + dma_addr_t start; pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); if (!pages) return; - ret = iommu_map(domain->domain, 0, page_to_phys(pages), PAGE_SIZE * 2, - IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE); - if (!ret) { - size_t unmapped = iommu_unmap(domain->domain, 0, PAGE_SIZE); - - if (unmapped == PAGE_SIZE) - iommu_unmap(domain->domain, PAGE_SIZE, PAGE_SIZE); - else - domain->fgsp = true; + list_for_each_entry(region, regions, list) { + start = ALIGN(region->start, PAGE_SIZE * 2); + if (start >= region->end || (region->end - start < PAGE_SIZE * 2)) + continue; + + ret = iommu_map(domain->domain, start, page_to_phys(pages), PAGE_SIZE * 2, + IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE); + if (!ret) { + size_t unmapped = iommu_unmap(domain->domain, start, PAGE_SIZE); + + if (unmapped == PAGE_SIZE) + iommu_unmap(domain->domain, start + PAGE_SIZE, PAGE_SIZE); + else + domain->fgsp = true; + } + break; } __free_pages(pages, order); @@ -2326,7 +2335,7 @@ } } - vfio_test_domain_fgsp(domain); + vfio_test_domain_fgsp(domain, &iova_copy); /* replay mappings on new domains */ ret = vfio_iommu_replay(iommu, domain); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vhost/net.c +++ linux-oem-6.1-6.1.0/drivers/vhost/net.c @@ -611,7 +611,7 @@ /* Skip header. TODO: support TSO. */ size_t len = iov_length(vq->iov, out); - iov_iter_init(iter, WRITE, vq->iov, out, len); + iov_iter_init(iter, ITER_SOURCE, vq->iov, out, len); iov_iter_advance(iter, hdr_size); return iov_iter_count(iter); @@ -1184,14 +1184,14 @@ msg.msg_control = vhost_net_buf_consume(&nvq->rxq); /* On overrun, truncate and discard */ if (unlikely(headcount > UIO_MAXIOV)) { - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); + iov_iter_init(&msg.msg_iter, ITER_DEST, vq->iov, 1, 1); err = sock->ops->recvmsg(sock, &msg, 1, MSG_DONTWAIT | MSG_TRUNC); pr_debug("Discarded rx packet: len %zd\n", sock_len); continue; } /* We don't need to be notified again. */ - iov_iter_init(&msg.msg_iter, READ, vq->iov, in, vhost_len); + iov_iter_init(&msg.msg_iter, ITER_DEST, vq->iov, in, vhost_len); fixup = msg.msg_iter; if (unlikely((vhost_hlen))) { /* We will supply the header ourselves @@ -1511,6 +1511,9 @@ nvq = &n->vqs[index]; mutex_lock(&vq->mutex); + if (fd == -1) + vhost_clear_msg(&n->dev); + /* Verify that ring has been setup correctly. */ if (!vhost_vq_access_ok(vq)) { r = -EFAULT; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vhost/scsi.c +++ linux-oem-6.1-6.1.0/drivers/vhost/scsi.c @@ -80,7 +80,7 @@ struct scatterlist *tvc_prot_sgl; struct page **tvc_upages; /* Pointer to response header iovec */ - struct iovec tvc_resp_iov; + struct iovec *tvc_resp_iov; /* Pointer to vhost_scsi for our device */ struct vhost_scsi *tvc_vhost; /* Pointer to vhost_virtqueue for the cmd */ @@ -563,7 +563,7 @@ memcpy(v_rsp.sense, cmd->tvc_sense_buf, se_cmd->scsi_sense_length); - iov_iter_init(&iov_iter, READ, &cmd->tvc_resp_iov, + iov_iter_init(&iov_iter, ITER_DEST, cmd->tvc_resp_iov, cmd->tvc_in_iovs, sizeof(v_rsp)); ret = copy_to_iter(&v_rsp, sizeof(v_rsp), &iov_iter); if (likely(ret == sizeof(v_rsp))) { @@ -594,6 +594,7 @@ struct vhost_scsi_cmd *cmd; struct vhost_scsi_nexus *tv_nexus; struct scatterlist *sg, *prot_sg; + struct iovec *tvc_resp_iov; struct page **pages; int tag; @@ -613,6 +614,7 @@ sg = cmd->tvc_sgl; prot_sg = cmd->tvc_prot_sgl; pages = cmd->tvc_upages; + tvc_resp_iov = cmd->tvc_resp_iov; memset(cmd, 0, sizeof(*cmd)); cmd->tvc_sgl = sg; cmd->tvc_prot_sgl = prot_sg; @@ -625,6 +627,7 @@ cmd->tvc_data_direction = data_direction; cmd->tvc_nexus = tv_nexus; cmd->inflight = vhost_scsi_get_inflight(vq); + cmd->tvc_resp_iov = tvc_resp_iov; memcpy(cmd->tvc_cdb, cdb, VHOST_SCSI_MAX_CDB_SIZE); @@ -864,7 +867,7 @@ * point at the start of the outgoing WRITE payload, if * DMA_TO_DEVICE is set. */ - iov_iter_init(&vc->out_iter, WRITE, vq->iov, vc->out, vc->out_size); + iov_iter_init(&vc->out_iter, ITER_SOURCE, vq->iov, vc->out, vc->out_size); ret = 0; done: @@ -935,7 +938,7 @@ struct iov_iter in_iter, prot_iter, data_iter; u64 tag; u32 exp_data_len, data_direction; - int ret, prot_bytes, c = 0; + int ret, prot_bytes, i, c = 0; u16 lun; u8 task_attr; bool t10_pi = vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI); @@ -1016,7 +1019,7 @@ data_direction = DMA_FROM_DEVICE; exp_data_len = vc.in_size - vc.rsp_size; - iov_iter_init(&in_iter, READ, &vq->iov[vc.out], vc.in, + iov_iter_init(&in_iter, ITER_DEST, &vq->iov[vc.out], vc.in, vc.rsp_size + exp_data_len); iov_iter_advance(&in_iter, vc.rsp_size); data_iter = in_iter; @@ -1092,7 +1095,8 @@ } cmd->tvc_vhost = vs; cmd->tvc_vq = vq; - cmd->tvc_resp_iov = vq->iov[vc.out]; + for (i = 0; i < vc.in ; i++) + cmd->tvc_resp_iov[i] = vq->iov[vc.out + i]; cmd->tvc_in_iovs = vc.in; pr_debug("vhost_scsi got command opcode: %#02x, lun: %d\n", @@ -1146,7 +1150,7 @@ memset(&rsp, 0, sizeof(rsp)); rsp.response = tmf_resp_code; - iov_iter_init(&iov_iter, READ, resp_iov, in_iovs, sizeof(rsp)); + iov_iter_init(&iov_iter, ITER_DEST, resp_iov, in_iovs, sizeof(rsp)); ret = copy_to_iter(&rsp, sizeof(rsp), &iov_iter); if (likely(ret == sizeof(rsp))) @@ -1238,7 +1242,7 @@ memset(&rsp, 0, sizeof(rsp)); /* event_actual = 0 */ rsp.response = VIRTIO_SCSI_S_OK; - iov_iter_init(&iov_iter, READ, &vq->iov[vc->out], vc->in, sizeof(rsp)); + iov_iter_init(&iov_iter, ITER_DEST, &vq->iov[vc->out], vc->in, sizeof(rsp)); ret = copy_to_iter(&rsp, sizeof(rsp), &iov_iter); if (likely(ret == sizeof(rsp))) @@ -1461,6 +1465,7 @@ kfree(tv_cmd->tvc_sgl); kfree(tv_cmd->tvc_prot_sgl); kfree(tv_cmd->tvc_upages); + kfree(tv_cmd->tvc_resp_iov); } sbitmap_free(&svq->scsi_tags); @@ -1508,6 +1513,14 @@ goto out; } + tv_cmd->tvc_resp_iov = kcalloc(UIO_MAXIOV, + sizeof(struct iovec), + GFP_KERNEL); + if (!tv_cmd->tvc_resp_iov) { + pr_err("Unable to allocate tv_cmd->tvc_resp_iov\n"); + goto out; + } + tv_cmd->tvc_prot_sgl = kcalloc(VHOST_SCSI_PREALLOC_PROT_SGLS, sizeof(struct scatterlist), GFP_KERNEL); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/vhost/vhost.h +++ linux-oem-6.1-6.1.0/drivers/vhost/vhost.h @@ -181,6 +181,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp); bool vhost_vq_access_ok(struct vhost_virtqueue *vq); bool vhost_log_access_ok(struct vhost_dev *); +void vhost_clear_msg(struct vhost_dev *dev); int vhost_get_vq_desc(struct vhost_virtqueue *, struct iovec iov[], unsigned int iov_count, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/video/fbdev/core/fb_defio.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fb_defio.c @@ -313,7 +313,7 @@ } EXPORT_SYMBOL_GPL(fb_deferred_io_open); -void fb_deferred_io_cleanup(struct fb_info *info) +void fb_deferred_io_release(struct fb_info *info) { struct fb_deferred_io *fbdefio = info->fbdefio; struct page *page; @@ -327,6 +327,14 @@ page = fb_deferred_io_page(info, i); page->mapping = NULL; } +} +EXPORT_SYMBOL_GPL(fb_deferred_io_release); + +void fb_deferred_io_cleanup(struct fb_info *info) +{ + struct fb_deferred_io *fbdefio = info->fbdefio; + + fb_deferred_io_release(info); kvfree(info->pagerefs); mutex_destroy(&fbdefio->lock); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/video/fbdev/core/fbmem.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/core/fbmem.c @@ -1453,6 +1453,10 @@ struct fb_info * const info = file->private_data; lock_fb_info(info); +#if IS_ENABLED(CONFIG_FB_DEFERRED_IO) + if (info->fbdefio) + fb_deferred_io_release(info); +#endif if (info->fbops->fb_release) info->fbops->fb_release(info,1); module_put(info->fbops->owner); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/video/fbdev/nvidia/nvidia.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/nvidia/nvidia.c @@ -1197,17 +1197,17 @@ return nvidiafb_check_var(&info->var, info); } -static u32 nvidia_get_chipset(struct fb_info *info) +static u32 nvidia_get_chipset(struct pci_dev *pci_dev, + volatile u32 __iomem *REGS) { - struct nvidia_par *par = info->par; - u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device; + u32 id = (pci_dev->vendor << 16) | pci_dev->device; printk(KERN_INFO PFX "Device ID: %x \n", id); if ((id & 0xfff0) == 0x00f0 || (id & 0xfff0) == 0x02e0) { /* pci-e */ - id = NV_RD32(par->REGS, 0x1800); + id = NV_RD32(REGS, 0x1800); if ((id & 0x0000ffff) == 0x000010DE) id = 0x10DE0000 | (id >> 16); @@ -1220,12 +1220,11 @@ return id; } -static u32 nvidia_get_arch(struct fb_info *info) +static u32 nvidia_get_arch(u32 Chipset) { - struct nvidia_par *par = info->par; u32 arch = 0; - switch (par->Chipset & 0x0ff0) { + switch (Chipset & 0x0ff0) { case 0x0100: /* GeForce 256 */ case 0x0110: /* GeForce2 MX */ case 0x0150: /* GeForce2 */ @@ -1278,16 +1277,44 @@ struct fb_info *info; unsigned short cmd; int ret; + volatile u32 __iomem *REGS; + int Chipset; + u32 Architecture; NVTRACE_ENTER(); assert(pd != NULL); + if (pci_enable_device(pd)) { + printk(KERN_ERR PFX "cannot enable PCI device\n"); + return -ENODEV; + } + + /* enable IO and mem if not already done */ + pci_read_config_word(pd, PCI_COMMAND, &cmd); + cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); + pci_write_config_word(pd, PCI_COMMAND, cmd); + + nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); + nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); + + REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); + if (!REGS) { + printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); + return -ENODEV; + } + + Chipset = nvidia_get_chipset(pd, REGS); + Architecture = nvidia_get_arch(Chipset); + if (Architecture == 0) { + printk(KERN_ERR PFX "unknown NV_ARCH\n"); + goto err_out; + } + ret = aperture_remove_conflicting_pci_devices(pd, "nvidiafb"); if (ret) - return ret; + goto err_out; info = framebuffer_alloc(sizeof(struct nvidia_par), &pd->dev); - if (!info) goto err_out; @@ -1298,11 +1325,6 @@ if (info->pixmap.addr == NULL) goto err_out_kfree; - if (pci_enable_device(pd)) { - printk(KERN_ERR PFX "cannot enable PCI device\n"); - goto err_out_enable; - } - if (pci_request_regions(pd, "nvidiafb")) { printk(KERN_ERR PFX "cannot request PCI regions\n"); goto err_out_enable; @@ -1318,34 +1340,17 @@ par->paneltweak = paneltweak; par->reverse_i2c = reverse_i2c; - /* enable IO and mem if not already done */ - pci_read_config_word(pd, PCI_COMMAND, &cmd); - cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); - pci_write_config_word(pd, PCI_COMMAND, cmd); - - nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); nvidiafb_fix.smem_start = pci_resource_start(pd, 1); - nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); - - par->REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); - - if (!par->REGS) { - printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); - goto err_out_free_base0; - } - par->Chipset = nvidia_get_chipset(info); - par->Architecture = nvidia_get_arch(info); + par->REGS = REGS; - if (par->Architecture == 0) { - printk(KERN_ERR PFX "unknown NV_ARCH\n"); - goto err_out_arch; - } + par->Chipset = Chipset; + par->Architecture = Architecture; sprintf(nvidiafb_fix.id, "NV%x", (pd->device & 0x0ff0) >> 4); if (NVCommonSetup(info)) - goto err_out_arch; + goto err_out_free_base0; par->FbAddress = nvidiafb_fix.smem_start; par->FbMapSize = par->RamAmountKBytes * 1024; @@ -1401,7 +1406,6 @@ goto err_out_iounmap_fb; } - printk(KERN_INFO PFX "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", info->fix.id, @@ -1415,15 +1419,14 @@ err_out_free_base1: fb_destroy_modedb(info->monspecs.modedb); nvidia_delete_i2c_busses(par); -err_out_arch: - iounmap(par->REGS); - err_out_free_base0: +err_out_free_base0: pci_release_regions(pd); err_out_enable: kfree(info->pixmap.addr); err_out_kfree: framebuffer_release(info); err_out: + iounmap(REGS); return -ENODEV; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -1536,22 +1536,28 @@ { struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); unsigned long flags; - struct dsi_irq_stats stats; + struct dsi_irq_stats *stats; + + stats = kzalloc(sizeof(*stats), GFP_KERNEL); + if (!stats) { + seq_printf(s, "out of memory\n"); + return; + } spin_lock_irqsave(&dsi->irq_stats_lock, flags); - stats = dsi->irq_stats; + *stats = dsi->irq_stats; memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); dsi->irq_stats.last_reset = jiffies; spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); seq_printf(s, "period %u ms\n", - jiffies_to_msecs(jiffies - stats.last_reset)); + jiffies_to_msecs(jiffies - stats->last_reset)); - seq_printf(s, "irqs %d\n", stats.irq_count); + seq_printf(s, "irqs %d\n", stats->irq_count); #define PIS(x) \ - seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]) + seq_printf(s, "%-20s %10d\n", #x, stats->dsi_irqs[ffs(DSI_IRQ_##x)-1]) seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); PIS(VC0); @@ -1575,10 +1581,10 @@ #define PIS(x) \ seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \ - stats.vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ - stats.vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); + stats->vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ + stats->vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); seq_printf(s, "-- VC interrupts --\n"); PIS(CS); @@ -1594,7 +1600,7 @@ #define PIS(x) \ seq_printf(s, "%-20s %10d\n", #x, \ - stats.cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); + stats->cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); seq_printf(s, "-- CIO interrupts --\n"); PIS(ERRSYNCESC1); @@ -1618,6 +1624,8 @@ PIS(ULPSACTIVENOT_ALL0); PIS(ULPSACTIVENOT_ALL1); #undef PIS + + kfree(stats); } static void dsi1_dump_irqs(struct seq_file *s) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/video/fbdev/smscufx.c +++ linux-oem-6.1-6.1.0/drivers/video/fbdev/smscufx.c @@ -1622,7 +1622,7 @@ struct usb_device *usbdev; struct ufx_data *dev; struct fb_info *info; - int retval; + int retval = -ENOMEM; u32 id_rev, fpga_rev; /* usb initialization */ @@ -1654,15 +1654,17 @@ if (!ufx_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { dev_err(dev->gdev, "ufx_alloc_urb_list failed\n"); - goto e_nomem; + goto put_ref; } /* We don't register a new USB class. Our client interface is fbdev */ /* allocates framebuffer driver structure, not framebuffer memory */ info = framebuffer_alloc(0, &usbdev->dev); - if (!info) - goto e_nomem; + if (!info) { + dev_err(dev->gdev, "framebuffer_alloc failed\n"); + goto free_urb_list; + } dev->info = info; info->par = dev; @@ -1705,22 +1707,34 @@ check_warn_goto_error(retval, "unable to find common mode for display and adapter"); retval = ufx_reg_set_bits(dev, 0x4000, 0x00000001); - check_warn_goto_error(retval, "error %d enabling graphics engine", retval); + if (retval < 0) { + dev_err(dev->gdev, "error %d enabling graphics engine", retval); + goto setup_modes; + } /* ready to begin using device */ atomic_set(&dev->usb_active, 1); dev_dbg(dev->gdev, "checking var"); retval = ufx_ops_check_var(&info->var, info); - check_warn_goto_error(retval, "error %d ufx_ops_check_var", retval); + if (retval < 0) { + dev_err(dev->gdev, "error %d ufx_ops_check_var", retval); + goto reset_active; + } dev_dbg(dev->gdev, "setting par"); retval = ufx_ops_set_par(info); - check_warn_goto_error(retval, "error %d ufx_ops_set_par", retval); + if (retval < 0) { + dev_err(dev->gdev, "error %d ufx_ops_set_par", retval); + goto reset_active; + } dev_dbg(dev->gdev, "registering framebuffer"); retval = register_framebuffer(info); - check_warn_goto_error(retval, "error %d register_framebuffer", retval); + if (retval < 0) { + dev_err(dev->gdev, "error %d register_framebuffer", retval); + goto reset_active; + } dev_info(dev->gdev, "SMSC UDX USB device /dev/fb%d attached. %dx%d resolution." " Using %dK framebuffer memory\n", info->node, @@ -1728,21 +1742,23 @@ return 0; -error: - fb_dealloc_cmap(&info->cmap); -destroy_modedb: +reset_active: + atomic_set(&dev->usb_active, 0); +setup_modes: fb_destroy_modedb(info->monspecs.modedb); vfree(info->screen_base); fb_destroy_modelist(&info->modelist); +error: + fb_dealloc_cmap(&info->cmap); +destroy_modedb: framebuffer_release(info); +free_urb_list: + if (dev->urbs.count > 0) + ufx_free_urb_list(dev); put_ref: kref_put(&dev->kref, ufx_free); /* ref for framebuffer */ kref_put(&dev->kref, ufx_free); /* last ref from kref_init */ return retval; - -e_nomem: - retval = -ENOMEM; - goto put_ref; } static void ufx_usb_disconnect(struct usb_interface *interface) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/virtio/virtio_pci_modern.c +++ linux-oem-6.1-6.1.0/drivers/virtio/virtio_pci_modern.c @@ -303,7 +303,7 @@ int err; if (index >= vp_modern_get_num_queues(mdev)) - return ERR_PTR(-ENOENT); + return ERR_PTR(-EINVAL); /* Check if queue is either not available or already active. */ num = vp_modern_get_queue_size(mdev, index); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/w1/w1.c +++ linux-oem-6.1-6.1.0/drivers/w1/w1.c @@ -1166,6 +1166,8 @@ /* remainder if it woke up early */ unsigned long jremain = 0; + atomic_inc(&dev->refcnt); + for (;;) { if (!jremain && dev->search_count) { @@ -1193,8 +1195,10 @@ */ mutex_unlock(&dev->list_mutex); - if (kthread_should_stop()) + if (kthread_should_stop()) { + __set_current_state(TASK_RUNNING); break; + } /* Only sleep when the search is active. */ if (dev->search_count) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/w1/w1_int.c +++ linux-oem-6.1-6.1.0/drivers/w1/w1_int.c @@ -51,10 +51,9 @@ dev->search_count = w1_search_count; dev->enable_pullup = w1_enable_pullup; - /* 1 for w1_process to decrement - * 1 for __w1_remove_master_device to decrement + /* For __w1_remove_master_device to decrement */ - atomic_set(&dev->refcnt, 2); + atomic_set(&dev->refcnt, 1); INIT_LIST_HEAD(&dev->slist); INIT_LIST_HEAD(&dev->async_list); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/watchdog/diag288_wdt.c +++ linux-oem-6.1-6.1.0/drivers/watchdog/diag288_wdt.c @@ -86,7 +86,7 @@ "1:\n" EX_TABLE(0b, 1b) : "+d" (err) : "d"(__func), "d"(__timeout), - "d"(__action), "d"(__len) : "1", "cc"); + "d"(__action), "d"(__len) : "1", "cc", "memory"); return err; } @@ -268,12 +268,21 @@ char ebc_begin[] = { 194, 197, 199, 201, 213 }; + char *ebc_cmd; watchdog_set_nowayout(&wdt_dev, nowayout_info); if (MACHINE_IS_VM) { - if (__diag288_vm(WDT_FUNC_INIT, 15, - ebc_begin, sizeof(ebc_begin)) != 0) { + ebc_cmd = kmalloc(sizeof(ebc_begin), GFP_KERNEL); + if (!ebc_cmd) { + pr_err("The watchdog cannot be initialized\n"); + return -ENOMEM; + } + memcpy(ebc_cmd, ebc_begin, sizeof(ebc_begin)); + ret = __diag288_vm(WDT_FUNC_INIT, 15, + ebc_cmd, sizeof(ebc_begin)); + kfree(ebc_cmd); + if (ret != 0) { pr_err("The watchdog cannot be initialized\n"); return -EINVAL; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/xen/pvcalls-back.c +++ linux-oem-6.1-6.1.0/drivers/xen/pvcalls-back.c @@ -129,13 +129,13 @@ if (masked_prod < masked_cons) { vec[0].iov_base = data->in + masked_prod; vec[0].iov_len = wanted; - iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, wanted); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, vec, 1, wanted); } else { vec[0].iov_base = data->in + masked_prod; vec[0].iov_len = array_size - masked_prod; vec[1].iov_base = data->in; vec[1].iov_len = wanted - vec[0].iov_len; - iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, wanted); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, vec, 2, wanted); } atomic_set(&map->read, 0); @@ -188,13 +188,13 @@ if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) { vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_len = size; - iov_iter_kvec(&msg.msg_iter, READ, vec, 1, size); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, vec, 1, size); } else { vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_len = array_size - pvcalls_mask(cons, array_size); vec[1].iov_base = data->out; vec[1].iov_len = size - vec[0].iov_len; - iov_iter_kvec(&msg.msg_iter, READ, vec, 2, size); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, vec, 2, size); } atomic_set(&map->write, 0); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/drivers/xen/pvcalls-front.c +++ linux-oem-6.1-6.1.0/drivers/xen/pvcalls-front.c @@ -225,6 +225,8 @@ return IRQ_HANDLED; } +static void free_active_ring(struct sock_mapping *map); + static void pvcalls_front_free_map(struct pvcalls_bedata *bedata, struct sock_mapping *map) { @@ -240,7 +242,7 @@ for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++) gnttab_end_foreign_access(map->active.ring->ref[i], NULL); gnttab_end_foreign_access(map->active.ref, NULL); - free_page((unsigned long)map->active.ring); + free_active_ring(map); kfree(map); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/9p/vfs_addr.c +++ linux-oem-6.1-6.1.0/fs/9p/vfs_addr.c @@ -40,7 +40,7 @@ size_t len = subreq->len - subreq->transferred; int total, err; - iov_iter_xarray(&to, READ, &rreq->mapping->i_pages, pos, len); + iov_iter_xarray(&to, ITER_DEST, &rreq->mapping->i_pages, pos, len); total = p9_client_read(fid, pos, &to, &err); @@ -172,7 +172,7 @@ len = min_t(loff_t, i_size - start, len); - iov_iter_xarray(&from, WRITE, &folio_mapping(folio)->i_pages, start, len); + iov_iter_xarray(&from, ITER_SOURCE, &folio_mapping(folio)->i_pages, start, len); /* We should have writeback_fid always set */ BUG_ON(!v9inode->writeback_fid); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/9p/vfs_dir.c +++ linux-oem-6.1-6.1.0/fs/9p/vfs_dir.c @@ -109,7 +109,7 @@ struct iov_iter to; int n; - iov_iter_kvec(&to, READ, &kvec, 1, buflen); + iov_iter_kvec(&to, ITER_DEST, &kvec, 1, buflen); n = p9_client_read(file->private_data, ctx->pos, &to, &err); if (err) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/9p/xattr.c +++ linux-oem-6.1-6.1.0/fs/9p/xattr.c @@ -24,7 +24,7 @@ struct iov_iter to; int err; - iov_iter_kvec(&to, READ, &kvec, 1, buffer_size); + iov_iter_kvec(&to, ITER_DEST, &kvec, 1, buffer_size); attr_fid = p9_client_xattrwalk(fid, name, &attr_size); if (IS_ERR(attr_fid)) { @@ -109,7 +109,7 @@ struct iov_iter from; int retval, err; - iov_iter_kvec(&from, WRITE, &kvec, 1, value_len); + iov_iter_kvec(&from, ITER_SOURCE, &kvec, 1, value_len); p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu flags = %d\n", name, value_len, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/affs/file.c +++ linux-oem-6.1-6.1.0/fs/affs/file.c @@ -880,7 +880,7 @@ if (inode->i_size > AFFS_I(inode)->mmu_private) { struct address_space *mapping = inode->i_mapping; struct page *page; - void *fsdata; + void *fsdata = NULL; loff_t isize = inode->i_size; int res; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/cmservice.c +++ linux-oem-6.1-6.1.0/fs/afs/cmservice.c @@ -298,7 +298,7 @@ if (call->count2 != call->count && call->count2 != 0) return afs_protocol_error(call, afs_eproto_cb_count); call->iter = &call->def_iter; - iov_iter_discard(&call->def_iter, READ, call->count2 * 3 * 4); + iov_iter_discard(&call->def_iter, ITER_DEST, call->count2 * 3 * 4); call->unmarshall++; fallthrough; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/dir.c +++ linux-oem-6.1-6.1.0/fs/afs/dir.c @@ -305,7 +305,7 @@ req->actual_len = i_size; /* May change */ req->len = nr_pages * PAGE_SIZE; /* We can ask for more than there is */ req->data_version = dvnode->status.data_version; /* May change */ - iov_iter_xarray(&req->def_iter, READ, &dvnode->netfs.inode.i_mapping->i_pages, + iov_iter_xarray(&req->def_iter, ITER_DEST, &dvnode->netfs.inode.i_mapping->i_pages, 0, i_size); req->iter = &req->def_iter; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/file.c +++ linux-oem-6.1-6.1.0/fs/afs/file.c @@ -324,7 +324,7 @@ fsreq->vnode = vnode; fsreq->iter = &fsreq->def_iter; - iov_iter_xarray(&fsreq->def_iter, READ, + iov_iter_xarray(&fsreq->def_iter, ITER_DEST, &fsreq->vnode->netfs.inode.i_mapping->i_pages, fsreq->pos, fsreq->len); @@ -346,7 +346,7 @@ fsreq->len = folio_size(folio); fsreq->vnode = vnode; fsreq->iter = &fsreq->def_iter; - iov_iter_xarray(&fsreq->def_iter, READ, &folio->mapping->i_pages, + iov_iter_xarray(&fsreq->def_iter, ITER_DEST, &folio->mapping->i_pages, fsreq->pos, fsreq->len); ret = afs_fetch_data(fsreq->vnode, fsreq); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/internal.h +++ linux-oem-6.1-6.1.0/fs/afs/internal.h @@ -1301,7 +1301,7 @@ call->iov_len = size; call->kvec[0].iov_base = buf; call->kvec[0].iov_len = size; - iov_iter_kvec(&call->def_iter, READ, call->kvec, 1, size); + iov_iter_kvec(&call->def_iter, ITER_DEST, call->kvec, 1, size); } static inline void afs_extract_to_tmp(struct afs_call *call) @@ -1319,7 +1319,7 @@ static inline void afs_extract_discard(struct afs_call *call, size_t size) { call->iov_len = size; - iov_iter_discard(&call->def_iter, READ, size); + iov_iter_discard(&call->def_iter, ITER_DEST, size); } static inline void afs_extract_to_buf(struct afs_call *call, size_t size) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/rxrpc.c +++ linux-oem-6.1-6.1.0/fs/afs/rxrpc.c @@ -359,7 +359,7 @@ msg.msg_name = NULL; msg.msg_namelen = 0; - iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, call->request_size); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, iov, 1, call->request_size); msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_flags = MSG_WAITALL | (call->write_iter ? MSG_MORE : 0); @@ -400,7 +400,7 @@ RX_USER_ABORT, ret, "KSD"); } else { len = 0; - iov_iter_kvec(&msg.msg_iter, READ, NULL, 0, 0); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, NULL, 0, 0); rxrpc_kernel_recv_data(call->net->socket, rxcall, &msg.msg_iter, &len, false, &call->abort_code, &call->service_id); @@ -485,7 +485,7 @@ ) { if (state == AFS_CALL_SV_AWAIT_ACK) { len = 0; - iov_iter_kvec(&call->def_iter, READ, NULL, 0, 0); + iov_iter_kvec(&call->def_iter, ITER_DEST, NULL, 0, 0); ret = rxrpc_kernel_recv_data(call->net->socket, call->rxcall, &call->def_iter, &len, false, &remote_abort, @@ -822,7 +822,7 @@ msg.msg_name = NULL; msg.msg_namelen = 0; - iov_iter_kvec(&msg.msg_iter, WRITE, NULL, 0, 0); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, NULL, 0, 0); msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_flags = 0; @@ -862,7 +862,7 @@ iov[0].iov_len = len; msg.msg_name = NULL; msg.msg_namelen = 0; - iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, len); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, iov, 1, len); msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_flags = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/afs/write.c +++ linux-oem-6.1-6.1.0/fs/afs/write.c @@ -609,7 +609,7 @@ */ afs_write_to_cache(vnode, start, len, i_size, caching); - iov_iter_xarray(&iter, WRITE, &mapping->i_pages, start, len); + iov_iter_xarray(&iter, ITER_SOURCE, &mapping->i_pages, start, len); ret = afs_store_data(vnode, &iter, start, false); } else { _debug("write discard %x @%llx [%llx]", len, start, i_size); @@ -1000,7 +1000,7 @@ bv[0].bv_page = &folio->page; bv[0].bv_offset = f; bv[0].bv_len = t - f; - iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len); + iov_iter_bvec(&iter, ITER_SOURCE, bv, 1, bv[0].bv_len); trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio); ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/aio.c +++ linux-oem-6.1-6.1.0/fs/aio.c @@ -361,6 +361,9 @@ spin_lock(&mm->ioctx_lock); rcu_read_lock(); table = rcu_dereference(mm->ioctx_table); + if (!table) + goto out_unlock; + for (i = 0; i < table->nr; i++) { struct kioctx *ctx; @@ -374,6 +377,7 @@ } } +out_unlock: rcu_read_unlock(); spin_unlock(&mm->ioctx_lock); return res; @@ -1552,7 +1556,7 @@ if (unlikely(!file->f_op->read_iter)) return -EINVAL; - ret = aio_setup_rw(READ, iocb, &iovec, vectored, compat, &iter); + ret = aio_setup_rw(ITER_DEST, iocb, &iovec, vectored, compat, &iter); if (ret < 0) return ret; ret = rw_verify_area(READ, file, &req->ki_pos, iov_iter_count(&iter)); @@ -1580,7 +1584,7 @@ if (unlikely(!file->f_op->write_iter)) return -EINVAL; - ret = aio_setup_rw(WRITE, iocb, &iovec, vectored, compat, &iter); + ret = aio_setup_rw(ITER_SOURCE, iocb, &iovec, vectored, compat, &iter); if (ret < 0) return ret; ret = rw_verify_area(WRITE, file, &req->ki_pos, iov_iter_count(&iter)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/binfmt_elf.c +++ linux-oem-6.1-6.1.0/fs/binfmt_elf.c @@ -2209,7 +2209,7 @@ * The number of segs are recored into ELF header as 16bit value. * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here. */ - segs = cprm->vma_count + elf_core_extra_phdrs(); + segs = cprm->vma_count + elf_core_extra_phdrs(cprm); /* for notes section */ segs++; @@ -2249,7 +2249,7 @@ dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); offset += cprm->vma_data_size; - offset += elf_core_extra_data_size(); + offset += elf_core_extra_data_size(cprm); e_shoff = offset; if (e_phnum == PN_XNUM) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/ctree.h +++ linux-oem-6.1-6.1.0/fs/btrfs/ctree.h @@ -590,6 +590,12 @@ /* Indicate we have to finish a zone to do next allocation. */ BTRFS_FS_NEED_ZONE_FINISH, + /* + * Indicate metadata over-commit is disabled. This is set when active + * zone tracking is needed. + */ + BTRFS_FS_NO_OVERCOMMIT, + #if BITS_PER_LONG == 32 /* Indicate if we have error/warn message printed on 32bit systems */ BTRFS_FS_32BIT_ERROR, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/extent-tree.c +++ linux-oem-6.1-6.1.0/fs/btrfs/extent-tree.c @@ -1706,6 +1706,11 @@ BUG(); if (ret && insert_reserved) btrfs_pin_extent(trans, node->bytenr, node->num_bytes, 1); + if (ret < 0) + btrfs_err(trans->fs_info, +"failed to run delayed ref for logical %llu num_bytes %llu type %u action %u ref_mod %d: %d", + node->bytenr, node->num_bytes, node->type, + node->action, node->ref_mod, ret); return ret; } @@ -1947,8 +1952,6 @@ if (ret) { unselect_delayed_ref_head(delayed_refs, locked_ref); btrfs_put_delayed_ref(ref); - btrfs_debug(fs_info, "run_one_delayed_ref returned %d", - ret); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/qgroup.c +++ linux-oem-6.1-6.1.0/fs/btrfs/qgroup.c @@ -2751,9 +2751,19 @@ BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING)) { /* * Old roots should be searched when inserting qgroup - * extent record + * extent record. + * + * But for INCONSISTENT (NO_ACCOUNTING) -> rescan case, + * we may have some record inserted during + * NO_ACCOUNTING (thus no old_roots populated), but + * later we start rescan, which clears NO_ACCOUNTING, + * leaving some inserted records without old_roots + * populated. + * + * Those cases are rare and should not cause too much + * time spent during commit_transaction(). */ - if (WARN_ON(!record->old_roots)) { + if (!record->old_roots) { /* Search commit root to find old_roots */ ret = btrfs_find_all_roots(NULL, fs_info, record->bytenr, 0, @@ -3338,6 +3348,7 @@ int err = -ENOMEM; int ret = 0; bool stopped = false; + bool did_leaf_rescans = false; path = btrfs_alloc_path(); if (!path) @@ -3358,6 +3369,7 @@ } err = qgroup_rescan_leaf(trans, path); + did_leaf_rescans = true; if (err > 0) btrfs_commit_transaction(trans); @@ -3378,16 +3390,23 @@ mutex_unlock(&fs_info->qgroup_rescan_lock); /* - * only update status, since the previous part has already updated the - * qgroup info. + * Only update status, since the previous part has already updated the + * qgroup info, and only if we did any actual work. This also prevents + * race with a concurrent quota disable, which has already set + * fs_info->quota_root to NULL and cleared BTRFS_FS_QUOTA_ENABLED at + * btrfs_quota_disable(). */ - trans = btrfs_start_transaction(fs_info->quota_root, 1); - if (IS_ERR(trans)) { - err = PTR_ERR(trans); + if (did_leaf_rescans) { + trans = btrfs_start_transaction(fs_info->quota_root, 1); + if (IS_ERR(trans)) { + err = PTR_ERR(trans); + trans = NULL; + btrfs_err(fs_info, + "fail to start transaction for status update: %d", + err); + } + } else { trans = NULL; - btrfs_err(fs_info, - "fail to start transaction for status update: %d", - err); } mutex_lock(&fs_info->qgroup_rescan_lock); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/space-info.c +++ linux-oem-6.1-6.1.0/fs/btrfs/space-info.c @@ -404,7 +404,8 @@ return 0; used = btrfs_space_info_used(space_info, true); - if (btrfs_is_zoned(fs_info) && (space_info->flags & BTRFS_BLOCK_GROUP_METADATA)) + if (test_bit(BTRFS_FS_NO_OVERCOMMIT, &fs_info->flags) && + (space_info->flags & BTRFS_BLOCK_GROUP_METADATA)) avail = 0; else avail = calc_available_free_space(fs_info, space_info, flush); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/tree-log.c +++ linux-oem-6.1-6.1.0/fs/btrfs/tree-log.c @@ -3011,7 +3011,6 @@ ret = 0; if (ret) { blk_finish_plug(&plug); - btrfs_abort_transaction(trans, ret); btrfs_set_log_full_commit(trans); mutex_unlock(&root->log_mutex); goto out; @@ -3076,15 +3075,12 @@ blk_finish_plug(&plug); btrfs_set_log_full_commit(trans); - - if (ret != -ENOSPC) { - btrfs_abort_transaction(trans, ret); - mutex_unlock(&log_root_tree->log_mutex); - goto out; - } + if (ret != -ENOSPC) + btrfs_err(fs_info, + "failed to update log for root %llu ret %d", + root->root_key.objectid, ret); btrfs_wait_tree_log_extents(log, mark); mutex_unlock(&log_root_tree->log_mutex); - ret = BTRFS_LOG_FORCE_COMMIT; goto out; } @@ -3143,7 +3139,6 @@ goto out_wake_log_root; } else if (ret) { btrfs_set_log_full_commit(trans); - btrfs_abort_transaction(trans, ret); mutex_unlock(&log_root_tree->log_mutex); goto out_wake_log_root; } @@ -3612,17 +3607,19 @@ } static int flush_dir_items_batch(struct btrfs_trans_handle *trans, - struct btrfs_root *log, + struct btrfs_inode *inode, struct extent_buffer *src, struct btrfs_path *dst_path, int start_slot, int count) { + struct btrfs_root *log = inode->root->log_root; char *ins_data = NULL; struct btrfs_item_batch batch; struct extent_buffer *dst; unsigned long src_offset; unsigned long dst_offset; + u64 last_index; struct btrfs_key key; u32 item_size; int ret; @@ -3680,6 +3677,19 @@ src_offset = btrfs_item_ptr_offset(src, start_slot + count - 1); copy_extent_buffer(dst, src, dst_offset, src_offset, batch.total_data_size); btrfs_release_path(dst_path); + + last_index = batch.keys[count - 1].offset; + ASSERT(last_index > inode->last_dir_index_offset); + + /* + * If for some unexpected reason the last item's index is not greater + * than the last index we logged, warn and return an error to fallback + * to a transaction commit. + */ + if (WARN_ON(last_index <= inode->last_dir_index_offset)) + ret = -EUCLEAN; + else + inode->last_dir_index_offset = last_index; out: kfree(ins_data); @@ -3729,7 +3739,6 @@ } di = btrfs_item_ptr(src, i, struct btrfs_dir_item); - ctx->last_dir_item_offset = key.offset; /* * Skip ranges of items that consist only of dir item keys created @@ -3792,7 +3801,7 @@ if (batch_size > 0) { int ret; - ret = flush_dir_items_batch(trans, log, src, dst_path, + ret = flush_dir_items_batch(trans, inode, src, dst_path, batch_start, batch_size); if (ret < 0) return ret; @@ -3857,7 +3866,10 @@ path->slots[0]); if (tmp.type == BTRFS_DIR_INDEX_KEY) last_old_dentry_offset = tmp.offset; + } else if (ret < 0) { + err = ret; } + goto done; } @@ -3877,19 +3889,34 @@ */ if (tmp.type == BTRFS_DIR_INDEX_KEY) last_old_dentry_offset = tmp.offset; + } else if (ret < 0) { + err = ret; + goto done; } + btrfs_release_path(path); /* - * Find the first key from this transaction again. See the note for - * log_new_dir_dentries, if we're logging a directory recursively we - * won't be holding its i_mutex, which means we can modify the directory - * while we're logging it. If we remove an entry between our first - * search and this search we'll not find the key again and can just - * bail. + * Find the first key from this transaction again or the one we were at + * in the loop below in case we had to reschedule. We may be logging the + * directory without holding its VFS lock, which happen when logging new + * dentries (through log_new_dir_dentries()) or in some cases when we + * need to log the parent directory of an inode. This means a dir index + * key might be deleted from the inode's root, and therefore we may not + * find it anymore. If we can't find it, just move to the next key. We + * can not bail out and ignore, because if we do that we will simply + * not log dir index keys that come after the one that was just deleted + * and we can end up logging a dir index range that ends at (u64)-1 + * (@last_offset is initialized to that), resulting in removing dir + * entries we should not remove at log replay time. */ search: ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); + if (ret > 0) + ret = btrfs_next_item(root, path); + if (ret < 0) + err = ret; + /* If ret is 1, there are no more keys in the inode's root. */ if (ret != 0) goto done; @@ -4062,7 +4089,6 @@ min_key = BTRFS_DIR_START_INDEX; max_key = 0; - ctx->last_dir_item_offset = inode->last_dir_index_offset; while (1) { ret = log_dir_items(trans, inode, path, dst_path, @@ -4074,8 +4100,6 @@ min_key = max_key + 1; } - inode->last_dir_index_offset = ctx->last_dir_item_offset; - return 0; } @@ -5608,8 +5632,10 @@ * LOG_INODE_EXISTS mode) and slow down other fsyncs or transaction * commits. */ - if (ctx->num_conflict_inodes >= MAX_CONFLICT_INODES) + if (ctx->num_conflict_inodes >= MAX_CONFLICT_INODES) { + btrfs_set_log_full_commit(trans); return BTRFS_LOG_FORCE_COMMIT; + } inode = btrfs_iget(root->fs_info->sb, ino, root); /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/tree-log.h +++ linux-oem-6.1-6.1.0/fs/btrfs/tree-log.h @@ -23,8 +23,6 @@ bool logging_new_delayed_dentries; /* Indicate if the inode being logged was logged before. */ bool logged_before; - /* Tracks the last logged dir item/index key offset. */ - u64 last_dir_item_offset; struct inode *inode; struct list_head list; /* Only used for fast fsyncs. */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/zlib.c +++ linux-oem-6.1-6.1.0/fs/btrfs/zlib.c @@ -63,7 +63,7 @@ workspacesize = max(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL), zlib_inflate_workspacesize()); - workspace->strm.workspace = kvmalloc(workspacesize, GFP_KERNEL); + workspace->strm.workspace = kvzalloc(workspacesize, GFP_KERNEL); workspace->level = level; workspace->buf = NULL; /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/btrfs/zoned.c +++ linux-oem-6.1-6.1.0/fs/btrfs/zoned.c @@ -538,6 +538,8 @@ } atomic_set(&zone_info->active_zones_left, max_active_zones - nactive); + /* Overcommit does not work well with active zone tacking. */ + set_bit(BTRFS_FS_NO_OVERCOMMIT, &fs_info->flags); } /* Validate superblock log */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ceph/addr.c +++ linux-oem-6.1-6.1.0/fs/ceph/addr.c @@ -288,7 +288,7 @@ } len = min_t(size_t, iinfo->inline_len - subreq->start, subreq->len); - iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, subreq->start, len); + iov_iter_xarray(&iter, ITER_DEST, &rreq->mapping->i_pages, subreq->start, len); err = copy_to_iter(iinfo->inline_data + subreq->start, len, &iter); if (err == 0) err = -EFAULT; @@ -305,7 +305,7 @@ struct inode *inode = rreq->inode; struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_fs_client *fsc = ceph_inode_to_client(inode); - struct ceph_osd_request *req; + struct ceph_osd_request *req = NULL; struct ceph_vino vino = ceph_vino(inode); struct iov_iter iter; struct page **pages; @@ -313,6 +313,11 @@ int err = 0; u64 len = subreq->len; + if (ceph_inode_is_shutdown(inode)) { + err = -EIO; + goto out; + } + if (ceph_has_inline_data(ci) && ceph_netfs_issue_op_inline(subreq)) return; @@ -327,7 +332,7 @@ } dout("%s: pos=%llu orig_len=%zu len=%llu\n", __func__, subreq->start, subreq->len, len); - iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, subreq->start, len); + iov_iter_xarray(&iter, ITER_DEST, &rreq->mapping->i_pages, subreq->start, len); err = iov_iter_get_pages_alloc2(&iter, &pages, len, &page_off); if (err < 0) { dout("%s: iov_ter_get_pages_alloc returned %d\n", __func__, err); @@ -563,6 +568,9 @@ dout("writepage %p idx %lu\n", page, page->index); + if (ceph_inode_is_shutdown(inode)) + return -EIO; + /* verify this is a writeable snap context */ snapc = page_snap_context(page); if (!snapc) { @@ -1643,7 +1651,7 @@ struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_fs_client *fsc = ceph_inode_to_client(inode); struct ceph_osd_request *req = NULL; - struct ceph_cap_flush *prealloc_cf; + struct ceph_cap_flush *prealloc_cf = NULL; struct folio *folio = NULL; u64 inline_version = CEPH_INLINE_NONE; struct page *pages[1]; @@ -1657,6 +1665,11 @@ dout("uninline_data %p %llx.%llx inline_version %llu\n", inode, ceph_vinop(inode), inline_version); + if (ceph_inode_is_shutdown(inode)) { + err = -EIO; + goto out; + } + if (inline_version == CEPH_INLINE_NONE) return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ceph/file.c +++ linux-oem-6.1-6.1.0/fs/ceph/file.c @@ -1161,7 +1161,7 @@ aio_req->total_len = rc + zlen; } - iov_iter_bvec(&i, READ, osd_data->bvec_pos.bvecs, + iov_iter_bvec(&i, ITER_DEST, osd_data->bvec_pos.bvecs, osd_data->num_bvecs, len); iov_iter_advance(&i, rc); iov_iter_zero(zlen, &i); @@ -1400,7 +1400,7 @@ int zlen = min_t(size_t, len - ret, size - pos - ret); - iov_iter_bvec(&i, READ, bvecs, num_pages, len); + iov_iter_bvec(&i, ITER_DEST, bvecs, num_pages, len); iov_iter_advance(&i, ret); iov_iter_zero(zlen, &i); ret += zlen; @@ -2004,6 +2004,9 @@ loff_t zero = 0; int op; + if (ceph_inode_is_shutdown(inode)) + return -EIO; + if (!length) { op = offset ? CEPH_OSD_OP_DELETE : CEPH_OSD_OP_TRUNCATE; length = &zero; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ceph/mds_client.c +++ linux-oem-6.1-6.1.0/fs/ceph/mds_client.c @@ -806,6 +806,9 @@ { struct ceph_mds_session *s; + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_FENCE_IO) + return ERR_PTR(-EIO); + if (mds >= mdsc->mdsmap->possible_max_rank) return ERR_PTR(-EINVAL); @@ -1478,6 +1481,9 @@ int mstate; int mds = session->s_mds; + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_FENCE_IO) + return -EIO; + /* wait for mds to go active? */ mstate = ceph_mdsmap_get_state(mdsc->mdsmap, mds); dout("open_session to mds%d (%s)\n", mds, @@ -2860,6 +2866,11 @@ return; } + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_FENCE_IO) { + dout("do_request metadata corrupted\n"); + err = -EIO; + goto finish; + } if (req->r_timeout && time_after_eq(jiffies, req->r_started + req->r_timeout)) { dout("do_request timed out\n"); @@ -3245,6 +3256,7 @@ u64 tid; int err, result; int mds = session->s_mds; + bool close_sessions = false; if (msg->front.iov_len < sizeof(*head)) { pr_err("mdsc_handle_reply got corrupt (short) reply\n"); @@ -3351,10 +3363,17 @@ realm = NULL; if (rinfo->snapblob_len) { down_write(&mdsc->snap_rwsem); - ceph_update_snap_trace(mdsc, rinfo->snapblob, + err = ceph_update_snap_trace(mdsc, rinfo->snapblob, rinfo->snapblob + rinfo->snapblob_len, le32_to_cpu(head->op) == CEPH_MDS_OP_RMSNAP, &realm); + if (err) { + up_write(&mdsc->snap_rwsem); + close_sessions = true; + if (err == -EIO) + ceph_msg_dump(msg); + goto out_err; + } downgrade_write(&mdsc->snap_rwsem); } else { down_read(&mdsc->snap_rwsem); @@ -3412,6 +3431,10 @@ req->r_end_latency, err); out: ceph_mdsc_put_request(req); + + /* Defer closing the sessions after s_mutex lock being released */ + if (close_sessions) + ceph_mdsc_close_sessions(mdsc); return; } @@ -3662,6 +3685,12 @@ break; case CEPH_SESSION_FLUSHMSG: + /* flush cap releases */ + spin_lock(&session->s_cap_lock); + if (session->s_num_cap_releases) + ceph_flush_cap_releases(mdsc, session); + spin_unlock(&session->s_cap_lock); + send_flushmsg_ack(mdsc, session, seq); break; @@ -5011,7 +5040,7 @@ } /* - * called after sb is ro. + * called after sb is ro or when metadata corrupted. */ void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc) { @@ -5301,7 +5330,8 @@ struct ceph_mds_client *mdsc = s->s_mdsc; pr_warn("mds%d closed our session\n", s->s_mds); - send_mds_reconnect(mdsc, s); + if (READ_ONCE(mdsc->fsc->mount_state) != CEPH_MOUNT_FENCE_IO) + send_mds_reconnect(mdsc, s); } static void mds_dispatch(struct ceph_connection *con, struct ceph_msg *msg) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ceph/snap.c +++ linux-oem-6.1-6.1.0/fs/ceph/snap.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include #include @@ -766,8 +767,10 @@ struct ceph_snap_realm *realm; struct ceph_snap_realm *first_realm = NULL; struct ceph_snap_realm *realm_to_rebuild = NULL; + struct ceph_client *client = mdsc->fsc->client; int rebuild_snapcs; int err = -ENOMEM; + int ret; LIST_HEAD(dirty_realms); lockdep_assert_held_write(&mdsc->snap_rwsem); @@ -884,6 +887,27 @@ if (first_realm) ceph_put_snap_realm(mdsc, first_realm); pr_err("%s error %d\n", __func__, err); + + /* + * When receiving a corrupted snap trace we don't know what + * exactly has happened in MDS side. And we shouldn't continue + * writing to OSD, which may corrupt the snapshot contents. + * + * Just try to blocklist this kclient and then this kclient + * must be remounted to continue after the corrupted metadata + * fixed in the MDS side. + */ + WRITE_ONCE(mdsc->fsc->mount_state, CEPH_MOUNT_FENCE_IO); + ret = ceph_monc_blocklist_add(&client->monc, &client->msgr.inst.addr); + if (ret) + pr_err("%s failed to blocklist %s: %d\n", __func__, + ceph_pr_addr(&client->msgr.inst.addr), ret); + + WARN(1, "%s: %s%sdo remount to continue%s", + __func__, ret ? "" : ceph_pr_addr(&client->msgr.inst.addr), + ret ? "" : " was blocklisted, ", + err == -EIO ? " after corrupted snaptrace is fixed" : ""); + return err; } @@ -984,6 +1008,7 @@ __le64 *split_inos = NULL, *split_realms = NULL; int i; int locked_rwsem = 0; + bool close_sessions = false; /* decode */ if (msg->front.iov_len < sizeof(*h)) @@ -1092,8 +1117,12 @@ * update using the provided snap trace. if we are deleting a * snap, we can avoid queueing cap_snaps. */ - ceph_update_snap_trace(mdsc, p, e, - op == CEPH_SNAP_OP_DESTROY, NULL); + if (ceph_update_snap_trace(mdsc, p, e, + op == CEPH_SNAP_OP_DESTROY, + NULL)) { + close_sessions = true; + goto bad; + } if (op == CEPH_SNAP_OP_SPLIT) /* we took a reference when we created the realm, above */ @@ -1112,6 +1141,9 @@ out: if (locked_rwsem) up_write(&mdsc->snap_rwsem); + + if (close_sessions) + ceph_mdsc_close_sessions(mdsc); return; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/cifsencrypt.c +++ linux-oem-6.1-6.1.0/fs/cifs/cifsencrypt.c @@ -278,6 +278,7 @@ * ( for NTLMSSP_AV_NB_DOMAIN_NAME followed by NTLMSSP_AV_EOL ) + * unicode length of a netbios domain name */ + kfree_sensitive(ses->auth_key.response); ses->auth_key.len = size + 2 * dlen; ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL); if (!ses->auth_key.response) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/dfs_cache.c +++ linux-oem-6.1-6.1.0/fs/cifs/dfs_cache.c @@ -792,26 +792,27 @@ */ static int cache_refresh_path(const unsigned int xid, struct cifs_ses *ses, const char *path) { - int rc; - struct cache_entry *ce; struct dfs_info3_param *refs = NULL; + struct cache_entry *ce; int numrefs = 0; - bool newent = false; + int rc; cifs_dbg(FYI, "%s: search path: %s\n", __func__, path); - down_write(&htable_rw_lock); + down_read(&htable_rw_lock); ce = lookup_cache_entry(path); - if (!IS_ERR(ce)) { - if (!cache_entry_expired(ce)) { - dump_ce(ce); - up_write(&htable_rw_lock); - return 0; - } - } else { - newent = true; + if (!IS_ERR(ce) && !cache_entry_expired(ce)) { + up_read(&htable_rw_lock); + return 0; } + /* + * Unlock shared access as we don't want to hold any locks while getting + * a new referral. The @ses used for performing the I/O could be + * reconnecting and it acquires @htable_rw_lock to look up the dfs cache + * in order to failover -- if necessary. + */ + up_read(&htable_rw_lock); /* * Either the entry was not found, or it is expired. @@ -819,19 +820,22 @@ */ rc = get_dfs_referral(xid, ses, path, &refs, &numrefs); if (rc) - goto out_unlock; + goto out; dump_refs(refs, numrefs); - if (!newent) { - rc = update_cache_entry_locked(ce, refs, numrefs); - goto out_unlock; + down_write(&htable_rw_lock); + /* Re-check as another task might have it added or refreshed already */ + ce = lookup_cache_entry(path); + if (!IS_ERR(ce)) { + if (cache_entry_expired(ce)) + rc = update_cache_entry_locked(ce, refs, numrefs); + } else { + rc = add_cache_entry_locked(refs, numrefs); } - rc = add_cache_entry_locked(refs, numrefs); - -out_unlock: up_write(&htable_rw_lock); +out: free_dfs_info_array(refs, numrefs); return rc; } @@ -1046,10 +1050,10 @@ const struct nls_table *cp, int remap, const char *path, const struct dfs_cache_tgt_iterator *it) { - int rc; - const char *npath; - struct cache_entry *ce; struct cache_dfs_tgt *t; + struct cache_entry *ce; + const char *npath; + int rc = 0; npath = dfs_cache_canonical_path(path, cp, remap); if (IS_ERR(npath)) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/file.c +++ linux-oem-6.1-6.1.0/fs/cifs/file.c @@ -3532,7 +3532,7 @@ ctx->iter = *from; ctx->len = len; } else { - rc = setup_aio_ctx_iter(ctx, from, WRITE); + rc = setup_aio_ctx_iter(ctx, from, ITER_SOURCE); if (rc) { kref_put(&ctx->refcount, cifs_aio_ctx_release); return rc; @@ -3880,7 +3880,7 @@ rdata->got_bytes += result; } - return rdata->got_bytes > 0 && result != -ECONNABORTED ? + return result != -ECONNABORTED && rdata->got_bytes > 0 ? rdata->got_bytes : result; } @@ -4276,7 +4276,7 @@ ctx->iter = *to; ctx->len = len; } else { - rc = setup_aio_ctx_iter(ctx, to, READ); + rc = setup_aio_ctx_iter(ctx, to, ITER_DEST); if (rc) { kref_put(&ctx->refcount, cifs_aio_ctx_release); return rc; @@ -4656,7 +4656,7 @@ rdata->got_bytes += result; } - return rdata->got_bytes > 0 && result != -ECONNABORTED ? + return result != -ECONNABORTED && rdata->got_bytes > 0 ? rdata->got_bytes : result; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/fscache.c +++ linux-oem-6.1-6.1.0/fs/cifs/fscache.c @@ -150,7 +150,7 @@ bvec[0].bv_page = page; bvec[0].bv_offset = 0; bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, READ, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + iov_iter_bvec(&iter, ITER_DEST, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); ret = fscache_begin_read_operation(&cres, cookie); if (ret < 0) @@ -180,7 +180,7 @@ bvec[0].bv_page = page; bvec[0].bv_offset = 0; bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, WRITE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + iov_iter_bvec(&iter, ITER_SOURCE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); ret = fscache_begin_write_operation(&cres, cookie); if (ret < 0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/inode.c +++ linux-oem-6.1-6.1.0/fs/cifs/inode.c @@ -991,12 +991,6 @@ } rc = server->ops->query_path_info(xid, tcon, cifs_sb, full_path, &tmp_data, &adjust_tz, &is_reparse_point); -#ifdef CONFIG_CIFS_DFS_UPCALL - if (rc == -ENOENT && is_tcon_dfs(tcon)) - rc = cifs_dfs_query_info_nonascii_quirk(xid, tcon, - cifs_sb, - full_path); -#endif data = &tmp_data; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/link.c +++ linux-oem-6.1-6.1.0/fs/cifs/link.c @@ -428,6 +428,7 @@ oparms.disposition = FILE_CREATE; oparms.fid = &fid; oparms.reconnect = false; + oparms.mode = 0644; rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL, NULL, NULL); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/smb1ops.c +++ linux-oem-6.1-6.1.0/fs/cifs/smb1ops.c @@ -562,17 +562,20 @@ if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { rc = SMBQueryInformation(xid, tcon, full_path, &fi, cifs_sb->local_nls, cifs_remap(cifs_sb)); - if (!rc) - move_cifs_info_to_smb2(&data->fi, &fi); *adjustTZ = true; } - if (!rc && (le32_to_cpu(fi.Attributes) & ATTR_REPARSE)) { + if (!rc) { int tmprc; int oplock = 0; struct cifs_fid fid; struct cifs_open_parms oparms; + move_cifs_info_to_smb2(&data->fi, &fi); + + if (!(le32_to_cpu(fi.Attributes) & ATTR_REPARSE)) + return 0; + oparms.tcon = tcon; oparms.cifs_sb = cifs_sb; oparms.desired_access = FILE_READ_ATTRIBUTES; @@ -716,17 +719,25 @@ static int cifs_open_file(const unsigned int xid, struct cifs_open_parms *oparms, __u32 *oplock, void *buf) { - FILE_ALL_INFO *fi = buf; + struct cifs_open_info_data *data = buf; + FILE_ALL_INFO fi = {}; + int rc; if (!(oparms->tcon->ses->capabilities & CAP_NT_SMBS)) - return SMBLegacyOpen(xid, oparms->tcon, oparms->path, - oparms->disposition, - oparms->desired_access, - oparms->create_options, - &oparms->fid->netfid, oplock, fi, - oparms->cifs_sb->local_nls, - cifs_remap(oparms->cifs_sb)); - return CIFS_open(xid, oparms, oplock, fi); + rc = SMBLegacyOpen(xid, oparms->tcon, oparms->path, + oparms->disposition, + oparms->desired_access, + oparms->create_options, + &oparms->fid->netfid, oplock, &fi, + oparms->cifs_sb->local_nls, + cifs_remap(oparms->cifs_sb)); + else + rc = CIFS_open(xid, oparms, oplock, &fi); + + if (!rc && data) + move_cifs_info_to_smb2(&data->fi, &fi); + + return rc; } static void @@ -1050,7 +1061,7 @@ struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct inode *newinode = NULL; int rc = -EPERM; - FILE_ALL_INFO *buf = NULL; + struct cifs_open_info_data buf = {}; struct cifs_io_parms io_parms; __u32 oplock = 0; struct cifs_fid fid; @@ -1082,14 +1093,14 @@ cifs_sb->local_nls, cifs_remap(cifs_sb)); if (rc) - goto out; + return rc; rc = cifs_get_inode_info_unix(&newinode, full_path, inode->i_sb, xid); if (rc == 0) d_instantiate(dentry, newinode); - goto out; + return rc; } /* @@ -1097,19 +1108,13 @@ * support block and char device (no socket & fifo) */ if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) - goto out; + return rc; if (!S_ISCHR(mode) && !S_ISBLK(mode)) - goto out; + return rc; cifs_dbg(FYI, "sfu compat create special file\n"); - buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); - if (buf == NULL) { - rc = -ENOMEM; - goto out; - } - oparms.tcon = tcon; oparms.cifs_sb = cifs_sb; oparms.desired_access = GENERIC_WRITE; @@ -1124,21 +1129,21 @@ oplock = REQ_OPLOCK; else oplock = 0; - rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, buf); + rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, &buf); if (rc) - goto out; + return rc; /* * BB Do not bother to decode buf since no local inode yet to put * timestamps in, but we can reuse it safely. */ - pdev = (struct win_dev *)buf; + pdev = (struct win_dev *)&buf.fi; io_parms.pid = current->tgid; io_parms.tcon = tcon; io_parms.offset = 0; io_parms.length = sizeof(struct win_dev); - iov[1].iov_base = buf; + iov[1].iov_base = &buf.fi; iov[1].iov_len = sizeof(struct win_dev); if (S_ISCHR(mode)) { memcpy(pdev->type, "IntxCHR", 8); @@ -1157,8 +1162,8 @@ d_drop(dentry); /* FIXME: add code here to set EAs */ -out: - kfree(buf); + + cifs_free_open_info(&buf); return rc; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/smb2inode.c +++ linux-oem-6.1-6.1.0/fs/cifs/smb2inode.c @@ -540,22 +540,41 @@ rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, FILE_READ_ATTRIBUTES, FILE_OPEN, create_options, ACL_NO_MODE, data, SMB2_OP_QUERY_INFO, cfile, err_iov, err_buftype); - if (rc == -EOPNOTSUPP) { - if (err_iov[0].iov_base && err_buftype[0] != CIFS_NO_BUFFER && - ((struct smb2_hdr *)err_iov[0].iov_base)->Command == SMB2_CREATE && - ((struct smb2_hdr *)err_iov[0].iov_base)->Status == STATUS_STOPPED_ON_SYMLINK) { - rc = smb2_parse_symlink_response(cifs_sb, err_iov, &data->symlink_target); + if (rc) { + struct smb2_hdr *hdr = err_iov[0].iov_base; + + if (unlikely(!hdr || err_buftype[0] == CIFS_NO_BUFFER)) + goto out; + if (rc == -EOPNOTSUPP && hdr->Command == SMB2_CREATE && + hdr->Status == STATUS_STOPPED_ON_SYMLINK) { + rc = smb2_parse_symlink_response(cifs_sb, err_iov, + &data->symlink_target); if (rc) goto out; - } - *reparse = true; - create_options |= OPEN_REPARSE_POINT; - /* Failed on a symbolic link - query a reparse point info */ - cifs_get_readable_path(tcon, full_path, &cfile); - rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, FILE_READ_ATTRIBUTES, - FILE_OPEN, create_options, ACL_NO_MODE, data, - SMB2_OP_QUERY_INFO, cfile, NULL, NULL); + *reparse = true; + create_options |= OPEN_REPARSE_POINT; + + /* Failed on a symbolic link - query a reparse point info */ + cifs_get_readable_path(tcon, full_path, &cfile); + rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, + FILE_READ_ATTRIBUTES, FILE_OPEN, + create_options, ACL_NO_MODE, data, + SMB2_OP_QUERY_INFO, cfile, NULL, NULL); + goto out; + } else if (rc != -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && + hdr->Status == STATUS_OBJECT_NAME_INVALID) { + /* + * Handle weird Windows SMB server behaviour. It responds with + * STATUS_OBJECT_NAME_INVALID code to SMB2 QUERY_INFO request + * for "\\\" DFS reference, + * where contains non-ASCII unicode symbols. + */ + rc = -EREMOTE; + } + if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && cifs_sb && + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS)) + rc = -EOPNOTSUPP; } out: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/smb2pdu.c +++ linux-oem-6.1-6.1.0/fs/cifs/smb2pdu.c @@ -541,9 +541,10 @@ assemble_neg_contexts(struct smb2_negotiate_req *req, struct TCP_Server_Info *server, unsigned int *total_len) { - char *pneg_ctxt; - char *hostname = NULL; unsigned int ctxt_len, neg_context_count; + struct TCP_Server_Info *pserver; + char *pneg_ctxt; + char *hostname; if (*total_len > 200) { /* In case length corrupted don't want to overrun smb buffer */ @@ -574,8 +575,9 @@ * secondary channels don't have the hostname field populated * use the hostname field in the primary channel instead */ - hostname = CIFS_SERVER_IS_CHAN(server) ? - server->primary_server->hostname : server->hostname; + pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server; + cifs_server_lock(pserver); + hostname = pserver->hostname; if (hostname && (hostname[0] != 0)) { ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt, hostname); @@ -584,6 +586,7 @@ neg_context_count = 3; } else neg_context_count = 2; + cifs_server_unlock(pserver); build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt); *total_len += sizeof(struct smb2_posix_neg_context); @@ -1450,6 +1453,7 @@ /* keep session key if binding */ if (!is_binding) { + kfree_sensitive(ses->auth_key.response); ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, GFP_KERNEL); if (!ses->auth_key.response) { @@ -1479,8 +1483,11 @@ out_put_spnego_key: key_invalidate(spnego_key); key_put(spnego_key); - if (rc) + if (rc) { kfree_sensitive(ses->auth_key.response); + ses->auth_key.response = NULL; + ses->auth_key.len = 0; + } out: sess_data->result = rc; sess_data->func = NULL; @@ -4156,12 +4163,15 @@ (struct smb2_hdr *)rdata->iov[0].iov_base; struct cifs_credits credits = { .value = 0, .instance = 0 }; struct smb_rqst rqst = { .rq_iov = &rdata->iov[1], - .rq_nvec = 1, - .rq_pages = rdata->pages, - .rq_offset = rdata->page_offset, - .rq_npages = rdata->nr_pages, - .rq_pagesz = rdata->pagesz, - .rq_tailsz = rdata->tailsz }; + .rq_nvec = 1, }; + + if (rdata->got_bytes) { + rqst.rq_pages = rdata->pages; + rqst.rq_offset = rdata->page_offset; + rqst.rq_npages = rdata->nr_pages; + rqst.rq_pagesz = rdata->pagesz; + rqst.rq_tailsz = rdata->tailsz; + } WARN_ONCE(rdata->server != mid->server, "rdata server %p != mid server %p", only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/smbdirect.c +++ linux-oem-6.1-6.1.0/fs/cifs/smbdirect.c @@ -1405,6 +1405,7 @@ destroy_workqueue(info->workqueue); log_rdma_event(INFO, "rdma session destroyed\n"); kfree(info); + server->smbd_conn = NULL; } /* only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/cifs/transport.c +++ linux-oem-6.1-6.1.0/fs/cifs/transport.c @@ -347,7 +347,7 @@ .iov_base = &rfc1002_marker, .iov_len = 4 }; - iov_iter_kvec(&smb_msg.msg_iter, WRITE, &hiov, 1, 4); + iov_iter_kvec(&smb_msg.msg_iter, ITER_SOURCE, &hiov, 1, 4); rc = smb_send_kvec(server, &smb_msg, &sent); if (rc < 0) goto unmask; @@ -368,7 +368,7 @@ size += iov[i].iov_len; } - iov_iter_kvec(&smb_msg.msg_iter, WRITE, iov, n_vec, size); + iov_iter_kvec(&smb_msg.msg_iter, ITER_SOURCE, iov, n_vec, size); rc = smb_send_kvec(server, &smb_msg, &sent); if (rc < 0) @@ -384,7 +384,7 @@ rqst_page_get_length(&rqst[j], i, &bvec.bv_len, &bvec.bv_offset); - iov_iter_bvec(&smb_msg.msg_iter, WRITE, + iov_iter_bvec(&smb_msg.msg_iter, ITER_SOURCE, &bvec, 1, bvec.bv_len); rc = smb_send_kvec(server, &smb_msg, &sent); if (rc < 0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/coredump.c +++ linux-oem-6.1-6.1.0/fs/coredump.c @@ -831,6 +831,30 @@ } } +int dump_emit(struct coredump_params *cprm, const void *addr, int nr) +{ + if (cprm->to_skip) { + if (!__dump_skip(cprm, cprm->to_skip)) + return 0; + cprm->to_skip = 0; + } + return __dump_emit(cprm, addr, nr); +} +EXPORT_SYMBOL(dump_emit); + +void dump_skip_to(struct coredump_params *cprm, unsigned long pos) +{ + cprm->to_skip = pos - cprm->pos; +} +EXPORT_SYMBOL(dump_skip_to); + +void dump_skip(struct coredump_params *cprm, size_t nr) +{ + cprm->to_skip += nr; +} +EXPORT_SYMBOL(dump_skip); + +#ifdef CONFIG_ELF_CORE static int dump_emit_page(struct coredump_params *cprm, struct page *page) { struct bio_vec bvec = { @@ -853,7 +877,7 @@ if (dump_interrupted()) return 0; pos = file->f_pos; - iov_iter_bvec(&iter, WRITE, &bvec, 1, PAGE_SIZE); + iov_iter_bvec(&iter, ITER_SOURCE, &bvec, 1, PAGE_SIZE); n = __kernel_write_iter(cprm->file, &iter, &pos); if (n != PAGE_SIZE) return 0; @@ -864,30 +888,6 @@ return 1; } -int dump_emit(struct coredump_params *cprm, const void *addr, int nr) -{ - if (cprm->to_skip) { - if (!__dump_skip(cprm, cprm->to_skip)) - return 0; - cprm->to_skip = 0; - } - return __dump_emit(cprm, addr, nr); -} -EXPORT_SYMBOL(dump_emit); - -void dump_skip_to(struct coredump_params *cprm, unsigned long pos) -{ - cprm->to_skip = pos - cprm->pos; -} -EXPORT_SYMBOL(dump_skip_to); - -void dump_skip(struct coredump_params *cprm, size_t nr) -{ - cprm->to_skip += nr; -} -EXPORT_SYMBOL(dump_skip); - -#ifdef CONFIG_ELF_CORE int dump_user_range(struct coredump_params *cprm, unsigned long start, unsigned long len) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ext4/sysfs.c +++ linux-oem-6.1-6.1.0/fs/ext4/sysfs.c @@ -491,6 +491,11 @@ complete(&sbi->s_kobj_unregister); } +static void ext4_feat_release(struct kobject *kobj) +{ + kfree(kobj); +} + static const struct sysfs_ops ext4_attr_ops = { .show = ext4_attr_show, .store = ext4_attr_store, @@ -505,7 +510,7 @@ static struct kobj_type ext4_feat_ktype = { .default_groups = ext4_feat_groups, .sysfs_ops = &ext4_attr_ops, - .release = (void (*)(struct kobject *))kfree, + .release = ext4_feat_release, }; void ext4_notify_error_sysfs(struct ext4_sb_info *sbi) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/f2fs/extent_cache.c +++ linux-oem-6.1-6.1.0/fs/f2fs/extent_cache.c @@ -415,7 +415,8 @@ struct extent_node *en; bool ret = false; - f2fs_bug_on(sbi, !et); + if (!et) + return false; trace_f2fs_lookup_extent_tree_start(inode, pgofs); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/fscache/io.c +++ linux-oem-6.1-6.1.0/fs/fscache/io.c @@ -286,7 +286,7 @@ * taken into account. */ - iov_iter_xarray(&iter, WRITE, &mapping->i_pages, start, len); + iov_iter_xarray(&iter, ITER_SOURCE, &mapping->i_pages, start, len); fscache_write(cres, start, &iter, fscache_wreq_done, wreq); return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/fscache/volume.c +++ linux-oem-6.1-6.1.0/fs/fscache/volume.c @@ -141,13 +141,14 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate, unsigned int collidee_debug_id) { - wait_var_event_timeout(&candidate->flags, - !fscache_is_acquire_pending(candidate), 20 * HZ); + wait_on_bit_timeout(&candidate->flags, FSCACHE_VOLUME_ACQUIRE_PENDING, + TASK_UNINTERRUPTIBLE, 20 * HZ); if (fscache_is_acquire_pending(candidate)) { pr_notice("Potential volume collision new=%08x old=%08x", candidate->debug_id, collidee_debug_id); fscache_stat(&fscache_n_volumes_collision); - wait_var_event(&candidate->flags, !fscache_is_acquire_pending(candidate)); + wait_on_bit(&candidate->flags, FSCACHE_VOLUME_ACQUIRE_PENDING, + TASK_UNINTERRUPTIBLE); } } @@ -279,8 +280,7 @@ fscache_end_cache_access(volume->cache, fscache_access_acquire_volume_end); - clear_bit_unlock(FSCACHE_VOLUME_CREATING, &volume->flags); - wake_up_bit(&volume->flags, FSCACHE_VOLUME_CREATING); + clear_and_wake_up_bit(FSCACHE_VOLUME_CREATING, &volume->flags); fscache_put_volume(volume, fscache_volume_put_create_work); } @@ -347,8 +347,8 @@ hlist_bl_for_each_entry(cursor, p, h, hash_link) { if (fscache_volume_same(cursor, volume)) { fscache_see_volume(cursor, fscache_volume_see_hash_wake); - clear_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, &cursor->flags); - wake_up_bit(&cursor->flags, FSCACHE_VOLUME_ACQUIRE_PENDING); + clear_and_wake_up_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, + &cursor->flags); return; } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/fuse/ioctl.c +++ linux-oem-6.1-6.1.0/fs/fuse/ioctl.c @@ -255,7 +255,7 @@ ap.args.in_pages = true; err = -EFAULT; - iov_iter_init(&ii, WRITE, in_iov, in_iovs, in_size); + iov_iter_init(&ii, ITER_SOURCE, in_iov, in_iovs, in_size); for (i = 0; iov_iter_count(&ii) && !WARN_ON(i >= ap.num_pages); i++) { c = copy_page_from_iter(ap.pages[i], 0, PAGE_SIZE, &ii); if (c != PAGE_SIZE && iov_iter_count(&ii)) @@ -324,7 +324,7 @@ goto out; err = -EFAULT; - iov_iter_init(&ii, READ, out_iov, out_iovs, transferred); + iov_iter_init(&ii, ITER_DEST, out_iov, out_iovs, transferred); for (i = 0; iov_iter_count(&ii) && !WARN_ON(i >= ap.num_pages); i++) { c = copy_page_to_iter(ap.pages[i], 0, PAGE_SIZE, &ii); if (c != PAGE_SIZE && iov_iter_count(&ii)) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/gfs2/aops.c +++ linux-oem-6.1-6.1.0/fs/gfs2/aops.c @@ -427,8 +427,6 @@ return error; kaddr = kmap_atomic(page); - if (dsize > gfs2_max_stuffed_size(ip)) - dsize = gfs2_max_stuffed_size(ip); memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), dsize); memset(kaddr + dsize, 0, PAGE_SIZE - dsize); kunmap_atomic(kaddr); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/gfs2/bmap.c +++ linux-oem-6.1-6.1.0/fs/gfs2/bmap.c @@ -61,9 +61,6 @@ void *kaddr = kmap(page); u64 dsize = i_size_read(inode); - if (dsize > gfs2_max_stuffed_size(ip)) - dsize = gfs2_max_stuffed_size(ip); - memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), dsize); memset(kaddr + dsize, 0, PAGE_SIZE - dsize); kunmap(page); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/gfs2/glops.c +++ linux-oem-6.1-6.1.0/fs/gfs2/glops.c @@ -397,38 +397,39 @@ struct timespec64 atime; u16 height, depth; umode_t mode = be32_to_cpu(str->di_mode); - bool is_new = ip->i_inode.i_state & I_NEW; + struct inode *inode = &ip->i_inode; + bool is_new = inode->i_state & I_NEW; if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) goto corrupt; - if (unlikely(!is_new && inode_wrong_type(&ip->i_inode, mode))) + if (unlikely(!is_new && inode_wrong_type(inode, mode))) goto corrupt; ip->i_no_formal_ino = be64_to_cpu(str->di_num.no_formal_ino); - ip->i_inode.i_mode = mode; + inode->i_mode = mode; if (is_new) { - ip->i_inode.i_rdev = 0; + inode->i_rdev = 0; switch (mode & S_IFMT) { case S_IFBLK: case S_IFCHR: - ip->i_inode.i_rdev = MKDEV(be32_to_cpu(str->di_major), - be32_to_cpu(str->di_minor)); + inode->i_rdev = MKDEV(be32_to_cpu(str->di_major), + be32_to_cpu(str->di_minor)); break; } } - i_uid_write(&ip->i_inode, be32_to_cpu(str->di_uid)); - i_gid_write(&ip->i_inode, be32_to_cpu(str->di_gid)); - set_nlink(&ip->i_inode, be32_to_cpu(str->di_nlink)); - i_size_write(&ip->i_inode, be64_to_cpu(str->di_size)); - gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); + i_uid_write(inode, be32_to_cpu(str->di_uid)); + i_gid_write(inode, be32_to_cpu(str->di_gid)); + set_nlink(inode, be32_to_cpu(str->di_nlink)); + i_size_write(inode, be64_to_cpu(str->di_size)); + gfs2_set_inode_blocks(inode, be64_to_cpu(str->di_blocks)); atime.tv_sec = be64_to_cpu(str->di_atime); atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); - if (timespec64_compare(&ip->i_inode.i_atime, &atime) < 0) - ip->i_inode.i_atime = atime; - ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); - ip->i_inode.i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); - ip->i_inode.i_ctime.tv_sec = be64_to_cpu(str->di_ctime); - ip->i_inode.i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec); + if (timespec64_compare(&inode->i_atime, &atime) < 0) + inode->i_atime = atime; + inode->i_mtime.tv_sec = be64_to_cpu(str->di_mtime); + inode->i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); + inode->i_ctime.tv_sec = be64_to_cpu(str->di_ctime); + inode->i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec); ip->i_goal = be64_to_cpu(str->di_goal_meta); ip->i_generation = be64_to_cpu(str->di_generation); @@ -436,7 +437,7 @@ ip->i_diskflags = be32_to_cpu(str->di_flags); ip->i_eattr = be64_to_cpu(str->di_eattr); /* i_diskflags and i_eattr must be set before gfs2_set_inode_flags() */ - gfs2_set_inode_flags(&ip->i_inode); + gfs2_set_inode_flags(inode); height = be16_to_cpu(str->di_height); if (unlikely(height > GFS2_MAX_META_HEIGHT)) goto corrupt; @@ -448,8 +449,11 @@ ip->i_depth = (u8)depth; ip->i_entries = be32_to_cpu(str->di_entries); - if (S_ISREG(ip->i_inode.i_mode)) - gfs2_set_aops(&ip->i_inode); + if (gfs2_is_stuffed(ip) && inode->i_size > gfs2_max_stuffed_size(ip)) + goto corrupt; + + if (S_ISREG(inode->i_mode)) + gfs2_set_aops(inode); return 0; corrupt: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/gfs2/log.c +++ linux-oem-6.1-6.1.0/fs/gfs2/log.c @@ -80,6 +80,15 @@ brelse(bd->bd_bh); } +static int __gfs2_writepage(struct page *page, struct writeback_control *wbc, + void *data) +{ + struct address_space *mapping = data; + int ret = mapping->a_ops->writepage(page, wbc); + mapping_set_error(mapping, ret); + return ret; +} + /** * gfs2_ail1_start_one - Start I/O on a transaction * @sdp: The superblock @@ -131,7 +140,7 @@ if (!mapping) continue; spin_unlock(&sdp->sd_ail_lock); - ret = filemap_fdatawrite_wbc(mapping, wbc); + ret = write_cache_pages(mapping, wbc, __gfs2_writepage, mapping); if (need_resched()) { blk_finish_plug(plug); cond_resched(); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/gfs2/super.c +++ linux-oem-6.1-6.1.0/fs/gfs2/super.c @@ -379,6 +379,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) { + const struct inode *inode = &ip->i_inode; struct gfs2_dinode *str = buf; str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC); @@ -386,15 +387,15 @@ str->di_header.mh_format = cpu_to_be32(GFS2_FORMAT_DI); str->di_num.no_addr = cpu_to_be64(ip->i_no_addr); str->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino); - str->di_mode = cpu_to_be32(ip->i_inode.i_mode); - str->di_uid = cpu_to_be32(i_uid_read(&ip->i_inode)); - str->di_gid = cpu_to_be32(i_gid_read(&ip->i_inode)); - str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); - str->di_size = cpu_to_be64(i_size_read(&ip->i_inode)); - str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); - str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); - str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); - str->di_ctime = cpu_to_be64(ip->i_inode.i_ctime.tv_sec); + str->di_mode = cpu_to_be32(inode->i_mode); + str->di_uid = cpu_to_be32(i_uid_read(inode)); + str->di_gid = cpu_to_be32(i_gid_read(inode)); + str->di_nlink = cpu_to_be32(inode->i_nlink); + str->di_size = cpu_to_be64(i_size_read(inode)); + str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(inode)); + str->di_atime = cpu_to_be64(inode->i_atime.tv_sec); + str->di_mtime = cpu_to_be64(inode->i_mtime.tv_sec); + str->di_ctime = cpu_to_be64(inode->i_ctime.tv_sec); str->di_goal_meta = cpu_to_be64(ip->i_goal); str->di_goal_data = cpu_to_be64(ip->i_goal); @@ -402,16 +403,16 @@ str->di_flags = cpu_to_be32(ip->i_diskflags); str->di_height = cpu_to_be16(ip->i_height); - str->di_payload_format = cpu_to_be32(S_ISDIR(ip->i_inode.i_mode) && + str->di_payload_format = cpu_to_be32(S_ISDIR(inode->i_mode) && !(ip->i_diskflags & GFS2_DIF_EXHASH) ? GFS2_FORMAT_DE : 0); str->di_depth = cpu_to_be16(ip->i_depth); str->di_entries = cpu_to_be32(ip->i_entries); str->di_eattr = cpu_to_be64(ip->i_eattr); - str->di_atime_nsec = cpu_to_be32(ip->i_inode.i_atime.tv_nsec); - str->di_mtime_nsec = cpu_to_be32(ip->i_inode.i_mtime.tv_nsec); - str->di_ctime_nsec = cpu_to_be32(ip->i_inode.i_ctime.tv_nsec); + str->di_atime_nsec = cpu_to_be32(inode->i_atime.tv_nsec); + str->di_mtime_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); + str->di_ctime_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); } /** only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ksmbd/ksmbd_netlink.h +++ linux-oem-6.1-6.1.0/fs/ksmbd/ksmbd_netlink.h @@ -105,7 +105,8 @@ __u32 sub_auth[3]; /* Subauth value for Security ID */ __u32 smb2_max_credits; /* MAX credits */ __u32 smbd_max_io_size; /* smbd read write size */ - __u32 reserved[127]; /* Reserved room */ + __u32 max_connections; /* Number of maximum simultaneous connections */ + __u32 reserved[126]; /* Reserved room */ __u32 ifc_list_sz; /* interfaces list size */ __s8 ____payload[]; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ksmbd/ndr.c +++ linux-oem-6.1-6.1.0/fs/ksmbd/ndr.c @@ -242,7 +242,7 @@ return ret; if (da->version != 3 && da->version != 4) { - pr_err("v%d version is not supported\n", da->version); + ksmbd_debug(VFS, "v%d version is not supported\n", da->version); return -EINVAL; } @@ -251,7 +251,7 @@ return ret; if (da->version != version2) { - pr_err("ndr version mismatched(version: %d, version2: %d)\n", + ksmbd_debug(VFS, "ndr version mismatched(version: %d, version2: %d)\n", da->version, version2); return -EINVAL; } @@ -457,7 +457,7 @@ if (ret) return ret; if (acl->version != 4) { - pr_err("v%d version is not supported\n", acl->version); + ksmbd_debug(VFS, "v%d version is not supported\n", acl->version); return -EINVAL; } @@ -465,7 +465,7 @@ if (ret) return ret; if (acl->version != version2) { - pr_err("ndr version mismatched(version: %d, version2: %d)\n", + ksmbd_debug(VFS, "ndr version mismatched(version: %d, version2: %d)\n", acl->version, version2); return -EINVAL; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ksmbd/server.h +++ linux-oem-6.1-6.1.0/fs/ksmbd/server.h @@ -41,6 +41,7 @@ unsigned int share_fake_fscaps; struct smb_sid domain_sid; unsigned int auth_mechs; + unsigned int max_connections; char *conf[SERVER_CONF_WORK_GROUP + 1]; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ksmbd/smb2pdu.h +++ linux-oem-6.1-6.1.0/fs/ksmbd/smb2pdu.h @@ -24,8 +24,9 @@ #define SMB21_DEFAULT_IOSIZE (1024 * 1024) #define SMB3_DEFAULT_TRANS_SIZE (1024 * 1024) -#define SMB3_MIN_IOSIZE (64 * 1024) -#define SMB3_MAX_IOSIZE (8 * 1024 * 1024) +#define SMB3_MIN_IOSIZE (64 * 1024) +#define SMB3_MAX_IOSIZE (8 * 1024 * 1024) +#define SMB3_MAX_MSGSIZE (4 * 4096) /* * Definitions for SMB2 Protocol Data Units (network frames) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ksmbd/transport_ipc.c +++ linux-oem-6.1-6.1.0/fs/ksmbd/transport_ipc.c @@ -308,6 +308,9 @@ if (req->smbd_max_io_size) init_smbd_max_io_size(req->smbd_max_io_size); + if (req->max_connections) + server_conf.max_connections = req->max_connections; + ret = ksmbd_set_netbios_name(req->netbios_name); ret |= ksmbd_set_server_string(req->server_string); ret |= ksmbd_set_work_group(req->work_group); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/netfs/io.c +++ linux-oem-6.1-6.1.0/fs/netfs/io.c @@ -23,7 +23,7 @@ { struct iov_iter iter; - iov_iter_xarray(&iter, READ, &subreq->rreq->mapping->i_pages, + iov_iter_xarray(&iter, ITER_DEST, &subreq->rreq->mapping->i_pages, subreq->start + subreq->transferred, subreq->len - subreq->transferred); iov_iter_zero(iov_iter_count(&iter), &iter); @@ -49,7 +49,7 @@ struct iov_iter iter; netfs_stat(&netfs_n_rh_read); - iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, + iov_iter_xarray(&iter, ITER_DEST, &rreq->mapping->i_pages, subreq->start + subreq->transferred, subreq->len - subreq->transferred); @@ -208,7 +208,7 @@ continue; } - iov_iter_xarray(&iter, WRITE, &rreq->mapping->i_pages, + iov_iter_xarray(&iter, ITER_SOURCE, &rreq->mapping->i_pages, subreq->start, subreq->len); atomic_inc(&rreq->nr_copy_ops); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfs/filelayout/filelayout.c +++ linux-oem-6.1-6.1.0/fs/nfs/filelayout/filelayout.c @@ -783,6 +783,12 @@ return &fl->generic_hdr; } +static bool +filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg) +{ + return flseg->num_fh > 1; +} + /* * filelayout_pg_test(). Called by nfs_can_coalesce_requests() * @@ -803,6 +809,8 @@ size = pnfs_generic_pg_test(pgio, prev, req); if (!size) return 0; + else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg))) + return size; /* see if req and prev are in the same stripe */ if (prev) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfs/fscache.c +++ linux-oem-6.1-6.1.0/fs/nfs/fscache.c @@ -252,7 +252,7 @@ bvec[0].bv_page = page; bvec[0].bv_offset = 0; bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, READ, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + iov_iter_bvec(&iter, ITER_DEST, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); ret = fscache_begin_read_operation(&cres, cookie); if (ret < 0) @@ -282,7 +282,7 @@ bvec[0].bv_page = page; bvec[0].bv_offset = 0; bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, WRITE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + iov_iter_bvec(&iter, ITER_SOURCE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); ret = fscache_begin_write_operation(&cres, cookie); if (ret < 0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/filecache.c +++ linux-oem-6.1-6.1.0/fs/nfsd/filecache.c @@ -33,7 +33,6 @@ static DEFINE_PER_CPU(unsigned long, nfsd_file_acquisitions); static DEFINE_PER_CPU(unsigned long, nfsd_file_releases); static DEFINE_PER_CPU(unsigned long, nfsd_file_total_age); -static DEFINE_PER_CPU(unsigned long, nfsd_file_pages_flushed); static DEFINE_PER_CPU(unsigned long, nfsd_file_evictions); struct nfsd_fcache_disposal { @@ -63,6 +62,7 @@ struct net *net; const struct cred *cred; unsigned char need; + bool gc; enum nfsd_file_lookup_type type; }; @@ -162,6 +162,8 @@ return 1; if (!nfsd_match_cred(nf->nf_cred, key->cred)) return 1; + if (!!test_bit(NFSD_FILE_GC, &nf->nf_flags) != key->gc) + return 1; if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) return 1; break; @@ -297,56 +299,28 @@ nf->nf_flags = 0; __set_bit(NFSD_FILE_HASHED, &nf->nf_flags); __set_bit(NFSD_FILE_PENDING, &nf->nf_flags); + if (key->gc) + __set_bit(NFSD_FILE_GC, &nf->nf_flags); nf->nf_inode = key->inode; - /* nf_ref is pre-incremented for hash table */ - refcount_set(&nf->nf_ref, 2); + refcount_set(&nf->nf_ref, 1); nf->nf_may = key->need; nf->nf_mark = NULL; } return nf; } -static bool -nfsd_file_free(struct nfsd_file *nf) -{ - s64 age = ktime_to_ms(ktime_sub(ktime_get(), nf->nf_birthtime)); - bool flush = false; - - this_cpu_inc(nfsd_file_releases); - this_cpu_add(nfsd_file_total_age, age); - - trace_nfsd_file_put_final(nf); - if (nf->nf_mark) - nfsd_file_mark_put(nf->nf_mark); - if (nf->nf_file) { - get_file(nf->nf_file); - filp_close(nf->nf_file, NULL); - fput(nf->nf_file); - flush = true; - } - - /* - * If this item is still linked via nf_lru, that's a bug. - * WARN and leak it to preserve system stability. - */ - if (WARN_ON_ONCE(!list_empty(&nf->nf_lru))) - return flush; - - call_rcu(&nf->nf_rcu, nfsd_file_slab_free); - return flush; -} - -static bool -nfsd_file_check_writeback(struct nfsd_file *nf) +static void +nfsd_file_fsync(struct nfsd_file *nf) { struct file *file = nf->nf_file; - struct address_space *mapping; + int ret; if (!file || !(file->f_mode & FMODE_WRITE)) - return false; - mapping = file->f_mapping; - return mapping_tagged(mapping, PAGECACHE_TAG_DIRTY) || - mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK); + return; + ret = vfs_fsync(file, 1); + trace_nfsd_file_fsync(nf, ret); + if (ret) + nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); } static int @@ -360,31 +334,6 @@ } static void -nfsd_file_flush(struct nfsd_file *nf) -{ - struct file *file = nf->nf_file; - - if (!file || !(file->f_mode & FMODE_WRITE)) - return; - this_cpu_add(nfsd_file_pages_flushed, file->f_mapping->nrpages); - if (vfs_fsync(file, 1) != 0) - nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); -} - -static void nfsd_file_lru_add(struct nfsd_file *nf) -{ - set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); - if (list_lru_add(&nfsd_file_lru, &nf->nf_lru)) - trace_nfsd_file_lru_add(nf); -} - -static void nfsd_file_lru_remove(struct nfsd_file *nf) -{ - if (list_lru_del(&nfsd_file_lru, &nf->nf_lru)) - trace_nfsd_file_lru_del(nf); -} - -static void nfsd_file_hash_remove(struct nfsd_file *nf) { trace_nfsd_file_unhash(nf); @@ -406,60 +355,76 @@ } static void -nfsd_file_unhash_and_dispose(struct nfsd_file *nf, struct list_head *dispose) +nfsd_file_free(struct nfsd_file *nf) { - trace_nfsd_file_unhash_and_dispose(nf); - if (nfsd_file_unhash(nf)) { - /* caller must call nfsd_file_dispose_list() later */ - nfsd_file_lru_remove(nf); - list_add(&nf->nf_lru, dispose); + s64 age = ktime_to_ms(ktime_sub(ktime_get(), nf->nf_birthtime)); + + trace_nfsd_file_free(nf); + + this_cpu_inc(nfsd_file_releases); + this_cpu_add(nfsd_file_total_age, age); + + nfsd_file_unhash(nf); + + /* + * We call fsync here in order to catch writeback errors. It's not + * strictly required by the protocol, but an nfsd_file could get + * evicted from the cache before a COMMIT comes in. If another + * task were to open that file in the interim and scrape the error, + * then the client may never see it. By calling fsync here, we ensure + * that writeback happens before the entry is freed, and that any + * errors reported result in the write verifier changing. + */ + nfsd_file_fsync(nf); + + if (nf->nf_mark) + nfsd_file_mark_put(nf->nf_mark); + if (nf->nf_file) { + get_file(nf->nf_file); + filp_close(nf->nf_file, NULL); + fput(nf->nf_file); } + + /* + * If this item is still linked via nf_lru, that's a bug. + * WARN and leak it to preserve system stability. + */ + if (WARN_ON_ONCE(!list_empty(&nf->nf_lru))) + return; + + call_rcu(&nf->nf_rcu, nfsd_file_slab_free); } -static void -nfsd_file_put_noref(struct nfsd_file *nf) +static bool +nfsd_file_check_writeback(struct nfsd_file *nf) { - trace_nfsd_file_put(nf); + struct file *file = nf->nf_file; + struct address_space *mapping; - if (refcount_dec_and_test(&nf->nf_ref)) { - WARN_ON(test_bit(NFSD_FILE_HASHED, &nf->nf_flags)); - nfsd_file_lru_remove(nf); - nfsd_file_free(nf); - } + if (!file || !(file->f_mode & FMODE_WRITE)) + return false; + mapping = file->f_mapping; + return mapping_tagged(mapping, PAGECACHE_TAG_DIRTY) || + mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK); } -void -nfsd_file_put(struct nfsd_file *nf) +static bool nfsd_file_lru_add(struct nfsd_file *nf) { - might_sleep(); - - nfsd_file_lru_add(nf); - if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) { - nfsd_file_flush(nf); - nfsd_file_put_noref(nf); - } else if (nf->nf_file) { - nfsd_file_put_noref(nf); - nfsd_file_schedule_laundrette(); - } else - nfsd_file_put_noref(nf); + set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); + if (list_lru_add(&nfsd_file_lru, &nf->nf_lru)) { + trace_nfsd_file_lru_add(nf); + return true; + } + return false; } -/** - * nfsd_file_close - Close an nfsd_file - * @nf: nfsd_file to close - * - * If this is the final reference for @nf, free it immediately. - * This reflects an on-the-wire CLOSE or DELEGRETURN into the - * VFS and exported filesystem. - */ -void nfsd_file_close(struct nfsd_file *nf) +static bool nfsd_file_lru_remove(struct nfsd_file *nf) { - nfsd_file_put(nf); - if (refcount_dec_if_one(&nf->nf_ref)) { - nfsd_file_unhash(nf); - nfsd_file_lru_remove(nf); - nfsd_file_free(nf); + if (list_lru_del(&nfsd_file_lru, &nf->nf_lru)) { + trace_nfsd_file_lru_del(nf); + return true; } + return false; } struct nfsd_file * @@ -470,36 +435,60 @@ return NULL; } -static void -nfsd_file_dispose_list(struct list_head *dispose) +/** + * nfsd_file_put - put the reference to a nfsd_file + * @nf: nfsd_file of which to put the reference + * + * Put a reference to a nfsd_file. In the non-GC case, we just put the + * reference immediately. In the GC case, if the reference would be + * the last one, the put it on the LRU instead to be cleaned up later. + */ +void +nfsd_file_put(struct nfsd_file *nf) { - struct nfsd_file *nf; + might_sleep(); + trace_nfsd_file_put(nf); - while(!list_empty(dispose)) { - nf = list_first_entry(dispose, struct nfsd_file, nf_lru); - list_del_init(&nf->nf_lru); - nfsd_file_flush(nf); - nfsd_file_put_noref(nf); + if (test_bit(NFSD_FILE_GC, &nf->nf_flags) && + test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) { + /* + * If this is the last reference (nf_ref == 1), then try to + * transfer it to the LRU. + */ + if (refcount_dec_not_one(&nf->nf_ref)) + return; + + /* Try to add it to the LRU. If that fails, decrement. */ + if (nfsd_file_lru_add(nf)) { + /* If it's still hashed, we're done */ + if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) { + nfsd_file_schedule_laundrette(); + return; + } + + /* + * We're racing with unhashing, so try to remove it from + * the LRU. If removal fails, then someone else already + * has our reference. + */ + if (!nfsd_file_lru_remove(nf)) + return; + } } + if (refcount_dec_and_test(&nf->nf_ref)) + nfsd_file_free(nf); } static void -nfsd_file_dispose_list_sync(struct list_head *dispose) +nfsd_file_dispose_list(struct list_head *dispose) { - bool flush = false; struct nfsd_file *nf; - while(!list_empty(dispose)) { + while (!list_empty(dispose)) { nf = list_first_entry(dispose, struct nfsd_file, nf_lru); list_del_init(&nf->nf_lru); - nfsd_file_flush(nf); - if (!refcount_dec_and_test(&nf->nf_ref)) - continue; - if (nfsd_file_free(nf)) - flush = true; + nfsd_file_free(nf); } - if (flush) - flush_delayed_fput(); } static void @@ -569,21 +558,8 @@ struct list_head *head = arg; struct nfsd_file *nf = list_entry(item, struct nfsd_file, nf_lru); - /* - * Do a lockless refcount check. The hashtable holds one reference, so - * we look to see if anything else has a reference, or if any have - * been put since the shrinker last ran. Those don't get unhashed and - * released. - * - * Note that in the put path, we set the flag and then decrement the - * counter. Here we check the counter and then test and clear the flag. - * That order is deliberate to ensure that we can do this locklessly. - */ - if (refcount_read(&nf->nf_ref) > 1) { - list_lru_isolate(lru, &nf->nf_lru); - trace_nfsd_file_gc_in_use(nf); - return LRU_REMOVED; - } + /* We should only be dealing with GC entries here */ + WARN_ON_ONCE(!test_bit(NFSD_FILE_GC, &nf->nf_flags)); /* * Don't throw out files that are still undergoing I/O or @@ -594,40 +570,30 @@ return LRU_SKIP; } + /* If it was recently added to the list, skip it */ if (test_and_clear_bit(NFSD_FILE_REFERENCED, &nf->nf_flags)) { trace_nfsd_file_gc_referenced(nf); return LRU_ROTATE; } - if (!test_and_clear_bit(NFSD_FILE_HASHED, &nf->nf_flags)) { - trace_nfsd_file_gc_hashed(nf); - return LRU_SKIP; + /* + * Put the reference held on behalf of the LRU. If it wasn't the last + * one, then just remove it from the LRU and ignore it. + */ + if (!refcount_dec_and_test(&nf->nf_ref)) { + trace_nfsd_file_gc_in_use(nf); + list_lru_isolate(lru, &nf->nf_lru); + return LRU_REMOVED; } + /* Refcount went to zero. Unhash it and queue it to the dispose list */ + nfsd_file_unhash(nf); list_lru_isolate_move(lru, &nf->nf_lru, head); this_cpu_inc(nfsd_file_evictions); trace_nfsd_file_gc_disposed(nf); return LRU_REMOVED; } -/* - * Unhash items on @dispose immediately, then queue them on the - * disposal workqueue to finish releasing them in the background. - * - * cel: Note that between the time list_lru_shrink_walk runs and - * now, these items are in the hash table but marked unhashed. - * Why release these outside of lru_cb ? There's no lock ordering - * problem since lru_cb currently takes no lock. - */ -static void nfsd_file_gc_dispose_list(struct list_head *dispose) -{ - struct nfsd_file *nf; - - list_for_each_entry(nf, dispose, nf_lru) - nfsd_file_hash_remove(nf); - nfsd_file_dispose_list_delayed(dispose); -} - static void nfsd_file_gc(void) { @@ -637,7 +603,7 @@ ret = list_lru_walk(&nfsd_file_lru, nfsd_file_lru_cb, &dispose, list_lru_count(&nfsd_file_lru)); trace_nfsd_file_gc_removed(ret, list_lru_count(&nfsd_file_lru)); - nfsd_file_gc_dispose_list(&dispose); + nfsd_file_dispose_list_delayed(&dispose); } static void @@ -662,7 +628,7 @@ ret = list_lru_shrink_walk(&nfsd_file_lru, sc, nfsd_file_lru_cb, &dispose); trace_nfsd_file_shrinker_removed(ret, list_lru_count(&nfsd_file_lru)); - nfsd_file_gc_dispose_list(&dispose); + nfsd_file_dispose_list_delayed(&dispose); return ret; } @@ -672,18 +638,62 @@ .seeks = 1, }; -/* - * Find all cache items across all net namespaces that match @inode and - * move them to @dispose. The lookup is atomic wrt nfsd_file_acquire(). +/** + * nfsd_file_cond_queue - conditionally unhash and queue a nfsd_file + * @nf: nfsd_file to attempt to queue + * @dispose: private list to queue successfully-put objects + * + * Unhash an nfsd_file, try to get a reference to it, and then put that + * reference. If it's the last reference, queue it to the dispose list. + */ +static void +nfsd_file_cond_queue(struct nfsd_file *nf, struct list_head *dispose) + __must_hold(RCU) +{ + int decrement = 1; + + /* If we raced with someone else unhashing, ignore it */ + if (!nfsd_file_unhash(nf)) + return; + + /* If we can't get a reference, ignore it */ + if (!nfsd_file_get(nf)) + return; + + /* Extra decrement if we remove from the LRU */ + if (nfsd_file_lru_remove(nf)) + ++decrement; + + /* If refcount goes to 0, then put on the dispose list */ + if (refcount_sub_and_test(decrement, &nf->nf_ref)) { + list_add(&nf->nf_lru, dispose); + trace_nfsd_file_closing(nf); + } +} + +/** + * nfsd_file_queue_for_close: try to close out any open nfsd_files for an inode + * @inode: inode on which to close out nfsd_files + * @dispose: list on which to gather nfsd_files to close out + * + * An nfsd_file represents a struct file being held open on behalf of nfsd. An + * open file however can block other activity (such as leases), or cause + * undesirable behavior (e.g. spurious silly-renames when reexporting NFS). + * + * This function is intended to find open nfsd_files when this sort of + * conflicting access occurs and then attempt to close those files out. + * + * Populates the dispose list with entries that have already had their + * refcounts go to zero. The actual free of an nfsd_file can be expensive, + * so we leave it up to the caller whether it wants to wait or not. */ -static unsigned int -__nfsd_file_close_inode(struct inode *inode, struct list_head *dispose) +static void +nfsd_file_queue_for_close(struct inode *inode, struct list_head *dispose) { struct nfsd_file_lookup_key key = { .type = NFSD_FILE_KEY_INODE, .inode = inode, }; - unsigned int count = 0; struct nfsd_file *nf; rcu_read_lock(); @@ -692,52 +702,61 @@ nfsd_file_rhash_params); if (!nf) break; - nfsd_file_unhash_and_dispose(nf, dispose); - count++; + nfsd_file_cond_queue(nf, dispose); } while (1); rcu_read_unlock(); - return count; } /** - * nfsd_file_close_inode_sync - attempt to forcibly close a nfsd_file + * nfsd_file_close_inode - attempt a delayed close of a nfsd_file * @inode: inode of the file to attempt to remove * - * Unhash and put, then flush and fput all cache items associated with @inode. + * Close out any open nfsd_files that can be reaped for @inode. The + * actual freeing is deferred to the dispose_list_delayed infrastructure. + * + * This is used by the fsnotify callbacks and setlease notifier. */ -void -nfsd_file_close_inode_sync(struct inode *inode) +static void +nfsd_file_close_inode(struct inode *inode) { LIST_HEAD(dispose); - unsigned int count; - count = __nfsd_file_close_inode(inode, &dispose); - trace_nfsd_file_close_inode_sync(inode, count); - nfsd_file_dispose_list_sync(&dispose); + nfsd_file_queue_for_close(inode, &dispose); + nfsd_file_dispose_list_delayed(&dispose); } /** - * nfsd_file_close_inode - attempt a delayed close of a nfsd_file + * nfsd_file_close_inode_sync - attempt to forcibly close a nfsd_file * @inode: inode of the file to attempt to remove * - * Unhash and put all cache item associated with @inode. + * Close out any open nfsd_files that can be reaped for @inode. The + * nfsd_files are closed out synchronously. + * + * This is called from nfsd_rename and nfsd_unlink to avoid silly-renames + * when reexporting NFS. */ -static void -nfsd_file_close_inode(struct inode *inode) +void +nfsd_file_close_inode_sync(struct inode *inode) { + struct nfsd_file *nf; LIST_HEAD(dispose); - unsigned int count; - count = __nfsd_file_close_inode(inode, &dispose); - trace_nfsd_file_close_inode(inode, count); - nfsd_file_dispose_list_delayed(&dispose); + trace_nfsd_file_close(inode); + + nfsd_file_queue_for_close(inode, &dispose); + while (!list_empty(&dispose)) { + nf = list_first_entry(&dispose, struct nfsd_file, nf_lru); + list_del_init(&nf->nf_lru); + nfsd_file_free(nf); + } + flush_delayed_fput(); } /** * nfsd_file_delayed_close - close unused nfsd_files * @work: dummy * - * Walk the LRU list and close any entries that have not been used since + * Walk the LRU list and destroy any entries that have not been used since * the last scan. */ static void @@ -759,7 +778,7 @@ /* Only close files for F_SETLEASE leases */ if (fl->fl_flags & FL_LEASE) - nfsd_file_close_inode_sync(file_inode(fl->fl_file)); + nfsd_file_close_inode(file_inode(fl->fl_file)); return 0; } @@ -880,6 +899,13 @@ goto out; } +/** + * __nfsd_file_cache_purge: clean out the cache for shutdown + * @net: net-namespace to shut down the cache (may be NULL) + * + * Walk the nfsd_file cache and close out any that match @net. If @net is NULL, + * then close out everything. Called when an nfsd instance is being shut down. + */ static void __nfsd_file_cache_purge(struct net *net) { @@ -894,7 +920,7 @@ nf = rhashtable_walk_next(&iter); while (!IS_ERR_OR_NULL(nf)) { if (!net || nf->nf_net == net) - nfsd_file_unhash_and_dispose(nf, &dispose); + nfsd_file_cond_queue(nf, &dispose); nf = rhashtable_walk_next(&iter); } @@ -1000,7 +1026,6 @@ per_cpu(nfsd_file_acquisitions, i) = 0; per_cpu(nfsd_file_releases, i) = 0; per_cpu(nfsd_file_total_age, i) = 0; - per_cpu(nfsd_file_pages_flushed, i) = 0; per_cpu(nfsd_file_evictions, i) = 0; } } @@ -1034,12 +1059,14 @@ static __be32 nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, - unsigned int may_flags, struct nfsd_file **pnf, bool open) + unsigned int may_flags, struct file *file, + struct nfsd_file **pnf, bool want_gc) { struct nfsd_file_lookup_key key = { .type = NFSD_FILE_KEY_FULL, .need = may_flags & NFSD_FILE_MAY_MASK, .net = SVC_NET(rqstp), + .gc = want_gc, }; bool open_retry = true; struct nfsd_file *nf; @@ -1060,8 +1087,12 @@ if (nf) nf = nfsd_file_get(nf); rcu_read_unlock(); - if (nf) + + if (nf) { + if (nfsd_file_lru_remove(nf)) + WARN_ON_ONCE(refcount_dec_and_test(&nf->nf_ref)); goto wait_for_construction; + } nf = nfsd_file_alloc(&key, may_flags); if (!nf) { @@ -1094,49 +1125,53 @@ goto out; } open_retry = false; - nfsd_file_put_noref(nf); + if (refcount_dec_and_test(&nf->nf_ref)) + nfsd_file_free(nf); goto retry; } - nfsd_file_lru_remove(nf); this_cpu_inc(nfsd_file_cache_hits); status = nfserrno(nfsd_open_break_lease(file_inode(nf->nf_file), may_flags)); out: if (status == nfs_ok) { - if (open) - this_cpu_inc(nfsd_file_acquisitions); + this_cpu_inc(nfsd_file_acquisitions); *pnf = nf; } else { - nfsd_file_put(nf); + if (refcount_dec_and_test(&nf->nf_ref)) + nfsd_file_free(nf); nf = NULL; } out_status: put_cred(key.cred); - if (open) - trace_nfsd_file_acquire(rqstp, key.inode, may_flags, nf, status); + trace_nfsd_file_acquire(rqstp, key.inode, may_flags, nf, status); return status; open_file: trace_nfsd_file_alloc(nf); nf->nf_mark = nfsd_file_mark_find_or_create(nf, key.inode); if (nf->nf_mark) { - if (open) { + if (file) { + get_file(file); + nf->nf_file = file; + status = nfs_ok; + trace_nfsd_file_opened(nf, status); + } else { status = nfsd_open_verified(rqstp, fhp, may_flags, &nf->nf_file); trace_nfsd_file_open(nf, status); - } else - status = nfs_ok; + } } else status = nfserr_jukebox; /* * If construction failed, or we raced with a call to unlink() * then unhash. */ - if (status != nfs_ok || key.inode->i_nlink == 0) - if (nfsd_file_unhash(nf)) - nfsd_file_put_noref(nf); + if (status == nfs_ok && key.inode->i_nlink == 0) + status = nfserr_jukebox; + if (status != nfs_ok) + nfsd_file_unhash(nf); clear_bit_unlock(NFSD_FILE_PENDING, &nf->nf_flags); smp_mb__after_atomic(); wake_up_bit(&nf->nf_flags, NFSD_FILE_PENDING); @@ -1144,12 +1179,38 @@ } /** + * nfsd_file_acquire_gc - Get a struct nfsd_file with an open file + * @rqstp: the RPC transaction being executed + * @fhp: the NFS filehandle of the file to be opened + * @may_flags: NFSD_MAY_ settings for the file + * @pnf: OUT: new or found "struct nfsd_file" object + * + * The nfsd_file object returned by this API is reference-counted + * and garbage-collected. The object is retained for a few + * seconds after the final nfsd_file_put() in case the caller + * wants to re-use it. + * + * Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in + * network byte order is returned. + */ +__be32 +nfsd_file_acquire_gc(struct svc_rqst *rqstp, struct svc_fh *fhp, + unsigned int may_flags, struct nfsd_file **pnf) +{ + return nfsd_file_do_acquire(rqstp, fhp, may_flags, NULL, pnf, true); +} + +/** * nfsd_file_acquire - Get a struct nfsd_file with an open file * @rqstp: the RPC transaction being executed * @fhp: the NFS filehandle of the file to be opened * @may_flags: NFSD_MAY_ settings for the file * @pnf: OUT: new or found "struct nfsd_file" object * + * The nfsd_file_object returned by this API is reference-counted + * but not garbage-collected. The object is unhashed after the + * final nfsd_file_put(). + * * Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in * network byte order is returned. */ @@ -1157,24 +1218,30 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned int may_flags, struct nfsd_file **pnf) { - return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, true); + return nfsd_file_do_acquire(rqstp, fhp, may_flags, NULL, pnf, false); } /** - * nfsd_file_create - Get a struct nfsd_file, do not open + * nfsd_file_acquire_opened - Get a struct nfsd_file using existing open file * @rqstp: the RPC transaction being executed * @fhp: the NFS filehandle of the file just created * @may_flags: NFSD_MAY_ settings for the file + * @file: cached, already-open file (may be NULL) * @pnf: OUT: new or found "struct nfsd_file" object * + * Acquire a nfsd_file object that is not GC'ed. If one doesn't already exist, + * and @file is non-NULL, use it to instantiate a new nfsd_file instead of + * opening a new one. + * * Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in * network byte order is returned. */ __be32 -nfsd_file_create(struct svc_rqst *rqstp, struct svc_fh *fhp, - unsigned int may_flags, struct nfsd_file **pnf) +nfsd_file_acquire_opened(struct svc_rqst *rqstp, struct svc_fh *fhp, + unsigned int may_flags, struct file *file, + struct nfsd_file **pnf) { - return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, false); + return nfsd_file_do_acquire(rqstp, fhp, may_flags, file, pnf, false); } /* @@ -1184,7 +1251,7 @@ */ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) { - unsigned long releases = 0, pages_flushed = 0, evictions = 0; + unsigned long releases = 0, evictions = 0; unsigned long hits = 0, acquisitions = 0; unsigned int i, count = 0, buckets = 0; unsigned long lru = 0, total_age = 0; @@ -1212,7 +1279,6 @@ releases += per_cpu(nfsd_file_releases, i); total_age += per_cpu(nfsd_file_total_age, i); evictions += per_cpu(nfsd_file_evictions, i); - pages_flushed += per_cpu(nfsd_file_pages_flushed, i); } seq_printf(m, "total entries: %u\n", count); @@ -1226,6 +1292,5 @@ seq_printf(m, "mean age (ms): %ld\n", total_age / releases); else seq_printf(m, "mean age (ms): -\n"); - seq_printf(m, "pages flushed: %lu\n", pages_flushed); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/filecache.h +++ linux-oem-6.1-6.1.0/fs/nfsd/filecache.h @@ -38,6 +38,7 @@ #define NFSD_FILE_HASHED (0) #define NFSD_FILE_PENDING (1) #define NFSD_FILE_REFERENCED (2) +#define NFSD_FILE_GC (3) unsigned long nf_flags; struct inode *nf_inode; /* don't deref */ refcount_t nf_ref; @@ -52,13 +53,15 @@ int nfsd_file_cache_start_net(struct net *net); void nfsd_file_cache_shutdown_net(struct net *net); void nfsd_file_put(struct nfsd_file *nf); -void nfsd_file_close(struct nfsd_file *nf); struct nfsd_file *nfsd_file_get(struct nfsd_file *nf); void nfsd_file_close_inode_sync(struct inode *inode); bool nfsd_file_is_cached(struct inode *inode); -__be32 nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, +__be32 nfsd_file_acquire_gc(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned int may_flags, struct nfsd_file **nfp); -__be32 nfsd_file_create(struct svc_rqst *rqstp, struct svc_fh *fhp, +__be32 nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned int may_flags, struct nfsd_file **nfp); +__be32 nfsd_file_acquire_opened(struct svc_rqst *rqstp, struct svc_fh *fhp, + unsigned int may_flags, struct file *file, + struct nfsd_file **nfp); int nfsd_file_cache_stats_show(struct seq_file *m, void *v); #endif /* _FS_NFSD_FILECACHE_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/nfs3proc.c +++ linux-oem-6.1-6.1.0/fs/nfsd/nfs3proc.c @@ -13,6 +13,7 @@ #include "cache.h" #include "xdr3.h" #include "vfs.h" +#include "filecache.h" #define NFSDDBG_FACILITY NFSDDBG_PROC @@ -763,6 +764,7 @@ { struct nfsd3_commitargs *argp = rqstp->rq_argp; struct nfsd3_commitres *resp = rqstp->rq_resp; + struct nfsd_file *nf; dprintk("nfsd: COMMIT(3) %s %u@%Lu\n", SVCFH_fmt(&argp->fh), @@ -770,8 +772,14 @@ (unsigned long long) argp->offset); fh_copy(&resp->fh, &argp->fh); - resp->status = nfsd_commit(rqstp, &resp->fh, argp->offset, + resp->status = nfsd_file_acquire_gc(rqstp, &resp->fh, NFSD_MAY_WRITE | + NFSD_MAY_NOT_BREAK_LEASE, &nf); + if (resp->status) + goto out; + resp->status = nfsd_commit(rqstp, &resp->fh, nf, argp->offset, argp->count, resp->verf); + nfsd_file_put(nf); +out: return rpc_success; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/trace.h +++ linux-oem-6.1-6.1.0/fs/nfsd/trace.h @@ -817,7 +817,8 @@ __print_flags(val, "|", \ { 1 << NFSD_FILE_HASHED, "HASHED" }, \ { 1 << NFSD_FILE_PENDING, "PENDING" }, \ - { 1 << NFSD_FILE_REFERENCED, "REFERENCED"}) + { 1 << NFSD_FILE_REFERENCED, "REFERENCED" }, \ + { 1 << NFSD_FILE_GC, "GC" }) DECLARE_EVENT_CLASS(nfsd_file_class, TP_PROTO(struct nfsd_file *nf), @@ -849,10 +850,11 @@ TP_PROTO(struct nfsd_file *nf), \ TP_ARGS(nf)) -DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final); +DEFINE_NFSD_FILE_EVENT(nfsd_file_free); DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash); DEFINE_NFSD_FILE_EVENT(nfsd_file_put); -DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_dispose); +DEFINE_NFSD_FILE_EVENT(nfsd_file_closing); +DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_queue); TRACE_EVENT(nfsd_file_alloc, TP_PROTO( @@ -920,43 +922,6 @@ ) ); -TRACE_EVENT(nfsd_file_create, - TP_PROTO( - const struct svc_rqst *rqstp, - unsigned int may_flags, - const struct nfsd_file *nf - ), - - TP_ARGS(rqstp, may_flags, nf), - - TP_STRUCT__entry( - __field(const void *, nf_inode) - __field(const void *, nf_file) - __field(unsigned long, may_flags) - __field(unsigned long, nf_flags) - __field(unsigned long, nf_may) - __field(unsigned int, nf_ref) - __field(u32, xid) - ), - - TP_fast_assign( - __entry->nf_inode = nf->nf_inode; - __entry->nf_file = nf->nf_file; - __entry->may_flags = may_flags; - __entry->nf_flags = nf->nf_flags; - __entry->nf_may = nf->nf_may; - __entry->nf_ref = refcount_read(&nf->nf_ref); - __entry->xid = be32_to_cpu(rqstp->rq_xid); - ), - - TP_printk("xid=0x%x inode=%p may_flags=%s ref=%u nf_flags=%s nf_may=%s nf_file=%p", - __entry->xid, __entry->nf_inode, - show_nfsd_may_flags(__entry->may_flags), - __entry->nf_ref, show_nf_flags(__entry->nf_flags), - show_nfsd_may_flags(__entry->nf_may), __entry->nf_file - ) -); - TRACE_EVENT(nfsd_file_insert_err, TP_PROTO( const struct svc_rqst *rqstp, @@ -1018,8 +983,8 @@ ) ); -TRACE_EVENT(nfsd_file_open, - TP_PROTO(struct nfsd_file *nf, __be32 status), +DECLARE_EVENT_CLASS(nfsd_file_open_class, + TP_PROTO(const struct nfsd_file *nf, __be32 status), TP_ARGS(nf, status), TP_STRUCT__entry( __field(void *, nf_inode) /* cannot be dereferenced */ @@ -1043,34 +1008,16 @@ __entry->nf_file) ) -DECLARE_EVENT_CLASS(nfsd_file_search_class, - TP_PROTO( - const struct inode *inode, - unsigned int count - ), - TP_ARGS(inode, count), - TP_STRUCT__entry( - __field(const struct inode *, inode) - __field(unsigned int, count) - ), - TP_fast_assign( - __entry->inode = inode; - __entry->count = count; - ), - TP_printk("inode=%p count=%u", - __entry->inode, __entry->count) -); - -#define DEFINE_NFSD_FILE_SEARCH_EVENT(name) \ -DEFINE_EVENT(nfsd_file_search_class, name, \ +#define DEFINE_NFSD_FILE_OPEN_EVENT(name) \ +DEFINE_EVENT(nfsd_file_open_class, name, \ TP_PROTO( \ - const struct inode *inode, \ - unsigned int count \ + const struct nfsd_file *nf, \ + __be32 status \ ), \ - TP_ARGS(inode, count)) + TP_ARGS(nf, status)) -DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync); -DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode); +DEFINE_NFSD_FILE_OPEN_EVENT(nfsd_file_open); +DEFINE_NFSD_FILE_OPEN_EVENT(nfsd_file_opened); TRACE_EVENT(nfsd_file_is_cached, TP_PROTO( @@ -1149,7 +1096,6 @@ DEFINE_NFSD_FILE_GC_EVENT(nfsd_file_gc_in_use); DEFINE_NFSD_FILE_GC_EVENT(nfsd_file_gc_writeback); DEFINE_NFSD_FILE_GC_EVENT(nfsd_file_gc_referenced); -DEFINE_NFSD_FILE_GC_EVENT(nfsd_file_gc_hashed); DEFINE_NFSD_FILE_GC_EVENT(nfsd_file_gc_disposed); DECLARE_EVENT_CLASS(nfsd_file_lruwalk_class, @@ -1181,6 +1127,53 @@ DEFINE_NFSD_FILE_LRUWALK_EVENT(nfsd_file_gc_removed); DEFINE_NFSD_FILE_LRUWALK_EVENT(nfsd_file_shrinker_removed); +TRACE_EVENT(nfsd_file_close, + TP_PROTO( + const struct inode *inode + ), + TP_ARGS(inode), + TP_STRUCT__entry( + __field(const void *, inode) + ), + TP_fast_assign( + __entry->inode = inode; + ), + TP_printk("inode=%p", + __entry->inode + ) +); + +TRACE_EVENT(nfsd_file_fsync, + TP_PROTO( + const struct nfsd_file *nf, + int ret + ), + TP_ARGS(nf, ret), + TP_STRUCT__entry( + __field(void *, nf_inode) + __field(int, nf_ref) + __field(int, ret) + __field(unsigned long, nf_flags) + __field(unsigned char, nf_may) + __field(struct file *, nf_file) + ), + TP_fast_assign( + __entry->nf_inode = nf->nf_inode; + __entry->nf_ref = refcount_read(&nf->nf_ref); + __entry->ret = ret; + __entry->nf_flags = nf->nf_flags; + __entry->nf_may = nf->nf_may; + __entry->nf_file = nf->nf_file; + ), + TP_printk("inode=%p ref=%d flags=%s may=%s nf_file=%p ret=%d", + __entry->nf_inode, + __entry->nf_ref, + show_nf_flags(__entry->nf_flags), + show_nfsd_may_flags(__entry->nf_may), + __entry->nf_file, __entry->ret + ) +); + #include "cache.h" TRACE_DEFINE_ENUM(RC_DROPIT); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/vfs.c +++ linux-oem-6.1-6.1.0/fs/nfsd/vfs.c @@ -943,7 +943,7 @@ ssize_t host_err; trace_nfsd_read_vector(rqstp, fhp, offset, *count); - iov_iter_kvec(&iter, READ, vec, vlen, *count); + iov_iter_kvec(&iter, ITER_DEST, vec, vlen, *count); host_err = vfs_iter_read(file, &iter, &ppos, 0); return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err); } @@ -1033,7 +1033,7 @@ if (stable && !use_wgather) flags |= RWF_SYNC; - iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt); + iov_iter_kvec(&iter, ITER_SOURCE, vec, vlen, *cnt); since = READ_ONCE(file->f_wb_err); if (verf) nfsd_copy_write_verifier(verf, nn); @@ -1085,7 +1085,7 @@ __be32 err; trace_nfsd_read_start(rqstp, fhp, offset, *count); - err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); + err = nfsd_file_acquire_gc(rqstp, fhp, NFSD_MAY_READ, &nf); if (err) return err; @@ -1117,7 +1117,7 @@ trace_nfsd_write_start(rqstp, fhp, offset, *cnt); - err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_WRITE, &nf); + err = nfsd_file_acquire_gc(rqstp, fhp, NFSD_MAY_WRITE, &nf); if (err) goto out; @@ -1133,6 +1133,7 @@ * nfsd_commit - Commit pending writes to stable storage * @rqstp: RPC request being processed * @fhp: NFS filehandle + * @nf: target file * @offset: raw offset from beginning of file * @count: raw count of bytes to sync * @verf: filled in with the server's current write verifier @@ -1149,19 +1150,13 @@ * An nfsstat value in network byte order. */ __be32 -nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, u64 offset, - u32 count, __be32 *verf) +nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, + u64 offset, u32 count, __be32 *verf) { + __be32 err = nfs_ok; u64 maxbytes; loff_t start, end; struct nfsd_net *nn; - struct nfsd_file *nf; - __be32 err; - - err = nfsd_file_acquire(rqstp, fhp, - NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &nf); - if (err) - goto out; /* * Convert the client-provided (offset, count) range to a @@ -1202,8 +1197,6 @@ } else nfsd_copy_write_verifier(verf, nn); - nfsd_file_put(nf); -out: return err; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nfsd/vfs.h +++ linux-oem-6.1-6.1.0/fs/nfsd/vfs.h @@ -88,7 +88,8 @@ __be32 nfsd_create_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct svc_fh *resfhp, struct nfsd_attrs *iap); __be32 nfsd_commit(struct svc_rqst *rqst, struct svc_fh *fhp, - u64 offset, u32 count, __be32 *verf); + struct nfsd_file *nf, u64 offset, u32 count, + __be32 *verf); #ifdef CONFIG_NFSD_V4 __be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name, void **bufp, int *lenp); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nilfs2/btree.c +++ linux-oem-6.1-6.1.0/fs/nilfs2/btree.c @@ -480,9 +480,18 @@ ret = nilfs_btnode_submit_block(btnc, ptr, 0, REQ_OP_READ, &bh, &submit_ptr); if (ret) { - if (ret != -EEXIST) - return ret; - goto out_check; + if (likely(ret == -EEXIST)) + goto out_check; + if (ret == -ENOENT) { + /* + * Block address translation failed due to invalid + * value of 'ptr'. In this case, return internal code + * -EINVAL (broken bmap) to notify bmap layer of fatal + * metadata corruption. + */ + ret = -EINVAL; + } + return ret; } if (ra) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nilfs2/ioctl.c +++ linux-oem-6.1-6.1.0/fs/nilfs2/ioctl.c @@ -1114,7 +1114,14 @@ minseg = range[0] + segbytes - 1; do_div(minseg, segbytes); + + if (range[1] < 4096) + goto out; + maxseg = NILFS_SB2_OFFSET_BYTES(range[1]); + if (maxseg < segbytes) + goto out; + do_div(maxseg, segbytes); maxseg--; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/nilfs2/super.c +++ linux-oem-6.1-6.1.0/fs/nilfs2/super.c @@ -409,6 +409,15 @@ goto out; /* + * Prevent underflow in second superblock position calculation. + * The exact minimum size check is done in nilfs_sufile_resize(). + */ + if (newsize < 4096) { + ret = -ENOSPC; + goto out; + } + + /* * Write lock is required to protect some functions depending * on the number of segments, the number of reserved segments, * and so forth. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/ocfs2/cluster/tcp.c +++ linux-oem-6.1-6.1.0/fs/ocfs2/cluster/tcp.c @@ -900,7 +900,7 @@ { struct kvec vec = { .iov_len = len, .iov_base = data, }; struct msghdr msg = { .msg_flags = MSG_DONTWAIT, }; - iov_iter_kvec(&msg.msg_iter, READ, &vec, 1, len); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &vec, 1, len); return sock_recvmsg(sock, &msg, MSG_DONTWAIT); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/orangefs/inode.c +++ linux-oem-6.1-6.1.0/fs/orangefs/inode.c @@ -53,7 +53,7 @@ bv.bv_len = wlen; bv.bv_offset = off % PAGE_SIZE; WARN_ON(wlen == 0); - iov_iter_bvec(&iter, WRITE, &bv, 1, wlen); + iov_iter_bvec(&iter, ITER_SOURCE, &bv, 1, wlen); ret = wait_for_direct_io(ORANGEFS_IO_WRITE, inode, &off, &iter, wlen, len, wr, NULL, NULL); @@ -112,7 +112,7 @@ else ow->bv[i].bv_offset = 0; } - iov_iter_bvec(&iter, WRITE, ow->bv, ow->npages, ow->len); + iov_iter_bvec(&iter, ITER_SOURCE, ow->bv, ow->npages, ow->len); WARN_ON(ow->off >= len); if (ow->off + ow->len > len) @@ -270,7 +270,7 @@ offset = readahead_pos(rac); i_pages = &rac->mapping->i_pages; - iov_iter_xarray(&iter, READ, i_pages, offset, readahead_length(rac)); + iov_iter_xarray(&iter, ITER_DEST, i_pages, offset, readahead_length(rac)); /* read in the pages. */ if ((ret = wait_for_direct_io(ORANGEFS_IO_READ, inode, @@ -303,7 +303,7 @@ bv.bv_page = &folio->page; bv.bv_len = folio_size(folio); bv.bv_offset = 0; - iov_iter_bvec(&iter, READ, &bv, 1, folio_size(folio)); + iov_iter_bvec(&iter, ITER_DEST, &bv, 1, folio_size(folio)); ret = wait_for_direct_io(ORANGEFS_IO_READ, inode, &off, &iter, folio_size(folio), inode->i_size, NULL, NULL, file); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/overlayfs/copy_up.c +++ linux-oem-6.1-6.1.0/fs/overlayfs/copy_up.c @@ -754,7 +754,7 @@ if (!c->metacopy && c->stat.size) { err = ovl_copy_up_file(ofs, c->dentry, tmpfile, c->stat.size); if (err) - return err; + goto out_fput; } err = ovl_copy_up_metadata(c, temp); @@ -973,6 +973,10 @@ if (err) return err; + if (!kuid_has_mapping(current_user_ns(), ctx.stat.uid) || + !kgid_has_mapping(current_user_ns(), ctx.stat.gid)) + return -EOVERFLOW; + ctx.metacopy = ovl_need_meta_copy_up(dentry, ctx.stat.mode, flags); if (parent) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/overlayfs/export.c +++ linux-oem-6.1-6.1.0/fs/overlayfs/export.c @@ -796,7 +796,7 @@ return ERR_PTR(-ENOMEM); /* Copy unaligned inner fh into aligned buffer */ - memcpy(&fh->fb, fid, buflen - OVL_FH_WIRE_OFFSET); + memcpy(fh->buf, fid, buflen - OVL_FH_WIRE_OFFSET); return fh; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/proc/vmcore.c +++ linux-oem-6.1-6.1.0/fs/proc/vmcore.c @@ -199,7 +199,7 @@ struct kvec kvec = { .iov_base = buf, .iov_len = count }; struct iov_iter iter; - iov_iter_kvec(&iter, READ, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); return read_from_oldmem(&iter, count, ppos, false); } @@ -212,7 +212,7 @@ struct kvec kvec = { .iov_base = buf, .iov_len = count }; struct iov_iter iter; - iov_iter_kvec(&iter, READ, &kvec, 1, count); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); return read_from_oldmem(&iter, count, ppos, cc_platform_has(CC_ATTR_MEM_ENCRYPT)); @@ -437,7 +437,7 @@ offset = (loff_t) index << PAGE_SHIFT; kvec.iov_base = page_address(page); kvec.iov_len = PAGE_SIZE; - iov_iter_kvec(&iter, READ, &kvec, 1, PAGE_SIZE); + iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, PAGE_SIZE); rc = __read_vmcore(&iter, &offset); if (rc < 0) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/read_write.c +++ linux-oem-6.1-6.1.0/fs/read_write.c @@ -384,7 +384,7 @@ init_sync_kiocb(&kiocb, filp); kiocb.ki_pos = (ppos ? *ppos : 0); - iov_iter_ubuf(&iter, READ, buf, len); + iov_iter_ubuf(&iter, ITER_DEST, buf, len); ret = call_read_iter(filp, &kiocb, &iter); BUG_ON(ret == -EIOCBQUEUED); @@ -424,7 +424,7 @@ init_sync_kiocb(&kiocb, file); kiocb.ki_pos = pos ? *pos : 0; - iov_iter_kvec(&iter, READ, &iov, 1, iov.iov_len); + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); ret = file->f_op->read_iter(&kiocb, &iter); if (ret > 0) { if (pos) @@ -486,7 +486,7 @@ init_sync_kiocb(&kiocb, filp); kiocb.ki_pos = (ppos ? *ppos : 0); - iov_iter_ubuf(&iter, WRITE, (void __user *)buf, len); + iov_iter_ubuf(&iter, ITER_SOURCE, (void __user *)buf, len); ret = call_write_iter(filp, &kiocb, &iter); BUG_ON(ret == -EIOCBQUEUED); @@ -533,7 +533,7 @@ .iov_len = min_t(size_t, count, MAX_RW_COUNT), }; struct iov_iter iter; - iov_iter_kvec(&iter, WRITE, &iov, 1, iov.iov_len); + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); return __kernel_write_iter(file, &iter, pos); } /* @@ -911,7 +911,7 @@ struct iov_iter iter; ssize_t ret; - ret = import_iovec(READ, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); + ret = import_iovec(ITER_DEST, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); if (ret >= 0) { ret = do_iter_read(file, &iter, pos, flags); kfree(iov); @@ -928,7 +928,7 @@ struct iov_iter iter; ssize_t ret; - ret = import_iovec(WRITE, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); + ret = import_iovec(ITER_SOURCE, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); if (ret >= 0) { file_start_write(file); ret = do_iter_write(file, &iter, pos, flags); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/seq_file.c +++ linux-oem-6.1-6.1.0/fs/seq_file.c @@ -156,7 +156,7 @@ ssize_t ret; init_sync_kiocb(&kiocb, file); - iov_iter_init(&iter, READ, &iov, 1, size); + iov_iter_init(&iter, ITER_DEST, &iov, 1, size); kiocb.ki_pos = *ppos; ret = seq_read_iter(&kiocb, &iter); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/squashfs/squashfs_fs.h +++ linux-oem-6.1-6.1.0/fs/squashfs/squashfs_fs.h @@ -183,7 +183,7 @@ #define SQUASHFS_ID_BLOCK_BYTES(A) (SQUASHFS_ID_BLOCKS(A) *\ sizeof(u64)) /* xattr id lookup table defines */ -#define SQUASHFS_XATTR_BYTES(A) ((A) * sizeof(struct squashfs_xattr_id)) +#define SQUASHFS_XATTR_BYTES(A) (((u64) (A)) * sizeof(struct squashfs_xattr_id)) #define SQUASHFS_XATTR_BLOCK(A) (SQUASHFS_XATTR_BYTES(A) / \ SQUASHFS_METADATA_SIZE) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/squashfs/squashfs_fs_sb.h +++ linux-oem-6.1-6.1.0/fs/squashfs/squashfs_fs_sb.h @@ -63,7 +63,7 @@ long long bytes_used; unsigned int inodes; unsigned int fragments; - int xattr_ids; + unsigned int xattr_ids; unsigned int ids; bool panic_on_errors; }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/squashfs/xattr.h +++ linux-oem-6.1-6.1.0/fs/squashfs/xattr.h @@ -10,12 +10,12 @@ #ifdef CONFIG_SQUASHFS_XATTR extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64, - u64 *, int *); + u64 *, unsigned int *); extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *, unsigned int *, unsigned long long *); #else static inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb, - u64 start, u64 *xattr_table_start, int *xattr_ids) + u64 start, u64 *xattr_table_start, unsigned int *xattr_ids) { struct squashfs_xattr_id_table *id_table; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/squashfs/xattr_id.c +++ linux-oem-6.1-6.1.0/fs/squashfs/xattr_id.c @@ -56,7 +56,7 @@ * Read uncompressed xattr id lookup table indexes from disk into memory */ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start, - u64 *xattr_table_start, int *xattr_ids) + u64 *xattr_table_start, unsigned int *xattr_ids) { struct squashfs_sb_info *msblk = sb->s_fs_info; unsigned int len, indexes; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/userfaultfd.c +++ linux-oem-6.1-6.1.0/fs/userfaultfd.c @@ -108,6 +108,21 @@ return ctx->features & UFFD_FEATURE_INITIALIZED; } +static void userfaultfd_set_vm_flags(struct vm_area_struct *vma, + vm_flags_t flags) +{ + const bool uffd_wp_changed = (vma->vm_flags ^ flags) & VM_UFFD_WP; + + vma->vm_flags = flags; + /* + * For shared mappings, we want to enable writenotify while + * userfaultfd-wp is enabled (see vma_wants_writenotify()). We'll simply + * recalculate vma->vm_page_prot whenever userfaultfd-wp changes. + */ + if ((vma->vm_flags & VM_SHARED) && uffd_wp_changed) + vma_set_page_prot(vma); +} + static int userfaultfd_wake_function(wait_queue_entry_t *wq, unsigned mode, int wake_flags, void *key) { @@ -618,7 +633,8 @@ for_each_vma(vmi, vma) { if (vma->vm_userfaultfd_ctx.ctx == release_new_ctx) { vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; - vma->vm_flags &= ~__VM_UFFD_FLAGS; + userfaultfd_set_vm_flags(vma, + vma->vm_flags & ~__VM_UFFD_FLAGS); } } mmap_write_unlock(mm); @@ -652,7 +668,7 @@ octx = vma->vm_userfaultfd_ctx.ctx; if (!octx || !(octx->features & UFFD_FEATURE_EVENT_FORK)) { vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; - vma->vm_flags &= ~__VM_UFFD_FLAGS; + userfaultfd_set_vm_flags(vma, vma->vm_flags & ~__VM_UFFD_FLAGS); return 0; } @@ -733,7 +749,7 @@ } else { /* Drop uffd context if remap feature not enabled */ vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; - vma->vm_flags &= ~__VM_UFFD_FLAGS; + userfaultfd_set_vm_flags(vma, vma->vm_flags & ~__VM_UFFD_FLAGS); } } @@ -895,7 +911,7 @@ prev = vma; } - vma->vm_flags = new_flags; + userfaultfd_set_vm_flags(vma, new_flags); vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; } mmap_write_unlock(mm); @@ -1463,7 +1479,7 @@ * the next vma was merged into the current one and * the current one has not been updated yet. */ - vma->vm_flags = new_flags; + userfaultfd_set_vm_flags(vma, new_flags); vma->vm_userfaultfd_ctx.ctx = ctx; if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma)) @@ -1651,7 +1667,7 @@ * the next vma was merged into the current one and * the current one has not been updated yet. */ - vma->vm_flags = new_flags; + userfaultfd_set_vm_flags(vma, new_flags); vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; skip: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/fs/zonefs/super.c +++ linux-oem-6.1-6.1.0/fs/zonefs/super.c @@ -442,6 +442,10 @@ data_size = zonefs_check_zone_condition(inode, zone, false, false); } + } else if (sbi->s_mount_opts & ZONEFS_MNTOPT_ERRORS_RO && + data_size > isize) { + /* Do not expose garbage data */ + data_size = isize; } /* @@ -805,6 +809,24 @@ ret = submit_bio_wait(bio); + /* + * If the file zone was written underneath the file system, the zone + * write pointer may not be where we expect it to be, but the zone + * append write can still succeed. So check manually that we wrote where + * we intended to, that is, at zi->i_wpoffset. + */ + if (!ret) { + sector_t wpsector = + zi->i_zsector + (zi->i_wpoffset >> SECTOR_SHIFT); + + if (bio->bi_iter.bi_sector != wpsector) { + zonefs_warn(inode->i_sb, + "Corrupted write pointer %llu for zone at %llu\n", + wpsector, zi->i_zsector); + ret = -EIO; + } + } + zonefs_file_write_dio_end_io(iocb, size, ret, 0); trace_zonefs_file_dio_append(inode, size, ret); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/acpi/acpi_bus.h +++ linux-oem-6.1-6.1.0/include/acpi/acpi_bus.h @@ -230,7 +230,8 @@ u32 hardware_id:1; u32 bus_address:1; u32 platform_id:1; - u32 reserved:29; + u32 backlight:1; + u32 reserved:28; }; struct acpi_device_pnp { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/asm-generic/vmlinux.lds.h +++ linux-oem-6.1-6.1.0/include/asm-generic/vmlinux.lds.h @@ -929,7 +929,12 @@ #define PRINTK_INDEX #endif +/* + * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler. + * Otherwise, the type of .notes section would become PROGBITS instead of NOTES. + */ #define NOTES \ + /DISCARD/ : { *(.note.GNU-stack) } \ .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ __start_notes = .; \ KEEP(*(.note.*)) \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/drm/drm_vma_manager.h +++ linux-oem-6.1-6.1.0/include/drm/drm_vma_manager.h @@ -74,6 +74,7 @@ struct drm_vma_offset_node *node); int drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *tag); +int drm_vma_node_allow_once(struct drm_vma_offset_node *node, struct drm_file *tag); void drm_vma_node_revoke(struct drm_vma_offset_node *node, struct drm_file *tag); bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/kunit/test.h +++ linux-oem-6.1-6.1.0/include/kunit/test.h @@ -299,7 +299,6 @@ */ #define kunit_test_init_section_suites(__suites...) \ __kunit_test_suites(CONCATENATE(__UNIQUE_ID(array), _probe), \ - CONCATENATE(__UNIQUE_ID(suites), _probe), \ ##__suites) #define kunit_test_init_section_suite(suite) \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/apple-gmux.h +++ linux-oem-6.1-6.1.0/include/linux/apple-gmux.h @@ -8,18 +8,118 @@ #define LINUX_APPLE_GMUX_H #include +#include +#include #define GMUX_ACPI_HID "APP000B" +/* + * gmux port offsets. Many of these are not yet used, but may be in the + * future, and it's useful to have them documented here anyhow. + */ +#define GMUX_PORT_VERSION_MAJOR 0x04 +#define GMUX_PORT_VERSION_MINOR 0x05 +#define GMUX_PORT_VERSION_RELEASE 0x06 +#define GMUX_PORT_SWITCH_DISPLAY 0x10 +#define GMUX_PORT_SWITCH_GET_DISPLAY 0x11 +#define GMUX_PORT_INTERRUPT_ENABLE 0x14 +#define GMUX_PORT_INTERRUPT_STATUS 0x16 +#define GMUX_PORT_SWITCH_DDC 0x28 +#define GMUX_PORT_SWITCH_EXTERNAL 0x40 +#define GMUX_PORT_SWITCH_GET_EXTERNAL 0x41 +#define GMUX_PORT_DISCRETE_POWER 0x50 +#define GMUX_PORT_MAX_BRIGHTNESS 0x70 +#define GMUX_PORT_BRIGHTNESS 0x74 +#define GMUX_PORT_VALUE 0xc2 +#define GMUX_PORT_READ 0xd0 +#define GMUX_PORT_WRITE 0xd4 + +#define GMUX_MIN_IO_LEN (GMUX_PORT_BRIGHTNESS + 4) + #if IS_ENABLED(CONFIG_APPLE_GMUX) +static inline bool apple_gmux_is_indexed(unsigned long iostart) +{ + u16 val; + + outb(0xaa, iostart + 0xcc); + outb(0x55, iostart + 0xcd); + outb(0x00, iostart + 0xce); + + val = inb(iostart + 0xcc) | (inb(iostart + 0xcd) << 8); + if (val == 0x55aa) + return true; + + return false; +} + +/** + * apple_gmux_detect() - detect if gmux is built into the machine + * + * @pnp_dev: Device to probe or NULL to use the first matching device + * @indexed_ret: Returns (by reference) if the gmux is indexed or not + * + * Detect if a supported gmux device is present by actually probing it. + * This avoids the false positives returned on some models by + * apple_gmux_present(). + * + * Return: %true if a supported gmux ACPI device is detected and the kernel + * was configured with CONFIG_APPLE_GMUX, %false otherwise. + */ +static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, bool *indexed_ret) +{ + u8 ver_major, ver_minor, ver_release; + struct device *dev = NULL; + struct acpi_device *adev; + struct resource *res; + bool indexed = false; + bool ret = false; + + if (!pnp_dev) { + adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1); + if (!adev) + return false; + + dev = get_device(acpi_get_first_physical_node(adev)); + acpi_dev_put(adev); + if (!dev) + return false; + + pnp_dev = to_pnp_dev(dev); + } + + res = pnp_get_resource(pnp_dev, IORESOURCE_IO, 0); + if (!res || resource_size(res) < GMUX_MIN_IO_LEN) + goto out; + + /* + * Invalid version information may indicate either that the gmux + * device isn't present or that it's a new one that uses indexed io. + */ + ver_major = inb(res->start + GMUX_PORT_VERSION_MAJOR); + ver_minor = inb(res->start + GMUX_PORT_VERSION_MINOR); + ver_release = inb(res->start + GMUX_PORT_VERSION_RELEASE); + if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) { + indexed = apple_gmux_is_indexed(res->start); + if (!indexed) + goto out; + } + + if (indexed_ret) + *indexed_ret = indexed; + + ret = true; +out: + put_device(dev); + return ret; +} /** - * apple_gmux_present() - detect if gmux is built into the machine + * apple_gmux_present() - check if gmux ACPI device is present * * Drivers may use this to activate quirks specific to dual GPU MacBook Pros * and Mac Pros, e.g. for deferred probing, runtime pm and backlight. * - * Return: %true if gmux is present and the kernel was configured + * Return: %true if gmux ACPI device is present and the kernel was configured * with CONFIG_APPLE_GMUX, %false otherwise. */ static inline bool apple_gmux_present(void) @@ -33,6 +133,11 @@ { return false; } + +static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, bool *indexed_ret) +{ + return false; +} #endif /* !CONFIG_APPLE_GMUX */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/ceph/libceph.h +++ linux-oem-6.1-6.1.0/include/linux/ceph/libceph.h @@ -99,16 +99,6 @@ #define CEPH_AUTH_NAME_DEFAULT "guest" -/* mount state */ -enum { - CEPH_MOUNT_MOUNTING, - CEPH_MOUNT_MOUNTED, - CEPH_MOUNT_UNMOUNTING, - CEPH_MOUNT_UNMOUNTED, - CEPH_MOUNT_SHUTDOWN, - CEPH_MOUNT_RECOVER, -}; - static inline unsigned long ceph_timeout_jiffies(unsigned long timeout) { return timeout ?: MAX_SCHEDULE_TIMEOUT; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/elfcore.h +++ linux-oem-6.1-6.1.0/include/linux/elfcore.h @@ -114,14 +114,14 @@ * Dumping its extra ELF program headers includes all the other information * a debugger needs to easily find how the gate DSO was being used. */ -extern Elf_Half elf_core_extra_phdrs(void); +extern Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm); extern int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); extern int elf_core_write_extra_data(struct coredump_params *cprm); -extern size_t elf_core_extra_data_size(void); +extern size_t elf_core_extra_data_size(struct coredump_params *cprm); #else -static inline Elf_Half elf_core_extra_phdrs(void) +static inline Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm) { return 0; } @@ -136,7 +136,7 @@ return 1; } -static inline size_t elf_core_extra_data_size(void) +static inline size_t elf_core_extra_data_size(struct coredump_params *cprm) { return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/fb.h +++ linux-oem-6.1-6.1.0/include/linux/fb.h @@ -662,6 +662,7 @@ extern void fb_deferred_io_open(struct fb_info *info, struct inode *inode, struct file *file); +extern void fb_deferred_io_release(struct fb_info *info); extern void fb_deferred_io_cleanup(struct fb_info *info); extern int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/highmem-internal.h +++ linux-oem-6.1-6.1.0/include/linux/highmem-internal.h @@ -200,7 +200,7 @@ static inline void __kunmap_local(const void *addr) { #ifdef ARCH_HAS_FLUSH_ON_KUNMAP - kunmap_flush_on_unmap(addr); + kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE)); #endif } @@ -227,7 +227,7 @@ static inline void __kunmap_atomic(const void *addr) { #ifdef ARCH_HAS_FLUSH_ON_KUNMAP - kunmap_flush_on_unmap(addr); + kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE)); #endif pagefault_enable(); if (IS_ENABLED(CONFIG_PREEMPT_RT)) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/hugetlb.h +++ linux-oem-6.1-6.1.0/include/linux/hugetlb.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -752,7 +753,10 @@ if (!page_size_log) return &default_hstate; - return size_to_hstate(1UL << page_size_log); + if (page_size_log < BITS_PER_LONG) + return size_to_hstate(1UL << page_size_log); + + return NULL; } static inline struct hstate *hstate_vma(struct vm_area_struct *vma) @@ -1182,6 +1186,18 @@ } #endif +#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE +static inline bool hugetlb_pmd_shared(pte_t *pte) +{ + return page_count(virt_to_page(pte)) > 1; +} +#else +static inline bool hugetlb_pmd_shared(pte_t *pte) +{ + return false; +} +#endif + bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr); #ifndef __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/memcontrol.h +++ linux-oem-6.1-6.1.0/include/linux/memcontrol.h @@ -1655,10 +1655,13 @@ static inline void mem_cgroup_track_foreign_dirty(struct folio *folio, struct bdi_writeback *wb) { + struct mem_cgroup *memcg; + if (mem_cgroup_disabled()) return; - if (unlikely(&folio_memcg(folio)->css != wb->memcg_css)) + memcg = folio_memcg(folio); + if (unlikely(memcg && &memcg->css != wb->memcg_css)) mem_cgroup_track_foreign_dirty_slowpath(folio, wb); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/mlx5/driver.h +++ linux-oem-6.1-6.1.0/include/linux/mlx5/driver.h @@ -315,7 +315,7 @@ struct mlx5_cmd_debug dbg; struct cmd_msg_cache cache[MLX5_NUM_COMMAND_CACHES]; int checksum_disabled; - struct mlx5_cmd_stats *stats; + struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX]; }; struct mlx5_cmd_mailbox { @@ -573,6 +573,14 @@ struct dentry *lag_debugfs; }; +enum mlx5_func_type { + MLX5_PF, + MLX5_VF, + MLX5_SF, + MLX5_HOST_PF, + MLX5_FUNC_TYPE_NUM, +}; + struct mlx5_ft_pool; struct mlx5_priv { /* IRQ table valid only for real pci devices PF or VF */ @@ -583,11 +591,10 @@ struct mlx5_nb pg_nb; struct workqueue_struct *pg_wq; struct xarray page_root_xa; - u32 fw_pages; atomic_t reg_pages; struct list_head free_list; - u32 vfs_pages; - u32 host_pf_pages; + u32 fw_pages; + u32 page_counters[MLX5_FUNC_TYPE_NUM]; u32 fw_pages_alloc_failed; u32 give_pages_dropped; u32 reclaim_pages_discard; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/mtd/spi-nor.h +++ linux-oem-6.1-6.1.0/include/linux/mtd/spi-nor.h @@ -7,7 +7,6 @@ #define __LINUX_MTD_SPI_NOR_H #include -#include #include #include only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/nospec.h +++ linux-oem-6.1-6.1.0/include/linux/nospec.h @@ -11,6 +11,10 @@ struct task_struct; +#ifndef barrier_nospec +# define barrier_nospec() do { } while (0) +#endif + /** * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise * @index: array element index only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/nvmem-provider.h +++ linux-oem-6.1-6.1.0/include/linux/nvmem-provider.h @@ -70,7 +70,6 @@ * @word_size: Minimum read/write access granularity. * @stride: Minimum read/write access stride. * @priv: User context passed to read/write callbacks. - * @wp-gpio: Write protect pin * @ignore_wp: Write Protect pin is managed by the provider. * * Note: A default "nvmem" name will be assigned to the device if @@ -85,7 +84,6 @@ const char *name; int id; struct module *owner; - struct gpio_desc *wp_gpio; const struct nvmem_cell_info *cells; int ncells; const struct nvmem_keepout *keepout; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/panic.h +++ linux-oem-6.1-6.1.0/include/linux/panic.h @@ -11,6 +11,7 @@ __printf(1, 2) void panic(const char *fmt, ...) __noreturn __cold; void nmi_panic(struct pt_regs *regs, const char *msg); +void check_panic_on_warn(const char *origin); extern void oops_enter(void); extern void oops_exit(void); extern bool oops_may_print(void); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/platform_data/x86/simatic-ipc.h +++ linux-oem-6.1-6.1.0/include/linux/platform_data/x86/simatic-ipc.h @@ -32,7 +32,8 @@ SIMATIC_IPC_IPC477E = 0x00000A02, SIMATIC_IPC_IPC127E = 0x00000D01, SIMATIC_IPC_IPC227G = 0x00000F01, - SIMATIC_IPC_IPC427G = 0x00001001, + SIMATIC_IPC_IPCBX_39A = 0x00001001, + SIMATIC_IPC_IPCPX_39A = 0x00001002, }; static inline u32 simatic_ipc_get_station_id(u8 *data, int max_len) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/psi_types.h +++ linux-oem-6.1-6.1.0/include/linux/psi_types.h @@ -177,6 +177,7 @@ struct timer_list poll_timer; wait_queue_head_t poll_wait; atomic_t poll_wakeup; + atomic_t poll_scheduled; /* Protects data used by the monitor */ struct mutex trigger_lock; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/shrinker.h +++ linux-oem-6.1-6.1.0/include/linux/shrinker.h @@ -104,7 +104,7 @@ #ifdef CONFIG_SHRINKER_DEBUG extern int shrinker_debugfs_add(struct shrinker *shrinker); -extern void shrinker_debugfs_remove(struct shrinker *shrinker); +extern struct dentry *shrinker_debugfs_remove(struct shrinker *shrinker); extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...); #else /* CONFIG_SHRINKER_DEBUG */ @@ -112,8 +112,9 @@ { return 0; } -static inline void shrinker_debugfs_remove(struct shrinker *shrinker) +static inline struct dentry *shrinker_debugfs_remove(struct shrinker *shrinker) { + return NULL; } static inline __printf(2, 3) int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/soc/ti/omap1-io.h +++ linux-oem-6.1-6.1.0/include/linux/soc/ti/omap1-io.h @@ -5,7 +5,7 @@ #ifndef __ASSEMBLER__ #include -#ifdef CONFIG_ARCH_OMAP1_ANY +#ifdef CONFIG_ARCH_OMAP1 /* * NOTE: Please use ioremap + __raw_read/write where possible instead of these */ @@ -15,7 +15,7 @@ extern void omap_writeb(u8 v, u32 pa); extern void omap_writew(u16 v, u32 pa); extern void omap_writel(u32 v, u32 pa); -#else +#elif defined(CONFIG_COMPILE_TEST) static inline u8 omap_readb(u32 pa) { return 0; } static inline u16 omap_readw(u32 pa) { return 0; } static inline u32 omap_readl(u32 pa) { return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/stmmac.h +++ linux-oem-6.1-6.1.0/include/linux/stmmac.h @@ -252,6 +252,7 @@ int rss_en; int mac_port_sel_speed; bool en_tx_lpi_clockgating; + bool rx_clk_runs_in_lpi; int has_xgmac; bool vlan_fail_q_en; u8 vlan_fail_q; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/thermal.h +++ linux-oem-6.1-6.1.0/include/linux/thermal.h @@ -100,6 +100,7 @@ struct thermal_cooling_device { int id; char *type; + unsigned long max_state; struct device device; struct device_node *np; void *devdata; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/tpm_eventlog.h +++ linux-oem-6.1-6.1.0/include/linux/tpm_eventlog.h @@ -198,8 +198,8 @@ * The loop below will unmap these fields if the log is larger than * one page, so save them here for reference: */ - count = READ_ONCE(event->count); - event_type = READ_ONCE(event->event_type); + count = event->count; + event_type = event->event_type; /* Verify that it's the log header */ if (event_header->pcr_idx != 0 || only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/trace_events.h +++ linux-oem-6.1-6.1.0/include/linux/trace_events.h @@ -270,6 +270,7 @@ const int align; const int is_signed; const int filter_type; + const int len; }; int (*define_fields)(struct trace_event_call *); }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/uio.h +++ linux-oem-6.1-6.1.0/include/linux/uio.h @@ -29,6 +29,9 @@ ITER_UBUF, }; +#define ITER_SOURCE 1 // == WRITE +#define ITER_DEST 0 // == READ + struct iov_iter_state { size_t iov_offset; size_t count; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/usb.h +++ linux-oem-6.1-6.1.0/include/linux/usb.h @@ -751,11 +751,14 @@ extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, bool enable); extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); +extern int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index); #else static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, bool enable) { return 0; } static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) { return true; } +static inline int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) + { return 0; } #endif /* USB autosuspend and autoresume */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/linux/util_macros.h +++ linux-oem-6.1-6.1.0/include/linux/util_macros.h @@ -38,4 +38,16 @@ */ #define find_closest_descending(x, a, as) __find_closest(x, a, as, >=) +/** + * is_insidevar - check if the @ptr points inside the @var memory range. + * @ptr: the pointer to a memory address. + * @var: the variable which address and size identify the memory range. + * + * Evaluates to true if the address in @ptr lies within the memory + * range allocated to @var. + */ +#define is_insidevar(ptr, var) \ + ((uintptr_t)(ptr) >= (uintptr_t)(var) && \ + (uintptr_t)(ptr) < (uintptr_t)(var) + sizeof(var)) + #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/net/sch_generic.h +++ linux-oem-6.1-6.1.0/include/net/sch_generic.h @@ -1288,4 +1288,11 @@ int sch_frag_xmit_hook(struct sk_buff *skb, int (*xmit)(struct sk_buff *skb)); +/* Make sure qdisc is no longer in SCHED state. */ +static inline void qdisc_synchronize(const struct Qdisc *q) +{ + while (test_bit(__QDISC_STATE_SCHED, &q->state)) + msleep(1); +} + #endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/net/sock.h +++ linux-oem-6.1-6.1.0/include/net/sock.h @@ -2430,6 +2430,19 @@ return false; } +static inline struct sk_buff *skb_clone_and_charge_r(struct sk_buff *skb, struct sock *sk) +{ + skb = skb_clone(skb, sk_gfp_mask(sk, GFP_ATOMIC)); + if (skb) { + if (sk_rmem_schedule(sk, skb, skb->truesize)) { + skb_set_owner_r(skb, sk); + return skb; + } + __kfree_skb(skb); + } + return NULL; +} + static inline void skb_prepare_for_gro(struct sk_buff *skb) { if (skb->destructor != sock_wfree) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/scsi/libiscsi.h +++ linux-oem-6.1-6.1.0/include/scsi/libiscsi.h @@ -422,6 +422,8 @@ extern struct iscsi_cls_session * iscsi_session_setup(struct iscsi_transport *, struct Scsi_Host *shost, uint16_t, int, int, uint32_t, unsigned int); +void iscsi_session_remove(struct iscsi_cls_session *cls_session); +void iscsi_session_free(struct iscsi_cls_session *cls_session); extern void iscsi_session_teardown(struct iscsi_cls_session *); extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/scsi/sas_ata.h +++ linux-oem-6.1-6.1.0/include/scsi/sas_ata.h @@ -35,6 +35,7 @@ int sas_execute_ata_cmd(struct domain_device *device, u8 *fis, int force_phy_id); int sas_ata_wait_after_reset(struct domain_device *dev, unsigned long deadline); +int smp_ata_check_ready_type(struct ata_link *link); #else @@ -98,6 +99,11 @@ { return -ETIMEDOUT; } + +static inline int smp_ata_check_ready_type(struct ata_link *link) +{ + return 0; +} #endif #endif /* _SAS_ATA_H_ */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/scsi/scsi_transport_iscsi.h +++ linux-oem-6.1-6.1.0/include/scsi/scsi_transport_iscsi.h @@ -236,6 +236,14 @@ ISCSI_SESSION_FREE, }; +enum { + ISCSI_SESSION_TARGET_UNBOUND, + ISCSI_SESSION_TARGET_ALLOCATED, + ISCSI_SESSION_TARGET_SCANNED, + ISCSI_SESSION_TARGET_UNBINDING, + ISCSI_SESSION_TARGET_MAX, +}; + #define ISCSI_MAX_TARGET -1 struct iscsi_cls_session { @@ -264,6 +272,7 @@ */ pid_t creator; int state; + int target_state; /* session target bind state */ int sid; /* session id */ void *dd_data; /* LLD private data */ struct device dev; /* sysfs transport/container device */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/trace/events/btrfs.h +++ linux-oem-6.1-6.1.0/include/trace/events/btrfs.h @@ -98,7 +98,7 @@ EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \ EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \ EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \ - EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \ + EM( FLUSH_DELAYED_REFS, "FLUSH_DELAYED_REFS") \ EM( ALLOC_CHUNK, "ALLOC_CHUNK") \ EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \ EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/trace/stages/stage4_event_fields.h +++ linux-oem-6.1-6.1.0/include/trace/stages/stage4_event_fields.h @@ -26,7 +26,8 @@ #define __array(_type, _item, _len) { \ .type = #_type"["__stringify(_len)"]", .name = #_item, \ .size = sizeof(_type[_len]), .align = ALIGN_STRUCTFIELD(_type), \ - .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER }, + .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER,\ + .len = _len }, #undef __dynamic_array #define __dynamic_array(_type, _item, _len) { \ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/drm/virtgpu_drm.h +++ linux-oem-6.1-6.1.0/include/uapi/drm/virtgpu_drm.h @@ -64,6 +64,7 @@ __u32 pad; }; +/* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */ struct drm_virtgpu_execbuffer { __u32 flags; __u32 size; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/linux/ip.h +++ linux-oem-6.1-6.1.0/include/uapi/linux/ip.h @@ -18,6 +18,7 @@ #ifndef _UAPI_LINUX_IP_H #define _UAPI_LINUX_IP_H #include +#include #include #define IPTOS_TOS_MASK 0x1E only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/linux/ipv6.h +++ linux-oem-6.1-6.1.0/include/uapi/linux/ipv6.h @@ -4,6 +4,7 @@ #include #include +#include #include #include only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/linux/netfilter/nf_conntrack_sctp.h +++ linux-oem-6.1-6.1.0/include/uapi/linux/netfilter/nf_conntrack_sctp.h @@ -15,7 +15,7 @@ SCTP_CONNTRACK_SHUTDOWN_RECD, SCTP_CONNTRACK_SHUTDOWN_ACK_SENT, SCTP_CONNTRACK_HEARTBEAT_SENT, - SCTP_CONNTRACK_HEARTBEAT_ACKED, + SCTP_CONNTRACK_HEARTBEAT_ACKED, /* no longer used */ SCTP_CONNTRACK_MAX }; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/linux/netfilter/nfnetlink_cttimeout.h +++ linux-oem-6.1-6.1.0/include/uapi/linux/netfilter/nfnetlink_cttimeout.h @@ -94,7 +94,7 @@ CTA_TIMEOUT_SCTP_SHUTDOWN_RECD, CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT, CTA_TIMEOUT_SCTP_HEARTBEAT_SENT, - CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED, + CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED, /* no longer used */ __CTA_TIMEOUT_SCTP_MAX }; #define CTA_TIMEOUT_SCTP_MAX (__CTA_TIMEOUT_SCTP_MAX - 1) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/uapi/linux/psci.h +++ linux-oem-6.1-6.1.0/include/uapi/linux/psci.h @@ -58,7 +58,7 @@ #define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18) #define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19) -#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(19) +#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20) #define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12) #define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13) @@ -67,7 +67,7 @@ #define PSCI_1_0_FN64_STAT_COUNT PSCI_0_2_FN64(17) #define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18) -#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(19) +#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20) /* PSCI v0.2 power state encoding for CPU_SUSPEND function */ #define PSCI_0_2_POWER_STATE_ID_MASK 0xffff only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/include/ufs/ufshcd.h +++ linux-oem-6.1-6.1.0/include/ufs/ufshcd.h @@ -806,6 +806,7 @@ * @urgent_bkops_lvl: keeps track of urgent bkops level for device * @is_urgent_bkops_lvl_checked: keeps track if the urgent bkops level for * device is known or not. + * @wb_mutex: used to serialize devfreq and sysfs write booster toggling * @clk_scaling_lock: used to serialize device commands and clock scaling * @desc_size: descriptor sizes reported by device * @scsi_block_reqs_cnt: reference counting for scsi block requests @@ -948,6 +949,7 @@ enum bkops_status urgent_bkops_lvl; bool is_urgent_bkops_lvl_checked; + struct mutex wb_mutex; struct rw_semaphore clk_scaling_lock; unsigned char desc_size[QUERY_DESC_IDN_MAX]; atomic_t scsi_block_reqs_cnt; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/io_uring/fdinfo.c +++ linux-oem-6.1-6.1.0/io_uring/fdinfo.c @@ -170,12 +170,11 @@ xa_for_each(&ctx->personalities, index, cred) io_uring_show_cred(m, index, cred); } - if (has_lock) - mutex_unlock(&ctx->uring_lock); seq_puts(m, "PollList:\n"); for (i = 0; i < (1U << ctx->cancel_table.hash_bits); i++) { struct io_hash_bucket *hb = &ctx->cancel_table.hbs[i]; + struct io_hash_bucket *hbl = &ctx->cancel_table_locked.hbs[i]; struct io_kiocb *req; spin_lock(&hb->lock); @@ -183,8 +182,17 @@ seq_printf(m, " op=%d, task_works=%d\n", req->opcode, task_work_pending(req->task)); spin_unlock(&hb->lock); + + if (!has_lock) + continue; + hlist_for_each_entry(req, &hbl->list, hash_node) + seq_printf(m, " op=%d, task_works=%d\n", req->opcode, + task_work_pending(req->task)); } + if (has_lock) + mutex_unlock(&ctx->uring_lock); + seq_puts(m, "CqOverflowList:\n"); spin_lock(&ctx->completion_lock); list_for_each_entry(ocqe, &ctx->cq_overflow_list, list) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/io_uring/io-wq.c +++ linux-oem-6.1-6.1.0/io_uring/io-wq.c @@ -1230,6 +1230,12 @@ worker = container_of(cb, struct io_worker, create_work); io_worker_cancel_cb(worker); + /* + * Only the worker continuation helper has worker allocated and + * hence needs freeing. + */ + if (cb->func == create_worker_cont) + kfree(worker); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/io_uring/rw.c +++ linux-oem-6.1-6.1.0/io_uring/rw.c @@ -548,12 +548,12 @@ int io_readv_prep_async(struct io_kiocb *req) { - return io_rw_prep_async(req, READ); + return io_rw_prep_async(req, ITER_DEST); } int io_writev_prep_async(struct io_kiocb *req) { - return io_rw_prep_async(req, WRITE); + return io_rw_prep_async(req, ITER_SOURCE); } /* @@ -704,7 +704,7 @@ loff_t *ppos; if (!req_has_async_data(req)) { - ret = io_import_iovec(READ, req, &iovec, s, issue_flags); + ret = io_import_iovec(ITER_DEST, req, &iovec, s, issue_flags); if (unlikely(ret < 0)) return ret; } else { @@ -716,7 +716,7 @@ * buffers, as we dropped the selected one before retry. */ if (io_do_buffer_select(req)) { - ret = io_import_iovec(READ, req, &iovec, s, issue_flags); + ret = io_import_iovec(ITER_DEST, req, &iovec, s, issue_flags); if (unlikely(ret < 0)) return ret; } @@ -851,7 +851,7 @@ loff_t *ppos; if (!req_has_async_data(req)) { - ret = io_import_iovec(WRITE, req, &iovec, s, issue_flags); + ret = io_import_iovec(ITER_SOURCE, req, &iovec, s, issue_flags); if (unlikely(ret < 0)) return ret; } else { @@ -1055,7 +1055,11 @@ continue; req->cqe.flags = io_put_kbuf(req, 0); - __io_fill_cqe_req(req->ctx, req); + if (unlikely(!__io_fill_cqe_req(ctx, req))) { + spin_lock(&ctx->completion_lock); + io_req_cqe_overflow(req); + spin_unlock(&ctx->completion_lock); + } } if (unlikely(!nr_events)) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/bpf/bpf_lsm.c +++ linux-oem-6.1-6.1.0/kernel/bpf/bpf_lsm.c @@ -51,7 +51,6 @@ */ BTF_SET_START(bpf_lsm_locked_sockopt_hooks) #ifdef CONFIG_SECURITY_NETWORK -BTF_ID(func, bpf_lsm_socket_sock_rcv_skb) BTF_ID(func, bpf_lsm_sock_graft) BTF_ID(func, bpf_lsm_inet_csk_clone) BTF_ID(func, bpf_lsm_inet_conn_established) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/bpf/hashtab.c +++ linux-oem-6.1-6.1.0/kernel/bpf/hashtab.c @@ -152,7 +152,7 @@ { unsigned long flags; - hash = hash & HASHTAB_MAP_LOCK_MASK; + hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); preempt_disable(); if (unlikely(__this_cpu_inc_return(*(htab->map_locked[hash])) != 1)) { @@ -171,7 +171,7 @@ struct bucket *b, u32 hash, unsigned long flags) { - hash = hash & HASHTAB_MAP_LOCK_MASK; + hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); raw_spin_unlock_irqrestore(&b->raw_lock, flags); __this_cpu_dec(*(htab->map_locked[hash])); preempt_enable(); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/bpf/memalloc.c +++ linux-oem-6.1-6.1.0/kernel/bpf/memalloc.c @@ -71,7 +71,7 @@ if (size <= 192) return size_index[(size - 1) / 8] - 1; - return fls(size - 1) - 1; + return fls(size - 1) - 2; } #define NUM_CACHES 11 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/bpf/offload.c +++ linux-oem-6.1-6.1.0/kernel/bpf/offload.c @@ -216,9 +216,6 @@ if (offload->dev_state) offload->offdev->ops->destroy(prog); - /* Make sure BPF_PROG_GET_NEXT_ID can't find this dead program */ - bpf_prog_free_id(prog, true); - list_del_init(&offload->offloads); kfree(offload); prog->aux->offload = NULL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/bpf/task_iter.c +++ linux-oem-6.1-6.1.0/kernel/bpf/task_iter.c @@ -438,6 +438,7 @@ */ struct bpf_iter_seq_task_common common; struct task_struct *task; + struct mm_struct *mm; struct vm_area_struct *vma; u32 tid; unsigned long prev_vm_start; @@ -456,16 +457,19 @@ enum bpf_task_vma_iter_find_op op; struct vm_area_struct *curr_vma; struct task_struct *curr_task; + struct mm_struct *curr_mm; u32 saved_tid = info->tid; /* If this function returns a non-NULL vma, it holds a reference to - * the task_struct, and holds read lock on vma->mm->mmap_lock. + * the task_struct, holds a refcount on mm->mm_users, and holds + * read lock on vma->mm->mmap_lock. * If this function returns NULL, it does not hold any reference or * lock. */ if (info->task) { curr_task = info->task; curr_vma = info->vma; + curr_mm = info->mm; /* In case of lock contention, drop mmap_lock to unblock * the writer. * @@ -504,13 +508,15 @@ * 4.2) VMA2 and VMA2' covers different ranges, process * VMA2'. */ - if (mmap_lock_is_contended(curr_task->mm)) { + if (mmap_lock_is_contended(curr_mm)) { info->prev_vm_start = curr_vma->vm_start; info->prev_vm_end = curr_vma->vm_end; op = task_vma_iter_find_vma; - mmap_read_unlock(curr_task->mm); - if (mmap_read_lock_killable(curr_task->mm)) + mmap_read_unlock(curr_mm); + if (mmap_read_lock_killable(curr_mm)) { + mmput(curr_mm); goto finish; + } } else { op = task_vma_iter_next_vma; } @@ -535,42 +541,47 @@ op = task_vma_iter_find_vma; } - if (!curr_task->mm) + curr_mm = get_task_mm(curr_task); + if (!curr_mm) goto next_task; - if (mmap_read_lock_killable(curr_task->mm)) + if (mmap_read_lock_killable(curr_mm)) { + mmput(curr_mm); goto finish; + } } switch (op) { case task_vma_iter_first_vma: - curr_vma = find_vma(curr_task->mm, 0); + curr_vma = find_vma(curr_mm, 0); break; case task_vma_iter_next_vma: - curr_vma = find_vma(curr_task->mm, curr_vma->vm_end); + curr_vma = find_vma(curr_mm, curr_vma->vm_end); break; case task_vma_iter_find_vma: /* We dropped mmap_lock so it is necessary to use find_vma * to find the next vma. This is similar to the mechanism * in show_smaps_rollup(). */ - curr_vma = find_vma(curr_task->mm, info->prev_vm_end - 1); + curr_vma = find_vma(curr_mm, info->prev_vm_end - 1); /* case 1) and 4.2) above just use curr_vma */ /* check for case 2) or case 4.1) above */ if (curr_vma && curr_vma->vm_start == info->prev_vm_start && curr_vma->vm_end == info->prev_vm_end) - curr_vma = find_vma(curr_task->mm, curr_vma->vm_end); + curr_vma = find_vma(curr_mm, curr_vma->vm_end); break; } if (!curr_vma) { /* case 3) above, or case 2) 4.1) with vma->next == NULL */ - mmap_read_unlock(curr_task->mm); + mmap_read_unlock(curr_mm); + mmput(curr_mm); goto next_task; } info->task = curr_task; info->vma = curr_vma; + info->mm = curr_mm; return curr_vma; next_task: @@ -579,6 +590,7 @@ put_task_struct(curr_task); info->task = NULL; + info->mm = NULL; info->tid++; goto again; @@ -587,6 +599,7 @@ put_task_struct(curr_task); info->task = NULL; info->vma = NULL; + info->mm = NULL; return NULL; } @@ -658,7 +671,9 @@ */ info->prev_vm_start = ~0UL; info->prev_vm_end = info->vma->vm_end; - mmap_read_unlock(info->task->mm); + mmap_read_unlock(info->mm); + mmput(info->mm); + info->mm = NULL; put_task_struct(info->task); info->task = NULL; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/cgroup/cpuset.c +++ linux-oem-6.1-6.1.0/kernel/cgroup/cpuset.c @@ -1201,12 +1201,13 @@ /** * update_tasks_cpumask - Update the cpumasks of tasks in the cpuset. * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed + * @new_cpus: the temp variable for the new effective_cpus mask * * Iterate through each task of @cs updating its cpus_allowed to the * effective cpuset's. As this function is called with cpuset_rwsem held, * cpuset membership stays stable. */ -static void update_tasks_cpumask(struct cpuset *cs) +static void update_tasks_cpumask(struct cpuset *cs, struct cpumask *new_cpus) { struct css_task_iter it; struct task_struct *task; @@ -1220,7 +1221,10 @@ if (top_cs && (task->flags & PF_KTHREAD) && kthread_is_per_cpu(task)) continue; - set_cpus_allowed_ptr(task, cs->effective_cpus); + + cpumask_and(new_cpus, cs->effective_cpus, + task_cpu_possible_mask(task)); + set_cpus_allowed_ptr(task, new_cpus); } css_task_iter_end(&it); } @@ -1342,7 +1346,7 @@ * A parent can be left with no CPU as long as there is no * task directly associated with the parent partition. */ - if (!cpumask_intersects(cs->cpus_allowed, parent->effective_cpus) && + if (cpumask_subset(parent->effective_cpus, cs->cpus_allowed) && partition_is_populated(parent, cs)) return PERR_NOCPUS; @@ -1505,7 +1509,7 @@ spin_unlock_irq(&callback_lock); if (adding || deleting) - update_tasks_cpumask(parent); + update_tasks_cpumask(parent, tmp->new_cpus); /* * Set or clear CS_SCHED_LOAD_BALANCE when partcmd_update, if necessary. @@ -1657,7 +1661,7 @@ WARN_ON(!is_in_v2_mode() && !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); - update_tasks_cpumask(cp); + update_tasks_cpumask(cp, tmp->new_cpus); /* * On legacy hierarchy, if the effective cpumask of any non- @@ -2305,7 +2309,7 @@ } } - update_tasks_cpumask(parent); + update_tasks_cpumask(parent, tmpmask.new_cpus); if (parent->child_ecpus_count) update_sibling_cpumasks(parent, cs, &tmpmask); @@ -2320,6 +2324,7 @@ new_prs = -new_prs; spin_lock_irq(&callback_lock); cs->partition_root_state = new_prs; + WRITE_ONCE(cs->prs_err, err); spin_unlock_irq(&callback_lock); /* * Update child cpusets, if present. @@ -3317,7 +3322,7 @@ * as the tasks will be migrated to an ancestor. */ if (cpus_updated && !cpumask_empty(cs->cpus_allowed)) - update_tasks_cpumask(cs); + update_tasks_cpumask(cs, new_cpus); if (mems_updated && !nodes_empty(cs->mems_allowed)) update_tasks_nodemask(cs); @@ -3354,7 +3359,7 @@ spin_unlock_irq(&callback_lock); if (cpus_updated) - update_tasks_cpumask(cs); + update_tasks_cpumask(cs, new_cpus); if (mems_updated) update_tasks_nodemask(cs); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/exit.c +++ linux-oem-6.1-6.1.0/kernel/exit.c @@ -67,11 +67,58 @@ #include #include #include +#include #include #include #include +/* + * The default value should be high enough to not crash a system that randomly + * crashes its kernel from time to time, but low enough to at least not permit + * overflowing 32-bit refcounts or the ldsem writer count. + */ +static unsigned int oops_limit = 10000; + +#ifdef CONFIG_SYSCTL +static struct ctl_table kern_exit_table[] = { + { + .procname = "oops_limit", + .data = &oops_limit, + .maxlen = sizeof(oops_limit), + .mode = 0644, + .proc_handler = proc_douintvec, + }, + { } +}; + +static __init int kernel_exit_sysctls_init(void) +{ + register_sysctl_init("kernel", kern_exit_table); + return 0; +} +late_initcall(kernel_exit_sysctls_init); +#endif + +static atomic_t oops_count = ATOMIC_INIT(0); + +#ifdef CONFIG_SYSFS +static ssize_t oops_count_show(struct kobject *kobj, struct kobj_attribute *attr, + char *page) +{ + return sysfs_emit(page, "%d\n", atomic_read(&oops_count)); +} + +static struct kobj_attribute oops_count_attr = __ATTR_RO(oops_count); + +static __init int kernel_exit_sysfs_init(void) +{ + sysfs_add_file_to_group(kernel_kobj, &oops_count_attr.attr, NULL); + return 0; +} +late_initcall(kernel_exit_sysfs_init); +#endif + static void __unhash_process(struct task_struct *p, bool group_dead) { nr_threads--; @@ -884,6 +931,7 @@ * Then do everything else. */ struct task_struct *tsk = current; + unsigned int limit; if (unlikely(in_interrupt())) panic("Aiee, killing interrupt handler!"); @@ -898,6 +946,20 @@ } /* + * Every time the system oopses, if the oops happens while a reference + * to an object was held, the reference leaks. + * If the oops doesn't also leak memory, repeated oopsing can cause + * reference counters to wrap around (if they're not using refcount_t). + * This means that repeated oopsing can make unexploitable-looking bugs + * exploitable through repeated oopsing. + * To make sure this can't happen, place an upper bound on how often the + * kernel may oops without panic(). + */ + limit = READ_ONCE(oops_limit); + if (atomic_inc_return(&oops_count) >= limit && limit) + panic("Oopsed too often (kernel.oops_limit is %d)", limit); + + /* * We're taking recursive faults here in make_task_dead. Safest is to just * leave this task alone and wait for reboot. */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/irq/irqdomain.c +++ linux-oem-6.1-6.1.0/kernel/irq/irqdomain.c @@ -1915,7 +1915,7 @@ static void debugfs_remove_domain_dir(struct irq_domain *d) { - debugfs_remove(debugfs_lookup(d->name, domain_dir)); + debugfs_lookup_and_remove(d->name, domain_dir); } void __init irq_domain_debugfs_init(struct dentry *root) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/kcsan/kcsan_test.c +++ linux-oem-6.1-6.1.0/kernel/kcsan/kcsan_test.c @@ -159,7 +159,7 @@ const bool is_assert = (r->access[0].type | r->access[1].type) & KCSAN_ACCESS_ASSERT; bool ret = false; unsigned long flags; - typeof(observed.lines) expect; + typeof(*observed.lines) *expect; const char *end; char *cur; int i; @@ -168,6 +168,10 @@ if (!report_available()) return false; + expect = kmalloc(sizeof(observed.lines), GFP_KERNEL); + if (WARN_ON(!expect)) + return false; + /* Generate expected report contents. */ /* Title */ @@ -253,6 +257,7 @@ strstr(observed.lines[2], expect[1]))); out: spin_unlock_irqrestore(&observed.lock, flags); + kfree(expect); return ret; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/kcsan/report.c +++ linux-oem-6.1-6.1.0/kernel/kcsan/report.c @@ -492,8 +492,7 @@ dump_stack_print_info(KERN_DEFAULT); pr_err("==================================================================\n"); - if (panic_on_warn) - panic("panic_on_warn set ...\n"); + check_panic_on_warn("KCSAN"); } static void release_report(unsigned long *flags, struct other_info *other_info) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/module/main.c +++ linux-oem-6.1-6.1.0/kernel/module/main.c @@ -2386,7 +2386,8 @@ sched_annotate_sleep(); mutex_lock(&module_mutex); mod = find_module_all(name, strlen(name), true); - ret = !mod || mod->state == MODULE_STATE_LIVE; + ret = !mod || mod->state == MODULE_STATE_LIVE + || mod->state == MODULE_STATE_GOING; mutex_unlock(&module_mutex); return ret; @@ -2562,20 +2563,35 @@ mod->state = MODULE_STATE_UNFORMED; -again: mutex_lock(&module_mutex); old = find_module_all(mod->name, strlen(mod->name), true); if (old != NULL) { - if (old->state != MODULE_STATE_LIVE) { + if (old->state == MODULE_STATE_COMING + || old->state == MODULE_STATE_UNFORMED) { /* Wait in case it fails to load. */ mutex_unlock(&module_mutex); err = wait_event_interruptible(module_wq, finished_loading(mod->name)); if (err) goto out_unlocked; - goto again; + + /* The module might have gone in the meantime. */ + mutex_lock(&module_mutex); + old = find_module_all(mod->name, strlen(mod->name), + true); } - err = -EEXIST; + + /* + * We are here only when the same module was being loaded. Do + * not try to load it again right now. It prevents long delays + * caused by serialized module load failures. It might happen + * when more devices of the same type trigger load of + * a particular module. + */ + if (old && old->state == MODULE_STATE_LIVE) + err = -EEXIST; + else + err = -EBUSY; goto out; } mod_update_bounds(mod); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/panic.c +++ linux-oem-6.1-6.1.0/kernel/panic.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ int panic_on_warn __read_mostly; unsigned long panic_on_taint; bool panic_on_taint_nousertaint = false; +static unsigned int warn_limit __read_mostly; int panic_timeout = CONFIG_PANIC_TIMEOUT; EXPORT_SYMBOL_GPL(panic_timeout); @@ -75,8 +77,9 @@ EXPORT_SYMBOL(panic_notifier_list); -#if defined(CONFIG_SMP) && defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL static struct ctl_table kern_panic_table[] = { +#ifdef CONFIG_SMP { .procname = "oops_all_cpu_backtrace", .data = &sysctl_oops_all_cpu_backtrace, @@ -86,6 +89,14 @@ .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, +#endif + { + .procname = "warn_limit", + .data = &warn_limit, + .maxlen = sizeof(warn_limit), + .mode = 0644, + .proc_handler = proc_douintvec, + }, { } }; @@ -97,6 +108,25 @@ late_initcall(kernel_panic_sysctls_init); #endif +static atomic_t warn_count = ATOMIC_INIT(0); + +#ifdef CONFIG_SYSFS +static ssize_t warn_count_show(struct kobject *kobj, struct kobj_attribute *attr, + char *page) +{ + return sysfs_emit(page, "%d\n", atomic_read(&warn_count)); +} + +static struct kobj_attribute warn_count_attr = __ATTR_RO(warn_count); + +static __init int kernel_panic_sysfs_init(void) +{ + sysfs_add_file_to_group(kernel_kobj, &warn_count_attr.attr, NULL); + return 0; +} +late_initcall(kernel_panic_sysfs_init); +#endif + static long no_blink(int state) { return 0; @@ -199,6 +229,19 @@ ftrace_dump(DUMP_ALL); } +void check_panic_on_warn(const char *origin) +{ + unsigned int limit; + + if (panic_on_warn) + panic("%s: panic_on_warn set ...\n", origin); + + limit = READ_ONCE(warn_limit); + if (atomic_inc_return(&warn_count) >= limit && limit) + panic("%s: system warned too often (kernel.warn_limit is %d)", + origin, limit); +} + /** * panic - halt the system * @fmt: The text string to print @@ -617,8 +660,7 @@ if (regs) show_regs(regs); - if (panic_on_warn) - panic("panic_on_warn set ...\n"); + check_panic_on_warn("kernel"); if (!regs) dump_stack(); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/time/alarmtimer.c +++ linux-oem-6.1-6.1.0/kernel/time/alarmtimer.c @@ -470,11 +470,35 @@ } EXPORT_SYMBOL_GPL(alarm_forward); -u64 alarm_forward_now(struct alarm *alarm, ktime_t interval) +static u64 __alarm_forward_now(struct alarm *alarm, ktime_t interval, bool throttle) { struct alarm_base *base = &alarm_bases[alarm->type]; + ktime_t now = base->get_ktime(); + + if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && throttle) { + /* + * Same issue as with posix_timer_fn(). Timers which are + * periodic but the signal is ignored can starve the system + * with a very small interval. The real fix which was + * promised in the context of posix_timer_fn() never + * materialized, but someone should really work on it. + * + * To prevent DOS fake @now to be 1 jiffie out which keeps + * the overrun accounting correct but creates an + * inconsistency vs. timer_gettime(2). + */ + ktime_t kj = NSEC_PER_SEC / HZ; + + if (interval < kj) + now = ktime_add(now, kj); + } + + return alarm_forward(alarm, now, interval); +} - return alarm_forward(alarm, base->get_ktime(), interval); +u64 alarm_forward_now(struct alarm *alarm, ktime_t interval) +{ + return __alarm_forward_now(alarm, interval, false); } EXPORT_SYMBOL_GPL(alarm_forward_now); @@ -551,9 +575,10 @@ if (posix_timer_event(ptr, si_private) && ptr->it_interval) { /* * Handle ignored signals and rearm the timer. This will go - * away once we handle ignored signals proper. + * away once we handle ignored signals proper. Ensure that + * small intervals cannot starve the system. */ - ptr->it_overrun += alarm_forward_now(alarm, ptr->it_interval); + ptr->it_overrun += __alarm_forward_now(alarm, ptr->it_interval, true); ++ptr->it_requeue_pending; ptr->it_active = 1; result = ALARMTIMER_RESTART; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/bpf_trace.c +++ linux-oem-6.1-6.1.0/kernel/trace/bpf_trace.c @@ -832,6 +832,7 @@ work = container_of(entry, struct send_signal_irq_work, irq_work); group_send_sig_info(work->sig, SEND_SIG_PRIV, work->task, work->type); + put_task_struct(work->task); } static int bpf_send_signal_common(u32 sig, enum pid_type type) @@ -847,6 +848,9 @@ return -EPERM; if (unlikely(!nmi_uaccess_okay())) return -EPERM; + /* Task should not be pid=1 to avoid kernel panic. */ + if (unlikely(is_global_init(current))) + return -EPERM; if (irqs_disabled()) { /* Do an early check on signal validity. Otherwise, @@ -863,7 +867,7 @@ * to the irq_work. The current task may change when queued * irq works get executed. */ - work->task = current; + work->task = get_task_struct(current); work->sig = sig; work->type = type; irq_work_queue(&work->irq_work); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/ftrace.c +++ linux-oem-6.1-6.1.0/kernel/trace/ftrace.c @@ -1248,12 +1248,17 @@ call_rcu(&hash->rcu, __free_ftrace_hash_rcu); } +/** + * ftrace_free_filter - remove all filters for an ftrace_ops + * @ops - the ops to remove the filters from + */ void ftrace_free_filter(struct ftrace_ops *ops) { ftrace_ops_init(ops); free_ftrace_hash(ops->func_hash->filter_hash); free_ftrace_hash(ops->func_hash->notrace_hash); } +EXPORT_SYMBOL_GPL(ftrace_free_filter); static struct ftrace_hash *alloc_ftrace_hash(int size_bits) { @@ -5828,6 +5833,10 @@ * * Filters denote which functions should be enabled when tracing is enabled * If @ip is NULL, it fails to update filter. + * + * This can allocate memory which must be freed before @ops can be freed, + * either by removing each filtered addr or by using + * ftrace_free_filter(@ops). */ int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip, int remove, int reset) @@ -5847,7 +5856,11 @@ * * Filters denote which functions should be enabled when tracing is enabled * If @ips array or any ip specified within is NULL , it fails to update filter. - */ + * + * This can allocate memory which must be freed before @ops can be freed, + * either by removing each filtered addr or by using + * ftrace_free_filter(@ops). +*/ int ftrace_set_filter_ips(struct ftrace_ops *ops, unsigned long *ips, unsigned int cnt, int remove, int reset) { @@ -5889,6 +5902,10 @@ * * Filters denote which functions should be enabled when tracing is enabled. * If @buf is NULL and reset is set, all functions will be enabled for tracing. + * + * This can allocate memory which must be freed before @ops can be freed, + * either by removing each filtered addr or by using + * ftrace_free_filter(@ops). */ int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, int len, int reset) @@ -5908,6 +5925,10 @@ * Notrace Filters denote which functions should not be enabled when tracing * is enabled. If @buf is NULL and reset is set, all functions will be enabled * for tracing. + * + * This can allocate memory which must be freed before @ops can be freed, + * either by removing each filtered addr or by using + * ftrace_free_filter(@ops). */ int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, int len, int reset) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/trace_events.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_events.c @@ -114,7 +114,7 @@ static int __trace_define_field(struct list_head *head, const char *type, const char *name, int offset, int size, - int is_signed, int filter_type) + int is_signed, int filter_type, int len) { struct ftrace_event_field *field; @@ -133,6 +133,7 @@ field->offset = offset; field->size = size; field->is_signed = is_signed; + field->len = len; list_add(&field->link, head); @@ -150,14 +151,28 @@ head = trace_get_fields(call); return __trace_define_field(head, type, name, offset, size, - is_signed, filter_type); + is_signed, filter_type, 0); } EXPORT_SYMBOL_GPL(trace_define_field); +static int trace_define_field_ext(struct trace_event_call *call, const char *type, + const char *name, int offset, int size, int is_signed, + int filter_type, int len) +{ + struct list_head *head; + + if (WARN_ON(!call->class)) + return 0; + + head = trace_get_fields(call); + return __trace_define_field(head, type, name, offset, size, + is_signed, filter_type, len); +} + #define __generic_field(type, item, filter_type) \ ret = __trace_define_field(&ftrace_generic_fields, #type, \ #item, 0, 0, is_signed_type(type), \ - filter_type); \ + filter_type, 0); \ if (ret) \ return ret; @@ -166,7 +181,7 @@ "common_" #item, \ offsetof(typeof(ent), item), \ sizeof(ent.item), \ - is_signed_type(type), FILTER_OTHER); \ + is_signed_type(type), FILTER_OTHER, 0); \ if (ret) \ return ret; @@ -1588,12 +1603,17 @@ seq_printf(m, "\tfield:%s %s;\toffset:%u;\tsize:%u;\tsigned:%d;\n", field->type, field->name, field->offset, field->size, !!field->is_signed); - else - seq_printf(m, "\tfield:%.*s %s%s;\toffset:%u;\tsize:%u;\tsigned:%d;\n", + else if (field->len) + seq_printf(m, "\tfield:%.*s %s[%d];\toffset:%u;\tsize:%u;\tsigned:%d;\n", (int)(array_descriptor - field->type), field->type, field->name, - array_descriptor, field->offset, + field->len, field->offset, field->size, !!field->is_signed); + else + seq_printf(m, "\tfield:%.*s %s[];\toffset:%u;\tsize:%u;\tsigned:%d;\n", + (int)(array_descriptor - field->type), + field->type, field->name, + field->offset, field->size, !!field->is_signed); return 0; } @@ -2379,9 +2399,10 @@ } offset = ALIGN(offset, field->align); - ret = trace_define_field(call, field->type, field->name, + ret = trace_define_field_ext(call, field->type, field->name, offset, field->size, - field->is_signed, field->filter_type); + field->is_signed, field->filter_type, + field->len); if (WARN_ON_ONCE(ret)) { pr_err("error code is %d\n", ret); break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/trace_export.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_export.c @@ -111,7 +111,8 @@ #define __array(_type, _item, _len) { \ .type = #_type"["__stringify(_len)"]", .name = #_item, \ .size = sizeof(_type[_len]), .align = __alignof__(_type), \ - is_signed_type(_type), .filter_type = FILTER_OTHER }, + is_signed_type(_type), .filter_type = FILTER_OTHER, \ + .len = _len }, #undef __array_desc #define __array_desc(_type, _container, _item, _len) __array(_type, _item, _len) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/trace_osnoise.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_osnoise.c @@ -125,9 +125,8 @@ * register/unregister serialization is provided by trace's * trace_types_lock. */ - lockdep_assert_held(&trace_types_lock); - - list_for_each_entry_rcu(inst, &osnoise_instances, list) { + list_for_each_entry_rcu(inst, &osnoise_instances, list, + lockdep_is_held(&trace_types_lock)) { if (inst->tr == tr) { list_del_rcu(&inst->list); found = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/trace/trace_output.c +++ linux-oem-6.1-6.1.0/kernel/trace/trace_output.c @@ -1568,7 +1568,7 @@ NULL }; -__init static int init_events(void) +__init int init_events(void) { struct trace_event *event; int i, ret; @@ -1581,4 +1581,3 @@ return 0; } -early_initcall(init_events); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/kernel/umh.c +++ linux-oem-6.1-6.1.0/kernel/umh.c @@ -438,21 +438,27 @@ if (wait == UMH_NO_WAIT) /* task has freed sub_info */ goto unlock; - if (wait & UMH_KILLABLE) - state |= TASK_KILLABLE; - if (wait & UMH_FREEZABLE) state |= TASK_FREEZABLE; - retval = wait_for_completion_state(&done, state); - if (!retval) - goto wait_done; - if (wait & UMH_KILLABLE) { + retval = wait_for_completion_state(&done, state | TASK_KILLABLE); + if (!retval) + goto wait_done; + /* umh_complete() will see NULL and free sub_info */ if (xchg(&sub_info->complete, NULL)) goto unlock; + + /* + * fallthrough; in case of -ERESTARTSYS now do uninterruptible + * wait_for_completion_state(). Since umh_complete() shall call + * complete() in a moment if xchg() above returned NULL, this + * uninterruptible wait_for_completion_state() will not block + * SIGKILL'ed processes for long. + */ } + wait_for_completion_state(&done, state); wait_done: retval = sub_info->retval; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/lib/lockref.c +++ linux-oem-6.1-6.1.0/lib/lockref.c @@ -23,7 +23,6 @@ } \ if (!--retry) \ break; \ - cpu_relax(); \ } \ } while (0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/lib/nlattr.c +++ linux-oem-6.1-6.1.0/lib/nlattr.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -381,6 +382,7 @@ if (type <= 0 || type > maxtype) return 0; + type = array_index_nospec(type, maxtype + 1); pt = &policy[type]; BUG_ON(pt->type > NLA_TYPE_MAX); @@ -596,6 +598,7 @@ } continue; } + type = array_index_nospec(type, maxtype + 1); if (policy) { int err = validate_nla(nla, maxtype, policy, validate, extack, depth); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/lib/ubsan.c +++ linux-oem-6.1-6.1.0/lib/ubsan.c @@ -154,8 +154,7 @@ current->in_ubsan--; - if (panic_on_warn) - panic("panic_on_warn set ...\n"); + check_panic_on_warn("UBSAN"); } void __ubsan_handle_divrem_overflow(void *_data, void *lhs, void *rhs) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/lib/usercopy.c +++ linux-oem-6.1-6.1.0/lib/usercopy.c @@ -3,6 +3,7 @@ #include #include #include +#include /* out-of-line parts */ @@ -12,6 +13,12 @@ unsigned long res = n; might_fault(); if (!should_fail_usercopy() && likely(access_ok(from, n))) { + /* + * Ensure that bad access_ok() speculation will not + * lead to nasty side effects *after* the copy is + * finished: + */ + barrier_nospec(); instrument_copy_from_user_before(to, from, n); res = raw_copy_from_user(to, from, n); instrument_copy_from_user_after(to, from, n, res); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/huge_memory.c +++ linux-oem-6.1-6.1.0/mm/huge_memory.c @@ -3253,8 +3253,6 @@ pmde = mk_huge_pmd(new, READ_ONCE(vma->vm_page_prot)); if (pmd_swp_soft_dirty(*pvmw->pmd)) pmde = pmd_mksoft_dirty(pmde); - if (is_writable_migration_entry(entry)) - pmde = maybe_pmd_mkwrite(pmde, vma); if (pmd_swp_uffd_wp(*pvmw->pmd)) pmde = pmd_wrprotect(pmd_mkuffd_wp(pmde)); if (!is_migration_entry_young(entry)) @@ -3262,6 +3260,10 @@ /* NOTE: this may contain setting soft-dirty on some archs */ if (PageDirty(new) && is_migration_entry_dirty(entry)) pmde = pmd_mkdirty(pmde); + if (is_writable_migration_entry(entry)) + pmde = maybe_pmd_mkwrite(pmde, vma); + else + pmde = pmd_wrprotect(pmde); if (PageAnon(new)) { rmap_t rmap_flags = RMAP_COMPOUND; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/kasan/common.c +++ linux-oem-6.1-6.1.0/mm/kasan/common.c @@ -246,6 +246,9 @@ static inline bool ____kasan_kfree_large(void *ptr, unsigned long ip) { + if (!kasan_arch_is_ready()) + return false; + if (ptr != page_address(virt_to_head_page(ptr))) { kasan_report_invalid_free(ptr, ip, KASAN_REPORT_INVALID_FREE); return true; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/kasan/generic.c +++ linux-oem-6.1-6.1.0/mm/kasan/generic.c @@ -191,7 +191,12 @@ bool kasan_byte_accessible(const void *addr) { - s8 shadow_byte = READ_ONCE(*(s8 *)kasan_mem_to_shadow(addr)); + s8 shadow_byte; + + if (!kasan_arch_is_ready()) + return true; + + shadow_byte = READ_ONCE(*(s8 *)kasan_mem_to_shadow(addr)); return shadow_byte >= 0 && shadow_byte < KASAN_GRANULE_SIZE; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/kasan/report.c +++ linux-oem-6.1-6.1.0/mm/kasan/report.c @@ -164,8 +164,8 @@ (unsigned long)addr); pr_err("==================================================================\n"); spin_unlock_irqrestore(&report_lock, *flags); - if (panic_on_warn && !test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) - panic("panic_on_warn set ...\n"); + if (!test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) + check_panic_on_warn("KASAN"); if (kasan_arg_fault == KASAN_ARG_FAULT_PANIC) panic("kasan.fault=panic set ...\n"); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/kasan/shadow.c +++ linux-oem-6.1-6.1.0/mm/kasan/shadow.c @@ -291,6 +291,9 @@ unsigned long shadow_start, shadow_end; int ret; + if (!kasan_arch_is_ready()) + return 0; + if (!is_vmalloc_or_module_addr((void *)addr)) return 0; @@ -459,6 +462,9 @@ unsigned long region_start, region_end; unsigned long size; + if (!kasan_arch_is_ready()) + return; + region_start = ALIGN(start, KASAN_MEMORY_PER_SHADOW_PAGE); region_end = ALIGN_DOWN(end, KASAN_MEMORY_PER_SHADOW_PAGE); @@ -502,6 +508,9 @@ * with setting memory tags, so the KASAN_VMALLOC_INIT flag is ignored. */ + if (!kasan_arch_is_ready()) + return (void *)start; + if (!is_vmalloc_or_module_addr(start)) return (void *)start; @@ -524,6 +533,9 @@ */ void __kasan_poison_vmalloc(const void *start, unsigned long size) { + if (!kasan_arch_is_ready()) + return; + if (!is_vmalloc_or_module_addr(start)) return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/kfence/report.c +++ linux-oem-6.1-6.1.0/mm/kfence/report.c @@ -273,8 +273,7 @@ lockdep_on(); - if (panic_on_warn) - panic("panic_on_warn set ...\n"); + check_panic_on_warn("KFENCE"); /* We encountered a memory safety error, taint the kernel! */ add_taint(TAINT_BAD_PAGE, LOCKDEP_STILL_OK); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/khugepaged.c +++ linux-oem-6.1-6.1.0/mm/khugepaged.c @@ -847,6 +847,10 @@ return SCAN_SUCCEED; } +/* + * See pmd_trans_unstable() for how the result may change out from + * underneath us, even if we hold mmap_lock in read. + */ static int find_pmd_or_thp_or_none(struct mm_struct *mm, unsigned long address, pmd_t **pmd) @@ -865,8 +869,12 @@ #endif if (pmd_none(pmde)) return SCAN_PMD_NONE; + if (!pmd_present(pmde)) + return SCAN_PMD_NULL; if (pmd_trans_huge(pmde)) return SCAN_PMD_MAPPED; + if (pmd_devmap(pmde)) + return SCAN_PMD_NULL; if (pmd_bad(pmde)) return SCAN_PMD_NULL; return SCAN_SUCCEED; @@ -1467,14 +1475,6 @@ if (!hugepage_vma_check(vma, vma->vm_flags, false, false, false)) return SCAN_VMA_CHECK; - /* - * Symmetry with retract_page_tables(): Exclude MAP_PRIVATE mappings - * that got written to. Without this, we'd have to also lock the - * anon_vma if one exists. - */ - if (vma->anon_vma) - return SCAN_VMA_CHECK; - /* Keep pmd pgtable for uffd-wp; see comment in retract_page_tables() */ if (userfaultfd_wp(vma)) return SCAN_PTE_UFFD_WP; @@ -1574,8 +1574,14 @@ } /* step 4: remove pte entries */ + /* we make no change to anon, but protect concurrent anon page lookup */ + if (vma->anon_vma) + anon_vma_lock_write(vma->anon_vma); + collapse_and_free_pmd(mm, vma, haddr, pmd); + if (vma->anon_vma) + anon_vma_unlock_write(vma->anon_vma); i_mmap_unlock_write(vma->vm_file->f_mapping); maybe_install_pmd: @@ -1651,7 +1657,7 @@ * has higher cost too. It would also probably require locking * the anon_vma. */ - if (vma->anon_vma) { + if (READ_ONCE(vma->anon_vma)) { result = SCAN_PAGE_ANON; goto next; } @@ -1680,6 +1686,18 @@ if ((cc->is_khugepaged || is_target) && mmap_write_trylock(mm)) { /* + * Re-check whether we have an ->anon_vma, because + * collapse_and_free_pmd() requires that either no + * ->anon_vma exists or the anon_vma is locked. + * We already checked ->anon_vma above, but that check + * is racy because ->anon_vma can be populated under the + * mmap lock in read mode. + */ + if (vma->anon_vma) { + result = SCAN_PAGE_ANON; + goto unlock_next; + } + /* * When a vma is registered with uffd-wp, we can't * recycle the pmd pgtable because there can be pte * markers installed. Skip it only, so the rest mm/vma @@ -2590,6 +2608,7 @@ case SCAN_CGROUP_CHARGE_FAIL: return -EBUSY; /* Resource temporary unavailable - trying again might succeed */ + case SCAN_PAGE_COUNT: case SCAN_PAGE_LOCK: case SCAN_PAGE_LRU: case SCAN_DEL_PAGE_LRU: @@ -2646,7 +2665,7 @@ goto out_nolock; } - hend = vma->vm_end & HPAGE_PMD_MASK; + hend = min(hend, vma->vm_end & HPAGE_PMD_MASK); } mmap_assert_locked(mm); memset(cc->node_load, 0, sizeof(cc->node_load)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/madvise.c +++ linux-oem-6.1-6.1.0/mm/madvise.c @@ -1459,7 +1459,7 @@ goto out; } - ret = import_iovec(READ, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); + ret = import_iovec(ITER_DEST, vec, vlen, ARRAY_SIZE(iovstack), &iov, &iter); if (ret < 0) goto out; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/migrate.c +++ linux-oem-6.1-6.1.0/mm/migrate.c @@ -215,6 +215,8 @@ pte = maybe_mkwrite(pte, vma); else if (pte_swp_uffd_wp(*pvmw.pte)) pte = pte_mkuffd_wp(pte); + else + pte = pte_wrprotect(pte); if (folio_test_anon(folio) && !is_readable_migration_entry(entry)) rmap_flags |= RMAP_EXCLUSIVE; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/page_alloc.c +++ linux-oem-6.1-6.1.0/mm/page_alloc.c @@ -5640,9 +5640,12 @@ */ void __free_pages(struct page *page, unsigned int order) { + /* get PageHead before we drop reference */ + int head = PageHead(page); + if (put_page_testzero(page)) free_the_page(page, order); - else if (!PageHead(page)) + else if (!head) while (order-- > 0) free_the_page(page + (1 << order), order); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/page_io.c +++ linux-oem-6.1-6.1.0/mm/page_io.c @@ -376,7 +376,7 @@ struct address_space *mapping = sio->iocb.ki_filp->f_mapping; int ret; - iov_iter_bvec(&from, WRITE, sio->bvec, sio->pages, sio->len); + iov_iter_bvec(&from, ITER_SOURCE, sio->bvec, sio->pages, sio->len); ret = mapping->a_ops->swap_rw(&sio->iocb, &from); if (ret != -EIOCBQUEUED) sio_write_complete(&sio->iocb, ret); @@ -530,7 +530,7 @@ struct address_space *mapping = sio->iocb.ki_filp->f_mapping; int ret; - iov_iter_bvec(&from, READ, sio->bvec, sio->pages, sio->len); + iov_iter_bvec(&from, ITER_DEST, sio->bvec, sio->pages, sio->len); ret = mapping->a_ops->swap_rw(&sio->iocb, &from); if (ret != -EIOCBQUEUED) sio_read_complete(&sio->iocb, ret); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/process_vm_access.c +++ linux-oem-6.1-6.1.0/mm/process_vm_access.c @@ -263,7 +263,7 @@ struct iovec *iov_r; struct iov_iter iter; ssize_t rc; - int dir = vm_write ? WRITE : READ; + int dir = vm_write ? ITER_SOURCE : ITER_DEST; if (flags != 0) return -EINVAL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/shmem.c +++ linux-oem-6.1-6.1.0/mm/shmem.c @@ -472,12 +472,10 @@ if (vma && ((vma->vm_flags & VM_NOHUGEPAGE) || test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))) return false; - if (shmem_huge_force) - return true; - if (shmem_huge == SHMEM_HUGE_FORCE) - return true; if (shmem_huge == SHMEM_HUGE_DENY) return false; + if (shmem_huge_force || shmem_huge == SHMEM_HUGE_FORCE) + return true; switch (SHMEM_SB(inode->i_sb)->huge) { case SHMEM_HUGE_ALWAYS: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/shrinker_debug.c +++ linux-oem-6.1-6.1.0/mm/shrinker_debug.c @@ -246,18 +246,21 @@ } EXPORT_SYMBOL(shrinker_debugfs_rename); -void shrinker_debugfs_remove(struct shrinker *shrinker) +struct dentry *shrinker_debugfs_remove(struct shrinker *shrinker) { + struct dentry *entry = shrinker->debugfs_entry; + lockdep_assert_held(&shrinker_rwsem); kfree_const(shrinker->name); shrinker->name = NULL; - if (!shrinker->debugfs_entry) - return; + if (entry) { + ida_free(&shrinker_debugfs_ida, shrinker->debugfs_id); + shrinker->debugfs_entry = NULL; + } - debugfs_remove_recursive(shrinker->debugfs_entry); - ida_free(&shrinker_debugfs_ida, shrinker->debugfs_id); + return entry; } static int __init shrinker_debugfs_init(void) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/swapfile.c +++ linux-oem-6.1-6.1.0/mm/swapfile.c @@ -1101,6 +1101,7 @@ goto check_out; pr_debug("scan_swap_map of si %d failed to find offset\n", si->type); + cond_resched(); spin_lock(&swap_avail_lock); nextsi: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/mm/vmscan.c +++ linux-oem-6.1-6.1.0/mm/vmscan.c @@ -740,6 +740,8 @@ */ void unregister_shrinker(struct shrinker *shrinker) { + struct dentry *debugfs_entry; + if (!(shrinker->flags & SHRINKER_REGISTERED)) return; @@ -748,9 +750,11 @@ shrinker->flags &= ~SHRINKER_REGISTERED; if (shrinker->flags & SHRINKER_MEMCG_AWARE) unregister_memcg_shrinker(shrinker); - shrinker_debugfs_remove(shrinker); + debugfs_entry = shrinker_debugfs_remove(shrinker); up_write(&shrinker_rwsem); + debugfs_remove_recursive(debugfs_entry); + kfree(shrinker->nr_deferred); shrinker->nr_deferred = NULL; } @@ -3290,13 +3294,16 @@ if (mem_cgroup_disabled()) return; + /* migration can happen before addition */ + if (!mm->lru_gen.memcg) + return; + rcu_read_lock(); memcg = mem_cgroup_from_task(task); rcu_read_unlock(); if (memcg == mm->lru_gen.memcg) return; - VM_WARN_ON_ONCE(!mm->lru_gen.memcg); VM_WARN_ON_ONCE(list_empty(&mm->lru_gen.list)); lru_gen_del_mm(mm); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/6lowpan.c +++ linux-oem-6.1-6.1.0/net/bluetooth/6lowpan.c @@ -441,7 +441,7 @@ iv.iov_len = skb->len; memset(&msg, 0, sizeof(msg)); - iov_iter_kvec(&msg.msg_iter, WRITE, &iv, 1, skb->len); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iv, 1, skb->len); err = l2cap_chan_send(chan, &msg, skb->len); if (err > 0) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/a2mp.c +++ linux-oem-6.1-6.1.0/net/bluetooth/a2mp.c @@ -56,7 +56,7 @@ memset(&msg, 0, sizeof(msg)); - iov_iter_kvec(&msg.msg_iter, WRITE, &iv, 1, total_len); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iv, 1, total_len); l2cap_chan_send(chan, &msg, total_len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/hci_event.c +++ linux-oem-6.1-6.1.0/net/bluetooth/hci_event.c @@ -3838,8 +3838,11 @@ conn->handle, conn->link); /* Create CIS if LE is already connected */ - if (conn->link && conn->link->state == BT_CONNECTED) + if (conn->link && conn->link->state == BT_CONNECTED) { + rcu_read_unlock(); hci_le_create_cis(conn->link); + rcu_read_lock(); + } if (i == rp->num_handles) break; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/iso.c +++ linux-oem-6.1-6.1.0/net/bluetooth/iso.c @@ -261,13 +261,13 @@ if (!bis_capable(hdev)) { err = -EOPNOTSUPP; - goto done; + goto unlock; } /* Fail if out PHYs are marked as disabled */ if (!iso_pi(sk)->qos.out.phy) { err = -EINVAL; - goto done; + goto unlock; } hcon = hci_connect_bis(hdev, &iso_pi(sk)->dst, iso_pi(sk)->dst_type, @@ -275,22 +275,27 @@ iso_pi(sk)->base); if (IS_ERR(hcon)) { err = PTR_ERR(hcon); - goto done; + goto unlock; } conn = iso_conn_add(hcon); if (!conn) { hci_conn_drop(hcon); err = -ENOMEM; - goto done; + goto unlock; } - /* Update source addr of the socket */ - bacpy(&iso_pi(sk)->src, &hcon->src); + hci_dev_unlock(hdev); + hci_dev_put(hdev); err = iso_chan_add(conn, sk, NULL); if (err) - goto done; + return err; + + lock_sock(sk); + + /* Update source addr of the socket */ + bacpy(&iso_pi(sk)->src, &hcon->src); if (hcon->state == BT_CONNECTED) { iso_sock_clear_timer(sk); @@ -300,7 +305,10 @@ iso_sock_set_timer(sk, sk->sk_sndtimeo); } -done: + release_sock(sk); + return err; + +unlock: hci_dev_unlock(hdev); hci_dev_put(hdev); return err; @@ -324,13 +332,13 @@ if (!cis_central_capable(hdev)) { err = -EOPNOTSUPP; - goto done; + goto unlock; } /* Fail if either PHYs are marked as disabled */ if (!iso_pi(sk)->qos.in.phy && !iso_pi(sk)->qos.out.phy) { err = -EINVAL; - goto done; + goto unlock; } /* Just bind if DEFER_SETUP has been set */ @@ -340,7 +348,7 @@ &iso_pi(sk)->qos); if (IS_ERR(hcon)) { err = PTR_ERR(hcon); - goto done; + goto unlock; } } else { hcon = hci_connect_cis(hdev, &iso_pi(sk)->dst, @@ -348,7 +356,7 @@ &iso_pi(sk)->qos); if (IS_ERR(hcon)) { err = PTR_ERR(hcon); - goto done; + goto unlock; } } @@ -356,15 +364,20 @@ if (!conn) { hci_conn_drop(hcon); err = -ENOMEM; - goto done; + goto unlock; } - /* Update source addr of the socket */ - bacpy(&iso_pi(sk)->src, &hcon->src); + hci_dev_unlock(hdev); + hci_dev_put(hdev); err = iso_chan_add(conn, sk, NULL); if (err) - goto done; + return err; + + lock_sock(sk); + + /* Update source addr of the socket */ + bacpy(&iso_pi(sk)->src, &hcon->src); if (hcon->state == BT_CONNECTED) { iso_sock_clear_timer(sk); @@ -377,7 +390,10 @@ iso_sock_set_timer(sk, sk->sk_sndtimeo); } -done: + release_sock(sk); + return err; + +unlock: hci_dev_unlock(hdev); hci_dev_put(hdev); return err; @@ -831,20 +847,23 @@ bacpy(&iso_pi(sk)->dst, &sa->iso_bdaddr); iso_pi(sk)->dst_type = sa->iso_bdaddr_type; + release_sock(sk); + if (bacmp(&iso_pi(sk)->dst, BDADDR_ANY)) err = iso_connect_cis(sk); else err = iso_connect_bis(sk); if (err) - goto done; + return err; + + lock_sock(sk); if (!test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) { err = bt_sock_wait_state(sk, BT_CONNECTED, sock_sndtimeo(sk, flags & O_NONBLOCK)); } -done: release_sock(sk); return err; } @@ -1099,28 +1118,22 @@ { struct sock *sk = sock->sk; struct iso_pinfo *pi = iso_pi(sk); - int err; BT_DBG("sk %p", sk); - lock_sock(sk); - if (test_and_clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) { switch (sk->sk_state) { case BT_CONNECT2: + lock_sock(sk); iso_conn_defer_accept(pi->conn->hcon); sk->sk_state = BT_CONFIG; release_sock(sk); return 0; case BT_CONNECT: - err = iso_connect_cis(sk); - release_sock(sk); - return err; + return iso_connect_cis(sk); } } - release_sock(sk); - return bt_sock_recvmsg(sock, msg, len, flags); } @@ -1415,33 +1428,29 @@ struct sock *parent; struct sock *sk = conn->sk; struct hci_ev_le_big_sync_estabilished *ev; + struct hci_conn *hcon; BT_DBG("conn %p", conn); if (sk) { iso_sock_ready(conn->sk); } else { - iso_conn_lock(conn); - - if (!conn->hcon) { - iso_conn_unlock(conn); + hcon = conn->hcon; + if (!hcon) return; - } - ev = hci_recv_event_data(conn->hcon->hdev, + ev = hci_recv_event_data(hcon->hdev, HCI_EVT_LE_BIG_SYNC_ESTABILISHED); if (ev) - parent = iso_get_sock_listen(&conn->hcon->src, - &conn->hcon->dst, + parent = iso_get_sock_listen(&hcon->src, + &hcon->dst, iso_match_big, ev); else - parent = iso_get_sock_listen(&conn->hcon->src, + parent = iso_get_sock_listen(&hcon->src, BDADDR_ANY, NULL, NULL); - if (!parent) { - iso_conn_unlock(conn); + if (!parent) return; - } lock_sock(parent); @@ -1449,30 +1458,29 @@ BTPROTO_ISO, GFP_ATOMIC, 0); if (!sk) { release_sock(parent); - iso_conn_unlock(conn); return; } iso_sock_init(sk, parent); - bacpy(&iso_pi(sk)->src, &conn->hcon->src); - iso_pi(sk)->src_type = conn->hcon->src_type; + bacpy(&iso_pi(sk)->src, &hcon->src); + iso_pi(sk)->src_type = hcon->src_type; /* If hcon has no destination address (BDADDR_ANY) it means it * was created by HCI_EV_LE_BIG_SYNC_ESTABILISHED so we need to * initialize using the parent socket destination address. */ - if (!bacmp(&conn->hcon->dst, BDADDR_ANY)) { - bacpy(&conn->hcon->dst, &iso_pi(parent)->dst); - conn->hcon->dst_type = iso_pi(parent)->dst_type; - conn->hcon->sync_handle = iso_pi(parent)->sync_handle; + if (!bacmp(&hcon->dst, BDADDR_ANY)) { + bacpy(&hcon->dst, &iso_pi(parent)->dst); + hcon->dst_type = iso_pi(parent)->dst_type; + hcon->sync_handle = iso_pi(parent)->sync_handle; } - bacpy(&iso_pi(sk)->dst, &conn->hcon->dst); - iso_pi(sk)->dst_type = conn->hcon->dst_type; + bacpy(&iso_pi(sk)->dst, &hcon->dst); + iso_pi(sk)->dst_type = hcon->dst_type; - hci_conn_hold(conn->hcon); - __iso_chan_add(conn, sk, parent); + hci_conn_hold(hcon); + iso_chan_add(conn, sk, parent); if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) sk->sk_state = BT_CONNECT2; @@ -1483,8 +1491,6 @@ parent->sk_data_ready(parent); release_sock(parent); - - iso_conn_unlock(conn); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/mgmt_util.h +++ linux-oem-6.1-6.1.0/net/bluetooth/mgmt_util.h @@ -27,7 +27,7 @@ struct sock *sk; u8 handle; u8 instance; - u8 param[sizeof(struct mgmt_cp_mesh_send) + 29]; + u8 param[sizeof(struct mgmt_cp_mesh_send) + 31]; }; struct mgmt_pending_cmd { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/rfcomm/sock.c +++ linux-oem-6.1-6.1.0/net/bluetooth/rfcomm/sock.c @@ -391,6 +391,7 @@ addr->sa_family != AF_BLUETOOTH) return -EINVAL; + sock_hold(sk); lock_sock(sk); if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) { @@ -410,14 +411,18 @@ d->sec_level = rfcomm_pi(sk)->sec_level; d->role_switch = rfcomm_pi(sk)->role_switch; + /* Drop sock lock to avoid potential deadlock with the RFCOMM lock */ + release_sock(sk); err = rfcomm_dlc_open(d, &rfcomm_pi(sk)->src, &sa->rc_bdaddr, sa->rc_channel); - if (!err) + lock_sock(sk); + if (!err && !sock_flag(sk, SOCK_ZAPPED)) err = bt_sock_wait_state(sk, BT_CONNECTED, sock_sndtimeo(sk, flags & O_NONBLOCK)); done: release_sock(sk); + sock_put(sk); return err; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bluetooth/smp.c +++ linux-oem-6.1-6.1.0/net/bluetooth/smp.c @@ -605,7 +605,7 @@ memset(&msg, 0, sizeof(msg)); - iov_iter_kvec(&msg.msg_iter, WRITE, iv, 2, 1 + len); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, iv, 2, 1 + len); l2cap_chan_send(chan, &msg, 1 + len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/bridge/br_netfilter_hooks.c +++ linux-oem-6.1-6.1.0/net/bridge/br_netfilter_hooks.c @@ -871,6 +871,7 @@ if (nf_bridge && !nf_bridge->in_prerouting && !netif_is_l3_master(skb->dev) && !netif_is_l3_slave(skb->dev)) { + nf_bridge_info_free(skb); state->okfn(state->net, state->sk, skb); return NF_STOLEN; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/can/isotp.c +++ linux-oem-6.1-6.1.0/net/can/isotp.c @@ -140,7 +140,7 @@ canid_t rxid; ktime_t tx_gap; ktime_t lastrxcf_tstamp; - struct hrtimer rxtimer, txtimer; + struct hrtimer rxtimer, txtimer, txfrtimer; struct can_isotp_options opt; struct can_isotp_fc_options rxfc, txfc; struct can_isotp_ll_options ll; @@ -871,7 +871,7 @@ } /* start timer to send next consecutive frame with correct delay */ - hrtimer_start(&so->txtimer, so->tx_gap, HRTIMER_MODE_REL_SOFT); + hrtimer_start(&so->txfrtimer, so->tx_gap, HRTIMER_MODE_REL_SOFT); } static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer) @@ -879,49 +879,39 @@ struct isotp_sock *so = container_of(hrtimer, struct isotp_sock, txtimer); struct sock *sk = &so->sk; - enum hrtimer_restart restart = HRTIMER_NORESTART; - switch (so->tx.state) { - case ISOTP_SENDING: - - /* cfecho should be consumed by isotp_rcv_echo() here */ - if (!so->cfecho) { - /* start timeout for unlikely lost echo skb */ - hrtimer_set_expires(&so->txtimer, - ktime_add(ktime_get(), - ktime_set(ISOTP_ECHO_TIMEOUT, 0))); - restart = HRTIMER_RESTART; + /* don't handle timeouts in IDLE state */ + if (so->tx.state == ISOTP_IDLE) + return HRTIMER_NORESTART; - /* push out the next consecutive frame */ - isotp_send_cframe(so); - break; - } + /* we did not get any flow control or echo frame in time */ - /* cfecho has not been cleared in isotp_rcv_echo() */ - pr_notice_once("can-isotp: cfecho %08X timeout\n", so->cfecho); - fallthrough; + /* report 'communication error on send' */ + sk->sk_err = ECOMM; + if (!sock_flag(sk, SOCK_DEAD)) + sk_error_report(sk); - case ISOTP_WAIT_FC: - case ISOTP_WAIT_FIRST_FC: + /* reset tx state */ + so->tx.state = ISOTP_IDLE; + wake_up_interruptible(&so->wait); - /* we did not get any flow control frame in time */ + return HRTIMER_NORESTART; +} - /* report 'communication error on send' */ - sk->sk_err = ECOMM; - if (!sock_flag(sk, SOCK_DEAD)) - sk_error_report(sk); +static enum hrtimer_restart isotp_txfr_timer_handler(struct hrtimer *hrtimer) +{ + struct isotp_sock *so = container_of(hrtimer, struct isotp_sock, + txfrtimer); - /* reset tx state */ - so->tx.state = ISOTP_IDLE; - wake_up_interruptible(&so->wait); - break; + /* start echo timeout handling and cover below protocol error */ + hrtimer_start(&so->txtimer, ktime_set(ISOTP_ECHO_TIMEOUT, 0), + HRTIMER_MODE_REL_SOFT); - default: - WARN_ONCE(1, "can-isotp: tx timer state %08X cfecho %08X\n", - so->tx.state, so->cfecho); - } + /* cfecho should be consumed by isotp_rcv_echo() here */ + if (so->tx.state == ISOTP_SENDING && !so->cfecho) + isotp_send_cframe(so); - return restart; + return HRTIMER_NORESTART; } static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) @@ -1162,6 +1152,10 @@ /* wait for complete transmission of current pdu */ wait_event_interruptible(so->wait, so->tx.state == ISOTP_IDLE); + /* force state machines to be idle also when a signal occurred */ + so->tx.state = ISOTP_IDLE; + so->rx.state = ISOTP_IDLE; + spin_lock(&isotp_notifier_lock); while (isotp_busy_notifier == so) { spin_unlock(&isotp_notifier_lock); @@ -1194,6 +1188,7 @@ } } + hrtimer_cancel(&so->txfrtimer); hrtimer_cancel(&so->txtimer); hrtimer_cancel(&so->rxtimer); @@ -1597,6 +1592,8 @@ so->rxtimer.function = isotp_rx_timer_handler; hrtimer_init(&so->txtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT); so->txtimer.function = isotp_tx_timer_handler; + hrtimer_init(&so->txfrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT); + so->txfrtimer.function = isotp_txfr_timer_handler; init_waitqueue_head(&so->wait); spin_lock_init(&so->rx_lock); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/can/j1939/address-claim.c +++ linux-oem-6.1-6.1.0/net/can/j1939/address-claim.c @@ -165,6 +165,46 @@ * leaving this function. */ ecu = j1939_ecu_get_by_name_locked(priv, name); + + if (ecu && ecu->addr == skcb->addr.sa) { + /* The ISO 11783-5 standard, in "4.5.2 - Address claim + * requirements", states: + * d) No CF shall begin, or resume, transmission on the + * network until 250 ms after it has successfully claimed + * an address except when responding to a request for + * address-claimed. + * + * But "Figure 6" and "Figure 7" in "4.5.4.2 - Address-claim + * prioritization" show that the CF begins the transmission + * after 250 ms from the first AC (address-claimed) message + * even if it sends another AC message during that time window + * to resolve the address contention with another CF. + * + * As stated in "4.4.2.3 - Address-claimed message": + * In order to successfully claim an address, the CF sending + * an address claimed message shall not receive a contending + * claim from another CF for at least 250 ms. + * + * As stated in "4.4.3.2 - NAME management (NM) message": + * 1) A commanding CF can + * d) request that a CF with a specified NAME transmit + * the address-claimed message with its current NAME. + * 2) A target CF shall + * d) send an address-claimed message in response to a + * request for a matching NAME + * + * Taking the above arguments into account, the 250 ms wait is + * requested only during network initialization. + * + * Do not restart the timer on AC message if both the NAME and + * the address match and so if the address has already been + * claimed (timer has expired) or the AC message has been sent + * to resolve the contention with another CF (timer is still + * running). + */ + goto out_ecu_put; + } + if (!ecu && j1939_address_is_unicast(skcb->addr.sa)) ecu = j1939_ecu_create_locked(priv, name); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/can/j1939/transport.c +++ linux-oem-6.1-6.1.0/net/can/j1939/transport.c @@ -1092,10 +1092,6 @@ bool active; j1939_session_list_lock(priv); - /* This function should be called with a session ref-count of at - * least 2. - */ - WARN_ON_ONCE(kref_read(&session->kref) < 2); active = j1939_session_deactivate_locked(session); j1939_session_list_unlock(priv); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/can/raw.c +++ linux-oem-6.1-6.1.0/net/can/raw.c @@ -132,8 +132,8 @@ return; /* make sure to not pass oversized frames to the socket */ - if ((can_is_canfd_skb(oskb) && !ro->fd_frames && !ro->xl_frames) || - (can_is_canxl_skb(oskb) && !ro->xl_frames)) + if ((!ro->fd_frames && can_is_canfd_skb(oskb)) || + (!ro->xl_frames && can_is_canxl_skb(oskb))) return; /* eliminate multiple filter matches for the same skb */ @@ -670,6 +670,11 @@ if (copy_from_sockptr(&ro->fd_frames, optval, optlen)) return -EFAULT; + /* Enabling CAN XL includes CAN FD */ + if (ro->xl_frames && !ro->fd_frames) { + ro->fd_frames = ro->xl_frames; + return -EINVAL; + } break; case CAN_RAW_XL_FRAMES: @@ -679,6 +684,9 @@ if (copy_from_sockptr(&ro->xl_frames, optval, optlen)) return -EFAULT; + /* Enabling CAN XL includes CAN FD */ + if (ro->xl_frames) + ro->fd_frames = ro->xl_frames; break; case CAN_RAW_JOIN_FILTERS: @@ -786,6 +794,25 @@ return 0; } +static bool raw_bad_txframe(struct raw_sock *ro, struct sk_buff *skb, int mtu) +{ + /* Classical CAN -> no checks for flags and device capabilities */ + if (can_is_can_skb(skb)) + return false; + + /* CAN FD -> needs to be enabled and a CAN FD or CAN XL device */ + if (ro->fd_frames && can_is_canfd_skb(skb) && + (mtu == CANFD_MTU || can_is_canxl_dev_mtu(mtu))) + return false; + + /* CAN XL -> needs to be enabled and a CAN XL device */ + if (ro->xl_frames && can_is_canxl_skb(skb) && + can_is_canxl_dev_mtu(mtu)) + return false; + + return true; +} + static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) { struct sock *sk = sock->sk; @@ -833,20 +860,8 @@ goto free_skb; err = -EINVAL; - if (ro->xl_frames && can_is_canxl_dev_mtu(dev->mtu)) { - /* CAN XL, CAN FD and Classical CAN */ - if (!can_is_canxl_skb(skb) && !can_is_canfd_skb(skb) && - !can_is_can_skb(skb)) - goto free_skb; - } else if (ro->fd_frames && dev->mtu == CANFD_MTU) { - /* CAN FD and Classical CAN */ - if (!can_is_canfd_skb(skb) && !can_is_can_skb(skb)) - goto free_skb; - } else { - /* Classical CAN */ - if (!can_is_can_skb(skb)) - goto free_skb; - } + if (raw_bad_txframe(ro, skb, dev->mtu)) + goto free_skb; sockcm_init(&sockc, sk); if (msg->msg_controllen) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ceph/messenger_v1.c +++ linux-oem-6.1-6.1.0/net/ceph/messenger_v1.c @@ -30,7 +30,7 @@ if (!buf) msg.msg_flags |= MSG_TRUNC; - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, len); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, len); r = sock_recvmsg(sock, &msg, msg.msg_flags); if (r == -EAGAIN) r = 0; @@ -49,7 +49,7 @@ int r; BUG_ON(page_offset + length > PAGE_SIZE); - iov_iter_bvec(&msg.msg_iter, READ, &bvec, 1, length); + iov_iter_bvec(&msg.msg_iter, ITER_DEST, &bvec, 1, length); r = sock_recvmsg(sock, &msg, msg.msg_flags); if (r == -EAGAIN) r = 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ceph/messenger_v2.c +++ linux-oem-6.1-6.1.0/net/ceph/messenger_v2.c @@ -168,7 +168,7 @@ bv.bv_offset, bv.bv_len, CEPH_MSG_FLAGS); } else { - iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, bv.bv_len); + iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bv, 1, bv.bv_len); ret = sock_sendmsg(sock, &msg); } if (ret <= 0) { @@ -225,7 +225,7 @@ WARN_ON(iov_iter_count(&con->v2.in_iter)); con->v2.in_kvec_cnt = 0; - iov_iter_kvec(&con->v2.in_iter, READ, con->v2.in_kvecs, 0, 0); + iov_iter_kvec(&con->v2.in_iter, ITER_DEST, con->v2.in_kvecs, 0, 0); } static void set_in_bvec(struct ceph_connection *con, const struct bio_vec *bv) @@ -233,7 +233,7 @@ WARN_ON(iov_iter_count(&con->v2.in_iter)); con->v2.in_bvec = *bv; - iov_iter_bvec(&con->v2.in_iter, READ, &con->v2.in_bvec, 1, bv->bv_len); + iov_iter_bvec(&con->v2.in_iter, ITER_DEST, &con->v2.in_bvec, 1, bv->bv_len); } static void set_in_skip(struct ceph_connection *con, int len) @@ -241,7 +241,7 @@ WARN_ON(iov_iter_count(&con->v2.in_iter)); dout("%s con %p len %d\n", __func__, con, len); - iov_iter_discard(&con->v2.in_iter, READ, len); + iov_iter_discard(&con->v2.in_iter, ITER_DEST, len); } static void add_out_kvec(struct ceph_connection *con, void *buf, int len) @@ -265,7 +265,7 @@ con->v2.out_kvec_cnt = 0; - iov_iter_kvec(&con->v2.out_iter, WRITE, con->v2.out_kvecs, 0, 0); + iov_iter_kvec(&con->v2.out_iter, ITER_SOURCE, con->v2.out_kvecs, 0, 0); con->v2.out_iter_sendpage = false; } @@ -277,7 +277,7 @@ con->v2.out_bvec = *bv; con->v2.out_iter_sendpage = zerocopy; - iov_iter_bvec(&con->v2.out_iter, WRITE, &con->v2.out_bvec, 1, + iov_iter_bvec(&con->v2.out_iter, ITER_SOURCE, &con->v2.out_bvec, 1, con->v2.out_bvec.bv_len); } @@ -290,7 +290,7 @@ con->v2.out_bvec.bv_offset = 0; con->v2.out_bvec.bv_len = min(con->v2.out_zero, (int)PAGE_SIZE); con->v2.out_iter_sendpage = true; - iov_iter_bvec(&con->v2.out_iter, WRITE, &con->v2.out_bvec, 1, + iov_iter_bvec(&con->v2.out_iter, ITER_SOURCE, &con->v2.out_bvec, 1, con->v2.out_bvec.bv_len); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/compat.c +++ linux-oem-6.1-6.1.0/net/compat.c @@ -95,7 +95,8 @@ if (err) return err; - err = import_iovec(save_addr ? READ : WRITE, compat_ptr(msg.msg_iov), msg.msg_iovlen, + err = import_iovec(save_addr ? ITER_DEST : ITER_SOURCE, + compat_ptr(msg.msg_iov), msg.msg_iovlen, UIO_FASTIOV, iov, &kmsg->msg_iter); return err < 0 ? err : 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/core/gro.c +++ linux-oem-6.1-6.1.0/net/core/gro.c @@ -162,6 +162,15 @@ struct sk_buff *lp; int segs; + /* Do not splice page pool based packets w/ non-page pool + * packets. This can result in reference count issues as page + * pool pages will not decrement the reference count and will + * instead be immediately returned to the pool or have frag + * count decremented. + */ + if (p->pp_recycle != skb->pp_recycle) + return -ETOOMANYREFS; + /* pairs with WRITE_ONCE() in netif_set_gro_max_size() */ gro_max_size = READ_ONCE(p->dev->gro_max_size); @@ -489,45 +498,46 @@ rcu_read_lock(); list_for_each_entry_rcu(ptype, head, list) { - if (ptype->type != type || !ptype->callbacks.gro_receive) - continue; - - skb_set_network_header(skb, skb_gro_offset(skb)); - skb_reset_mac_len(skb); - BUILD_BUG_ON(sizeof_field(struct napi_gro_cb, zeroed) != sizeof(u32)); - BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct napi_gro_cb, zeroed), - sizeof(u32))); /* Avoid slow unaligned acc */ - *(u32 *)&NAPI_GRO_CB(skb)->zeroed = 0; - NAPI_GRO_CB(skb)->flush = skb_has_frag_list(skb); - NAPI_GRO_CB(skb)->is_atomic = 1; - NAPI_GRO_CB(skb)->count = 1; - if (unlikely(skb_is_gso(skb))) { - NAPI_GRO_CB(skb)->count = skb_shinfo(skb)->gso_segs; - /* Only support TCP at the moment. */ - if (!skb_is_gso_tcp(skb)) - NAPI_GRO_CB(skb)->flush = 1; - } - - /* Setup for GRO checksum validation */ - switch (skb->ip_summed) { - case CHECKSUM_COMPLETE: - NAPI_GRO_CB(skb)->csum = skb->csum; - NAPI_GRO_CB(skb)->csum_valid = 1; - break; - case CHECKSUM_UNNECESSARY: - NAPI_GRO_CB(skb)->csum_cnt = skb->csum_level + 1; - break; - } + if (ptype->type == type && ptype->callbacks.gro_receive) + goto found_ptype; + } + rcu_read_unlock(); + goto normal; - pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive, - ipv6_gro_receive, inet_gro_receive, - &gro_list->list, skb); +found_ptype: + skb_set_network_header(skb, skb_gro_offset(skb)); + skb_reset_mac_len(skb); + BUILD_BUG_ON(sizeof_field(struct napi_gro_cb, zeroed) != sizeof(u32)); + BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct napi_gro_cb, zeroed), + sizeof(u32))); /* Avoid slow unaligned acc */ + *(u32 *)&NAPI_GRO_CB(skb)->zeroed = 0; + NAPI_GRO_CB(skb)->flush = skb_has_frag_list(skb); + NAPI_GRO_CB(skb)->is_atomic = 1; + NAPI_GRO_CB(skb)->count = 1; + if (unlikely(skb_is_gso(skb))) { + NAPI_GRO_CB(skb)->count = skb_shinfo(skb)->gso_segs; + /* Only support TCP and non DODGY users. */ + if (!skb_is_gso_tcp(skb) || + (skb_shinfo(skb)->gso_type & SKB_GSO_DODGY)) + NAPI_GRO_CB(skb)->flush = 1; + } + + /* Setup for GRO checksum validation */ + switch (skb->ip_summed) { + case CHECKSUM_COMPLETE: + NAPI_GRO_CB(skb)->csum = skb->csum; + NAPI_GRO_CB(skb)->csum_valid = 1; + break; + case CHECKSUM_UNNECESSARY: + NAPI_GRO_CB(skb)->csum_cnt = skb->csum_level + 1; break; } - rcu_read_unlock(); - if (&ptype->list == head) - goto normal; + pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive, + ipv6_gro_receive, inet_gro_receive, + &gro_list->list, skb); + + rcu_read_unlock(); if (PTR_ERR(pp) == -EINPROGRESS) { ret = GRO_CONSUMED; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/core/net_namespace.c +++ linux-oem-6.1-6.1.0/net/core/net_namespace.c @@ -137,12 +137,12 @@ return 0; if (ops->id && ops->size) { -cleanup: ng = rcu_dereference_protected(net->gen, lockdep_is_held(&pernet_ops_rwsem)); ng->ptr[*ops->id] = NULL; } +cleanup: kfree(data); out: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/dccp/ipv6.c +++ linux-oem-6.1-6.1.0/net/dccp/ipv6.c @@ -551,11 +551,9 @@ *own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash), NULL); /* Clone pktoptions received with SYN, if we own the req */ if (*own_req && ireq->pktopts) { - newnp->pktoptions = skb_clone(ireq->pktopts, GFP_ATOMIC); + newnp->pktoptions = skb_clone_and_charge_r(ireq->pktopts, newsk); consume_skb(ireq->pktopts); ireq->pktopts = NULL; - if (newnp->pktoptions) - skb_set_owner_r(newnp->pktoptions, newsk); } return newsk; @@ -615,7 +613,7 @@ --ANK (980728) */ if (np->rxopt.all) - opt_skb = skb_clone(skb, GFP_ATOMIC); + opt_skb = skb_clone_and_charge_r(skb, sk); if (sk->sk_state == DCCP_OPEN) { /* Fast path */ if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len)) @@ -679,7 +677,6 @@ np->flow_label = ip6_flowlabel(ipv6_hdr(opt_skb)); if (ipv6_opt_accepted(sk, opt_skb, &DCCP_SKB_CB(opt_skb)->header.h6)) { - skb_set_owner_r(opt_skb, sk); memmove(IP6CB(opt_skb), &DCCP_SKB_CB(opt_skb)->header.h6, sizeof(struct inet6_skb_parm)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv4/fib_semantics.c +++ linux-oem-6.1-6.1.0/net/ipv4/fib_semantics.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1022,6 +1023,7 @@ if (type > RTAX_MAX) return false; + type = array_index_nospec(type, RTAX_MAX + 1); if (type == RTAX_CC_ALGO) { char tmp[TCP_CA_NAME_MAX]; bool ecn_ca = false; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv4/metrics.c +++ linux-oem-6.1-6.1.0/net/ipv4/metrics.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only #include +#include #include #include #include @@ -28,6 +29,7 @@ return -EINVAL; } + type = array_index_nospec(type, RTAX_MAX + 1); if (type == RTAX_CC_ALGO) { char tmp[TCP_CA_NAME_MAX]; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv4/tcp.c +++ linux-oem-6.1-6.1.0/net/ipv4/tcp.c @@ -435,6 +435,7 @@ /* There's a bubble in the pipe until at least the first ACK. */ tp->app_limited = ~0U; + tp->rate_app_limited = 1; /* See draft-stevens-tcpca-spec-01 for discussion of the * initialization of these values. @@ -2000,7 +2001,7 @@ if (copy_address != zc->copybuf_address) return -EINVAL; - err = import_single_range(READ, (void __user *)copy_address, + err = import_single_range(ITER_DEST, (void __user *)copy_address, inq, &iov, &msg.msg_iter); if (err) return err; @@ -2034,7 +2035,7 @@ if (copy_address != zc->copybuf_address) return -EINVAL; - err = import_single_range(READ, (void __user *)copy_address, + err = import_single_range(ITER_DEST, (void __user *)copy_address, copylen, &iov, &msg.msg_iter); if (err) return err; @@ -3177,6 +3178,7 @@ tp->last_oow_ack_time = 0; /* There's a bubble in the pipe until at least the first ACK. */ tp->app_limited = ~0U; + tp->rate_app_limited = 1; tp->rack.mstamp = 0; tp->rack.advanced = 0; tp->rack.reo_wnd_steps = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv6/addrconf.c +++ linux-oem-6.1-6.1.0/net/ipv6/addrconf.c @@ -3127,17 +3127,17 @@ offset = sizeof(struct in6_addr) - 4; memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4); - if (idev->dev->flags&IFF_POINTOPOINT) { + if (!(idev->dev->flags & IFF_POINTOPOINT) && idev->dev->type == ARPHRD_SIT) { + scope = IPV6_ADDR_COMPATv4; + plen = 96; + pflags |= RTF_NONEXTHOP; + } else { if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE) return; addr.s6_addr32[0] = htonl(0xfe800000); scope = IFA_LINK; plen = 64; - } else { - scope = IPV6_ADDR_COMPATv4; - plen = 96; - pflags |= RTF_NONEXTHOP; } if (addr.s6_addr32[3]) { @@ -3447,6 +3447,30 @@ } #endif +static void addrconf_init_auto_addrs(struct net_device *dev) +{ + switch (dev->type) { +#if IS_ENABLED(CONFIG_IPV6_SIT) + case ARPHRD_SIT: + addrconf_sit_config(dev); + break; +#endif +#if IS_ENABLED(CONFIG_NET_IPGRE) || IS_ENABLED(CONFIG_IPV6_GRE) + case ARPHRD_IP6GRE: + case ARPHRD_IPGRE: + addrconf_gre_config(dev); + break; +#endif + case ARPHRD_LOOPBACK: + init_loopback(dev); + break; + + default: + addrconf_dev_config(dev); + break; + } +} + static int fixup_permanent_addr(struct net *net, struct inet6_dev *idev, struct inet6_ifaddr *ifp) @@ -3615,26 +3639,7 @@ run_pending = 1; } - switch (dev->type) { -#if IS_ENABLED(CONFIG_IPV6_SIT) - case ARPHRD_SIT: - addrconf_sit_config(dev); - break; -#endif -#if IS_ENABLED(CONFIG_NET_IPGRE) || IS_ENABLED(CONFIG_IPV6_GRE) - case ARPHRD_IP6GRE: - case ARPHRD_IPGRE: - addrconf_gre_config(dev); - break; -#endif - case ARPHRD_LOOPBACK: - init_loopback(dev); - break; - - default: - addrconf_dev_config(dev); - break; - } + addrconf_init_auto_addrs(dev); if (!IS_ERR_OR_NULL(idev)) { if (run_pending) @@ -6397,7 +6402,7 @@ if (idev->cnf.addr_gen_mode != new_val) { idev->cnf.addr_gen_mode = new_val; - addrconf_dev_config(idev->dev); + addrconf_init_auto_addrs(idev->dev); } } else if (&net->ipv6.devconf_all->addr_gen_mode == ctl->data) { struct net_device *dev; @@ -6408,7 +6413,7 @@ if (idev && idev->cnf.addr_gen_mode != new_val) { idev->cnf.addr_gen_mode = new_val; - addrconf_dev_config(idev->dev); + addrconf_init_auto_addrs(idev->dev); } } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv6/raw.c +++ linux-oem-6.1-6.1.0/net/ipv6/raw.c @@ -505,6 +505,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, struct raw6_sock *rp) { + struct ipv6_txoptions *opt; struct sk_buff *skb; int err = 0; int offset; @@ -522,6 +523,9 @@ offset = rp->offset; total_len = inet_sk(sk)->cork.base.length; + opt = inet6_sk(sk)->cork.opt; + total_len -= opt ? opt->opt_flen : 0; + if (offset >= total_len - 1) { err = -EINVAL; ip6_flush_pending_frames(sk); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/ipv6/tcp_ipv6.c +++ linux-oem-6.1-6.1.0/net/ipv6/tcp_ipv6.c @@ -272,6 +272,7 @@ fl6.flowi6_proto = IPPROTO_TCP; fl6.daddr = sk->sk_v6_daddr; fl6.saddr = saddr ? *saddr : np->saddr; + fl6.flowlabel = ip6_make_flowinfo(np->tclass, np->flow_label); fl6.flowi6_oif = sk->sk_bound_dev_if; fl6.flowi6_mark = sk->sk_mark; fl6.fl6_dport = usin->sin6_port; @@ -1388,14 +1389,11 @@ /* Clone pktoptions received with SYN, if we own the req */ if (ireq->pktopts) { - newnp->pktoptions = skb_clone(ireq->pktopts, - sk_gfp_mask(sk, GFP_ATOMIC)); + newnp->pktoptions = skb_clone_and_charge_r(ireq->pktopts, newsk); consume_skb(ireq->pktopts); ireq->pktopts = NULL; - if (newnp->pktoptions) { + if (newnp->pktoptions) tcp_v6_restore_cb(newnp->pktoptions); - skb_set_owner_r(newnp->pktoptions, newsk); - } } } else { if (!req_unhash && found_dup_sk) { @@ -1467,7 +1465,7 @@ --ANK (980728) */ if (np->rxopt.all) - opt_skb = skb_clone(skb, sk_gfp_mask(sk, GFP_ATOMIC)); + opt_skb = skb_clone_and_charge_r(skb, sk); reason = SKB_DROP_REASON_NOT_SPECIFIED; if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ @@ -1553,7 +1551,6 @@ if (np->repflow) np->flow_label = ip6_flowlabel(ipv6_hdr(opt_skb)); if (ipv6_opt_accepted(sk, opt_skb, &TCP_SKB_CB(opt_skb)->header.h6)) { - skb_set_owner_r(opt_skb, sk); tcp_v6_restore_cb(opt_skb); opt_skb = xchg(&np->pktoptions, opt_skb); } else { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/l2tp/l2tp_core.c +++ linux-oem-6.1-6.1.0/net/l2tp/l2tp_core.c @@ -104,9 +104,9 @@ /* per-net private data for this module */ static unsigned int l2tp_net_id; struct l2tp_net { - struct list_head l2tp_tunnel_list; - /* Lock for write access to l2tp_tunnel_list */ - spinlock_t l2tp_tunnel_list_lock; + /* Lock for write access to l2tp_tunnel_idr */ + spinlock_t l2tp_tunnel_idr_lock; + struct idr l2tp_tunnel_idr; struct hlist_head l2tp_session_hlist[L2TP_HASH_SIZE_2]; /* Lock for write access to l2tp_session_hlist */ spinlock_t l2tp_session_hlist_lock; @@ -208,13 +208,10 @@ struct l2tp_tunnel *tunnel; rcu_read_lock_bh(); - list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) { - if (tunnel->tunnel_id == tunnel_id && - refcount_inc_not_zero(&tunnel->ref_count)) { - rcu_read_unlock_bh(); - - return tunnel; - } + tunnel = idr_find(&pn->l2tp_tunnel_idr, tunnel_id); + if (tunnel && refcount_inc_not_zero(&tunnel->ref_count)) { + rcu_read_unlock_bh(); + return tunnel; } rcu_read_unlock_bh(); @@ -224,13 +221,14 @@ struct l2tp_tunnel *l2tp_tunnel_get_nth(const struct net *net, int nth) { - const struct l2tp_net *pn = l2tp_pernet(net); + struct l2tp_net *pn = l2tp_pernet(net); + unsigned long tunnel_id, tmp; struct l2tp_tunnel *tunnel; int count = 0; rcu_read_lock_bh(); - list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) { - if (++count > nth && + idr_for_each_entry_ul(&pn->l2tp_tunnel_idr, tunnel, tmp, tunnel_id) { + if (tunnel && ++count > nth && refcount_inc_not_zero(&tunnel->ref_count)) { rcu_read_unlock_bh(); return tunnel; @@ -1043,7 +1041,7 @@ IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | IPSKB_REROUTED); nf_reset_ct(skb); - bh_lock_sock(sk); + bh_lock_sock_nested(sk); if (sock_owned_by_user(sk)) { kfree_skb(skb); ret = NET_XMIT_DROP; @@ -1227,6 +1225,15 @@ l2tp_tunnel_delete(tunnel); } +static void l2tp_tunnel_remove(struct net *net, struct l2tp_tunnel *tunnel) +{ + struct l2tp_net *pn = l2tp_pernet(net); + + spin_lock_bh(&pn->l2tp_tunnel_idr_lock); + idr_remove(&pn->l2tp_tunnel_idr, tunnel->tunnel_id); + spin_unlock_bh(&pn->l2tp_tunnel_idr_lock); +} + /* Workqueue tunnel deletion function */ static void l2tp_tunnel_del_work(struct work_struct *work) { @@ -1234,7 +1241,6 @@ del_work); struct sock *sk = tunnel->sock; struct socket *sock = sk->sk_socket; - struct l2tp_net *pn; l2tp_tunnel_closeall(tunnel); @@ -1248,12 +1254,7 @@ } } - /* Remove the tunnel struct from the tunnel list */ - pn = l2tp_pernet(tunnel->l2tp_net); - spin_lock_bh(&pn->l2tp_tunnel_list_lock); - list_del_rcu(&tunnel->list); - spin_unlock_bh(&pn->l2tp_tunnel_list_lock); - + l2tp_tunnel_remove(tunnel->l2tp_net, tunnel); /* drop initial ref */ l2tp_tunnel_dec_refcount(tunnel); @@ -1384,8 +1385,6 @@ return err; } -static struct lock_class_key l2tp_socket_class; - int l2tp_tunnel_create(int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp) { @@ -1455,12 +1454,19 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, struct l2tp_tunnel_cfg *cfg) { - struct l2tp_tunnel *tunnel_walk; - struct l2tp_net *pn; + struct l2tp_net *pn = l2tp_pernet(net); + u32 tunnel_id = tunnel->tunnel_id; struct socket *sock; struct sock *sk; int ret; + spin_lock_bh(&pn->l2tp_tunnel_idr_lock); + ret = idr_alloc_u32(&pn->l2tp_tunnel_idr, NULL, &tunnel_id, tunnel_id, + GFP_ATOMIC); + spin_unlock_bh(&pn->l2tp_tunnel_idr_lock); + if (ret) + return ret == -ENOSPC ? -EEXIST : ret; + if (tunnel->fd < 0) { ret = l2tp_tunnel_sock_create(net, tunnel->tunnel_id, tunnel->peer_tunnel_id, cfg, @@ -1474,6 +1480,7 @@ } sk = sock->sk; + lock_sock(sk); write_lock_bh(&sk->sk_callback_lock); ret = l2tp_validate_socket(sk, net, tunnel->encap); if (ret < 0) @@ -1481,24 +1488,6 @@ rcu_assign_sk_user_data(sk, tunnel); write_unlock_bh(&sk->sk_callback_lock); - tunnel->l2tp_net = net; - pn = l2tp_pernet(net); - - sock_hold(sk); - tunnel->sock = sk; - - spin_lock_bh(&pn->l2tp_tunnel_list_lock); - list_for_each_entry(tunnel_walk, &pn->l2tp_tunnel_list, list) { - if (tunnel_walk->tunnel_id == tunnel->tunnel_id) { - spin_unlock_bh(&pn->l2tp_tunnel_list_lock); - sock_put(sk); - ret = -EEXIST; - goto err_sock; - } - } - list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list); - spin_unlock_bh(&pn->l2tp_tunnel_list_lock); - if (tunnel->encap == L2TP_ENCAPTYPE_UDP) { struct udp_tunnel_sock_cfg udp_cfg = { .sk_user_data = tunnel, @@ -1512,9 +1501,16 @@ tunnel->old_sk_destruct = sk->sk_destruct; sk->sk_destruct = &l2tp_tunnel_destruct; - lockdep_set_class_and_name(&sk->sk_lock.slock, &l2tp_socket_class, - "l2tp_sock"); sk->sk_allocation = GFP_ATOMIC; + release_sock(sk); + + sock_hold(sk); + tunnel->sock = sk; + tunnel->l2tp_net = net; + + spin_lock_bh(&pn->l2tp_tunnel_idr_lock); + idr_replace(&pn->l2tp_tunnel_idr, tunnel, tunnel->tunnel_id); + spin_unlock_bh(&pn->l2tp_tunnel_idr_lock); trace_register_tunnel(tunnel); @@ -1523,17 +1519,16 @@ return 0; -err_sock: - write_lock_bh(&sk->sk_callback_lock); - rcu_assign_sk_user_data(sk, NULL); err_inval_sock: write_unlock_bh(&sk->sk_callback_lock); + release_sock(sk); if (tunnel->fd < 0) sock_release(sock); else sockfd_put(sock); err: + l2tp_tunnel_remove(net, tunnel); return ret; } EXPORT_SYMBOL_GPL(l2tp_tunnel_register); @@ -1647,8 +1642,8 @@ struct l2tp_net *pn = net_generic(net, l2tp_net_id); int hash; - INIT_LIST_HEAD(&pn->l2tp_tunnel_list); - spin_lock_init(&pn->l2tp_tunnel_list_lock); + idr_init(&pn->l2tp_tunnel_idr); + spin_lock_init(&pn->l2tp_tunnel_idr_lock); for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++) INIT_HLIST_HEAD(&pn->l2tp_session_hlist[hash]); @@ -1662,11 +1657,13 @@ { struct l2tp_net *pn = l2tp_pernet(net); struct l2tp_tunnel *tunnel = NULL; + unsigned long tunnel_id, tmp; int hash; rcu_read_lock_bh(); - list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) { - l2tp_tunnel_delete(tunnel); + idr_for_each_entry_ul(&pn->l2tp_tunnel_idr, tunnel, tmp, tunnel_id) { + if (tunnel) + l2tp_tunnel_delete(tunnel); } rcu_read_unlock_bh(); @@ -1676,6 +1673,7 @@ for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++) WARN_ON_ONCE(!hlist_empty(&pn->l2tp_session_hlist[hash])); + idr_destroy(&pn->l2tp_tunnel_idr); } static struct pernet_operations l2tp_net_ops = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/agg-tx.c +++ linux-oem-6.1-6.1.0/net/mac80211/agg-tx.c @@ -491,7 +491,7 @@ { struct tid_ampdu_tx *tid_tx; struct ieee80211_local *local = sta->local; - struct ieee80211_sub_if_data *sdata = sta->sdata; + struct ieee80211_sub_if_data *sdata; struct ieee80211_ampdu_params params = { .sta = &sta->sta, .action = IEEE80211_AMPDU_TX_START, @@ -511,8 +511,6 @@ */ clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); - ieee80211_agg_stop_txq(sta, tid); - /* * Make sure no packets are being processed. This ensures that * we have a valid starting sequence number and that in-flight @@ -521,6 +519,7 @@ */ synchronize_net(); + sdata = sta->sdata; params.ssn = sta->tid_seq[tid] >> 4; ret = drv_ampdu_action(local, sdata, ¶ms); tid_tx->ssn = params.ssn; @@ -534,6 +533,9 @@ */ set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state); } else if (ret) { + if (!sdata) + return; + ht_dbg(sdata, "BA request denied - HW unavailable for %pM tid %d\n", sta->sta.addr, tid); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/debugfs_sta.c +++ linux-oem-6.1-6.1.0/net/mac80211/debugfs_sta.c @@ -167,7 +167,7 @@ continue; txqi = to_txq_info(sta->sta.txq[i]); p += scnprintf(p, bufsz + buf - p, - "%d %d %u %u %u %u %u %u %u %u %u 0x%lx(%s%s%s)\n", + "%d %d %u %u %u %u %u %u %u %u %u 0x%lx(%s%s%s%s)\n", txqi->txq.tid, txqi->txq.ac, txqi->tin.backlog_bytes, @@ -182,7 +182,8 @@ txqi->flags, test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ? "STOP" : "RUN", test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags) ? " AMPDU" : "", - test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags) ? " NO-AMSDU" : ""); + test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags) ? " NO-AMSDU" : "", + test_bit(IEEE80211_TXQ_DIRTY, &txqi->flags) ? " DIRTY" : ""); } rcu_read_unlock(); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/driver-ops.c +++ linux-oem-6.1-6.1.0/net/mac80211/driver-ops.c @@ -391,6 +391,9 @@ might_sleep(); + if (!sdata) + return -EIO; + sdata = get_bss_sdata(sdata); if (!check_sdata_in_driver(sdata)) return -EIO; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/driver-ops.h +++ linux-oem-6.1-6.1.0/net/mac80211/driver-ops.h @@ -1183,7 +1183,7 @@ /* In reconfig don't transmit now, but mark for waking later */ if (local->in_reconfig) { - set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txq->flags); + set_bit(IEEE80211_TXQ_DIRTY, &txq->flags); return; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/ht.c +++ linux-oem-6.1-6.1.0/net/mac80211/ht.c @@ -391,6 +391,43 @@ tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; if (!blocked && tid_tx) { + struct ieee80211_sub_if_data *sdata = sta->sdata; + struct ieee80211_local *local = sdata->local; + + if (local->ops->wake_tx_queue) { + struct txq_info *txqi = + to_txq_info(sta->sta.txq[tid]); + struct fq *fq = &local->fq; + + spin_lock_bh(&fq->lock); + + /* Allow only frags to be dequeued */ + set_bit(IEEE80211_TXQ_STOP, &txqi->flags); + + if (!skb_queue_empty(&txqi->frags)) { + /* Fragmented Tx is ongoing, wait for it + * to finish. Reschedule worker to retry + * later. + */ + + spin_unlock_bh(&fq->lock); + spin_unlock_bh(&sta->lock); + + /* Give the task working on the txq a + * chance to send out the queued frags + */ + synchronize_net(); + + mutex_unlock(&sta->ampdu_mlme.mtx); + + ieee80211_queue_work(&sdata->local->hw, + work); + return; + } + + spin_unlock_bh(&fq->lock); + } + /* * Assign it over to the normal tid_tx array * where it "goes live". only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mac80211/rx.c +++ linux-oem-6.1-6.1.0/net/mac80211/rx.c @@ -4070,6 +4070,58 @@ #undef CALL_RXH } +static bool +ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id) +{ + if (!sta->mlo) + return false; + + return !!(sta->valid_links & BIT(link_id)); +} + +static bool ieee80211_rx_data_set_link(struct ieee80211_rx_data *rx, + u8 link_id) +{ + rx->link_id = link_id; + rx->link = rcu_dereference(rx->sdata->link[link_id]); + + if (!rx->sta) + return rx->link; + + if (!ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, link_id)) + return false; + + rx->link_sta = rcu_dereference(rx->sta->link[link_id]); + + return rx->link && rx->link_sta; +} + +static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx, + struct ieee80211_sta *pubsta, + int link_id) +{ + struct sta_info *sta; + + sta = container_of(pubsta, struct sta_info, sta); + + rx->link_id = link_id; + rx->sta = sta; + + if (sta) { + rx->local = sta->sdata->local; + if (!rx->sdata) + rx->sdata = sta->sdata; + rx->link_sta = &sta->deflink; + } + + if (link_id < 0) + rx->link = &rx->sdata->deflink; + else if (!ieee80211_rx_data_set_link(rx, link_id)) + return false; + + return true; +} + /* * This function makes calls into the RX path, therefore * it has to be invoked under RCU read lock. @@ -4078,16 +4130,19 @@ { struct sk_buff_head frames; struct ieee80211_rx_data rx = { - .sta = sta, - .sdata = sta->sdata, - .local = sta->local, /* This is OK -- must be QoS data frame */ .security_idx = tid, .seqno_idx = tid, - .link_id = -1, }; struct tid_ampdu_rx *tid_agg_rx; - u8 link_id; + int link_id = -1; + + /* FIXME: statistics won't be right with this */ + if (sta->sta.valid_links) + link_id = ffs(sta->sta.valid_links) - 1; + + if (!ieee80211_rx_data_set_sta(&rx, &sta->sta, link_id)) + return; tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); if (!tid_agg_rx) @@ -4107,10 +4162,6 @@ }; drv_event_callback(rx.local, rx.sdata, &event); } - /* FIXME: statistics won't be right with this */ - link_id = sta->sta.valid_links ? ffs(sta->sta.valid_links) - 1 : 0; - rx.link = rcu_dereference(sta->sdata->link[link_id]); - rx.link_sta = rcu_dereference(sta->link[link_id]); ieee80211_rx_handlers(&rx, &frames); } @@ -4126,7 +4177,6 @@ /* This is OK -- must be QoS data frame */ .security_idx = tid, .seqno_idx = tid, - .link_id = -1, }; int i, diff; @@ -4137,10 +4187,8 @@ sta = container_of(pubsta, struct sta_info, sta); - rx.sta = sta; - rx.sdata = sta->sdata; - rx.link = &rx.sdata->deflink; - rx.local = sta->local; + if (!ieee80211_rx_data_set_sta(&rx, pubsta, -1)) + return; rcu_read_lock(); tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); @@ -4527,15 +4575,6 @@ mutex_unlock(&local->sta_mtx); } -static bool -ieee80211_rx_is_valid_sta_link_id(struct ieee80211_sta *sta, u8 link_id) -{ - if (!sta->mlo) - return false; - - return !!(sta->valid_links & BIT(link_id)); -} - static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, struct ieee80211_fast_rx *fast_rx, int orig_len) @@ -4646,7 +4685,6 @@ struct sk_buff *skb = rx->skb; struct ieee80211_hdr *hdr = (void *)skb->data; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); - struct sta_info *sta = rx->sta; int orig_len = skb->len; int hdrlen = ieee80211_hdrlen(hdr->frame_control); int snap_offs = hdrlen; @@ -4658,7 +4696,6 @@ u8 da[ETH_ALEN]; u8 sa[ETH_ALEN]; } addrs __aligned(2); - struct link_sta_info *link_sta; struct ieee80211_sta_rx_stats *stats; /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write @@ -4761,18 +4798,10 @@ drop: dev_kfree_skb(skb); - if (rx->link_id >= 0) { - link_sta = rcu_dereference(sta->link[rx->link_id]); - if (!link_sta) - return true; - } else { - link_sta = &sta->deflink; - } - if (fast_rx->uses_rss) - stats = this_cpu_ptr(link_sta->pcpu_rx_stats); + stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats); else - stats = &link_sta->rx_stats; + stats = &rx->link_sta->rx_stats; stats->dropped++; return true; @@ -4790,8 +4819,8 @@ struct ieee80211_local *local = rx->local; struct ieee80211_sub_if_data *sdata = rx->sdata; struct ieee80211_hdr *hdr = (void *)skb->data; - struct link_sta_info *link_sta = NULL; - struct ieee80211_link_data *link; + struct link_sta_info *link_sta = rx->link_sta; + struct ieee80211_link_data *link = rx->link; rx->skb = skb; @@ -4813,35 +4842,6 @@ if (!ieee80211_accept_frame(rx)) return false; - if (rx->link_id >= 0) { - link = rcu_dereference(rx->sdata->link[rx->link_id]); - - /* we might race link removal */ - if (!link) - return true; - rx->link = link; - - if (rx->sta) { - rx->link_sta = - rcu_dereference(rx->sta->link[rx->link_id]); - if (!rx->link_sta) - return true; - } - } else { - if (rx->sta) - rx->link_sta = &rx->sta->deflink; - - rx->link = &sdata->deflink; - } - - if (unlikely(!is_multicast_ether_addr(hdr->addr1) && - rx->link_id >= 0 && rx->sta && rx->sta->sta.mlo)) { - link_sta = rcu_dereference(rx->sta->link[rx->link_id]); - - if (WARN_ON_ONCE(!link_sta)) - return true; - } - if (!consume) { struct skb_shared_hwtstamps *shwt; @@ -4859,9 +4859,12 @@ */ shwt = skb_hwtstamps(rx->skb); shwt->hwtstamp = skb_hwtstamps(skb)->hwtstamp; + + /* Update the hdr pointer to the new skb for translation below */ + hdr = (struct ieee80211_hdr *)rx->skb->data; } - if (unlikely(link_sta)) { + if (unlikely(rx->sta && rx->sta->sta.mlo)) { /* translate to MLD addresses */ if (ether_addr_equal(link->conf->addr, hdr->addr1)) ether_addr_copy(hdr->addr1, rx->sdata->vif.addr); @@ -4891,6 +4894,7 @@ struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_fast_rx *fast_rx; struct ieee80211_rx_data rx; + int link_id = -1; memset(&rx, 0, sizeof(rx)); rx.skb = skb; @@ -4907,12 +4911,8 @@ if (!pubsta) goto drop; - rx.sta = container_of(pubsta, struct sta_info, sta); - rx.sdata = rx.sta->sdata; - - if (status->link_valid && - !ieee80211_rx_is_valid_sta_link_id(pubsta, status->link_id)) - goto drop; + if (status->link_valid) + link_id = status->link_id; /* * TODO: Should the frame be dropped if the right link_id is not @@ -4921,19 +4921,8 @@ * link_id is used only for stats purpose and updating the stats on * the deflink is fine? */ - if (status->link_valid) - rx.link_id = status->link_id; - - if (rx.link_id >= 0) { - struct ieee80211_link_data *link; - - link = rcu_dereference(rx.sdata->link[rx.link_id]); - if (!link) - goto drop; - rx.link = link; - } else { - rx.link = &rx.sdata->deflink; - } + if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id)) + goto drop; fast_rx = rcu_dereference(rx.sta->fast_rx); if (!fast_rx) @@ -4951,6 +4940,8 @@ { struct link_sta_info *link_sta; struct ieee80211_hdr *hdr = (void *)skb->data; + struct sta_info *sta; + int link_id = -1; /* * Look up link station first, in case there's a @@ -4960,24 +4951,19 @@ */ link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2); if (link_sta) { - rx->sta = link_sta->sta; - rx->link_id = link_sta->link_id; + sta = link_sta->sta; + link_id = link_sta->link_id; } else { struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); - rx->sta = sta_info_get_bss(rx->sdata, hdr->addr2); - if (rx->sta) { - if (status->link_valid && - !ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, - status->link_id)) - return false; - - rx->link_id = status->link_valid ? status->link_id : -1; - } else { - rx->link_id = -1; - } + sta = sta_info_get_bss(rx->sdata, hdr->addr2); + if (status->link_valid) + link_id = status->link_id; } + if (!ieee80211_rx_data_set_sta(rx, &sta->sta, link_id)) + return false; + return ieee80211_prepare_and_rx_handle(rx, skb, consume); } @@ -5036,19 +5022,15 @@ if (ieee80211_is_data(fc)) { struct sta_info *sta, *prev_sta; - u8 link_id = status->link_id; + int link_id = -1; - if (pubsta) { - rx.sta = container_of(pubsta, struct sta_info, sta); - rx.sdata = rx.sta->sdata; + if (status->link_valid) + link_id = status->link_id; - if (status->link_valid && - !ieee80211_rx_is_valid_sta_link_id(pubsta, link_id)) + if (pubsta) { + if (!ieee80211_rx_data_set_sta(&rx, pubsta, link_id)) goto out; - if (status->link_valid) - rx.link_id = status->link_id; - /* * In MLO connection, fetch the link_id using addr2 * when the driver does not pass link_id in status. @@ -5066,7 +5048,7 @@ if (!link_sta) goto out; - rx.link_id = link_sta->link_id; + ieee80211_rx_data_set_link(&rx, link_sta->link_id); } if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) @@ -5082,30 +5064,27 @@ continue; } - if ((status->link_valid && - !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta, - link_id)) || - (!status->link_valid && prev_sta->sta.mlo)) + rx.sdata = prev_sta->sdata; + if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta, + link_id)) + goto out; + + if (!status->link_valid && prev_sta->sta.mlo) continue; - rx.link_id = status->link_valid ? link_id : -1; - rx.sta = prev_sta; - rx.sdata = prev_sta->sdata; ieee80211_prepare_and_rx_handle(&rx, skb, false); prev_sta = sta; } if (prev_sta) { - if ((status->link_valid && - !ieee80211_rx_is_valid_sta_link_id(&prev_sta->sta, - link_id)) || - (!status->link_valid && prev_sta->sta.mlo)) + rx.sdata = prev_sta->sdata; + if (!ieee80211_rx_data_set_sta(&rx, &prev_sta->sta, + link_id)) goto out; - rx.link_id = status->link_valid ? link_id : -1; - rx.sta = prev_sta; - rx.sdata = prev_sta->sdata; + if (!status->link_valid && prev_sta->sta.mlo) + goto out; if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) return; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mctp/af_mctp.c +++ linux-oem-6.1-6.1.0/net/mctp/af_mctp.c @@ -544,9 +544,6 @@ static void mctp_sk_close(struct sock *sk, long timeout) { - struct mctp_sock *msk = container_of(sk, struct mctp_sock, sk); - - del_timer_sync(&msk->key_expiry); sk_common_release(sk); } @@ -580,7 +577,19 @@ spin_lock_irqsave(&key->lock, fl2); __mctp_key_remove(key, net, fl2, MCTP_TRACE_KEY_CLOSED); } + sock_set_flag(sk, SOCK_DEAD); spin_unlock_irqrestore(&net->mctp.keys_lock, flags); + + /* Since there are no more tag allocations (we have removed all of the + * keys), stop any pending expiry events. the timer cannot be re-queued + * as the sk is no longer observable + */ + del_timer_sync(&msk->key_expiry); +} + +static void mctp_sk_destruct(struct sock *sk) +{ + skb_queue_purge(&sk->sk_receive_queue); } static struct proto mctp_proto = { @@ -619,6 +628,7 @@ return -ENOMEM; sock_init_data(sock, sk); + sk->sk_destruct = mctp_sk_destruct; rc = 0; if (sk->sk_prot->init) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mctp/route.c +++ linux-oem-6.1-6.1.0/net/mctp/route.c @@ -147,6 +147,7 @@ key->valid = true; spin_lock_init(&key->lock); refcount_set(&key->refs, 1); + sock_hold(key->sk); return key; } @@ -165,6 +166,7 @@ mctp_dev_release_key(key->dev, key); spin_unlock_irqrestore(&key->lock, flags); + sock_put(key->sk); kfree(key); } @@ -177,6 +179,11 @@ spin_lock_irqsave(&net->mctp.keys_lock, flags); + if (sock_flag(&msk->sk, SOCK_DEAD)) { + rc = -EINVAL; + goto out_unlock; + } + hlist_for_each_entry(tmp, &net->mctp.keys, hlist) { if (mctp_key_match(tmp, key->local_addr, key->peer_addr, key->tag)) { @@ -198,6 +205,7 @@ hlist_add_head(&key->sklist, &msk->keys); } +out_unlock: spin_unlock_irqrestore(&net->mctp.keys_lock, flags); return rc; @@ -315,8 +323,8 @@ static int mctp_route_input(struct mctp_route *route, struct sk_buff *skb) { + struct mctp_sk_key *key, *any_key = NULL; struct net *net = dev_net(skb->dev); - struct mctp_sk_key *key; struct mctp_sock *msk; struct mctp_hdr *mh; unsigned long f; @@ -361,13 +369,11 @@ * key for reassembly - we'll create a more specific * one for future packets if required (ie, !EOM). */ - key = mctp_lookup_key(net, skb, MCTP_ADDR_ANY, &f); - if (key) { - msk = container_of(key->sk, + any_key = mctp_lookup_key(net, skb, MCTP_ADDR_ANY, &f); + if (any_key) { + msk = container_of(any_key->sk, struct mctp_sock, sk); - spin_unlock_irqrestore(&key->lock, f); - mctp_key_unref(key); - key = NULL; + spin_unlock_irqrestore(&any_key->lock, f); } } @@ -419,14 +425,14 @@ * this function. */ rc = mctp_key_add(key, msk); - if (rc) { - kfree(key); - } else { + if (!rc) trace_mctp_key_acquire(key); - /* we don't need to release key->lock on exit */ - mctp_key_unref(key); - } + /* we don't need to release key->lock on exit, so + * clean up here and suppress the unlock via + * setting to NULL + */ + mctp_key_unref(key); key = NULL; } else { @@ -473,6 +479,8 @@ spin_unlock_irqrestore(&key->lock, f); mctp_key_unref(key); } + if (any_key) + mctp_key_unref(any_key); out: if (rc) kfree_skb(skb); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mpls/af_mpls.c +++ linux-oem-6.1-6.1.0/net/mpls/af_mpls.c @@ -1428,6 +1428,7 @@ free: kfree(table); out: + mdev->sysctl = NULL; return -ENOBUFS; } @@ -1437,6 +1438,9 @@ struct net *net = dev_net(dev); struct ctl_table *table; + if (!mdev->sysctl) + return; + table = mdev->sysctl->ctl_table_arg; unregister_net_sysctl_table(mdev->sysctl); kfree(table); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mptcp/pm.c +++ linux-oem-6.1-6.1.0/net/mptcp/pm.c @@ -420,6 +420,31 @@ } } +/* if sk is ipv4 or ipv6_only allows only same-family local and remote addresses, + * otherwise allow any matching local/remote pair + */ +bool mptcp_pm_addr_families_match(const struct sock *sk, + const struct mptcp_addr_info *loc, + const struct mptcp_addr_info *rem) +{ + bool mptcp_is_v4 = sk->sk_family == AF_INET; + +#if IS_ENABLED(CONFIG_MPTCP_IPV6) + bool loc_is_v4 = loc->family == AF_INET || ipv6_addr_v4mapped(&loc->addr6); + bool rem_is_v4 = rem->family == AF_INET || ipv6_addr_v4mapped(&rem->addr6); + + if (mptcp_is_v4) + return loc_is_v4 && rem_is_v4; + + if (ipv6_only_sock(sk)) + return !loc_is_v4 && !rem_is_v4; + + return loc_is_v4 == rem_is_v4; +#else + return mptcp_is_v4 && loc->family == AF_INET && rem->family == AF_INET; +#endif +} + void mptcp_pm_data_reset(struct mptcp_sock *msk) { u8 pm_type = mptcp_get_pm_type(sock_net((struct sock *)msk)); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mptcp/pm_netlink.c +++ linux-oem-6.1-6.1.0/net/mptcp/pm_netlink.c @@ -992,8 +992,8 @@ { int addrlen = sizeof(struct sockaddr_in); struct sockaddr_storage addr; - struct mptcp_sock *msk; struct socket *ssock; + struct sock *newsk; int backlog = 1024; int err; @@ -1002,17 +1002,15 @@ if (err) return err; - msk = mptcp_sk(entry->lsk->sk); - if (!msk) { - err = -EINVAL; - goto out; - } + newsk = entry->lsk->sk; + if (!newsk) + return -EINVAL; - ssock = __mptcp_nmpc_socket(msk); - if (!ssock) { - err = -EINVAL; - goto out; - } + lock_sock(newsk); + ssock = __mptcp_nmpc_socket(mptcp_sk(newsk)); + release_sock(newsk); + if (!ssock) + return -EINVAL; mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family); #if IS_ENABLED(CONFIG_MPTCP_IPV6) @@ -1022,20 +1020,16 @@ err = kernel_bind(ssock, (struct sockaddr *)&addr, addrlen); if (err) { pr_warn("kernel_bind error, err=%d", err); - goto out; + return err; } err = kernel_listen(ssock, backlog); if (err) { pr_warn("kernel_listen error, err=%d", err); - goto out; + return err; } return 0; - -out: - sock_release(entry->lsk); - return err; } int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc) @@ -1327,7 +1321,7 @@ return -EINVAL; } - entry = kmalloc(sizeof(*entry), GFP_KERNEL_ACCOUNT); + entry = kzalloc(sizeof(*entry), GFP_KERNEL_ACCOUNT); if (!entry) { GENL_SET_ERR_MSG(info, "can't allocate addr"); return -ENOMEM; @@ -1338,22 +1332,21 @@ ret = mptcp_pm_nl_create_listen_socket(skb->sk, entry); if (ret) { GENL_SET_ERR_MSG(info, "create listen socket error"); - kfree(entry); - return ret; + goto out_free; } } ret = mptcp_pm_nl_append_new_local_addr(pernet, entry); if (ret < 0) { GENL_SET_ERR_MSG(info, "too many addresses or duplicate one"); - if (entry->lsk) - sock_release(entry->lsk); - kfree(entry); - return ret; + goto out_free; } mptcp_nl_add_subflow_or_signal_addr(sock_net(skb->sk)); - return 0; + +out_free: + __mptcp_pm_release_addr_entry(entry); + return ret; } int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/mptcp/sockopt.c +++ linux-oem-6.1-6.1.0/net/mptcp/sockopt.c @@ -769,17 +769,24 @@ return tcp_setsockopt(listener->sk, SOL_TCP, TCP_DEFER_ACCEPT, optval, optlen); } -static int mptcp_setsockopt_sol_tcp_fastopen_connect(struct mptcp_sock *msk, sockptr_t optval, - unsigned int optlen) +static int mptcp_setsockopt_first_sf_only(struct mptcp_sock *msk, int level, int optname, + sockptr_t optval, unsigned int optlen) { + struct sock *sk = (struct sock *)msk; struct socket *sock; + int ret = -EINVAL; - /* Limit to first subflow */ + /* Limit to first subflow, before the connection establishment */ + lock_sock(sk); sock = __mptcp_nmpc_socket(msk); if (!sock) - return -EINVAL; + goto unlock; - return tcp_setsockopt(sock->sk, SOL_TCP, TCP_FASTOPEN_CONNECT, optval, optlen); + ret = tcp_setsockopt(sock->sk, level, optname, optval, optlen); + +unlock: + release_sock(sk); + return ret; } static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname, @@ -811,7 +818,8 @@ case TCP_DEFER_ACCEPT: return mptcp_setsockopt_sol_tcp_defer(msk, optval, optlen); case TCP_FASTOPEN_CONNECT: - return mptcp_setsockopt_sol_tcp_fastopen_connect(msk, optval, optlen); + return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname, + optval, optlen); } return -EOPNOTSUPP; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netfilter/ipset/ip_set_bitmap_ip.c +++ linux-oem-6.1-6.1.0/net/netfilter/ipset/ip_set_bitmap_ip.c @@ -308,8 +308,8 @@ return -IPSET_ERR_BITMAP_RANGE; pr_debug("mask_bits %u, netmask %u\n", mask_bits, netmask); - hosts = 2 << (32 - netmask - 1); - elements = 2 << (netmask - mask_bits - 1); + hosts = 2U << (32 - netmask - 1); + elements = 2UL << (netmask - mask_bits - 1); } if (elements > IPSET_BITMAP_MAX_RANGE + 1) return -IPSET_ERR_BITMAP_RANGE_SIZE; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netfilter/ipvs/ip_vs_sync.c +++ linux-oem-6.1-6.1.0/net/netfilter/ipvs/ip_vs_sync.c @@ -1617,7 +1617,7 @@ EnterFunction(7); /* Receive a packet */ - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, buflen); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, buflen); len = sock_recvmsg(sock, &msg, MSG_DONTWAIT); if (len < 0) return len; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netfilter/nf_conntrack_proto_sctp.c +++ linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_proto_sctp.c @@ -27,22 +27,16 @@ #include #include -/* FIXME: Examine ipfilter's timeouts and conntrack transitions more - closely. They're more complex. --RR - - And so for me for SCTP :D -Kiran */ - static const char *const sctp_conntrack_names[] = { - "NONE", - "CLOSED", - "COOKIE_WAIT", - "COOKIE_ECHOED", - "ESTABLISHED", - "SHUTDOWN_SENT", - "SHUTDOWN_RECD", - "SHUTDOWN_ACK_SENT", - "HEARTBEAT_SENT", - "HEARTBEAT_ACKED", + [SCTP_CONNTRACK_NONE] = "NONE", + [SCTP_CONNTRACK_CLOSED] = "CLOSED", + [SCTP_CONNTRACK_COOKIE_WAIT] = "COOKIE_WAIT", + [SCTP_CONNTRACK_COOKIE_ECHOED] = "COOKIE_ECHOED", + [SCTP_CONNTRACK_ESTABLISHED] = "ESTABLISHED", + [SCTP_CONNTRACK_SHUTDOWN_SENT] = "SHUTDOWN_SENT", + [SCTP_CONNTRACK_SHUTDOWN_RECD] = "SHUTDOWN_RECD", + [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = "SHUTDOWN_ACK_SENT", + [SCTP_CONNTRACK_HEARTBEAT_SENT] = "HEARTBEAT_SENT", }; #define SECS * HZ @@ -54,12 +48,11 @@ [SCTP_CONNTRACK_CLOSED] = 10 SECS, [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS, [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS, - [SCTP_CONNTRACK_ESTABLISHED] = 5 DAYS, + [SCTP_CONNTRACK_ESTABLISHED] = 210 SECS, [SCTP_CONNTRACK_SHUTDOWN_SENT] = 300 SECS / 1000, [SCTP_CONNTRACK_SHUTDOWN_RECD] = 300 SECS / 1000, [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = 3 SECS, [SCTP_CONNTRACK_HEARTBEAT_SENT] = 30 SECS, - [SCTP_CONNTRACK_HEARTBEAT_ACKED] = 210 SECS, }; #define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1 @@ -73,7 +66,6 @@ #define sSR SCTP_CONNTRACK_SHUTDOWN_RECD #define sSA SCTP_CONNTRACK_SHUTDOWN_ACK_SENT #define sHS SCTP_CONNTRACK_HEARTBEAT_SENT -#define sHA SCTP_CONNTRACK_HEARTBEAT_ACKED #define sIV SCTP_CONNTRACK_MAX /* @@ -96,9 +88,6 @@ CLOSED - We have seen a SHUTDOWN_COMPLETE chunk in the direction of the SHUTDOWN chunk. Connection is closed. HEARTBEAT_SENT - We have seen a HEARTBEAT in a new flow. -HEARTBEAT_ACKED - We have seen a HEARTBEAT-ACK in the direction opposite to - that of the HEARTBEAT chunk. Secondary connection is - established. */ /* TODO @@ -115,33 +104,33 @@ static const u8 sctp_conntracks[2][11][SCTP_CONNTRACK_MAX] = { { /* ORIGINAL */ -/* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA */ -/* init */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCW, sHA}, -/* init_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA}, -/* abort */ {sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL}, -/* shutdown */ {sCL, sCL, sCW, sCE, sSS, sSS, sSR, sSA, sCL, sSS}, -/* shutdown_ack */ {sSA, sCL, sCW, sCE, sES, sSA, sSA, sSA, sSA, sHA}, -/* error */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA},/* Can't have Stale cookie*/ -/* cookie_echo */ {sCL, sCL, sCE, sCE, sES, sSS, sSR, sSA, sCL, sHA},/* 5.2.4 - Big TODO */ -/* cookie_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA},/* Can't come in orig dir */ -/* shutdown_comp*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sCL, sCL, sHA}, -/* heartbeat */ {sHS, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA}, -/* heartbeat_ack*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA} +/* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS */ +/* init */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCW}, +/* init_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL}, +/* abort */ {sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL}, +/* shutdown */ {sCL, sCL, sCW, sCE, sSS, sSS, sSR, sSA, sCL}, +/* shutdown_ack */ {sSA, sCL, sCW, sCE, sES, sSA, sSA, sSA, sSA}, +/* error */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL},/* Can't have Stale cookie*/ +/* cookie_echo */ {sCL, sCL, sCE, sCE, sES, sSS, sSR, sSA, sCL},/* 5.2.4 - Big TODO */ +/* cookie_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL},/* Can't come in orig dir */ +/* shutdown_comp*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sCL, sCL}, +/* heartbeat */ {sHS, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, +/* heartbeat_ack*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, }, { /* REPLY */ -/* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA */ -/* init */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA},/* INIT in sCL Big TODO */ -/* init_ack */ {sIV, sCW, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA}, -/* abort */ {sIV, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sIV, sCL}, -/* shutdown */ {sIV, sCL, sCW, sCE, sSR, sSS, sSR, sSA, sIV, sSR}, -/* shutdown_ack */ {sIV, sCL, sCW, sCE, sES, sSA, sSA, sSA, sIV, sHA}, -/* error */ {sIV, sCL, sCW, sCL, sES, sSS, sSR, sSA, sIV, sHA}, -/* cookie_echo */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA},/* Can't come in reply dir */ -/* cookie_ack */ {sIV, sCL, sCW, sES, sES, sSS, sSR, sSA, sIV, sHA}, -/* shutdown_comp*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sCL, sIV, sHA}, -/* heartbeat */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA}, -/* heartbeat_ack*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHA, sHA} +/* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS */ +/* init */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV},/* INIT in sCL Big TODO */ +/* init_ack */ {sIV, sCW, sCW, sCE, sES, sSS, sSR, sSA, sIV}, +/* abort */ {sIV, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sIV}, +/* shutdown */ {sIV, sCL, sCW, sCE, sSR, sSS, sSR, sSA, sIV}, +/* shutdown_ack */ {sIV, sCL, sCW, sCE, sES, sSA, sSA, sSA, sIV}, +/* error */ {sIV, sCL, sCW, sCL, sES, sSS, sSR, sSA, sIV}, +/* cookie_echo */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV},/* Can't come in reply dir */ +/* cookie_ack */ {sIV, sCL, sCW, sES, sES, sSS, sSR, sSA, sIV}, +/* shutdown_comp*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sCL, sIV}, +/* heartbeat */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, +/* heartbeat_ack*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sES}, } }; @@ -412,22 +401,29 @@ for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { /* Special cases of Verification tag check (Sec 8.5.1) */ if (sch->type == SCTP_CID_INIT) { - /* Sec 8.5.1 (A) */ + /* (A) vtag MUST be zero */ if (sh->vtag != 0) goto out_unlock; } else if (sch->type == SCTP_CID_ABORT) { - /* Sec 8.5.1 (B) */ - if (sh->vtag != ct->proto.sctp.vtag[dir] && - sh->vtag != ct->proto.sctp.vtag[!dir]) + /* (B) vtag MUST match own vtag if T flag is unset OR + * MUST match peer's vtag if T flag is set + */ + if ((!(sch->flags & SCTP_CHUNK_FLAG_T) && + sh->vtag != ct->proto.sctp.vtag[dir]) || + ((sch->flags & SCTP_CHUNK_FLAG_T) && + sh->vtag != ct->proto.sctp.vtag[!dir])) goto out_unlock; } else if (sch->type == SCTP_CID_SHUTDOWN_COMPLETE) { - /* Sec 8.5.1 (C) */ - if (sh->vtag != ct->proto.sctp.vtag[dir] && - sh->vtag != ct->proto.sctp.vtag[!dir] && - sch->flags & SCTP_CHUNK_FLAG_T) + /* (C) vtag MUST match own vtag if T flag is unset OR + * MUST match peer's vtag if T flag is set + */ + if ((!(sch->flags & SCTP_CHUNK_FLAG_T) && + sh->vtag != ct->proto.sctp.vtag[dir]) || + ((sch->flags & SCTP_CHUNK_FLAG_T) && + sh->vtag != ct->proto.sctp.vtag[!dir])) goto out_unlock; } else if (sch->type == SCTP_CID_COOKIE_ECHO) { - /* Sec 8.5.1 (D) */ + /* (D) vtag must be same as init_vtag as found in INIT_ACK */ if (sh->vtag != ct->proto.sctp.vtag[dir]) goto out_unlock; } else if (sch->type == SCTP_CID_HEARTBEAT) { @@ -501,8 +497,12 @@ } ct->proto.sctp.state = new_state; - if (old_state != new_state) + if (old_state != new_state) { nf_conntrack_event_cache(IPCT_PROTOINFO, ct); + if (new_state == SCTP_CONNTRACK_ESTABLISHED && + !test_and_set_bit(IPS_ASSURED_BIT, &ct->status)) + nf_conntrack_event_cache(IPCT_ASSURED, ct); + } } spin_unlock_bh(&ct->lock); @@ -516,14 +516,6 @@ nf_ct_refresh_acct(ct, ctinfo, skb, timeouts[new_state]); - if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED && - dir == IP_CT_DIR_REPLY && - new_state == SCTP_CONNTRACK_ESTABLISHED) { - pr_debug("Setting assured bit\n"); - set_bit(IPS_ASSURED_BIT, &ct->status); - nf_conntrack_event_cache(IPCT_ASSURED, ct); - } - return NF_ACCEPT; out_unlock: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netfilter/nf_conntrack_proto_tcp.c +++ linux-oem-6.1-6.1.0/net/netfilter/nf_conntrack_proto_tcp.c @@ -1068,6 +1068,13 @@ ct->proto.tcp.last_flags |= IP_CT_EXP_CHALLENGE_ACK; } + + /* possible challenge ack reply to syn */ + if (old_state == TCP_CONNTRACK_SYN_SENT && + index == TCP_ACK_SET && + dir == IP_CT_DIR_REPLY) + ct->proto.tcp.last_ack = ntohl(th->ack_seq); + spin_unlock_bh(&ct->lock); nf_ct_l4proto_log_invalid(skb, ct, state, "packet (index %d) in dir %d ignored, state %s", @@ -1193,6 +1200,14 @@ * segments we ignored. */ goto in_window; } + + /* Reset in response to a challenge-ack we let through earlier */ + if (old_state == TCP_CONNTRACK_SYN_SENT && + ct->proto.tcp.last_index == TCP_ACK_SET && + ct->proto.tcp.last_dir == IP_CT_DIR_REPLY && + ntohl(th->seq) == ct->proto.tcp.last_ack) + goto in_window; + break; default: /* Keep compilers happy. */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netfilter/nft_set_rbtree.c +++ linux-oem-6.1-6.1.0/net/netfilter/nft_set_rbtree.c @@ -38,10 +38,12 @@ return !nft_rbtree_interval_end(rbe); } -static bool nft_rbtree_equal(const struct nft_set *set, const void *this, - const struct nft_rbtree_elem *interval) +static int nft_rbtree_cmp(const struct nft_set *set, + const struct nft_rbtree_elem *e1, + const struct nft_rbtree_elem *e2) { - return memcmp(this, nft_set_ext_key(&interval->ext), set->klen) == 0; + return memcmp(nft_set_ext_key(&e1->ext), nft_set_ext_key(&e2->ext), + set->klen); } static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set, @@ -52,7 +54,6 @@ const struct nft_rbtree_elem *rbe, *interval = NULL; u8 genmask = nft_genmask_cur(net); const struct rb_node *parent; - const void *this; int d; parent = rcu_dereference_raw(priv->root.rb_node); @@ -62,12 +63,11 @@ rbe = rb_entry(parent, struct nft_rbtree_elem, node); - this = nft_set_ext_key(&rbe->ext); - d = memcmp(this, key, set->klen); + d = memcmp(nft_set_ext_key(&rbe->ext), key, set->klen); if (d < 0) { parent = rcu_dereference_raw(parent->rb_left); if (interval && - nft_rbtree_equal(set, this, interval) && + !nft_rbtree_cmp(set, rbe, interval) && nft_rbtree_interval_end(rbe) && nft_rbtree_interval_start(interval)) continue; @@ -215,154 +215,216 @@ return rbe; } +static int nft_rbtree_gc_elem(const struct nft_set *__set, + struct nft_rbtree *priv, + struct nft_rbtree_elem *rbe) +{ + struct nft_set *set = (struct nft_set *)__set; + struct rb_node *prev = rb_prev(&rbe->node); + struct nft_rbtree_elem *rbe_prev; + struct nft_set_gc_batch *gcb; + + gcb = nft_set_gc_batch_check(set, NULL, GFP_ATOMIC); + if (!gcb) + return -ENOMEM; + + /* search for expired end interval coming before this element. */ + do { + rbe_prev = rb_entry(prev, struct nft_rbtree_elem, node); + if (nft_rbtree_interval_end(rbe_prev)) + break; + + prev = rb_prev(prev); + } while (prev != NULL); + + rb_erase(&rbe_prev->node, &priv->root); + rb_erase(&rbe->node, &priv->root); + atomic_sub(2, &set->nelems); + + nft_set_gc_batch_add(gcb, rbe); + nft_set_gc_batch_complete(gcb); + + return 0; +} + +static bool nft_rbtree_update_first(const struct nft_set *set, + struct nft_rbtree_elem *rbe, + struct rb_node *first) +{ + struct nft_rbtree_elem *first_elem; + + first_elem = rb_entry(first, struct nft_rbtree_elem, node); + /* this element is closest to where the new element is to be inserted: + * update the first element for the node list path. + */ + if (nft_rbtree_cmp(set, rbe, first_elem) < 0) + return true; + + return false; +} + static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, struct nft_rbtree_elem *new, struct nft_set_ext **ext) { - bool overlap = false, dup_end_left = false, dup_end_right = false; + struct nft_rbtree_elem *rbe, *rbe_le = NULL, *rbe_ge = NULL; + struct rb_node *node, *parent, **p, *first = NULL; struct nft_rbtree *priv = nft_set_priv(set); u8 genmask = nft_genmask_next(net); - struct nft_rbtree_elem *rbe; - struct rb_node *parent, **p; - int d; + int d, err; - /* Detect overlaps as we descend the tree. Set the flag in these cases: - * - * a1. _ _ __>| ?_ _ __| (insert end before existing end) - * a2. _ _ ___| ?_ _ _>| (insert end after existing end) - * a3. _ _ ___? >|_ _ __| (insert start before existing end) - * - * and clear it later on, as we eventually reach the points indicated by - * '?' above, in the cases described below. We'll always meet these - * later, locally, due to tree ordering, and overlaps for the intervals - * that are the closest together are always evaluated last. - * - * b1. _ _ __>| !_ _ __| (insert end before existing start) - * b2. _ _ ___| !_ _ _>| (insert end after existing start) - * b3. _ _ ___! >|_ _ __| (insert start after existing end, as a leaf) - * '--' no nodes falling in this range - * b4. >|_ _ ! (insert start before existing start) - * - * Case a3. resolves to b3.: - * - if the inserted start element is the leftmost, because the '0' - * element in the tree serves as end element - * - otherwise, if an existing end is found immediately to the left. If - * there are existing nodes in between, we need to further descend the - * tree before we can conclude the new start isn't causing an overlap - * - * or to b4., which, preceded by a3., means we already traversed one or - * more existing intervals entirely, from the right. - * - * For a new, rightmost pair of elements, we'll hit cases b3. and b2., - * in that order. - * - * The flag is also cleared in two special cases: - * - * b5. |__ _ _!|<_ _ _ (insert start right before existing end) - * b6. |__ _ >|!__ _ _ (insert end right after existing start) - * - * which always happen as last step and imply that no further - * overlapping is possible. - * - * Another special case comes from the fact that start elements matching - * an already existing start element are allowed: insertion is not - * performed but we return -EEXIST in that case, and the error will be - * cleared by the caller if NLM_F_EXCL is not present in the request. - * This way, request for insertion of an exact overlap isn't reported as - * error to userspace if not desired. - * - * However, if the existing start matches a pre-existing start, but the - * end element doesn't match the corresponding pre-existing end element, - * we need to report a partial overlap. This is a local condition that - * can be noticed without need for a tracking flag, by checking for a - * local duplicated end for a corresponding start, from left and right, - * separately. + /* Descend the tree to search for an existing element greater than the + * key value to insert that is greater than the new element. This is the + * first element to walk the ordered elements to find possible overlap. */ - parent = NULL; p = &priv->root.rb_node; while (*p != NULL) { parent = *p; rbe = rb_entry(parent, struct nft_rbtree_elem, node); - d = memcmp(nft_set_ext_key(&rbe->ext), - nft_set_ext_key(&new->ext), - set->klen); + d = nft_rbtree_cmp(set, rbe, new); + if (d < 0) { p = &parent->rb_left; - - if (nft_rbtree_interval_start(new)) { - if (nft_rbtree_interval_end(rbe) && - nft_set_elem_active(&rbe->ext, genmask) && - !nft_set_elem_expired(&rbe->ext) && !*p) - overlap = false; - } else { - if (dup_end_left && !*p) - return -ENOTEMPTY; - - overlap = nft_rbtree_interval_end(rbe) && - nft_set_elem_active(&rbe->ext, - genmask) && - !nft_set_elem_expired(&rbe->ext); - - if (overlap) { - dup_end_right = true; - continue; - } - } } else if (d > 0) { - p = &parent->rb_right; + if (!first || + nft_rbtree_update_first(set, rbe, first)) + first = &rbe->node; - if (nft_rbtree_interval_end(new)) { - if (dup_end_right && !*p) - return -ENOTEMPTY; - - overlap = nft_rbtree_interval_end(rbe) && - nft_set_elem_active(&rbe->ext, - genmask) && - !nft_set_elem_expired(&rbe->ext); - - if (overlap) { - dup_end_left = true; - continue; - } - } else if (nft_set_elem_active(&rbe->ext, genmask) && - !nft_set_elem_expired(&rbe->ext)) { - overlap = nft_rbtree_interval_end(rbe); - } + p = &parent->rb_right; } else { - if (nft_rbtree_interval_end(rbe) && - nft_rbtree_interval_start(new)) { + if (nft_rbtree_interval_end(rbe)) p = &parent->rb_left; - - if (nft_set_elem_active(&rbe->ext, genmask) && - !nft_set_elem_expired(&rbe->ext)) - overlap = false; - } else if (nft_rbtree_interval_start(rbe) && - nft_rbtree_interval_end(new)) { + else p = &parent->rb_right; + } + } + + if (!first) + first = rb_first(&priv->root); + + /* Detect overlap by going through the list of valid tree nodes. + * Values stored in the tree are in reversed order, starting from + * highest to lowest value. + */ + for (node = first; node != NULL; node = rb_next(node)) { + rbe = rb_entry(node, struct nft_rbtree_elem, node); + + if (!nft_set_elem_active(&rbe->ext, genmask)) + continue; + + /* perform garbage collection to avoid bogus overlap reports. */ + if (nft_set_elem_expired(&rbe->ext)) { + err = nft_rbtree_gc_elem(set, priv, rbe); + if (err < 0) + return err; + + continue; + } - if (nft_set_elem_active(&rbe->ext, genmask) && - !nft_set_elem_expired(&rbe->ext)) - overlap = false; - } else if (nft_set_elem_active(&rbe->ext, genmask) && - !nft_set_elem_expired(&rbe->ext)) { - *ext = &rbe->ext; - return -EEXIST; - } else { - overlap = false; - if (nft_rbtree_interval_end(rbe)) - p = &parent->rb_left; - else - p = &parent->rb_right; + d = nft_rbtree_cmp(set, rbe, new); + if (d == 0) { + /* Matching end element: no need to look for an + * overlapping greater or equal element. + */ + if (nft_rbtree_interval_end(rbe)) { + rbe_le = rbe; + break; + } + + /* first element that is greater or equal to key value. */ + if (!rbe_ge) { + rbe_ge = rbe; + continue; } + + /* this is a closer more or equal element, update it. */ + if (nft_rbtree_cmp(set, rbe_ge, new) != 0) { + rbe_ge = rbe; + continue; + } + + /* element is equal to key value, make sure flags are + * the same, an existing more or equal start element + * must not be replaced by more or equal end element. + */ + if ((nft_rbtree_interval_start(new) && + nft_rbtree_interval_start(rbe_ge)) || + (nft_rbtree_interval_end(new) && + nft_rbtree_interval_end(rbe_ge))) { + rbe_ge = rbe; + continue; + } + } else if (d > 0) { + /* annotate element greater than the new element. */ + rbe_ge = rbe; + continue; + } else if (d < 0) { + /* annotate element less than the new element. */ + rbe_le = rbe; + break; } + } + + /* - new start element matching existing start element: full overlap + * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given. + */ + if (rbe_ge && !nft_rbtree_cmp(set, new, rbe_ge) && + nft_rbtree_interval_start(rbe_ge) == nft_rbtree_interval_start(new)) { + *ext = &rbe_ge->ext; + return -EEXIST; + } - dup_end_left = dup_end_right = false; + /* - new end element matching existing end element: full overlap + * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given. + */ + if (rbe_le && !nft_rbtree_cmp(set, new, rbe_le) && + nft_rbtree_interval_end(rbe_le) == nft_rbtree_interval_end(new)) { + *ext = &rbe_le->ext; + return -EEXIST; } - if (overlap) + /* - new start element with existing closest, less or equal key value + * being a start element: partial overlap, reported as -ENOTEMPTY. + * Anonymous sets allow for two consecutive start element since they + * are constant, skip them to avoid bogus overlap reports. + */ + if (!nft_set_is_anonymous(set) && rbe_le && + nft_rbtree_interval_start(rbe_le) && nft_rbtree_interval_start(new)) + return -ENOTEMPTY; + + /* - new end element with existing closest, less or equal key value + * being a end element: partial overlap, reported as -ENOTEMPTY. + */ + if (rbe_le && + nft_rbtree_interval_end(rbe_le) && nft_rbtree_interval_end(new)) + return -ENOTEMPTY; + + /* - new end element with existing closest, greater or equal key value + * being an end element: partial overlap, reported as -ENOTEMPTY + */ + if (rbe_ge && + nft_rbtree_interval_end(rbe_ge) && nft_rbtree_interval_end(new)) return -ENOTEMPTY; + /* Accepted element: pick insertion point depending on key value */ + parent = NULL; + p = &priv->root.rb_node; + while (*p != NULL) { + parent = *p; + rbe = rb_entry(parent, struct nft_rbtree_elem, node); + d = nft_rbtree_cmp(set, rbe, new); + + if (d < 0) + p = &parent->rb_left; + else if (d > 0) + p = &parent->rb_right; + else if (nft_rbtree_interval_end(rbe)) + p = &parent->rb_left; + else + p = &parent->rb_right; + } + rb_link_node_rcu(&new->node, parent, p); rb_insert_color(&new->node, &priv->root); return 0; @@ -501,23 +563,37 @@ struct nft_rbtree *priv; struct rb_node *node; struct nft_set *set; + struct net *net; + u8 genmask; priv = container_of(work, struct nft_rbtree, gc_work.work); set = nft_set_container_of(priv); + net = read_pnet(&set->net); + genmask = nft_genmask_cur(net); write_lock_bh(&priv->lock); write_seqcount_begin(&priv->count); for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) { rbe = rb_entry(node, struct nft_rbtree_elem, node); + if (!nft_set_elem_active(&rbe->ext, genmask)) + continue; + + /* elements are reversed in the rbtree for historical reasons, + * from highest to lowest value, that is why end element is + * always visited before the start element. + */ if (nft_rbtree_interval_end(rbe)) { rbe_end = rbe; continue; } if (!nft_set_elem_expired(&rbe->ext)) continue; - if (nft_set_elem_mark_busy(&rbe->ext)) + + if (nft_set_elem_mark_busy(&rbe->ext)) { + rbe_end = NULL; continue; + } if (rbe_prev) { rb_erase(&rbe_prev->node, &priv->root); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netlink/af_netlink.c +++ linux-oem-6.1-6.1.0/net/netlink/af_netlink.c @@ -580,7 +580,9 @@ if (nlk_sk(sk)->bound) goto err; - nlk_sk(sk)->portid = portid; + /* portid can be read locklessly from netlink_getname(). */ + WRITE_ONCE(nlk_sk(sk)->portid, portid); + sock_hold(sk); err = __netlink_insert(table, sk); @@ -1085,9 +1087,11 @@ return -EINVAL; if (addr->sa_family == AF_UNSPEC) { - sk->sk_state = NETLINK_UNCONNECTED; - nlk->dst_portid = 0; - nlk->dst_group = 0; + /* paired with READ_ONCE() in netlink_getsockbyportid() */ + WRITE_ONCE(sk->sk_state, NETLINK_UNCONNECTED); + /* dst_portid and dst_group can be read locklessly */ + WRITE_ONCE(nlk->dst_portid, 0); + WRITE_ONCE(nlk->dst_group, 0); return 0; } if (addr->sa_family != AF_NETLINK) @@ -1108,9 +1112,11 @@ err = netlink_autobind(sock); if (err == 0) { - sk->sk_state = NETLINK_CONNECTED; - nlk->dst_portid = nladdr->nl_pid; - nlk->dst_group = ffs(nladdr->nl_groups); + /* paired with READ_ONCE() in netlink_getsockbyportid() */ + WRITE_ONCE(sk->sk_state, NETLINK_CONNECTED); + /* dst_portid and dst_group can be read locklessly */ + WRITE_ONCE(nlk->dst_portid, nladdr->nl_pid); + WRITE_ONCE(nlk->dst_group, ffs(nladdr->nl_groups)); } return err; @@ -1127,10 +1133,12 @@ nladdr->nl_pad = 0; if (peer) { - nladdr->nl_pid = nlk->dst_portid; - nladdr->nl_groups = netlink_group_mask(nlk->dst_group); + /* Paired with WRITE_ONCE() in netlink_connect() */ + nladdr->nl_pid = READ_ONCE(nlk->dst_portid); + nladdr->nl_groups = netlink_group_mask(READ_ONCE(nlk->dst_group)); } else { - nladdr->nl_pid = nlk->portid; + /* Paired with WRITE_ONCE() in netlink_insert() */ + nladdr->nl_pid = READ_ONCE(nlk->portid); netlink_lock_table(); nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0; netlink_unlock_table(); @@ -1157,8 +1165,9 @@ /* Don't bother queuing skb if kernel socket has no input function */ nlk = nlk_sk(sock); - if (sock->sk_state == NETLINK_CONNECTED && - nlk->dst_portid != nlk_sk(ssk)->portid) { + /* dst_portid and sk_state can be changed in netlink_connect() */ + if (READ_ONCE(sock->sk_state) == NETLINK_CONNECTED && + READ_ONCE(nlk->dst_portid) != nlk_sk(ssk)->portid) { sock_put(sock); return ERR_PTR(-ECONNREFUSED); } @@ -1875,8 +1884,9 @@ goto out; netlink_skb_flags |= NETLINK_SKB_DST; } else { - dst_portid = nlk->dst_portid; - dst_group = nlk->dst_group; + /* Paired with WRITE_ONCE() in netlink_connect() */ + dst_portid = READ_ONCE(nlk->dst_portid); + dst_group = READ_ONCE(nlk->dst_group); } /* Paired with WRITE_ONCE() in netlink_insert() */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netrom/af_netrom.c +++ linux-oem-6.1-6.1.0/net/netrom/af_netrom.c @@ -400,6 +400,11 @@ struct sock *sk = sock->sk; lock_sock(sk); + if (sock->state != SS_UNCONNECTED) { + release_sock(sk); + return -EINVAL; + } + if (sk->sk_state != TCP_LISTEN) { memset(&nr_sk(sk)->user_addr, 0, AX25_ADDR_LEN); sk->sk_max_ack_backlog = backlog; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/netrom/nr_timer.c +++ linux-oem-6.1-6.1.0/net/netrom/nr_timer.c @@ -121,6 +121,7 @@ is accepted() it isn't 'dead' so doesn't get removed. */ if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { + sock_hold(sk); bh_unlock_sock(sk); nr_destroy_socket(sk); goto out; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/nfc/llcp_core.c +++ linux-oem-6.1-6.1.0/net/nfc/llcp_core.c @@ -157,6 +157,7 @@ cancel_work_sync(&local->rx_work); cancel_work_sync(&local->timeout_work); kfree_skb(local->rx_pending); + local->rx_pending = NULL; del_timer_sync(&local->sdreq_timer); cancel_work_sync(&local->sdreq_timeout_work); nfc_llcp_free_sdp_tlv_list(&local->pending_sdreqs); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/openvswitch/meter.c +++ linux-oem-6.1-6.1.0/net/openvswitch/meter.c @@ -449,7 +449,7 @@ err = attach_meter(meter_tbl, meter); if (err) - goto exit_unlock; + goto exit_free_old_meter; ovs_unlock(); @@ -472,6 +472,8 @@ genlmsg_end(reply, ovs_reply_header); return genlmsg_reply(reply, info); +exit_free_old_meter: + ovs_meter_free(old_meter); exit_unlock: ovs_unlock(); nlmsg_free(reply); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/qrtr/ns.c +++ linux-oem-6.1-6.1.0/net/qrtr/ns.c @@ -83,7 +83,10 @@ node->id = node_id; - radix_tree_insert(&nodes, node_id, node); + if (radix_tree_insert(&nodes, node_id, node)) { + kfree(node); + return NULL; + } return node; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/rds/message.c +++ linux-oem-6.1-6.1.0/net/rds/message.c @@ -104,9 +104,9 @@ spin_lock_irqsave(&q->lock, flags); head = &q->zcookie_head; if (!list_empty(head)) { - info = list_entry(head, struct rds_msg_zcopy_info, - rs_zcookie_next); - if (info && rds_zcookie_add(info, cookie)) { + info = list_first_entry(head, struct rds_msg_zcopy_info, + rs_zcookie_next); + if (rds_zcookie_add(info, cookie)) { spin_unlock_irqrestore(&q->lock, flags); kfree(rds_info_from_znotifier(znotif)); /* caller invokes rds_wake_sk_sleep() */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/rose/af_rose.c +++ linux-oem-6.1-6.1.0/net/rose/af_rose.c @@ -488,6 +488,12 @@ { struct sock *sk = sock->sk; + lock_sock(sk); + if (sock->state != SS_UNCONNECTED) { + release_sock(sk); + return -EINVAL; + } + if (sk->sk_state != TCP_LISTEN) { struct rose_sock *rose = rose_sk(sk); @@ -497,8 +503,10 @@ memset(rose->dest_digis, 0, AX25_ADDR_LEN * ROSE_MAX_DIGIS); sk->sk_max_ack_backlog = backlog; sk->sk_state = TCP_LISTEN; + release_sock(sk); return 0; } + release_sock(sk); return -EOPNOTSUPP; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sched/act_ctinfo.c +++ linux-oem-6.1-6.1.0/net/sched/act_ctinfo.c @@ -91,7 +91,7 @@ cp = rcu_dereference_bh(ca->params); tcf_lastuse_update(&ca->tcf_tm); - bstats_update(&ca->tcf_bstats, skb); + tcf_action_update_bstats(&ca->common, skb); action = READ_ONCE(ca->tcf_action); wlen = skb_network_offset(skb); @@ -210,8 +210,8 @@ index = actparm->index; err = tcf_idr_check_alloc(tn, &index, a, bind); if (!err) { - ret = tcf_idr_create(tn, index, est, a, - &act_ctinfo_ops, bind, false, flags); + ret = tcf_idr_create_from_flags(tn, index, est, a, + &act_ctinfo_ops, bind, flags); if (ret) { tcf_idr_cleanup(tn, index); return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sched/act_mpls.c +++ linux-oem-6.1-6.1.0/net/sched/act_mpls.c @@ -132,6 +132,11 @@ { const u32 *label = nla_data(attr); + if (nla_len(attr) != sizeof(*label)) { + NL_SET_ERR_MSG_MOD(extack, "Invalid MPLS label length"); + return -EINVAL; + } + if (*label & ~MPLS_LABEL_MASK || *label == MPLS_LABEL_IMPLNULL) { NL_SET_ERR_MSG_MOD(extack, "MPLS label out of range"); return -EINVAL; @@ -143,7 +148,8 @@ static const struct nla_policy mpls_policy[TCA_MPLS_MAX + 1] = { [TCA_MPLS_PARMS] = NLA_POLICY_EXACT_LEN(sizeof(struct tc_mpls)), [TCA_MPLS_PROTO] = { .type = NLA_U16 }, - [TCA_MPLS_LABEL] = NLA_POLICY_VALIDATE_FN(NLA_U32, valid_label), + [TCA_MPLS_LABEL] = NLA_POLICY_VALIDATE_FN(NLA_BINARY, + valid_label), [TCA_MPLS_TC] = NLA_POLICY_RANGE(NLA_U8, 0, 7), [TCA_MPLS_TTL] = NLA_POLICY_MIN(NLA_U8, 1), [TCA_MPLS_BOS] = NLA_POLICY_RANGE(NLA_U8, 0, 1), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sched/sch_gred.c +++ linux-oem-6.1-6.1.0/net/sched/sch_gred.c @@ -377,6 +377,7 @@ /* Even if driver returns failure adjust the stats - in case offload * ended but driver still wants to adjust the values. */ + sch_tree_lock(sch); for (i = 0; i < MAX_DPs; i++) { if (!table->tab[i]) continue; @@ -393,6 +394,7 @@ sch->qstats.overlimits += hw_stats->stats.qstats[i].overlimits; } _bstats_update(&sch->bstats, bytes, packets); + sch_tree_unlock(sch); kfree(hw_stats); return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sched/sch_htb.c +++ linux-oem-6.1-6.1.0/net/sched/sch_htb.c @@ -427,7 +427,10 @@ while (cl->cmode == HTB_MAY_BORROW && p && mask) { m = mask; while (m) { - int prio = ffz(~m); + unsigned int prio = ffz(~m); + + if (WARN_ON_ONCE(prio >= ARRAY_SIZE(p->inner.clprio))) + break; m &= ~(1 << prio); if (p->inner.clprio[prio].feed.rb_node) @@ -1545,7 +1548,7 @@ struct tc_htb_qopt_offload offload_opt; struct netdev_queue *dev_queue; struct Qdisc *q = cl->leaf.q; - struct Qdisc *old = NULL; + struct Qdisc *old; int err; if (cl->level) @@ -1553,14 +1556,17 @@ WARN_ON(!q); dev_queue = htb_offload_get_queue(cl); - old = htb_graft_helper(dev_queue, NULL); - if (destroying) - /* Before HTB is destroyed, the kernel grafts noop_qdisc to - * all queues. + /* When destroying, caller qdisc_graft grafts the new qdisc and invokes + * qdisc_put for the qdisc being destroyed. htb_destroy_class_offload + * does not need to graft or qdisc_put the qdisc being destroyed. + */ + if (!destroying) { + old = htb_graft_helper(dev_queue, NULL); + /* Last qdisc grafted should be the same as cl->leaf.q when + * calling htb_delete. */ - WARN_ON(!(old->flags & TCQ_F_BUILTIN)); - else WARN_ON(old != q); + } if (cl->parent) { _bstats_update(&cl->parent->bstats_bias, @@ -1577,10 +1583,12 @@ }; err = htb_offload(qdisc_dev(sch), &offload_opt); - if (!err || destroying) - qdisc_put(old); - else - htb_graft_helper(dev_queue, old); + if (!destroying) { + if (!err) + qdisc_put(old); + else + htb_graft_helper(dev_queue, old); + } if (last_child) return err; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sched/sch_taprio.c +++ linux-oem-6.1-6.1.0/net/sched/sch_taprio.c @@ -1700,6 +1700,7 @@ int i; hrtimer_cancel(&q->advance_timer); + if (q->qdiscs) { for (i = 0; i < dev->num_tx_queues; i++) if (q->qdiscs[i]) @@ -1720,6 +1721,7 @@ * happens in qdisc_create(), after taprio_init() has been called. */ hrtimer_cancel(&q->advance_timer); + qdisc_synchronize(sch); taprio_disable_offload(dev, q, NULL); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sctp/bind_addr.c +++ linux-oem-6.1-6.1.0/net/sctp/bind_addr.c @@ -73,6 +73,12 @@ } } + /* If somehow no addresses were found that can be used with this + * scope, it's an error. + */ + if (list_empty(&dest->address_list)) + error = -ENETUNREACH; + out: if (error) sctp_bind_addr_clean(dest); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sctp/diag.c +++ linux-oem-6.1-6.1.0/net/sctp/diag.c @@ -343,11 +343,9 @@ struct sctp_comm_param *commp = p; struct sock *sk = ep->base.sk; const struct inet_diag_req_v2 *r = commp->r; - struct sctp_association *assoc = - list_entry(ep->asocs.next, struct sctp_association, asocs); /* find the ep only once through the transports by this condition */ - if (tsp->asoc != assoc) + if (!list_is_first(&tsp->asoc->asocs, &ep->asocs)) return 0; if (r->sdiag_family != AF_UNSPEC && sk->sk_family != r->sdiag_family) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sctp/transport.c +++ linux-oem-6.1-6.1.0/net/sctp/transport.c @@ -196,9 +196,7 @@ /* When a data chunk is sent, reset the heartbeat interval. */ expires = jiffies + sctp_transport_timeout(transport); - if ((time_before(transport->hb_timer.expires, expires) || - !timer_pending(&transport->hb_timer)) && - !mod_timer(&transport->hb_timer, + if (!mod_timer(&transport->hb_timer, expires + prandom_u32_max(transport->rto))) sctp_transport_hold(transport); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/smc/smc_clc.c +++ linux-oem-6.1-6.1.0/net/smc/smc_clc.c @@ -673,7 +673,7 @@ */ krflags = MSG_PEEK | MSG_WAITALL; clc_sk->sk_rcvtimeo = timeout; - iov_iter_kvec(&msg.msg_iter, READ, &vec, 1, + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &vec, 1, sizeof(struct smc_clc_msg_hdr)); len = sock_recvmsg(smc->clcsock, &msg, krflags); if (signal_pending(current)) { @@ -720,7 +720,7 @@ } else { recvlen = datlen; } - iov_iter_kvec(&msg.msg_iter, READ, &vec, 1, recvlen); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &vec, 1, recvlen); krflags = MSG_WAITALL; len = sock_recvmsg(smc->clcsock, &msg, krflags); if (len < recvlen || !smc_clc_msg_hdr_valid(clcm, check_trl)) { @@ -737,7 +737,7 @@ /* receive remaining proposal message */ recvlen = datlen > SMC_CLC_RECV_BUF_LEN ? SMC_CLC_RECV_BUF_LEN : datlen; - iov_iter_kvec(&msg.msg_iter, READ, &vec, 1, recvlen); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &vec, 1, recvlen); len = sock_recvmsg(smc->clcsock, &msg, krflags); datlen -= len; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/smc/smc_tx.c +++ linux-oem-6.1-6.1.0/net/smc/smc_tx.c @@ -308,7 +308,7 @@ iov.iov_base = kaddr + offset; iov.iov_len = size; - iov_iter_kvec(&msg.msg_iter, WRITE, &iov, 1, size); + iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iov, 1, size); rc = smc_tx_sendmsg(smc, &msg, size); kunmap(page); return rc; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/socket.c +++ linux-oem-6.1-6.1.0/net/socket.c @@ -750,7 +750,7 @@ int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t num, size_t size) { - iov_iter_kvec(&msg->msg_iter, WRITE, vec, num, size); + iov_iter_kvec(&msg->msg_iter, ITER_SOURCE, vec, num, size); return sock_sendmsg(sock, msg); } EXPORT_SYMBOL(kernel_sendmsg); @@ -776,7 +776,7 @@ if (!sock->ops->sendmsg_locked) return sock_no_sendmsg_locked(sk, msg, size); - iov_iter_kvec(&msg->msg_iter, WRITE, vec, num, size); + iov_iter_kvec(&msg->msg_iter, ITER_SOURCE, vec, num, size); return sock->ops->sendmsg_locked(sk, msg, msg_data_left(msg)); } @@ -971,9 +971,12 @@ static void sock_recv_mark(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) { - if (sock_flag(sk, SOCK_RCVMARK) && skb) - put_cmsg(msg, SOL_SOCKET, SO_MARK, sizeof(__u32), - &skb->mark); + if (sock_flag(sk, SOCK_RCVMARK) && skb) { + /* We must use a bounce buffer for CONFIG_HARDENED_USERCOPY=y */ + __u32 mark = skb->mark; + + put_cmsg(msg, SOL_SOCKET, SO_MARK, sizeof(__u32), &mark); + } } void __sock_recv_cmsgs(struct msghdr *msg, struct sock *sk, @@ -1034,7 +1037,7 @@ struct kvec *vec, size_t num, size_t size, int flags) { msg->msg_control_is_user = false; - iov_iter_kvec(&msg->msg_iter, READ, vec, num, size); + iov_iter_kvec(&msg->msg_iter, ITER_DEST, vec, num, size); return sock_recvmsg(sock, msg, flags); } EXPORT_SYMBOL(kernel_recvmsg); @@ -2092,7 +2095,7 @@ struct iovec iov; int fput_needed; - err = import_single_range(WRITE, buff, len, &iov, &msg.msg_iter); + err = import_single_range(ITER_SOURCE, buff, len, &iov, &msg.msg_iter); if (unlikely(err)) return err; sock = sockfd_lookup_light(fd, &err, &fput_needed); @@ -2157,7 +2160,7 @@ int err, err2; int fput_needed; - err = import_single_range(READ, ubuf, size, &iov, &msg.msg_iter); + err = import_single_range(ITER_DEST, ubuf, size, &iov, &msg.msg_iter); if (unlikely(err)) return err; sock = sockfd_lookup_light(fd, &err, &fput_needed); @@ -2417,7 +2420,7 @@ if (err) return err; - err = import_iovec(save_addr ? READ : WRITE, + err = import_iovec(save_addr ? ITER_DEST : ITER_SOURCE, msg.msg_iov, msg.msg_iovlen, UIO_FASTIOV, iov, &kmsg->msg_iter); return err < 0 ? err : 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sunrpc/socklib.c +++ linux-oem-6.1-6.1.0/net/sunrpc/socklib.c @@ -214,14 +214,14 @@ static int xprt_send_kvec(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t seek) { - iov_iter_kvec(&msg->msg_iter, WRITE, vec, 1, vec->iov_len); + iov_iter_kvec(&msg->msg_iter, ITER_SOURCE, vec, 1, vec->iov_len); return xprt_sendmsg(sock, msg, seek); } static int xprt_send_pagedata(struct socket *sock, struct msghdr *msg, struct xdr_buf *xdr, size_t base) { - iov_iter_bvec(&msg->msg_iter, WRITE, xdr->bvec, xdr_buf_pagecount(xdr), + iov_iter_bvec(&msg->msg_iter, ITER_SOURCE, xdr->bvec, xdr_buf_pagecount(xdr), xdr->page_len + xdr->page_base); return xprt_sendmsg(sock, msg, base + xdr->page_base); } @@ -244,7 +244,7 @@ }; size_t len = iov[0].iov_len + iov[1].iov_len; - iov_iter_kvec(&msg->msg_iter, WRITE, iov, 2, len); + iov_iter_kvec(&msg->msg_iter, ITER_SOURCE, iov, 2, len); return xprt_sendmsg(sock, msg, base); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/sunrpc/xprtsock.c +++ linux-oem-6.1-6.1.0/net/sunrpc/xprtsock.c @@ -364,7 +364,7 @@ xs_read_kvec(struct socket *sock, struct msghdr *msg, int flags, struct kvec *kvec, size_t count, size_t seek) { - iov_iter_kvec(&msg->msg_iter, READ, kvec, 1, count); + iov_iter_kvec(&msg->msg_iter, ITER_DEST, kvec, 1, count); return xs_sock_recvmsg(sock, msg, flags, seek); } @@ -373,7 +373,7 @@ struct bio_vec *bvec, unsigned long nr, size_t count, size_t seek) { - iov_iter_bvec(&msg->msg_iter, READ, bvec, nr, count); + iov_iter_bvec(&msg->msg_iter, ITER_DEST, bvec, nr, count); return xs_sock_recvmsg(sock, msg, flags, seek); } @@ -381,7 +381,7 @@ xs_read_discard(struct socket *sock, struct msghdr *msg, int flags, size_t count) { - iov_iter_discard(&msg->msg_iter, READ, count); + iov_iter_discard(&msg->msg_iter, ITER_DEST, count); return sock_recvmsg(sock, msg, flags); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/tipc/node.c +++ linux-oem-6.1-6.1.0/net/tipc/node.c @@ -1179,8 +1179,9 @@ bool addr_match = false; bool sign_match = false; bool link_up = false; + bool link_is_reset = false; bool accept_addr = false; - bool reset = true; + bool reset = false; char *if_name; unsigned long intv; u16 session; @@ -1200,14 +1201,14 @@ /* Prepare to validate requesting node's signature and media address */ l = le->link; link_up = l && tipc_link_is_up(l); + link_is_reset = l && tipc_link_is_reset(l); addr_match = l && !memcmp(&le->maddr, maddr, sizeof(*maddr)); sign_match = (signature == n->signature); /* These three flags give us eight permutations: */ if (sign_match && addr_match && link_up) { - /* All is fine. Do nothing. */ - reset = false; + /* All is fine. Ignore requests. */ /* Peer node is not a container/local namespace */ if (!n->peer_hash_mix) n->peer_hash_mix = hash_mixes; @@ -1232,6 +1233,7 @@ */ accept_addr = true; *respond = true; + reset = true; } else if (!sign_match && addr_match && link_up) { /* Peer node rebooted. Two possibilities: * - Delayed re-discovery; this link endpoint has already @@ -1263,6 +1265,7 @@ n->signature = signature; accept_addr = true; *respond = true; + reset = true; } if (!accept_addr) @@ -1291,6 +1294,7 @@ tipc_link_fsm_evt(l, LINK_RESET_EVT); if (n->state == NODE_FAILINGOVER) tipc_link_fsm_evt(l, LINK_FAILOVER_BEGIN_EVT); + link_is_reset = tipc_link_is_reset(l); le->link = l; n->link_cnt++; tipc_node_calculate_timer(n, l); @@ -1303,7 +1307,7 @@ memcpy(&le->maddr, maddr, sizeof(*maddr)); exit: tipc_node_write_unlock(n); - if (reset && l && !tipc_link_is_reset(l)) + if (reset && !link_is_reset) tipc_node_link_down(n, b->identity, false); tipc_node_put(n); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/tipc/socket.c +++ linux-oem-6.1-6.1.0/net/tipc/socket.c @@ -2614,6 +2614,7 @@ /* Send a 'SYN-' to destination */ m.msg_name = dest; m.msg_namelen = destlen; + iov_iter_kvec(&m.msg_iter, ITER_SOURCE, NULL, 0, 0); /* If connect is in non-blocking case, set MSG_DONTWAIT to * indicate send_msg() is never blocked. @@ -2776,6 +2777,7 @@ __skb_queue_head(&new_sk->sk_receive_queue, buf); skb_set_owner_r(buf, new_sk); } + iov_iter_kvec(&m.msg_iter, ITER_SOURCE, NULL, 0, 0); __tipc_sendstream(new_sock, &m, 0); release_sock(new_sk); exit: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/tipc/topsrv.c +++ linux-oem-6.1-6.1.0/net/tipc/topsrv.c @@ -396,7 +396,7 @@ iov.iov_base = &s; iov.iov_len = sizeof(s); msg.msg_name = NULL; - iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, iov.iov_len); + iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, iov.iov_len); ret = sock_recvmsg(con->sock, &msg, MSG_DONTWAIT); if (ret == -EWOULDBLOCK) return -EWOULDBLOCK; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/tls/tls_device.c +++ linux-oem-6.1-6.1.0/net/tls/tls_device.c @@ -620,7 +620,7 @@ kaddr = kmap(page); iov.iov_base = kaddr + offset; iov.iov_len = size; - iov_iter_kvec(&msg_iter, WRITE, &iov, 1, size); + iov_iter_kvec(&msg_iter, ITER_SOURCE, &iov, 1, size); iter_offset.msg_iter = &msg_iter; rc = tls_push_data(sk, iter_offset, size, flags, TLS_RECORD_TYPE_DATA, NULL); @@ -697,7 +697,7 @@ union tls_iter_offset iter; struct iov_iter msg_iter; - iov_iter_kvec(&msg_iter, WRITE, NULL, 0, 0); + iov_iter_kvec(&msg_iter, ITER_SOURCE, NULL, 0, 0); iter.msg_iter = &msg_iter; return tls_push_data(sk, iter, 0, flags, TLS_RECORD_TYPE_DATA, NULL); } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/x25/af_x25.c +++ linux-oem-6.1-6.1.0/net/x25/af_x25.c @@ -482,6 +482,12 @@ int rc = -EOPNOTSUPP; lock_sock(sk); + if (sock->state != SS_UNCONNECTED) { + rc = -EINVAL; + release_sock(sk); + return rc; + } + if (sk->sk_state != TCP_LISTEN) { memset(&x25_sk(sk)->dest_addr, 0, X25_ADDR_LEN); sk->sk_max_ack_backlog = backlog; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/xfrm/espintcp.c +++ linux-oem-6.1-6.1.0/net/xfrm/espintcp.c @@ -354,7 +354,7 @@ *((__be16 *)buf) = cpu_to_be16(msglen); pfx_iov.iov_base = buf; pfx_iov.iov_len = sizeof(buf); - iov_iter_kvec(&pfx_iter, WRITE, &pfx_iov, 1, pfx_iov.iov_len); + iov_iter_kvec(&pfx_iter, ITER_SOURCE, &pfx_iov, 1, pfx_iov.iov_len); err = sk_msg_memcopy_from_iter(sk, &pfx_iter, &emsg->skmsg, pfx_iov.iov_len); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/xfrm/xfrm_compat.c +++ linux-oem-6.1-6.1.0/net/xfrm/xfrm_compat.c @@ -5,6 +5,7 @@ * Based on code and translator idea by: Florian Westphal */ #include +#include #include #include @@ -302,7 +303,7 @@ nla_for_each_attr(nla, attrs, len, remaining) { int err; - switch (type) { + switch (nlh_src->nlmsg_type) { case XFRM_MSG_NEWSPDINFO: err = xfrm_nla_cpy(dst, nla, nla_len(nla)); break; @@ -437,6 +438,7 @@ NL_SET_ERR_MSG(extack, "Bad attribute"); return -EOPNOTSUPP; } + type = array_index_nospec(type, XFRMA_MAX + 1); if (nla_len(nla) < compat_policy[type].len) { NL_SET_ERR_MSG(extack, "Attribute bad length"); return -EOPNOTSUPP; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/xfrm/xfrm_input.c +++ linux-oem-6.1-6.1.0/net/xfrm/xfrm_input.c @@ -279,8 +279,7 @@ goto out; if (x->props.flags & XFRM_STATE_DECAP_DSCP) - ipv6_copy_dscp(ipv6_get_dsfield(ipv6_hdr(skb)), - ipipv6_hdr(skb)); + ipv6_copy_dscp(XFRM_MODE_SKB_CB(skb)->tos, ipipv6_hdr(skb)); if (!(x->props.flags & XFRM_STATE_NOECN)) ipip6_ecn_decapsulate(skb); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/xfrm/xfrm_policy.c +++ linux-oem-6.1-6.1.0/net/xfrm/xfrm_policy.c @@ -336,7 +336,7 @@ } if (xp->lft.hard_use_expires_seconds) { time64_t tmo = xp->lft.hard_use_expires_seconds + - (xp->curlft.use_time ? : xp->curlft.add_time) - now; + (READ_ONCE(xp->curlft.use_time) ? : xp->curlft.add_time) - now; if (tmo <= 0) goto expired; if (tmo < next) @@ -354,7 +354,7 @@ } if (xp->lft.soft_use_expires_seconds) { time64_t tmo = xp->lft.soft_use_expires_seconds + - (xp->curlft.use_time ? : xp->curlft.add_time) - now; + (READ_ONCE(xp->curlft.use_time) ? : xp->curlft.add_time) - now; if (tmo <= 0) { warn = 1; tmo = XFRM_KM_TIMEOUT; @@ -3586,7 +3586,8 @@ return 1; } - pol->curlft.use_time = ktime_get_real_seconds(); + /* This lockless write can happen from different cpus. */ + WRITE_ONCE(pol->curlft.use_time, ktime_get_real_seconds()); pols[0] = pol; npols++; @@ -3601,7 +3602,9 @@ xfrm_pol_put(pols[0]); return 0; } - pols[1]->curlft.use_time = ktime_get_real_seconds(); + /* This write can happen from different cpus. */ + WRITE_ONCE(pols[1]->curlft.use_time, + ktime_get_real_seconds()); npols++; } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/net/xfrm/xfrm_state.c +++ linux-oem-6.1-6.1.0/net/xfrm/xfrm_state.c @@ -572,7 +572,7 @@ } if (x->lft.hard_use_expires_seconds) { long tmo = x->lft.hard_use_expires_seconds + - (x->curlft.use_time ? : now) - now; + (READ_ONCE(x->curlft.use_time) ? : now) - now; if (tmo <= 0) goto expired; if (tmo < next) @@ -594,7 +594,7 @@ } if (x->lft.soft_use_expires_seconds) { long tmo = x->lft.soft_use_expires_seconds + - (x->curlft.use_time ? : now) - now; + (READ_ONCE(x->curlft.use_time) ? : now) - now; if (tmo <= 0) warn = 1; else if (tmo < next) @@ -1754,7 +1754,7 @@ hrtimer_start(&x1->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL_SOFT); - if (x1->curlft.use_time) + if (READ_ONCE(x1->curlft.use_time)) xfrm_state_check_expire(x1); if (x->props.smark.m || x->props.smark.v || x->if_id) { @@ -1786,8 +1786,8 @@ int xfrm_state_check_expire(struct xfrm_state *x) { - if (!x->curlft.use_time) - x->curlft.use_time = ktime_get_real_seconds(); + if (!READ_ONCE(x->curlft.use_time)) + WRITE_ONCE(x->curlft.use_time, ktime_get_real_seconds()); if (x->curlft.bytes >= x->lft.hard_byte_limit || x->curlft.packets >= x->lft.hard_packet_limit) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/rust/kernel/print.rs +++ linux-oem-6.1-6.1.0/rust/kernel/print.rs @@ -115,17 +115,24 @@ macro_rules! print_macro ( // The non-continuation cases (most of them, e.g. `INFO`). ($format_string:path, $($arg:tt)+) => ( - // SAFETY: This hidden macro should only be called by the documented - // printing macros which ensure the format string is one of the fixed - // ones. All `__LOG_PREFIX`s are null-terminated as they are generated - // by the `module!` proc macro or fixed values defined in a kernel - // crate. - unsafe { - $crate::print::call_printk( - &$format_string, - crate::__LOG_PREFIX, - format_args!($($arg)+), - ); + // To remain sound, `arg`s must be expanded outside the `unsafe` block. + // Typically one would use a `let` binding for that; however, `format_args!` + // takes borrows on the arguments, but does not extend the scope of temporaries. + // Therefore, a `match` expression is used to keep them around, since + // the scrutinee is kept until the end of the `match`. + match format_args!($($arg)+) { + // SAFETY: This hidden macro should only be called by the documented + // printing macros which ensure the format string is one of the fixed + // ones. All `__LOG_PREFIX`s are null-terminated as they are generated + // by the `module!` proc macro or fixed values defined in a kernel + // crate. + args => unsafe { + $crate::print::call_printk( + &$format_string, + crate::__LOG_PREFIX, + args, + ); + } } ); ); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/samples/ftrace/ftrace-direct-multi-modify.c +++ linux-oem-6.1-6.1.0/samples/ftrace/ftrace-direct-multi-modify.c @@ -149,6 +149,7 @@ { kthread_stop(simple_tsk); unregister_ftrace_direct_multi(&direct, my_tramp); + ftrace_free_filter(&direct); } module_init(ftrace_direct_multi_init); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/samples/ftrace/ftrace-direct-multi.c +++ linux-oem-6.1-6.1.0/samples/ftrace/ftrace-direct-multi.c @@ -77,6 +77,7 @@ static void __exit ftrace_direct_multi_exit(void) { unregister_ftrace_direct_multi(&direct, (unsigned long) my_tramp); + ftrace_free_filter(&direct); } module_init(ftrace_direct_multi_init); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/scripts/head-object-list.txt +++ linux-oem-6.1-6.1.0/scripts/head-object-list.txt @@ -15,7 +15,6 @@ arch/arc/kernel/head.o arch/arm/kernel/head-nommu.o arch/arm/kernel/head.o -arch/arm64/kernel/head.o arch/csky/kernel/head.o arch/hexagon/kernel/head.o arch/ia64/kernel/head.o @@ -39,7 +38,6 @@ arch/powerpc/kernel/fpu.o arch/powerpc/kernel/vector.o arch/powerpc/kernel/prom_init.o -arch/riscv/kernel/head.o arch/s390/kernel/head64.o arch/sh/kernel/head_32.o arch/sparc/kernel/head_32.o only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/scripts/tracing/ftrace-bisect.sh +++ linux-oem-6.1-6.1.0/scripts/tracing/ftrace-bisect.sh @@ -12,7 +12,7 @@ # (note, if this is a problem with function_graph tracing, then simply # replace "function" with "function_graph" in the following steps). # -# # cd /sys/kernel/debug/tracing +# # cd /sys/kernel/tracing # # echo schedule > set_ftrace_filter # # echo function > current_tracer # @@ -20,22 +20,40 @@ # # # echo nop > current_tracer # -# # cat available_filter_functions > ~/full-file +# Starting with v5.1 this can be done with numbers, making it much faster: +# +# The old (slow) way, for kernels before v5.1. +# +# [old-way] # cat available_filter_functions > ~/full-file +# +# [old-way] *** Note *** this process will take several minutes to update the +# [old-way] filters. Setting multiple functions is an O(n^2) operation, and we +# [old-way] are dealing with thousands of functions. So go have coffee, talk +# [old-way] with your coworkers, read facebook. And eventually, this operation +# [old-way] will end. +# +# The new way (using numbers) is an O(n) operation, and usually takes less than a second. +# +# seq `wc -l available_filter_functions | cut -d' ' -f1` > ~/full-file +# +# This will create a sequence of numbers that match the functions in +# available_filter_functions, and when echoing in a number into the +# set_ftrace_filter file, it will enable the corresponding function in +# O(1) time. Making enabling all functions O(n) where n is the number of +# functions to enable. +# +# For either the new or old way, the rest of the operations remain the same. +# # # ftrace-bisect ~/full-file ~/test-file ~/non-test-file # # cat ~/test-file > set_ftrace_filter # -# *** Note *** this will take several minutes. Setting multiple functions is -# an O(n^2) operation, and we are dealing with thousands of functions. So go -# have coffee, talk with your coworkers, read facebook. And eventually, this -# operation will end. -# # # echo function > current_tracer # # If it crashes, we know that ~/test-file has a bad function. # # Reboot back to test kernel. # -# # cd /sys/kernel/debug/tracing +# # cd /sys/kernel/tracing # # mv ~/test-file ~/full-file # # If it didn't crash. only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/security/keys/keyctl.c +++ linux-oem-6.1-6.1.0/security/keys/keyctl.c @@ -1251,7 +1251,7 @@ struct iov_iter from; int ret; - ret = import_single_range(WRITE, (void __user *)_payload, plen, + ret = import_single_range(ITER_SOURCE, (void __user *)_payload, plen, &iov, &from); if (unlikely(ret)) return ret; @@ -1283,7 +1283,7 @@ if (!_payload_iov) ioc = 0; - ret = import_iovec(WRITE, _payload_iov, ioc, + ret = import_iovec(ITER_SOURCE, _payload_iov, ioc, ARRAY_SIZE(iovstack), &iov, &from); if (ret < 0) return ret; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/security/tomoyo/Makefile +++ linux-oem-6.1-6.1.0/security/tomoyo/Makefile @@ -10,7 +10,7 @@ quiet_cmd_policy = POLICY $@ cmd_policy = ($(call do_policy,profile); $(call do_policy,exception_policy); $(call do_policy,domain_policy); $(call do_policy,manager); $(call do_policy,stat)) >$@ -$(obj)/builtin-policy.h: $(wildcard $(obj)/policy/*.conf $(src)/policy/*.conf.default) FORCE +$(obj)/builtin-policy.h: $(wildcard $(obj)/policy/*.conf $(srctree)/$(src)/policy/*.conf.default) FORCE $(call if_changed,policy) $(obj)/common.o: $(obj)/builtin-policy.h only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/core/control_led.c +++ linux-oem-6.1-6.1.0/sound/core/control_led.c @@ -530,12 +530,11 @@ bool attach) { char buf2[256], *s, *os; - size_t len = max(sizeof(s) - 1, count); struct snd_ctl_elem_id id; int err; - strncpy(buf2, buf, len); - buf2[len] = '\0'; + if (strscpy(buf2, buf, sizeof(buf2)) < 0) + return -E2BIG; memset(&id, 0, sizeof(id)); id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; s = buf2; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/firewire/motu/motu-hwdep.c +++ linux-oem-6.1-6.1.0/sound/firewire/motu/motu-hwdep.c @@ -87,6 +87,10 @@ return -EFAULT; count = consumed; + } else { + spin_unlock_irq(&motu->lock); + + count = 0; } return count; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/pci/hda/hda_bind.c +++ linux-oem-6.1-6.1.0/sound/pci/hda/hda_bind.c @@ -144,6 +144,7 @@ error: snd_hda_codec_cleanup_for_unbind(codec); + codec->preset = NULL; return err; } @@ -166,6 +167,7 @@ if (codec->patch_ops.free) codec->patch_ops.free(codec); snd_hda_codec_cleanup_for_unbind(codec); + codec->preset = NULL; module_put(dev->driver->owner); return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/pci/hda/patch_conexant.c +++ linux-oem-6.1-6.1.0/sound/pci/hda/patch_conexant.c @@ -1125,6 +1125,7 @@ HDA_CODEC_ENTRY(0x14f11f87, "SN6140", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto), + HDA_CODEC_ENTRY(0x14f120d1, "SN6180", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/pci/hda/patch_via.c +++ linux-oem-6.1-6.1.0/sound/pci/hda/patch_via.c @@ -819,6 +819,9 @@ return 0; nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn, ARRAY_SIZE(conn) - 1); + if (nums < 0) + return nums; + for (i = 0; i < nums; i++) { if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT) return 0; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/pci/lx6464es/lx_core.c +++ linux-oem-6.1-6.1.0/sound/pci/lx6464es/lx_core.c @@ -493,12 +493,11 @@ dev_dbg(chip->card->dev, "CMD_08_ASK_BUFFERS: needed %d, freed %d\n", *r_needed, *r_freed); - for (i = 0; i < MAX_STREAM_BUFFER; ++i) { - for (i = 0; i != chip->rmh.stat_len; ++i) - dev_dbg(chip->card->dev, - " stat[%d]: %x, %x\n", i, - chip->rmh.stat[i], - chip->rmh.stat[i] & MASK_DATA_SIZE); + for (i = 0; i < MAX_STREAM_BUFFER && i < chip->rmh.stat_len; + ++i) { + dev_dbg(chip->card->dev, " stat[%d]: %x, %x\n", i, + chip->rmh.stat[i], + chip->rmh.stat[i] & MASK_DATA_SIZE); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/amd/acp-es8336.c +++ linux-oem-6.1-6.1.0/sound/soc/amd/acp-es8336.c @@ -198,9 +198,11 @@ int ret; adev = acpi_dev_get_first_match_dev("ESSX8336", NULL, -1); - if (adev) - put_device(&adev->dev); + if (!adev) + return -ENODEV; + codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); if (!codec_dev) dev_err(card->dev, "can not find codec dev\n"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/codecs/cs42l56.c +++ linux-oem-6.1-6.1.0/sound/soc/codecs/cs42l56.c @@ -1191,18 +1191,12 @@ if (pdata) { cs42l56->pdata = *pdata; } else { - pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), - GFP_KERNEL); - if (!pdata) - return -ENOMEM; - if (i2c_client->dev.of_node) { ret = cs42l56_handle_of_data(i2c_client, &cs42l56->pdata); if (ret != 0) return ret; } - cs42l56->pdata = *pdata; } if (cs42l56->pdata.gpio_nreset) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/codecs/rt9120.c +++ linux-oem-6.1-6.1.0/sound/soc/codecs/rt9120.c @@ -177,8 +177,20 @@ return 0; } +static int rt9120_codec_suspend(struct snd_soc_component *comp) +{ + return pm_runtime_force_suspend(comp->dev); +} + +static int rt9120_codec_resume(struct snd_soc_component *comp) +{ + return pm_runtime_force_resume(comp->dev); +} + static const struct snd_soc_component_driver rt9120_component_driver = { .probe = rt9120_codec_probe, + .suspend = rt9120_codec_suspend, + .resume = rt9120_codec_resume, .controls = rt9120_snd_controls, .num_controls = ARRAY_SIZE(rt9120_snd_controls), .dapm_widgets = rt9120_dapm_widgets, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/codecs/tas5805m.c +++ linux-oem-6.1-6.1.0/sound/soc/codecs/tas5805m.c @@ -154,6 +154,7 @@ #define TAS5805M_VOLUME_MIN 0 struct tas5805m_priv { + struct i2c_client *i2c; struct regulator *pvdd; struct gpio_desc *gpio_pdn_n; @@ -165,6 +166,9 @@ int vol[2]; bool is_powered; bool is_muted; + + struct work_struct work; + struct mutex lock; }; static void set_dsp_scale(struct regmap *rm, int offset, int vol) @@ -181,13 +185,11 @@ regmap_bulk_write(rm, offset, v, ARRAY_SIZE(v)); } -static void tas5805m_refresh(struct snd_soc_component *component) +static void tas5805m_refresh(struct tas5805m_priv *tas5805m) { - struct tas5805m_priv *tas5805m = - snd_soc_component_get_drvdata(component); struct regmap *rm = tas5805m->regmap; - dev_dbg(component->dev, "refresh: is_muted=%d, vol=%d/%d\n", + dev_dbg(&tas5805m->i2c->dev, "refresh: is_muted=%d, vol=%d/%d\n", tas5805m->is_muted, tas5805m->vol[0], tas5805m->vol[1]); regmap_write(rm, REG_PAGE, 0x00); @@ -201,6 +203,9 @@ set_dsp_scale(rm, 0x24, tas5805m->vol[0]); set_dsp_scale(rm, 0x28, tas5805m->vol[1]); + regmap_write(rm, REG_PAGE, 0x00); + regmap_write(rm, REG_BOOK, 0x00); + /* Set/clear digital soft-mute */ regmap_write(rm, REG_DEVICE_CTRL_2, (tas5805m->is_muted ? DCTRL2_MUTE : 0) | @@ -226,8 +231,11 @@ struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component); + mutex_lock(&tas5805m->lock); ucontrol->value.integer.value[0] = tas5805m->vol[0]; ucontrol->value.integer.value[1] = tas5805m->vol[1]; + mutex_unlock(&tas5805m->lock); + return 0; } @@ -243,11 +251,13 @@ snd_soc_kcontrol_component(kcontrol); struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component); + int ret = 0; if (!(volume_is_valid(ucontrol->value.integer.value[0]) && volume_is_valid(ucontrol->value.integer.value[1]))) return -EINVAL; + mutex_lock(&tas5805m->lock); if (tas5805m->vol[0] != ucontrol->value.integer.value[0] || tas5805m->vol[1] != ucontrol->value.integer.value[1]) { tas5805m->vol[0] = ucontrol->value.integer.value[0]; @@ -256,11 +266,12 @@ tas5805m->vol[0], tas5805m->vol[1], tas5805m->is_powered); if (tas5805m->is_powered) - tas5805m_refresh(component); - return 1; + tas5805m_refresh(tas5805m); + ret = 1; } + mutex_unlock(&tas5805m->lock); - return 0; + return ret; } static const struct snd_kcontrol_new tas5805m_snd_controls[] = { @@ -294,54 +305,83 @@ struct snd_soc_component *component = dai->component; struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component); - struct regmap *rm = tas5805m->regmap; - unsigned int chan, global1, global2; switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - dev_dbg(component->dev, "DSP startup\n"); - - /* We mustn't issue any I2C transactions until the I2S - * clock is stable. Furthermore, we must allow a 5ms - * delay after the first set of register writes to - * allow the DSP to boot before configuring it. - */ - usleep_range(5000, 10000); - send_cfg(rm, dsp_cfg_preboot, - ARRAY_SIZE(dsp_cfg_preboot)); - usleep_range(5000, 15000); - send_cfg(rm, tas5805m->dsp_cfg_data, - tas5805m->dsp_cfg_len); - - tas5805m->is_powered = true; - tas5805m_refresh(component); + dev_dbg(component->dev, "clock start\n"); + schedule_work(&tas5805m->work); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - dev_dbg(component->dev, "DSP shutdown\n"); + break; - tas5805m->is_powered = false; + default: + return -EINVAL; + } - regmap_write(rm, REG_PAGE, 0x00); - regmap_write(rm, REG_BOOK, 0x00); + return 0; +} - regmap_read(rm, REG_CHAN_FAULT, &chan); - regmap_read(rm, REG_GLOBAL_FAULT1, &global1); - regmap_read(rm, REG_GLOBAL_FAULT2, &global2); +static void do_work(struct work_struct *work) +{ + struct tas5805m_priv *tas5805m = + container_of(work, struct tas5805m_priv, work); + struct regmap *rm = tas5805m->regmap; - dev_dbg(component->dev, - "fault regs: CHAN=%02x, GLOBAL1=%02x, GLOBAL2=%02x\n", - chan, global1, global2); + dev_dbg(&tas5805m->i2c->dev, "DSP startup\n"); - regmap_write(rm, REG_DEVICE_CTRL_2, DCTRL2_MODE_HIZ); - break; + mutex_lock(&tas5805m->lock); + /* We mustn't issue any I2C transactions until the I2S + * clock is stable. Furthermore, we must allow a 5ms + * delay after the first set of register writes to + * allow the DSP to boot before configuring it. + */ + usleep_range(5000, 10000); + send_cfg(rm, dsp_cfg_preboot, ARRAY_SIZE(dsp_cfg_preboot)); + usleep_range(5000, 15000); + send_cfg(rm, tas5805m->dsp_cfg_data, tas5805m->dsp_cfg_len); + + tas5805m->is_powered = true; + tas5805m_refresh(tas5805m); + mutex_unlock(&tas5805m->lock); +} - default: - return -EINVAL; +static int tas5805m_dac_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct tas5805m_priv *tas5805m = + snd_soc_component_get_drvdata(component); + struct regmap *rm = tas5805m->regmap; + + if (event & SND_SOC_DAPM_PRE_PMD) { + unsigned int chan, global1, global2; + + dev_dbg(component->dev, "DSP shutdown\n"); + cancel_work_sync(&tas5805m->work); + + mutex_lock(&tas5805m->lock); + if (tas5805m->is_powered) { + tas5805m->is_powered = false; + + regmap_write(rm, REG_PAGE, 0x00); + regmap_write(rm, REG_BOOK, 0x00); + + regmap_read(rm, REG_CHAN_FAULT, &chan); + regmap_read(rm, REG_GLOBAL_FAULT1, &global1); + regmap_read(rm, REG_GLOBAL_FAULT2, &global2); + + dev_dbg(component->dev, "fault regs: CHAN=%02x, " + "GLOBAL1=%02x, GLOBAL2=%02x\n", + chan, global1, global2); + + regmap_write(rm, REG_DEVICE_CTRL_2, DCTRL2_MODE_HIZ); + } + mutex_unlock(&tas5805m->lock); } return 0; @@ -354,7 +394,8 @@ static const struct snd_soc_dapm_widget tas5805m_dapm_widgets[] = { SND_SOC_DAPM_AIF_IN("DAC IN", "Playback", 0, SND_SOC_NOPM, 0, 0), - SND_SOC_DAPM_DAC("DAC", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0, + tas5805m_dac_event, SND_SOC_DAPM_PRE_PMD), SND_SOC_DAPM_OUTPUT("OUT") }; @@ -375,11 +416,14 @@ struct tas5805m_priv *tas5805m = snd_soc_component_get_drvdata(component); + mutex_lock(&tas5805m->lock); dev_dbg(component->dev, "set mute=%d (is_powered=%d)\n", mute, tas5805m->is_powered); + tas5805m->is_muted = mute; if (tas5805m->is_powered) - tas5805m_refresh(component); + tas5805m_refresh(tas5805m); + mutex_unlock(&tas5805m->lock); return 0; } @@ -434,6 +478,7 @@ if (!tas5805m) return -ENOMEM; + tas5805m->i2c = i2c; tas5805m->pvdd = devm_regulator_get(dev, "pvdd"); if (IS_ERR(tas5805m->pvdd)) { dev_err(dev, "failed to get pvdd supply: %ld\n", @@ -507,6 +552,9 @@ gpiod_set_value(tas5805m->gpio_pdn_n, 1); usleep_range(10000, 15000); + INIT_WORK(&tas5805m->work, do_work); + mutex_init(&tas5805m->lock); + /* Don't register through devm. We need to be able to unregister * the component prior to deasserting PDN# */ @@ -527,6 +575,7 @@ struct device *dev = &i2c->dev; struct tas5805m_priv *tas5805m = dev_get_drvdata(dev); + cancel_work_sync(&tas5805m->work); snd_soc_unregister_component(dev); gpiod_set_value(tas5805m->gpio_pdn_n, 0); usleep_range(10000, 15000); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/codecs/wm8904.c +++ linux-oem-6.1-6.1.0/sound/soc/codecs/wm8904.c @@ -697,6 +697,7 @@ int dcs_mask; int dcs_l, dcs_r; int dcs_l_reg, dcs_r_reg; + int an_out_reg; int timeout; int pwr_reg; @@ -712,6 +713,7 @@ dcs_mask = WM8904_DCS_ENA_CHAN_0 | WM8904_DCS_ENA_CHAN_1; dcs_r_reg = WM8904_DC_SERVO_8; dcs_l_reg = WM8904_DC_SERVO_9; + an_out_reg = WM8904_ANALOGUE_OUT1_LEFT; dcs_l = 0; dcs_r = 1; break; @@ -720,6 +722,7 @@ dcs_mask = WM8904_DCS_ENA_CHAN_2 | WM8904_DCS_ENA_CHAN_3; dcs_r_reg = WM8904_DC_SERVO_6; dcs_l_reg = WM8904_DC_SERVO_7; + an_out_reg = WM8904_ANALOGUE_OUT2_LEFT; dcs_l = 2; dcs_r = 3; break; @@ -792,6 +795,10 @@ snd_soc_component_update_bits(component, reg, WM8904_HPL_ENA_OUTP | WM8904_HPR_ENA_OUTP, WM8904_HPL_ENA_OUTP | WM8904_HPR_ENA_OUTP); + + /* Update volume, requires PGA to be powered */ + val = snd_soc_component_read(component, an_out_reg); + snd_soc_component_write(component, an_out_reg, val); break; case SND_SOC_DAPM_POST_PMU: only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/fsl/fsl-asoc-card.c +++ linux-oem-6.1-6.1.0/sound/soc/fsl/fsl-asoc-card.c @@ -121,11 +121,11 @@ static const struct snd_soc_dapm_route audio_map_ac97[] = { /* 1st half -- Normal DAPM routes */ - {"Playback", NULL, "AC97 Playback"}, - {"AC97 Capture", NULL, "Capture"}, + {"AC97 Playback", NULL, "CPU AC97 Playback"}, + {"CPU AC97 Capture", NULL, "AC97 Capture"}, /* 2nd half -- ASRC DAPM routes */ - {"AC97 Playback", NULL, "ASRC-Playback"}, - {"ASRC-Capture", NULL, "AC97 Capture"}, + {"CPU AC97 Playback", NULL, "ASRC-Playback"}, + {"ASRC-Capture", NULL, "CPU AC97 Capture"}, }; static const struct snd_soc_dapm_route audio_map_tx[] = { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/fsl/fsl_micfil.c +++ linux-oem-6.1-6.1.0/sound/soc/fsl/fsl_micfil.c @@ -154,21 +154,21 @@ static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = { SOC_SINGLE_SX_TLV("CH0 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(0), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(0), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH1 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(1), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(1), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH2 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(2), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(2), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH3 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(3), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(3), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH4 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(4), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(4), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH5 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(5), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(5), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH6 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(6), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(6), 0x8, 0xF, gain_tlv), SOC_SINGLE_SX_TLV("CH7 Volume", REG_MICFIL_OUT_CTRL, - MICFIL_OUTGAIN_CHX_SHIFT(7), 0xF, 0x7, gain_tlv), + MICFIL_OUTGAIN_CHX_SHIFT(7), 0x8, 0xF, gain_tlv), SOC_ENUM_EXT("MICFIL Quality Select", fsl_micfil_quality_enum, micfil_quality_get, micfil_quality_set), only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/fsl/fsl_sai.c +++ linux-oem-6.1-6.1.0/sound/soc/fsl/fsl_sai.c @@ -1141,6 +1141,7 @@ sai->verid.version = val & (FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK); + sai->verid.version >>= FSL_SAI_VERID_MINOR_SHIFT; sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK; ret = regmap_read(sai->regmap, FSL_SAI_PARAM, &val); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/fsl/fsl_ssi.c +++ linux-oem-6.1-6.1.0/sound/soc/fsl/fsl_ssi.c @@ -1189,14 +1189,14 @@ .symmetric_channels = 1, .probe = fsl_ssi_dai_probe, .playback = { - .stream_name = "AC97 Playback", + .stream_name = "CPU AC97 Playback", .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_8000_48000, .formats = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S20, }, .capture = { - .stream_name = "AC97 Capture", + .stream_name = "CPU AC97 Capture", .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_48000, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/bytcht_es8316.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcht_es8316.c @@ -497,21 +497,28 @@ if (adev) { snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); byt_cht_es8316_dais[dai_index].codecs->name = codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); return -ENXIO; } + codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); + if (!codec_dev) + return -EPROBE_DEFER; + priv->codec_dev = get_device(codec_dev); + /* override platform name, if required */ byt_cht_es8316_card.dev = dev; platform_name = mach->mach_params.platform; ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card, platform_name); - if (ret) + if (ret) { + put_device(codec_dev); return ret; + } /* Check for BYTCR or other platform and setup quirks */ dmi_id = dmi_first_match(byt_cht_es8316_quirk_table); @@ -539,13 +546,10 @@ /* get the clock */ priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3"); - if (IS_ERR(priv->mclk)) + if (IS_ERR(priv->mclk)) { + put_device(codec_dev); return dev_err_probe(dev, PTR_ERR(priv->mclk), "clk_get pmc_plt_clk_3 failed\n"); - - codec_dev = acpi_get_first_physical_node(adev); - if (!codec_dev) - return -EPROBE_DEFER; - priv->codec_dev = get_device(codec_dev); + } if (quirk & BYT_CHT_ES8316_JD_INVERTED) props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-inverted"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/bytcr_rt5651.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_rt5651.c @@ -922,7 +922,6 @@ if (adev) { snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), "i2c-%s", acpi_dev_name(adev)); - put_device(&adev->dev); byt_rt5651_dais[dai_index].codecs->name = byt_rt5651_codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); @@ -930,6 +929,7 @@ } codec_dev = acpi_get_first_physical_node(adev); + acpi_dev_put(adev); if (!codec_dev) return -EPROBE_DEFER; priv->codec_dev = get_device(codec_dev); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/bytcr_wm5102.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/bytcr_wm5102.c @@ -411,9 +411,9 @@ return -ENOENT; } snprintf(codec_name, sizeof(codec_name), "spi-%s", acpi_dev_name(adev)); - put_device(&adev->dev); codec_dev = bus_find_device_by_name(&spi_bus_type, NULL, codec_name); + acpi_dev_put(adev); if (!codec_dev) return -EPROBE_DEFER; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/sof_cs42l42.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_cs42l42.c @@ -336,6 +336,9 @@ links[*id].platforms = platform_component; links[*id].num_platforms = ARRAY_SIZE(platform_component); links[*id].dpcm_playback = 1; + /* firmware-generated echo reference */ + links[*id].dpcm_capture = 1; + links[*id].no_pcm = 1; links[*id].cpus = &cpus[*id]; links[*id].num_cpus = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/sof_nau8825.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_nau8825.c @@ -47,6 +47,7 @@ #define SOF_RT1019P_SPEAKER_AMP_PRESENT BIT(14) #define SOF_MAX98373_SPEAKER_AMP_PRESENT BIT(15) #define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(16) +#define SOF_RT1015P_SPEAKER_AMP_PRESENT BIT(17) static unsigned long sof_nau8825_quirk = SOF_NAU8825_SSP_CODEC(0); @@ -478,11 +479,11 @@ links[id].num_codecs = ARRAY_SIZE(max_98373_components); links[id].init = max_98373_spk_codec_init; links[id].ops = &max_98373_ops; - /* feedback stream */ - links[id].dpcm_capture = 1; } else if (sof_nau8825_quirk & SOF_MAX98360A_SPEAKER_AMP_PRESENT) { max_98360a_dai_link(&links[id]); + } else if (sof_nau8825_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) { + sof_rt1015p_dai_link(&links[id]); } else { goto devm_err; } @@ -490,6 +491,9 @@ links[id].platforms = platform_component; links[id].num_platforms = ARRAY_SIZE(platform_component); links[id].dpcm_playback = 1; + /* feedback stream or firmware-generated echo reference */ + links[id].dpcm_capture = 1; + links[id].no_pcm = 1; links[id].cpus = &cpus[id]; links[id].num_cpus = 1; @@ -576,6 +580,8 @@ if (sof_nau8825_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) max_98373_set_codec_conf(&sof_audio_card_nau8825); + else if (sof_nau8825_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) + sof_rt1015p_codec_conf(&sof_audio_card_nau8825); if (sof_nau8825_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) sof_audio_card_nau8825.num_links++; @@ -613,7 +619,7 @@ }, { - .name = "adl_rt1019p_nau8825", + .name = "adl_rt1019p_8825", .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | SOF_SPEAKER_AMP_PRESENT | SOF_RT1019P_SPEAKER_AMP_PRESENT | @@ -621,7 +627,7 @@ SOF_NAU8825_NUM_HDMIDEV(4)), }, { - .name = "adl_max98373_nau8825", + .name = "adl_max98373_8825", .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | SOF_SPEAKER_AMP_PRESENT | SOF_MAX98373_SPEAKER_AMP_PRESENT | @@ -632,7 +638,7 @@ }, { /* The limitation of length of char array, shorten the name */ - .name = "adl_mx98360a_nau8825", + .name = "adl_mx98360a_8825", .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | SOF_SPEAKER_AMP_PRESENT | SOF_MAX98360A_SPEAKER_AMP_PRESENT | @@ -642,6 +648,16 @@ SOF_SSP_BT_OFFLOAD_PRESENT), }, + { + .name = "adl_rt1015p_8825", + .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | + SOF_SPEAKER_AMP_PRESENT | + SOF_RT1015P_SPEAKER_AMP_PRESENT | + SOF_NAU8825_SSP_AMP(1) | + SOF_NAU8825_NUM_HDMIDEV(4) | + SOF_BT_OFFLOAD_SSP(2) | + SOF_SSP_BT_OFFLOAD_PRESENT), + }, { } }; MODULE_DEVICE_TABLE(platform, board_ids); @@ -663,3 +679,4 @@ MODULE_LICENSE("GPL"); MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); +MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_REALTEK_COMMON); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/sof_rt5682.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_rt5682.c @@ -761,8 +761,6 @@ links[id].num_codecs = ARRAY_SIZE(max_98373_components); links[id].init = max_98373_spk_codec_init; links[id].ops = &max_98373_ops; - /* feedback stream */ - links[id].dpcm_capture = 1; } else if (sof_rt5682_quirk & SOF_MAX98360A_SPEAKER_AMP_PRESENT) { max_98360a_dai_link(&links[id]); @@ -789,6 +787,9 @@ links[id].platforms = platform_component; links[id].num_platforms = ARRAY_SIZE(platform_component); links[id].dpcm_playback = 1; + /* feedback stream or firmware-generated echo reference */ + links[id].dpcm_capture = 1; + links[id].no_pcm = 1; links[id].cpus = &cpus[id]; links[id].num_cpus = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/boards/sof_ssp_amp.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/boards/sof_ssp_amp.c @@ -258,13 +258,12 @@ sof_rt1308_dai_link(&links[id]); } else if (sof_ssp_amp_quirk & SOF_CS35L41_SPEAKER_AMP_PRESENT) { cs35l41_set_dai_link(&links[id]); - - /* feedback from amplifier */ - links[id].dpcm_capture = 1; } links[id].platforms = platform_component; links[id].num_platforms = ARRAY_SIZE(platform_component); links[id].dpcm_playback = 1; + /* feedback from amplifier or firmware-generated echo reference */ + links[id].dpcm_capture = 1; links[id].no_pcm = 1; links[id].cpus = &cpus[id]; links[id].num_cpus = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/intel/common/soc-acpi-intel-adl-match.c +++ linux-oem-6.1-6.1.0/sound/soc/intel/common/soc-acpi-intel-adl-match.c @@ -430,6 +430,11 @@ .codecs = {"10EC5682", "RTL5682"}, }; +static const struct snd_soc_acpi_codecs adl_rt1015p_amp = { + .num_codecs = 1, + .codecs = {"RTL1015"} +}; + static const struct snd_soc_acpi_codecs adl_rt1019p_amp = { .num_codecs = 1, .codecs = {"RTL1019"} @@ -469,21 +474,21 @@ }, { .id = "10508825", - .drv_name = "adl_rt1019p_nau8825", + .drv_name = "adl_rt1019p_8825", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &adl_rt1019p_amp, .sof_tplg_filename = "sof-adl-rt1019-nau8825.tplg", }, { .id = "10508825", - .drv_name = "adl_max98373_nau8825", + .drv_name = "adl_max98373_8825", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &adl_max98373_amp, .sof_tplg_filename = "sof-adl-max98373-nau8825.tplg", }, { .id = "10508825", - .drv_name = "adl_mx98360a_nau8825", + .drv_name = "adl_mx98360a_8825", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &adl_max98360a_amp, .sof_tplg_filename = "sof-adl-max98360a-nau8825.tplg", @@ -497,6 +502,13 @@ }, { .id = "10508825", + .drv_name = "adl_rt1015p_8825", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &adl_rt1015p_amp, + .sof_tplg_filename = "sof-adl-rt1015-nau8825.tplg", + }, + { + .id = "10508825", .drv_name = "sof_nau8825", .sof_tplg_filename = "sof-adl-nau8825.tplg", }, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/mediatek/Kconfig +++ linux-oem-6.1-6.1.0/sound/soc/mediatek/Kconfig @@ -182,10 +182,12 @@ If unsure select "N". config SND_SOC_MT8186_MT6366_RT1019_RT5682S - tristate "ASoC Audio driver for MT8186 with RT1019 RT5682S codec" + tristate "ASoC Audio driver for MT8186 with RT1019 RT5682S MAX98357A/MAX98360 codec" depends on I2C && GPIOLIB depends on SND_SOC_MT8186 && MTK_PMIC_WRAP + select SND_SOC_MAX98357A select SND_SOC_MT6358 + select SND_SOC_MAX98357A select SND_SOC_RT1015P select SND_SOC_RT5682S select SND_SOC_BT_SCO only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/Makefile +++ linux-oem-6.1-6.1.0/sound/soc/qcom/Makefile @@ -28,6 +28,7 @@ snd-soc-sm8250-objs := sm8250.o snd-soc-sc8280xp-objs := sc8280xp.o snd-soc-qcom-common-objs := common.o +snd-soc-qcom-sdw-objs := sdw.o obj-$(CONFIG_SND_SOC_STORM) += snd-soc-storm.o obj-$(CONFIG_SND_SOC_APQ8016_SBC) += snd-soc-apq8016-sbc.o @@ -38,6 +39,7 @@ obj-$(CONFIG_SND_SOC_SDM845) += snd-soc-sdm845.o obj-$(CONFIG_SND_SOC_SM8250) += snd-soc-sm8250.o obj-$(CONFIG_SND_SOC_QCOM_COMMON) += snd-soc-qcom-common.o +obj-$(CONFIG_SND_SOC_QCOM_SDW) += snd-soc-qcom-sdw.o #DSP lib obj-$(CONFIG_SND_SOC_QDSP6) += qdsp6/ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/lpass-cpu.c +++ linux-oem-6.1-6.1.0/sound/soc/qcom/lpass-cpu.c @@ -1037,10 +1037,11 @@ struct lpass_data *data) { struct device_node *node; - int ret, id; + int ret, i, id; /* Allow all channels by default for backwards compatibility */ - for (id = 0; id < data->variant->num_dai; id++) { + for (i = 0; i < data->variant->num_dai; i++) { + id = data->variant->dai_driver[i].id; data->mi2s_playback_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH; data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/sc8280xp.c +++ linux-oem-6.1-6.1.0/sound/soc/qcom/sc8280xp.c @@ -12,6 +12,7 @@ #include #include "qdsp6/q6afe.h" #include "common.h" +#include "sdw.h" #define DRIVER_NAME "sc8280xp" only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/sdw.c +++ linux-oem-6.1-6.1.0/sound/soc/qcom/sdw.c @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2018, Linaro Limited. +// Copyright (c) 2018, The Linux Foundation. All rights reserved. + +#include +#include +#include "qdsp6/q6afe.h" +#include "sdw.h" + +int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, + struct sdw_stream_runtime *sruntime, + bool *stream_prepared) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + int ret; + + if (!sruntime) + return 0; + + switch (cpu_dai->id) { + case WSA_CODEC_DMA_RX_0: + case WSA_CODEC_DMA_RX_1: + case RX_CODEC_DMA_RX_0: + case RX_CODEC_DMA_RX_1: + case TX_CODEC_DMA_TX_0: + case TX_CODEC_DMA_TX_1: + case TX_CODEC_DMA_TX_2: + case TX_CODEC_DMA_TX_3: + break; + default: + return 0; + } + + if (*stream_prepared) { + sdw_disable_stream(sruntime); + sdw_deprepare_stream(sruntime); + *stream_prepared = false; + } + + ret = sdw_prepare_stream(sruntime); + if (ret) + return ret; + + /** + * NOTE: there is a strict hw requirement about the ordering of port + * enables and actual WSA881x PA enable. PA enable should only happen + * after soundwire ports are enabled if not DC on the line is + * accumulated resulting in Click/Pop Noise + * PA enable/mute are handled as part of codec DAPM and digital mute. + */ + + ret = sdw_enable_stream(sruntime); + if (ret) { + sdw_deprepare_stream(sruntime); + return ret; + } + *stream_prepared = true; + + return ret; +} +EXPORT_SYMBOL_GPL(qcom_snd_sdw_prepare); + +int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct sdw_stream_runtime **psruntime) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *codec_dai; + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + struct sdw_stream_runtime *sruntime; + int i; + + switch (cpu_dai->id) { + case WSA_CODEC_DMA_RX_0: + case RX_CODEC_DMA_RX_0: + case RX_CODEC_DMA_RX_1: + case TX_CODEC_DMA_TX_0: + case TX_CODEC_DMA_TX_1: + case TX_CODEC_DMA_TX_2: + case TX_CODEC_DMA_TX_3: + for_each_rtd_codec_dais(rtd, i, codec_dai) { + sruntime = snd_soc_dai_get_stream(codec_dai, substream->stream); + if (sruntime != ERR_PTR(-ENOTSUPP)) + *psruntime = sruntime; + } + break; + } + + return 0; + +} +EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_params); + +int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, + struct sdw_stream_runtime *sruntime, bool *stream_prepared) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + + switch (cpu_dai->id) { + case WSA_CODEC_DMA_RX_0: + case WSA_CODEC_DMA_RX_1: + case RX_CODEC_DMA_RX_0: + case RX_CODEC_DMA_RX_1: + case TX_CODEC_DMA_TX_0: + case TX_CODEC_DMA_TX_1: + case TX_CODEC_DMA_TX_2: + case TX_CODEC_DMA_TX_3: + if (sruntime && *stream_prepared) { + sdw_disable_stream(sruntime); + sdw_deprepare_stream(sruntime); + *stream_prepared = false; + } + break; + default: + break; + } + + return 0; +} +EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_free); +MODULE_LICENSE("GPL v2"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/sdw.h +++ linux-oem-6.1-6.1.0/sound/soc/qcom/sdw.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +// Copyright (c) 2018, The Linux Foundation. All rights reserved. + +#ifndef __QCOM_SND_SDW_H__ +#define __QCOM_SND_SDW_H__ + +#include + +int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, + struct sdw_stream_runtime *runtime, + bool *stream_prepared); +int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct sdw_stream_runtime **psruntime); +int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, + struct sdw_stream_runtime *sruntime, + bool *stream_prepared); +#endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/qcom/sm8250.c +++ linux-oem-6.1-6.1.0/sound/soc/qcom/sm8250.c @@ -12,6 +12,7 @@ #include #include "qdsp6/q6afe.h" #include "common.h" +#include "sdw.h" #define DRIVER_NAME "sm8250" #define MI2S_BCLK_RATE 1536000 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/soc-topology.c +++ linux-oem-6.1-6.1.0/sound/soc/soc-topology.c @@ -1401,13 +1401,17 @@ template.num_kcontrols = le32_to_cpu(w->num_kcontrols); kc = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(*kc), GFP_KERNEL); - if (!kc) + if (!kc) { + ret = -ENOMEM; goto hdr_err; + } kcontrol_type = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(unsigned int), GFP_KERNEL); - if (!kcontrol_type) + if (!kcontrol_type) { + ret = -ENOMEM; goto hdr_err; + } for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) { control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/sof/debug.c +++ linux-oem-6.1-6.1.0/sound/soc/sof/debug.c @@ -353,7 +353,9 @@ return err; } - return 0; + return snd_sof_debugfs_buf_item(sdev, &sdev->fw_state, + sizeof(sdev->fw_state), + "fw_state", 0444); } EXPORT_SYMBOL_GPL(snd_sof_dbg_init); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/sof/intel/hda-dai.c +++ linux-oem-6.1-6.1.0/sound/soc/sof/intel/hda-dai.c @@ -216,6 +216,10 @@ struct hdac_bus *bus = hstream->bus; struct hdac_ext_link *link; + link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); + if (!link) + return -EINVAL; + hext_stream = snd_soc_dai_get_dma_data(cpu_dai, substream); if (!hext_stream) { hext_stream = hda_link_stream_assign(bus, substream); @@ -225,10 +229,6 @@ snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)hext_stream); } - link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); - if (!link) - return -EINVAL; - /* set the hdac_stream in the codec dai */ snd_soc_dai_set_stream(codec_dai, hdac_stream(hext_stream), substream->stream); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/sof/ipc4-mtrace.c +++ linux-oem-6.1-6.1.0/sound/soc/sof/ipc4-mtrace.c @@ -344,9 +344,10 @@ size_t count, loff_t *ppos) { struct sof_mtrace_priv *priv = file->private_data; - int id, ret; + unsigned int id; char *buf; u32 mask; + int ret; /* * To update Nth mask entry, write: @@ -357,9 +358,9 @@ if (IS_ERR(buf)) return PTR_ERR(buf); - ret = sscanf(buf, "%d,0x%x", &id, &mask); + ret = sscanf(buf, "%u,0x%x", &id, &mask); if (ret != 2) { - ret = sscanf(buf, "%d,%x", &id, &mask); + ret = sscanf(buf, "%u,%x", &id, &mask); if (ret != 2) { ret = -EINVAL; goto out; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/sof/pm.c +++ linux-oem-6.1-6.1.0/sound/soc/sof/pm.c @@ -182,7 +182,7 @@ const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm; const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg; pm_message_t pm_state; - u32 target_state = 0; + u32 target_state = snd_sof_dsp_power_target(sdev); int ret; /* do nothing if dsp suspend callback is not set */ @@ -192,6 +192,9 @@ if (runtime_suspend && !sof_ops(sdev)->runtime_suspend) return 0; + if (tplg_ops && tplg_ops->tear_down_all_pipelines) + tplg_ops->tear_down_all_pipelines(sdev, false); + if (sdev->fw_state != SOF_FW_BOOT_COMPLETE) goto suspend; @@ -206,7 +209,6 @@ } } - target_state = snd_sof_dsp_power_target(sdev); pm_state.event = target_state; /* Skip to platform-specific suspend if DSP is entering D0 */ @@ -217,9 +219,6 @@ goto suspend; } - if (tplg_ops->tear_down_all_pipelines) - tplg_ops->tear_down_all_pipelines(sdev, false); - /* suspend DMA trace */ sof_fw_trace_suspend(sdev, pm_state); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/soc/sof/sof-audio.c +++ linux-oem-6.1-6.1.0/sound/soc/sof/sof-audio.c @@ -271,9 +271,9 @@ struct snd_sof_widget *swidget = widget->dobj.private; struct snd_soc_dapm_path *p; - /* return if the widget is in use or if it is already unprepared */ - if (!swidget->prepared || swidget->use_count > 1) - return; + /* skip if the widget is in use or if it is already unprepared */ + if (!swidget || !swidget->prepared || swidget->use_count > 0) + goto sink_unprepare; if (widget_ops[widget->id].ipc_unprepare) /* unprepare the source widget */ @@ -281,6 +281,7 @@ swidget->prepared = false; +sink_unprepare: /* unprepare all widgets in the sink paths */ snd_soc_dapm_widget_for_each_sink_path(widget, p) { if (!p->walking && p->sink->dobj.private) { @@ -303,7 +304,7 @@ struct snd_soc_dapm_path *p; int ret; - if (!widget_ops[widget->id].ipc_prepare || swidget->prepared) + if (!swidget || !widget_ops[widget->id].ipc_prepare || swidget->prepared) goto sink_prepare; /* prepare the source widget */ @@ -326,7 +327,8 @@ p->walking = false; if (ret < 0) { /* unprepare the source widget */ - if (widget_ops[widget->id].ipc_unprepare && swidget->prepared) { + if (widget_ops[widget->id].ipc_unprepare && + swidget && swidget->prepared) { widget_ops[widget->id].ipc_unprepare(swidget); swidget->prepared = false; } @@ -429,11 +431,11 @@ for_each_dapm_widgets(list, i, widget) { /* starting widget for playback is AIF type */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK && !WIDGET_IS_AIF(widget->id)) + if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in) continue; /* starting widget for capture is DAI type */ - if (dir == SNDRV_PCM_STREAM_CAPTURE && !WIDGET_IS_DAI(widget->id)) + if (dir == SNDRV_PCM_STREAM_CAPTURE && widget->id != snd_soc_dapm_dai_out) continue; switch (op) { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/synth/emux/emux_nrpn.c +++ linux-oem-6.1-6.1.0/sound/synth/emux/emux_nrpn.c @@ -349,6 +349,9 @@ snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan, int param) { + if (param >= ARRAY_SIZE(chan->control)) + return -EINVAL; + return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), port, chan, param, chan->control[param], only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/sound/usb/stream.c +++ linux-oem-6.1-6.1.0/sound/usb/stream.c @@ -1222,6 +1222,12 @@ if (err < 0) return err; } + + /* try to set the interface... */ + usb_set_interface(chip->dev, iface_no, 0); + snd_usb_init_pitch(chip, fp); + snd_usb_init_sample_rate(chip, fp, fp->rate_max); + usb_set_interface(chip->dev, iface_no, altno); } return 0; } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/gpio/gpio-event-mon.c +++ linux-oem-6.1-6.1.0/tools/gpio/gpio-event-mon.c @@ -86,6 +86,7 @@ gpiotools_test_bit(values.bits, i)); } + i = 0; while (1) { struct gpio_v2_line_event event; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/arch-mips.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/arch-mips.h @@ -192,6 +192,7 @@ __asm__ (".section .text\n" ".weak __start\n" ".set nomips16\n" + ".set push\n" ".set noreorder\n" ".option pic0\n" ".ent __start\n" @@ -210,6 +211,7 @@ "li $v0, 4001\n" // NR_exit == 4001 "syscall\n" ".end __start\n" + ".set pop\n" ""); #endif // _NOLIBC_ARCH_MIPS_H only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/arch-riscv.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/arch-riscv.h @@ -11,13 +11,13 @@ #define O_RDONLY 0 #define O_WRONLY 1 #define O_RDWR 2 -#define O_CREAT 0x100 -#define O_EXCL 0x200 -#define O_NOCTTY 0x400 -#define O_TRUNC 0x1000 -#define O_APPEND 0x2000 -#define O_NONBLOCK 0x4000 -#define O_DIRECTORY 0x200000 +#define O_CREAT 0x40 +#define O_EXCL 0x80 +#define O_NOCTTY 0x100 +#define O_TRUNC 0x200 +#define O_APPEND 0x400 +#define O_NONBLOCK 0x800 +#define O_DIRECTORY 0x10000 struct sys_stat_struct { unsigned long st_dev; /* Device. */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/ctype.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/ctype.h @@ -96,4 +96,7 @@ return isgraph(c) && !isalnum(c); } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_CTYPE_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/errno.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/errno.h @@ -24,4 +24,7 @@ */ #define MAX_ERRNO 4095 +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_ERRNO_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/signal.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/signal.h @@ -19,4 +19,7 @@ return sys_kill(sys_getpid(), signal); } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_SIGNAL_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/stdio.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/stdio.h @@ -303,4 +303,7 @@ fprintf(stderr, "%s%serrno=%d\n", (msg && *msg) ? msg : "", (msg && *msg) ? ": " : "", errno); } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_STDIO_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/stdlib.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/stdlib.h @@ -419,4 +419,7 @@ return itoa_buffer; } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_STDLIB_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/string.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/string.h @@ -88,8 +88,11 @@ { char *p = dst; - while (len--) + while (len--) { + /* prevent gcc from recognizing memset() here */ + asm volatile(""); *(p++) = b; + } return dst; } @@ -285,4 +288,7 @@ return (char *)ret; } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_STRING_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/sys.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/sys.h @@ -1243,5 +1243,7 @@ return ret; } +/* make sure to include all global symbols */ +#include "nolibc.h" #endif /* _NOLIBC_SYS_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/time.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/time.h @@ -25,4 +25,7 @@ return tv.tv_sec; } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_TIME_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/types.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/types.h @@ -26,13 +26,13 @@ #define S_IFSOCK 0140000 #define S_IFMT 0170000 -#define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR) -#define S_ISCHR(mode) (((mode) & S_IFCHR) == S_IFCHR) -#define S_ISBLK(mode) (((mode) & S_IFBLK) == S_IFBLK) -#define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG) -#define S_ISFIFO(mode) (((mode) & S_IFIFO) == S_IFIFO) -#define S_ISLNK(mode) (((mode) & S_IFLNK) == S_IFLNK) -#define S_ISSOCK(mode) (((mode) & S_IFSOCK) == S_IFSOCK) +#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) +#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) +#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) +#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) +#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) /* dirent types */ #define DT_UNKNOWN 0x0 @@ -89,39 +89,46 @@ #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 +#define FD_SETIDXMASK (8 * sizeof(unsigned long)) +#define FD_SETBITMASK (8 * sizeof(unsigned long)-1) + /* for select() */ typedef struct { - uint32_t fd32[(FD_SETSIZE + 31) / 32]; + unsigned long fds[(FD_SETSIZE + FD_SETBITMASK) / FD_SETIDXMASK]; } fd_set; -#define FD_CLR(fd, set) do { \ - fd_set *__set = (set); \ - int __fd = (fd); \ - if (__fd >= 0) \ - __set->fd32[__fd / 32] &= ~(1U << (__fd & 31)); \ +#define FD_CLR(fd, set) do { \ + fd_set *__set = (set); \ + int __fd = (fd); \ + if (__fd >= 0) \ + __set->fds[__fd / FD_SETIDXMASK] &= \ + ~(1U << (__fd & FX_SETBITMASK)); \ } while (0) -#define FD_SET(fd, set) do { \ - fd_set *__set = (set); \ - int __fd = (fd); \ - if (__fd >= 0) \ - __set->fd32[__fd / 32] |= 1U << (__fd & 31); \ +#define FD_SET(fd, set) do { \ + fd_set *__set = (set); \ + int __fd = (fd); \ + if (__fd >= 0) \ + __set->fds[__fd / FD_SETIDXMASK] |= \ + 1 << (__fd & FD_SETBITMASK); \ } while (0) -#define FD_ISSET(fd, set) ({ \ - fd_set *__set = (set); \ - int __fd = (fd); \ - int __r = 0; \ - if (__fd >= 0) \ - __r = !!(__set->fd32[__fd / 32] & 1U << (__fd & 31)); \ - __r; \ +#define FD_ISSET(fd, set) ({ \ + fd_set *__set = (set); \ + int __fd = (fd); \ + int __r = 0; \ + if (__fd >= 0) \ + __r = !!(__set->fds[__fd / FD_SETIDXMASK] & \ +1U << (__fd & FD_SET_BITMASK)); \ + __r; \ }) -#define FD_ZERO(set) do { \ - fd_set *__set = (set); \ - int __idx; \ - for (__idx = 0; __idx < (FD_SETSIZE+31) / 32; __idx ++) \ - __set->fd32[__idx] = 0; \ +#define FD_ZERO(set) do { \ + fd_set *__set = (set); \ + int __idx; \ + int __size = (FD_SETSIZE+FD_SETBITMASK) / FD_SETIDXMASK;\ + for (__idx = 0; __idx < __size; __idx++) \ + __set->fds[__idx] = 0; \ } while (0) /* for poll() */ @@ -202,4 +209,7 @@ }) #endif +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_TYPES_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/include/nolibc/unistd.h +++ linux-oem-6.1-6.1.0/tools/include/nolibc/unistd.h @@ -51,4 +51,7 @@ return ioctl(fd, TIOCSPGRP, &pid); } +/* make sure to include all global symbols */ +#include "nolibc.h" + #endif /* _NOLIBC_UNISTD_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/perf/builtin-kmem.c +++ linux-oem-6.1-6.1.0/tools/perf/builtin-kmem.c @@ -26,6 +26,7 @@ #include "util/string2.h" #include +#include #include #include #include @@ -184,22 +185,33 @@ total_allocated += bytes_alloc; nr_allocs++; - return 0; -} -static int evsel__process_alloc_node_event(struct evsel *evsel, struct perf_sample *sample) -{ - int ret = evsel__process_alloc_event(evsel, sample); + /* + * Commit 11e9734bcb6a ("mm/slab_common: unify NUMA and UMA + * version of tracepoints") adds the field "node" into the + * tracepoints 'kmalloc' and 'kmem_cache_alloc'. + * + * The legacy tracepoints 'kmalloc_node' and 'kmem_cache_alloc_node' + * also contain the field "node". + * + * If the tracepoint contains the field "node" the tool stats the + * cross allocation. + */ + if (evsel__field(evsel, "node")) { + int node1, node2; - if (!ret) { - int node1 = cpu__get_node((struct perf_cpu){.cpu = sample->cpu}), - node2 = evsel__intval(evsel, sample, "node"); + node1 = cpu__get_node((struct perf_cpu){.cpu = sample->cpu}); + node2 = evsel__intval(evsel, sample, "node"); - if (node1 != node2) + /* + * If the field "node" is NUMA_NO_NODE (-1), we don't take it + * as a cross allocation. + */ + if ((node2 != NUMA_NO_NODE) && (node1 != node2)) nr_cross_allocs++; } - return ret; + return 0; } static int ptr_cmp(void *, void *); @@ -1368,8 +1380,8 @@ /* slab allocator */ { "kmem:kmalloc", evsel__process_alloc_event, }, { "kmem:kmem_cache_alloc", evsel__process_alloc_event, }, - { "kmem:kmalloc_node", evsel__process_alloc_node_event, }, - { "kmem:kmem_cache_alloc_node", evsel__process_alloc_node_event, }, + { "kmem:kmalloc_node", evsel__process_alloc_event, }, + { "kmem:kmem_cache_alloc_node", evsel__process_alloc_event, }, { "kmem:kfree", evsel__process_free_event, }, { "kmem:kmem_cache_free", evsel__process_free_event, }, /* page allocator */ @@ -1823,6 +1835,19 @@ return 0; } +static bool slab_legacy_tp_is_exposed(void) +{ + /* + * The tracepoints "kmem:kmalloc_node" and + * "kmem:kmem_cache_alloc_node" have been removed on the latest + * kernel, if the tracepoint "kmem:kmalloc_node" is existed it + * means the tool is running on an old kernel, we need to + * rollback to support these legacy tracepoints. + */ + return IS_ERR(trace_event__tp_format("kmem", "kmalloc_node")) ? + false : true; +} + static int __cmd_record(int argc, const char **argv) { const char * const record_args[] = { @@ -1830,22 +1855,28 @@ }; const char * const slab_events[] = { "-e", "kmem:kmalloc", - "-e", "kmem:kmalloc_node", "-e", "kmem:kfree", "-e", "kmem:kmem_cache_alloc", - "-e", "kmem:kmem_cache_alloc_node", "-e", "kmem:kmem_cache_free", }; + const char * const slab_legacy_events[] = { + "-e", "kmem:kmalloc_node", + "-e", "kmem:kmem_cache_alloc_node", + }; const char * const page_events[] = { "-e", "kmem:mm_page_alloc", "-e", "kmem:mm_page_free", }; unsigned int rec_argc, i, j; const char **rec_argv; + unsigned int slab_legacy_tp_exposed = slab_legacy_tp_is_exposed(); rec_argc = ARRAY_SIZE(record_args) + argc - 1; - if (kmem_slab) + if (kmem_slab) { rec_argc += ARRAY_SIZE(slab_events); + if (slab_legacy_tp_exposed) + rec_argc += ARRAY_SIZE(slab_legacy_events); + } if (kmem_page) rec_argc += ARRAY_SIZE(page_events) + 1; /* for -g */ @@ -1860,6 +1891,10 @@ if (kmem_slab) { for (j = 0; j < ARRAY_SIZE(slab_events); j++, i++) rec_argv[i] = strdup(slab_events[j]); + if (slab_legacy_tp_exposed) { + for (j = 0; j < ARRAY_SIZE(slab_legacy_events); j++, i++) + rec_argv[i] = strdup(slab_legacy_events[j]); + } } if (kmem_page) { rec_argv[i++] = strdup("-g"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/perf/util/auxtrace.c +++ linux-oem-6.1-6.1.0/tools/perf/util/auxtrace.c @@ -2610,7 +2610,7 @@ *size = sym->start - *start; if (idx > 0) { if (*size) - return 1; + return 0; } else if (dso_sym_match(sym, sym_name, &cnt, idx)) { print_duplicate_syms(dso, sym_name); return -EINVAL; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/perf/util/bpf_counter.h +++ linux-oem-6.1-6.1.0/tools/perf/util/bpf_counter.h @@ -4,9 +4,12 @@ #include #include + +#ifdef HAVE_LIBBPF_SUPPORT #include #include #include +#endif struct evsel; struct target; @@ -87,6 +90,8 @@ setrlimit(RLIMIT_MEMLOCK, &rinf); } +#ifdef HAVE_BPF_SKEL + static inline __u32 bpf_link_get_id(int fd) { struct bpf_link_info link_info = { .id = 0, }; @@ -127,5 +132,6 @@ return bpf_prog_test_run_opts(prog_fd, &opts); } +#endif /* HAVE_BPF_SKEL */ #endif /* __PERF_BPF_COUNTER_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/memblock/Makefile +++ linux-oem-6.1-6.1.0/tools/testing/memblock/Makefile @@ -29,13 +29,14 @@ @mkdir -p linux test -L linux/memblock.h || ln -s ../../../../include/linux/memblock.h linux/memblock.h + test -L asm/asm.h || ln -s ../../../arch/x86/include/asm/asm.h asm/asm.h test -L asm/cmpxchg.h || ln -s ../../../arch/x86/include/asm/cmpxchg.h asm/cmpxchg.h memblock.c: $(EXTR_SRC) test -L memblock.c || ln -s $(EXTR_SRC) memblock.c clean: - $(RM) $(TARGETS) $(OFILES) linux/memblock.h memblock.c asm/cmpxchg.h + $(RM) $(TARGETS) $(OFILES) linux/memblock.h memblock.c asm/asm.h asm/cmpxchg.h help: @echo 'Memblock simulator' only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/bpf/verifier/search_pruning.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/bpf/verifier/search_pruning.c @@ -225,3 +225,39 @@ .result_unpriv = ACCEPT, .insn_processed = 15, }, +/* The test performs a conditional 64-bit write to a stack location + * fp[-8], this is followed by an unconditional 8-bit write to fp[-8], + * then data is read from fp[-8]. This sequence is unsafe. + * + * The test would be mistakenly marked as safe w/o dst register parent + * preservation in verifier.c:copy_register_state() function. + * + * Note the usage of BPF_F_TEST_STATE_FREQ to force creation of the + * checkpoint state after conditional 64-bit assignment. + */ +{ + "write tracking and register parent chain bug", + .insns = { + /* r6 = ktime_get_ns() */ + BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns), + BPF_MOV64_REG(BPF_REG_6, BPF_REG_0), + /* r0 = ktime_get_ns() */ + BPF_EMIT_CALL(BPF_FUNC_ktime_get_ns), + /* if r0 > r6 goto +1 */ + BPF_JMP_REG(BPF_JGT, BPF_REG_0, BPF_REG_6, 1), + /* *(u64 *)(r10 - 8) = 0xdeadbeef */ + BPF_ST_MEM(BPF_DW, BPF_REG_FP, -8, 0xdeadbeef), + /* r1 = 42 */ + BPF_MOV64_IMM(BPF_REG_1, 42), + /* *(u8 *)(r10 - 8) = r1 */ + BPF_STX_MEM(BPF_B, BPF_REG_FP, BPF_REG_1, -8), + /* r2 = *(u64 *)(r10 - 8) */ + BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_FP, -8), + /* exit(0) */ + BPF_MOV64_IMM(BPF_REG_0, 0), + BPF_EXIT_INSN(), + }, + .flags = BPF_F_TEST_STATE_FREQ, + .errstr = "invalid read from stack off -8+1 size 8", + .result = REJECT, +}, only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/cgroup/test_cpuset_prs.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/cgroup/test_cpuset_prs.sh @@ -254,6 +254,7 @@ # Taking away all CPUs from parent or itself if there are tasks # will make the partition invalid. " S+ C2-3:P1:S+ C3:P1 . . T C2-3 . . 0 A1:2-3,A2:2-3 A1:P1,A2:P-1" + " S+ C3:P1:S+ C3 . . T P1 . . 0 A1:3,A2:3 A1:P1,A2:P-1" " S+ $SETUP_A123_PARTITIONS . T:C2-3 . . . 0 A1:2-3,A2:2-3,A3:3 A1:P1,A2:P-1,A3:P-1" " S+ $SETUP_A123_PARTITIONS . T:C2-3:C1-3 . . . 0 A1:1,A2:2,A3:3 A1:P1,A2:P1,A3:P1" only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c @@ -428,6 +428,7 @@ int main(int argc, char *argv[]) { struct timespec min_ts, max_ts, vm_ts; + struct kvm_xen_hvm_attr evt_reset; struct kvm_vm *vm; pthread_t thread; bool verbose; @@ -942,6 +943,10 @@ } done: + evt_reset.type = KVM_XEN_ATTR_TYPE_EVTCHN; + evt_reset.u.evtchn.flags = KVM_XEN_EVTCHN_RESET; + vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &evt_reset); + alarm(0); clock_gettime(CLOCK_REALTIME, &max_ts); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/af_unix/test_unix_oob.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/af_unix/test_unix_oob.c @@ -124,7 +124,7 @@ wait_for_signal(pipefd[0]); if (connect(cfd, (struct sockaddr *)consumer_addr, - sizeof(struct sockaddr)) != 0) { + sizeof(*consumer_addr)) != 0) { perror("Connect failed"); kill(0, SIGTERM); exit(1); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/cmsg_ipv6.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/cmsg_ipv6.sh @@ -6,7 +6,7 @@ NS=ns IP6=2001:db8:1::1/64 TGT6=2001:db8:1::2 -TMPF=`mktemp` +TMPF=$(mktemp --suffix ".pcap") cleanup() { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/forwarding/lib.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/forwarding/lib.sh @@ -906,14 +906,14 @@ local value=$1; shift SYSCTL_ORIG[$key]=$(sysctl -n $key) - sysctl -qw $key=$value + sysctl -qw $key="$value" } sysctl_restore() { local key=$1; shift - sysctl -qw $key=${SYSCTL_ORIG["$key"]} + sysctl -qw $key="${SYSCTL_ORIG[$key]}" } forwarding_enable() only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/l2_tos_ttl_inherit.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/l2_tos_ttl_inherit.sh @@ -12,19 +12,27 @@ # In addition this script also checks if forcing a specific field in the # outer header is working. +# Return 4 by default (Kselftest SKIP code) +ERR=4 + if [ "$(id -u)" != "0" ]; then echo "Please run as root." - exit 0 + exit $ERR fi if ! which tcpdump > /dev/null 2>&1; then echo "No tcpdump found. Required for this test." - exit 0 + exit $ERR fi expected_tos="0x00" expected_ttl="0" failed=false +readonly NS0=$(mktemp -u ns0-XXXXXXXX) +readonly NS1=$(mktemp -u ns1-XXXXXXXX) + +RUN_NS0="ip netns exec ${NS0}" + get_random_tos() { # Get a random hex tos value between 0x00 and 0xfc, a multiple of 4 echo "0x$(tr -dc '0-9a-f' < /dev/urandom | head -c 1)\ @@ -61,7 +69,6 @@ local vlan="$5" local test_tos="0x00" local test_ttl="0" - local ns="ip netns exec testing" # We don't want a test-tos of 0x00, # because this is the value that we get when no tos is set. @@ -94,14 +101,15 @@ printf "│%7s │%6s │%6s │%13s │%13s │%6s │" \ "$type" "$outer" "$inner" "$tos" "$ttl" "$vlan" - # Create 'testing' netns, veth pair and connect main ns with testing ns - ip netns add testing - ip link add type veth - ip link set veth1 netns testing - ip link set veth0 up - $ns ip link set veth1 up - ip addr flush dev veth0 - $ns ip addr flush dev veth1 + # Create netns NS0 and NS1 and connect them with a veth pair + ip netns add "${NS0}" + ip netns add "${NS1}" + ip link add name veth0 netns "${NS0}" type veth \ + peer name veth1 netns "${NS1}" + ip -netns "${NS0}" link set dev veth0 up + ip -netns "${NS1}" link set dev veth1 up + ip -netns "${NS0}" address flush dev veth0 + ip -netns "${NS1}" address flush dev veth1 local local_addr1="" local local_addr2="" @@ -127,51 +135,59 @@ if [ "$type" = "gre" ]; then type="gretap" fi - ip addr add 198.18.0.1/24 dev veth0 - $ns ip addr add 198.18.0.2/24 dev veth1 - ip link add name tep0 type $type $local_addr1 remote \ - 198.18.0.2 tos $test_tos ttl $test_ttl $vxlan $geneve - $ns ip link add name tep1 type $type $local_addr2 remote \ - 198.18.0.1 tos $test_tos ttl $test_ttl $vxlan $geneve + ip -netns "${NS0}" address add 198.18.0.1/24 dev veth0 + ip -netns "${NS1}" address add 198.18.0.2/24 dev veth1 + ip -netns "${NS0}" link add name tep0 type $type $local_addr1 \ + remote 198.18.0.2 tos $test_tos ttl $test_ttl \ + $vxlan $geneve + ip -netns "${NS1}" link add name tep1 type $type $local_addr2 \ + remote 198.18.0.1 tos $test_tos ttl $test_ttl \ + $vxlan $geneve elif [ "$outer" = "6" ]; then if [ "$type" = "gre" ]; then type="ip6gretap" fi - ip addr add fdd1:ced0:5d88:3fce::1/64 dev veth0 - $ns ip addr add fdd1:ced0:5d88:3fce::2/64 dev veth1 - ip link add name tep0 type $type $local_addr1 \ - remote fdd1:ced0:5d88:3fce::2 tos $test_tos ttl $test_ttl \ - $vxlan $geneve - $ns ip link add name tep1 type $type $local_addr2 \ - remote fdd1:ced0:5d88:3fce::1 tos $test_tos ttl $test_ttl \ - $vxlan $geneve + ip -netns "${NS0}" address add fdd1:ced0:5d88:3fce::1/64 \ + dev veth0 nodad + ip -netns "${NS1}" address add fdd1:ced0:5d88:3fce::2/64 \ + dev veth1 nodad + ip -netns "${NS0}" link add name tep0 type $type $local_addr1 \ + remote fdd1:ced0:5d88:3fce::2 tos $test_tos \ + ttl $test_ttl $vxlan $geneve + ip -netns "${NS1}" link add name tep1 type $type $local_addr2 \ + remote fdd1:ced0:5d88:3fce::1 tos $test_tos \ + ttl $test_ttl $vxlan $geneve fi # Bring L2-tunnel link up and create VLAN on top - ip link set tep0 up - $ns ip link set tep1 up - ip addr flush dev tep0 - $ns ip addr flush dev tep1 + ip -netns "${NS0}" link set tep0 up + ip -netns "${NS1}" link set tep1 up + ip -netns "${NS0}" address flush dev tep0 + ip -netns "${NS1}" address flush dev tep1 local parent if $vlan; then parent="vlan99-" - ip link add link tep0 name ${parent}0 type vlan id 99 - $ns ip link add link tep1 name ${parent}1 type vlan id 99 - ip link set ${parent}0 up - $ns ip link set ${parent}1 up - ip addr flush dev ${parent}0 - $ns ip addr flush dev ${parent}1 + ip -netns "${NS0}" link add link tep0 name ${parent}0 \ + type vlan id 99 + ip -netns "${NS1}" link add link tep1 name ${parent}1 \ + type vlan id 99 + ip -netns "${NS0}" link set dev ${parent}0 up + ip -netns "${NS1}" link set dev ${parent}1 up + ip -netns "${NS0}" address flush dev ${parent}0 + ip -netns "${NS1}" address flush dev ${parent}1 else parent="tep" fi # Assign inner IPv4/IPv6 addresses if [ "$inner" = "4" ] || [ "$inner" = "other" ]; then - ip addr add 198.19.0.1/24 brd + dev ${parent}0 - $ns ip addr add 198.19.0.2/24 brd + dev ${parent}1 + ip -netns "${NS0}" address add 198.19.0.1/24 brd + dev ${parent}0 + ip -netns "${NS1}" address add 198.19.0.2/24 brd + dev ${parent}1 elif [ "$inner" = "6" ]; then - ip addr add fdd4:96cf:4eae:443b::1/64 dev ${parent}0 - $ns ip addr add fdd4:96cf:4eae:443b::2/64 dev ${parent}1 + ip -netns "${NS0}" address add fdd4:96cf:4eae:443b::1/64 \ + dev ${parent}0 nodad + ip -netns "${NS1}" address add fdd4:96cf:4eae:443b::2/64 \ + dev ${parent}1 nodad fi } @@ -192,10 +208,10 @@ ping_dst="198.19.0.3" # Generates ARPs which are not IPv4/IPv6 fi if [ "$tos_ttl" = "inherit" ]; then - ping -i 0.1 $ping_dst -Q "$expected_tos" -t "$expected_ttl" \ - 2>/dev/null 1>&2 & ping_pid="$!" + ${RUN_NS0} ping -i 0.1 $ping_dst -Q "$expected_tos" \ + -t "$expected_ttl" 2>/dev/null 1>&2 & ping_pid="$!" else - ping -i 0.1 $ping_dst 2>/dev/null 1>&2 & ping_pid="$!" + ${RUN_NS0} ping -i 0.1 $ping_dst 2>/dev/null 1>&2 & ping_pid="$!" fi local tunnel_type_offset tunnel_type_proto req_proto_offset req_offset if [ "$type" = "gre" ]; then @@ -216,10 +232,12 @@ req_proto_offset="$((req_proto_offset + 4))" req_offset="$((req_offset + 4))" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip[$tunnel_type_offset] = $tunnel_type_proto and \ - ip[$req_proto_offset] = 0x01 and \ - ip[$req_offset] = 0x08 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip[$tunnel_type_offset] = $tunnel_type_proto and \ + ip[$req_proto_offset] = 0x01 and \ + ip[$req_offset] = 0x08 2>/dev/null \ + | head -n 1)" elif [ "$inner" = "6" ]; then req_proto_offset="44" req_offset="78" @@ -231,10 +249,12 @@ req_proto_offset="$((req_proto_offset + 4))" req_offset="$((req_offset + 4))" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip[$tunnel_type_offset] = $tunnel_type_proto and \ - ip[$req_proto_offset] = 0x3a and \ - ip[$req_offset] = 0x80 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip[$tunnel_type_offset] = $tunnel_type_proto and \ + ip[$req_proto_offset] = 0x3a and \ + ip[$req_offset] = 0x80 2>/dev/null \ + | head -n 1)" elif [ "$inner" = "other" ]; then req_proto_offset="36" req_offset="45" @@ -250,11 +270,13 @@ expected_tos="0x00" expected_ttl="64" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip[$tunnel_type_offset] = $tunnel_type_proto and \ - ip[$req_proto_offset] = 0x08 and \ - ip[$((req_proto_offset + 1))] = 0x06 and \ - ip[$req_offset] = 0x01 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip[$tunnel_type_offset] = $tunnel_type_proto and \ + ip[$req_proto_offset] = 0x08 and \ + ip[$((req_proto_offset + 1))] = 0x06 and \ + ip[$req_offset] = 0x01 2>/dev/null \ + | head -n 1)" fi elif [ "$outer" = "6" ]; then if [ "$type" = "gre" ]; then @@ -273,10 +295,12 @@ req_proto_offset="$((req_proto_offset + 4))" req_offset="$((req_offset + 4))" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip6[$tunnel_type_offset] = $tunnel_type_proto and \ - ip6[$req_proto_offset] = 0x01 and \ - ip6[$req_offset] = 0x08 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip6[$tunnel_type_offset] = $tunnel_type_proto and \ + ip6[$req_proto_offset] = 0x01 and \ + ip6[$req_offset] = 0x08 2>/dev/null \ + | head -n 1)" elif [ "$inner" = "6" ]; then local req_proto_offset="72" local req_offset="106" @@ -288,10 +312,12 @@ req_proto_offset="$((req_proto_offset + 4))" req_offset="$((req_offset + 4))" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip6[$tunnel_type_offset] = $tunnel_type_proto and \ - ip6[$req_proto_offset] = 0x3a and \ - ip6[$req_offset] = 0x80 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip6[$tunnel_type_offset] = $tunnel_type_proto and \ + ip6[$req_proto_offset] = 0x3a and \ + ip6[$req_offset] = 0x80 2>/dev/null \ + | head -n 1)" elif [ "$inner" = "other" ]; then local req_proto_offset="64" local req_offset="73" @@ -307,15 +333,17 @@ expected_tos="0x00" expected_ttl="64" fi - out="$(tcpdump --immediate-mode -p -c 1 -v -i veth0 -n \ - ip6[$tunnel_type_offset] = $tunnel_type_proto and \ - ip6[$req_proto_offset] = 0x08 and \ - ip6[$((req_proto_offset + 1))] = 0x06 and \ - ip6[$req_offset] = 0x01 2>/dev/null | head -n 1)" + out="$(${RUN_NS0} tcpdump --immediate-mode -p -c 1 -v \ + -i veth0 -n \ + ip6[$tunnel_type_offset] = $tunnel_type_proto and \ + ip6[$req_proto_offset] = 0x08 and \ + ip6[$((req_proto_offset + 1))] = 0x06 and \ + ip6[$req_offset] = 0x01 2>/dev/null \ + | head -n 1)" fi fi kill -9 $ping_pid - wait $ping_pid 2>/dev/null + wait $ping_pid 2>/dev/null || true result="FAIL" if [ "$outer" = "4" ]; then captured_ttl="$(get_field "ttl" "$out")" @@ -351,11 +379,35 @@ } cleanup() { - ip link del veth0 2>/dev/null - ip netns del testing 2>/dev/null - ip link del tep0 2>/dev/null + ip netns del "${NS0}" 2>/dev/null + ip netns del "${NS1}" 2>/dev/null } +exit_handler() { + # Don't exit immediately if one of the intermediate commands fails. + # We might be called at the end of the script, when the network + # namespaces have already been deleted. So cleanup() may fail, but we + # still need to run until 'exit $ERR' or the script won't return the + # correct error code. + set +e + + cleanup + + exit $ERR +} + +# Restore the default SIGINT handler (just in case) and exit. +# The exit handler will take care of cleaning everything up. +interrupted() { + trap - INT + + exit $ERR +} + +set -e +trap exit_handler EXIT +trap interrupted INT + printf "┌────────┬───────┬───────┬──────────────┬" printf "──────────────┬───────┬────────┐\n" for type in gre vxlan geneve; do @@ -385,6 +437,10 @@ printf "└────────┴───────┴───────┴──────────────┴" printf "──────────────┴───────┴────────┘\n" +# All tests done. +# Set ERR appropriately: it will be returned by the exit handler. if $failed; then - exit 1 + ERR=1 +else + ERR=0 fi only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -472,6 +472,12 @@ wait $1 2>/dev/null } +kill_tests_wait() +{ + kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1) + wait +} + pm_nl_set_limits() { local ns=$1 @@ -1688,6 +1694,7 @@ local subflow_nr=$3 local cnt1 local cnt2 + local dump_stats if [ -n "${need_title}" ]; then printf "%03u %-36s %s" "${TEST_COUNT}" "${TEST_NAME}" "${msg}" @@ -1705,7 +1712,12 @@ echo "[ ok ]" fi - [ "${dump_stats}" = 1 ] && ( ss -N $ns1 -tOni ; ss -N $ns1 -tOni | grep token; ip -n $ns1 mptcp endpoint ) + if [ "${dump_stats}" = 1 ]; then + ss -N $ns1 -tOni + ss -N $ns1 -tOni | grep token + ip -n $ns1 mptcp endpoint + dump_stats + fi } chk_link_usage() @@ -2985,7 +2997,7 @@ pm_nl_set_limits $ns1 2 2 pm_nl_set_limits $ns2 2 2 pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow & + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow 2>/dev/null & wait_mpj $ns1 pm_nl_check_endpoint 1 "creation" \ @@ -2998,14 +3010,14 @@ pm_nl_add_endpoint $ns2 10.0.2.2 flags signal pm_nl_check_endpoint 0 "modif is allowed" \ $ns2 10.0.2.2 id 1 flags signal - wait + kill_tests_wait fi if reset "delete and re-add"; then pm_nl_set_limits $ns1 1 1 pm_nl_set_limits $ns2 1 1 pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow - run_tests $ns1 $ns2 10.0.1.1 4 0 0 slow & + run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 2>/dev/null & wait_mpj $ns2 pm_nl_del_endpoint $ns2 2 10.0.2.2 @@ -3015,7 +3027,7 @@ pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow wait_mpj $ns2 chk_subflow_nr "" "after re-add" 2 - wait + kill_tests_wait fi } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -776,6 +776,63 @@ rm -f "$evts" } +test_subflows_v4_v6_mix() +{ + local client_evts + client_evts=$(mktemp) + # Capture events on the network namespace running the client + :>"$client_evts" + ip netns exec "$ns2" ./pm_nl_ctl events >> "$client_evts" 2>&1 & + evts_pid=$! + sleep 0.5 + + # Attempt to add a listener at 10.0.2.1: + ip netns exec "$ns1" ./pm_nl_ctl listen 10.0.2.1\ + $app6_port > /dev/null 2>&1 & + local listener_pid=$! + + # ADD_ADDR4 from server to client machine reusing the subflow port on + # the established v6 connection + :>"$client_evts" + ip netns exec "$ns1" ./pm_nl_ctl ann 10.0.2.1 token "$server6_token" id\ + $server_addr_id dev ns1eth2 > /dev/null 2>&1 + stdbuf -o0 -e0 printf "ADD_ADDR4 id:%d 10.0.2.1 (ns1) => ns2, reuse port\t\t" $server_addr_id + sleep 0.5 + verify_announce_event "$client_evts" "$ANNOUNCED" "$client6_token" "10.0.2.1"\ + "$server_addr_id" "$app6_port" + + # CREATE_SUBFLOW from client to server machine + :>"$client_evts" + ip netns exec "$ns2" ./pm_nl_ctl csf lip 10.0.2.2 lid 23 rip 10.0.2.1 rport\ + $app6_port token "$client6_token" > /dev/null 2>&1 + sleep 0.5 + verify_subflow_events "$client_evts" "$SUB_ESTABLISHED" "$client6_token"\ + "$AF_INET" "10.0.2.2" "10.0.2.1" "$app6_port" "23"\ + "$server_addr_id" "ns2" "ns1" + + # Delete the listener from the server ns, if one was created + kill_wait $listener_pid + + sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") + + # DESTROY_SUBFLOW from client to server machine + :>"$client_evts" + ip netns exec "$ns2" ./pm_nl_ctl dsf lip 10.0.2.2 lport "$sport" rip 10.0.2.1 rport\ + $app6_port token "$client6_token" > /dev/null 2>&1 + sleep 0.5 + verify_subflow_events "$client_evts" "$SUB_CLOSED" "$client6_token" \ + "$AF_INET" "10.0.2.2" "10.0.2.1" "$app6_port" "23"\ + "$server_addr_id" "ns2" "ns1" + + # RM_ADDR from server to client machine + ip netns exec "$ns1" ./pm_nl_ctl rem id $server_addr_id token\ + "$server6_token" > /dev/null 2>&1 + sleep 0.5 + + kill_wait $evts_pid + rm -f "$client_evts" +} + test_prio() { local count @@ -812,6 +869,7 @@ test_announce test_remove test_subflows +test_subflows_v4_v6_mix test_prio exit 0 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/test_vxlan_vnifiltering.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/test_vxlan_vnifiltering.sh @@ -293,19 +293,11 @@ elif [[ -n $vtype && $vtype == "vnifilterg" ]]; then # Add per vni group config with 'bridge vni' api if [ -n "$group" ]; then - if [ "$family" == "v4" ]; then - if [ $mcast -eq 1 ]; then - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group $group - else - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote $group - fi - else - if [ $mcast -eq 1 ]; then - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group6 $group - else - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote6 $group - fi - fi + if [ $mcast -eq 1 ]; then + bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group $group + else + bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote $group + fi fi fi done only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/toeplitz.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/toeplitz.c @@ -215,7 +215,7 @@ } /* A single TPACKET_V3 block can hold multiple frames */ -static void recv_block(struct ring_state *ring) +static bool recv_block(struct ring_state *ring) { struct tpacket_block_desc *block; char *frame; @@ -223,7 +223,7 @@ block = (void *)(ring->mmap + ring->idx * ring_block_sz); if (!(block->hdr.bh1.block_status & TP_STATUS_USER)) - return; + return false; frame = (char *)block; frame += block->hdr.bh1.offset_to_first_pkt; @@ -235,6 +235,8 @@ block->hdr.bh1.block_status = TP_STATUS_KERNEL; ring->idx = (ring->idx + 1) % ring_block_nr; + + return true; } /* simple test: sleep once unconditionally and then process all rings */ @@ -245,7 +247,7 @@ usleep(1000 * cfg_timeout_msec); for (i = 0; i < num_cpus; i++) - recv_block(&rings[i]); + do {} while (recv_block(&rings[i])); fprintf(stderr, "count: pass=%u nohash=%u fail=%u\n", frames_received - frames_nohash - frames_error, @@ -257,12 +259,12 @@ struct tpacket_req3 req3 = {0}; void *ring; - req3.tp_retire_blk_tov = cfg_timeout_msec; + req3.tp_retire_blk_tov = cfg_timeout_msec / 8; req3.tp_feature_req_word = TP_FT_REQ_FILL_RXHASH; req3.tp_frame_size = 2048; req3.tp_frame_nr = 1 << 10; - req3.tp_block_nr = 2; + req3.tp_block_nr = 16; req3.tp_block_size = req3.tp_frame_size * req3.tp_frame_nr; req3.tp_block_size /= req3.tp_block_nr; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/udpgso_bench.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/udpgso_bench.sh @@ -7,6 +7,7 @@ readonly YELLOW='\033[0;33m' readonly RED='\033[0;31m' readonly NC='\033[0m' # No Color +readonly TESTPORT=8000 readonly KSFT_PASS=0 readonly KSFT_FAIL=1 @@ -56,11 +57,26 @@ run_one() { local -r args=$@ + local nr_socks=0 + local i=0 + local -r timeout=10 + + ./udpgso_bench_rx -p "$TESTPORT" & + ./udpgso_bench_rx -p "$TESTPORT" -t & + + # Wait for the above test program to get ready to receive connections. + while [ "$i" -lt "$timeout" ]; do + nr_socks="$(ss -lnHi | grep -c "\*:${TESTPORT}")" + [ "$nr_socks" -eq 2 ] && break + i=$((i + 1)) + sleep 1 + done + if [ "$nr_socks" -ne 2 ]; then + echo "timed out while waiting for udpgso_bench_rx" + exit 1 + fi - ./udpgso_bench_rx & - ./udpgso_bench_rx -t & - - ./udpgso_bench_tx ${args} + ./udpgso_bench_tx -p "$TESTPORT" ${args} } run_in_netns() { only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/udpgso_bench_rx.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/udpgso_bench_rx.c @@ -250,7 +250,7 @@ static void do_flush_udp(int fd) { static char rbuf[ETH_MAX_MTU]; - int ret, len, gso_size, budget = 256; + int ret, len, gso_size = 0, budget = 256; len = cfg_read_all ? sizeof(rbuf) : 0; while (budget--) { @@ -336,6 +336,8 @@ cfg_verify = true; cfg_read_all = true; break; + default: + exit(1); } } only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/net/udpgso_bench_tx.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/net/udpgso_bench_tx.c @@ -62,6 +62,7 @@ static int cfg_port = 8000; static int cfg_runtime_ms = -1; static bool cfg_poll; +static int cfg_poll_loop_timeout_ms = 2000; static bool cfg_segment; static bool cfg_sendmmsg; static bool cfg_tcp; @@ -235,16 +236,17 @@ } } -static void flush_errqueue(int fd, const bool do_poll) +static void flush_errqueue(int fd, const bool do_poll, + unsigned long poll_timeout, const bool poll_err) { if (do_poll) { struct pollfd fds = {0}; int ret; fds.fd = fd; - ret = poll(&fds, 1, 500); + ret = poll(&fds, 1, poll_timeout); if (ret == 0) { - if (cfg_verbose) + if ((cfg_verbose) && (poll_err)) fprintf(stderr, "poll timeout\n"); } else if (ret < 0) { error(1, errno, "poll"); @@ -254,6 +256,20 @@ flush_errqueue_recv(fd); } +static void flush_errqueue_retry(int fd, unsigned long num_sends) +{ + unsigned long tnow, tstop; + bool first_try = true; + + tnow = gettimeofday_ms(); + tstop = tnow + cfg_poll_loop_timeout_ms; + do { + flush_errqueue(fd, true, tstop - tnow, first_try); + first_try = false; + tnow = gettimeofday_ms(); + } while ((stat_zcopies != num_sends) && (tnow < tstop)); +} + static int send_tcp(int fd, char *data) { int ret, done = 0, count = 0; @@ -413,7 +429,8 @@ static void usage(const char *filepath) { - error(1, 0, "Usage: %s [-46acmHPtTuvz] [-C cpu] [-D dst ip] [-l secs] [-M messagenr] [-p port] [-s sendsize] [-S gsosize]", + error(1, 0, "Usage: %s [-46acmHPtTuvz] [-C cpu] [-D dst ip] [-l secs] " + "[-L secs] [-M messagenr] [-p port] [-s sendsize] [-S gsosize]", filepath); } @@ -423,7 +440,7 @@ int max_len, hdrlen; int c; - while ((c = getopt(argc, argv, "46acC:D:Hl:mM:p:s:PS:tTuvz")) != -1) { + while ((c = getopt(argc, argv, "46acC:D:Hl:L:mM:p:s:PS:tTuvz")) != -1) { switch (c) { case '4': if (cfg_family != PF_UNSPEC) @@ -452,6 +469,9 @@ case 'l': cfg_runtime_ms = strtoul(optarg, NULL, 10) * 1000; break; + case 'L': + cfg_poll_loop_timeout_ms = strtoul(optarg, NULL, 10) * 1000; + break; case 'm': cfg_sendmmsg = true; break; @@ -490,6 +510,8 @@ case 'z': cfg_zerocopy = true; break; + default: + exit(1); } } @@ -677,7 +699,7 @@ num_sends += send_udp(fd, buf[i]); num_msgs++; if ((cfg_zerocopy && ((num_msgs & 0xF) == 0)) || cfg_tx_tstamp) - flush_errqueue(fd, cfg_poll); + flush_errqueue(fd, cfg_poll, 500, true); if (cfg_msg_nr && num_msgs >= cfg_msg_nr) break; @@ -696,7 +718,7 @@ } while (!interrupted && (cfg_runtime_ms == -1 || tnow < tstop)); if (cfg_zerocopy || cfg_tx_tstamp) - flush_errqueue(fd, true); + flush_errqueue_retry(fd, num_sends); if (close(fd)) error(1, errno, "close"); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/netfilter/nft_trans_stress.sh +++ linux-oem-6.1-6.1.0/tools/testing/selftests/netfilter/nft_trans_stress.sh @@ -10,12 +10,20 @@ ksft_skip=4 testns=testns-$(mktemp -u "XXXXXXXX") +tmp="" tables="foo bar baz quux" global_ret=0 eret=0 lret=0 +cleanup() { + ip netns pids "$testns" | xargs kill 2>/dev/null + ip netns del "$testns" + + rm -f "$tmp" +} + check_result() { local r=$1 @@ -43,6 +51,7 @@ exit $ksft_skip fi +trap cleanup EXIT tmp=$(mktemp) for table in $tables; do @@ -139,11 +148,4 @@ check_result $lret "add/delete with nftrace enabled" -pkill -9 ping - -wait - -rm -f "$tmp" -ip netns del "$testns" - exit $global_ret only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/netfilter/settings +++ linux-oem-6.1-6.1.0/tools/testing/selftests/netfilter/settings @@ -0,0 +1 @@ +timeout=120 only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/proc/proc-empty-vm.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/proc/proc-empty-vm.c @@ -25,6 +25,7 @@ #undef NDEBUG #include #include +#include #include #include #include @@ -41,7 +42,7 @@ * 1: vsyscall VMA is --xp vsyscall=xonly * 2: vsyscall VMA is r-xp vsyscall=emulate */ -static int g_vsyscall; +static volatile int g_vsyscall; static const char *g_proc_pid_maps_vsyscall; static const char *g_proc_pid_smaps_vsyscall; @@ -147,11 +148,12 @@ g_vsyscall = 0; /* gettimeofday(NULL, NULL); */ + uint64_t rax = 0xffffffffff600000; asm volatile ( - "call %P0" - : - : "i" (0xffffffffff600000), "D" (NULL), "S" (NULL) - : "rax", "rcx", "r11" + "call *%[rax]" + : [rax] "+a" (rax) + : "D" (NULL), "S" (NULL) + : "rcx", "r11" ); g_vsyscall = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/proc/proc-pid-vm.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/proc/proc-pid-vm.c @@ -257,11 +257,12 @@ g_vsyscall = 0; /* gettimeofday(NULL, NULL); */ + uint64_t rax = 0xffffffffff600000; asm volatile ( - "call %P0" - : - : "i" (0xffffffffff600000), "D" (NULL), "S" (NULL) - : "rax", "rcx", "r11" + "call *%[rax]" + : [rax] "+a" (rax) + : "D" (NULL), "S" (NULL) + : "rcx", "r11" ); g_vsyscall = 1; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/testing/selftests/timers/rtcpie.c +++ linux-oem-6.1-6.1.0/tools/testing/selftests/timers/rtcpie.c @@ -111,11 +111,11 @@ timersub(&end, &start, &diff); if (diff.tv_sec > 0 || diff.tv_usec > ((1000000L / tmp) * 1.10)) { - fprintf(stderr, "\nPIE delta error: %ld.%06ld should be close to 0.%06ld\n", + fprintf(stderr, "\nUbuntu Testing Force Pass LP #1814234: PIE delta error: %ld.%06ld should be close to 0.%06ld\n", diff.tv_sec, diff.tv_usec, (1000000L / tmp)); fflush(stdout); - exit(-1); + break; // LP: #1814234 } fprintf(stderr, " %d",i); only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/bug.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/bug.h @@ -1,13 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef BUG_H -#define BUG_H +#ifndef _LINUX_BUG_H +#define _LINUX_BUG_H #include #define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond)) -#define BUILD_BUG_ON(x) - #define BUG() abort() -#endif /* BUG_H */ +#endif /* _LINUX_BUG_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/build_bug.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/build_bug.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_BUILD_BUG_H +#define _LINUX_BUILD_BUG_H + +#define BUILD_BUG_ON(x) + +#endif /* _LINUX_BUILD_BUG_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/cpumask.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/cpumask.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CPUMASK_H +#define _LINUX_CPUMASK_H + +#include + +#endif /* _LINUX_CPUMASK_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/gfp.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/gfp.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_GFP_H +#define __LINUX_GFP_H + +#include + +#endif only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/kernel.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/kernel.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/kmsan.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/kmsan.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_KMSAN_H +#define _LINUX_KMSAN_H + +#include + +inline void kmsan_handle_dma(struct page *page, size_t offset, size_t size, + enum dma_data_direction dir) +{ +} + +#endif /* _LINUX_KMSAN_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/scatterlist.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/scatterlist.h @@ -2,6 +2,7 @@ #ifndef SCATTERLIST_H #define SCATTERLIST_H #include +#include struct scatterlist { unsigned long page_link; only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/linux/topology.h +++ linux-oem-6.1-6.1.0/tools/virtio/linux/topology.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TOPOLOGY_H +#define _LINUX_TOPOLOGY_H + +#include + +#endif /* _LINUX_TOPOLOGY_H */ only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/tools/virtio/vringh_test.c +++ linux-oem-6.1-6.1.0/tools/virtio/vringh_test.c @@ -308,6 +308,7 @@ gvdev.vdev.features = features; INIT_LIST_HEAD(&gvdev.vdev.vqs); + spin_lock_init(&gvdev.vdev.vqs_list_lock); gvdev.to_host_fd = to_host[1]; gvdev.notifies = 0; @@ -455,6 +456,7 @@ getrange = getrange_iov; vdev.features = 0; INIT_LIST_HEAD(&vdev.vqs); + spin_lock_init(&vdev.vqs_list_lock); while (argv[1]) { if (strcmp(argv[1], "--indirect") == 0) only in patch2: unchanged: --- linux-oem-6.1-6.1.0.orig/virt/kvm/vfio.c +++ linux-oem-6.1-6.1.0/virt/kvm/vfio.c @@ -336,7 +336,7 @@ return -ENXIO; } -static void kvm_vfio_destroy(struct kvm_device *dev) +static void kvm_vfio_release(struct kvm_device *dev) { struct kvm_vfio *kv = dev->private; struct kvm_vfio_group *kvg, *tmp; @@ -355,7 +355,7 @@ kvm_vfio_update_coherency(dev); kfree(kv); - kfree(dev); /* alloc by kvm_ioctl_create_device, free by .destroy */ + kfree(dev); /* alloc by kvm_ioctl_create_device, free by .release */ } static int kvm_vfio_create(struct kvm_device *dev, u32 type); @@ -363,7 +363,7 @@ static struct kvm_device_ops kvm_vfio_ops = { .name = "kvm-vfio", .create = kvm_vfio_create, - .destroy = kvm_vfio_destroy, + .release = kvm_vfio_release, .set_attr = kvm_vfio_set_attr, .has_attr = kvm_vfio_has_attr, };